From owner-svn-src-head@freebsd.org Sun Nov 11 00:04:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9967A110FF15; Sun, 11 Nov 2018 00:04:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F5F83216; Sun, 11 Nov 2018 00:04:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E725B21D8; Sun, 11 Nov 2018 00:04:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAB04aYi068149; Sun, 11 Nov 2018 00:04:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAB04aWF068147; Sun, 11 Nov 2018 00:04:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811110004.wAB04aWF068147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 11 Nov 2018 00:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340343 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11F5F83216 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.89), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 00:04:37 -0000 Author: kib Date: Sun Nov 11 00:04:36 2018 New Revision: 340343 URL: https://svnweb.freebsd.org/changeset/base/340343 Log: Allow absolute paths for O_BENEATH. The path must have a tail which does not escape starting/topping directory. The documentation will come shortly, see the man pages commit message for the reason of separate commit. Reviewed by: jilles (previous version) Discussed with: emaste Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17714 Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Nov 10 23:49:01 2018 (r340342) +++ head/sys/kern/vfs_lookup.c Sun Nov 11 00:04:36 2018 (r340343) @@ -177,6 +177,13 @@ nameicap_tracker_add(struct nameidata *ndp, struct vno if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; + if ((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | NI_LCF_BENEATH_LATCHED)) == + NI_LCF_BENEATH_ABS) { + MPASS((ndp->ni_lcf & NI_LCF_LATCH) != 0); + if (dp != ndp->ni_beneath_latch) + return; + ndp->ni_lcf |= NI_LCF_BENEATH_LATCHED; + } nt = uma_zalloc(nt_zone, M_WAITOK); vhold(dp); nt->dp = dp; @@ -184,7 +191,7 @@ nameicap_tracker_add(struct nameidata *ndp, struct vno } static void -nameicap_cleanup(struct nameidata *ndp) +nameicap_cleanup(struct nameidata *ndp, bool clean_latch) { struct nameicap_tracker *nt, *nt1; @@ -195,6 +202,8 @@ nameicap_cleanup(struct nameidata *ndp) vdrop(nt->dp); uma_zfree(nt_zone, nt); } + if (clean_latch && (ndp->ni_lcf & NI_LCF_LATCH) != 0) + vrele(ndp->ni_beneath_latch); } /* @@ -222,6 +231,11 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vn if (dp == nt->dp) return (0); } + if ((ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) { + ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; + nameicap_cleanup(ndp, false); + return (0); + } return (ENOTCAPABLE); } @@ -242,14 +256,18 @@ namei_handle_root(struct nameidata *ndp, struct vnode struct componentname *cnp; cnp = &ndp->ni_cnd; - if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 || - (cnp->cn_flags & BENEATH) != 0) { + if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0) { #ifdef KTRACE if (KTRPOINT(curthread, KTR_CAPFAIL)) ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL); #endif return (ENOTCAPABLE); } + if ((cnp->cn_flags & BENEATH) != 0) { + ndp->ni_lcf |= NI_LCF_BENEATH_ABS; + ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; + nameicap_cleanup(ndp, false); + } while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; ndp->ni_pathlen--; @@ -290,6 +308,7 @@ namei(struct nameidata *ndp) struct thread *td; struct proc *p; cap_rights_t rights; + struct filecaps dirfd_caps; struct uio auio; int error, linklen, startdir_used; @@ -427,6 +446,23 @@ namei(struct nameidata *ndp) if (error == 0 && dp->v_type != VDIR) error = ENOTDIR; } + if (error == 0 && (ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) { + if (ndp->ni_dirfd == AT_FDCWD) { + ndp->ni_beneath_latch = fdp->fd_cdir; + vrefact(ndp->ni_beneath_latch); + } else { + rights = ndp->ni_rightsneeded; + cap_rights_set(&rights, CAP_LOOKUP); + error = fgetvp_rights(td, ndp->ni_dirfd, &rights, + &dirfd_caps, &ndp->ni_beneath_latch); + if (error == 0 && dp->v_type != VDIR) { + vrele(ndp->ni_beneath_latch); + error = ENOTDIR; + } + } + if (error == 0) + ndp->ni_lcf |= NI_LCF_LATCH; + } FILEDESC_SUNLOCK(fdp); if (ndp->ni_startdir != NULL && !startdir_used) vrele(ndp->ni_startdir); @@ -456,9 +492,15 @@ namei(struct nameidata *ndp) namei_cleanup_cnp(cnp); } else cnp->cn_flags |= HASBUF; - nameicap_cleanup(ndp); - SDT_PROBE2(vfs, namei, lookup, return, 0, ndp->ni_vp); - return (0); + if ((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | + NI_LCF_BENEATH_LATCHED)) == NI_LCF_BENEATH_ABS) { + NDFREE(ndp, 0); + error = ENOTCAPABLE; + } + nameicap_cleanup(ndp, true); + SDT_PROBE2(vfs, namei, lookup, return, error, + (error == 0 ? ndp->ni_vp : NULL)); + return (error); } if (ndp->ni_loopcnt++ >= MAXSYMLINKS) { error = ELOOP; @@ -529,8 +571,9 @@ namei(struct nameidata *ndp) vrele(ndp->ni_dvp); out: vrele(ndp->ni_rootdir); + MPASS(error != 0); namei_cleanup_cnp(cnp); - nameicap_cleanup(ndp); + nameicap_cleanup(ndp, true); SDT_PROBE2(vfs, namei, lookup, return, error, NULL); return (error); } Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sat Nov 10 23:49:01 2018 (r340342) +++ head/sys/sys/namei.h Sun Nov 11 00:04:36 2018 (r340343) @@ -100,6 +100,7 @@ struct nameidata { */ struct componentname ni_cnd; struct nameicap_tracker_head ni_cap_tracker; + struct vnode *ni_beneath_latch; }; #ifdef _KERNEL @@ -163,6 +164,9 @@ struct nameidata { */ #define NI_LCF_STRICTRELATIVE 0x0001 /* relative lookup only */ #define NI_LCF_CAP_DOTDOT 0x0002 /* ".." in strictrelative case */ +#define NI_LCF_BENEATH_ABS 0x0004 /* BENEATH with absolute path */ +#define NI_LCF_BENEATH_LATCHED 0x0008 /* BENEATH_ABS traversed starting dir */ +#define NI_LCF_LATCH 0x0010 /* ni_beneath_latch valid */ /* * Initialization of a nameidata structure. From owner-svn-src-head@freebsd.org Sun Nov 11 00:21:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74BB61121558; Sun, 11 Nov 2018 00:21:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0573083B4A; Sun, 11 Nov 2018 00:21:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB49F23F2; Sun, 11 Nov 2018 00:21:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAB0LSww074542; Sun, 11 Nov 2018 00:21:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAB0LS4i074541; Sun, 11 Nov 2018 00:21:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811110021.wAB0LS4i074541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 11 Nov 2018 00:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340344 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0573083B4A X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.89), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 00:21:29 -0000 Author: kib Date: Sun Nov 11 00:21:28 2018 New Revision: 340344 URL: https://svnweb.freebsd.org/changeset/base/340344 Log: Remove one-use variable. This also removes a lot of #ifdefs and cleans up a warning when the AUDIT kernel option is defined, but neither KDTRACE_HOOKS nor MAC are. Reported and tested by: danger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Sun Nov 11 00:04:36 2018 (r340343) +++ head/sys/kern/sysv_shm.c Sun Nov 11 00:21:28 2018 (r340344) @@ -332,9 +332,6 @@ kern_shmdt_locked(struct thread *td, const void *shmad { struct proc *p = td->td_proc; struct shmmap_state *shmmap_s; -#if defined(AUDIT) || defined(MAC) - struct shmid_kernel *shmsegptr; -#endif #ifdef MAC int error; #endif @@ -355,11 +352,9 @@ kern_shmdt_locked(struct thread *td, const void *shmad } if (i == shminfo.shmseg) return (EINVAL); -#if (defined(AUDIT) && defined(KDTRACE_HOOKS)) || defined(MAC) - shmsegptr = &shmsegs[IPCID_TO_IX(shmmap_s->shmid)]; -#endif #ifdef MAC - error = mac_sysvshm_check_shmdt(td->td_ucred, shmsegptr); + error = mac_sysvshm_check_shmdt(td->td_ucred, + &shmsegs[IPCID_TO_IX(shmmap_s->shmid)]); if (error != 0) return (error); #endif From owner-svn-src-head@freebsd.org Sun Nov 11 00:39:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64C831121B98; Sun, 11 Nov 2018 00:39:21 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E62068428E; Sun, 11 Nov 2018 00:39:20 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C859F2700; Sun, 11 Nov 2018 00:39:20 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAB0dKat083975; Sun, 11 Nov 2018 00:39:20 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAB0dKrC083974; Sun, 11 Nov 2018 00:39:20 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811110039.wAB0dKrC083974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sun, 11 Nov 2018 00:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340345 - head/usr.sbin/periodic/etc/daily X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/usr.sbin/periodic/etc/daily X-SVN-Commit-Revision: 340345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E62068428E X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.89), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 00:39:21 -0000 Author: vangyzen Date: Sun Nov 11 00:39:20 2018 New Revision: 340345 URL: https://svnweb.freebsd.org/changeset/base/340345 Log: Fix daily mailq script for Postfix and daily_show_success="NO" Exit with a zero status when Postfix reports "Mail queue is empty" so this section won't appear in the report at all when daily_show_success="NO". MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/periodic/etc/daily/440.status-mailq Modified: head/usr.sbin/periodic/etc/daily/440.status-mailq ============================================================================== --- head/usr.sbin/periodic/etc/daily/440.status-mailq Sun Nov 11 00:21:28 2018 (r340344) +++ head/usr.sbin/periodic/etc/daily/440.status-mailq Sun Nov 11 00:39:20 2018 (r340345) @@ -33,7 +33,7 @@ case "$daily_status_mailq_enable" in *) mailq;; esac | tee /dev/stderr | - egrep -v '(mqueue is empty|Total requests)' | wc -l) + egrep -v '((Mail |m)queue is empty|Total requests)' | wc -l) [ $rc -gt 0 ] && rc=1 || rc=0 case "$daily_status_include_submit_mailq" in From owner-svn-src-head@freebsd.org Sun Nov 11 00:57:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E83C1122228; Sun, 11 Nov 2018 00:57:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF0E084B2E; Sun, 11 Nov 2018 00:57:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE0702A31; Sun, 11 Nov 2018 00:57:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAB0vDLs094270; Sun, 11 Nov 2018 00:57:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAB0vDKa094269; Sun, 11 Nov 2018 00:57:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811110057.wAB0vDKa094269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 11 Nov 2018 00:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340346 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 340346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF0E084B2E X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.89), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 00:57:14 -0000 Author: trasz Date: Sun Nov 11 00:57:13 2018 New Revision: 340346 URL: https://svnweb.freebsd.org/changeset/base/340346 Log: Update nsswitch.conf(5) man page to make it clear additional sources might be provided by third party software. Reviewed by: bcr MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17934 Modified: head/share/man/man5/nsswitch.conf.5 Modified: head/share/man/man5/nsswitch.conf.5 ============================================================================== --- head/share/man/man5/nsswitch.conf.5 Sun Nov 11 00:39:20 2018 (r340345) +++ head/share/man/man5/nsswitch.conf.5 Sun Nov 11 00:57:13 2018 (r340346) @@ -62,7 +62,7 @@ the current source. Each criterion consists of one or more status codes, and actions to take if that status code occurs. .Ss Sources -The following sources are implemented: +The following sources are implemented as part of the base system: .Pp .Bl -tag -width Source -compact .It Sy Source @@ -100,6 +100,8 @@ makes use of the .Xr nscd 8 daemon. .El +.Pp +Additional sources might be provided by third party software. .Ss Databases The following databases are used by the following C library functions: .Pp From owner-svn-src-head@freebsd.org Sun Nov 11 01:07:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B4F211226F0; Sun, 11 Nov 2018 01:07:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 9B544850C3; Sun, 11 Nov 2018 01:07:40 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAB17cji018294; Sat, 10 Nov 2018 17:07:38 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAB17cA2018293; Sat, 10 Nov 2018 17:07:38 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811110107.wAB17cA2018293@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340326 - head In-Reply-To: To: Ben Woods Date: Sat, 10 Nov 2018 17:07:38 -0800 (PST) CC: rgrimes@freebsd.org, Ben Woods , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 9B544850C3 X-Spamd-Result: default: False [1.79 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.52)[0.520,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.05)[0.053,0]; NEURAL_SPAM_MEDIUM(0.34)[0.344,0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 01:07:41 -0000 [ Charset UTF-8 unsupported, converting... ] > On Sun, 11 Nov 2018 at 2:43 am, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > If your going to bother with a differential, and invite people to > > it you should give them at least 24 hours, and preferably 72 hours > > to respond to the new review. Reviews that last < 4 hours are not > > code reviews. > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > Hi Rod, > > Sorry. The main reason I submitted the code review is because I do not have > my src commit bit, so needed to seek approval to commit. All the more reason for it to wait until the people you *invited* to the review to have a chance to respond. I do not believe an "accept" in a review is an "approve to commit beyond your normal scope". Was cem aware that he was "approving a non src committer to commit this change to the src tree" as your review has no mention that you are seeking src bit approval to commit there. > > I felt the need to commit the UPDATING entry was time sensitive, given the > change it was notifying users of had already been committed. > > Regards, > Ben > -- -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Nov 11 01:08:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9198511227B2; Sun, 11 Nov 2018 01:08:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 E37098523E; Sun, 11 Nov 2018 01:08:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAB18kvQ018310; Sat, 10 Nov 2018 17:08:46 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAB18kmP018309; Sat, 10 Nov 2018 17:08:46 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811110108.wAB18kmP018309@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340342 - head/share/man/man4 In-Reply-To: <201811102349.wAANn1HR058065@repo.freebsd.org> To: Edward Tomasz Napierala Date: Sat, 10 Nov 2018 17:08:46 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: E37098523E X-Spamd-Result: default: False [2.01 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.52)[0.522,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; NEURAL_SPAM_SHORT(0.62)[0.616,0]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.00)[0.001,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 01:08:48 -0000 > Author: trasz > Date: Sat Nov 10 23:49:01 2018 > New Revision: 340342 > URL: https://svnweb.freebsd.org/changeset/base/340342 > > Log: > Random tweaks to ddb(4) manual page. I certainly hope we are not randomly commiting bits to man pages. This is a 0 value commit message. > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/share/man/man4/ddb.4 > > Modified: head/share/man/man4/ddb.4 > ============================================================================== > --- head/share/man/man4/ddb.4 Sat Nov 10 23:43:03 2018 (r340341) > +++ head/share/man/man4/ddb.4 Sat Nov 10 23:49:01 2018 (r340342) > @@ -60,7 +60,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd September 21, 2018 > +.Dd November 10, 2018 > .Dt DDB 4 > .Os > .Sh NAME > @@ -108,7 +108,9 @@ If linked into the running kernel, > it can be invoked locally with the > .Ql debug > .Xr keymap 5 > -action. > +action, or by setting setting the > +.Dv debug.kdb.enter > +sysctl to 1. > The debugger is also invoked on kernel > .Xr panic 9 > if the > @@ -261,9 +263,9 @@ Non-printing characters are displayed as octal escapes > display in unsigned hex with character dump at the end of each line. > The location is also displayed in hex at the beginning of each line. > .It Cm i > -display as an instruction > +display as a disassembled instruction > .It Cm I > -display as an instruction with possible alternate formats depending on the > +display as an disassembled instruction with possible alternate formats depending on the > machine. > On i386, this selects the alternate format for the instruction decoding > (16 bits in a 32-bit code segment and vice versa). > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Nov 11 01:34:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82A14112396E; Sun, 11 Nov 2018 01:34:18 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 18113864C7; Sun, 11 Nov 2018 01:34:16 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 5c0a7e94; Sun, 11 Nov 2018 02:34:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=ieEzJKXThWX06C1EJqmnBf1UkHE=; b=oPXZsE+Uz9xZbREMnMzEI2IzTZTr s2cUFN7nAbSPVsRYq3dOOZdwxEThUKjUzVT3Xsy5iTUjP1fkhIN7w9MB4ZInHC+z a+sN6DW9b9D1mrWC8X1YXmoWZ9xS9oxGr6Iwiqm5AiQt41aMimaekx1XbZQUZOXO pyD/D1Ne0Jyfygo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=o/g9tRJT7tL7FvuL4m6R8hzRliw60wCxcDUYqnqqWP/t2vQ06bt9hXea D/cYfzb8gQI8S+cU1wbCSLeVCq23If3VHxjkRraEVL+AhX7OuKY0GZnW/tUC8EqK zkFPlV+aD+oKLd5Z6g+EQQSZoqkqx32Yb+fM4QvNk/07hFYCicA= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 9edafea9 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sun, 11 Nov 2018 02:34:14 +0100 (CET) Date: Sun, 11 Nov 2018 02:34:14 +0100 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Ben Woods , Ben Woods , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340326 - head Message-Id: <20181111023414.8431fcfee7fee7e553c020f7@bidouilliste.com> In-Reply-To: <201811110107.wAB17cA2018293@pdx.rh.CN85.dnsmgr.net> References: <201811110107.wAB17cA2018293@pdx.rh.CN85.dnsmgr.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 18113864C7 X-Spamd-Result: default: False [-2.42 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com]; NEURAL_HAM_MEDIUM(-0.94)[-0.942,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bidouilliste.com]; NEURAL_HAM_LONG(-0.98)[-0.978,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mx-backup.blih.net]; DKIM_TRACE(0.00)[bidouilliste.com:+]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-0.52)[-0.519,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-0.07)[asn: 12876(-0.34), country: FR(-0.02)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 01:34:18 -0000 On Sat, 10 Nov 2018 17:07:38 -0800 (PST) "Rodney W. Grimes" wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Sun, 11 Nov 2018 at 2:43 am, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > If your going to bother with a differential, and invite people to > > > it you should give them at least 24 hours, and preferably 72 hours > > > to respond to the new review. Reviews that last < 4 hours are not > > > code reviews. > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > Hi Rod, > > > > Sorry. The main reason I submitted the code review is because I do not have > > my src commit bit, so needed to seek approval to commit. > > All the more reason for it to wait until the people you *invited* to > the review to have a chance to respond. I don't see a problem, Ben was the one commiting r340318 and this review is just about documenting this in UPDATING. > I do not believe an "accept" in a review is an "approve to commit > beyond your normal scope". It is, see below. > Was cem aware that he was "approving a non src committer to commit > this change to the src tree" as your review has no mention that you > are seeking src bit approval to commit there. It doesn't matter, we have an implicit rule (feel free to formalized it) that if a N repo commiter accept your patch/review you are free to commit to the N repo. > > > > I felt the need to commit the UPDATING entry was time sensitive, given the > > change it was notifying users of had already been committed. > > > > Regards, > > Ben > > -- > > -- > Rod Grimes rgrimes@freebsd.org -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Sun Nov 11 01:38:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CD8D1123AFB; Sun, 11 Nov 2018 01:38:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65553866A4; Sun, 11 Nov 2018 01:38:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x736.google.com with SMTP id n12so8057967qkh.11; Sat, 10 Nov 2018 17:38:22 -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:user-agent; bh=0DHYq7c6MzEeM6ko1rL2O954W7veREs1fW1ponIzbeg=; b=Qpp6tIubp44gmDkFRCJo6wvO0eI6hWXEwOSsRfmd1ul6uhd+ZGjLvU6YEF6XCKBTJ9 M4S7qTOS8R/4+0yUQqErAhjkqec239gotI8y/r53kRQehnDAkot/RoYcaDmoZrItRBcv aZqgAk74dsJYmrZinWuV3J/4TLi8fZf82JAONx/0pGUMantATPAemCx06+lqQ2OzBJz4 CINY6ahaa8t4FN0OsH88PYMw4QMqOHzVo1T/4SvgA156Zw7M/5315SScQNWPHYYaJOsa VoC9+5d8qYRYTLcjtsQjJAvM985erbnAc6yBnJ0K4InCnni5t9eqMHigT6ugv5IBNKhu 8oaQ== 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:user-agent; bh=0DHYq7c6MzEeM6ko1rL2O954W7veREs1fW1ponIzbeg=; b=Lvya6rLViqOOA/U9iEQ68wdBToeUIeq2y+s7YMhkAL463Au/sbcZeNO5ywWI3FwjiO nrC3ZucvqxVGQSdIbWrGacVAdUyFkjZY6EUOUcfkyaz3SYzsA4tEG+MYzQXFL7ZDk6J+ Uov0JUjzP0GHC/r8rwDffA7jzih+ZJDdhppjBPcfTkhIqncOuM3CKckQLaZ/8rRq2q5V lY3SkXY+pH8SzF72GTusAG8YFqXrwv0v+xOuXctD4uzgYvMgNqL3bNJyBUzYhKBwgl6j xTShwrSUyHIe/RRFVU03AvBodp5t18olqgzjkkEAOxAwD+ly9XvN7BzQZ/owGYPwwq75 aZcQ== X-Gm-Message-State: AGRZ1gIf60LtqnaCG1C3pmkCLUuFI6wm8EXB7/HqZOW09vJ54WZ3UOZF 6Laig3UlFxkRlCEnlRRTSX0/O5y0 X-Google-Smtp-Source: AJdET5d3qzn8rDuwZFIRoGLl2AS+YknGeJssElJ/GSTF//a1qTBHxfptAUm7VNG7xyENPpnmMB4OtA== X-Received: by 2002:ac8:5509:: with SMTP id j9mr13589579qtq.287.1541900301619; Sat, 10 Nov 2018 17:38:21 -0800 (PST) Received: from spy (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id t43sm8892155qtc.53.2018.11.10.17.38.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 17:38:21 -0800 (PST) Sender: Mark Johnston Date: Sat, 10 Nov 2018 20:38:16 -0500 From: Mark Johnston To: rgrimes@freebsd.org Cc: Ben Woods , Ben Woods , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340326 - head Message-ID: <20181111013816.GA2880@spy> References: <201811110107.wAB17cA2018293@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811110107.wAB17cA2018293@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 65553866A4 X-Spamd-Result: default: False [-3.64 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[6.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; IP_SCORE(-0.98)[ipnet: 2607:f8b0::/32(-2.89), asn: 15169(-1.92), country: US(-0.09)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; FREEMAIL_CC(0.00)[gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 01:38:23 -0000 On Sat, Nov 10, 2018 at 05:07:38PM -0800, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Sun, 11 Nov 2018 at 2:43 am, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > If your going to bother with a differential, and invite people to > > > it you should give them at least 24 hours, and preferably 72 hours > > > to respond to the new review. Reviews that last < 4 hours are not > > > code reviews. > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > Hi Rod, > > > > Sorry. The main reason I submitted the code review is because I do not have > > my src commit bit, so needed to seek approval to commit. > > All the more reason for it to wait until the people you *invited* to > the review to have a chance to respond. > > I do not believe an "accept" in a review is an "approve to commit > beyond your normal scope". I think that's being pedantic. UPDATING is an English text file, no special qualification is needed to add an entry. Ben waited for two months before committing r340318; I'm sure he appreciates the need to give reviewers time to review anything controversial. > Was cem aware that he was "approving a non src committer to commit > this change to the src tree" as your review has no mention that you > are seeking src bit approval to commit there. I doubt he worried too much about the distinction. If a committer clicks "accept," it means, "the change looks good to me." Does it matter how it gets committed, at least in this trivial case? > > I felt the need to commit the UPDATING entry was time sensitive, given the > > change it was notifying users of had already been committed. That makes perfect sense to me. From owner-svn-src-head@freebsd.org Sun Nov 11 01:46:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A7701123E65; Sun, 11 Nov 2018 01:46:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A6B786B25; Sun, 11 Nov 2018 01:46:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B582328B; Sun, 11 Nov 2018 01:46:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAB1koo6019616; Sun, 11 Nov 2018 01:46:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAB1kmGE019607; Sun, 11 Nov 2018 01:46:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811110146.wAB1kmGE019607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 11 Nov 2018 01:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340347 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 340347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A6B786B25 X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.89), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 01:46:51 -0000 Author: kib Date: Sun Nov 11 01:46:48 2018 New Revision: 340347 URL: https://svnweb.freebsd.org/changeset/base/340347 Log: First draft of documentation for AT/O_BENEATH handling of the absolute paths. It was decided that committing the code and drafting of the man page update is better than allowing the code to rot until wordsmithing happens. Reviewed by: jilles (previous version) Discussed with: brooks, jilles, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17714 Modified: head/lib/libc/sys/access.2 head/lib/libc/sys/chflags.2 head/lib/libc/sys/chmod.2 head/lib/libc/sys/chown.2 head/lib/libc/sys/link.2 head/lib/libc/sys/open.2 head/lib/libc/sys/stat.2 head/lib/libc/sys/unlink.2 head/lib/libc/sys/utimensat.2 Modified: head/lib/libc/sys/access.2 ============================================================================== --- head/lib/libc/sys/access.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/access.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd November 11, 2018 .Dt ACCESS 2 .Os .Sh NAME @@ -121,7 +121,12 @@ The checks for accessibility are performed using the e IDs instead of the real user and group ID as required in a call to .Fn access . .It Dv AT_BENEATH -Only operate on files and directories below the starting directory. +Only operate on files and directories below the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp Even if a process's real or effective user has appropriate privileges @@ -198,14 +203,23 @@ is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. .It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE The .Dv AT_BENEATH -flag was specified but +flag was provided to +.Fn faccessat , +and the absolute .Fa path -is not strictly relative to the starting directory. -For example, +does not have its tail fully contained under the topping directory, +or the relative .Fa path -is absolute or includes a ".." component that escapes the starting directory. +escapes it. .El .Sh SEE ALSO .Xr chmod 2 , Modified: head/lib/libc/sys/chflags.2 ============================================================================== --- head/lib/libc/sys/chflags.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/chflags.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd November 11, 2018 .Dt CHFLAGS 2 .Os .Sh NAME @@ -96,7 +96,12 @@ If names a symbolic link, then the flags of the symbolic link are changed. .It Dv AT_BENEATH Only allow to change flags for a file which is beneath of -the starting directory. +the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -306,14 +311,23 @@ The underlying file system does not support file flags does not support all of the flags set in .Fa flags . .It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE The .Dv AT_BENEATH -flag was specified but +flag was provided to +.Fn chflagsat , +and the absolute .Fa path -is not strictly relative to the starting directory. -For example, +does not have its tail fully contained under the topping directory, +or the relative .Fa path -is absolute or includes a ".." component that escapes the starting directory. +escapes it. .El .Sh SEE ALSO .Xr chflags 1 , Modified: head/lib/libc/sys/chmod.2 ============================================================================== --- head/lib/libc/sys/chmod.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/chmod.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd November 11, 2018 .Dt CHMOD 2 .Os .Sh NAME @@ -103,7 +103,12 @@ If names a symbolic link, then the mode of the symbolic link is changed. .It Dv AT_BENEATH Only allow to change permissions of a file which is beneath of -the starting directory. +the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -289,14 +294,23 @@ is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. .It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE The .Dv AT_BENEATH -flag was specified but +flag was provided to +.Fn fchmodat , +and the absolute .Fa path -is not strictly relative to the starting directory. -For example, +does not have its tail fully contained under the topping directory, +or the relative .Fa path -is absolute or includes a ".." component that escapes the starting directory. +escapes it. .El .Sh SEE ALSO .Xr chmod 1 , Modified: head/lib/libc/sys/chown.2 ============================================================================== --- head/lib/libc/sys/chown.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/chown.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd Octover 20, 2018 +.Dd November 11, 2018 .Dt CHOWN 2 .Os .Sh NAME @@ -120,7 +120,12 @@ If names a symbolic link, ownership of the symbolic link is changed. .It Dv AT_BENEATH Only allow to change ownership of a file which is beneath of -the starting directory. +the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -231,14 +236,23 @@ is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. .It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE The .Dv AT_BENEATH -flag was specified but +flag was provided to +.Fn fchownat , +and the absolute .Fa path -is not strictly relative to the starting directory. -For example, +does not have its tail fully contained under the topping directory, +or the relative .Fa path -is absolute or includes a ".." component that escapes the starting directory. +escapes it. .El .Sh SEE ALSO .Xr chgrp 1 , Modified: head/lib/libc/sys/link.2 ============================================================================== --- head/lib/libc/sys/link.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/link.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd November 11, 2018 .Dt LINK 2 .Os .Sh NAME @@ -116,7 +116,12 @@ If names a symbolic link, a new link for the target of the symbolic link is created. .It Dv AT_BENEATH -Only allow to link to a file which is beneath of the starting directory. +Only allow to link to a file which is beneath of the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -260,16 +265,25 @@ respectively, is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. .It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was specified but .Fa name1 is not strictly relative to the starting directory. For example, .Fa name1 -is absolute or includes a ".." component that escapes the starting directory. +is absolute or includes a ".." component that escapes +the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The .Dv AT_BENEATH -flag was specified. +flag was provided to +.Fa linkat +and the absolute path +.Fa name1 +does not have its tail fully contained under the topping directory, +or the relative path +.Fa name1 +escapes it. .El .Sh SEE ALSO .Xr chflags 2 , Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/open.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd November 11, 2018 .Dt OPEN 2 .Os .Sh NAME @@ -75,8 +75,14 @@ function is equivalent to the .Fn open function except in the case where the .Fa path -specifies a relative path. -In this case the file to be opened is determined relative to the directory +specifies a relative path, or the +.Dv O_BENEATH +flag is provided. +For +.Fn openat +and relative +.Fa path , +the file to be opened is determined relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. @@ -95,6 +101,26 @@ parameter, the current working directory is used and the behavior is identical to a call to .Fn open . .Pp +When +.Fn openat +is called with an absolute +.Fa path +without the +.Dv O_BENEATH +flag, it ignores the +.Fa fd +argument. +When +.Dv O_BENEATH +is specified with an absolute +.Fa path , +a directory passed by the +.Fa fd +argument is used as the topping point for the resolution. +See the definition of the +.Dv O_BENEATH +flag below. +.Pp In .Xr capsicum 4 capability mode, @@ -109,14 +135,28 @@ must be strictly relative to a file descriptor as defined in .Pa sys/kern/vfs_lookup.c . .Fa path -must not be an absolute path and must not contain ".." components. +must not be an absolute path and must not contain ".." components +which cause the path resolution to escape the directory hierarchy +starting at +.Fa fd . Additionally, no symbolic link in .Fa path -may contain ".." components either. +may target absolute path or contain escaping ".." components. .Fa fd must not be .Dv AT_FDCWD . .Pp +If the +.Dv vfs.lookup_cap_dotdot +.Xr sysctl 3 +MIB is set to zero, ".." components in the paths, +used in capability mode, or with the +.Dv O_BENEATH +flag, are completely disabled. +If the +.Dv vfs.lookup_cap_dotdot_nonlocal +MIB is set to zero, ".." is not allowed if found on non-local filesystem. +.Pp The flags specified are formed by .Em or Ns 'ing the following values @@ -142,7 +182,7 @@ O_TTY_INIT ignored O_DIRECTORY error if file is not a directory O_CLOEXEC set FD_CLOEXEC upon open O_VERIFY verify the contents of the file -O_BENEATH require path to be strictly relative to starting directory +O_BENEATH require path to be strictly relative to topping directory .Ed .Pp Opening a file with @@ -273,19 +313,21 @@ been verified before operating on them. .Dv O_BENEATH returns .Er ENOTCAPABLE -if the specified path, after resolving all symlinks and ".." references -in it, does not reside in the directory hierarchy of children beneath -the starting directory, or is an absolute path. -Starting directory is the process current directory if relative +if the specified relative path, after resolving all symlinks and ".." +references, does not reside in the directory hierarchy of +children beneath the topping directory. +Topping directory is the process current directory if relative .Fa path is used for .Fn open , and the directory referenced by the .Fa fd -argument when specifying relative -.Fa path -for +argument when using .Fn openat . +If the specified path is absolute, +.Dv O_BENEATH +allows arbitrary prefix that ends up at the topping directory, +after which all further resolved components must be under it. .Pp If successful, .Fn open @@ -509,9 +551,16 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode or the +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The .Dv O_BENEATH -flag was provided. +flag was provided, and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. .El .Sh SEE ALSO .Xr chmod 2 , Modified: head/lib/libc/sys/stat.2 ============================================================================== --- head/lib/libc/sys/stat.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/stat.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd November 11, 2018 .Dt STAT 2 .Os .Sh NAME @@ -84,11 +84,24 @@ and .Fn lstat except when the .Fa path -specifies a relative path. -In this case the status is retrieved from a file relative to +specifies a relative path, or the +.Dv AT_BENEATH +flag is provided. +For +.Fn fstatat +and relative +.Fa path , +the status is retrieved from a file relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. +For +.Dv AT_BENEATH +and absolute +.Fa path , +the status is retrieved from a file specified by the +.Fa path , +but additional permission checks are performed, see below. .Pp The values for the .Fa flag @@ -101,7 +114,7 @@ If .Fa path names a symbolic link, the status of the symbolic link is returned. .It Dv AT_BENEATH -Only stat files and directories below the starting directory. +Only stat files and directories below the topping directory. See the description of the .Dv O_BENEATH flag in the @@ -125,6 +138,23 @@ respectively, depending on whether or not the bit is set in .Fa flag . .Pp +When +.Fn fstatat +is called with an absolute +.Fa path +without the +.Dv AT_BENEATH +flag, it ignores the +.Fa fd +argument. +When +.Dv AT_BENEATH +is specified with an absolute +.Fa path , +a directory passed by the +.Fa fd +argument is used as the topping point for the resolution. +.Pp The .Fa sb argument is a pointer to a @@ -405,14 +435,23 @@ is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. .It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE The .Dv AT_BENEATH -flag was specified but +flag was provided to +.Fn fstatat , +and the absolute .Fa path -is not strictly relative to the starting directory. -For example, +does not have its tail fully contained under the topping directory, +or the relative .Fa path -is absolute or includes a ".." component that escapes the starting directory. +escapes it. .El .Sh SEE ALSO .Xr access 2 , Modified: head/lib/libc/sys/unlink.2 ============================================================================== --- head/lib/libc/sys/unlink.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/unlink.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd November 11, 2018 .Dt UNLINK 2 .Os .Sh NAME @@ -90,8 +90,13 @@ and .Fa path as a directory, not a normal file. .It Dv AT_BENEATH -Only unlink files and directories which are beneath of the starting +Only unlink files and directories which are beneath of the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -204,14 +209,23 @@ is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. .It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE The .Dv AT_BENEATH -flag was specified but +flag was provided to +.Fn unlinkat , +and the absolute .Fa path -is not strictly relative to the starting directory. -For example, +does not have its tail fully contained under the topping directory, +or the relative .Fa path -is absolute or includes a ".." component that escapes the starting directory. +escapes it. .El .Sh SEE ALSO .Xr chflags 2 , Modified: head/lib/libc/sys/utimensat.2 ============================================================================== --- head/lib/libc/sys/utimensat.2 Sun Nov 11 00:57:13 2018 (r340346) +++ head/lib/libc/sys/utimensat.2 Sun Nov 11 01:46:48 2018 (r340347) @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd November 11, 2018 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -148,7 +148,12 @@ By default, changes the times of the file referenced by the symbolic link. .It Dv AT_BENEATH Only allow to change the times of a file which is beneath of -the starting directory. +the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. .El .Sh RETURN VALUES .Rv -std @@ -271,14 +276,23 @@ is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. .It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE The .Dv AT_BENEATH -flag was specified but +flag was provided to +.Fn utimensat , +and the absolute .Fa path -is not strictly relative to the starting directory. -For example, +does not have its tail fully contained under the topping directory, +or the relative .Fa path -is absolute or includes a ".." component that escapes the starting directory. +escapes it. .El .Sh SEE ALSO .Xr chflags 2 , From owner-svn-src-head@freebsd.org Sun Nov 11 01:54:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D0DC1124179 for ; Sun, 11 Nov 2018 01:54:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x134.google.com (mail-it1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6967A86FCF for ; Sun, 11 Nov 2018 01:54:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x134.google.com with SMTP id e11so8724502itl.5 for ; Sat, 10 Nov 2018 17:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ncpCrFoz0B0kOHx4sGUM25TpXD4btg3ccQawQtBRDQw=; b=RbihWSqjMvF4dtznEMLWyWXACir5WAhiwEEW7zIKQxNpvNN9R2wWAoOd+Co8mYSh+I euEKH3earMZiZKgGZn0i6aiyvqHW8WvP6kRYZ9D723kHhg31HQEfhzgKyl42loTvbLZf I3yEcoxciH5F/er0IRcshNxiK/AitJzHTdshgeQlWHqi5laT0Fv6WH5xvJnDIn27FiEr IfB3UiJJTENf6feWj/fwg3Ux3ykOE3wC2DWeTx9KjdBJrx2JhcIgLeK0t7qtKDjMpAgf Pen/jF5ipKfFRX/S9/DOHCda3UgPbyUcOH/7ikk1SZhcGYm5v9B/WZvRJVDpV1XwvoTq KQOA== 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=ncpCrFoz0B0kOHx4sGUM25TpXD4btg3ccQawQtBRDQw=; b=ifpwvYeIda7KYFzvnS1zD/zKHQvyQpwv4VLofW7V0jHxWRA2bmEq84kogIlY/N3FEm fBCVM2Ga21nImpXS6LHhyVsEXKDfT8rV5rxi5Unt5aEsSuaYyfi5iTxSmvfvz7cSiYuF 4NHkQhX7MeUwxpj8GiFWfTCNr27SPgtxjxHwLVleNoWismzoVdMYl5vewcCCZPy8fAdR sLMew+3e9AWbE0tkFWZMwUbm5OSsHTs0T9HYhvW2pR+K4lGJwSs/JkjgooJChRUf2j8y cCuXUwV6I4gJUOpNytk73ldY7tNz2FMiQkaiH+6A7EMSEuFEiBEuE5F2f961pGjZEJ2j /Tpg== X-Gm-Message-State: AGRZ1gI3/BMc6NzdTP9leKC//VB3EhHiz4OK76XWP2oqGd4jq/um/FzO S7WQCnKwjQN8hrWH2GmHx6enoLhu9cHkMiuVulU3cg== X-Google-Smtp-Source: AJdET5ci5bLNHGtv5PGDlyb7YggKOJNmDgKHmFJ4J0YoKgSAz8dppYdQ+olR+8ogpWH5HnLN5x06qn32ON9EBTI6phM= X-Received: by 2002:a24:eb0b:: with SMTP id h11-v6mr7207620itj.47.1541901282389; Sat, 10 Nov 2018 17:54:42 -0800 (PST) MIME-Version: 1.0 References: <201811110107.wAB17cA2018293@pdx.rh.CN85.dnsmgr.net> <20181111013816.GA2880@spy> In-Reply-To: <20181111013816.GA2880@spy> From: Warner Losh Date: Sat, 10 Nov 2018 18:54:30 -0700 Message-ID: Subject: Re: svn commit: r340326 - head To: Mark Johnston Cc: "Rodney W. Grimes" , Ben Woods , Ben Woods , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 6967A86FCF X-Spamd-Result: default: False [-3.93 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ALT1.aspmx.l.google.com,aspmx.l.google.com,ALT2.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[4.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.98)[ipnet: 2607:f8b0::/32(-2.88), asn: 15169(-1.92), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 01:54:44 -0000 On Sat, Nov 10, 2018, 6:38 PM Mark Johnston On Sat, Nov 10, 2018 at 05:07:38PM -0800, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > > On Sun, 11 Nov 2018 at 2:43 am, Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > If your going to bother with a differential, and invite people to > > > > it you should give them at least 24 hours, and preferably 72 hours > > > > to respond to the new review. Reviews that last < 4 hours are not > > > > code reviews. > > > > > > > > -- > > > > Rod Grimes > > > > rgrimes@freebsd.org > > > > > > > Hi Rod, > > > > > > Sorry. The main reason I submitted the code review is because I do not > have > > > my src commit bit, so needed to seek approval to commit. > > > > All the more reason for it to wait until the people you *invited* to > > the review to have a chance to respond. > > > > I do not believe an "accept" in a review is an "approve to commit > > beyond your normal scope". > > I think that's being pedantic. UPDATING is an English text file, no > special qualification is needed to add an entry. Ben waited for two > months before committing r340318; I'm sure he appreciates the need to > give reviewers time to review anything controversial. > > > Was cem aware that he was "approving a non src committer to commit > > this change to the src tree" as your review has no mention that you > > are seeking src bit approval to commit there. > > I doubt he worried too much about the distinction. If a committer > clicks "accept," it means, "the change looks good to me." Does it > matter how it gets committed, at least in this trivial case? > > > > I felt the need to commit the UPDATING entry was time sensitive, given > the > > > change it was notifying users of had already been committed. > > That makes perfect sense to me. > As the nominal owner of UPDATING, this is exactly what I invented for: to update users of time critical information. If there are improvements to the language, they can be made. Churn causes very little trouble for this file. Warner > From owner-svn-src-head@freebsd.org Sun Nov 11 13:41:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB5191105674; Sun, 11 Nov 2018 13:41:34 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16BF1815AC; Sun, 11 Nov 2018 13:41:34 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBE7D12E8B; Sun, 11 Nov 2018 13:41:33 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wABDfXTG088951; Sun, 11 Nov 2018 13:41:33 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wABDfXkl088945; Sun, 11 Nov 2018 13:41:33 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811111341.wABDfXkl088945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sun, 11 Nov 2018 13:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340354 - head/share/timedef X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/share/timedef X-SVN-Commit-Revision: 340354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16BF1815AC X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 13:41:35 -0000 Author: yuripv Date: Sun Nov 11 13:41:32 2018 New Revision: 340354 URL: https://svnweb.freebsd.org/changeset/base/340354 Log: Use blank am_pm and t_fmt_ampm for de_AT and de_DE locales as apparently they use 24-hour clock notation. The visible change is that w(1) now uses 24-hour clock format as it checks for t_fmt_ampm presence. PR: 231771 Submitted by: Christoph Schönweiler Reviewed by: bapt Approved by: kib (mentor, implicit) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D17945 Modified: head/share/timedef/de_AT.ISO8859-15.src head/share/timedef/de_AT.UTF-8.src head/share/timedef/de_DE.ISO8859-15.src head/share/timedef/de_DE.UTF-8.src Modified: head/share/timedef/de_AT.ISO8859-15.src ============================================================================== --- head/share/timedef/de_AT.ISO8859-15.src Sun Nov 11 12:35:30 2018 (r340353) +++ head/share/timedef/de_AT.ISO8859-15.src Sun Nov 11 13:41:32 2018 (r340354) @@ -1,7 +1,3 @@ -# Warning: Do not edit. This file is automatically generated from the -# tools in /usr/src/tools/tools/locale. The data is obtained from the -# CLDR project, obtained from http://cldr.unicode.org/ -# ----------------------------------------------------------------------------- # # Short month names Jän. @@ -59,8 +55,8 @@ Samstag %a %e %b %X %Y # # AM/PM -vorm. -nachm. + + # # date_fmt %a %e %b %Y %X %Z @@ -83,5 +79,5 @@ Dezember dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/de_AT.UTF-8.src ============================================================================== --- head/share/timedef/de_AT.UTF-8.src Sun Nov 11 12:35:30 2018 (r340353) +++ head/share/timedef/de_AT.UTF-8.src Sun Nov 11 13:41:32 2018 (r340354) @@ -1,7 +1,3 @@ -# Warning: Do not edit. This file is automatically generated from the -# tools in /usr/src/tools/tools/locale. The data is obtained from the -# CLDR project, obtained from http://cldr.unicode.org/ -# ----------------------------------------------------------------------------- # # Short month names Jän. @@ -59,8 +55,8 @@ Samstag %a %e %b %X %Y # # AM/PM -vorm. -nachm. + + # # date_fmt %a %e %b %Y %X %Z @@ -83,5 +79,5 @@ Dezember dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/de_DE.ISO8859-15.src ============================================================================== --- head/share/timedef/de_DE.ISO8859-15.src Sun Nov 11 12:35:30 2018 (r340353) +++ head/share/timedef/de_DE.ISO8859-15.src Sun Nov 11 13:41:32 2018 (r340354) @@ -1,7 +1,3 @@ -# Warning: Do not edit. This file is automatically generated from the -# tools in /usr/src/tools/tools/locale. The data is obtained from the -# CLDR project, obtained from http://cldr.unicode.org/ -# ----------------------------------------------------------------------------- # # Short month names Jan. @@ -59,8 +55,8 @@ Samstag %a %e %b %X %Y # # AM/PM -vorm. -nachm. + + # # date_fmt %a %e %b %Y %X %Z @@ -83,5 +79,5 @@ Dezember dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/de_DE.UTF-8.src ============================================================================== --- head/share/timedef/de_DE.UTF-8.src Sun Nov 11 12:35:30 2018 (r340353) +++ head/share/timedef/de_DE.UTF-8.src Sun Nov 11 13:41:32 2018 (r340354) @@ -1,7 +1,3 @@ -# Warning: Do not edit. This file is automatically generated from the -# tools in /usr/src/tools/tools/locale. The data is obtained from the -# CLDR project, obtained from http://cldr.unicode.org/ -# ----------------------------------------------------------------------------- # # Short month names Jan. @@ -59,8 +55,8 @@ Samstag %a %e %b %X %Y # # AM/PM -vorm. -nachm. + + # # date_fmt %a %e %b %Y %X %Z @@ -83,5 +79,5 @@ Dezember dm # # ampm_fmt -%I:%M:%S %p + # EOF From owner-svn-src-head@freebsd.org Sun Nov 11 19:15:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A946D110FFF3; Sun, 11 Nov 2018 19:15:24 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9A5469A6B; Sun, 11 Nov 2018 19:15:23 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x336.google.com with SMTP id 124-v6so6495469wmw.0; Sun, 11 Nov 2018 11:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=t2mDQy3wL7qKFF+qeRITTDNEofTpNdHlmGBaXEqCL5o=; b=jcAw8Sm7ApELEJWtIbajjKyKip7Ck7AwJZrNQWKTZ7VB3e7MJkPEdUzVD+iyrWacN8 s2jVWKrQO2eWW6djgYCbTtZMjJcy3OgWNcwd1W4dTeO+NHpRiW3Q91z+2/lVU/gWKVtd JOE7jpUi21Hv2bmgnF4VTMK37LRb5yvoPihTqqGRxwzlii8fKeM4PXr2vIGbv/YZc8ls b/j6VqlTRQ/2XptFyaCOtFfOOrrmjqacSRSWr907rl8MhBpknkh4ifFcjJoNA6wHDpRN vpcLFNbwgg76Nem/OWdc4eVbQTVjj945H0Fuzz7XxYEQfDIRXsYaYgu/8ftr8CV9Oqea JphQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=t2mDQy3wL7qKFF+qeRITTDNEofTpNdHlmGBaXEqCL5o=; b=im0ZBYbqxt+TdieS6hRk3Ekad4jcRc45MEuFQPHPQHtOH9FADZev3QO6yFNRCt4gbG hmji1p6+kc+Pz0eIrEgsA173aJuEy7w2uAd/LS6AX/gHScmh+zvLnB8eDZrZcYwva6xM DJgXmgODoB7M4Wh70DiQ/3ZGq8dX3zAwgFvFuhoqcFu/zDEhnwTFDwxm3rSuja4uHoqK gkn5Ra3ApclymLERqjyeXyuKAI+QxROMyfAvcaLndz19N243TY9YZFhynpuujOWsmJLY aFKQS35PP+Vhz4FW34/X39eV9IJQtfXu0dvcJrZkXJhJufV4S3cviU2Colgn2snCjpnQ NAaA== X-Gm-Message-State: AGRZ1gLsruZGiblNf8hejsCxCF7qLmuegN6anSm3Ww+td7EXbFMFL+8v N3aREPrPLOCeNFcKzYRm3qaXLaOU X-Google-Smtp-Source: AJdET5fKMZAUUr6TaXqZbx+lUH2wqsOOD5TGQJVVztI7wFvaXuoh/8/xPsJkCfcB57bm7Dj34GNIFA== X-Received: by 2002:a1c:dd1:: with SMTP id 200-v6mr5939537wmn.52.1541963722181; Sun, 11 Nov 2018 11:15:22 -0800 (PST) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id x16-v6sm9746103wro.28.2018.11.11.11.15.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Nov 2018 11:15:21 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 11 Nov 2018 19:15:20 +0000 From: Edward Tomasz Napierala To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340342 - head/share/man/man4 Message-ID: <20181111191520.632xzsbhrgvp6do4@brick> Mail-Followup-To: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811102349.wAANn1HR058065@repo.freebsd.org> <201811110108.wAB18kmP018309@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811110108.wAB18kmP018309@pdx.rh.CN85.dnsmgr.net> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: B9A5469A6B X-Spamd-Result: default: False [-3.27 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[6.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.76)[-0.758,0]; IP_SCORE(-0.81)[ipnet: 2a00:1450::/32(-2.03), asn: 15169(-1.93), country: US(-0.09)]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 19:15:24 -0000 On 1110T1708, Rodney W. Grimes wrote: > > Author: trasz > > Date: Sat Nov 10 23:49:01 2018 > > New Revision: 340342 > > URL: https://svnweb.freebsd.org/changeset/base/340342 > > > > Log: > > Random tweaks to ddb(4) manual page. > > I certainly hope we are not randomly commiting > bits to man pages. This is a 0 value commit message. You're right, sorry. I guess it should read: Update the ddb(4) man page to mention the 'debug.kdb.enter' sysctl, and to include the "disassembly" word to make it easier to find the 'i' specifier. And perhaps I should just refrain from committing when the only thing I can think of is getting some sleep. From owner-svn-src-head@freebsd.org Mon Nov 12 02:40:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55857112DF7E; Mon, 12 Nov 2018 02:40:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f177.google.com (mail-it1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC6A979EFA; Mon, 12 Nov 2018 02:40:39 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f177.google.com with SMTP id k206-v6so10603522ite.0; Sun, 11 Nov 2018 18:40:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=YvNzooep6lJJLuGd/8fW1HsF6EL5oiqP+ssnT6rBU7A=; b=AaoXQVH0XqRgoWGgTiGkHKG0EDQWkPGfHhU05XjO8MsNQ6hxWEHtunEmG5++GJ1Fm+ Y1uHZ/6vWqjgi33QbaqphSHTjsY34WA7Vv3mYFLTitCGexER8QmxbUZYyeCy73zBVPjH lbliOjijAqLJA9ztJfsl12av3iXukLZ3pEfKaOoepQbP2xEX4qEP4Q9TPMJNhQq9c3uG Kwi2s3lM+w+egiQOgquY+Zm+8Xo4qx8eG49ipmv/9jubgTO5xDmhJEow4gJk2Zd9GtnZ QXipIEXZnf5DkqycNGJTmO4N1sxHrbE+N9xm/ub/+1L3vQFR5+FBkIrV+++3d2YBoIAw 3Z8w== X-Gm-Message-State: AGRZ1gKIHEQbt/7DzGhkVm9eMgHu0qj2QgjsLjFlz+zDLPiQvTxv9slq XULuVhODVh+LB6FckOy98Gse/Ye5 X-Google-Smtp-Source: AJdET5fwG0svyonAV/p1TkDu5fVFsdFXziXvgFJ8iJTKv5JMHxOSvcUerKcePSBTrOQ4wRb6IigHHA== X-Received: by 2002:a02:95cb:: with SMTP id b69-v6mr16826647jai.120.1541989940654; Sun, 11 Nov 2018 18:32:20 -0800 (PST) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com. [209.85.166.180]) by smtp.gmail.com with ESMTPSA id n25-v6sm4503075iop.34.2018.11.11.18.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 18:32:20 -0800 (PST) Received: by mail-it1-f180.google.com with SMTP id w7-v6so11204046itd.1; Sun, 11 Nov 2018 18:32:19 -0800 (PST) X-Received: by 2002:a24:c846:: with SMTP id w67-v6mr9815580itf.32.1541989939211; Sun, 11 Nov 2018 18:32:19 -0800 (PST) MIME-Version: 1.0 References: <201811110107.wAB17cA2018293@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811110107.wAB17cA2018293@pdx.rh.CN85.dnsmgr.net> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 11 Nov 2018 18:32:08 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340326 - head To: "Rodney W. Grimes" Cc: woodsb02@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: AC6A979EFA X-Spamd-Result: default: False [-4.01 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[4]; REPLYTO_ADDR_EQ_FROM(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.88)[-0.885,0]; RCVD_IN_DNSWL_NONE(0.00)[177.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; IP_SCORE(-1.12)[ipnet: 209.85.128.0/17(-3.56), asn: 15169(-1.92), country: US(-0.09)]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 02:40:40 -0000 I absolutely approve of Ben's excellent addition to UPDATING, a text document. Your demands for additional scrutiny and time-wasting around code review are ridiculous and disproportionate, and certainly a poor reward for Ben's straightforward and unimpeachable effort to improve our UPDATING documentation. Ben, thank you for submitting and committing the UPDATING change and please try to ignore Rod's hyper-criticism. Conrad On Sat, Nov 10, 2018 at 5:07 PM Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > On Sun, 11 Nov 2018 at 2:43 am, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > If your going to bother with a differential, and invite people to > > > it you should give them at least 24 hours, and preferably 72 hours > > > to respond to the new review. Reviews that last < 4 hours are not > > > code reviews. > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > Hi Rod, > > > > Sorry. The main reason I submitted the code review is because I do not have > > my src commit bit, so needed to seek approval to commit. > > All the more reason for it to wait until the people you *invited* to > the review to have a chance to respond. > > I do not believe an "accept" in a review is an "approve to commit > beyond your normal scope". > > Was cem aware that he was "approving a non src committer to commit > this change to the src tree" as your review has no mention that you > are seeking src bit approval to commit there. > > > > > I felt the need to commit the UPDATING entry was time sensitive, given the > > change it was notifying users of had already been committed. > > > > Regards, > > Ben > > -- > > -- > Rod Grimes rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Mon Nov 12 05:24:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 218361130F37; Mon, 12 Nov 2018 05:24:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A16117E3D1; Mon, 12 Nov 2018 05:24:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CB7D1C7F5; Mon, 12 Nov 2018 05:24:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAC5OKvY080465; Mon, 12 Nov 2018 05:24:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAC5OKnH080464; Mon, 12 Nov 2018 05:24:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811120524.wAC5OKnH080464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 12 Nov 2018 05:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340358 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A16117E3D1 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 05:24:21 -0000 Author: cem Date: Mon Nov 12 05:24:20 2018 New Revision: 340358 URL: https://svnweb.freebsd.org/changeset/base/340358 Log: netdump: Fix netdumping with INVARIANTS kernels Correct boneheaded assertion I added in r339501. Mea culpa. The intent is to notice when an M_WAITOK zone allocation would fail during netdump, not to prevent all use of mbufs during netdump. Reviewed by: markj X-MFC-With: r339501 Differential Revision: https://reviews.freebsd.org/D17957 Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Nov 12 00:42:34 2018 (r340357) +++ head/sys/kern/kern_mbuf.c Mon Nov 12 05:24:20 2018 (r340358) @@ -410,8 +410,6 @@ nd_buf_import(void *arg, void **store, int count, int struct mbuf *m; int i; - KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__)); - q = arg; for (i = 0; i < count; i++) { @@ -421,6 +419,8 @@ nd_buf_import(void *arg, void **store, int count, int trash_init(m, q == &nd_mbufq ? MSIZE : nd_clsize, flags); store[i] = m; } + KASSERT((flags & M_WAITOK) == 0 || i == count, + ("%s: ran out of pre-allocated mbufs", __func__)); return (i); } @@ -447,8 +447,6 @@ nd_pack_import(void *arg __unused, void **store, int c void *clust; int i; - KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__)); - for (i = 0; i < count; i++) { m = m_get(MT_DATA, M_NOWAIT); if (m == NULL) @@ -461,6 +459,8 @@ nd_pack_import(void *arg __unused, void **store, int c mb_ctor_clust(clust, nd_clsize, m, 0); store[i] = m; } + KASSERT((flags & M_WAITOK) == 0 || i == count, + ("%s: ran out of pre-allocated mbufs", __func__)); return (i); } From owner-svn-src-head@freebsd.org Mon Nov 12 07:14:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1988D1132CCC; Mon, 12 Nov 2018 07:14:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81C48814C0; Mon, 12 Nov 2018 07:14:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A9F91D97B; Mon, 12 Nov 2018 07:14:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAC7EZ1M036236; Mon, 12 Nov 2018 07:14:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAC7EZKJ036235; Mon, 12 Nov 2018 07:14:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201811120714.wAC7EZKJ036235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 12 Nov 2018 07:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340359 - head/usr.bin/uuencode X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.bin/uuencode X-SVN-Commit-Revision: 340359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 81C48814C0 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 07:14:36 -0000 Author: delphij Date: Mon Nov 12 07:14:34 2018 New Revision: 340359 URL: https://svnweb.freebsd.org/changeset/base/340359 Log: Make outfile constant. MFC after: 2 weeks Modified: head/usr.bin/uuencode/uuencode.c Modified: head/usr.bin/uuencode/uuencode.c ============================================================================== --- head/usr.bin/uuencode/uuencode.c Mon Nov 12 05:24:20 2018 (r340358) +++ head/usr.bin/uuencode/uuencode.c Mon Nov 12 07:14:34 2018 (r340359) @@ -77,7 +77,7 @@ main(int argc, char *argv[]) struct stat sb; int base64; int ch; - char *outfile; + const char *outfile; base64 = 0; outfile = NULL; From owner-svn-src-head@freebsd.org Mon Nov 12 11:21:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AABDF1103041; Mon, 12 Nov 2018 11:21:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42CAB6B3D8; Mon, 12 Nov 2018 11:21:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B3112002D; Mon, 12 Nov 2018 11:21:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACBL0Vt061442; Mon, 12 Nov 2018 11:21:00 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACBKxMt061432; Mon, 12 Nov 2018 11:20:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811121120.wACBKxMt061432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 12 Nov 2018 11:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340360 - in head: sbin/ipfw sys/netinet6 sys/netpfil/ipfw/nptv6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: sbin/ipfw sys/netinet6 sys/netpfil/ipfw/nptv6 X-SVN-Commit-Revision: 340360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42CAB6B3D8 X-Spamd-Result: default: False [-103.10 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 11:21:01 -0000 Author: ae Date: Mon Nov 12 11:20:59 2018 New Revision: 340360 URL: https://svnweb.freebsd.org/changeset/base/340360 Log: Add ability to use dynamic external prefix in ipfw_nptv6 module. Now an interface name can be specified for nptv6 instance instead of ext_prefix. The module will track if_addr_ext events and when suitable IPv6 address will be added to specified interface, it will be configured as external prefix. When address disappears instance becomes unusable, i.e. it doesn't match any packets. Reviewed by: 0mp (manpages) Tested by: Dries Michiels MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D17765 Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.h head/sbin/ipfw/nptv6.c head/sys/netinet6/ip_fw_nptv6.h head/sys/netpfil/ipfw/nptv6/nptv6.c head/sys/netpfil/ipfw/nptv6/nptv6.h Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Nov 12 07:14:34 2018 (r340359) +++ head/sbin/ipfw/ipfw.8 Mon Nov 12 11:20:59 2018 (r340360) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2018 +.Dd November 12, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -3495,6 +3495,15 @@ NPTv6 module translates source address when it matches .It Cm ext_prefix Ar ipv6_prefix IPv6 prefix used in external network. NPTv6 module translates destination address when it matches this prefix. +.It Cm ext_if Ar nic +The NPTv6 module will use first global IPv6 address from interface +.Ar nic +as external prefix. +It can be useful when IPv6 prefix of external network is dynamically obtained. +.Cm ext_prefix +and +.Cm ext_if +options are mutually exclusive. .It Cm prefixlen Ar length The length of specified IPv6 prefixes. It must be in range from 8 to 64. .El Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Mon Nov 12 07:14:34 2018 (r340359) +++ head/sbin/ipfw/ipfw2.h Mon Nov 12 11:20:59 2018 (r340360) @@ -294,6 +294,7 @@ enum tokens { TOK_INTPREFIX, TOK_EXTPREFIX, TOK_PREFIXLEN, + TOK_EXTIF, TOK_TCPSETMSS, Modified: head/sbin/ipfw/nptv6.c ============================================================================== --- head/sbin/ipfw/nptv6.c Mon Nov 12 07:14:34 2018 (r340359) +++ head/sbin/ipfw/nptv6.c Mon Nov 12 11:20:59 2018 (r340360) @@ -152,6 +152,7 @@ static struct _s_x nptv6newcmds[] = { { "int_prefix", TOK_INTPREFIX }, { "ext_prefix", TOK_EXTPREFIX }, { "prefixlen", TOK_PREFIXLEN }, + { "ext_if", TOK_EXTIF }, { NULL, 0 } }; @@ -214,6 +215,9 @@ nptv6_create(const char *name, uint8_t set, int ac, ch ac--; av++; break; case TOK_EXTPREFIX: + if (flags & NPTV6_HAS_EXTPREFIX) + errx(EX_USAGE, + "Only one ext_prefix or ext_if allowed"); NEED1("IPv6 prefix required"); nptv6_parse_prefix(*av, &cfg->external, &plen); flags |= NPTV6_HAS_EXTPREFIX; @@ -221,6 +225,18 @@ nptv6_create(const char *name, uint8_t set, int ac, ch goto check_prefix; ac--; av++; break; + case TOK_EXTIF: + if (flags & NPTV6_HAS_EXTPREFIX) + errx(EX_USAGE, + "Only one ext_prefix or ext_if allowed"); + NEED1("Interface name required"); + if (strlen(*av) >= sizeof(cfg->if_name)) + errx(EX_USAGE, "Invalid interface name"); + flags |= NPTV6_HAS_EXTPREFIX; + cfg->flags |= NPTV6_DYNAMIC_PREFIX; + strncpy(cfg->if_name, *av, sizeof(cfg->if_name)); + ac--; av++; + break; case TOK_PREFIXLEN: NEED1("IPv6 prefix length required"); plen = strtol(*av, &p, 10); @@ -245,13 +261,14 @@ check_prefix: if ((flags & NPTV6_HAS_INTPREFIX) != NPTV6_HAS_INTPREFIX) errx(EX_USAGE, "int_prefix required"); if ((flags & NPTV6_HAS_EXTPREFIX) != NPTV6_HAS_EXTPREFIX) - errx(EX_USAGE, "ext_prefix required"); + errx(EX_USAGE, "ext_prefix or ext_if required"); if ((flags & NPTV6_HAS_PREFIXLEN) != NPTV6_HAS_PREFIXLEN) errx(EX_USAGE, "prefixlen required"); n2mask(&mask, cfg->plen); APPLY_MASK(&cfg->internal, &mask); - APPLY_MASK(&cfg->external, &mask); + if ((cfg->flags & NPTV6_DYNAMIC_PREFIX) == 0) + APPLY_MASK(&cfg->external, &mask); olh->count = 1; olh->objsize = sizeof(*cfg); @@ -350,8 +367,13 @@ nptv6_show_cb(ipfw_nptv6_cfg *cfg, const char *name, u printf("set %u ", cfg->set); inet_ntop(AF_INET6, &cfg->internal, abuf, sizeof(abuf)); printf("nptv6 %s int_prefix %s ", cfg->name, abuf); - inet_ntop(AF_INET6, &cfg->external, abuf, sizeof(abuf)); - printf("ext_prefix %s prefixlen %u\n", abuf, cfg->plen); + if (cfg->flags & NPTV6_DYNAMIC_PREFIX) + printf("ext_if %s ", cfg->if_name); + else { + inet_ntop(AF_INET6, &cfg->external, abuf, sizeof(abuf)); + printf("ext_prefix %s ", abuf); + } + printf("prefixlen %u\n", cfg->plen); return (0); } Modified: head/sys/netinet6/ip_fw_nptv6.h ============================================================================== --- head/sys/netinet6/ip_fw_nptv6.h Mon Nov 12 07:14:34 2018 (r340359) +++ head/sys/netinet6/ip_fw_nptv6.h Mon Nov 12 11:20:59 2018 (r340360) @@ -40,11 +40,15 @@ struct ipfw_nptv6_stats { typedef struct _ipfw_nptv6_cfg { char name[64]; /* NPTv6 instance name */ struct in6_addr internal; /* NPTv6 internal prefix */ - struct in6_addr external; /* NPTv6 external prefix */ + union { + struct in6_addr external; /* NPTv6 external prefix */ + char if_name[IF_NAMESIZE]; + }; uint8_t plen; /* Prefix length */ uint8_t set; /* Named instance set [0..31] */ uint8_t spare[2]; uint32_t flags; +#define NPTV6_DYNAMIC_PREFIX 1 /* Use dynamic external prefix */ } ipfw_nptv6_cfg; #endif /* _NETINET6_IP_FW_NPTV6_H_ */ Modified: head/sys/netpfil/ipfw/nptv6/nptv6.c ============================================================================== --- head/sys/netpfil/ipfw/nptv6/nptv6.c Mon Nov 12 07:14:34 2018 (r340359) +++ head/sys/netpfil/ipfw/nptv6/nptv6.c Mon Nov 12 11:20:59 2018 (r340360) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -65,6 +66,8 @@ VNET_DEFINE_STATIC(uint16_t, nptv6_eid) = 0; #define V_nptv6_eid VNET(nptv6_eid) #define IPFW_TLV_NPTV6_NAME IPFW_TLV_EACTION_NAME(V_nptv6_eid) +static eventhandler_tag nptv6_ifaddr_event; + static struct nptv6_cfg *nptv6_alloc_config(const char *name, uint8_t set); static void nptv6_free_config(struct nptv6_cfg *cfg); static struct nptv6_cfg *nptv6_find(struct namedobj_instance *ni, @@ -357,7 +360,8 @@ ipfw_nptv6(struct ip_fw_chain *chain, struct ip_fw_arg if (cmd->opcode != O_EXTERNAL_ACTION || cmd->arg1 != V_nptv6_eid || icmd->opcode != O_EXTERNAL_INSTANCE || - (cfg = NPTV6_LOOKUP(chain, icmd)) == NULL) + (cfg = NPTV6_LOOKUP(chain, icmd)) == NULL || + (cfg->flags & NPTV6_READY) == 0) return (ret); /* * We need act as router, so when forwarding is disabled - @@ -442,7 +446,10 @@ nptv6_export_config(struct ip_fw_chain *ch, struct npt { uc->internal = cfg->internal; - uc->external = cfg->external; + if (cfg->flags & NPTV6_DYNAMIC_PREFIX) + memcpy(uc->if_name, cfg->if_name, IF_NAMESIZE); + else + uc->external = cfg->external; uc->plen = cfg->plen; uc->flags = cfg->flags & NPTV6_FLAGSMASK; uc->set = cfg->no.set; @@ -497,7 +504,141 @@ nptv6_calculate_adjustment(struct nptv6_cfg *cfg) cfg->adjustment = cksum_add(~e, i); } +static int +nptv6_check_prefix(const struct in6_addr *addr) +{ + + if (IN6_IS_ADDR_MULTICAST(addr) || + IN6_IS_ADDR_LINKLOCAL(addr) || + IN6_IS_ADDR_LOOPBACK(addr) || + IN6_IS_ADDR_UNSPECIFIED(addr)) + return (EINVAL); + return (0); +} + +static void +nptv6_set_external(struct nptv6_cfg *cfg, struct in6_addr *addr) +{ + + cfg->external = *addr; + IN6_MASK_ADDR(&cfg->external, &cfg->mask); + nptv6_calculate_adjustment(cfg); + cfg->flags |= NPTV6_READY; +} + /* + * Try to determine what prefix to use as external for + * configured interface name. + */ +static void +nptv6_find_prefix(struct ip_fw_chain *ch, struct nptv6_cfg *cfg, + struct ifnet *ifp) +{ + struct ifaddr *ifa; + struct in6_ifaddr *ia; + + MPASS(cfg->flags & NPTV6_DYNAMIC_PREFIX); + IPFW_UH_WLOCK_ASSERT(ch); + + if (ifp == NULL) { + ifp = ifunit_ref(cfg->if_name); + if (ifp == NULL) + return; + } + if_addr_rlock(ifp); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + ia = (struct in6_ifaddr *)ifa; + if (nptv6_check_prefix(&ia->ia_addr.sin6_addr) || + IN6_ARE_MASKED_ADDR_EQUAL(&ia->ia_addr.sin6_addr, + &cfg->internal, &cfg->mask)) + continue; + /* Suitable address is found. */ + nptv6_set_external(cfg, &ia->ia_addr.sin6_addr); + break; + } + if_addr_runlock(ifp); + if_rele(ifp); +} + +struct ifaddr_event_args { + struct ifnet *ifp; + const struct in6_addr *addr; + int event; +}; + +static int +ifaddr_cb(struct namedobj_instance *ni, struct named_object *no, + void *arg) +{ + struct ifaddr_event_args *args; + struct ip_fw_chain *ch; + struct nptv6_cfg *cfg; + + ch = &V_layer3_chain; + cfg = (struct nptv6_cfg *)SRV_OBJECT(ch, no->kidx); + if ((cfg->flags & NPTV6_DYNAMIC_PREFIX) == 0) + return (0); + + args = arg; + /* If interface name doesn't match, ignore */ + if (strncmp(args->ifp->if_xname, cfg->if_name, IF_NAMESIZE)) + return (0); + if (args->ifp->if_flags & IFF_DYING) { /* XXX: is it possible? */ + cfg->flags &= ~NPTV6_READY; + return (0); + } + if (args->event == IFADDR_EVENT_DEL) { + /* If instance is not ready, ignore */ + if ((cfg->flags & NPTV6_READY) == 0) + return (0); + /* If address does not match the external prefix, ignore */ + if (IN6_ARE_MASKED_ADDR_EQUAL(&cfg->external, args->addr, + &cfg->mask) != 0) + return (0); + /* Otherwise clear READY flag */ + cfg->flags &= ~NPTV6_READY; + } else {/* IFADDR_EVENT_ADD */ + /* If instance is already ready, ignore */ + if (cfg->flags & NPTV6_READY) + return (0); + /* If address is not suitable for prefix, ignore */ + if (nptv6_check_prefix(args->addr) || + IN6_ARE_MASKED_ADDR_EQUAL(args->addr, &cfg->internal, + &cfg->mask)) + return (0); + /* FALLTHROUGH */ + } + MPASS(!(cfg->flags & NPTV6_READY)); + /* Try to determine the prefix */ + if_ref(args->ifp); + nptv6_find_prefix(ch, cfg, args->ifp); + return (0); +} + +static void +nptv6_ifaddrevent_handler(void *arg __unused, struct ifnet *ifp, + struct ifaddr *ifa, int event) +{ + struct ifaddr_event_args args; + struct ip_fw_chain *ch; + + if (ifa->ifa_addr->sa_family != AF_INET6) + return; + + args.ifp = ifp; + args.addr = &((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_addr; + args.event = event; + + ch = &V_layer3_chain; + IPFW_UH_WLOCK(ch); + ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), ifaddr_cb, &args, + IPFW_TLV_NPTV6_NAME); + IPFW_UH_WUNLOCK(ch); +} + +/* * Creates new NPTv6 instance. * Data layout (v0)(current): * Request: [ ipfw_obj_lheader ipfw_nptv6_cfg ] @@ -523,15 +664,12 @@ nptv6_create(struct ip_fw_chain *ch, ip_fw3_opheader * return (EINVAL); if (uc->plen < 8 || uc->plen > 64 || uc->set >= IPFW_MAX_SETS) return (EINVAL); - if (IN6_IS_ADDR_MULTICAST(&uc->internal) || - IN6_IS_ADDR_MULTICAST(&uc->external) || - IN6_IS_ADDR_UNSPECIFIED(&uc->internal) || - IN6_IS_ADDR_UNSPECIFIED(&uc->external) || - IN6_IS_ADDR_LINKLOCAL(&uc->internal) || - IN6_IS_ADDR_LINKLOCAL(&uc->external)) + if (nptv6_check_prefix(&uc->internal)) return (EINVAL); in6_prefixlen2mask(&mask, uc->plen); - if (IN6_ARE_MASKED_ADDR_EQUAL(&uc->internal, &uc->external, &mask)) + if ((uc->flags & NPTV6_DYNAMIC_PREFIX) == 0 && ( + nptv6_check_prefix(&uc->external) || + IN6_ARE_MASKED_ADDR_EQUAL(&uc->external, &uc->internal, &mask))) return (EINVAL); ni = CHAIN_TO_SRV(ch); @@ -544,15 +682,23 @@ nptv6_create(struct ip_fw_chain *ch, ip_fw3_opheader * cfg = nptv6_alloc_config(uc->name, uc->set); cfg->plen = uc->plen; + cfg->flags = uc->flags & NPTV6_FLAGSMASK; if (cfg->plen <= 48) cfg->flags |= NPTV6_48PLEN; - cfg->internal = uc->internal; - cfg->external = uc->external; cfg->mask = mask; + cfg->internal = uc->internal; IN6_MASK_ADDR(&cfg->internal, &mask); - IN6_MASK_ADDR(&cfg->external, &mask); - nptv6_calculate_adjustment(cfg); + if (cfg->flags & NPTV6_DYNAMIC_PREFIX) + memcpy(cfg->if_name, uc->if_name, IF_NAMESIZE); + else + nptv6_set_external(cfg, &uc->external); + if ((uc->flags & NPTV6_DYNAMIC_PREFIX) != 0 && + nptv6_ifaddr_event == NULL) + nptv6_ifaddr_event = EVENTHANDLER_REGISTER( + ifaddr_event_ext, nptv6_ifaddrevent_handler, NULL, + EVENTHANDLER_PRI_ANY); + IPFW_UH_WLOCK(ch); if (ipfw_objhash_alloc_idx(ni, &cfg->no.kidx) != 0) { IPFW_UH_WUNLOCK(ch); @@ -561,7 +707,10 @@ nptv6_create(struct ip_fw_chain *ch, ip_fw3_opheader * } ipfw_objhash_add(ni, &cfg->no); SRV_OBJECT(ch, cfg->no.kidx) = cfg; + if (cfg->flags & NPTV6_DYNAMIC_PREFIX) + nptv6_find_prefix(ch, cfg, NULL); IPFW_UH_WUNLOCK(ch); + return (0); } @@ -870,6 +1019,8 @@ void nptv6_uninit(struct ip_fw_chain *ch, int last) { + if (last && nptv6_ifaddr_event != NULL) + EVENTHANDLER_DEREGISTER(ifaddr_event_ext, nptv6_ifaddr_event); IPFW_DEL_OBJ_REWRITER(last, opcodes); IPFW_DEL_SOPT_HANDLER(last, scodes); ipfw_del_eaction(ch, V_nptv6_eid); Modified: head/sys/netpfil/ipfw/nptv6/nptv6.h ============================================================================== --- head/sys/netpfil/ipfw/nptv6/nptv6.h Mon Nov 12 07:14:34 2018 (r340359) +++ head/sys/netpfil/ipfw/nptv6/nptv6.h Mon Nov 12 11:20:59 2018 (r340360) @@ -51,11 +51,14 @@ struct nptv6_cfg { uint16_t adjustment; /* Checksum adjustment value */ uint8_t plen; /* Prefix length */ uint8_t flags; /* Flags for internal use */ -#define NPTV6_48PLEN 0x0001 +#define NPTV6_READY 0x80 +#define NPTV6_48PLEN 0x40 + + char if_name[IF_NAMESIZE]; char name[64]; /* Instance name */ counter_u64_t stats[NPTV6STATS]; /* Statistics counters */ }; -#define NPTV6_FLAGSMASK 0 +#define NPTV6_FLAGSMASK (NPTV6_DYNAMIC_PREFIX) int nptv6_init(struct ip_fw_chain *ch, int first); void nptv6_uninit(struct ip_fw_chain *ch, int last); From owner-svn-src-head@freebsd.org Mon Nov 12 13:00:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DE6611057EF; Mon, 12 Nov 2018 13:00:09 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 ACCD16E2F4; Mon, 12 Nov 2018 13:00:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [178.17.145.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 01E922603DA; Mon, 12 Nov 2018 13:59:58 +0100 (CET) Subject: Re: svn commit: r340097 - in head/sys: kern sys To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811030343.wA33hXRD067832@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Mon, 12 Nov 2018 13:59:25 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0.1 MIME-Version: 1.0 In-Reply-To: <201811030343.wA33hXRD067832@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: ACCD16E2F4 X-Spamd-Result: default: False [-4.80 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; TO_DN_SOME(0.00)[]; MX_GOOD(-0.01)[mail.turbocat.net]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-1.56)[ipnet: 88.99.0.0/16(-4.86), asn: 24940(-2.93), country: DE(-0.02)]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 13:00:09 -0000 On 11/3/18 4:43 AM, Matt Macy wrote: > Author: mmacy > Date: Sat Nov 3 03:43:32 2018 > New Revision: 340097 > URL: https://svnweb.freebsd.org/changeset/base/340097 > > Log: > Convert epoch to read / write records per cpu > > In discussing D17503 "Run epoch calls sooner and more reliably" with > sbahra@ we came to the conclusion that epoch is currently misusing the > ck_epoch API. It isn't safe to do a "write side" operation (ck_epoch_call > or ck_epoch_poll) in the middle of a "read side" section. Since, by definition, > it's possible to be preempted during the middle of an EPOCH_PREEMPT > epoch the GC task might call ck_epoch_poll or another thread might call > ck_epoch_call on the same section. The right solution is ultimately to change > the way that ck_epoch works for this use case. However, as a stopgap for > 12 we agreed to simply have separate records for each use case. > > Tested by: pho@ > > MFC after: 3 days ^^^ not yet MFC'ed - any reason why not? --HPS From owner-svn-src-head@freebsd.org Mon Nov 12 13:26:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A82F4110617C; Mon, 12 Nov 2018 13:26:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 331DC6EF19; Mon, 12 Nov 2018 13:26:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 156DC214EC; Mon, 12 Nov 2018 13:26:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACDQEZS026509; Mon, 12 Nov 2018 13:26:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACDQDGt026503; Mon, 12 Nov 2018 13:26:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811121326.wACDQDGt026503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 12 Nov 2018 13:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340361 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 340361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 331DC6EF19 X-Spamd-Result: default: False [-103.05 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 13:26:15 -0000 Author: tuexen Date: Mon Nov 12 13:26:13 2018 New Revision: 340361 URL: https://svnweb.freebsd.org/changeset/base/340361 Log: Fix printing of 64-bit counters on 32-bit ppc platforms. Several statistic counters are uint64_t values and are printed by systat using %lu. This results in displaying wrong numbers. Use PRIu64 instead. While there, print variables of size_t using %zd. MFC after:i 3 days Differential Revision: https://reviews.freebsd.org/D17838 Modified: head/usr.bin/systat/fetch.c head/usr.bin/systat/icmp6.c head/usr.bin/systat/ip.c head/usr.bin/systat/ip6.c head/usr.bin/systat/tcp.c head/usr.bin/systat/zarc.c Modified: head/usr.bin/systat/fetch.c ============================================================================== --- head/usr.bin/systat/fetch.c Mon Nov 12 11:20:59 2018 (r340360) +++ head/usr.bin/systat/fetch.c Mon Nov 12 13:26:13 2018 (r340361) @@ -68,9 +68,8 @@ void getsysctl(const char *name, void *ptr, size_t len strerror(errno)); } if (nlen != len) { - error("sysctl(%s...) expected %lu, got %lu", name, - (unsigned long)len, (unsigned long)nlen); - } + error("sysctl(%s...) expected %zu, got %zu", name, len, nlen); + } } /* Modified: head/usr.bin/systat/icmp6.c ============================================================================== --- head/usr.bin/systat/icmp6.c Mon Nov 12 11:20:59 2018 (r340360) +++ head/usr.bin/systat/icmp6.c Mon Nov 12 13:26:13 2018 (r340361) @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6 #include #include +#include #include #include #include @@ -173,7 +174,7 @@ void showicmp6(void) { struct icmp6stat stats; - u_long totalin, totalout; + uint64_t totalin, totalout; int i; memset(&stats, 0, sizeof stats); @@ -184,11 +185,11 @@ showicmp6(void) } totalin += stats.icp6s_badcode + stats.icp6s_badlen + stats.icp6s_checksum + stats.icp6s_tooshort; - mvwprintw(wnd, 1, 0, "%9lu", totalin); - mvwprintw(wnd, 1, 35, "%9lu", totalout); + mvwprintw(wnd, 1, 0, "%9"PRIu64, totalin); + mvwprintw(wnd, 1, 35, "%9"PRIu64, totalout); #define DO(stat, row, col) \ - mvwprintw(wnd, row, col, "%9lu", stats.stat) + mvwprintw(wnd, row, col, "%9"PRIu64, stats.stat) DO(icp6s_badcode, 2, 0); DO(icp6s_badlen, 3, 0); Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Mon Nov 12 11:20:59 2018 (r340360) +++ head/usr.bin/systat/ip.c Mon Nov 12 13:26:13 2018 (r340361) @@ -53,6 +53,7 @@ static const char sccsid[] = "@(#)mbufs.c 8.1 (Berkele #include #include +#include #include #include #include @@ -203,16 +204,16 @@ void showip(void) { struct stat stats; - u_long totalout; + uint64_t totalout; domode(&stats); totalout = stats.i.ips_forward + stats.i.ips_localout; #define DO(stat, row, col) \ - mvwprintw(wnd, row, col, "%9lu", stats.stat) + mvwprintw(wnd, row, col, "%9"PRIu64, stats.stat) DO(i.ips_total, 1, 0); - mvwprintw(wnd, 1, 35, "%9lu", totalout); + mvwprintw(wnd, 1, 35, "%9"PRIu64, totalout); DO(i.ips_badsum, 2, 0); DO(i.ips_localout, 2, 35); DO(i.ips_tooshort, 3, 0); Modified: head/usr.bin/systat/ip6.c ============================================================================== --- head/usr.bin/systat/ip6.c Mon Nov 12 11:20:59 2018 (r340360) +++ head/usr.bin/systat/ip6.c Mon Nov 12 13:26:13 2018 (r340361) @@ -52,6 +52,7 @@ static const char sccsid[] = "@(#)mbufs.c 8.1 (Berkele #include #include +#include #include #include #include @@ -190,16 +191,16 @@ void showip6(void) { struct ip6stat stats; - u_long totalout; + uint64_t totalout; domode(&stats); totalout = stats.ip6s_forward + stats.ip6s_localout; #define DO(stat, row, col) \ - mvwprintw(wnd, row, col, "%9lu", stats.stat) + mvwprintw(wnd, row, col, "%9"PRIu64, stats.stat) DO(ip6s_total, 1, 0); - mvwprintw(wnd, 1, 35, "%9lu", totalout); + mvwprintw(wnd, 1, 35, "%9"PRIu64, totalout); DO(ip6s_tooshort, 2, 0); DO(ip6s_localout, 2, 35); DO(ip6s_toosmall, 3, 0); Modified: head/usr.bin/systat/tcp.c ============================================================================== --- head/usr.bin/systat/tcp.c Mon Nov 12 11:20:59 2018 (r340360) +++ head/usr.bin/systat/tcp.c Mon Nov 12 13:26:13 2018 (r340361) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -237,7 +238,7 @@ showtcp(void) domode(&stats); #define DO(stat, row, col) \ - mvwprintw(wnd, row, col, "%12lu", stats.stat) + mvwprintw(wnd, row, col, "%12"PRIu64, stats.stat) #define L(row, stat) DO(stat, row, 0) #define R(row, stat) DO(stat, row, 38) L(1, tcps_connattempt); R(1, tcps_sndtotal); Modified: head/usr.bin/systat/zarc.c ============================================================================== --- head/usr.bin/systat/zarc.c Mon Nov 12 11:20:59 2018 (r340360) +++ head/usr.bin/systat/zarc.c Mon Nov 12 13:26:13 2018 (r340361) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "systat.h" @@ -139,11 +140,11 @@ showzarc(void) #define DO(stat, row, col, fmt) \ mvwprintw(wnd, row, col, fmt, stat) -#define R(row, stat) DO(rate.hits.stat, row, 31+1, "%3lu") -#define H(row, stat) DO(delta.hits.stat, row, 31+1+5, "%7lu"); \ - DO(curstat.hits.stat, row, 31+1+5+8+8, "%12lu") -#define M(row, stat) DO(delta.misses.stat, row, 31+1+5+8, "%7lu"); \ - DO(curstat.misses.stat, row, 31+1+5+8+8+13, "%12lu") +#define R(row, stat) DO(rate.hits.stat, row, 31+1, "%3"PRIu64) +#define H(row, stat) DO(delta.hits.stat, row, 31+1+5, "%7"PRIu64); \ + DO(curstat.hits.stat, row, 31+1+5+8+8, "%12"PRIu64) +#define M(row, stat) DO(delta.misses.stat, row, 31+1+5+8, "%7"PRIu64); \ + DO(curstat.misses.stat, row, 31+1+5+8+8+13, "%12"PRIu64) #define E(row, stat) R(row, stat); H(row, stat); M(row, stat); E(1, arcstats); E(2, arcstats_demand_data); From owner-svn-src-head@freebsd.org Mon Nov 12 14:19:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17B511107052; Mon, 12 Nov 2018 14:19:29 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 66C16705F9; Mon, 12 Nov 2018 14:19:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wACE0Kcb025629; Mon, 12 Nov 2018 06:00:20 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wACE0JK5025628; Mon, 12 Nov 2018 06:00:19 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811121400.wACE0JK5025628@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340326 - head In-Reply-To: To: cem@freebsd.org Date: Mon, 12 Nov 2018 06:00:19 -0800 (PST) CC: "Rodney W. Grimes" , woodsb02@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 66C16705F9 X-Spamd-Result: default: False [0.38 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.08)[-0.080,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.41)[-0.411,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.00)[-0.001,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 14:19:29 -0000 > I absolutely approve of Ben's excellent addition to UPDATING, a text document. At no point did I raise ANY objectection to the content of his change, stop trying to make that the issue. > Your demands for additional scrutiny and time-wasting around code > review are ridiculous and disproportionate, and certainly a poor > reward for Ben's straightforward and unimpeachable effort to improve > our UPDATING documentation. My demands are reasonable, as I stated them, your ignoring them and casting focus on my non dmeands however is pointless. > > Ben, thank you for submitting and committing the UPDATING change and > please try to ignore Rod's hyper-criticism. What you are totally ignoring is that Ben infact TAGGED me into the review process, causing me to process yet another email only to go look at the review to find it had been closed by a commit in < 4 hours total elapsed time. That is BULLSHIT and I am calling it BULLSHIT. And though Ben is the poor victom of example here, he is not the only guilty party, and though this is a trivial change, it is not the change that I am ranting about, but the fact that the process is broken. IF YOUR GOING TO TAG SOMEONE INTO A REVIEW YOU MUST GIVE THEM TIME TO RESPOND BEFORE YOU COMMIT, otherwise your just wasting there time. Do NOT tag me into a review if your going to commit it before I can possibly be expected to respond. I well rant on anyone who does that. CLEAR NOW? > Conrad > > > On Sat, Nov 10, 2018 at 5:07 PM Rodney W. Grimes > wrote: > > > > [ Charset UTF-8 unsupported, converting... ] > > > On Sun, 11 Nov 2018 at 2:43 am, Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > If your going to bother with a differential, and invite people to > > > > it you should give them at least 24 hours, and preferably 72 hours > > > > to respond to the new review. Reviews that last < 4 hours are not > > > > code reviews. > > > > > > > > -- > > > > Rod Grimes > > > > rgrimes@freebsd.org > > > > > > > Hi Rod, > > > > > > Sorry. The main reason I submitted the code review is because I do not have > > > my src commit bit, so needed to seek approval to commit. > > > > All the more reason for it to wait until the people you *invited* to > > the review to have a chance to respond. > > > > I do not believe an "accept" in a review is an "approve to commit > > beyond your normal scope". > > > > Was cem aware that he was "approving a non src committer to commit > > this change to the src tree" as your review has no mention that you > > are seeking src bit approval to commit there. > > > > > > > > I felt the need to commit the UPDATING entry was time sensitive, given the > > > change it was notifying users of had already been committed. > > > > > > Regards, > > > Ben > > > -- > > > > -- > > Rod Grimes rgrimes@freebsd.org > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Nov 12 14:34:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78DFE1107765; Mon, 12 Nov 2018 14:34:45 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-vk1-xa44.google.com (mail-vk1-xa44.google.com [IPv6:2607:f8b0:4864:20::a44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDF1B70FFF; Mon, 12 Nov 2018 14:34:44 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mail-vk1-xa44.google.com with SMTP id w72so2004863vkd.5; Mon, 12 Nov 2018 06:34:44 -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=oq31TJ4aGQ6RZnC1yAIvmCP7/okl7awh9MIpeRFeH6k=; b=jfxNHCd7xuORt7rO12pjRhMqPzYKaVEkOzo5AqLoFSEMoik2ua0bONKujQwkgo22Hw Erq/fust4fhHBUillNG1Hj+ILCdwjxkq5sr5eFyjHDNQsP4DsR1prAPrStxaqDkhmjmM BNJW7mvBxaaymy/6k92PaMPFtjCbxvjODm59xUrS+B4JVh13SnOt2MDLzl5ykuF6xSSr UUYmB96VHAKIgcPqyl2MJy7rXpxDFu7RNd0KTexeNKa4QZ+VEBV4Rx9Sia/euZLT4Sak 98aboyByldYD88WGqBq1Tcp+BG7uewDtRElZo2SbdXSgJ3R3etYZfZ5+sd1oHQ+JVdfz +/+Q== 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=oq31TJ4aGQ6RZnC1yAIvmCP7/okl7awh9MIpeRFeH6k=; b=uiSuG+R04b2aaPcReCX8b5h0819+oOKSaSYlCiaTOhrw7wPMpM96KRai7+wdaEjIrt 94s67drBiCv1Ca0JLUG1vdgspT1Hn2kWNkWnHS/vD5F8Ayql0SVDd5IE5IavopHoAQpb 7t9onb6Oj0qvt+6AkSaCcTM2AT8SPMiRuW6uuPOq9XbKuJWioLyBfx2b/Mxla54j4USs FpCykRVY6kXKY3IZiUhWRZP+mUBF4GhWnb9FwB51bI23Kja/K3C5B+8Rca5nCTi1LoDA bBrtoDVe9bzz/Y0SmR1i+G+OTJoaEO9WwV2PrL8uCDYCztMwO4RB6SDeGY0WQuZGkdUP dQWA== X-Gm-Message-State: AGRZ1gK5iCaoWbB9pJh7VNPuMQjOV3bbfIvLTVZ2kKWqAc4d79xJyqce XoA8dcn2aLG05IwVnBhK80n2k7CtQ2szSyku9Pyr6Q== X-Google-Smtp-Source: AJdET5f5T7cepDksLkPettdtrxjho9UltBbSG0opipl1l2QgeCg71Kq1lwS2itmJy8ZC4vFDLj9RZc1Z1afcYIXYUNY= X-Received: by 2002:a1f:8a8e:: with SMTP id m136mr520510vkd.46.1542033283923; Mon, 12 Nov 2018 06:34:43 -0800 (PST) MIME-Version: 1.0 References: <201811121400.wACE0JK5025628@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811121400.wACE0JK5025628@pdx.rh.CN85.dnsmgr.net> From: Ben Woods Date: Mon, 12 Nov 2018 22:34:41 +0800 Message-ID: Subject: Re: svn commit: r340326 - head To: "Rodney W. Grimes" Cc: cem@freebsd.org, Ben Woods , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: CDF1B70FFF X-Spamd-Result: default: False [-5.00 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCPT_COUNT_FIVE(0.00)[6]; IP_SCORE(-1.00)[ipnet: 2607:f8b0::/32(-2.94), asn: 15169(-1.96), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 14:34:45 -0000 On Mon, 12 Nov 2018 at 22:19, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > Do NOT tag me into a review if your going to commit it before > I can possibly be expected to respond. I well rant on anyone > who does that. > > CLEAR NOW? > Understood. Cheers, Ben From owner-svn-src-head@freebsd.org Mon Nov 12 15:10:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C07D11081BC; Mon, 12 Nov 2018 15:10:47 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 527EF7204B; Mon, 12 Nov 2018 15:10:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 65B228D4A250; Mon, 12 Nov 2018 15:10:44 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 9296DD1F843; Mon, 12 Nov 2018 15:10:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 5QcHkAiGyTuK; Mon, 12 Nov 2018 15:10:42 +0000 (UTC) Received: from [10.248.98.202] (fresh-ayiya.sbone.de [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 068FED1F7FD; Mon, 12 Nov 2018 15:10:41 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Mark Johnston" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333283 - in head: etc/mtree include share/man/man4 sys/conf sys/net sys/netinet/netdump Date: Mon, 12 Nov 2018 15:10:54 +0000 X-Mailer: MailMate (2.0BETAr6127) Message-ID: In-Reply-To: <201805060038.w460cUTZ079439@repo.freebsd.org> References: <201805060038.w460cUTZ079439@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 527EF7204B X-Spamd-Result: default: False [-3.78 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:195.201.62.131]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[zabbadoz.net]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.59)[asn: 24940(-2.93), country: DE(-0.01)]; MX_GOOD(-0.01)[cached: cross.sbone.de]; NEURAL_HAM_SHORT(-0.89)[-0.887,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:195.201.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 15:10:47 -0000 On 6 May 2018, at 0:38, Mark Johnston wrote: > Author: markj > Date: Sun May 6 00:38:29 2018 > New Revision: 333283 > URL: https://svnweb.freebsd.org/changeset/base/333283 > > Log: > Import the netdump client code. So this is an IPv4-only feature; what would be needed to add IPv6 support to netdump? I don’t like (a) new features going into the tree w/ only IPv4 support and (b) I noticed I can’t use it where I might need it.. Can we fix this? /bz From owner-svn-src-head@freebsd.org Mon Nov 12 15:16:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 784781108379; Mon, 12 Nov 2018 15:16:25 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 B4C2772552; Mon, 12 Nov 2018 15:16:24 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wACFGKYS025937; Mon, 12 Nov 2018 07:16:20 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wACFGKQ6025936; Mon, 12 Nov 2018 07:16:20 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811121516.wACFGKQ6025936@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333283 - in head: etc/mtree include share/man/man4 sys/conf sys/net sys/netinet/netdump In-Reply-To: To: "Bjoern A. Zeeb" Date: Mon, 12 Nov 2018 07:16:20 -0800 (PST) CC: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B4C2772552 X-Spamd-Result: default: False [1.97 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.19)[0.194,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.33)[0.332,0]; NEURAL_SPAM_MEDIUM(0.57)[0.574,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 15:16:25 -0000 > On 6 May 2018, at 0:38, Mark Johnston wrote: > > > Author: markj > > Date: Sun May 6 00:38:29 2018 > > New Revision: 333283 > > URL: https://svnweb.freebsd.org/changeset/base/333283 > > > > Log: > > Import the netdump client code. > > So this is an IPv4-only feature; what would be needed to add IPv6 > support to netdump? I don?t like (a) new features going into the tree > w/ only IPv4 support and (b) I noticed I can?t use it where I might > need it.. > > Can we fix this? Yes please +1 -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Nov 12 15:52:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E919111097D8; Mon, 12 Nov 2018 15:52:47 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E628742B2; Mon, 12 Nov 2018 15:52:47 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50AA322D88; Mon, 12 Nov 2018 15:52:47 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACFqlVh002963; Mon, 12 Nov 2018 15:52:47 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACFqjLr002955; Mon, 12 Nov 2018 15:52:45 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121552.wACFqjLr002955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 15:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340363 - in head: . contrib/tcpdump contrib/traceroute lib/libcasper/services/cap_dns lib/libcasper/services/cap_dns/tests sbin/ping X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: . contrib/tcpdump contrib/traceroute lib/libcasper/services/cap_dns lib/libcasper/services/cap_dns/tests sbin/ping X-SVN-Commit-Revision: 340363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E628742B2 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 15:52:48 -0000 Author: oshogbo Date: Mon Nov 12 15:52:45 2018 New Revision: 340363 URL: https://svnweb.freebsd.org/changeset/base/340363 Log: libcasper: ange the name of limits in cap_dns so the intentions are obvious. Reported by: pjd MFC after: 3 weeks Modified: head/ObsoleteFiles.inc head/contrib/tcpdump/tcpdump.c head/contrib/traceroute/traceroute.c head/lib/libcasper/services/cap_dns/Makefile head/lib/libcasper/services/cap_dns/cap_dns.3 head/lib/libcasper/services/cap_dns/cap_dns.c head/lib/libcasper/services/cap_dns/tests/dns_test.c head/sbin/ping/ping.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Nov 12 15:18:09 2018 (r340362) +++ head/ObsoleteFiles.inc Mon Nov 12 15:52:45 2018 (r340363) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20181112: Cleanup old libcap_dns. +OLD_LIBS+=lib/casper/libcap_dns.so.1 +OLD_LIBS+=usr/lib32/libcap_dns.so.1 # 20181030: malloc_domain(9) KPI change OLD_FILES+=share/man/man9/malloc_domain.9.gz # 20181026: joy(4) removal Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Mon Nov 12 15:18:09 2018 (r340362) +++ head/contrib/tcpdump/tcpdump.c Mon Nov 12 15:52:45 2018 (r340363) @@ -741,7 +741,7 @@ capdns_setup(void) if (capdnsloc == NULL) error("unable to open system.dns service"); /* Limit system.dns to reverse DNS lookups. */ - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; if (cap_dns_type_limit(capdnsloc, types, 1) < 0) error("unable to limit access to system.dns service"); families[0] = AF_INET; Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Mon Nov 12 15:18:09 2018 (r340362) +++ head/contrib/traceroute/traceroute.c Mon Nov 12 15:52:45 2018 (r340363) @@ -523,7 +523,7 @@ main(int argc, char **argv) int sump = 0; int sockerrno; #ifdef WITH_CASPER - const char *types[] = { "NAME", "ADDR" }; + const char *types[] = { "NAME2ADDR", "ADDR2NAME" }; int families[1]; cap_channel_t *casper; #endif Modified: head/lib/libcasper/services/cap_dns/Makefile ============================================================================== --- head/lib/libcasper/services/cap_dns/Makefile Mon Nov 12 15:18:09 2018 (r340362) +++ head/lib/libcasper/services/cap_dns/Makefile Mon Nov 12 15:52:45 2018 (r340363) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.3 Mon Nov 12 15:18:09 2018 (r340362) +++ head/lib/libcasper/services/cap_dns/cap_dns.3 Mon Nov 12 15:52:45 2018 (r340363) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2018 +.Dd November 12, 2018 .Dt CAP_DNS 3 .Os .Sh NAME @@ -92,9 +92,9 @@ function limits the functions allowed in the service. The .Fa types variable can be set to -.Dv ADDR +.Dv ADDR2NAME or -.Dv NAME . +.Dv NAME2ADDR . See the .Sx LIMITS section for more details. @@ -129,9 +129,9 @@ for that function can contain the following values and The .Va type can have two values: -.Dv ADDR +.Dv ADDR2NAME or -.Dv NAME . +.Dv NAME2ADDR . The .Dv ADDR means that reverse DNS lookups are allowed with Modified: head/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.c Mon Nov 12 15:18:09 2018 (r340362) +++ head/lib/libcasper/services/cap_dns/cap_dns.c Mon Nov 12 15:52:45 2018 (r340363) @@ -474,7 +474,7 @@ dns_gethostbyname(const nvlist_t *limits, const nvlist struct hostent *hp; int family; - if (!dns_allowed_type(limits, "NAME")) + if (!dns_allowed_type(limits, "NAME2ADDR")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -498,7 +498,7 @@ dns_gethostbyaddr(const nvlist_t *limits, const nvlist size_t addrsize; int family; - if (!dns_allowed_type(limits, "ADDR")) + if (!dns_allowed_type(limits, "ADDR2NAME")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -524,7 +524,7 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t socklen_t salen; int error, flags; - if (!dns_allowed_type(limits, "ADDR")) + if (!dns_allowed_type(limits, "ADDR2NAME")) return (NO_RECOVERY); error = 0; @@ -617,7 +617,7 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t unsigned int ii; int error, family, n; - if (!dns_allowed_type(limits, "NAME")) + if (!dns_allowed_type(limits, "NAME2ADDR")) return (NO_RECOVERY); hostname = dnvlist_get_string(nvlin, "hostname", NULL); @@ -702,8 +702,8 @@ dns_limit(const nvlist_t *oldlimits, const nvlist_t *n if (strncmp(name, "type", sizeof("type") - 1) != 0) return (EINVAL); type = nvlist_get_string(newlimits, name); - if (strcmp(type, "ADDR") != 0 && - strcmp(type, "NAME") != 0) { + if (strcmp(type, "ADDR2NAME") != 0 && + strcmp(type, "NAME2ADDR") != 0) { return (EINVAL); } if (!dns_allowed_type(oldlimits, type)) Modified: head/lib/libcasper/services/cap_dns/tests/dns_test.c ============================================================================== --- head/lib/libcasper/services/cap_dns/tests/dns_test.c Mon Nov 12 15:18:09 2018 (r340362) +++ head/lib/libcasper/services/cap_dns/tests/dns_test.c Mon Nov 12 15:52:45 2018 (r340363) @@ -357,8 +357,8 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; @@ -380,12 +380,12 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -407,12 +407,12 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "NAME"; + types[1] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -432,8 +432,8 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; CHECK(cap_dns_family_limit(capdns, families, 1) == 0); @@ -459,8 +459,8 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 1) == 0); @@ -488,18 +488,18 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 2) == 0); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -525,18 +525,18 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 2) == 0); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET6; @@ -562,18 +562,18 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 2) == 0); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "NAME"; + types[1] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -598,18 +598,18 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == 0); families[0] = AF_INET; families[1] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 2) == 0); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); - types[1] = "NAME"; + types[1] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET6; @@ -630,13 +630,13 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); families[0] = AF_INET; CHECK(cap_dns_family_limit(capdns, families, 1) == 0); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -644,7 +644,7 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET6; @@ -665,13 +665,13 @@ main(void) capdns = cap_clone(origcapdns); CHECK(capdns != NULL); - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 1) == 0); families[0] = AF_INET6; CHECK(cap_dns_family_limit(capdns, families, 1) == 0); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; CHECK(cap_dns_type_limit(capdns, types, 2) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; @@ -679,7 +679,7 @@ main(void) CHECK(cap_dns_family_limit(capdns, families, 2) == -1 && errno == ENOTCAPABLE); - types[0] = "NAME"; + types[0] = "NAME2ADDR"; CHECK(cap_dns_type_limit(capdns, types, 1) == -1 && errno == ENOTCAPABLE); families[0] = AF_INET; Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Mon Nov 12 15:18:09 2018 (r340362) +++ head/sbin/ping/ping.c Mon Nov 12 15:52:45 2018 (r340363) @@ -612,7 +612,7 @@ main(int argc, char *const *argv) if (capdns != NULL) { const char *types[1]; - types[0] = "ADDR"; + types[0] = "ADDR2NAME"; if (cap_dns_type_limit(capdns, types, 1) < 0) err(1, "unable to limit access to system.dns service"); } @@ -1781,8 +1781,8 @@ capdns_setup(void) cap_close(capcas); if (capdnsloc == NULL) err(1, "unable to open system.dns service"); - types[0] = "NAME"; - types[1] = "ADDR"; + types[0] = "NAME2ADDR"; + types[1] = "ADDR2NAME"; if (cap_dns_type_limit(capdnsloc, types, 2) < 0) err(1, "unable to limit access to system.dns service"); families[0] = AF_INET; From owner-svn-src-head@freebsd.org Mon Nov 12 15:59:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0DAA11099D2; Mon, 12 Nov 2018 15:59:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 694BC746A5; Mon, 12 Nov 2018 15:59:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4817522D8E; Mon, 12 Nov 2018 15:59:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACFxXxj003398; Mon, 12 Nov 2018 15:59:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACFxX3o003397; Mon, 12 Nov 2018 15:59:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811121559.wACFxX3o003397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Nov 2018 15:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340364 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 694BC746A5 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 15:59:34 -0000 Author: kib Date: Mon Nov 12 15:59:32 2018 New Revision: 340364 URL: https://svnweb.freebsd.org/changeset/base/340364 Log: Allow set ether/vlan PCP operation from the VNET jails. The vlan interfaces can be created from vnet jails, it seems, so it sounds logical to allow pcp configuration as well. Reviewed by: bz, hselasky (previous version) Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17777 Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Nov 12 15:52:45 2018 (r340363) +++ head/sys/kern/kern_jail.c Mon Nov 12 15:59:32 2018 (r340364) @@ -3062,6 +3062,7 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_NET_SETIFMETRIC: case PRIV_NET_SETIFPHYS: case PRIV_NET_SETIFMAC: + case PRIV_NET_SETLANPCP: case PRIV_NET_ADDMULTI: case PRIV_NET_DELMULTI: case PRIV_NET_HWIOCTL: From owner-svn-src-head@freebsd.org Mon Nov 12 16:44:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54581110AB3E; Mon, 12 Nov 2018 16:44:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3400766AA; Mon, 12 Nov 2018 16:44:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5A28235B8; Mon, 12 Nov 2018 16:44:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACGiQ1i029031; Mon, 12 Nov 2018 16:44:26 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACGiQUD029030; Mon, 12 Nov 2018 16:44:26 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121644.wACGiQUD029030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 16:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340370 - head/usr.bin/head X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/head X-SVN-Commit-Revision: 340370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3400766AA X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 16:44:27 -0000 Author: oshogbo Date: Mon Nov 12 16:44:26 2018 New Revision: 340370 URL: https://svnweb.freebsd.org/changeset/base/340370 Log: head: fix style nits No functional change intended. Reviewed by: emaste MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14498 Modified: head/usr.bin/head/head.c Modified: head/usr.bin/head/head.c ============================================================================== --- head/usr.bin/head/head.c Mon Nov 12 16:43:53 2018 (r340369) +++ head/usr.bin/head/head.c Mon Nov 12 16:44:26 2018 (r340370) @@ -75,14 +75,17 @@ static const struct option long_opts[] = int main(int argc, char *argv[]) { - int ch; FILE *fp; - int first, linecnt = -1, eval = 0; - off_t bytecnt = -1; char *ep; + off_t bytecnt; + int ch, first, linecnt, eval; + linecnt = -1; + eval = 0; + bytecnt = -1; + obsolete(argv); - while ((ch = getopt_long(argc, argv, "+n:c:", long_opts, NULL)) != -1) + while ((ch = getopt_long(argc, argv, "+n:c:", long_opts, NULL)) != -1) { switch(ch) { case 'c': bytecnt = strtoimax(optarg, &ep, 10); @@ -97,16 +100,18 @@ main(int argc, char *argv[]) case '?': default: usage(); + /* NOTREACHED */ } + } argc -= optind; argv += optind; if (linecnt != -1 && bytecnt != -1) errx(1, "can't combine line and byte counts"); - if (linecnt == -1 ) + if (linecnt == -1) linecnt = 10; - if (*argv) { - for (first = 1; *argv; ++argv) { + if (*argv != NULL) { + for (first = 1; *argv != NULL; ++argv) { if ((fp = fopen(*argv, "r")) == NULL) { warn("%s", *argv); eval = 1; @@ -137,7 +142,7 @@ head(FILE *fp, int cnt) char *cp; size_t error, readlen; - while (cnt && (cp = fgetln(fp, &readlen)) != NULL) { + while (cnt != 0 && (cp = fgetln(fp, &readlen)) != NULL) { error = fwrite(cp, sizeof(char), readlen, stdout); if (error != readlen) err(1, "stdout"); From owner-svn-src-head@freebsd.org Mon Nov 12 16:49:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1408C110AE05; Mon, 12 Nov 2018 16:49:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30F1176961; Mon, 12 Nov 2018 16:49:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd33.google.com with SMTP id h4so2565541iom.5; Mon, 12 Nov 2018 08:49:07 -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:content-transfer-encoding:in-reply-to :user-agent; bh=0S2t8+T8b5ShoymRBtFwQUHnK8pAmHi3aJjgYaCH3/M=; b=Argx1ZqqVnxroA31JTwda3+8RDSFolUlp/njmRf5ge1rgVwilmnvzqRTu5Zlx+ayA1 CGhNSor4NhWpCDZlAyVmEt424sSSPtswUhcd9qmmSYQAJOY1bTfNpJTmGO7XcnV4Q3dI D+NzHhkXQWDaCb4OY/c+2fLRnIPWs55aBv+O/fqaUvH6gPmCXHB/bvObJjN0ndHAOo/+ 2Ld2lNn96aI1T1bCAyqJL9c3P6QotfMq2sgzv8rGFvzjiNoKMEjE+x+jHY+7eZd4Y0r0 s/su9lllpuM+HXuX9sOxilUUAfG6et9hiSngPi7+r0/DHbnHtA6NGHqYOt1dxRHsbXEQ RPgw== 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 :content-transfer-encoding:in-reply-to:user-agent; bh=0S2t8+T8b5ShoymRBtFwQUHnK8pAmHi3aJjgYaCH3/M=; b=fXUuSSCpCCYYj+vb0Qu3mbau5qBToMNrqPnBirUFHD++wgkYMdpRQ+6mNlhOfH2uep KlWVESvWRMXubipvxwyheQ5IOUGlnas3oywVEA3LtUqUqOsSVg8Yma+UrfEBtuf41Wb6 0YtlhxeTe8H11XkIrl0rGjs3BFAtfaAYUboKUluT7mi1F6irnOrGVdc2D4WULEmha4dn x4WHYiNSlGqGNNiX+rr8vPtBNDbf2PRCW1kg13xg81qqXn84Hx9sokvqD+wV48NlazBh XOMTdx2xOWcMAjfX8wk4eObaxHua+Me/EhifREuN+6DhjttgY6RdV2e79C2xQGZqBE2o uLfA== X-Gm-Message-State: AGRZ1gLBN8Q9KevF7t4/S+4eraZl2LZUcRFuhCuPl2phLexeHP6w+tmw wZ6rx9Ue3ZVHSZPPigpjrCS0xz3m8Ok= X-Google-Smtp-Source: AJdET5cyu/j9u28K9e6gSUX2ilcaclG6WhwLfHgZDzFUBA9k46nKftIgRxMzzyQGn84wqImfoVH66Q== X-Received: by 2002:a6b:3806:: with SMTP id f6mr485501ioa.194.1542041346057; Mon, 12 Nov 2018 08:49:06 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id z5-v6sm4028096iob.68.2018.11.12.08.49.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 08:49:05 -0800 (PST) Sender: Mark Johnston Date: Mon, 12 Nov 2018 11:49:03 -0500 From: Mark Johnston To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333283 - in head: etc/mtree include share/man/man4 sys/conf sys/net sys/netinet/netdump Message-ID: <20181112164903.GD25936@raichu> References: <201805060038.w460cUTZ079439@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 30F1176961 X-Spamd-Result: default: False [-3.61 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[3.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.90)[-0.900,0]; IP_SCORE(-1.00)[ipnet: 2607:f8b0::/32(-2.94), asn: 15169(-1.96), country: US(-0.09)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 16:49:08 -0000 On Mon, Nov 12, 2018 at 03:10:54PM +0000, Bjoern A. Zeeb wrote: > On 6 May 2018, at 0:38, Mark Johnston wrote: > > > Author: markj > > Date: Sun May 6 00:38:29 2018 > > New Revision: 333283 > > URL: https://svnweb.freebsd.org/changeset/base/333283 > > > > Log: > > Import the netdump client code. > > So this is an IPv4-only feature; what would be needed to add IPv6 > support to netdump? I don’t like (a) new features going into the tree > w/ only IPv4 support and (b) I noticed I can’t use it where I might > need it.. One would at least need to: - ensure that dumpon(8) can pass IPv6 configuration parameters to the kernel, - add code to add IPv6 headers to outbound packets, - add code to process inbound IPv6 packets, - use ND to resolve the gateway. > Can we fix this? Sure. I can't promise I will get to it in the near future, but I'm happy to review patches. From owner-svn-src-head@freebsd.org Mon Nov 12 16:50:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6D62110AEC2; Mon, 12 Nov 2018 16:50:31 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF4176B2B; Mon, 12 Nov 2018 16:50:31 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 5F5F43C475F; Mon, 12 Nov 2018 16:50:24 +0000 (UTC) Date: Mon, 12 Nov 2018 16:50:24 +0000 From: Brooks Davis To: Eitan Adler Cc: Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340294 - head/sys/compat/freebsd32 Message-ID: <20181112165024.GC66623@spindle.one-eyed-alien.net> References: <201811091803.wA9I31ie014903@repo.freebsd.org> <20181109181901.GA61841@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 1FF4176B2B X-Spamd-Result: default: False [-0.98 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.950,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.950,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[spindle.one-eyed-alien.net]; MX_MISSING(3.50)[requested record is not found]; NEURAL_HAM_SHORT(-0.88)[-0.876,0]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; IP_SCORE(-0.80)[asn: 36236(-3.88), country: US(-0.09)]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 16:50:32 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 10, 2018 at 12:18:13AM -0800, Eitan Adler wrote: > On Fri, 9 Nov 2018 at 10:19, Brooks Davis wrote: > > > > On Fri, Nov 09, 2018 at 06:03:01PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Fri Nov 9 18:03:01 2018 > > > New Revision: 340294 > > > URL: https://svnweb.freebsd.org/changeset/base/340294 > > > > > > Log: > > > Fix a number of bugs in freebsd32's capabilities.conf. > > > > > > Bugs range from failure to update after changing syscall implementa= ion > > > names to using the wrong name. Somewhat confusingly, the name in > > > capabilities.conf is exactly the string that appears in syscalls.ma= ster, > > > not the name with a COMPAT* prefix which is the actual function nam= e. > > > > > > Found while making a change to use the default capabilities.conf. >=20 > Is there any automated way to detect this in the future? Can we add > some test that detect non-existent syscalls or the like? https://reviews.freebsd.org/D17932 fixes most of this. It wouldn't be too hard to keep track of which syscalls were emitted and check that against the set from capabilities.conf. I'll keep that in mind. -- Brooks --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJb6a9PAAoJEKzQXbSebgfAW4cIAJT9Kx4h33Ot0XFw/oCduNsX AM2zwRmX5cbejqzr8A4hGN5khczXPzJRqFIg8IJAa8pQ1ZIpVSsfwX5F/EYsW0Fz gJUe+wNqm51dPqUZTCyXpUFApqTiPAHjZYU3c2DwhUJu/wfnsI9dqO1r0I3ZCxMK GM7fTVTpU5cNrk2OdZdOsFxe4Bpu2tfgq/PfMwedlQQovu/2X9KGV+JPC/YNRhKt oq8qenKXx0y5aT0tM/mgnPRjbMyyHAkY3dshvq+AcKCMMVvHkVePjldA1lEX8r+W 0CpkearE65JMzEpjHnTKFlN3UqQ97Gu0gWc7IR3lAvVqW05EsAoJLXm9rF2tRz4= =5ZxW -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc-- From owner-svn-src-head@freebsd.org Mon Nov 12 16:55:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49DE4110B0F7; Mon, 12 Nov 2018 16:55:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEDD676F5E; Mon, 12 Nov 2018 16:55:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C63A23786; Mon, 12 Nov 2018 16:55:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACGtKUx034389; Mon, 12 Nov 2018 16:55:20 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACGtKQg034388; Mon, 12 Nov 2018 16:55:20 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811121655.wACGtKQg034388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 12 Nov 2018 16:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340371 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AEDD676F5E X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 16:55:21 -0000 Author: brooks Date: Mon Nov 12 16:55:20 2018 New Revision: 340371 URL: https://svnweb.freebsd.org/changeset/base/340371 Log: Use ...-freebsd13.0 in -target strings. Reported by: Mark Millard Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Mon Nov 12 16:44:26 2018 (r340370) +++ head/Makefile.libcompat Mon Nov 12 16:55:20 2018 (r340371) @@ -17,7 +17,7 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} .if ${WANT_COMPILER_TYPE} == gcc || \ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) .else -LIB32CPUFLAGS+= -target x86_64-unknown-freebsd12.0 +LIB32CPUFLAGS+= -target x86_64-unknown-freebsd13.0 .endif LIB32CPUFLAGS+= -m32 LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ @@ -49,9 +49,9 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} .endif .else .if ${TARGET_ARCH:Mmips64el*} != "" -LIB32CPUFLAGS= -target mipsel-unknown-freebsd12.0 +LIB32CPUFLAGS= -target mipsel-unknown-freebsd13.0 .else -LIB32CPUFLAGS= -target mips-unknown-freebsd12.0 +LIB32CPUFLAGS= -target mips-unknown-freebsd13.0 .endif .endif LIB32CPUFLAGS+= -mabi=32 From owner-svn-src-head@freebsd.org Mon Nov 12 17:10:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C19A8110B924; Mon, 12 Nov 2018 17:10:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52ED777E60; Mon, 12 Nov 2018 17:10:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3505623936; Mon, 12 Nov 2018 17:10:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACHAj2O039654; Mon, 12 Nov 2018 17:10:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACHAjDu039653; Mon, 12 Nov 2018 17:10:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811121710.wACHAjDu039653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Nov 2018 17:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340372 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 340372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52ED777E60 X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 17:10:45 -0000 Author: kevans Date: Mon Nov 12 17:10:44 2018 New Revision: 340372 URL: https://svnweb.freebsd.org/changeset/base/340372 Log: dtb.mk: Fix passing of ECHO to make_dtb{,o}.sh Modified: head/sys/conf/dtb.mk Modified: head/sys/conf/dtb.mk ============================================================================== --- head/sys/conf/dtb.mk Mon Nov 12 16:55:20 2018 (r340371) +++ head/sys/conf/dtb.mk Mon Nov 12 17:10:44 2018 (r340372) @@ -55,21 +55,21 @@ DTBO=${DTSO:R:S/$/.dtbo/} all: ${DTB} ${DTBO} .if defined(DTS) -.export DTC +.export DTC ECHO .for _dts in ${DTS} ${_dts:R:S/$/.dtb/}: ${_dts} ${OP_META} @${ECHO} Generating ${.TARGET} from ${_dts} - @env ECHO=${ECHO} ${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${_dts} ${.OBJDIR} + @${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${_dts} ${.OBJDIR} CLEANFILES+=${_dts:R:S/$/.dtb/} .endfor .endif .if defined(DTSO) -.export DTC +.export DTC ECHO .for _dtso in ${DTSO} ${_dtso:R:S/$/.dtbo/}: ${_dtso} ${OP_META} @${ECHO} Generating ${.TARGET} from ${_dtso} - @env ECHO=${ECHO} ${SYSDIR}/tools/fdt/make_dtbo.sh ${SYSDIR} overlays/${_dtso} ${.OBJDIR} + @${SYSDIR}/tools/fdt/make_dtbo.sh ${SYSDIR} overlays/${_dtso} ${.OBJDIR} CLEANFILES+=${_dtso:R:S/$/.dtbo/} .endfor .endif From owner-svn-src-head@freebsd.org Mon Nov 12 17:40:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 689EA110C653; Mon, 12 Nov 2018 17:40:49 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE79A79FC0; Mon, 12 Nov 2018 17:40:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B03EE23E79; Mon, 12 Nov 2018 17:40:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACHemG6056950; Mon, 12 Nov 2018 17:40:48 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACHelYr056945; Mon, 12 Nov 2018 17:40:47 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121740.wACHelYr056945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 17:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340373 - in head: lib/libcasper/services lib/libcasper/services/cap_fileargs share/mk X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: lib/libcasper/services lib/libcasper/services/cap_fileargs share/mk X-SVN-Commit-Revision: 340373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE79A79FC0 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 17:40:49 -0000 Author: oshogbo Date: Mon Nov 12 17:40:47 2018 New Revision: 340373 URL: https://svnweb.freebsd.org/changeset/base/340373 Log: libcasper: introduce cap_fileargs service cap_fileargs is a Casper service which helps to sandbox applications that need access to the filesystem namespace. The main purpose of the service is to make easy to capsicumize applications that works on multiple files passed in argv. We have a couple example of using it but we still treat this service as an experimental one. Reviewed by: emsate (previous version), jonathan (partially) Discussed with: many Differential Revision: https://reviews.freebsd.org/D14407 Added: head/lib/libcasper/services/cap_fileargs/ head/lib/libcasper/services/cap_fileargs/Makefile (contents, props changed) head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 (contents, props changed) head/lib/libcasper/services/cap_fileargs/cap_fileargs.c (contents, props changed) head/lib/libcasper/services/cap_fileargs/cap_fileargs.h (contents, props changed) Modified: head/lib/libcasper/services/Makefile head/share/mk/src.libnames.mk Modified: head/lib/libcasper/services/Makefile ============================================================================== --- head/lib/libcasper/services/Makefile Mon Nov 12 17:10:44 2018 (r340372) +++ head/lib/libcasper/services/Makefile Mon Nov 12 17:40:47 2018 (r340373) @@ -3,6 +3,7 @@ .include SUBDIR= cap_dns +SUBDIR+= cap_fileargs SUBDIR+= cap_grp SUBDIR+= cap_pwd SUBDIR+= cap_random Added: head/lib/libcasper/services/cap_fileargs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_fileargs/Makefile Mon Nov 12 17:40:47 2018 (r340373) @@ -0,0 +1,35 @@ +# $FreeBSD$ + +SHLIBDIR?= /lib/casper + +.include + +PACKAGE=libcasper + +SHLIB_MAJOR= 1 +INCSDIR?= ${INCLUDEDIR}/casper + +.if ${MK_CASPER} != "no" +SHLIB= cap_fileargs + +SRCS= cap_fileargs.c +.endif + +INCS= cap_fileargs.h + +LIBADD= nv + +CFLAGS+=-I${.CURDIR} + +MAN+= cap_fileargs.3 + +MLINKS+=cap_fileargs.3 libcap_fileargs.3 +MLINKS+=cap_fileargs.3 fileargs_cinit.3 +MLINKS+=cap_fileargs.3 fileargs_cinitnv.3 +MLINKS+=cap_fileargs.3 fileargs_fopen.3 +MLINKS+=cap_fileargs.3 fileargs_free.3 +MLINKS+=cap_fileargs.3 fileargs_init.3 +MLINKS+=cap_fileargs.3 fileargs_initnv.3 +MLINKS+=cap_fileargs.3 fileargs_open.3 + +.include Added: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Mon Nov 12 17:40:47 2018 (r340373) @@ -0,0 +1,241 @@ +.\" Copyright (c) 2018 Mariusz Zaborski +.\" 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 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 November 12, 2018 +.Dt CAP_FILEARGS 3 +.Os +.Sh NAME +.Nm fileargs_cinit , +.Nm fileargs_cinitnv , +.Nm fileargs_init , +.Nm fileargs_initnv , +.Nm fileargs_free , +.Nm fileargs_open , +.Nm fileargs_fopen +.Nd "library for handling files in capability mode" +.Sh LIBRARY +.Lb libcap_fileargs +.Sh SYNOPSIS +.In sys/nv.h +.In libcasper.h +.In casper/cap_fileargs.h +.Ft "fileargs_t *" +.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" "cap_rights_t *rightsp" +.Ft "fileargs_t *" +.Fn fileargs_cinit "cap_channel_t *cas" "int argc" "char *argv[]" "int flags" "mode_t mode" "cap_rights_t *rightsp" +.Ft "fileargs_t *" +.Fn fileargs_cinitnv "cap_channel_t *cas" "nvlist_t *limits" +.Ft "fileargs_t *" +.Fn fileargs_initnv "nvlist_t *limits" +.Ft "void" +.Fn fileargs_free "fileargs_t *fa" +.Ft "int" +.Fn fileargs_open "fileargs_t *fa" "const char *name" +.Ft "FILE *" +.Fn fileargs_fopen "fileargs_t *fa" "const char *name" "const char *mode" +.Sh DESCRIPTION +The library is used to simplify Capsicumizing a tools that are using file system. +Idea behind the library is that we are passing a remaining +.Fa argc +and +.Fa argv +which contains a list of files that should be open for this program. +The library will create a service that will serve those files. +.Pp +The function +.Fn fileargs_init +create a service to the +.Nm system.fileargs . +The +.Fa argv +contains a list of files that should be opened. +The argument can be set to +.Dv NULL +which will not create a service and all files will be prohibited to be opened. +The +.Fa argc +argument contains a number of passed files. +The +.Fa flags +argument limits opened files for either execution or reading and/or writing. +The +.Fa mode +argument tells which what mode file should be created if the +.Dv O_CREATE +flag is present . +For more details of the +.Fa flags +and +.Fa mode +arguments see +.Xr open 2 . +The +.Fa rightsp +argument contains a list of the capability rights which file should be limited to. +For more details of the capability rights see +.Xr cap_rights_init 3 . +.Pp +The function +.Fn fileargs_cinit +is equivalent to +.Fn fileargs_init +except that the connection to the Casper needs to be provided. +.Pp +The functions +.Fn fileargs_ininv +and +.Fn fileargs_cininv +are respectively equivalent to +.Fn fileargs_init +and +.Fn fileargs_cinit +expect that all arguments all provided as +.Xr nvlist 9 . +For details see +.Sx LIMITS . +.Pp +The +.Fa fileargs_free +close connection to the +.Nm system.filerags +service and free are structures. +The function handle +.Dv NULL +argument. +.Pp +The functions +.Fn fileargs_open +and +.Fn fileargs_fopen +are respectively equivalent to +.Xr open 2 +and +.Xr fopen 3 +expect that all arguments are fetched from the +.Va fileargs_t +structure. +.Sh LIMITS +This section describe which values and types should be used to pass arguments to the +.Fa system.filerags +through the +.Fn fileargs_ininv +and +.Fn fileargs_cinit +functions. +The +.Xr nvlist 9 +for that functions must contain the following values and types: +.Bl -ohang -offset indent +.It flags ( NV_TYPE_NUMBER ) +The +.Va flags +limits opened files for either execution or reading and/or writing. +.It mode (NV_TYPE_NUMBER) +If in the +.Va flags +argument the +.Dv O_CREATE +flag was defined the +.Xr nvlist 9 +must contain the +.Va mode . +The +.Va mode +argument tells which what mode file should be created. +.El +.Pp +The +.Xr nvlist 9 +for that functions may contain the following values and types: +.Bl -ohang -offset indent +.It cap_rights ( NV_TYPE_BINARY ) +The +.Va cap_rights +argument contains a list of the capability rights which file should be limited to. +.It ( NV_TYPE_NULL ) +Any number of +.Dv NV_TYPE_NULL +where the name of the element is name of the file which can be opened. +.Sh EXAMPLES +The following example first parse some options and then create the +.Nm system.filerags +service with remaining arguments. +.Bd -literal +int ch, fd, i; +cap_rights_t rights; +fileargs_t *fa; + +while ((ch = getopt(argc, argv, "h")) != -1) { + switch (ch) { + case 'h': + default: + usage(); + } +} + +argc -= optind; +argv += optind; + +/* Create capability to the system.fileargs service. */ +fa = fileargs_init(argc, argv, O_RDONLY, 0, + cap_rights_init(&rights, CAP_READ)); +if (fa == NULL) + err(1, "unable to open system.fileargs service"); + +/* Enter capability mode sandbox. */ +if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + +/* Open files. */ +for (i = 0; i < argc; i++) { + fd = fileargs_open(fa, argv[i]); + if (fd < 0) + err(1, "unable to open file %s", argv[i]); + printf("File %s opened in capability mode\n", argv[i]); + close(fd); +} + +fileargs_free(fa); +.Ed +.Sh SEE ALSO +.Xr cap_enter 2 , +.Xr open 2 , +.Xr cap_rights_init 3 , +.Xr err 3 , +.Xr fopen 3, +.Xr getopt 3, +.Xr capsicum 4 , +.Xr nv 9 +.Sh BUGS +The +.Lb cap_fileargs +included in +.Fx +is considered experimental, and should not be deployed in production +environments without careful consideration of the risks associated with +the use of experimental operating system features. +.Sh AUTHORS +.An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org Added: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Mon Nov 12 17:40:47 2018 (r340373) @@ -0,0 +1,505 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Mariusz Zaborski + * 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 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "cap_fileargs.h" + +#define CACHE_SIZE 128 + +#define FILEARGS_MAGIC 0xFA00FA00 + +struct fileargs { + uint32_t fa_magic; + nvlist_t *fa_cache; + cap_channel_t *fa_chann; + int fa_fdflags; +}; + +static int +fileargs_get_cache(fileargs_t *fa, const char *name) +{ + int fd; + const nvlist_t *nvl; + nvlist_t *tnvl; + + assert(fa != NULL); + assert(fa->fa_magic == FILEARGS_MAGIC); + assert(name != NULL); + + if (fa->fa_cache == NULL) + return (-1); + + if ((fa->fa_fdflags & O_CREAT) != 0) + return (-1); + + nvl = dnvlist_get_nvlist(fa->fa_cache, name, NULL); + if (nvl == NULL) + return (-1); + + tnvl = nvlist_take_nvlist(fa->fa_cache, name); + fd = nvlist_take_descriptor(tnvl, "fd"); + nvlist_destroy(tnvl); + + if ((fa->fa_fdflags & O_CLOEXEC) != O_CLOEXEC) { + if (fcntl(fd, F_SETFD, fa->fa_fdflags) == -1) { + close(fd); + return (-1); + } + } + + return (fd); +} + +static void +fileargs_set_cache(fileargs_t *fa, nvlist_t *nvl) +{ + + nvlist_destroy(fa->fa_cache); + fa->fa_cache = nvl; +} + +static nvlist_t* +fileargs_fetch(fileargs_t *fa, const char *name) +{ + nvlist_t *nvl; + int serrno; + + assert(fa != NULL); + assert(name != NULL); + + nvl = nvlist_create(NV_FLAG_NO_UNIQUE); + nvlist_add_string(nvl, "cmd", "open"); + nvlist_add_string(nvl, "name", name); + + nvl = cap_xfer_nvlist(fa->fa_chann, nvl); + if (nvl == NULL) + return (NULL); + + if (nvlist_get_number(nvl, "error") != 0) { + serrno = (int)nvlist_get_number(nvl, "error"); + nvlist_destroy(nvl); + errno = serrno; + return (NULL); + } + + return (nvl); +} + +static nvlist_t * +fileargs_create_limit(int argc, const char * const *argv, int flags, + mode_t mode, cap_rights_t *rightsp) +{ + nvlist_t *limits; + int i; + + limits = nvlist_create(NV_FLAG_NO_UNIQUE); + if (limits == NULL) + return (NULL); + + nvlist_add_number(limits, "flags", flags); + if (rightsp != NULL) { + nvlist_add_binary(limits, "cap_rights", rightsp, + sizeof(*rightsp)); + } + if ((flags & O_CREAT) != 0) + nvlist_add_number(limits, "mode", (uint64_t)mode); + + for (i = 0; i < argc; i++) { + nvlist_add_null(limits, argv[i]); + } + + return (limits); +} + +static fileargs_t * +fileargs_create(cap_channel_t *chan, int fdflags) +{ + fileargs_t *fa; + + fa = malloc(sizeof(*fa)); + if (fa != NULL) { + fa->fa_cache = NULL; + fa->fa_chann = chan; + fa->fa_fdflags = fdflags; + fa->fa_magic = FILEARGS_MAGIC; + } + + return (fa); +} + +fileargs_t * +fileargs_init(int argc, char *argv[], int flags, mode_t mode, + cap_rights_t *rightsp) +{ + nvlist_t *limits; + + if (argv <= 0 || argv == NULL) { + return (fileargs_create(NULL, 0)); + } + + limits = fileargs_create_limit(argc, (const char * const *)argv, flags, + mode, rightsp); + if (limits == NULL) + return (NULL); + + return (fileargs_initnv(limits)); +} + +fileargs_t * +fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], int flags, + mode_t mode, cap_rights_t *rightsp) +{ + nvlist_t *limits; + + if (argv <= 0 || argv == NULL) { + return (fileargs_create(NULL, 0)); + } + + limits = fileargs_create_limit(argc, (const char * const *)argv, flags, + mode, rightsp); + if (limits == NULL) + return (NULL); + + return (fileargs_cinitnv(cas, limits)); +} + +fileargs_t * +fileargs_initnv(nvlist_t *limits) +{ + cap_channel_t *cas; + fileargs_t *fa; + + if (limits == NULL) { + return (fileargs_create(NULL, 0)); + } + + cas = cap_init(); + if (cas == NULL) { + nvlist_destroy(limits); + return (NULL); + } + + fa = fileargs_cinitnv(cas, limits); + cap_close(cas); + + return (fa); +} + +fileargs_t * +fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits) +{ + cap_channel_t *chann; + fileargs_t *fa; + int serrno, ret; + int flags; + + assert(cas != NULL); + + if (limits == NULL) { + return (fileargs_create(NULL, 0)); + } + + chann = NULL; + fa = NULL; + + chann = cap_service_open(cas, "system.fileargs"); + if (chann == NULL) { + nvlist_destroy(limits); + return (NULL); + } + + flags = nvlist_get_number(limits, "flags"); + + /* Limits are consumed no need to free them. */ + ret = cap_limit_set(chann, limits); + if (ret < 0) + goto out; + + fa = fileargs_create(chann, flags); + if (fa == NULL) + goto out; + + return (fa); +out: + serrno = errno; + if (chann != NULL) + cap_close(chann); + errno = serrno; + return (NULL); +} + +int +fileargs_open(fileargs_t *fa, const char *name) +{ + int fd; + nvlist_t *nvl; + char *cmd; + + assert(fa != NULL); + assert(fa->fa_magic == FILEARGS_MAGIC); + + if (name == NULL) { + errno = EINVAL; + return (-1); + } + + if (fa->fa_chann == NULL) { + errno = ENOTCAPABLE; + return (-1); + } + + fd = fileargs_get_cache(fa, name); + if (fd != -1) + return (fd); + + nvl = fileargs_fetch(fa, name); + if (nvl == NULL) + return (-1); + + fd = nvlist_take_descriptor(nvl, "fd"); + cmd = nvlist_take_string(nvl, "cmd"); + if (strcmp(cmd, "cache") == 0) + fileargs_set_cache(fa, nvl); + else + nvlist_destroy(nvl); + free(cmd); + + return (fd); +} + +FILE * +fileargs_fopen(fileargs_t *fa, const char *name, const char *mode) +{ + int fd; + + if ((fd = fileargs_open(fa, name)) < 0) { + return (NULL); + } + + return (fdopen(fd, mode)); +} + +void +fileargs_free(fileargs_t *fa) +{ + + if (fa == NULL) + return; + + assert(fa->fa_magic == FILEARGS_MAGIC); + + nvlist_destroy(fa->fa_cache); + if (fa->fa_chann != NULL) { + cap_close(fa->fa_chann); + } + explicit_bzero(&fa->fa_magic, sizeof(fa->fa_magic)); + free(fa); +} + +/* + * Service functions. + */ + +static const char *lastname; +static void *cacheposition; +static bool allcached; +static const cap_rights_t *caprightsp; +static int capflags; +static mode_t capmode; + +static int +open_file(const char *name) +{ + int fd, serrno; + + if ((capflags & O_CREAT) == 0) + fd = open(name, capflags); + else + fd = open(name, capflags, capmode); + if (fd < 0) + return (-1); + + if (caprightsp != NULL) { + if (cap_rights_limit(fd, caprightsp) < 0) { + serrno = errno; + close(fd); + errno = serrno; + return (-1); + } + } + + return (fd); +} + +static void +fileargs_add_cache(nvlist_t *nvlout, const nvlist_t *limits, + const char *curent_name) +{ + int type, i, fd; + void *cookie; + nvlist_t *new; + const char *fname; + + if ((capflags & O_CREAT) != 0) { + allcached = true; + return; + } + + cookie = cacheposition; + for (i = 0; i < CACHE_SIZE + 1; i++) { + fname = nvlist_next(limits, &type, &cookie); + if (fname == NULL) { + cacheposition = NULL; + lastname = NULL; + allcached = true; + return; + } + /* We doing that to catch next element name. */ + if (i == CACHE_SIZE) { + break; + } + + if (type != NV_TYPE_NULL || + (curent_name != NULL && strcmp(fname, curent_name) == 0)) { + curent_name = NULL; + i--; + continue; + } + + fd = open_file(fname); + if (fd < 0) { + i--; + continue; + } + + new = nvlist_create(NV_FLAG_NO_UNIQUE); + nvlist_move_descriptor(new, "fd", fd); + nvlist_add_nvlist(nvlout, fname, new); + } + cacheposition = cookie; + lastname = fname; +} + +static bool +fileargs_allowed(const nvlist_t *limits, const nvlist_t *request) +{ + const char *name; + + name = dnvlist_get_string(request, "name", NULL); + if (name == NULL) + return (false); + + /* Fast path. */ + if (lastname != NULL && strcmp(name, lastname) == 0) + return (true); + + if (!nvlist_exists_null(limits, name)) + return (false); + + return (true); +} + +static int +fileargs_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits) +{ + + if (oldlimits != NULL) + return (ENOTCAPABLE); + + capflags = (int)dnvlist_get_number(newlimits, "flags", 0); + if ((capflags & O_CREAT) != 0) + capmode = (mode_t)nvlist_get_number(newlimits, "mode"); + else + capmode = 0; + + caprightsp = dnvlist_get_binary(newlimits, "cap_rights", NULL, NULL, 0); + + return (0); +} + +static int +fileargs_command_open(const nvlist_t *limits, nvlist_t *nvlin, + nvlist_t *nvlout) +{ + int fd; + const char *name; + + if (limits == NULL) + return (ENOTCAPABLE); + + if (!fileargs_allowed(limits, nvlin)) + return (ENOTCAPABLE); + + name = nvlist_get_string(nvlin, "name"); + + fd = open_file(name); + if (fd < 0) + return (errno); + + if (!allcached && (lastname == NULL || + strcmp(name, lastname) == 0)) { + nvlist_add_string(nvlout, "cmd", "cache"); + fileargs_add_cache(nvlout, limits, name); + } else { + nvlist_add_string(nvlout, "cmd", "open"); + } + nvlist_move_descriptor(nvlout, "fd", fd); + return (0); +} + +static int +fileargs_command(const char *cmd, const nvlist_t *limits, + nvlist_t *nvlin, nvlist_t *nvlout) +{ + + if (strcmp(cmd, "open") == 0) + return (fileargs_command_open(limits, nvlin, nvlout)); + + return (EINVAL); +} + +CREATE_SERVICE("system.fileargs", fileargs_limit, fileargs_command, + CASPER_SERVICE_FD | CASPER_SERVICE_STDIO | CASPER_SERVICE_NO_UNIQ_LIMITS); Added: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Mon Nov 12 17:40:47 2018 (r340373) @@ -0,0 +1,108 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Mariusz Zaborski + * 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 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$ + */ + +#ifndef _FILEARGS_H_ +#define _FILEARGS_H_ + +#include +#include + +#include + +#ifdef WITH_CASPER +struct fileargs; +typedef struct fileargs fileargs_t; + +fileargs_t *fileargs_init(int argc, char *argv[], int flags, mode_t mode, + cap_rights_t *rightsp); +fileargs_t *fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], + int flags, mode_t mode, cap_rights_t *rightsp); +fileargs_t *fileargs_initnv(nvlist_t *limits); +fileargs_t *fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits); +int fileargs_open(fileargs_t *fa, const char *name); +void fileargs_free(fileargs_t *fa); +FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode); +#else +typedef struct fileargs { + int fa_flags; + mode_t fa_mode; +} fileargs_t; + +static inline fileargs_t * +fileargs_init(int argc __unused, char *argv[] __unused, int flags, mode_t mode, + cap_rights_t *rightsp __unused) { + fileargs_t *fa; + + fa = malloc(sizeof(*fa)); + if (fa != NULL) { + fa->fa_flags = flags; + fa->fa_mode = mode; + } + + return (fa); +} + +static inline fileargs_t * +fileargs_cinit(cap_channel_t *cas __unused, int argc, char *argv[], int flags, + mode_t mode, cap_rights_t *rightsp) +{ + + return (fileargs_init(argc, argv, flags, mode, rightsp)); +} + +static inline fileargs_t * +fileargs_initnv(nvlist_t *limits) +{ + fileargs_t *fa; + + fa = fileargs_init(0, NULL, + nvlist_get_number(limits, "flags"), + dnvlist_get_number(limits, "mode", 0), + NULL); + nvlist_destroy(limits); + + return (fa); +} + +static inline fileargs_t * +fileargs_cinitnv(cap_channel_t *cas __unused, nvlist_t *limits) +{ + + return (fileargs_initnv(limits)); +} + +#define fileargs_open(fa, name) \ + open(name, fa->fa_flags, fa->fa_mode) +#define fileargs_fopen(fa, name, mode) \ + fopen(name, mode) +#define fileargs_free(fa) (free(fa)) +#endif + +#endif /* !_FILEARGS_H_ */ Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon Nov 12 17:10:44 2018 (r340372) +++ head/share/mk/src.libnames.mk Mon Nov 12 17:40:47 2018 (r340373) @@ -75,6 +75,7 @@ _LIBRARIES= \ cam \ casper \ cap_dns \ + cap_fileargs \ cap_grp \ cap_pwd \ cap_random \ @@ -238,6 +239,7 @@ _DP_cam= sbuf _DP_kvm= elf _DP_casper= nv _DP_cap_dns= nv +_DP_cap_fileargs= nv _DP_cap_grp= nv _DP_cap_pwd= nv _DP_cap_random= nv From owner-svn-src-head@freebsd.org Mon Nov 12 17:47:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80958110C903; Mon, 12 Nov 2018 17:47:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 076FC7A5DC; Mon, 12 Nov 2018 17:47:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C397E2400A; Mon, 12 Nov 2018 17:47:51 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACHlpZp060459; Mon, 12 Nov 2018 17:47:51 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACHlpQb060458; Mon, 12 Nov 2018 17:47:51 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121747.wACHlpQb060458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 17:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340374 - head/usr.bin/wc X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/wc X-SVN-Commit-Revision: 340374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 076FC7A5DC X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 17:47:52 -0000 Author: oshogbo Date: Mon Nov 12 17:47:51 2018 New Revision: 340374 URL: https://svnweb.freebsd.org/changeset/base/340374 Log: wc: sandbox wc using capsicum Reviewed by: AllanJude, emaste Differential Revision: https://reviews.freebsd.org/D14409 Modified: head/usr.bin/wc/Makefile head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/Makefile ============================================================================== --- head/usr.bin/wc/Makefile Mon Nov 12 17:40:47 2018 (r340373) +++ head/usr.bin/wc/Makefile Mon Nov 12 17:47:51 2018 (r340374) @@ -1,7 +1,15 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= wc LIBADD= xo + +.if ${MK_CASPER} != "no" +LIBADD+= casper +LIBADD+= cap_fileargs +CFLAGS+=-DWITH_CASPER +.endif .include Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Mon Nov 12 17:40:47 2018 (r340373) +++ head/usr.bin/wc/wc.c Mon Nov 12 17:47:51 2018 (r340374) @@ -44,9 +44,11 @@ static char sccsid[] = "@(#)wc.c 8.1 (Berkeley) 6/6/93 #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include #include #include @@ -61,6 +63,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +static fileargs_t *fa; static uintmax_t tlinect, twordct, tcharct, tlongline; static int doline, doword, dochar, domulti, dolongline; static volatile sig_atomic_t siginfo; @@ -90,6 +96,7 @@ int main(int argc, char *argv[]) { int ch, errors, total; + cap_rights_t rights; (void) setlocale(LC_CTYPE, ""); @@ -125,6 +132,26 @@ main(int argc, char *argv[]) (void)signal(SIGINFO, siginfo_handler); + fa = fileargs_init(argc, argv, O_RDONLY, 0, + cap_rights_init(&rights, CAP_READ, CAP_FSTAT)); + if (fa == NULL) { + xo_warn("Unable to init casper"); + exit(1); + } + + caph_cache_catpages(); + if (caph_limit_stdio() < 0) { + xo_warn("Unable to limit stdio"); + fileargs_free(fa); + exit(1); + } + + if (caph_enter() < 0) { + xo_warn("Unable to enter capability mode"); + fileargs_free(fa); + exit(1); + } + /* Wc's flags are on by default. */ if (doline + doword + dochar + domulti + dolongline == 0) doline = doword = dochar = 1; @@ -158,6 +185,7 @@ main(int argc, char *argv[]) xo_close_container("total"); } + fileargs_free(fa); xo_close_container("wc"); xo_finish(); exit(errors == 0 ? 0 : 1); @@ -206,7 +234,7 @@ cnt(const char *file) linect = wordct = charct = llct = tmpll = 0; if (file == NULL) fd = STDIN_FILENO; - else if ((fd = open(file, O_RDONLY, 0)) < 0) { + else if ((fd = fileargs_open(fa, file)) < 0) { xo_warn("%s: open", file); return (1); } From owner-svn-src-head@freebsd.org Mon Nov 12 17:52:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71ED9110CB37; Mon, 12 Nov 2018 17:52:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D32E97AA1A; Mon, 12 Nov 2018 17:52:14 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f42.google.com with SMTP id u19so2590416ioc.2; Mon, 12 Nov 2018 09:52:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qbDHWfmc7No+V/wQ65YiZG074lzwtN/PlogxVJQZ6qk=; b=f7MbUESJwEWi6UGVYF3b39FkkKd57/HLa0RqgN03aiEZmHk/DmcaqdYAjk1wfD+gMR 9/0/cPg8DIQkz/diuULLf54bAgKHl2IiS/M4REsMi91kDI7j9Tn2T3YbgCalCQO0V4Yh rHQ2muIjpXlG3IUIGvqFcY9LT9tp5ngoaD4uJ8JKu/5eHHuEno07Dz0bzWBV6KWKoMw5 8T2mDClMuyeIxjEpbKP5DOtKuQQOchoYaOu53hF+R+Zj647KRJm+fQxzu2XL2l39omY5 y2pdy5AWyJ7y+LKCv7XkrVLkFqrl+ka9wVsPLHsuZkYbye1vyyE8PCVC2axq7/EWu5hy TXXA== X-Gm-Message-State: AGRZ1gJaOtZnz0TyAdUc2g08C3YiZeyfuSKdvsrWWFKFmo31JVjP4edK GtnGpMQfakssR9BL6WCCIlE7r6DoXyEqIFmBI2hYnXRN X-Google-Smtp-Source: AJdET5dhX57nZucKe1+GkcZ4Wid6uc694xBdl2jTHE2yozC+fDqRy2ZnKFuhyTJUmkFTKAZQcrw74lzT61gvgr/J6l0= X-Received: by 2002:a6b:fe11:: with SMTP id x17-v6mr1422446ioh.294.1542045127468; Mon, 12 Nov 2018 09:52:07 -0800 (PST) MIME-Version: 1.0 References: <201811051925.wA5JPvSX076588@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Mon, 12 Nov 2018 12:51:54 -0500 Message-ID: Subject: Re: svn commit: r340156 - in head: . sys/sys To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: D32E97AA1A X-Spamd-Result: default: False [-4.12 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; IP_SCORE(-1.14)[ipnet: 209.85.128.0/17(-3.65), asn: 15169(-1.96), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; RCVD_IN_DNSWL_NONE(0.00)[42.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[42.166.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 17:52:15 -0000 On Mon, 5 Nov 2018 at 16:53, Antoine Brodin wrote: > > On Mon, Nov 5, 2018 at 8:26 PM Ed Maste wrote: > > > > Author: emaste > > Date: Mon Nov 5 19:25:57 2018 > > New Revision: 340156 > > URL: https://svnweb.freebsd.org/changeset/base/340156 > > > > Log: > > Remove backwards-compatibility sys/capability.h > > Hi, > > Please revert, after this change, most ports converted to capsicum > are no longer sandboxed (including pkg, tcpdump). Change was reverted in r340166 and affected ports are tracked as dependencies of PR 228878. PR 233007 - ports-mgmt/pkg Change to use capsicum.h was committed quite some time ago but is not yet in a pkg release. PR 233026 - sysutils/procenv Discussion ongoing, upstream issue https://github.com/jamesodhunt/procenv/issues/6 PR 233092 - lang/go Upstream pull request https://github.com/golang/go/pull/28742, likely use REINPLACE_CMD to patch the port (and the next two) until the change makes its way through. PR 233090 - dns/dnscrypt-proxy2 embedded file from go PR 233091 - devel/gitlab-shell embedded file from go From owner-svn-src-head@freebsd.org Mon Nov 12 17:55:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B78BA110CC16; Mon, 12 Nov 2018 17:55:31 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (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 DC85B7AC0D; Mon, 12 Nov 2018 17:55:30 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 8DAB82700402; Mon, 12 Nov 2018 12:55:23 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 8DAB82700402 Authentication-Results: duke.cs.duke.edu; dmarc=none header.from=cs.duke.edu DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1542045323; bh=IppCD6qPay/o7JCAMwc+AEV4vdwjnK7DmovNIzIU4wI=; h=Subject:To:From:Date:From; b=CiNlhcThP2x/9APxPH3XPJ9xfno4ngXshzQLubHCEcrQ8Gdsr5cOFxEioxsDxQUUN N0GLkWGO86PAzYxMotwyrMiHjzNySL/zJvStdSweGdCJUWBF/2bVbMIoJf7RI4xrfZ 3II4zCHWyfAtexOQczYGCpxuW9O04CRFeuyRtPDc/r8aLTu1jSRKKH2XKYvpNUeL2/ arx9QY8o15cVNInAKBB3lqTNcZqGCbwWZ/6YB6QB/pnKBnm5XopajwVAX5gJVrj9c7 XTzatn0HypH/mwCImqJpEwVpLnau8ZxgQ8LjkqWxzkAZCh7SGMy5nNvG2vY0rQYPRN v1whpdnvyBZxA== Subject: Re: svn commit: r340097 - in head/sys: kern sys To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811030343.wA33hXRD067832@repo.freebsd.org> From: Andrew Gallatin Message-ID: Date: Mon, 12 Nov 2018 12:55:22 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <201811030343.wA33hXRD067832@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DC85B7AC0D X-Spamd-Result: default: False [-3.41 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[cs.duke.edu]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:152.3.140.0/23]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.31)[0.313,0]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_IN_DNSWL_MED(-0.20)[1.140.3.152.list.dnswl.org : 127.0.11.2]; DKIM_TRACE(0.00)[cs.duke.edu:+]; DMARC_POLICY_ALLOW(-0.50)[cs.duke.edu,none]; MX_GOOD(-0.01)[mx.oit.duke.edu]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)]; ASN(0.00)[asn:13371, ipnet:152.3.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 17:55:32 -0000 On 11/2/18 11:43 PM, Matt Macy wrote: > Author: mmacy > Date: Sat Nov 3 03:43:32 2018 > New Revision: 340097 > URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_340097&d=DwIDaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=C46M75X_gZcJY3aXGYy_P4DQJhD-uEFU00BP6AzHPik&s=JvPbkoXDB3zzo2IjmopaQxJ3kRcIwzosrpY4elq80LQ&e= > > Log: > Convert epoch to read / write records per cpu > > In discussing D17503 "Run epoch calls sooner and more reliably" with > sbahra@ we came to the conclusion that epoch is currently misusing the > ck_epoch API. It isn't safe to do a "write side" operation (ck_epoch_call > or ck_epoch_poll) in the middle of a "read side" section. Since, by definition, > it's possible to be preempted during the middle of an EPOCH_PREEMPT > epoch the GC task might call ck_epoch_poll or another thread might call > ck_epoch_call on the same section. The right solution is ultimately to change > the way that ck_epoch works for this use case. However, as a stopgap for > 12 we agreed to simply have separate records for each use case. > > Tested by: pho@ > > MFC after: 3 days Hi Matt, Can you elaborate why this is needed? I seem to recall that Samy Al Bahra made some upstream changes to CK that modified the CK API to legitimize our use of the API, and these were brought into FreeBSD in r339375. Were these insufficient? Also, it would be great if you could get review on epoch changes. Epoch is totally awesome, and I'm thrilled that you brought it in. However, it is very tricky, and it seems like changes here could benefit from review. Thanks, Drew From owner-svn-src-head@freebsd.org Mon Nov 12 17:57:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA77110CD3C; Mon, 12 Nov 2018 17:57:13 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 556E07ADD9; Mon, 12 Nov 2018 17:57:13 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37F2D241A4; Mon, 12 Nov 2018 17:57:13 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACHvDqh065532; Mon, 12 Nov 2018 17:57:13 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACHvDrW065531; Mon, 12 Nov 2018 17:57:13 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201811121757.wACHvDrW065531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Mon, 12 Nov 2018 17:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340375 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jch X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 340375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 556E07ADD9 X-Spamd-Result: default: False [-102.52 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.41)[-0.406,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 17:57:14 -0000 Author: jch Date: Mon Nov 12 17:57:12 2018 New Revision: 340375 URL: https://svnweb.freebsd.org/changeset/base/340375 Log: cxgbe/netmap: Fix cxgbe netmap when interface is DOWN A kernel panic can occur if the cxgbe interface is DOWN when activating netmap. This patch prevents the driver from freeing up cxgbe netmap resources when they have not been allocated. Submitted by: Nicolas Witkowski Reviewed by: np MFC after: 1 week Sponsored by: Verisign, Inc. Differential Revision: https://reviews.freebsd.org/D17802 Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Mon Nov 12 17:47:51 2018 (r340374) +++ head/sys/dev/cxgbe/t4_netmap.c Mon Nov 12 17:57:12 2018 (r340375) @@ -492,6 +492,9 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v ASSERT_SYNCHRONIZED_OP(sc); + if (!nm_netmap_on(na)) + return (0); + if ((vi->flags & VI_INIT_DONE) == 0) return (0); From owner-svn-src-head@freebsd.org Mon Nov 12 17:59:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07619110CF00; Mon, 12 Nov 2018 17:59:17 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FFC57AFD9; Mon, 12 Nov 2018 17:59:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5ACF8241A9; Mon, 12 Nov 2018 17:59:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACHxGkK065661; Mon, 12 Nov 2018 17:59:16 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACHxFEn065659; Mon, 12 Nov 2018 17:59:15 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121759.wACHxFEn065659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 17:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340376 - head/usr.bin/head X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/head X-SVN-Commit-Revision: 340376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FFC57AFD9 X-Spamd-Result: default: False [-102.59 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.48)[-0.476,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 17:59:17 -0000 Author: oshogbo Date: Mon Nov 12 17:59:15 2018 New Revision: 340376 URL: https://svnweb.freebsd.org/changeset/base/340376 Log: head: sandbox using capsicum Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D14409 Modified: head/usr.bin/head/Makefile head/usr.bin/head/head.c Modified: head/usr.bin/head/Makefile ============================================================================== --- head/usr.bin/head/Makefile Mon Nov 12 17:57:12 2018 (r340375) +++ head/usr.bin/head/Makefile Mon Nov 12 17:59:15 2018 (r340376) @@ -8,4 +8,10 @@ PROG= head HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.if ${MK_CASPER} != "no" && !defined(RESCUE) +LIBADD+= casper +LIBADD+= cap_fileargs +CFLAGS+=-DWITH_CASPER +.endif + .include Modified: head/usr.bin/head/head.c ============================================================================== --- head/usr.bin/head/head.c Mon Nov 12 17:57:12 2018 (r340375) +++ head/usr.bin/head/head.c Mon Nov 12 17:59:15 2018 (r340376) @@ -43,10 +43,13 @@ static char sccsid[] = "@(#)head.c 8.2 (Berkeley) 5/4/ #include __FBSDID("$FreeBSD$"); +#include #include +#include #include #include +#include #include #include #include @@ -54,6 +57,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + /* * head - give the first few lines of a stream or of each of a set of files * @@ -79,6 +85,8 @@ main(int argc, char *argv[]) char *ep; off_t bytecnt; int ch, first, linecnt, eval; + fileargs_t *fa; + cap_rights_t rights; linecnt = -1; eval = 0; @@ -106,13 +114,22 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + fa = fileargs_init(argc, argv, O_RDONLY, 0, + cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL)); + if (fa == NULL) + errx(1, "unable to init casper"); + + caph_cache_catpages(); + if (caph_limit_stdio() < 0 || caph_enter_casper() < 0) + err(1, "unable to enter capability mode"); + if (linecnt != -1 && bytecnt != -1) errx(1, "can't combine line and byte counts"); if (linecnt == -1) linecnt = 10; if (*argv != NULL) { for (first = 1; *argv != NULL; ++argv) { - if ((fp = fopen(*argv, "r")) == NULL) { + if ((fp = fileargs_fopen(fa, *argv, "r")) == NULL) { warn("%s", *argv); eval = 1; continue; @@ -133,6 +150,7 @@ main(int argc, char *argv[]) else head_bytes(stdin, bytecnt); + fileargs_free(fa); exit(eval); } From owner-svn-src-head@freebsd.org Mon Nov 12 18:01:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04E82110D0F8; Mon, 12 Nov 2018 18:01:37 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 884777B359; Mon, 12 Nov 2018 18:01:36 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69CFE241FF; Mon, 12 Nov 2018 18:01:36 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACI1ao9066747; Mon, 12 Nov 2018 18:01:36 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACI1aUk066746; Mon, 12 Nov 2018 18:01:36 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121801.wACI1aUk066746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 18:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340377 - head/usr.bin/wc X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/wc X-SVN-Commit-Revision: 340377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 884777B359 X-Spamd-Result: default: False [-102.30 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.19)[-0.195,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 18:01:37 -0000 Author: oshogbo Date: Mon Nov 12 18:01:36 2018 New Revision: 340377 URL: https://svnweb.freebsd.org/changeset/base/340377 Log: wc: We should sandbox wc only if Capers is available. Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Mon Nov 12 17:59:15 2018 (r340376) +++ head/usr.bin/wc/wc.c Mon Nov 12 18:01:36 2018 (r340377) @@ -146,7 +146,7 @@ main(int argc, char *argv[]) exit(1); } - if (caph_enter() < 0) { + if (caph_enter_with_casper() < 0) { xo_warn("Unable to enter capability mode"); fileargs_free(fa); exit(1); From owner-svn-src-head@freebsd.org Mon Nov 12 18:34:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55465110DED2; Mon, 12 Nov 2018 18:34:56 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A25757CBFE; Mon, 12 Nov 2018 18:34:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82F3A24889; Mon, 12 Nov 2018 18:34:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACIYtM6088614; Mon, 12 Nov 2018 18:34:55 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACIYt1A088613; Mon, 12 Nov 2018 18:34:55 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121834.wACIYt1A088613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 18:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340380 - head/usr.bin/wc X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/wc X-SVN-Commit-Revision: 340380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A25757CBFE X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 18:34:56 -0000 Author: oshogbo Date: Mon Nov 12 18:34:55 2018 New Revision: 340380 URL: https://svnweb.freebsd.org/changeset/base/340380 Log: s/caph_enter_with_casper/caph_enter_casper/ Reported by: npn Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Mon Nov 12 18:23:51 2018 (r340379) +++ head/usr.bin/wc/wc.c Mon Nov 12 18:34:55 2018 (r340380) @@ -146,7 +146,7 @@ main(int argc, char *argv[]) exit(1); } - if (caph_enter_with_casper() < 0) { + if (caph_enter_capser() < 0) { xo_warn("Unable to enter capability mode"); fileargs_free(fa); exit(1); From owner-svn-src-head@freebsd.org Mon Nov 12 18:37:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E98EF110E047; Mon, 12 Nov 2018 18:37:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 733BB7CFCE; Mon, 12 Nov 2018 18:37:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 540022488D; Mon, 12 Nov 2018 18:37:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACIbWjW089034; Mon, 12 Nov 2018 18:37:32 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACIbWWU089033; Mon, 12 Nov 2018 18:37:32 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121837.wACIbWWU089033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 18:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340381 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 340381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 733BB7CFCE X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 18:37:33 -0000 Author: oshogbo Date: Mon Nov 12 18:37:31 2018 New Revision: 340381 URL: https://svnweb.freebsd.org/changeset/base/340381 Log: Fix typo in the comparison. This fix build with gcc. Reported by: jenkins Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Mon Nov 12 18:34:55 2018 (r340380) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Mon Nov 12 18:37:31 2018 (r340381) @@ -176,7 +176,7 @@ fileargs_init(int argc, char *argv[], int flags, mode_ { nvlist_t *limits; - if (argv <= 0 || argv == NULL) { + if (argc <= 0 || argv == NULL) { return (fileargs_create(NULL, 0)); } @@ -194,7 +194,7 @@ fileargs_cinit(cap_channel_t *cas, int argc, char *arg { nvlist_t *limits; - if (argv <= 0 || argv == NULL) { + if (argc <= 0 || argv == NULL) { return (fileargs_create(NULL, 0)); } From owner-svn-src-head@freebsd.org Mon Nov 12 18:43:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AECF110E434; Mon, 12 Nov 2018 18:43:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18A4A7D5A8; Mon, 12 Nov 2018 18:43:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDF1224A33; Mon, 12 Nov 2018 18:43:51 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACIhpge094086; Mon, 12 Nov 2018 18:43:51 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACIhpDM094085; Mon, 12 Nov 2018 18:43:51 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811121843.wACIhpDM094085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Nov 2018 18:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340382 - head/usr.bin/wc X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/wc X-SVN-Commit-Revision: 340382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18A4A7D5A8 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 18:43:52 -0000 Author: oshogbo Date: Mon Nov 12 18:43:51 2018 New Revision: 340382 URL: https://svnweb.freebsd.org/changeset/base/340382 Log: s/caph_enter_capser/caph_enter_casper/g Reported by: npn Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Mon Nov 12 18:37:31 2018 (r340381) +++ head/usr.bin/wc/wc.c Mon Nov 12 18:43:51 2018 (r340382) @@ -146,7 +146,7 @@ main(int argc, char *argv[]) exit(1); } - if (caph_enter_capser() < 0) { + if (caph_enter_casper() < 0) { xo_warn("Unable to enter capability mode"); fileargs_free(fa); exit(1); From owner-svn-src-head@freebsd.org Mon Nov 12 19:12:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09693110F0C9; Mon, 12 Nov 2018 19:12:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 847A77E671; Mon, 12 Nov 2018 19:12:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66FC024DFE; Mon, 12 Nov 2018 19:12:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACJCFt6009831; Mon, 12 Nov 2018 19:12:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACJCFjr009830; Mon, 12 Nov 2018 19:12:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811121912.wACJCFjr009830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Nov 2018 19:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340383 - head/lib/libc X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc X-SVN-Commit-Revision: 340383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 847A77E671 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 19:12:16 -0000 Author: kib Date: Mon Nov 12 19:12:14 2018 New Revision: 340383 URL: https://svnweb.freebsd.org/changeset/base/340383 Log: Create namespace for the symbols added during 13-CURRENT cycle. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/Versions.def Modified: head/lib/libc/Versions.def ============================================================================== --- head/lib/libc/Versions.def Mon Nov 12 18:43:51 2018 (r340382) +++ head/lib/libc/Versions.def Mon Nov 12 19:12:14 2018 (r340383) @@ -31,6 +31,9 @@ FBSD_1.4 { FBSD_1.5 { } FBSD_1.4; +# This version was first added to 13.0-current. +FBSD_1.6 { +} FBSD_1.5; # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries @@ -39,4 +42,4 @@ FBSD_1.5 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.5; +} FBSD_1.6; From owner-svn-src-head@freebsd.org Mon Nov 12 19:17:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C535110F257; Mon, 12 Nov 2018 19:17:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2BE67E94A; Mon, 12 Nov 2018 19:17:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A19B524F47; Mon, 12 Nov 2018 19:17:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACJHR1x010085; Mon, 12 Nov 2018 19:17:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACJHRbg010082; Mon, 12 Nov 2018 19:17:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811121917.wACJHRbg010082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Nov 2018 19:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340384 - in head/sys: amd64/amd64 x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 x86/include x86/x86 X-SVN-Commit-Revision: 340384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C2BE67E94A X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 19:17:28 -0000 Author: kib Date: Mon Nov 12 19:17:26 2018 New Revision: 340384 URL: https://svnweb.freebsd.org/changeset/base/340384 Log: Apply fix to un-cripple max cpu id on BSP earlier. We need to know actual value for the standard extended features before ifuncs are resolved. Reported and tested by: madpilot Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Nov 12 19:12:14 2018 (r340383) +++ head/sys/amd64/amd64/machdep.c Mon Nov 12 19:17:26 2018 (r340384) @@ -1581,6 +1581,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) identify_cpu1(); identify_hypervisor(); + identify_cpu_fixup_bsp(); identify_cpu2(); initializecpucache(); Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Mon Nov 12 19:12:14 2018 (r340383) +++ head/sys/x86/include/x86_var.h Mon Nov 12 19:17:26 2018 (r340384) @@ -129,6 +129,7 @@ void dump_drop_page(vm_paddr_t); void finishidentcpu(void); void identify_cpu1(void); void identify_cpu2(void); +void identify_cpu_fixup_bsp(void); void identify_hypervisor(void); void initializecpu(void); void initializecpucache(void); Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Mon Nov 12 19:12:14 2018 (r340383) +++ head/sys/x86/x86/identcpu.c Mon Nov 12 19:17:26 2018 (r340384) @@ -1467,6 +1467,19 @@ identify_cpu2(void) } } +void +identify_cpu_fixup_bsp(void) +{ + u_int regs[4]; + + cpu_vendor_id = find_cpu_vendor_id(); + + if (fix_cpuid()) { + do_cpuid(0, regs); + cpu_high = regs[0]; + } +} + /* * Final stage of CPU identification. */ @@ -1478,12 +1491,7 @@ finishidentcpu(void) u_char ccr3; #endif - cpu_vendor_id = find_cpu_vendor_id(); - - if (fix_cpuid()) { - do_cpuid(0, regs); - cpu_high = regs[0]; - } + identify_cpu_fixup_bsp(); if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { do_cpuid(5, regs); From owner-svn-src-head@freebsd.org Mon Nov 12 20:38:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07BDC1122353; Mon, 12 Nov 2018 20:38:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2B381B08; Mon, 12 Nov 2018 20:38:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66D9425C71; Mon, 12 Nov 2018 20:38:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACKciHp050789; Mon, 12 Nov 2018 20:38:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACKciJL050788; Mon, 12 Nov 2018 20:38:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811122038.wACKciJL050788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Nov 2018 20:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340385 - head/contrib/elftoolchain/strings X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/strings X-SVN-Commit-Revision: 340385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A2B381B08 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 20:38:45 -0000 Author: emaste Date: Mon Nov 12 20:38:43 2018 New Revision: 340385 URL: https://svnweb.freebsd.org/changeset/base/340385 Log: strings: enter capability mode when operating on stdin Reviewed by: oshogbo MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Mon Nov 12 19:17:26 2018 (r340384) +++ head/contrib/elftoolchain/strings/strings.c Mon Nov 12 20:38:43 2018 (r340385) @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -188,9 +189,12 @@ main(int argc, char **argv) if (!min_len) min_len = 4; - if (!*argv) - rc = find_strings("{standard input}", 0, 0); - else while (*argv) { + if (!*argv) { + if (caph_limit_stdio() < 0 || caph_enter() < 0) + err(1, "unable to enter capability mode"); + return (find_strings("{standard input}", 0, 0)); + } + while (*argv) { if (handle_file(*argv) != 0) rc = 1; argv++; From owner-svn-src-head@freebsd.org Mon Nov 12 20:44:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 088FC11225CF; Mon, 12 Nov 2018 20:44:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B05A82795; Mon, 12 Nov 2018 20:44:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5241D25E03; Mon, 12 Nov 2018 20:44:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACKiNuW055735; Mon, 12 Nov 2018 20:44:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACKiM9u055731; Mon, 12 Nov 2018 20:44:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811122044.wACKiM9u055731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Nov 2018 20:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340386 - in head: lib share/mk targets/pseudo/userland/lib X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib share/mk targets/pseudo/userland/lib X-SVN-Commit-Revision: 340386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B05A82795 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 20:44:24 -0000 Author: emaste Date: Mon Nov 12 20:44:22 2018 New Revision: 340386 URL: https://svnweb.freebsd.org/changeset/base/340386 Log: retire LINKER_FEATURES filter flag And build libdl unconditionally. All supported FreeBSD linkers accept -F / --filter so there is no need to test for support. Discussed with: kib Sponsored by: The FreeBSD Foundation Modified: head/lib/Makefile head/share/mk/bsd.linker.mk head/targets/pseudo/userland/lib/Makefile.depend Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Nov 12 20:38:43 2018 (r340385) +++ head/lib/Makefile Mon Nov 12 20:44:22 2018 (r340386) @@ -42,7 +42,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libdevctl \ libdevinfo \ libdevstat \ - ${_libdl} \ + libdl \ libdwarf \ libedit \ libelftc \ @@ -191,10 +191,6 @@ SUBDIR.${MK_BHYVE}+= libvmmapi .if ${MACHINE_CPUARCH} != "sparc64" _libproc= libproc _librtld_db= librtld_db -.endif - -.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mfilter} -_libdl= libdl .endif SUBDIR.${MK_OPENSSL}+= libmp Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Mon Nov 12 20:38:43 2018 (r340385) +++ head/share/mk/bsd.linker.mk Mon Nov 12 20:44:22 2018 (r340386) @@ -86,9 +86,6 @@ ${X_}LINKER_FEATURES= ${X_}LINKER_FEATURES+= build-id ${X_}LINKER_FEATURES+= ifunc .endif -.if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 -${X_}LINKER_FEATURES+= filter -.endif .if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 ${X_}LINKER_FEATURES+= retpoline .endif Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Mon Nov 12 20:38:43 2018 (r340385) +++ head/targets/pseudo/userland/lib/Makefile.depend Mon Nov 12 20:44:22 2018 (r340386) @@ -60,6 +60,7 @@ DIRDEPS = \ lib/libdevdctl \ lib/libdevinfo \ lib/libdevstat \ + lib/libdl \ lib/libdwarf \ lib/libedit/edit/readline \ lib/libelf \ @@ -212,10 +213,6 @@ DIRDEPS+= \ .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "powerpc" DIRDEPS+= stand/libsa32 -.endif - -.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mfilter} -DIRDEPS+= lib/libdl .endif .if ${MK_NAND} != "no" From owner-svn-src-head@freebsd.org Mon Nov 12 21:01:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 145821122A46; Mon, 12 Nov 2018 21:01:30 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96BF9830CF; Mon, 12 Nov 2018 21:01:29 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76E44260F7; Mon, 12 Nov 2018 21:01:29 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACL1T77064099; Mon, 12 Nov 2018 21:01:29 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACL1S3E064096; Mon, 12 Nov 2018 21:01:28 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201811122101.wACL1S3E064096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 12 Nov 2018 21:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340387 - in head/sys: amd64/conf i386/conf X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in head/sys: amd64/conf i386/conf X-SVN-Commit-Revision: 340387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96BF9830CF X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 21:01:30 -0000 Author: zeising (doc,ports committer) Date: Mon Nov 12 21:01:28 2018 New Revision: 340387 URL: https://svnweb.freebsd.org/changeset/base/340387 Log: Add evdev support to amd64 and i386 kernels Include evdev support and drivers in the amd64 and i386 GENERIC and MINIMAL kernels. Evdev is used by X and wayland to handle input devices, and this change, together with upcomming changes in ports will make us handle input devices better in graphical UIs. Reviewed by: wulf, bapt, imp Approved by: imp Differential Revision: https://reviews.freebsd.org/D17912 Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/i386/conf/GENERIC head/sys/i386/conf/MINIMAL Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Nov 12 20:44:22 2018 (r340386) +++ head/sys/amd64/conf/GENERIC Mon Nov 12 21:01:28 2018 (r340387) @@ -372,3 +372,8 @@ device vmx # VMware VMXNET3 Ethernet # Netmap provides direct access to TX/RX rings on supported NICs device netmap # netmap(4) support + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Mon Nov 12 20:44:22 2018 (r340386) +++ head/sys/amd64/conf/MINIMAL Mon Nov 12 21:01:28 2018 (r340387) @@ -147,3 +147,8 @@ device bpf # Berkeley packet filter # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Nov 12 20:44:22 2018 (r340386) +++ head/sys/i386/conf/GENERIC Mon Nov 12 21:01:28 2018 (r340387) @@ -366,3 +366,8 @@ device xenpci # Xen HVM Hypervisor services driver # VMware support device vmx # VMware VMXNET3 Ethernet + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev Modified: head/sys/i386/conf/MINIMAL ============================================================================== --- head/sys/i386/conf/MINIMAL Mon Nov 12 20:44:22 2018 (r340386) +++ head/sys/i386/conf/MINIMAL Mon Nov 12 21:01:28 2018 (r340387) @@ -148,3 +148,8 @@ device bpf # Berkeley packet filter # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev From owner-svn-src-head@freebsd.org Mon Nov 12 22:12:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A96C211250F9; Mon, 12 Nov 2018 22:12:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 2350A87133; Mon, 12 Nov 2018 22:12:17 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wACMCGuK027643; Mon, 12 Nov 2018 14:12:16 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wACMCGAw027642; Mon, 12 Nov 2018 14:12:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811122212.wACMCGAw027642@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340387 - in head/sys: amd64/conf i386/conf In-Reply-To: <201811122101.wACL1S3E064096@repo.freebsd.org> To: Niclas Zeising Date: Mon, 12 Nov 2018 14:12:16 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 2350A87133 X-Spamd-Result: default: False [0.68 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.03)[-0.033,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.12)[-0.117,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.04)[-0.041,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 22:12:18 -0000 > Author: zeising (doc,ports committer) > Date: Mon Nov 12 21:01:28 2018 > New Revision: 340387 > URL: https://svnweb.freebsd.org/changeset/base/340387 > > Log: > Add evdev support to amd64 and i386 kernels > > Include evdev support and drivers in the amd64 and i386 GENERIC and MINIMAL > kernels. Evdev is used by X and wayland to handle input devices, and this > change, together with upcomming changes in ports will make us handle input > devices better in graphical UIs. Well these "upcomming" changes in ports effect aarch64 and powerpc who are also consumers of X? > Reviewed by: wulf, bapt, imp > Approved by: imp > Differential Revision: https://reviews.freebsd.org/D17912 > > Modified: > head/sys/amd64/conf/GENERIC > head/sys/amd64/conf/MINIMAL > head/sys/i386/conf/GENERIC > head/sys/i386/conf/MINIMAL > > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERIC Mon Nov 12 20:44:22 2018 (r340386) > +++ head/sys/amd64/conf/GENERIC Mon Nov 12 21:01:28 2018 (r340387) > @@ -372,3 +372,8 @@ device vmx # VMware VMXNET3 Ethernet > > # Netmap provides direct access to TX/RX rings on supported NICs > device netmap # netmap(4) support > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > Modified: head/sys/amd64/conf/MINIMAL > ============================================================================== > --- head/sys/amd64/conf/MINIMAL Mon Nov 12 20:44:22 2018 (r340386) > +++ head/sys/amd64/conf/MINIMAL Mon Nov 12 21:01:28 2018 (r340387) > @@ -147,3 +147,8 @@ device bpf # Berkeley packet filter > # NOTE: XENHVM depends on xenpci. They must be added or removed together. > options XENHVM # Xen HVM kernel infrastructure > device xenpci # Xen HVM Hypervisor services driver > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > Modified: head/sys/i386/conf/GENERIC > ============================================================================== > --- head/sys/i386/conf/GENERIC Mon Nov 12 20:44:22 2018 (r340386) > +++ head/sys/i386/conf/GENERIC Mon Nov 12 21:01:28 2018 (r340387) > @@ -366,3 +366,8 @@ device xenpci # Xen HVM Hypervisor services driver > > # VMware support > device vmx # VMware VMXNET3 Ethernet > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > Modified: head/sys/i386/conf/MINIMAL > ============================================================================== > --- head/sys/i386/conf/MINIMAL Mon Nov 12 20:44:22 2018 (r340386) > +++ head/sys/i386/conf/MINIMAL Mon Nov 12 21:01:28 2018 (r340387) > @@ -148,3 +148,8 @@ device bpf # Berkeley packet filter > # NOTE: XENHVM depends on xenpci. They must be added or removed together. > options XENHVM # Xen HVM kernel infrastructure > device xenpci # Xen HVM Hypervisor services driver > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Nov 12 22:18:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69C9B1125374; Mon, 12 Nov 2018 22:18:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB62B87592; Mon, 12 Nov 2018 22:18:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC56E26D36; Mon, 12 Nov 2018 22:18:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACMID3s005328; Mon, 12 Nov 2018 22:18:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACMICML005320; Mon, 12 Nov 2018 22:18:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811122218.wACMICML005320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Nov 2018 22:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340390 - in head/sys/dts: . arm arm/overlays arm64 arm64/overlays mips powerpc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/dts: . arm arm/overlays arm64 arm64/overlays mips powerpc X-SVN-Commit-Revision: 340390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB62B87592 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 22:18:14 -0000 Author: kevans Date: Mon Nov 12 22:18:11 2018 New Revision: 340390 URL: https://svnweb.freebsd.org/changeset/base/340390 Log: Fix test-dts{,o} targets There were two main problems here: 1.) sys/dts/Makefile.inc is not included from various */overlays directories by default, only ../Makefile.inc 2.) When shelling out for DTS/DTSO, cwd != .CURDIR, so enumeration always failed These changes allow make test-dts and make test-dtso to function in their respective directories. Reviewed by: manu MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17961 Added: head/sys/dts/arm/Makefile.inc (contents, props changed) head/sys/dts/arm64/Makefile.inc (contents, props changed) Modified: head/sys/dts/Makefile.inc head/sys/dts/arm/Makefile head/sys/dts/arm/overlays/Makefile head/sys/dts/arm64/Makefile head/sys/dts/arm64/overlays/Makefile head/sys/dts/mips/Makefile head/sys/dts/powerpc/Makefile Modified: head/sys/dts/Makefile.inc ============================================================================== --- head/sys/dts/Makefile.inc Mon Nov 12 21:53:47 2018 (r340389) +++ head/sys/dts/Makefile.inc Mon Nov 12 22:18:11 2018 (r340390) @@ -5,9 +5,9 @@ SYSDIR?=${SRCTOP}/sys test-dts: .for dts in ${DTS} @env MACHINE=`basename ${.CURDIR}` ${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${dts} /tmp +.endfor test-dtso: .for dtso in ${DTSO} @env MACHINE=`basename ${.CURDIR}` ${SYSDIR}/tools/fdt/make_dtbo.sh ${SYSDIR} ${dtso} /tmp - .endfor Modified: head/sys/dts/arm/Makefile ============================================================================== --- head/sys/dts/arm/Makefile Mon Nov 12 21:53:47 2018 (r340389) +++ head/sys/dts/arm/Makefile Mon Nov 12 22:18:11 2018 (r340390) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Added: head/sys/dts/arm/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm/Makefile.inc Mon Nov 12 22:18:11 2018 (r340390) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: head/sys/dts/arm/overlays/Makefile ============================================================================== --- head/sys/dts/arm/overlays/Makefile Mon Nov 12 21:53:47 2018 (r340389) +++ head/sys/dts/arm/overlays/Makefile Mon Nov 12 22:18:11 2018 (r340390) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTSO!=ls *.dtso +DTSO!=ls ${.CURDIR}/*.dtso all: test-dtso Modified: head/sys/dts/arm64/Makefile ============================================================================== --- head/sys/dts/arm64/Makefile Mon Nov 12 21:53:47 2018 (r340389) +++ head/sys/dts/arm64/Makefile Mon Nov 12 22:18:11 2018 (r340390) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Added: head/sys/dts/arm64/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/Makefile.inc Mon Nov 12 22:18:11 2018 (r340390) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: head/sys/dts/arm64/overlays/Makefile ============================================================================== --- head/sys/dts/arm64/overlays/Makefile Mon Nov 12 21:53:47 2018 (r340389) +++ head/sys/dts/arm64/overlays/Makefile Mon Nov 12 22:18:11 2018 (r340390) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTSO!=ls *.dtso +DTSO!=ls ${.CURDIR}/*.dtso all: test-dtso Modified: head/sys/dts/mips/Makefile ============================================================================== --- head/sys/dts/mips/Makefile Mon Nov 12 21:53:47 2018 (r340389) +++ head/sys/dts/mips/Makefile Mon Nov 12 22:18:11 2018 (r340390) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Modified: head/sys/dts/powerpc/Makefile ============================================================================== --- head/sys/dts/powerpc/Makefile Mon Nov 12 21:53:47 2018 (r340389) +++ head/sys/dts/powerpc/Makefile Mon Nov 12 22:18:11 2018 (r340390) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts From owner-svn-src-head@freebsd.org Mon Nov 12 22:34:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 279621125869; Mon, 12 Nov 2018 22:34:03 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 921B1887E5; Mon, 12 Nov 2018 22:34:02 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 690A817086; Mon, 12 Nov 2018 22:33:56 +0000 (UTC) Date: Mon, 12 Nov 2018 22:33:54 +0000 From: Mark Linimon To: rgrimes@freebsd.org Cc: cem@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , woodsb02@freebsd.org Subject: Re: svn commit: r340326 - head Message-ID: <20181112223354.GA25202@lonesome.com> References: <201811121400.wACE0JK5025628@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811121400.wACE0JK5025628@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 921B1887E5 X-Spamd-Result: default: False [-1.94 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.934,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.91)[-0.908,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lonesome.com]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_IN_DNSWL_MED(-0.20)[11.6.222.18.list.dnswl.org : 127.0.5.2]; MX_GOOD(-0.01)[mail.soaustin.net]; NEURAL_HAM_SHORT(-0.72)[-0.716,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-0.07)[ipnet: 18.220.0.0/14(0.47), asn: 16509(-0.72), country: US(-0.09)]; ASN(0.00)[asn:16509, ipnet:18.220.0.0/14, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 22:34:03 -0000 On Mon, Nov 12, 2018 at 06:00:19AM -0800, Rodney W. Grimes wrote: > it is not the change that I am ranting about, but the fact that the > process is broken. If the "process" must be followed absolutely, then FreeBSD has already failed. This was a text file, advisory to users only; no executable code. Ben clearly made a mistake in including you in the review list. This does not excuse your shouting. You need to take some time away from the keyboard. Your response is disproportionate and demotivating. mcl From owner-svn-src-head@freebsd.org Tue Nov 13 00:23:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98F4F1127FE8 for ; Tue, 13 Nov 2018 00:23:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12b.google.com (mail-it1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A40F58BA64 for ; Tue, 13 Nov 2018 00:23:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12b.google.com with SMTP id a205-v6so9907064itd.4 for ; Mon, 12 Nov 2018 16:23:05 -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=EGkRyWSzmjWBuxa5M/YjPW48+EEn/50FiU/Vik3i6dw=; b=YHTIAjAF2eNY+WHzISR+kuDSxHdb5+gDsQO2SB9Exp+gQoyuxuUo3or6iEGmgWyP04 B7vP6+BRLhIJfV67fstXFEDmPxJrDHWHFLCJV4TheZmxw/dxaGXir5E4qK8KVB26aS2E YOLG2saSkphA/x1T+QJ40+dP9o7YdVeFiNNWibChDqLIkcncbQORlnmVGcMhV39//BPt RIePLGQQph4iHA1PtkvPYMWyUNCFVMkPEtW0nTKLQvAhp5hFgdIlMbrjLqZ7O3Iyl+P5 K28GexqFG3KtxHn8dMbiQ79JU9Yzfc2yKEhumq1v6qAWYpea94BnXSZ6mvm1Rzxkecz+ /JLw== 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=EGkRyWSzmjWBuxa5M/YjPW48+EEn/50FiU/Vik3i6dw=; b=gFj1nanBAJvvdl9q0iOWXeyfDYz95uLIaKKMxJMxyHYB+U222vHDuspbWRwKs4wRLM ummyHEGjJGyJcpc2YnULs0dQtG0LID2O4rrSJ1dDDmYw14Z0OaDuAvhwnpN5+pJFRS/k o6cJc8dkiX/dKsq6yoo2On8TH0LWictrHTTnTH53klhX5b3QtQB2vby2Yt8SLtlkLobW 0OIl7QwrWUIzDoFg+a6YnqPwxQoPJhIZh9p1mtd/bvke/BxMWvwXk6pxMxLSBSzfe8zV otrMfxMy+iwZdWJMbtccfyREKf8NDwMSIeC/OEDnB8wDkLsUBkOkxR3m34HecNmn0fiS 97wA== X-Gm-Message-State: AGRZ1gJpxGLdxzj/9iKn/B/O65RBL6o3aowzE6G6g59K2PgsWa/FIqIG elfyjd2UWvhVjrIf7xiWh7bp8zF1AuKKtTGrnK782g== X-Google-Smtp-Source: AJdET5ewwu7U1EdQ3XrzF3zCVZ5MQsnCLWplvM8zz5xbE3jR9sCy767gMYnFWdfAdol6Gp4ZUYRMIXC6sEjtDWxvIj0= X-Received: by 2002:a02:3b08:: with SMTP id c8-v6mr445217jaa.93.1542068584784; Mon, 12 Nov 2018 16:23:04 -0800 (PST) MIME-Version: 1.0 References: <201811122101.wACL1S3E064096@repo.freebsd.org> <201811122212.wACMCGAw027642@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811122212.wACMCGAw027642@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 12 Nov 2018 17:22:49 -0700 Message-ID: Subject: Re: svn commit: r340387 - in head/sys: amd64/conf i386/conf To: "Rodney W. Grimes" Cc: Niclas Zeising , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: A40F58BA64 X-Spamd-Result: default: False [-3.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[b.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.99)[ipnet: 2607:f8b0::/32(-2.90), asn: 15169(-1.94), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 00:23:06 -0000 On Mon, Nov 12, 2018, 3:12 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > Author: zeising (doc,ports committer) > > Date: Mon Nov 12 21:01:28 2018 > > New Revision: 340387 > > URL: https://svnweb.freebsd.org/changeset/base/340387 > > > > Log: > > Add evdev support to amd64 and i386 kernels > > > > Include evdev support and drivers in the amd64 and i386 GENERIC and > MINIMAL > > kernels. Evdev is used by X and wayland to handle input devices, and > this > > change, together with upcomming changes in ports will make us handle > input > > devices better in graphical UIs. > > Well these "upcomming" changes in ports effect aarch64 and powerpc > who are also consumers of X? > Likely. Though there is little experience with them, so we don't know if it is even safe to turn them on there yet. This has taken 6 months to get stable on x86 due to its fragile console locking protocol. Similar time has not been invested elsewhere, so until that happens, we should keep them off by default. Otherwise we run the risk of destabilizing these platforms, even for people who don't use X. As tier 2 platforms, this has been how we've traditionally approached risk. Even though aarch64 is approaching tier1 status overall, in graphics it is still lagging. Warner > Reviewed by: wulf, bapt, imp > > Approved by: imp > > Differential Revision: https://reviews.freebsd.org/D17912 > > > > Modified: > > head/sys/amd64/conf/GENERIC > > head/sys/amd64/conf/MINIMAL > > head/sys/i386/conf/GENERIC > > head/sys/i386/conf/MINIMAL > > > > Modified: head/sys/amd64/conf/GENERIC > > > ============================================================================== > > --- head/sys/amd64/conf/GENERIC Mon Nov 12 20:44:22 2018 > (r340386) > > +++ head/sys/amd64/conf/GENERIC Mon Nov 12 21:01:28 2018 > (r340387) > > @@ -372,3 +372,8 @@ device vmx # VMware > VMXNET3 Ethernet > > > > # Netmap provides direct access to TX/RX rings on supported NICs > > device netmap # netmap(4) support > > + > > +# evdev interface > > +options EVDEV_SUPPORT # evdev support in legacy drivers > > +device evdev # input event device > support > > +device uinput # install /dev/uinput cdev > > > > Modified: head/sys/amd64/conf/MINIMAL > > > ============================================================================== > > --- head/sys/amd64/conf/MINIMAL Mon Nov 12 20:44:22 2018 > (r340386) > > +++ head/sys/amd64/conf/MINIMAL Mon Nov 12 21:01:28 2018 > (r340387) > > @@ -147,3 +147,8 @@ device bpf # Berkeley > packet filter > > # NOTE: XENHVM depends on xenpci. They must be added or removed > together. > > options XENHVM # Xen HVM kernel infrastructure > > device xenpci # Xen HVM Hypervisor > services driver > > + > > +# evdev interface > > +options EVDEV_SUPPORT # evdev support in legacy drivers > > +device evdev # input event device > support > > +device uinput # install /dev/uinput cdev > > > > Modified: head/sys/i386/conf/GENERIC > > > ============================================================================== > > --- head/sys/i386/conf/GENERIC Mon Nov 12 20:44:22 2018 > (r340386) > > +++ head/sys/i386/conf/GENERIC Mon Nov 12 21:01:28 2018 > (r340387) > > @@ -366,3 +366,8 @@ device xenpci # Xen HVM > Hypervisor services driver > > > > # VMware support > > device vmx # VMware VMXNET3 Ethernet > > + > > +# evdev interface > > +options EVDEV_SUPPORT # evdev support in legacy drivers > > +device evdev # input event device > support > > +device uinput # install /dev/uinput cdev > > > > Modified: head/sys/i386/conf/MINIMAL > > > ============================================================================== > > --- head/sys/i386/conf/MINIMAL Mon Nov 12 20:44:22 2018 > (r340386) > > +++ head/sys/i386/conf/MINIMAL Mon Nov 12 21:01:28 2018 > (r340387) > > @@ -148,3 +148,8 @@ device bpf # Berkeley > packet filter > > # NOTE: XENHVM depends on xenpci. They must be added or removed > together. > > options XENHVM # Xen HVM kernel infrastructure > > device xenpci # Xen HVM Hypervisor > services driver > > + > > +# evdev interface > > +options EVDEV_SUPPORT # evdev support in legacy drivers > > +device evdev # input event device > support > > +device uinput # install /dev/uinput cdev > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Tue Nov 13 00:30:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F5191128364; Tue, 13 Nov 2018 00:30:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 322F78BF02; Tue, 13 Nov 2018 00:30:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAD0U6Nr028351; Mon, 12 Nov 2018 16:30:06 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAD0U6sG028350; Mon, 12 Nov 2018 16:30:06 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811130030.wAD0U6sG028350@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340387 - in head/sys: amd64/conf i386/conf In-Reply-To: To: Warner Losh Date: Mon, 12 Nov 2018 16:30:06 -0800 (PST) CC: "Rodney W. Grimes" , Niclas Zeising , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 322F78BF02 X-Spamd-Result: default: False [1.08 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.06)[-0.060,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.43)[0.435,0]; NEURAL_HAM_LONG(-0.16)[-0.163,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 00:30:10 -0000 > On Mon, Nov 12, 2018, 3:12 PM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > > > Author: zeising (doc,ports committer) > > > Date: Mon Nov 12 21:01:28 2018 > > > New Revision: 340387 > > > URL: https://svnweb.freebsd.org/changeset/base/340387 > > > > > > Log: > > > Add evdev support to amd64 and i386 kernels > > > > > > Include evdev support and drivers in the amd64 and i386 GENERIC and > > MINIMAL > > > kernels. Evdev is used by X and wayland to handle input devices, and > > this > > > change, together with upcomming changes in ports will make us handle > > input > > > devices better in graphical UIs. > > > > Well these "upcomming" changes in ports effect aarch64 and powerpc > > who are also consumers of X? > > > > Likely. Though there is little experience with them, so we don't know if it > is even safe to turn them on there yet. This has taken 6 months to get > stable on x86 due to its fragile console locking protocol. Similar time has > not been invested elsewhere, so until that happens, we should keep them off > by default. Otherwise we run the risk of destabilizing these platforms, > even for people who don't use X. As tier 2 platforms, this has been how > we've traditionally approached risk. Even though aarch64 is approaching > tier1 status overall, in graphics it is still lagging. >From some place aarch64 is already a tier1 platform, specifically it is listed as such in the pkg.freebsd.org package download page. My real concern here is that it sounded like changes to what are in the ports/packages are going to be made in such a way that you are required to have evdev to use them. If this suddently becomes mandatory to be able to use X we need to ensure that this code (evdev) does infact work on aarch64 and others before such changes are put in place. My reading here is that this code is only avaliable as static compile into the kernel, aka no moduleto load, making this a non-trivial road block to rpi3, etc users. > Warner > > > > Reviewed by: wulf, bapt, imp > > > Approved by: imp > > > Differential Revision: https://reviews.freebsd.org/D17912 > > > > > > Modified: > > > head/sys/amd64/conf/GENERIC > > > head/sys/amd64/conf/MINIMAL > > > head/sys/i386/conf/GENERIC > > > head/sys/i386/conf/MINIMAL > > > > > > Modified: head/sys/amd64/conf/GENERIC > > > > > ============================================================================== > > > --- head/sys/amd64/conf/GENERIC Mon Nov 12 20:44:22 2018 > > (r340386) > > > +++ head/sys/amd64/conf/GENERIC Mon Nov 12 21:01:28 2018 > > (r340387) > > > @@ -372,3 +372,8 @@ device vmx # VMware > > VMXNET3 Ethernet > > > > > > # Netmap provides direct access to TX/RX rings on supported NICs > > > device netmap # netmap(4) support > > > + > > > +# evdev interface > > > +options EVDEV_SUPPORT # evdev support in legacy drivers > > > +device evdev # input event device > > support > > > +device uinput # install /dev/uinput cdev > > > > > > Modified: head/sys/amd64/conf/MINIMAL > > > > > ============================================================================== > > > --- head/sys/amd64/conf/MINIMAL Mon Nov 12 20:44:22 2018 > > (r340386) > > > +++ head/sys/amd64/conf/MINIMAL Mon Nov 12 21:01:28 2018 > > (r340387) > > > @@ -147,3 +147,8 @@ device bpf # Berkeley > > packet filter > > > # NOTE: XENHVM depends on xenpci. They must be added or removed > > together. > > > options XENHVM # Xen HVM kernel infrastructure > > > device xenpci # Xen HVM Hypervisor > > services driver > > > + > > > +# evdev interface > > > +options EVDEV_SUPPORT # evdev support in legacy drivers > > > +device evdev # input event device > > support > > > +device uinput # install /dev/uinput cdev > > > > > > Modified: head/sys/i386/conf/GENERIC > > > > > ============================================================================== > > > --- head/sys/i386/conf/GENERIC Mon Nov 12 20:44:22 2018 > > (r340386) > > > +++ head/sys/i386/conf/GENERIC Mon Nov 12 21:01:28 2018 > > (r340387) > > > @@ -366,3 +366,8 @@ device xenpci # Xen HVM > > Hypervisor services driver > > > > > > # VMware support > > > device vmx # VMware VMXNET3 Ethernet > > > + > > > +# evdev interface > > > +options EVDEV_SUPPORT # evdev support in legacy drivers > > > +device evdev # input event device > > support > > > +device uinput # install /dev/uinput cdev > > > > > > Modified: head/sys/i386/conf/MINIMAL > > > > > ============================================================================== > > > --- head/sys/i386/conf/MINIMAL Mon Nov 12 20:44:22 2018 > > (r340386) > > > +++ head/sys/i386/conf/MINIMAL Mon Nov 12 21:01:28 2018 > > (r340387) > > > @@ -148,3 +148,8 @@ device bpf # Berkeley > > packet filter > > > # NOTE: XENHVM depends on xenpci. They must be added or removed > > together. > > > options XENHVM # Xen HVM kernel infrastructure > > > device xenpci # Xen HVM Hypervisor > > services driver > > > + > > > +# evdev interface > > > +options EVDEV_SUPPORT # evdev support in legacy drivers > > > +device evdev # input event device > > support > > > +device uinput # install /dev/uinput cdev > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Nov 13 00:49:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2887112897D for ; Tue, 13 Nov 2018 00:49:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1C848C7FB for ; Tue, 13 Nov 2018 00:49:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd43.google.com with SMTP id u15so3414918iof.12 for ; Mon, 12 Nov 2018 16:49:35 -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=E1PDfod6MjcRhFi3aZmxEAPiXfsAw4F8ezmRsghWj0g=; b=gzuQvb0d+DfzWD/psU1Pa59TZ8HnYqLowwFD4MRmMikow3yodeH7ckcrB4NvXvOnIr fSmjrMYuHGedQYDH2wWak8j51ruWqAG8bEu1fze3I5n2OwdiCR8v5MfezMwl0j3XP5wT Qj4CTMDkNE+kZL4bm2osAlstKKWdjgZRaT49PhNvmMglmmXK8s24cXH8WShoXq9IWa4L NE0mVUWYokyND8sYY2iw6caD6os79/RdlCBZyoQJ+zzSADOqapJI7c+k6F+vkw4lOD+g KTe4hx2NdvG6HuwZapr2Kwh0yCQLMgM5lIcpgrHxA65cgwFN9WulGtOUwiG1mDjfn65j EtfQ== 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=E1PDfod6MjcRhFi3aZmxEAPiXfsAw4F8ezmRsghWj0g=; b=S5J5IxNM/28wBn+E5b2xd1yesNnM6nBz3AhTV/Q8y2/yVDzdFwKIccGUehD7A73tcz mQzpU5aDftWkl4ey/v2earEaZLja2qFTJhD8TWI67AHvwSCvZ40Th4vnuzOCBA+0EAjo 862TOWZUQa00ZN9LIvaVcewjWkQWRolrpFQ8CGb8daEP7/d5xc6Dyq1L3X01IZaaSdwK /Fv4W02mjDANWJfgjzikZbynSyhuhE60FsJjbuTuVGLK9yWodfyjkq3gXGz6TgZwHaeB gqb0MFnydXQP5DsNI4CKIC76zh8wgXzlNdjd5iXiOPIgf97RVtauy45fmh3envOZ3dvX WLVQ== X-Gm-Message-State: AGRZ1gJVHSJ6WuH3LdC2sZdtYw2gLr5Q7+m/iVK2pZTiI+QjZ4kNy91Z 2ewpNhkQ4D7ynRwSuLkoeTugkTswLzUriyj7BmH0/Q== X-Google-Smtp-Source: AJdET5daZAnnBD/Gcu94xO6d9Ukd3pfHbooUof1Am7mGt2GUvBlbAPuu/0tEhpfMvvdG+mH0XDG1EYds+nMU6R6i8xg= X-Received: by 2002:a5e:8614:: with SMTP id z20-v6mr2548130ioj.37.1542070175025; Mon, 12 Nov 2018 16:49:35 -0800 (PST) MIME-Version: 1.0 References: <201811130030.wAD0U6sG028350@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811130030.wAD0U6sG028350@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 12 Nov 2018 17:49:24 -0700 Message-ID: Subject: Re: svn commit: r340387 - in head/sys: amd64/conf i386/conf To: "Rodney W. Grimes" Cc: Niclas Zeising , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: F1C848C7FB X-Spamd-Result: default: False [-3.94 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[3.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.99)[ipnet: 2607:f8b0::/32(-2.90), asn: 15169(-1.93), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 00:49:37 -0000 On Mon, Nov 12, 2018 at 5:30 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Mon, Nov 12, 2018, 3:12 PM Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > > > > > Author: zeising (doc,ports committer) > > > > Date: Mon Nov 12 21:01:28 2018 > > > > New Revision: 340387 > > > > URL: https://svnweb.freebsd.org/changeset/base/340387 > > > > > > > > Log: > > > > Add evdev support to amd64 and i386 kernels > > > > > > > > Include evdev support and drivers in the amd64 and i386 GENERIC and > > > MINIMAL > > > > kernels. Evdev is used by X and wayland to handle input devices, > and > > > this > > > > change, together with upcomming changes in ports will make us > handle > > > input > > > > devices better in graphical UIs. > > > > > > Well these "upcomming" changes in ports effect aarch64 and powerpc > > > who are also consumers of X? > > > > > > > Likely. Though there is little experience with them, so we don't know if > it > > is even safe to turn them on there yet. This has taken 6 months to get > > stable on x86 due to its fragile console locking protocol. Similar time > has > > not been invested elsewhere, so until that happens, we should keep them > off > > by default. Otherwise we run the risk of destabilizing these platforms, > > even for people who don't use X. As tier 2 platforms, this has been how > > we've traditionally approached risk. Even though aarch64 is approaching > > tier1 status overall, in graphics it is still lagging. > > From some place aarch64 is already a tier1 platform, specifically > it is listed as such in the pkg.freebsd.org package download page. > Graphics on aarch64 is tier 2, and will remain tier 2 for the foreseeable future. Tier 1 support requires that we leverage other people's drivers, and we can't easily do that w/o a good linux compat layer. The structure of FreeBSD and Linux are just enough different that doing so is somewhat tricky and labor intensive. This is especially true for the acceleration features. Basic framebuffer support isn't terribly hard, but to get good 2d and 3d acceleration, we'll likely need to run upstream vendor's code (which in many cases is available only as a binary blob + linux glue). > My real concern here is that it sounded like changes to what are > in the ports/packages are going to be made in such a way that you > are required to have evdev to use them. If this suddently becomes > mandatory to be able to use X we need to ensure that this code > (evdev) does infact work on aarch64 and others before such changes are > put in place. My reading here is that this code is only avaliable > as static compile into the kernel, aka no moduleto load, making this > a non-trivial road block to rpi3, etc users. > This is just for touchscreen support on x86, which requires evdev to work well. Whatever works today won't change. However, without a lot of testing, I'm hesitant to blindly enable it on aarch64. Once that changes, we can turn it on, but until then it would be unwise. And evdev can be turned off on a per-platform basis in the packages / ports tree should the need arise. I don't think this is going to be an issue. Warner > > Warner > > > > > > > Reviewed by: wulf, bapt, imp > > > > Approved by: imp > > > > Differential Revision: https://reviews.freebsd.org/D17912 > > > > > > > > Modified: > > > > head/sys/amd64/conf/GENERIC > > > > head/sys/amd64/conf/MINIMAL > > > > head/sys/i386/conf/GENERIC > > > > head/sys/i386/conf/MINIMAL > > > > > > > > Modified: head/sys/amd64/conf/GENERIC > > > > > > > > ============================================================================== > > > > --- head/sys/amd64/conf/GENERIC Mon Nov 12 20:44:22 2018 > > > (r340386) > > > > +++ head/sys/amd64/conf/GENERIC Mon Nov 12 21:01:28 2018 > > > (r340387) > > > > @@ -372,3 +372,8 @@ device vmx # > VMware > > > VMXNET3 Ethernet > > > > > > > > # Netmap provides direct access to TX/RX rings on supported NICs > > > > device netmap # netmap(4) support > > > > + > > > > +# evdev interface > > > > +options EVDEV_SUPPORT # evdev support in legacy > drivers > > > > +device evdev # input event device > > > support > > > > +device uinput # install /dev/uinput > cdev > > > > > > > > Modified: head/sys/amd64/conf/MINIMAL > > > > > > > > ============================================================================== > > > > --- head/sys/amd64/conf/MINIMAL Mon Nov 12 20:44:22 2018 > > > (r340386) > > > > +++ head/sys/amd64/conf/MINIMAL Mon Nov 12 21:01:28 2018 > > > (r340387) > > > > @@ -147,3 +147,8 @@ device bpf # > Berkeley > > > packet filter > > > > # NOTE: XENHVM depends on xenpci. They must be added or removed > > > together. > > > > options XENHVM # Xen HVM kernel infrastructure > > > > device xenpci # Xen HVM Hypervisor > > > services driver > > > > + > > > > +# evdev interface > > > > +options EVDEV_SUPPORT # evdev support in legacy > drivers > > > > +device evdev # input event device > > > support > > > > +device uinput # install /dev/uinput > cdev > > > > > > > > Modified: head/sys/i386/conf/GENERIC > > > > > > > > ============================================================================== > > > > --- head/sys/i386/conf/GENERIC Mon Nov 12 20:44:22 2018 > > > (r340386) > > > > +++ head/sys/i386/conf/GENERIC Mon Nov 12 21:01:28 2018 > > > (r340387) > > > > @@ -366,3 +366,8 @@ device xenpci # Xen > HVM > > > Hypervisor services driver > > > > > > > > # VMware support > > > > device vmx # VMware VMXNET3 > Ethernet > > > > + > > > > +# evdev interface > > > > +options EVDEV_SUPPORT # evdev support in legacy > drivers > > > > +device evdev # input event device > > > support > > > > +device uinput # install /dev/uinput > cdev > > > > > > > > Modified: head/sys/i386/conf/MINIMAL > > > > > > > > ============================================================================== > > > > --- head/sys/i386/conf/MINIMAL Mon Nov 12 20:44:22 2018 > > > (r340386) > > > > +++ head/sys/i386/conf/MINIMAL Mon Nov 12 21:01:28 2018 > > > (r340387) > > > > @@ -148,3 +148,8 @@ device bpf # > Berkeley > > > packet filter > > > > # NOTE: XENHVM depends on xenpci. They must be added or removed > > > together. > > > > options XENHVM # Xen HVM kernel infrastructure > > > > device xenpci # Xen HVM Hypervisor > > > services driver > > > > + > > > > +# evdev interface > > > > +options EVDEV_SUPPORT # evdev support in legacy > drivers > > > > +device evdev # input event device > > > support > > > > +device uinput # install /dev/uinput > cdev > > > > > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Tue Nov 13 01:30:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49745112C1C0; Tue, 13 Nov 2018 01:30:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD34E8F12C; Tue, 13 Nov 2018 01:30:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF8A8101F; Tue, 13 Nov 2018 01:30:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAD1UVbU003004; Tue, 13 Nov 2018 01:30:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAD1UVAK003003; Tue, 13 Nov 2018 01:30:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811130130.wAD1UVAK003003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Nov 2018 01:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340391 - head/contrib/elftoolchain/strings X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/strings X-SVN-Commit-Revision: 340391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CD34E8F12C X-Spamd-Result: default: False [-103.04 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.93)[-0.928,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 01:30:32 -0000 Author: emaste Date: Tue Nov 13 01:30:31 2018 New Revision: 340391 URL: https://svnweb.freebsd.org/changeset/base/340391 Log: Revert r340385, strings capability mode This needs to be reworked for bootstrapping. Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Mon Nov 12 22:18:11 2018 (r340390) +++ head/contrib/elftoolchain/strings/strings.c Tue Nov 13 01:30:31 2018 (r340391) @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -189,12 +188,9 @@ main(int argc, char **argv) if (!min_len) min_len = 4; - if (!*argv) { - if (caph_limit_stdio() < 0 || caph_enter() < 0) - err(1, "unable to enter capability mode"); - return (find_strings("{standard input}", 0, 0)); - } - while (*argv) { + if (!*argv) + rc = find_strings("{standard input}", 0, 0); + else while (*argv) { if (handle_file(*argv) != 0) rc = 1; argv++; From owner-svn-src-head@freebsd.org Tue Nov 13 04:34:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 339A71103929; Tue, 13 Nov 2018 04:34:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF83C72198; Tue, 13 Nov 2018 04:34:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E153259; Tue, 13 Nov 2018 04:34:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAD4YVMk000597; Tue, 13 Nov 2018 04:34:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAD4YVYa000596; Tue, 13 Nov 2018 04:34:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811130434.wAD4YVYa000596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 13 Nov 2018 04:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340392 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF83C72198 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 04:34:32 -0000 Author: kevans Date: Tue Nov 13 04:34:30 2018 New Revision: 340392 URL: https://svnweb.freebsd.org/changeset/base/340392 Log: Add dynamic_kenv assertion to init_static_kenv Both to formally document the requirement that this not be called after the dynamic kenv is setup, and to perhaps help static analyzers figure out what's going on. While calling init_static_kenv this late isn't fatal, there are some caveats that the caller should be aware of: - Late calls are effectively a no-op, as far as default FreeBSD is concerned, as everything will switch to searching the dynamic kenv once it's available. - Each of the kern_getenv calls will leak memory, as it's assumed that these are searching static environment and allocations will not be made. As such, this usage is not sensible and should be detected. Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Tue Nov 13 01:30:31 2018 (r340391) +++ head/sys/kern/kern_environment.c Tue Nov 13 04:34:30 2018 (r340392) @@ -249,6 +249,7 @@ init_static_kenv(char *buf, size_t len) { char *eval; + KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized")); /* * Give the static environment a chance to disable the loader(8) * environment first. This is done with loader_env.disabled=1. From owner-svn-src-head@freebsd.org Tue Nov 13 06:10:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C33611051DB for ; Tue, 13 Nov 2018 06:10:26 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-it1-x12b.google.com (mail-it1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DEC87455A for ; Tue, 13 Nov 2018 06:10:25 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-it1-x12b.google.com with SMTP id w7-v6so16818114itd.1 for ; Mon, 12 Nov 2018 22:10:25 -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=exhcVhAjS32mnaQdisBsY44eBiZvKZhCOXgPJLSYosk=; b=ZJb2vxQZ1uDXcOQmf+ygk3c3f6c7YDTchkJBoArHPF4i7y0alq6XZyryVIDM/VxEFw xr/DyIGwUJGsAzcJlwbC5PmL0NTKfr/Ek+xdnNGTmf8PrA1IQFUKTaq1DDKy1bWkE54/ BMurHa7PFl6vqEyUejGRsGPKD17yj8WNx0XTA= 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=exhcVhAjS32mnaQdisBsY44eBiZvKZhCOXgPJLSYosk=; b=F1BSVKC9PzJ5dsoVVnYn5GwEmBBccxB71efk4ecBPHSb+LmiR3tEFRxFwXjBKgPqro YyLTb71WCdFeFqEoXjxBgn/EcajB6+BttlCarB58idtrmEnceGkWpjpoQYG0Np5nQwKo o9B+qWTsq8zAVB8sw+MuciPRrJUmUn3tfWl2o26pa3RA9+k4kwJXJ4cZebKPjiXBPINz L0aeNzAfPcH7xtDRkQHfqcFYwjIYEHpS8usUxuJXWNkGIr6lo2LzkpT0uCx2oLv1mAfS SjG3iJwvqjBEKbwaufgUZGp16MUVhNQiyTAylf4+W9Ui/eeTszDLfTZVMZIYxjQon1tc N6cA== X-Gm-Message-State: AGRZ1gIqzVTnttwFp3LPG8klqYo/R/LypTm6tDGhNvW+ZgFRz6yuyhS2 hBO2UQ6ptqADMHLX6I5AqSloMKV+3B/NIok6krKHFrHwuhbpcjRk X-Google-Smtp-Source: AJdET5dvv1RYqr68u0W7luwJadtZh6wo+PxxVOQ3aaFzNA9yyRYgRwJ2t7yns4O0fGbNwKCQYJ0dqANb0n6C67e76Cs= X-Received: by 2002:a05:660c:595:: with SMTP id g21mr2539945itk.167.1542089424224; Mon, 12 Nov 2018 22:10:24 -0800 (PST) MIME-Version: 1.0 References: <201811130030.wAD0U6sG028350@pdx.rh.CN85.dnsmgr.net> In-Reply-To: From: Kevin Bowling Date: Mon, 12 Nov 2018 23:10:13 -0700 Message-ID: Subject: Re: svn commit: r340387 - in head/sys: amd64/conf i386/conf To: Warner Losh Cc: rgrimes@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Niclas Zeising Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2DEC87455A X-Spamd-Result: default: False [-5.74 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[kev009.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[kev009.com:~]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; RCVD_IN_DNSWL_NONE(0.00)[b.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; R_DKIM_PERMFAIL(0.00)[kev009.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.44)[ip: (-7.29), ipnet: 2607:f8b0::/32(-2.88), asn: 15169(-1.95), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 06:10:26 -0000 ppc64 will be the next arch after amd64 to get modern graphics (https://github.com/POWER9BSD/freebsd/commits/projects/lkpi) but we like the tier-2 status for now and will replay changes from amd64 GENERIC once I'm able to test. FWIW evdev is the standard with libinput for X11 under Linux. It's useful for modern trackpads and has no downsides for traditional keyboards and mice under X11. It's also a requisite for Wayland. So I am happy to see this change, thanks Niclas!. Regards, Kevin On Mon, Nov 12, 2018 at 5:50 PM Warner Losh wrote: > > On Mon, Nov 12, 2018 at 5:30 PM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > On Mon, Nov 12, 2018, 3:12 PM Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > > > > > > > Author: zeising (doc,ports committer) > > > > > Date: Mon Nov 12 21:01:28 2018 > > > > > New Revision: 340387 > > > > > URL: https://svnweb.freebsd.org/changeset/base/340387 > > > > > > > > > > Log: > > > > > Add evdev support to amd64 and i386 kernels > > > > > > > > > > Include evdev support and drivers in the amd64 and i386 GENERIC and > > > > MINIMAL > > > > > kernels. Evdev is used by X and wayland to handle input devices, > > and > > > > this > > > > > change, together with upcomming changes in ports will make us > > handle > > > > input > > > > > devices better in graphical UIs. > > > > > > > > Well these "upcomming" changes in ports effect aarch64 and powerpc > > > > who are also consumers of X? > > > > > > > > > > Likely. Though there is little experience with them, so we don't know if > > it > > > is even safe to turn them on there yet. This has taken 6 months to get > > > stable on x86 due to its fragile console locking protocol. Similar time > > has > > > not been invested elsewhere, so until that happens, we should keep them > > off > > > by default. Otherwise we run the risk of destabilizing these platforms, > > > even for people who don't use X. As tier 2 platforms, this has been how > > > we've traditionally approached risk. Even though aarch64 is approaching > > > tier1 status overall, in graphics it is still lagging. > > > > From some place aarch64 is already a tier1 platform, specifically > > it is listed as such in the pkg.freebsd.org package download page. > > > > Graphics on aarch64 is tier 2, and will remain tier 2 for the foreseeable > future. Tier 1 support requires that we leverage other people's drivers, > and we can't easily do that w/o a good linux compat layer. The structure of > FreeBSD and Linux are just enough different that doing so is somewhat > tricky and labor intensive. This is especially true for the acceleration > features. Basic framebuffer support isn't terribly hard, but to get good 2d > and 3d acceleration, we'll likely need to run upstream vendor's code (which > in many cases is available only as a binary blob + linux glue). > > > > My real concern here is that it sounded like changes to what are > > in the ports/packages are going to be made in such a way that you > > are required to have evdev to use them. If this suddently becomes > > mandatory to be able to use X we need to ensure that this code > > (evdev) does infact work on aarch64 and others before such changes are > > put in place. My reading here is that this code is only avaliable > > as static compile into the kernel, aka no moduleto load, making this > > a non-trivial road block to rpi3, etc users. > > > > This is just for touchscreen support on x86, which requires evdev to work > well. Whatever works today won't change. However, without a lot of testing, > I'm hesitant to blindly enable it on aarch64. Once that changes, we can > turn it on, but until then it would be unwise. And evdev can be turned off > on a per-platform basis in the packages / ports tree should the need arise. > I don't think this is going to be an issue. > > Warner > > > > > Warner > > > > > > > > > > Reviewed by: wulf, bapt, imp > > > > > Approved by: imp > > > > > Differential Revision: https://reviews.freebsd.org/D17912 > > > > > > > > > > Modified: > > > > > head/sys/amd64/conf/GENERIC > > > > > head/sys/amd64/conf/MINIMAL > > > > > head/sys/i386/conf/GENERIC > > > > > head/sys/i386/conf/MINIMAL > > > > > > > > > > Modified: head/sys/amd64/conf/GENERIC > > > > > > > > > > > ============================================================================== > > > > > --- head/sys/amd64/conf/GENERIC Mon Nov 12 20:44:22 2018 > > > > (r340386) > > > > > +++ head/sys/amd64/conf/GENERIC Mon Nov 12 21:01:28 2018 > > > > (r340387) > > > > > @@ -372,3 +372,8 @@ device vmx # > > VMware > > > > VMXNET3 Ethernet > > > > > > > > > > # Netmap provides direct access to TX/RX rings on supported NICs > > > > > device netmap # netmap(4) support > > > > > + > > > > > +# evdev interface > > > > > +options EVDEV_SUPPORT # evdev support in legacy > > drivers > > > > > +device evdev # input event device > > > > support > > > > > +device uinput # install /dev/uinput > > cdev > > > > > > > > > > Modified: head/sys/amd64/conf/MINIMAL > > > > > > > > > > > ============================================================================== > > > > > --- head/sys/amd64/conf/MINIMAL Mon Nov 12 20:44:22 2018 > > > > (r340386) > > > > > +++ head/sys/amd64/conf/MINIMAL Mon Nov 12 21:01:28 2018 > > > > (r340387) > > > > > @@ -147,3 +147,8 @@ device bpf # > > Berkeley > > > > packet filter > > > > > # NOTE: XENHVM depends on xenpci. They must be added or removed > > > > together. > > > > > options XENHVM # Xen HVM kernel infrastructure > > > > > device xenpci # Xen HVM Hypervisor > > > > services driver > > > > > + > > > > > +# evdev interface > > > > > +options EVDEV_SUPPORT # evdev support in legacy > > drivers > > > > > +device evdev # input event device > > > > support > > > > > +device uinput # install /dev/uinput > > cdev > > > > > > > > > > Modified: head/sys/i386/conf/GENERIC > > > > > > > > > > > ============================================================================== > > > > > --- head/sys/i386/conf/GENERIC Mon Nov 12 20:44:22 2018 > > > > (r340386) > > > > > +++ head/sys/i386/conf/GENERIC Mon Nov 12 21:01:28 2018 > > > > (r340387) > > > > > @@ -366,3 +366,8 @@ device xenpci # Xen > > HVM > > > > Hypervisor services driver > > > > > > > > > > # VMware support > > > > > device vmx # VMware VMXNET3 > > Ethernet > > > > > + > > > > > +# evdev interface > > > > > +options EVDEV_SUPPORT # evdev support in legacy > > drivers > > > > > +device evdev # input event device > > > > support > > > > > +device uinput # install /dev/uinput > > cdev > > > > > > > > > > Modified: head/sys/i386/conf/MINIMAL > > > > > > > > > > > ============================================================================== > > > > > --- head/sys/i386/conf/MINIMAL Mon Nov 12 20:44:22 2018 > > > > (r340386) > > > > > +++ head/sys/i386/conf/MINIMAL Mon Nov 12 21:01:28 2018 > > > > (r340387) > > > > > @@ -148,3 +148,8 @@ device bpf # > > Berkeley > > > > packet filter > > > > > # NOTE: XENHVM depends on xenpci. They must be added or removed > > > > together. > > > > > options XENHVM # Xen HVM kernel infrastructure > > > > > device xenpci # Xen HVM Hypervisor > > > > services driver > > > > > + > > > > > +# evdev interface > > > > > +options EVDEV_SUPPORT # evdev support in legacy > > drivers > > > > > +device evdev # input event device > > > > support > > > > > +device uinput # install /dev/uinput > > cdev > > > > > > > > > > > > > > > > > > -- > > > > Rod Grimes > > > > rgrimes@freebsd.org > > > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Tue Nov 13 06:26:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39B8F11057FE; Tue, 13 Nov 2018 06:26:27 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (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 59DFA74DCB; Tue, 13 Nov 2018 06:26:26 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42vHhJ4sKHzDj5D; Tue, 13 Nov 2018 06:26:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id DmAYCoetWSSA; Tue, 13 Nov 2018 06:26:08 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:9eda:3eff:fe70:24c0]) by mail.daemonic.se (Postfix) with ESMTPSA id 42vHh02CwRzDhFd; Tue, 13 Nov 2018 06:26:08 +0000 (UTC) Subject: Re: svn commit: r340387 - in head/sys: amd64/conf i386/conf To: Warner Losh , "Rodney W. Grimes" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201811130030.wAD0U6sG028350@pdx.rh.CN85.dnsmgr.net> From: Niclas Zeising Message-ID: Date: Tue, 13 Nov 2018 07:26:08 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 59DFA74DCB X-Spamd-Result: default: False [-103.90 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; IP_SCORE(-0.80)[asn: 36236(-3.89), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36236, ipnet:176.58.89.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 06:26:27 -0000 On 11/13/18 1:49 AM, Warner Losh wrote: > On Mon, Nov 12, 2018 at 5:30 PM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >>> On Mon, Nov 12, 2018, 3:12 PM Rodney W. Grimes < >>> freebsd@pdx.rh.cn85.dnsmgr.net wrote: >>> >>>>> Author: zeising (doc,ports committer) >>>>> Date: Mon Nov 12 21:01:28 2018 >>>>> New Revision: 340387 >>>>> URL: https://svnweb.freebsd.org/changeset/base/340387 >>>>> >>>>> Log: >>>>> Add evdev support to amd64 and i386 kernels >>>>> >>>>> Include evdev support and drivers in the amd64 and i386 GENERIC and >>>> MINIMAL >>>>> kernels. Evdev is used by X and wayland to handle input devices, >> and >>>> this >>>>> change, together with upcomming changes in ports will make us >> handle >>>> input >>>>> devices better in graphical UIs. >>>> >>>> Well these "upcomming" changes in ports effect aarch64 and powerpc >>>> who are also consumers of X? >>>> >>> >>> Likely. Though there is little experience with them, so we don't know if >> it >>> is even safe to turn them on there yet. This has taken 6 months to get >>> stable on x86 due to its fragile console locking protocol. Similar time >> has >>> not been invested elsewhere, so until that happens, we should keep them >> off >>> by default. Otherwise we run the risk of destabilizing these platforms, >>> even for people who don't use X. As tier 2 platforms, this has been how >>> we've traditionally approached risk. Even though aarch64 is approaching >>> tier1 status overall, in graphics it is still lagging. >> >> From some place aarch64 is already a tier1 platform, specifically >> it is listed as such in the pkg.freebsd.org package download page. >> > > Graphics on aarch64 is tier 2, and will remain tier 2 for the foreseeable > future. Tier 1 support requires that we leverage other people's drivers, > and we can't easily do that w/o a good linux compat layer. The structure of > FreeBSD and Linux are just enough different that doing so is somewhat > tricky and labor intensive. This is especially true for the acceleration > features. Basic framebuffer support isn't terribly hard, but to get good 2d > and 3d acceleration, we'll likely need to run upstream vendor's code (which > in many cases is available only as a binary blob + linux glue). > > >> My real concern here is that it sounded like changes to what are >> in the ports/packages are going to be made in such a way that you >> are required to have evdev to use them. If this suddently becomes >> mandatory to be able to use X we need to ensure that this code >> (evdev) does infact work on aarch64 and others before such changes are >> put in place. My reading here is that this code is only avaliable >> as static compile into the kernel, aka no moduleto load, making this >> a non-trivial road block to rpi3, etc users. >> > > This is just for touchscreen support on x86, which requires evdev to work > well. Whatever works today won't change. However, without a lot of testing, > I'm hesitant to blindly enable it on aarch64. Once that changes, we can > turn it on, but until then it would be unwise. And evdev can be turned off > on a per-platform basis in the packages / ports tree should the need arise. > I don't think this is going to be an issue. > Hi! This change makes it easier, and in some case possible, to use certain input devices, such as touchscreens, input tablets and so on. It will make it easier to use things like two finger scrolling or horizontal scrolling on touchpads, for instance. Using evdev and libinput (from ports) is a prerequisite for Wayland, and useful for X, however, for X the old input drivers are not going away, and can still be used on architectures without evdev. The input stack (for graphical environments) in FreeBSD is lagging behind Linux, and this is a first step to get it at least a little bit closer in terms of support. With regards to other architectures, I only have access to amd64 and to some extent i386, and only enabled the drivers there. I have no problem with enabling this on further architectures if I get help testing, or hardware to test on. As stated, this won't cause regressions on these platforms, the old input device drivers (xf86-input-*) won't go anywhere in a hurry, if ever, and is still available for use. I hope this clears things up a little. Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Tue Nov 13 06:28:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A4B11058CC; Tue, 13 Nov 2018 06:28:11 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (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 2A59F74F52; Tue, 13 Nov 2018 06:28:11 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42vHkK5VTzzDj5M; Tue, 13 Nov 2018 06:28:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id xjQJeJmm-Uom; Tue, 13 Nov 2018 06:28:09 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:9eda:3eff:fe70:24c0]) by mail.daemonic.se (Postfix) with ESMTPSA id 42vHkJ5VRwzDhFd; Tue, 13 Nov 2018 06:28:08 +0000 (UTC) Subject: Re: svn commit: r340387 - in head/sys: amd64/conf i386/conf To: Kevin Bowling , Warner Losh Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , rgrimes@freebsd.org References: <201811130030.wAD0U6sG028350@pdx.rh.CN85.dnsmgr.net> From: Niclas Zeising Message-ID: <11af3fe5-76aa-ab66-ac06-4c53cdeb5bc1@freebsd.org> Date: Tue, 13 Nov 2018 07:28:08 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2A59F74F52 X-Spamd-Result: default: False [-103.90 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; IP_SCORE(-0.80)[asn: 36236(-3.89), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 06:28:12 -0000 On 11/13/18 7:10 AM, Kevin Bowling wrote: > ppc64 will be the next arch after amd64 to get modern graphics > (https://github.com/POWER9BSD/freebsd/commits/projects/lkpi) but we > like the tier-2 status for now and will replay changes from amd64 > GENERIC once I'm able to test. > > FWIW evdev is the standard with libinput for X11 under Linux. It's > useful for modern trackpads and has no downsides for traditional > keyboards and mice under X11. It's also a requisite for Wayland. So > I am happy to see this change, thanks Niclas!. > This is great! Let me and the rest of the graphics team know if we can help in any way. I have no problem enabling evdev support in ppc64 (or any other arches) if it's tested at least a little. The only reason I only enabled it for i386 and amd64 is that those are the platforms I have available myself. Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Tue Nov 13 09:19:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C5E3110ADBA; Tue, 13 Nov 2018 09:19:08 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2C217A898; Tue, 13 Nov 2018 09:19:07 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3C196421; Tue, 13 Nov 2018 09:19:07 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAD9J7M1043383; Tue, 13 Nov 2018 09:19:07 GMT (envelope-from kbowling@FreeBSD.org) Received: (from kbowling@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAD9J7f4043382; Tue, 13 Nov 2018 09:19:07 GMT (envelope-from kbowling@FreeBSD.org) Message-Id: <201811130919.wAD9J7f4043382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kbowling set sender to kbowling@FreeBSD.org using -f From: Kevin Bowling Date: Tue, 13 Nov 2018 09:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340393 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: kbowling X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 340393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D2C217A898 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 09:19:08 -0000 Author: kbowling (ports committer) Date: Tue Nov 13 09:19:07 2018 New Revision: 340393 URL: https://svnweb.freebsd.org/changeset/base/340393 Log: powerpc64: reduce GENERIC64 diff versus amd64 GENERIC Reviewed by: jhibbits Approved by: timur (mentor) Differential Revision: https://reviews.freebsd.org/D17515 Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Tue Nov 13 04:34:30 2018 (r340392) +++ head/sys/powerpc/conf/GENERIC64 Tue Nov 13 09:19:07 2018 (r340393) @@ -39,6 +39,10 @@ options PREEMPTION #Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET #InterNETworking options INET6 #IPv6 communications protocols +options IPSEC # IP (v4/v6) security +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options TCP_OFFLOAD # TCP offload +options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open options SCTP #Stream Control Transmission Protocol @@ -83,6 +87,9 @@ options MAC # TrustedBSD MAC Framework options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel +options RACCT # Resource accounting framework +options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default +options RCTL # Resource limits # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -136,10 +143,12 @@ device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53 # ATA/SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Service (SES and SAF-TE) # vt is the default console driver, resembling an SCO console device vt # Core console driver @@ -168,6 +177,7 @@ device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 # Pseudo devices. +device crypto # core crypto support device loop # Network loopback device random # Entropy device device ether # Ethernet support @@ -193,10 +203,8 @@ device usb # USB Bus (required) device uhid # "Human Interface Devices" device ukbd # Keyboard options KBD_INSTALL_CDEV # install a CDEV entry in /dev -device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da0 device ums # Mouse -device urio # Diamond Rio 500 MP3 player # USB Ethernet device aue # ADMtek USB Ethernet device axe # ASIX Electronics USB Ethernet @@ -236,3 +244,5 @@ device sound # Generic sound driver (required) device snd_ai2s # Apple I2S audio device snd_uaudio # USB Audio +# Netmap provides direct access to TX/RX rings on supported NICs +device netmap # netmap(4) support From owner-svn-src-head@freebsd.org Tue Nov 13 13:57:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83E6F112600D; Tue, 13 Nov 2018 13:57:16 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 154BC853E9; Tue, 13 Nov 2018 13:57:16 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB13111373; Tue, 13 Nov 2018 13:57:15 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADDvF5k086219; Tue, 13 Nov 2018 13:57:15 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADDvFwg086218; Tue, 13 Nov 2018 13:57:15 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811131357.wADDvFwg086218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 13 Nov 2018 13:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340394 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 340394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 154BC853E9 X-Spamd-Result: default: False [-103.11 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 13:57:16 -0000 Author: eugen Date: Tue Nov 13 13:57:15 2018 New Revision: 340394 URL: https://svnweb.freebsd.org/changeset/base/340394 Log: Fix part of the SYNOPSIS documenting LIST OF RULES AND PREPROCESSING that is still referred as last section of the SYNOPSIS later but was erroneously situated in the section IN-KERNEL NAT. MFC after: 1 month Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Nov 13 09:19:07 2018 (r340393) +++ head/sbin/ipfw/ipfw.8 Tue Nov 13 13:57:15 2018 (r340394) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2018 +.Dd November 13, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -105,16 +105,6 @@ in-kernel NAT. .Ar number .Cm config .Ar config-options -.Pp -.Nm -.Op Fl cfnNqS -.Oo -.Fl p Ar preproc -.Oo -.Ar preproc-flags -.Oc -.Oc -.Ar pathname .Ss STATEFUL IPv6/IPv4 NETWORK ADDRESS AND PROTOCOL TRANSLATION .Nm .Oo Cm set Ar N Oc Cm nat64lsn Ar name Cm create Ar create-options @@ -166,6 +156,16 @@ in-kernel NAT. .Cm internal talist .Nm .Cm internal vlist +.Ss LIST OF RULES AND PREPROCESSING +.Nm +.Op Fl cfnNqS +.Oo +.Fl p Ar preproc +.Oo +.Ar preproc-flags +.Oc +.Oc +.Ar pathname .Sh DESCRIPTION The .Nm From owner-svn-src-head@freebsd.org Tue Nov 13 15:28:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ADD91128444; Tue, 13 Nov 2018 15:28:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F6856A9B9; Tue, 13 Nov 2018 15:28:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D284121FD; Tue, 13 Nov 2018 15:28:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADFSRcd032191; Tue, 13 Nov 2018 15:28:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADFSRxP032190; Tue, 13 Nov 2018 15:28:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811131528.wADFSRxP032190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Nov 2018 15:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340395 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 340395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F6856A9B9 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 15:28:28 -0000 Author: andrew Date: Tue Nov 13 15:28:27 2018 New Revision: 340395 URL: https://svnweb.freebsd.org/changeset/base/340395 Log: Run __cxa_finalize in shared objects in the destructor path. When we have .dtors call them before .dtor handling, otherwise call from a destructor. PR: 233056 MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/common/crtbegin.c Modified: head/lib/csu/common/crtbegin.c ============================================================================== --- head/lib/csu/common/crtbegin.c Tue Nov 13 13:57:15 2018 (r340394) +++ head/lib/csu/common/crtbegin.c Tue Nov 13 15:28:27 2018 (r340395) @@ -32,12 +32,29 @@ typedef void (*crt_func)(void); extern void *__dso_handle __hidden; -#ifdef SHARED -void *__dso_handle = &__dso_handle; -#else +#ifndef SHARED void *__dso_handle = 0; +#else +void *__dso_handle = &__dso_handle; +void __cxa_finalize(void *) __weak_symbol; + +/* + * Call __cxa_finalize with the dso handle in shared objects. + * When we have ctors/dtors call from the dtor handler before calling + * any dtors, otherwise use a destructor. + */ +#ifndef HAVE_CTORS +__attribute__((destructor)) #endif +static void +run_cxa_finalize(void) +{ + if (__cxa_finalize != NULL) + __cxa_finalize(__dso_handle); +} +#endif + /* * On some architectures and toolchains we may need to call the .dtors. * These are called in the order they are in the ELF file. @@ -57,6 +74,10 @@ __do_global_dtors_aux(void) { crt_func fn; int n; + +#ifdef SHARED + run_cxa_finalize(); +#endif for (n = 1;; n++) { fn = __DTOR_LIST__[n]; From owner-svn-src-head@freebsd.org Tue Nov 13 15:58:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20553112945A; Tue, 13 Nov 2018 15:58:02 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id 1BDDF6BC41; Tue, 13 Nov 2018 15:58:00 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: by lath.rinet.ru (Postfix, from userid 222) id B8E1FE38C; Tue, 13 Nov 2018 18:57:53 +0300 (MSK) Date: Tue, 13 Nov 2018 18:57:53 +0300 From: Oleg Bulyzhin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339358 - head/sys/net Message-ID: <20181113155753.GA92602@lath.rinet.ru> References: <201810151029.w9FATU8r068148@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810151029.w9FATU8r068148@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 1BDDF6BC41 X-Spamd-Result: default: False [5.13 / 200.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[0.997,0]; NEURAL_SPAM_SHORT(0.97)[0.969,0]; MX_GOOD(-0.01)[lath.rinet.ru]; NEURAL_SPAM_LONG(0.99)[0.989,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[oleg@FreeBSD.org,oleg@lath.rinet.ru]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; IP_SCORE(0.88)[ipnet: 195.54.192.0/19(2.46), asn: 8331(1.96), country: RU(-0.01)]; ASN(0.00)[asn:8331, ipnet:195.54.192.0/19, country:RU]; FROM_NEQ_ENVFROM(0.00)[oleg@FreeBSD.org,oleg@lath.rinet.ru]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 15:58:02 -0000 btw, this breaks kernel build with VLAN_ARRAY option defined. -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ From owner-svn-src-head@freebsd.org Tue Nov 13 18:04:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6AA8112C617 for ; Tue, 13 Nov 2018 18:04:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1f.eu.mailhop.org (outbound1f.eu.mailhop.org [52.28.59.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07DE870716 for ; Tue, 13 Nov 2018 18:04:35 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1542131302; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Cb+djJRSY0MtwtSkF7oD6qwr3ANwUK939QqtsGhMdq1y9FWu9/LGNxJ103NPOWTRjUjrxrPXlKd/2 nSEQYe0mU+O8UBBS4m6Xa2xWPFL11EXpMdGI5ikK5ip9XQOKRJvS3Twgdp2jFZumosDvTTUpnJpn5c g6wbV0V+iqv4I6/ecTKXqWNX2JZmPxj+JIJbBvcJPDZaVug5YCZJOMruw2R9EDIJAvV/B1boUfUDo7 I2hceBSdWvUxsk0q+yy5U//xyXpEF0xLqKdmTLdx1YiV543pO+nqgU7FFRIYdy5bjkUvTTaWguJJ+k OJaSLFy6R6UcpUe45l0ZoEgUV/50/UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=yeXZW1ck12Tta5cmSZL7Iza63tgUX9ULygz78ujWUtM=; b=vChSEwM/atNw66ALBQiNJGUFd8WkO1/dYYCpjWwgKbVw0t+5xoHmuzRPQ7HBEk3pS++UsMFOMW+3G Rcahm5lxV9dR8EMBmfZ5C+8MXJ2vGJnPmJOJchJfffo2sOhqz7/UMkH8MYD2VuEog625TRpDuvwtIg Ba7zWKQmr+Lwv8hhqD7Bpqmkr4HPbow76bu+pv6KfrUv3GHMFmsP9Ney7Yh1bXC4QC96/8Xn6GS/Te i7XtPHE1JP+S2j/gfx0rhYazi4ckdDb/0GlLuO0JcHAwCQHURsOqc/x01JAiq9AhHmM2PvWRAtLNqg vV6M0FCCczZAJsVhOKMq7a3cqPhieaA== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=yeXZW1ck12Tta5cmSZL7Iza63tgUX9ULygz78ujWUtM=; b=XltGDgxR5JmH7sLSgWLntKTodCW7OFpEZbuTVwxHYN+jJSSa2viqRK7Bq3IPxPdJohvG7ikdOaZAb /hIarpWh2naUvH99t0/oimKl6PGX0cVxVG4sCkS5Mh8sSwU/uiQCzWVmptZ+krNwg6oa9RH091D0lL Ywrh46DK+6W71q2OnxvjdGGF48h1W6vIXcqw+Km/7rHDmipsld0ANc9+Hopm4El6o8QqQqnSl12Kbq MlMFTBqAuai1MfoRIMO/Fjv5fWGH5sVb+hBL+Wz2SMYxm+usKDsdaM+79m/I8GpGv05I2UAfPs4ksm ZfMxbbEWuwKU4WG3Q+TTvDmYBsYwXhQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 4ebbabd4-e76c-11e8-8436-3d722b9f52f0 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id 4ebbabd4-e76c-11e8-8436-3d722b9f52f0; Tue, 13 Nov 2018 17:48:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wADHmJf4097771; Tue, 13 Nov 2018 10:48:19 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1542131299.52306.208.camel@freebsd.org> Subject: Re: svn commit: r340326 - head From: Ian Lepore To: rgrimes@freebsd.org, cem@freebsd.org Cc: woodsb02@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 13 Nov 2018 10:48:19 -0700 In-Reply-To: <201811121400.wACE0JK5025628@pdx.rh.CN85.dnsmgr.net> References: <201811121400.wACE0JK5025628@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 07DE870716 X-Spamd-Result: default: False [-103.96 / 200.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; HAS_XOIP(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[outbound.mailhop.org:+]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.16)[asn: 16509(-0.68), country: US(-0.09)]; ARC_ALLOW(-1.00)[i=1]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[60.211.177.67.zen.spamhaus.org : 127.0.0.10]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[outbound.mailhop.org]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[28.59.28.52.list.dnswl.org : 127.0.20.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 18:04:37 -0000 On Mon, 2018-11-12 at 06:00 -0800, Rodney W. Grimes wrote: > > > > I absolutely approve of Ben's excellent addition to UPDATING, a > > text document. > At no point did I raise ANY objectection to the content > of his change, stop trying to make that the issue. > > > > > Your demands for additional scrutiny and time-wasting around code > > review are ridiculous and disproportionate, and certainly a poor > > reward for Ben's straightforward and unimpeachable effort to > > improve > > our UPDATING documentation. > My demands are reasonable, as I stated them, your ignoring them > and casting focus on my non dmeands however is pointless. > > > > > > > Ben, thank you for submitting and committing the UPDATING change > > and > > please try to ignore Rod's hyper-criticism. > What you are totally ignoring is that Ben infact TAGGED me into > the review process, causing me to process yet another email only > to go look at the review to find it had been closed by a commit > in < 4 hours total elapsed time. > > That is BULLSHIT and I am calling it BULLSHIT.  And though Ben > is the poor victom of example here, he is not the only guilty > party, and though this is a trivial change, it is not the change > that I am ranting about, but the fact that the process is > broken. > > IF YOUR GOING TO TAG SOMEONE INTO A REVIEW YOU MUST GIVE THEM > TIME TO RESPOND BEFORE YOU COMMIT, otherwise your just wasting > there time.   > > Do NOT tag me into a review if your going to commit it before > I can possibly be expected to respond.  I well rant on anyone > who does that. > > CLEAR NOW? > You seem to be very confused about phabricator and the review process. Being added to the list of reviewers in no way implies that your signoff is REQUIRED before a commit can occur. If you don't have time to jump on a review immediately, but some other committer does, then that's good enough, the process is working to perfection. -- Ian > > > > Conrad > > > > > > On Sat, Nov 10, 2018 at 5:07 PM Rodney W. Grimes > > wrote: > > > > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > On Sun, 11 Nov 2018 at 2:43 am, Rodney W. Grimes < > > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > > > If your going to bother with a differential, and invite > > > > > people to > > > > > it you should give them at least 24 hours, and preferably 72 > > > > > hours > > > > > to respond to the new review.  Reviews that last < 4 hours > > > > > are not > > > > > code reviews. > > > > > > > > > > -- > > > > > Rod Grimes > > > > > rgrimes@freebsd.org > > > > > > > > > Hi Rod, > > > > > > > > Sorry. The main reason I submitted the code review is because I > > > > do not have > > > > my src commit bit, so needed to seek approval to commit. > > > All the more reason for it to wait until the people you *invited* > > > to > > > the review to have a chance to respond. > > > > > > I do not believe an "accept" in a review is an "approve to commit > > > beyond your normal scope". > > > > > > Was cem aware that he was "approving a non src committer to > > > commit > > > this change to the src tree" as your review has no mention that > > > you > > > are seeking src bit approval to commit there. > > > > > > > > > > > > > > > I felt the need to commit the UPDATING entry was time > > > > sensitive, given the > > > > change it was notifying users of had already been committed. > > > > > > > > Regards, > > > > Ben > > > > -- > > > -- > > > Rod Grimes                                                 rgrime > > > s@freebsd.org > > > > > From owner-svn-src-head@freebsd.org Tue Nov 13 18:12:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 033B4112CEAF; Tue, 13 Nov 2018 18:12:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8880E70F3A; Tue, 13 Nov 2018 18:12:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F7CC13D29; Tue, 13 Nov 2018 18:12:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADIC7Qc019036; Tue, 13 Nov 2018 18:12:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADIC631019034; Tue, 13 Nov 2018 18:12:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811131812.wADIC631019034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Nov 2018 18:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340399 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 340399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8880E70F3A X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 18:12:08 -0000 Author: markj Date: Tue Nov 13 18:12:06 2018 New Revision: 340399 URL: https://svnweb.freebsd.org/changeset/base/340399 Log: RISC-V: Add macros for reading performance counter CSRs. The RISC-V spec defines several performance counter CSRs such as: cycle, time, instret, hpmcounter(3...31). They are defined to be 64-bits wide on all RISC-V architectures. On RV64 and RV128 they can be read from a single CSR. On RV32, additional CSRs (given the suffix "h") are present which contain the upper 32 bits of these counters, and must be read as well. (See section 2.8 in the User ISA Spec for full details.) This change adds macros for reading these values safely on any RISC-V ISA length. Obviously we aren't supporting anything other than RV64 at the moment, but this ensures we won't need to change how we read these values if we ever do. Submitted by: Mitchell Horne Reviewed by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17952 Modified: head/sys/riscv/include/cpufunc.h head/sys/riscv/include/riscvreg.h Modified: head/sys/riscv/include/cpufunc.h ============================================================================== --- head/sys/riscv/include/cpufunc.h Tue Nov 13 17:43:16 2018 (r340398) +++ head/sys/riscv/include/cpufunc.h Tue Nov 13 18:12:06 2018 (r340399) @@ -104,6 +104,11 @@ sfence_vma_page(uintptr_t addr) __asm __volatile("sfence.vma %0" :: "r" (addr) : "memory"); } +#define rdcycle() csr_read64(cycle) +#define rdtime() csr_read64(time) +#define rdinstret() csr_read64(instret) +#define rdhpmcounter(n) csr_read64(hpmcounter##n) + #define cpufunc_nullop() riscv_nullop() void riscv_nullop(void); Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Tue Nov 13 17:43:16 2018 (r340398) +++ head/sys/riscv/include/riscvreg.h Tue Nov 13 18:12:06 2018 (r340399) @@ -223,4 +223,23 @@ val; \ }) +#if __riscv_xlen == 32 +#define csr_read64(csr) \ +({ uint64_t val; \ + uint32_t high, low; \ + __asm __volatile("1: " \ + "csrr t0, " #csr "h\n" \ + "csrr %0, " #csr "\n" \ + "csrr %1, " #csr "h\n" \ + "bne t0, %1, 1b" \ + : "=r" (low), "=r" (high) \ + : \ + : "t0"); \ + val = (low | ((uint64_t)high << 32)); \ + val; \ +}) +#else +#define csr_read64(csr) ((uint64_t)csr_read(csr)) +#endif + #endif /* !_MACHINE_RISCVREG_H_ */ From owner-svn-src-head@freebsd.org Tue Nov 13 18:20:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A996112D1E2; Tue, 13 Nov 2018 18:20:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8A77151B; Tue, 13 Nov 2018 18:20:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71B6613D5E; Tue, 13 Nov 2018 18:20:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADIKRDq019564; Tue, 13 Nov 2018 18:20:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADIKRCs019563; Tue, 13 Nov 2018 18:20:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811131820.wADIKRCs019563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Nov 2018 18:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340400 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 340400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F8A77151B X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 18:20:28 -0000 Author: markj Date: Tue Nov 13 18:20:27 2018 New Revision: 340400 URL: https://svnweb.freebsd.org/changeset/base/340400 Log: RISC-V: Implement get_cyclecount(9). Add the missing implementation for get_cyclecount(9) on RISC-V by reading the cycle CSR. Submitted by: Mitchell Horne Reviewed by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17953 Modified: head/sys/riscv/include/cpu.h Modified: head/sys/riscv/include/cpu.h ============================================================================== --- head/sys/riscv/include/cpu.h Tue Nov 13 18:12:06 2018 (r340399) +++ head/sys/riscv/include/cpu.h Tue Nov 13 18:20:27 2018 (r340400) @@ -38,6 +38,7 @@ #define _MACHINE_CPU_H_ #include +#include #include #define TRAPF_PC(tfp) ((tfp)->tf_ra) @@ -86,8 +87,7 @@ static __inline uint64_t get_cyclecount(void) { - /* TODO: This is bogus */ - return (1); + return (rdcycle()); } #endif From owner-svn-src-head@freebsd.org Tue Nov 13 18:40:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AF95112D894; Tue, 13 Nov 2018 18:40:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E11E772199; Tue, 13 Nov 2018 18:40:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C18D014098; Tue, 13 Nov 2018 18:40:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADIe16E030013; Tue, 13 Nov 2018 18:40:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADIe1D5030011; Tue, 13 Nov 2018 18:40:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811131840.wADIe1D5030011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Nov 2018 18:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340402 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E11E772199 X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 18:40:02 -0000 Author: markj Date: Tue Nov 13 18:40:01 2018 New Revision: 340402 URL: https://svnweb.freebsd.org/changeset/base/340402 Log: Allow allocations across meta boundaries. Remove restrictions that prevent allocation requests to cross the boundary between two meta nodes. Replace the bmu_avail field in meta nodes with a bitmap that identifies which subtrees have some free memory, and iterate over the nonempty subtrees only in blst_meta_alloc. If free memory is scarce, this should make searching for it faster. Put the code for handling the next-leaf allocation in a separate function. When taking blocks from the next leaf empties the leaf, be sure to clear the appropriate bit in its parent, and so on, up to the least-common ancestor of this leaf and the next. Eliminate special terminator nodes, and rely instead on the fact that there is a 0-bit at the end of the bitmask at the root of the tree that will stop a meta_alloc search, or a next-leaf search, before the search falls off the end of the tree. Make sure that the tree is big enough to have space for that 0-bit. Eliminate special all-free indicators. Lazy initialization of subtrees stands in the way of having an allocation span a meta-node boundary, so a subtree of all free blocks is not treated specially. Subtrees of all-allocated blocks are still recognized by looking at the bitmask at the root and finding 0. Don't print all-allocated subtrees. Do print the bitmasks for meta nodes, when tree-printing. Submitted by: Doug Moore Reviewed by: alc MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12635 Modified: head/sys/kern/subr_blist.c head/sys/sys/blist.h Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Tue Nov 13 18:21:47 2018 (r340401) +++ head/sys/kern/subr_blist.c Tue Nov 13 18:40:01 2018 (r340402) @@ -46,11 +46,11 @@ * upper bound on a potential allocation, but not necessarily a tight upper * bound. * - * The radix tree also implements two collapsed states for meta nodes: - * the ALL-ALLOCATED state and the ALL-FREE state. If a meta node is - * in either of these two states, all information contained underneath - * the node is considered stale. These states are used to optimize - * allocation and freeing operations. + * The bitmap field in each node directs the search for available blocks. + * For a leaf node, a bit is set if the corresponding block is free. For a + * meta node, a bit is set if the corresponding subtree contains a free + * block somewhere within it. The search at a meta node considers only + * children of that node that represent a range that includes a free block. * * The hinting greatly increases code efficiency for allocations while * the general radix structure optimizes both allocations and frees. The @@ -59,19 +59,19 @@ * * The blist code wires all necessary memory at creation time. Neither * allocations nor frees require interaction with the memory subsystem. - * The non-blocking features of the blist code are used in the swap code - * (vm/swap_pager.c). + * The non-blocking nature of allocations and frees is required by swap + * code (vm/swap_pager.c). * - * LAYOUT: The radix tree is laid out recursively using a - * linear array. Each meta node is immediately followed (laid out - * sequentially in memory) by BLIST_META_RADIX lower level nodes. This - * is a recursive structure but one that can be easily scanned through - * a very simple 'skip' calculation. In order to support large radixes, - * portions of the tree may reside outside our memory allocation. We - * handle this with an early-termination optimization (when bighint is - * set to -1) on the scan. The memory allocation is only large enough - * to cover the number of blocks requested at creation time even if it - * must be encompassed in larger root-node radix. + * LAYOUT: The radix tree is laid out recursively using a linear array. + * Each meta node is immediately followed (laid out sequentially in + * memory) by BLIST_META_RADIX lower level nodes. This is a recursive + * structure but one that can be easily scanned through a very simple + * 'skip' calculation. The memory allocation is only large enough to + * cover the number of blocks requested at creation time. Nodes that + * represent blocks beyond that limit, nodes that would never be read + * or written, are not allocated, so that the last of the + * BLIST_META_RADIX lower level nodes of a some nodes may not be + * allocated. * * NOTE: the allocator cannot currently allocate more than * BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too @@ -105,6 +105,7 @@ __FBSDID("$FreeBSD$"); #define BLIST_DEBUG #endif +#include #include #include #include @@ -118,7 +119,7 @@ __FBSDID("$FreeBSD$"); #define bitcount64(x) __bitcount64((uint64_t)(x)) #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) -static __inline int imax(int a, int b) { return (a > b ? a : b); } +#define ummin(a,b) ((a) < (b) ? (a) : (b)) #include @@ -179,6 +180,18 @@ radix_to_skip(daddr_t radix) } /* + * Provide a mask with count bits set, starting as position n. + */ +static inline u_daddr_t +bitrange(int n, int count) +{ + + return (((u_daddr_t)-1 << n) & + ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - (n + count)))); +} + + +/* * Use binary search, or a faster method, to find the 1 bit in a u_daddr_t. * Assumes that the argument has only one bit set. */ @@ -220,9 +233,7 @@ blist_t blist_create(daddr_t blocks, int flags) { blist_t bl; - daddr_t i, last_block; - u_daddr_t nodes, radix, skip; - int digit; + u_daddr_t nodes, radix; if (blocks == 0) panic("invalid block count"); @@ -230,30 +241,13 @@ blist_create(daddr_t blocks, int flags) /* * Calculate the radix and node count used for scanning. */ - last_block = blocks - 1; + nodes = 1; radix = BLIST_BMAP_RADIX; - while (radix < blocks) { - if (((last_block / radix + 1) & BLIST_META_MASK) != 0) - /* - * We must widen the blist to avoid partially - * filled nodes. - */ - last_block |= radix - 1; + while (radix <= blocks) { + nodes += 1 + (blocks - 1) / radix; radix *= BLIST_META_RADIX; } - /* - * Count the meta-nodes in the expanded tree, including the final - * terminator, from the bottom level up to the root. - */ - nodes = 1; - if (radix - blocks >= BLIST_BMAP_RADIX) - nodes++; - last_block /= BLIST_BMAP_RADIX; - while (last_block > 0) { - nodes += last_block + 1; - last_block /= BLIST_META_RADIX; - } bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags | M_ZERO); if (bl == NULL) @@ -261,34 +255,7 @@ blist_create(daddr_t blocks, int flags) bl->bl_blocks = blocks; bl->bl_radix = radix; - bl->bl_cursor = 0; - /* - * Initialize the empty tree by filling in root values, then initialize - * just the terminators in the rest of the tree. - */ - bl->bl_root[0].bm_bighint = 0; - if (radix == BLIST_BMAP_RADIX) - bl->bl_root[0].u.bmu_bitmap = 0; - else - bl->bl_root[0].u.bmu_avail = 0; - last_block = blocks - 1; - i = 0; - while (radix > BLIST_BMAP_RADIX) { - radix /= BLIST_META_RADIX; - skip = radix_to_skip(radix); - digit = last_block / radix; - i += 1 + digit * skip; - if (digit != BLIST_META_MASK) { - /* - * Add a terminator. - */ - bl->bl_root[i + skip].bm_bighint = (daddr_t)-1; - bl->bl_root[i + skip].u.bmu_bitmap = 0; - } - last_block %= radix; - } - #if defined(BLIST_DEBUG) printf( "BLIST representing %lld blocks (%lld MB of swap)" @@ -321,6 +288,9 @@ blist_alloc(blist_t bl, daddr_t count) { daddr_t blk; + if (count > BLIST_MAX_ALLOC) + panic("allocation too large"); + /* * This loop iterates at most twice. An allocation failure in the * first iteration leads to a second iteration only if the cursor was @@ -331,12 +301,13 @@ blist_alloc(blist_t bl, daddr_t count) blk = blst_meta_alloc(bl->bl_root, bl->bl_cursor, count, bl->bl_radix); if (blk != SWAPBLK_NONE) { + bl->bl_avail -= count; bl->bl_cursor = blk + count; if (bl->bl_cursor == bl->bl_blocks) bl->bl_cursor = 0; return (blk); - } else if (bl->bl_cursor != 0) - bl->bl_cursor = 0; + } + bl->bl_cursor = 0; } return (SWAPBLK_NONE); } @@ -348,10 +319,7 @@ daddr_t blist_avail(blist_t bl) { - if (bl->bl_radix == BLIST_BMAP_RADIX) - return (bitcount64(bl->bl_root->u.bmu_bitmap)); - else - return (bl->bl_root->u.bmu_avail); + return (bl->bl_avail); } /* @@ -363,7 +331,10 @@ void blist_free(blist_t bl, daddr_t blkno, daddr_t count) { + if (blkno < 0 || blkno + count > bl->bl_blocks) + panic("freeing invalid range"); blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix); + bl->bl_avail += count; } /* @@ -375,8 +346,13 @@ blist_free(blist_t bl, daddr_t blkno, daddr_t count) daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count) { + daddr_t filled; - return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix)); + if (blkno < 0 || blkno + count > bl->bl_blocks) + panic("filling invalid range"); + filled = blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix); + bl->bl_avail -= filled; + return (filled); } /* @@ -414,8 +390,11 @@ blist_resize(blist_t *pbl, daddr_t count, int freenew, void blist_print(blist_t bl) { - printf("BLIST cursor = %08jx {\n", (uintmax_t)bl->bl_cursor); - blst_radix_print(bl->bl_root, 0, bl->bl_radix, 4); + printf("BLIST avail = %jd, cursor = %08jx {\n", + (uintmax_t)bl->bl_avail, (uintmax_t)bl->bl_cursor); + + if (bl->bl_root->bm_bitmap != 0) + blst_radix_print(bl->bl_root, 0, bl->bl_radix, 4); printf("}\n"); } @@ -569,16 +548,11 @@ blist_stats(blist_t bl, struct sbuf *s) * Check for skippable subtrees starting at i. */ while (radix > BLIST_BMAP_RADIX) { - if (bl->bl_root[nodes].u.bmu_avail == 0) { + if (bl->bl_root[nodes].bm_bitmap == 0) { if (gap_stats_counting(stats)) update_gap_stats(stats, i); break; } - if (bl->bl_root[nodes].u.bmu_avail == radix) { - if (!gap_stats_counting(stats)) - update_gap_stats(stats, i); - break; - } /* * Skip subtree root. @@ -590,7 +564,7 @@ blist_stats(blist_t bl, struct sbuf *s) /* * Scan leaf. */ - mask = bl->bl_root[nodes].u.bmu_bitmap; + mask = bl->bl_root[nodes].bm_bitmap; diff = mask ^ (mask << 1); if (gap_stats_counting(stats)) diff ^= 1; @@ -618,8 +592,58 @@ blist_stats(blist_t bl, struct sbuf *s) */ /* - * blist_leaf_alloc() - allocate at a leaf in the radix tree (a bitmap). + * BLST_NEXT_LEAF_ALLOC() - allocate the first few blocks in the next leaf. * + * 'scan' is a leaf node, associated with a block containing 'blk'. + * The next leaf node could be adjacent, or several nodes away if the + * least common ancestor of 'scan' and its neighbor is several levels + * up. Use 'blk' to determine how many meta-nodes lie between the + * leaves. If the next leaf has enough initial bits set, clear them + * and clear the bits in the meta nodes on the path up to the least + * common ancestor to mark any subtrees made completely empty. + */ +static int +blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int count) +{ + blmeta_t *next; + daddr_t skip; + u_daddr_t radix; + int digit; + + next = scan + 1; + blk += BLIST_BMAP_RADIX; + radix = BLIST_BMAP_RADIX; + while ((digit = ((blk / radix) & BLIST_META_MASK)) == 0 && + (next->bm_bitmap & 1) == 1) { + next++; + radix *= BLIST_META_RADIX; + } + if (((next->bm_bitmap + 1) & ~((u_daddr_t)-1 << count)) != 0) { + /* + * The next leaf doesn't have enough free blocks at the + * beginning to complete the spanning allocation. + */ + return (ENOMEM); + } + /* Clear the first 'count' bits in the next leaf to allocate. */ + next->bm_bitmap &= (u_daddr_t)-1 << count; + + /* + * Update bitmaps of next-ancestors, up to least common ancestor. + */ + skip = radix_to_skip(radix); + while (radix != BLIST_BMAP_RADIX && next->bm_bitmap == 0) { + (--next)->bm_bitmap ^= 1; + radix /= BLIST_META_RADIX; + } + if (next->bm_bitmap == 0) + scan[-digit * skip].bm_bitmap ^= (u_daddr_t)1 << digit; + return (0); +} + +/* + * BLST_LEAF_ALLOC() - allocate at a leaf in the radix tree (a bitmap). + * * This is the core of the allocator and is optimized for the * BLIST_BMAP_RADIX block allocation case. Otherwise, execution * time is proportional to log2(count) + bitpos time. @@ -633,15 +657,15 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count range1 = 0; count1 = count - 1; num_shifts = fls(count1); - mask = scan->u.bmu_bitmap; + mask = scan->bm_bitmap; while ((-mask & ~mask) != 0 && num_shifts > 0) { /* * If bit i is set in mask, then bits in [i, i+range1] are set - * in scan->u.bmu_bitmap. The value of range1 is equal to + * in scan->bm_bitmap. The value of range1 is equal to * count1 >> num_shifts. Grow range and reduce num_shifts to 0, * while preserving these invariants. The updates to mask leave * fewer bits set, but each bit that remains set represents a - * longer string of consecutive bits set in scan->u.bmu_bitmap. + * longer string of consecutive bits set in scan->bm_bitmap. * If more updates to mask cannot clear more bits, because mask * is partitioned with all 0 bits preceding all 1 bits, the loop * terminates immediately. @@ -685,31 +709,14 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count * An allocation within this leaf is impossible, so a successful * allocation depends on the next leaf providing some of the blocks. */ - if (((blk / BLIST_BMAP_RADIX + 1) & BLIST_META_MASK) == 0) { + if (blst_next_leaf_alloc(scan, blk, hi - BLIST_BMAP_RADIX) != 0) /* - * The next leaf has a different meta-node parent, so it - * is not necessarily initialized. Update bighint, - * comparing the range found at the end of mask to the - * largest earlier range that could have been made to - * vanish in the initial processing of mask. + * The hint cannot be updated, because the same + * allocation request could be satisfied later, by this + * leaf, if the state of the next leaf changes, and + * without any changes to this leaf. */ - scan->bm_bighint = imax(BLIST_BMAP_RADIX - lo, range1); return (SWAPBLK_NONE); - } - hi -= BLIST_BMAP_RADIX; - if (((scan[1].u.bmu_bitmap + 1) & ~((u_daddr_t)-1 << hi)) != 0) { - /* - * The next leaf doesn't have enough free blocks at the - * beginning to complete the spanning allocation. The - * hint cannot be updated, because the same allocation - * request could be satisfied later, by this leaf, if - * the state of the next leaf changes, and without any - * changes to this leaf. - */ - return (SWAPBLK_NONE); - } - /* Clear the first 'hi' bits in the next leaf, allocating them. */ - scan[1].u.bmu_bitmap &= (u_daddr_t)-1 << hi; hi = BLIST_BMAP_RADIX; } @@ -724,12 +731,9 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count } else { /* Clear the bits of mask at position 'hi' and higher. */ mask &= (u_daddr_t)-1 >> (BLIST_BMAP_RADIX - hi); - /* If this allocation uses all the bits, clear the hint. */ - if (mask == scan->u.bmu_bitmap) - scan->bm_bighint = 0; } /* Clear the allocated bits from this leaf. */ - scan->u.bmu_bitmap &= ~mask; + scan->bm_bitmap &= ~mask; return ((blk & ~BLIST_BMAP_MASK) + lo); } @@ -744,81 +748,61 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix) { - daddr_t blk, i, next_skip, r, skip; - int child; + daddr_t blk, i, r, skip; + u_daddr_t bit, mask; bool scan_from_start; + int digit; if (radix == BLIST_BMAP_RADIX) return (blst_leaf_alloc(scan, cursor, count)); - if (scan->u.bmu_avail < count) { - /* - * The meta node's hint must be too large if the allocation - * exceeds the number of free blocks. Reduce the hint, and - * return failure. - */ - scan->bm_bighint = scan->u.bmu_avail; - return (SWAPBLK_NONE); - } blk = cursor & -radix; + scan_from_start = (cursor == blk); + radix /= BLIST_META_RADIX; skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; + mask = scan->bm_bitmap; + /* Discard any candidates that appear before cursor. */ + digit = (cursor / radix) & BLIST_META_MASK; + mask &= (u_daddr_t)-1 << digit; + /* - * An ALL-FREE meta node requires special handling before allocating - * any of its blocks. + * If the first try is for a block that includes the cursor, pre-undo + * the digit * radix offset in the first call; otherwise, ignore the + * cursor entirely. */ - if (scan->u.bmu_avail == radix) { - radix /= BLIST_META_RADIX; + if (((mask >> digit) & 1) == 1) + cursor -= digit * radix; + else + cursor = blk; - /* - * Reinitialize each of the meta node's children. An ALL-FREE - * meta node cannot have a terminator in any subtree. - */ - for (i = 1; i < skip; i += next_skip) { - if (next_skip == 1) - scan[i].u.bmu_bitmap = (u_daddr_t)-1; - else - scan[i].u.bmu_avail = radix; - scan[i].bm_bighint = radix; - } - } else { - radix /= BLIST_META_RADIX; - } - - if (count > radix) { - /* - * The allocation exceeds the number of blocks that are - * managed by a subtree of this meta node. - */ - panic("allocation too large"); - } - scan_from_start = cursor == blk; - child = (cursor - blk) / radix; - blk += child * radix; - for (i = 1 + child * next_skip; i < skip; i += next_skip) { + /* + * Examine the nonempty subtree associated with each bit set in mask. + */ + do { + bit = mask & -mask; + digit = bitpos(bit); + i = 1 + digit * skip; if (count <= scan[i].bm_bighint) { /* * The allocation might fit beginning in the i'th subtree. */ - r = blst_meta_alloc(&scan[i], - cursor > blk ? cursor : blk, count, radix); + r = blst_meta_alloc(&scan[i], cursor + digit * radix, + count, radix); if (r != SWAPBLK_NONE) { - scan->u.bmu_avail -= count; + if (scan[i].bm_bitmap == 0) + scan->bm_bitmap ^= bit; return (r); } - } else if (scan[i].bm_bighint == (daddr_t)-1) { - /* - * Terminator - */ - break; } - blk += radix; - } + cursor = blk; + } while ((mask ^= bit) != 0); /* - * We couldn't allocate count in this subtree, update bighint. + * We couldn't allocate count in this subtree. If the whole tree was + * scanned, and the last tree node is allocated, update bighint. */ - if (scan_from_start && scan->bm_bighint >= count) + if (scan_from_start && !(digit == BLIST_META_RADIX - 1 && + scan[i].bm_bighint == BLIST_MAX_ALLOC)) scan->bm_bighint = count - 1; return (SWAPBLK_NONE); @@ -832,7 +816,6 @@ static void blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) { u_daddr_t mask; - int n; /* * free some data in this bitmap @@ -840,20 +823,10 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) * \_________/\__/ * count n */ - n = blk & BLIST_BMAP_MASK; - mask = ((u_daddr_t)-1 << n) & - ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n)); - if (scan->u.bmu_bitmap & mask) + mask = bitrange(blk & BLIST_BMAP_MASK, count); + if (scan->bm_bitmap & mask) panic("freeing free block"); - scan->u.bmu_bitmap |= mask; - - /* - * We could probably do a better job here. We are required to make - * bighint at least as large as the biggest contiguous block of - * data. If we just shoehorn it, a little extra overhead will - * be incured on the next allocation (but only that one typically). - */ - scan->bm_bighint = BLIST_BMAP_RADIX; + scan->bm_bitmap |= mask; } /* @@ -869,79 +842,37 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, u_daddr_t radix) { - daddr_t blk, i, next_skip, skip, v; - int child; + daddr_t blk, endBlk, i, skip; + int digit, endDigit; - if (scan->bm_bighint == (daddr_t)-1) - panic("freeing invalid range"); - if (radix == BLIST_BMAP_RADIX) - return (blst_leaf_free(scan, freeBlk, count)); - skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; - - if (scan->u.bmu_avail == 0) { - /* - * ALL-ALLOCATED special case, with possible - * shortcut to ALL-FREE special case. - */ - scan->u.bmu_avail = count; - scan->bm_bighint = count; - - if (count != radix) { - for (i = 1; i < skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) - break; - scan[i].bm_bighint = 0; - if (next_skip == 1) { - scan[i].u.bmu_bitmap = 0; - } else { - scan[i].u.bmu_avail = 0; - } - } - /* fall through */ - } - } else { - scan->u.bmu_avail += count; - /* scan->bm_bighint = radix; */ - } - /* - * ALL-FREE special case. + * We could probably do a better job here. We are required to make + * bighint at least as large as the biggest allocable block of data. + * If we just shoehorn it, a little extra overhead will be incurred + * on the next allocation (but only that one typically). */ + scan->bm_bighint = BLIST_MAX_ALLOC; - if (scan->u.bmu_avail == radix) - return; - if (scan->u.bmu_avail > radix) - panic("blst_meta_free: freeing already free blocks (%lld) %lld/%lld", - (long long)count, (long long)scan->u.bmu_avail, - (long long)radix); + if (radix == BLIST_BMAP_RADIX) + return (blst_leaf_free(scan, freeBlk, count)); - /* - * Break the free down into its components - */ - - blk = freeBlk & -radix; + endBlk = ummin(freeBlk + count, (freeBlk + radix) & -radix); radix /= BLIST_META_RADIX; - - child = (freeBlk - blk) / radix; - blk += child * radix; - i = 1 + child * next_skip; - while (i < skip && blk < freeBlk + count) { - v = blk + radix - freeBlk; - if (v > count) - v = count; - blst_meta_free(&scan[i], freeBlk, v, radix); - if (scan->bm_bighint < scan[i].bm_bighint) - scan->bm_bighint = scan[i].bm_bighint; - count -= v; - freeBlk += v; + skip = radix_to_skip(radix); + blk = freeBlk & -radix; + digit = (blk / radix) & BLIST_META_MASK; + endDigit = 1 + (((endBlk - 1) / radix) & BLIST_META_MASK); + scan->bm_bitmap |= bitrange(digit, endDigit - digit); + for (i = 1 + digit * skip; blk < endBlk; i += skip) { blk += radix; - i += next_skip; + count = ummin(blk, endBlk) - freeBlk; + blst_meta_free(&scan[i], freeBlk, count, radix); + freeBlk = blk; } } /* - * BLIST_RADIX_COPY() - copy one radix tree to another + * BLST_COPY() - copy one radix tree to another * * Locates free space in the source tree and frees it in the destination * tree. The space may not already be free in the destination. @@ -950,21 +881,21 @@ static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest, daddr_t count) { - daddr_t i, next_skip, skip; + daddr_t endBlk, i, skip; /* * Leaf node */ if (radix == BLIST_BMAP_RADIX) { - u_daddr_t v = scan->u.bmu_bitmap; + u_daddr_t v = scan->bm_bitmap; if (v == (u_daddr_t)-1) { blist_free(dest, blk, count); } else if (v != 0) { int i; - for (i = 0; i < BLIST_BMAP_RADIX && i < count; ++i) { + for (i = 0; i < count; ++i) { if (v & ((u_daddr_t)1 << i)) blist_free(dest, blk + i, 1); } @@ -976,42 +907,22 @@ blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, * Meta node */ - if (scan->u.bmu_avail == 0) { + if (scan->bm_bitmap == 0) { /* * Source all allocated, leave dest allocated */ return; } - if (scan->u.bmu_avail == radix) { - /* - * Source all free, free entire dest - */ - if (count < radix) - blist_free(dest, blk, count); - else - blist_free(dest, blk, radix); - return; - } - - skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; + endBlk = blk + count; radix /= BLIST_META_RADIX; - - for (i = 1; count && i < skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) - break; - - if (count >= radix) { - blst_copy(&scan[i], blk, radix, dest, radix); - count -= radix; - } else { - if (count) { - blst_copy(&scan[i], blk, radix, dest, count); - } - count = 0; - } + skip = radix_to_skip(radix); + for (i = 1; blk < endBlk; i += skip) { blk += radix; + count = radix; + if (blk >= endBlk) + count -= blk - endBlk; + blst_copy(&scan[i], blk - radix, radix, dest, count); } } @@ -1027,16 +938,13 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) { daddr_t nblks; u_daddr_t mask; - int n; - n = blk & BLIST_BMAP_MASK; - mask = ((u_daddr_t)-1 << n) & - ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n)); + mask = bitrange(blk & BLIST_BMAP_MASK, count); /* Count the number of blocks that we are allocating. */ - nblks = bitcount64(scan->u.bmu_bitmap & mask); + nblks = bitcount64(scan->bm_bitmap & mask); - scan->u.bmu_bitmap &= ~mask; + scan->bm_bitmap &= ~mask; return (nblks); } @@ -1051,70 +959,27 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, u_daddr_t radix) { - daddr_t blk, i, nblks, next_skip, skip, v; - int child; + daddr_t blk, endBlk, i, nblks, skip; + int digit; - if (scan->bm_bighint == (daddr_t)-1) - panic("filling invalid range"); - if (count > radix) { - /* - * The allocation exceeds the number of blocks that are - * managed by this node. - */ - panic("fill too large"); - } if (radix == BLIST_BMAP_RADIX) return (blst_leaf_fill(scan, allocBlk, count)); - if (count == radix || scan->u.bmu_avail == 0) { - /* - * ALL-ALLOCATED special case - */ - nblks = scan->u.bmu_avail; - scan->u.bmu_avail = 0; - scan->bm_bighint = 0; - return (nblks); - } + + endBlk = ummin(allocBlk + count, (allocBlk + radix) & -radix); + radix /= BLIST_META_RADIX; skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; blk = allocBlk & -radix; - - /* - * An ALL-FREE meta node requires special handling before allocating - * any of its blocks. - */ - if (scan->u.bmu_avail == radix) { - radix /= BLIST_META_RADIX; - - /* - * Reinitialize each of the meta node's children. An ALL-FREE - * meta node cannot have a terminator in any subtree. - */ - for (i = 1; i < skip; i += next_skip) { - if (next_skip == 1) - scan[i].u.bmu_bitmap = (u_daddr_t)-1; - else - scan[i].u.bmu_avail = radix; - scan[i].bm_bighint = radix; - } - } else { - radix /= BLIST_META_RADIX; - } - nblks = 0; - child = (allocBlk - blk) / radix; - blk += child * radix; - i = 1 + child * next_skip; - while (i < skip && blk < allocBlk + count) { - v = blk + radix - allocBlk; - if (v > count) - v = count; - nblks += blst_meta_fill(&scan[i], allocBlk, v, radix); - count -= v; - allocBlk += v; + while (blk < endBlk) { + digit = (blk / radix) & BLIST_META_MASK; + i = 1 + digit * skip; blk += radix; - i += next_skip; + count = ummin(blk, endBlk) - allocBlk; + nblks += blst_meta_fill(&scan[i], allocBlk, count, radix); + if (scan[i].bm_bitmap == 0) + scan->bm_bitmap &= ~((u_daddr_t)1 << digit); + allocBlk = blk; } - scan->u.bmu_avail -= nblks; return (nblks); } @@ -1123,64 +988,44 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab) { - daddr_t i, next_skip, skip; + daddr_t skip; + u_daddr_t bit, mask; + int digit; if (radix == BLIST_BMAP_RADIX) { printf( - "%*.*s(%08llx,%lld): bitmap %016llx big=%lld\n", + "%*.*s(%08llx,%lld): bitmap %0*llx big=%lld\n", tab, tab, "", (long long)blk, (long long)radix, - (long long)scan->u.bmu_bitmap, + 1 + (BLIST_BMAP_RADIX - 1) / 4, + (long long)scan->bm_bitmap, (long long)scan->bm_bighint ); return; } - if (scan->u.bmu_avail == 0) { - printf( - "%*.*s(%08llx,%lld) ALL ALLOCATED\n", - tab, tab, "", - (long long)blk, - (long long)radix - ); - return; - } - if (scan->u.bmu_avail == radix) { - printf( - "%*.*s(%08llx,%lld) ALL FREE\n", - tab, tab, "", - (long long)blk, - (long long)radix - ); - return; - } - printf( - "%*.*s(%08llx,%lld): subtree (%lld/%lld) big=%lld {\n", + "%*.*s(%08llx): subtree (%lld/%lld) bitmap %0*llx big=%lld {\n", tab, tab, "", (long long)blk, (long long)radix, - (long long)scan->u.bmu_avail, (long long)radix, + 1 + (BLIST_META_RADIX - 1) / 4, + (long long)scan->bm_bitmap, (long long)scan->bm_bighint ); - skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; radix /= BLIST_META_RADIX; + skip = radix_to_skip(radix); tab += 4; - for (i = 1; i < skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) { - printf( - "%*.*s(%08llx,%lld): Terminator\n", - tab, tab, "", - (long long)blk, (long long)radix - ); - break; - } - blst_radix_print(&scan[i], blk, radix, tab); - blk += radix; - } + mask = scan->bm_bitmap; + /* Examine the nonempty subtree associated with each bit set in mask */ + do { + bit = mask & -mask; + digit = bitpos(bit); + blst_radix_print(&scan[1 + digit * skip], blk + digit * radix, + radix, tab); + } while ((mask ^= bit) != 0); tab -= 4; printf( @@ -1196,7 +1041,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t int main(int ac, char **av) { - int size = 1024; + int size = BLIST_META_RADIX * BLIST_BMAP_RADIX; int i; blist_t bl; struct sbuf *s; Modified: head/sys/sys/blist.h ============================================================================== --- head/sys/sys/blist.h Tue Nov 13 18:21:47 2018 (r340401) +++ head/sys/sys/blist.h Tue Nov 13 18:40:01 2018 (r340402) @@ -73,22 +73,20 @@ typedef uint64_t u_daddr_t; /* unsigned disk address * */ typedef struct blmeta { - union { - daddr_t bmu_avail; /* space available under us */ - u_daddr_t bmu_bitmap; /* bitmap if we are a leaf */ - } u; + u_daddr_t bm_bitmap; /* bitmap if we are a leaf */ daddr_t bm_bighint; /* biggest contiguous block hint*/ } blmeta_t; typedef struct blist { daddr_t bl_blocks; /* area of coverage */ + daddr_t bl_avail; /* # available blocks */ u_daddr_t bl_radix; /* coverage radix */ daddr_t bl_cursor; /* next-fit search starts at */ blmeta_t bl_root[1]; /* root of radix tree */ } *blist_t; -#define BLIST_META_RADIX 16 #define BLIST_BMAP_RADIX (sizeof(u_daddr_t)*8) +#define BLIST_META_RADIX BLIST_BMAP_RADIX #define BLIST_MAX_ALLOC BLIST_BMAP_RADIX From owner-svn-src-head@freebsd.org Tue Nov 13 19:02:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B51D6112E195; Tue, 13 Nov 2018 19:02:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24F1473146; Tue, 13 Nov 2018 19:02:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 070BA14550; Tue, 13 Nov 2018 19:02:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADJ2BBC045660; Tue, 13 Nov 2018 19:02:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADJ2BlX045658; Tue, 13 Nov 2018 19:02:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811131902.wADJ2BlX045658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Nov 2018 19:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340404 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 24F1473146 X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 19:02:13 -0000 Author: glebius Date: Tue Nov 13 19:02:11 2018 New Revision: 340404 URL: https://svnweb.freebsd.org/changeset/base/340404 Log: Uninline epoch(9) entrance and exit. There is no proof that modern processors would benefit from avoiding a function call, but bloating code. In fact, clang created an uninlined real function for many object files in the network stack. - Move epoch_private.h into subr_epoch.c. Code copied exactly, avoiding any changes, including style(9). - Remove private copies of critical_enter/exit. Reviewed by: kib, jtl Differential Revision: https://reviews.freebsd.org/D17879 Deleted: head/sys/sys/epoch_private.h Modified: head/sys/kern/subr_epoch.c head/sys/sys/epoch.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Tue Nov 13 18:49:43 2018 (r340403) +++ head/sys/kern/subr_epoch.c Tue Nov 13 19:02:11 2018 (r340404) @@ -55,6 +55,40 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); +typedef struct epoch_thread { +#ifdef EPOCH_TRACKER_DEBUG + uint64_t et_magic_pre; +#endif + TAILQ_ENTRY(epoch_thread) et_link; /* Epoch queue. */ + struct thread *et_td; /* pointer to thread in section */ + ck_epoch_section_t et_section; /* epoch section object */ +#ifdef EPOCH_TRACKER_DEBUG + uint64_t et_magic_post; +#endif +} *epoch_thread_t; +TAILQ_HEAD (epoch_tdlist, epoch_thread); + +#ifdef __amd64__ +#define EPOCH_ALIGN CACHE_LINE_SIZE*2 +#else +#define EPOCH_ALIGN CACHE_LINE_SIZE +#endif + +typedef struct epoch_record { + ck_epoch_record_t er_read_record; + ck_epoch_record_t er_write_record; + volatile struct epoch_tdlist er_tdlist; + volatile uint32_t er_gen; + uint32_t er_cpuid; +} __aligned(EPOCH_ALIGN) *epoch_record_t; + +struct epoch { + struct ck_epoch e_epoch __aligned(EPOCH_ALIGN); + epoch_record_t e_pcpu_record; + int e_idx; + int e_flags; +}; + /* arbitrary --- needs benchmarking */ #define MAX_ADAPTIVE_SPIN 100 #define MAX_EPOCHS 64 @@ -157,6 +191,15 @@ epoch_ctor(epoch_t epoch) } } +static void +epoch_adjust_prio(struct thread *td, u_char prio) +{ + + thread_lock(td); + sched_prio(td, prio); + thread_unlock(td); +} + epoch_t epoch_alloc(int flags) { @@ -192,32 +235,110 @@ epoch_free(epoch_t epoch) free(epoch, M_EPOCH); } +static epoch_record_t +epoch_currecord(epoch_t epoch) +{ + + return (zpcpu_get_cpu(epoch->e_pcpu_record, curcpu)); +} + +#define INIT_CHECK(epoch) \ + do { \ + if (__predict_false((epoch) == NULL)) \ + return; \ + } while (0) + void -epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et) +epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) { + struct epoch_record *er; + struct epoch_thread *etd; + struct thread_lite *td; - epoch_enter_preempt(epoch, et); + MPASS(cold || epoch != NULL); + INIT_CHECK(epoch); + etd = (void *)et; + MPASS(epoch->e_flags & EPOCH_PREEMPT); +#ifdef EPOCH_TRACKER_DEBUG + etd->et_magic_pre = EPOCH_MAGIC0; + etd->et_magic_post = EPOCH_MAGIC1; +#endif + td = (struct thread_lite *)curthread; + etd->et_td = (void*)td; + td->td_epochnest++; + critical_enter(); + sched_pin_lite(td); + + td->td_pre_epoch_prio = td->td_priority; + er = epoch_currecord(epoch); + TAILQ_INSERT_TAIL(&er->er_tdlist, etd, et_link); + ck_epoch_begin(&er->er_read_record, (ck_epoch_section_t *)&etd->et_section); + critical_exit(); } void -epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et) +epoch_enter(epoch_t epoch) { + struct thread_lite *td; + epoch_record_t er; - epoch_exit_preempt(epoch, et); + MPASS(cold || epoch != NULL); + INIT_CHECK(epoch); + td = (struct thread_lite *)curthread; + + td->td_epochnest++; + critical_enter(); + er = epoch_currecord(epoch); + ck_epoch_begin(&er->er_read_record, NULL); } void -epoch_enter_KBI(epoch_t epoch) +epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) { + struct epoch_record *er; + struct epoch_thread *etd; + struct thread_lite *td; - epoch_enter(epoch); + INIT_CHECK(epoch); + td = (struct thread_lite *)curthread; + critical_enter(); + sched_unpin_lite(td); + MPASS(td->td_epochnest); + td->td_epochnest--; + er = epoch_currecord(epoch); + MPASS(epoch->e_flags & EPOCH_PREEMPT); + etd = (void *)et; + MPASS(etd != NULL); + MPASS(etd->et_td == (struct thread *)td); +#ifdef EPOCH_TRACKER_DEBUG + MPASS(etd->et_magic_pre == EPOCH_MAGIC0); + MPASS(etd->et_magic_post == EPOCH_MAGIC1); + etd->et_magic_pre = 0; + etd->et_magic_post = 0; +#endif + etd->et_td = (void*)0xDEADBEEF; + ck_epoch_end(&er->er_read_record, + (ck_epoch_section_t *)&etd->et_section); + TAILQ_REMOVE(&er->er_tdlist, etd, et_link); + er->er_gen++; + if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) + epoch_adjust_prio((struct thread *)td, td->td_pre_epoch_prio); + critical_exit(); } void -epoch_exit_KBI(epoch_t epoch) +epoch_exit(epoch_t epoch) { + struct thread_lite *td; + epoch_record_t er; - epoch_exit(epoch); + INIT_CHECK(epoch); + td = (struct thread_lite *)curthread; + MPASS(td->td_epochnest); + td->td_epochnest--; + er = epoch_currecord(epoch); + ck_epoch_end(&er->er_read_record, NULL); + critical_exit(); } /* @@ -545,12 +666,4 @@ int in_epoch(epoch_t epoch) { return (in_epoch_verbose(epoch, 0)); -} - -void -epoch_adjust_prio(struct thread *td, u_char prio) -{ - thread_lock(td); - sched_prio(td, prio); - thread_unlock(td); } Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Tue Nov 13 18:49:43 2018 (r340403) +++ head/sys/sys/epoch.h Tue Nov 13 19:02:11 2018 (r340404) @@ -29,27 +29,18 @@ #ifndef _SYS_EPOCH_H_ #define _SYS_EPOCH_H_ -#ifdef _KERNEL -#include -#include -#endif -struct epoch; -typedef struct epoch *epoch_t; +/* + * XXXGL: temporarily keep epoch_tracker exposed to userland until + * we remove trackers embedded into network structs. + */ -#define EPOCH_PREEMPT 0x1 -#define EPOCH_LOCKED 0x2 - -extern epoch_t global_epoch; -extern epoch_t global_epoch_preempt; - struct epoch_context { void *data[2]; } __aligned(sizeof(void *)); typedef struct epoch_context *epoch_context_t; - struct epoch_tracker { void *datap[3]; #ifdef EPOCH_TRACKER_DEBUG @@ -61,6 +52,19 @@ struct epoch_tracker { typedef struct epoch_tracker *epoch_tracker_t; +#ifdef _KERNEL +#include +#include + +struct epoch; +typedef struct epoch *epoch_t; + +#define EPOCH_PREEMPT 0x1 +#define EPOCH_LOCKED 0x2 + +extern epoch_t global_epoch; +extern epoch_t global_epoch_preempt; + epoch_t epoch_alloc(int flags); void epoch_free(epoch_t epoch); void epoch_wait(epoch_t epoch); @@ -68,26 +72,15 @@ void epoch_wait_preempt(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); int in_epoch(epoch_t epoch); int in_epoch_verbose(epoch_t epoch, int dump_onfail); -#ifdef _KERNEL DPCPU_DECLARE(int, epoch_cb_count); DPCPU_DECLARE(struct grouptask, epoch_cb_task); #define EPOCH_MAGIC0 0xFADECAFEF00DD00D #define EPOCH_MAGIC1 0xBADDBABEDEEDFEED -void epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et); -void epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et); -void epoch_enter_KBI(epoch_t epoch); -void epoch_exit_KBI(epoch_t epoch); +void epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et); +void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et); +void epoch_enter(epoch_t epoch); +void epoch_exit(epoch_t epoch); - -#if defined(KLD_MODULE) && !defined(KLD_TIED) -#define epoch_enter_preempt(e, t) epoch_enter_preempt_KBI((e), (t)) -#define epoch_exit_preempt(e, t) epoch_exit_preempt_KBI((e), (t)) -#define epoch_enter(e) epoch_enter_KBI((e)) -#define epoch_exit(e) epoch_exit_KBI((e)) -#else -#include -#endif /* KLD_MODULE */ - -#endif /* _KERNEL */ -#endif +#endif /* _KERNEL */ +#endif /* _SYS_EPOCH_H_ */ From owner-svn-src-head@freebsd.org Tue Nov 13 19:44:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5478C112F758; Tue, 13 Nov 2018 19:44:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBAA474B10; Tue, 13 Nov 2018 19:44:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 988B714C34; Tue, 13 Nov 2018 19:44:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADJif4O066111; Tue, 13 Nov 2018 19:44:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADJifcs066109; Tue, 13 Nov 2018 19:44:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811131944.wADJifcs066109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Nov 2018 19:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340405 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 340405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBAA474B10 X-Spamd-Result: default: False [-102.86 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.75)[-0.749,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 19:44:42 -0000 Author: markj Date: Tue Nov 13 19:44:40 2018 New Revision: 340405 URL: https://svnweb.freebsd.org/changeset/base/340405 Log: Add accounting to per-domain UMA full bucket caches. In particular, track the current size of the cache and maintain an estimate of its working set size. This will be used to decide how much to shrink various caches when the kernel attempts to reclaim pages. As a secondary effect, it makes statistics aggregation (done by, e.g., vmstat -z) cheaper since sysctl_vm_zone_stats() no longer needs to iterate over lists of cached buckets. Discussed with: alc, glebius, jeff Tested by: pho (previous version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D16666 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 13 19:02:11 2018 (r340404) +++ head/sys/vm/uma_core.c Tue Nov 13 19:44:40 2018 (r340405) @@ -459,7 +459,37 @@ bucket_zone_drain(void) zone_drain(ubz->ubz_zone); } +static uma_bucket_t +zone_try_fetch_bucket(uma_zone_t zone, uma_zone_domain_t zdom, const bool ws) +{ + uma_bucket_t bucket; + + ZONE_LOCK_ASSERT(zone); + + if ((bucket = LIST_FIRST(&zdom->uzd_buckets)) != NULL) { + MPASS(zdom->uzd_nitems >= bucket->ub_cnt); + LIST_REMOVE(bucket, ub_link); + zdom->uzd_nitems -= bucket->ub_cnt; + if (ws && zdom->uzd_imin > zdom->uzd_nitems) + zdom->uzd_imin = zdom->uzd_nitems; + } + return (bucket); +} + static void +zone_put_bucket(uma_zone_t zone, uma_zone_domain_t zdom, uma_bucket_t bucket, + const bool ws) +{ + + ZONE_LOCK_ASSERT(zone); + + LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + zdom->uzd_nitems += bucket->ub_cnt; + if (ws && zdom->uzd_imax < zdom->uzd_nitems) + zdom->uzd_imax = zdom->uzd_nitems; +} + +static void zone_log_warning(uma_zone_t zone) { static const struct timeval warninterval = { 300, 0 }; @@ -509,6 +539,23 @@ uma_timeout(void *unused) } /* + * Update the working set size estimate for the zone's bucket cache. + * The constants chosen here are somewhat arbitrary. With an update period of + * 20s (UMA_TIMEOUT), this estimate is dominated by zone activity over the + * last 100s. + */ +static void +zone_domain_update_wss(uma_zone_domain_t zdom) +{ + long wss; + + MPASS(zdom->uzd_imax >= zdom->uzd_imin); + wss = zdom->uzd_imax - zdom->uzd_imin; + zdom->uzd_imax = zdom->uzd_imin = zdom->uzd_nitems; + zdom->uzd_wss = (3 * wss + 2 * zdom->uzd_wss) / 5; +} + +/* * Routine to perform timeout driven calculations. This expands the * hashes and does per cpu statistics aggregation. * @@ -560,8 +607,14 @@ keg_timeout(uma_keg_t keg) static void zone_timeout(uma_zone_t zone) { + int i; zone_foreach_keg(zone, &keg_timeout); + + ZONE_LOCK(zone); + for (i = 0; i < vm_ndomains; i++) + zone_domain_update_wss(&zone->uz_domain[i]); + ZONE_UNLOCK(zone); } /* @@ -772,16 +825,16 @@ cache_drain_safe_cpu(uma_zone_t zone) cache = &zone->uz_cpu[curcpu]; if (cache->uc_allocbucket) { if (cache->uc_allocbucket->ub_cnt != 0) - LIST_INSERT_HEAD(&zone->uz_domain[domain].uzd_buckets, - cache->uc_allocbucket, ub_link); + zone_put_bucket(zone, &zone->uz_domain[domain], + cache->uc_allocbucket, false); else b1 = cache->uc_allocbucket; cache->uc_allocbucket = NULL; } if (cache->uc_freebucket) { if (cache->uc_freebucket->ub_cnt != 0) - LIST_INSERT_HEAD(&zone->uz_domain[domain].uzd_buckets, - cache->uc_freebucket, ub_link); + zone_put_bucket(zone, &zone->uz_domain[domain], + cache->uc_freebucket, false); else b2 = cache->uc_freebucket; cache->uc_freebucket = NULL; @@ -844,8 +897,8 @@ bucket_cache_drain(uma_zone_t zone) */ for (i = 0; i < vm_ndomains; i++) { zdom = &zone->uz_domain[i]; - while ((bucket = LIST_FIRST(&zdom->uzd_buckets)) != NULL) { - LIST_REMOVE(bucket, ub_link); + while ((bucket = zone_try_fetch_bucket(zone, zdom, false)) != + NULL) { ZONE_UNLOCK(zone); bucket_drain(zone, bucket); bucket_free(zone, bucket, NULL); @@ -2523,11 +2576,9 @@ zalloc_start: zdom = &zone->uz_domain[0]; else zdom = &zone->uz_domain[domain]; - if ((bucket = LIST_FIRST(&zdom->uzd_buckets)) != NULL) { + if ((bucket = zone_try_fetch_bucket(zone, zdom, true)) != NULL) { KASSERT(bucket->ub_cnt != 0, ("uma_zalloc_arg: Returning an empty bucket.")); - - LIST_REMOVE(bucket, ub_link); cache->uc_allocbucket = bucket; ZONE_UNLOCK(zone); goto zalloc_start; @@ -2556,6 +2607,7 @@ zalloc_start: critical_enter(); cpu = curcpu; cache = &zone->uz_cpu[cpu]; + /* * See if we lost the race or were migrated. Cache the * initialized bucket to make this less likely or claim @@ -2565,6 +2617,7 @@ zalloc_start: ((zone->uz_flags & UMA_ZONE_NUMA) == 0 || domain == PCPU_GET(domain))) { cache->uc_allocbucket = bucket; + zdom->uzd_imax += bucket->ub_cnt; } else if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) { critical_exit(); ZONE_UNLOCK(zone); @@ -2572,7 +2625,7 @@ zalloc_start: bucket_free(zone, bucket, udata); goto zalloc_restart; } else - LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + zone_put_bucket(zone, zdom, bucket, false); ZONE_UNLOCK(zone); goto zalloc_start; } @@ -3200,7 +3253,7 @@ zfree_start: bucket_free(zone, bucket, udata); goto zfree_restart; } else - LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + zone_put_bucket(zone, zdom, bucket, true); } /* @@ -3649,6 +3702,7 @@ uma_reclaim_locked(bool kmem_danger) cache_drain_safe(NULL); zone_foreach(zone_drain); } + /* * Some slabs may have been freed but this zone will be visited early * we visit again so that we can free pages that are empty once other @@ -3882,7 +3936,7 @@ uma_print_zone(uma_zone_t zone) * directly so that we don't have to. */ static void -uma_zone_sumstat(uma_zone_t z, int *cachefreep, uint64_t *allocsp, +uma_zone_sumstat(uma_zone_t z, long *cachefreep, uint64_t *allocsp, uint64_t *freesp, uint64_t *sleepsp) { uma_cache_t cache; @@ -3937,7 +3991,6 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS) struct uma_stream_header ush; struct uma_type_header uth; struct uma_percpu_stat *ups; - uma_bucket_t bucket; uma_zone_domain_t zdom; struct sbuf sbuf; uma_cache_t cache; @@ -3997,9 +4050,7 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS) for (i = 0; i < vm_ndomains; i++) { zdom = &z->uz_domain[i]; - LIST_FOREACH(bucket, &zdom->uzd_buckets, - ub_link) - uth.uth_zone_free += bucket->ub_cnt; + uth.uth_zone_free += zdom->uzd_nitems; } uth.uth_allocs = z->uz_allocs; uth.uth_frees = z->uz_frees; @@ -4199,12 +4250,11 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *i #ifdef DDB DB_SHOW_COMMAND(uma, db_show_uma) { - uma_bucket_t bucket; uma_keg_t kz; uma_zone_t z; - uma_zone_domain_t zdom; uint64_t allocs, frees, sleeps; - int cachefree, i; + long cachefree; + int i; db_printf("%18s %8s %8s %8s %12s %8s %8s\n", "Zone", "Size", "Used", "Free", "Requests", "Sleeps", "Bucket"); @@ -4221,13 +4271,10 @@ DB_SHOW_COMMAND(uma, db_show_uma) if (!((z->uz_flags & UMA_ZONE_SECONDARY) && (LIST_FIRST(&kz->uk_zones) != z))) cachefree += kz->uk_free; - for (i = 0; i < vm_ndomains; i++) { - zdom = &z->uz_domain[i]; - LIST_FOREACH(bucket, &zdom->uzd_buckets, - ub_link) - cachefree += bucket->ub_cnt; - } - db_printf("%18s %8ju %8jd %8d %12ju %8ju %8u\n", + for (i = 0; i < vm_ndomains; i++) + cachefree += z->uz_domain[i].uzd_nitems; + + db_printf("%18s %8ju %8jd %8ld %12ju %8ju %8u\n", z->uz_name, (uintmax_t)kz->uk_size, (intmax_t)(allocs - frees), cachefree, (uintmax_t)allocs, sleeps, z->uz_count); @@ -4239,22 +4286,18 @@ DB_SHOW_COMMAND(uma, db_show_uma) DB_SHOW_COMMAND(umacache, db_show_umacache) { - uma_bucket_t bucket; uma_zone_t z; - uma_zone_domain_t zdom; uint64_t allocs, frees; - int cachefree, i; + long cachefree; + int i; db_printf("%18s %8s %8s %8s %12s %8s\n", "Zone", "Size", "Used", "Free", "Requests", "Bucket"); LIST_FOREACH(z, &uma_cachezones, uz_link) { uma_zone_sumstat(z, &cachefree, &allocs, &frees, NULL); - for (i = 0; i < vm_ndomains; i++) { - zdom = &z->uz_domain[i]; - LIST_FOREACH(bucket, &zdom->uzd_buckets, ub_link) - cachefree += bucket->ub_cnt; - } - db_printf("%18s %8ju %8jd %8d %12ju %8u\n", + for (i = 0; i < vm_ndomains; i++) + cachefree += z->uz_domain[i].uzd_nitems; + db_printf("%18s %8ju %8jd %8ld %12ju %8u\n", z->uz_name, (uintmax_t)z->uz_size, (intmax_t)(allocs - frees), cachefree, (uintmax_t)allocs, z->uz_count); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Nov 13 19:02:11 2018 (r340404) +++ head/sys/vm/uma_int.h Tue Nov 13 19:44:40 2018 (r340405) @@ -304,6 +304,10 @@ typedef struct uma_klink *uma_klink_t; struct uma_zone_domain { LIST_HEAD(,uma_bucket) uzd_buckets; /* full buckets */ + long uzd_nitems; /* total item count */ + long uzd_imax; /* maximum item count this period */ + long uzd_imin; /* minimum item count this period */ + long uzd_wss; /* working set size estimate */ }; typedef struct uma_zone_domain * uma_zone_domain_t; @@ -423,11 +427,12 @@ void uma_large_free(uma_slab_t slab); mtx_init(&(z)->uz_lock, (z)->uz_name, \ "UMA zone", MTX_DEF | MTX_DUPOK); \ } while (0) - + #define ZONE_LOCK(z) mtx_lock((z)->uz_lockptr) #define ZONE_TRYLOCK(z) mtx_trylock((z)->uz_lockptr) #define ZONE_UNLOCK(z) mtx_unlock((z)->uz_lockptr) #define ZONE_LOCK_FINI(z) mtx_destroy(&(z)->uz_lock) +#define ZONE_LOCK_ASSERT(z) mtx_assert((z)->uz_lockptr, MA_OWNED) /* * Find a slab within a hash table. This is used for OFFPAGE zones to lookup From owner-svn-src-head@freebsd.org Tue Nov 13 19:51:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C437B112FB89; Tue, 13 Nov 2018 19:51:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44EC374F60; Tue, 13 Nov 2018 19:51:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 115A414D85; Tue, 13 Nov 2018 19:51:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADJpM4v067239; Tue, 13 Nov 2018 19:51:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADJpMgV067238; Tue, 13 Nov 2018 19:51:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811131951.wADJpMgV067238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 13 Nov 2018 19:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340406 - head/release/scripts X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/scripts X-SVN-Commit-Revision: 340406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44EC374F60 X-Spamd-Result: default: False [-103.09 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 19:51:23 -0000 Author: gjb Date: Tue Nov 13 19:51:22 2018 New Revision: 340406 URL: https://svnweb.freebsd.org/changeset/base/340406 Log: The roff ascii.gz documentation installed to /usr/share/doc was removed in r318881 when roff was removed from the base system. This results in the doc.txz distribution set containing a single directory (./) which is empty. Remove the "Additional documentation" option from the menu selection of bsdinstall(8), as the plain-text documentation installed in /usr/share/doc is installed as part of the packageworld target. The doc entry has not been removed from EXTRA_DISTRIBUTIONS in Makefile.inc1, in case its removal triggers an issue with freebsd-update(8), which is currently aware of the world/doc component, so the empty doc.txz continues to be created as a precaution. Noticed by: rgrimes MFC after: 2 days MFC before: 12.0-RC1 Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/make-manifest.sh Modified: head/release/scripts/make-manifest.sh ============================================================================== --- head/release/scripts/make-manifest.sh Tue Nov 13 19:44:40 2018 (r340405) +++ head/release/scripts/make-manifest.sh Tue Nov 13 19:51:22 2018 (r340406) @@ -51,6 +51,9 @@ for i in ${*}; do desc="$(eval echo \"\${desc_${distname}}\")" case ${i} in + doc.txz) + continue + ;; kernel-dbg.txz) desc="${desc_kernel_dbg}" ;; From owner-svn-src-head@freebsd.org Tue Nov 13 19:53:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3561112FCC2; Tue, 13 Nov 2018 19:53:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EA497538F; Tue, 13 Nov 2018 19:53:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD38314DF2; Tue, 13 Nov 2018 19:53:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADJr3CX071400; Tue, 13 Nov 2018 19:53:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADJr3XG071397; Tue, 13 Nov 2018 19:53:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811131953.wADJr3XG071397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 13 Nov 2018 19:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340407 - in head: . release/scripts X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in head: . release/scripts X-SVN-Commit-Revision: 340407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EA497538F X-Spamd-Result: default: False [-103.09 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 19:53:04 -0000 Author: gjb Date: Tue Nov 13 19:53:02 2018 New Revision: 340407 URL: https://svnweb.freebsd.org/changeset/base/340407 Log: In followup to r340406, remove doc from the EXTRA_DISTRIBUTIONS list and remaining references from the script used to create the MANIFEST file used by bsdinstall(8). No MFC is planned at this time. Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 head/release/scripts/make-manifest.sh Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Nov 13 19:51:22 2018 (r340406) +++ head/Makefile.inc1 Tue Nov 13 19:53:02 2018 (r340407) @@ -1287,7 +1287,7 @@ ITOOLS+=makewhatis # # Non-base distributions produced by the base system -EXTRA_DISTRIBUTIONS= doc +EXTRA_DISTRIBUTIONS= .if defined(LIBCOMPAT) EXTRA_DISTRIBUTIONS+= lib${libcompat} .endif @@ -1297,7 +1297,7 @@ EXTRA_DISTRIBUTIONS+= tests DEBUG_DISTRIBUTIONS= .if ${MK_DEBUG_FILES} != "no" -DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,doc,,:S,tests,,} +DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,tests,,} .endif MTREE_MAGIC?= mtree 2.0 Modified: head/release/scripts/make-manifest.sh ============================================================================== --- head/release/scripts/make-manifest.sh Tue Nov 13 19:51:22 2018 (r340406) +++ head/release/scripts/make-manifest.sh Tue Nov 13 19:53:02 2018 (r340407) @@ -10,7 +10,6 @@ # $FreeBSD$ base="Base system" -doc="Additional Documentation" kernel="Kernel" ports="Ports tree" src="System source tree" @@ -19,7 +18,6 @@ tests="Test suite" desc_base="${base} (MANDATORY)" desc_base_dbg="${base} (Debugging)" -desc_doc="${doc}" desc_kernel="${kernel} (MANDATORY)" desc_kernel_dbg="${kernel} (Debugging)" desc_kernel_alt="Alternate ${kernel}" @@ -30,7 +28,6 @@ desc_ports="${ports}" desc_src="${src}" desc_tests="${tests}" -default_doc=off default_src=off default_ports=off default_tests=off From owner-svn-src-head@freebsd.org Tue Nov 13 20:07:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2FAE113024F; Tue, 13 Nov 2018 20:07:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80D5E75BE7; Tue, 13 Nov 2018 20:07:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C8614F84; Tue, 13 Nov 2018 20:07:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADK7unO076627; Tue, 13 Nov 2018 20:07:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADK7toh076623; Tue, 13 Nov 2018 20:07:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811132007.wADK7toh076623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Nov 2018 20:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340408 - in head: lib/libnv lib/libnv/tests sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: lib/libnv lib/libnv/tests sys/contrib/libnv X-SVN-Commit-Revision: 340408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80D5E75BE7 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 20:07:57 -0000 Author: markj Date: Tue Nov 13 20:07:55 2018 New Revision: 340408 URL: https://svnweb.freebsd.org/changeset/base/340408 Log: Ensure that libnv can be used when kern.trap_enotcap=1. libnv used fcntl(fd, F_GETFL) to test whether fd is a valid file descriptor. Aside from being racy, this check requires CAP_FCNTL rights on fd. Instead, use fcntl(fd, F_GETFD), which does not require any capability rights. Also remove some redundant fd_is_valid() checks to avoid extra system calls; in many cases we were performing this check immediately before dup()ing the descriptor. Reviewed by: cem, oshogbo (previous version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17963 Modified: head/lib/libnv/common_impl.h head/lib/libnv/msgio.c head/lib/libnv/tests/nvlist_send_recv_test.c head/sys/contrib/libnv/nvpair.c Modified: head/lib/libnv/common_impl.h ============================================================================== --- head/lib/libnv/common_impl.h Tue Nov 13 19:53:02 2018 (r340407) +++ head/lib/libnv/common_impl.h Tue Nov 13 20:07:55 2018 (r340408) @@ -34,6 +34,15 @@ #ifndef _COMMON_IMPL_H_ #define _COMMON_IMPL_H_ -#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF) +#include +#include +#include + +static inline bool +fd_is_valid(int fd) +{ + + return (fcntl(fd, F_GETFD) != -1 || errno != EBADF); +} #endif /* !_COMMON_IMPL_H_ */ Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Tue Nov 13 19:53:02 2018 (r340407) +++ head/lib/libnv/msgio.c Tue Nov 13 20:07:55 2018 (r340408) @@ -66,11 +66,6 @@ msghdr_add_fd(struct cmsghdr *cmsg, int fd) PJDLOG_ASSERT(fd >= 0); - if (!fd_is_valid(fd)) { - errno = EBADF; - return (-1); - } - cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(sizeof(fd)); Modified: head/lib/libnv/tests/nvlist_send_recv_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_send_recv_test.c Tue Nov 13 19:53:02 2018 (r340407) +++ head/lib/libnv/tests/nvlist_send_recv_test.c Tue Nov 13 20:07:55 2018 (r340408) @@ -306,15 +306,12 @@ parent(int sock) CHECK(name == NULL); } -int -main(void) +static void +send_nvlist(void) { int status, socks[2]; pid_t pid; - printf("1..134\n"); - fflush(stdout); - if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0) err(1, "socketpair() failed"); pid = fork(); @@ -326,7 +323,7 @@ main(void) /* Child. */ close(socks[0]); child(socks[1]); - return (0); + _exit(0); default: /* Parent. */ close(socks[1]); @@ -336,6 +333,35 @@ main(void) if (waitpid(pid, &status, 0) < 0) err(1, "waitpid() failed"); +} + +static void +send_closed_fd(void) +{ + nvlist_t *nvl; + int error, socks[2]; + + if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0) + err(1, "socketpair() failed"); + + nvl = nvlist_create(0); + nvlist_add_descriptor(nvl, "fd", 12345); + error = nvlist_error(nvl); + CHECK(error == EBADF); + + error = nvlist_send(socks[1], nvl); + CHECK(error != 0 && errno == EBADF); +} + +int +main(void) +{ + + printf("1..136\n"); + fflush(stdout); + + send_nvlist(); + send_closed_fd(); return (0); } Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Tue Nov 13 19:53:02 2018 (r340407) +++ head/sys/contrib/libnv/nvpair.c Tue Nov 13 20:07:55 2018 (r340408) @@ -1276,11 +1276,6 @@ nvpair_create_descriptor(const char *name, int value) { nvpair_t *nvp; - if (value < 0 || !fd_is_valid(value)) { - ERRNO_SET(EBADF); - return (NULL); - } - value = fcntl(value, F_DUPFD_CLOEXEC, 0); if (value < 0) return (NULL); @@ -1517,11 +1512,6 @@ nvpair_create_descriptor_array(const char *name, const if (value[ii] == -1) { fds[ii] = -1; } else { - if (!fd_is_valid(value[ii])) { - ERRNO_SET(EBADF); - goto fail; - } - fds[ii] = fcntl(value[ii], F_DUPFD_CLOEXEC, 0); if (fds[ii] == -1) goto fail; @@ -2035,10 +2025,6 @@ nvpair_append_descriptor_array(nvpair_t *nvp, const in NVPAIR_ASSERT(nvp); PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_DESCRIPTOR_ARRAY); - if (value < 0 || !fd_is_valid(value)) { - ERRNO_SET(EBADF); - return -1; - } fd = fcntl(value, F_DUPFD_CLOEXEC, 0); if (fd == -1) { return (-1); From owner-svn-src-head@freebsd.org Tue Nov 13 20:48:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C2111316D7; Tue, 13 Nov 2018 20:48:07 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6AF67731E; Tue, 13 Nov 2018 20:48:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87A7D15601; Tue, 13 Nov 2018 20:48:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADKm6r5096830; Tue, 13 Nov 2018 20:48:06 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADKm6TQ096828; Tue, 13 Nov 2018 20:48:06 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811132048.wADKm6TQ096828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 13 Nov 2018 20:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340409 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6AF67731E X-Spamd-Result: default: False [-103.11 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 20:48:07 -0000 Author: vangyzen Date: Tue Nov 13 20:48:05 2018 New Revision: 340409 URL: https://svnweb.freebsd.org/changeset/base/340409 Log: Make no assertions about lock state when the scheduler is stopped. Change the assert paths in rm, rw, and sx locks to match the lock and unlock paths. I did this for mutexes in r306346. Reported by: Travis Lane MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_rmlock.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Tue Nov 13 20:07:55 2018 (r340408) +++ head/sys/kern/kern_rmlock.c Tue Nov 13 20:48:05 2018 (r340409) @@ -742,7 +742,7 @@ _rm_assert(const struct rmlock *rm, int what, const ch { int count; - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; switch (what) { case RA_LOCKED: Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Nov 13 20:07:55 2018 (r340408) +++ head/sys/kern/kern_rwlock.c Tue Nov 13 20:48:05 2018 (r340409) @@ -1439,7 +1439,7 @@ __rw_assert(const volatile uintptr_t *c, int what, con { const struct rwlock *rw; - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; rw = rwlock2rw(c); Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Nov 13 20:07:55 2018 (r340408) +++ head/sys/kern/kern_sx.c Tue Nov 13 20:48:05 2018 (r340409) @@ -1416,7 +1416,7 @@ _sx_assert(const struct sx *sx, int what, const char * int slocked = 0; #endif - if (panicstr != NULL) + if (SCHEDULER_STOPPED()) return; switch (what) { case SA_SLOCKED: From owner-svn-src-head@freebsd.org Tue Nov 13 21:29:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 034851132A14; Tue, 13 Nov 2018 21:29:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 893F2790F9; Tue, 13 Nov 2018 21:29:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A75B15D0D; Tue, 13 Nov 2018 21:29:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADLTvTL017476; Tue, 13 Nov 2018 21:29:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADLTvPC017475; Tue, 13 Nov 2018 21:29:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811132129.wADLTvPC017475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 13 Nov 2018 21:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340410 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 893F2790F9 X-Spamd-Result: default: False [-103.07 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 21:29:58 -0000 Author: mjg Date: Tue Nov 13 21:29:56 2018 New Revision: 340410 URL: https://svnweb.freebsd.org/changeset/base/340410 Log: locks: plug warnings about unitialized variables They only showed up after I redefined LOCKSTAT_ENABLED to 0. doing_lockprof in mutex.c is a real (but harmless) bug. Should the value be non-zero it will do checks for lock profiling which would otherwise be skipped. state in rwlock.c is a wart from the compiler, the value can't be used if lock profiling is not enabled. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Tue Nov 13 20:48:05 2018 (r340409) +++ head/sys/kern/kern_mutex.c Tue Nov 13 21:29:56 2018 (r340410) @@ -486,7 +486,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - int doing_lockprof; + int doing_lockprof = 0; #endif td = curthread; @@ -690,7 +690,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t int64_t spin_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - int doing_lockprof; + int doing_lockprof = 0; #endif tid = (uintptr_t)curthread; Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Nov 13 20:48:05 2018 (r340409) +++ head/sys/kern/kern_rwlock.c Tue Nov 13 21:29:56 2018 (r340410) @@ -445,7 +445,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state; + uintptr_t state = 0; int doing_lockprof = 0; #endif @@ -913,7 +913,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state; + uintptr_t state = 0; int doing_lockprof = 0; #endif int extra_work = 0; From owner-svn-src-head@freebsd.org Tue Nov 13 21:41:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C78F311333E1; Tue, 13 Nov 2018 21:41:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5526179C43; Tue, 13 Nov 2018 21:41:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3383615ED2; Tue, 13 Nov 2018 21:41:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADLf0ZB023619; Tue, 13 Nov 2018 21:41:00 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADLeuP3023598; Tue, 13 Nov 2018 21:40:56 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201811132140.wADLeuP3023598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 13 Nov 2018 21:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340411 - in head: lib/libufs sbin/clri sbin/ffsinfo sbin/fsck_ffs sbin/fsirand sbin/growfs sbin/newfs sbin/tunefs sys/ufs/ffs tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: lib/libufs sbin/clri sbin/ffsinfo sbin/fsck_ffs sbin/fsirand sbin/growfs sbin/newfs sbin/tunefs sys/ufs/ffs tools/diag/prtblknos X-SVN-Commit-Revision: 340411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5526179C43 X-Spamd-Result: default: False [-103.07 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 21:41:01 -0000 Author: mckusick Date: Tue Nov 13 21:40:56 2018 New Revision: 340411 URL: https://svnweb.freebsd.org/changeset/base/340411 Log: In preparation for adding inode check-hashes, clean up and document the libufs interface for fetching and storing inodes. The undocumented getino / putino interface has been replaced with a new getinode / putinode interface. Convert the utilities that had been using the undocumented interface to use the new documented interface. No functional change (as for now the libufs library does not do inode check-hashes). Reviewed by: kib Tested by: Peter Holm Sponsored by: Netflix Added: head/lib/libufs/getinode.3 (contents, props changed) Modified: head/lib/libufs/Makefile head/lib/libufs/inode.c head/lib/libufs/libufs.h head/sbin/clri/clri.c head/sbin/ffsinfo/ffsinfo.c head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/gjournal.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass5.c head/sbin/fsirand/fsirand.c head/sbin/growfs/growfs.c head/sbin/newfs/mkfs.c head/sbin/tunefs/tunefs.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/tools/diag/prtblknos/main.c Modified: head/lib/libufs/Makefile ============================================================================== --- head/lib/libufs/Makefile Tue Nov 13 21:29:56 2018 (r340410) +++ head/lib/libufs/Makefile Tue Nov 13 21:40:56 2018 (r340411) @@ -3,12 +3,12 @@ PACKAGE=lib${LIB} LIB= ufs SHLIBDIR?= /lib -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 SRCS= block.c cgroup.c crc32.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c INCS= libufs.h -MAN= bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3 +MAN= bread.3 cgread.3 getinode.3 libufs.3 sbread.3 ufs_disk_close.3 MLINKS+= bread.3 bwrite.3 MLINKS+= bread.3 berase.3 MLINKS+= cgread.3 cgread1.3 @@ -16,6 +16,7 @@ MLINKS+= cgread.3 cgget.3 MLINKS+= cgread.3 cgwrite.3 MLINKS+= cgread.3 cgwrite1.3 MLINKS+= cgread.3 cgput.3 +MLINKS+= getinode.3 putinode.3 MLINKS+= sbread.3 sbwrite.3 MLINKS+= sbread.3 sbget.3 MLINKS+= sbread.3 sbput.3 Added: head/lib/libufs/getinode.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libufs/getinode.3 Tue Nov 13 21:40:56 2018 (r340411) @@ -0,0 +1,131 @@ +.\" Author: Marshall Kirk McKusick +.\" Date: January 19, 2018 +.\" Description: +.\" Manual page for libufs functions: +.\" getinode(3) +.\" putinode(3) +.\" +.\" This file is in the public domain. +.\" +.\" $FreeBSD$ +.\" +.Dd November 10, 2018 +.Dt GETINODE 3 +.Os +.Sh NAME +.Nm getinode , putinode +.Nd fetch and store inodes on a UFS file system +.Sh LIBRARY +.Lb libufs +.Sh SYNOPSIS +.In ufs/ufs/dinode.h +.In ufs/ffs/fs.h +.In libufs.h +.Ft int +.Fn getinode "struct uufsd *disk" "union dinodep *dp" "ino_t inumber" +.Ft int +.Fn putinode "struct uufsd *disk" +.Sh DESCRIPTION +The +.Fn getinode +and +.Fn putinode +functions provide an inode fetch and store API for +.Xr libufs 3 +consumers. +They operate on a userland UFS disk structure. +The +.Fn getinode +function fetches the specified inode from the filesystem. +The +.Fn putinode +function stores the most recently fetched inode to the filesystem. +.Pp +The +.Va dinodep +union is defined as: +.Bd -literal -offset indent +union dinodep { + struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; +}; +.Ed +.Pp +Sample code to clear write permissions for inode number +.Fa inumber +stored on the filesystem described by +.Fa diskp . +.Bd -literal -offset indent +#include +#include + +#include +#include +#include + +void +clearwrite(struct uufsd *diskp, ino_t inumber) +{ + union dinodep dp; + + if (getinode(diskp, &dp, inumber) == -1) + err(1, "getinode: %s", diskp->d_error); + switch (diskp->d_ufs) { + case 1: /* UFS 1 filesystem */ + dp.dp1->di_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); + break; + case 2: /* UFS 2 filesystem */ + dp.dp2->di_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); + break; + default: + errx(1, "unknown filesystem type"); + } + if (putinode(diskp) == -1) + err(1, "putinode: %s", diskp->d_error); +} +.Ed +.Sh RETURN VALUES +The +.Fn getinode +and +.Fn putinode +functions return 0 on success, or \-1 in case of any error. +A string describing the error is stored in +.Fa diskp->d_error . +The global +.Fa errno +often provides additional information. +.Sh ERRORS +The function +.Fn getinode +may fail and set +.Va errno +for any of the errors specified for the library function +.Xr pread 2 . +It can also fail if the inode number is out of the range of inodes +in the filesystem. +.Pp +The function +.Fn putinode +may fail and set +.Va errno +for any of the errors specified for the library functions +.Xr ufs_disk_write 3 +or +.Xr pwrite 2 . +.Pp +Additionally both functions may follow the +.Xr libufs 3 +error methodologies in case of a device error. +.Sh SEE ALSO +.Xr pread 2 , +.Xr pwrite 2 , +.Xr libufs 3 , +.Xr ufs_disk_write 3 +.Sh HISTORY +These functions first appeared as part of +.Xr libufs 3 +in +.Fx 13.0 . +.Sh AUTHORS +.An Marshall Kirk McKusick Aq Mt mckusick@freebsd.org Modified: head/lib/libufs/inode.c ============================================================================== --- head/lib/libufs/inode.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/lib/libufs/inode.c Tue Nov 13 21:40:56 2018 (r340411) @@ -49,18 +49,16 @@ __FBSDID("$FreeBSD$"); #include int -getino(struct uufsd *disk, void **dino, ino_t inode, int *mode) +getinode(struct uufsd *disk, union dinodep *dp, ino_t inum) { ino_t min, max; caddr_t inoblock; - struct ufs1_dinode *dp1; - struct ufs2_dinode *dp2; struct fs *fs; ERROR(disk, NULL); fs = &disk->d_fs; - if (inode >= (ino_t)fs->fs_ipg * fs->fs_ncg) { + if (inum >= (ino_t)fs->fs_ipg * fs->fs_ncg) { ERROR(disk, "inode number out of range"); return (-1); } @@ -76,26 +74,22 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i } disk->d_inoblock = inoblock; } - if (inode >= min && inode < max) + if (inum >= min && inum < max) goto gotit; - bread(disk, fsbtodb(fs, ino_to_fsba(fs, inode)), inoblock, + bread(disk, fsbtodb(fs, ino_to_fsba(fs, inum)), inoblock, fs->fs_bsize); - disk->d_inomin = min = inode - (inode % INOPB(fs)); + disk->d_inomin = min = inum - (inum % INOPB(fs)); disk->d_inomax = max = min + INOPB(fs); gotit: switch (disk->d_ufs) { case 1: - dp1 = &((struct ufs1_dinode *)inoblock)[inode - min]; - if (mode != NULL) - *mode = dp1->di_mode & IFMT; - if (dino != NULL) - *dino = dp1; + disk->d_dp.dp1 = &((struct ufs1_dinode *)inoblock)[inum - min]; + if (dp != NULL) + *dp = disk->d_dp; return (0); case 2: - dp2 = &((struct ufs2_dinode *)inoblock)[inode - min]; - if (mode != NULL) - *mode = dp2->di_mode & IFMT; - if (dino != NULL) - *dino = dp2; + disk->d_dp.dp2 = &((struct ufs2_dinode *)inoblock)[inum - min]; + if (dp != NULL) + *dp = disk->d_dp; return (0); default: break; @@ -105,7 +99,7 @@ gotit: switch (disk->d_ufs) { } int -putino(struct uufsd *disk) +putinode(struct uufsd *disk) { struct fs *fs; Modified: head/lib/libufs/libufs.h ============================================================================== --- head/lib/libufs/libufs.h Tue Nov 13 21:29:56 2018 (r340410) +++ head/lib/libufs/libufs.h Tue Nov 13 21:40:56 2018 (r340411) @@ -35,6 +35,10 @@ /* * libufs structures. */ +union dinodep { + struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; +}; /* * userland ufs disk. @@ -49,6 +53,7 @@ struct uufsd { caddr_t d_inoblock; /* inode block */ uint32_t d_inomin; /* low inode (not ino_t for ABI compat) */ uint32_t d_inomax; /* high inode (not ino_t for ABI compat) */ + union dinodep d_dp; /* pointer to currently active inode */ union { struct fs d_fs; /* filesystem information */ char d_sb[MAXBSIZE]; @@ -135,8 +140,8 @@ int cgwrite1(struct uufsd *, int); /* * inode.c */ -int getino(struct uufsd *, void **, ino_t, int *); -int putino(struct uufsd *); +int getinode(struct uufsd *, union dinodep *, ino_t); +int putinode(struct uufsd *); /* * sblock.c Modified: head/sbin/clri/clri.c ============================================================================== --- head/sbin/clri/clri.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/clri/clri.c Tue Nov 13 21:40:56 2018 (r340411) @@ -62,11 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -union dinodep { - struct ufs1_dinode *dp1; - struct ufs2_dinode *dp2; -}; - static void usage(void) { @@ -104,8 +99,8 @@ main(int argc, char *argv[]) } (void)printf("clearing %d\n", inonum); - if (getino(&disk, (void **)&dp, inonum, NULL) == -1) { - printf("getino: %s\n", disk.d_error); + if (getinode(&disk, &dp, inonum) == -1) { + printf("getinode: %s\n", disk.d_error); exitval = 1; continue; } @@ -119,7 +114,7 @@ main(int argc, char *argv[]) memset(dp.dp2, 0, sizeof(*dp.dp2)); dp.dp2->di_gen = generation; } - putino(&disk); + putinode(&disk); (void)fsync(disk.d_fd); } (void)ufs_disk_close(&disk); Modified: head/sbin/ffsinfo/ffsinfo.c ============================================================================== --- head/sbin/ffsinfo/ffsinfo.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/ffsinfo/ffsinfo.c Tue Nov 13 21:40:56 2018 (r340411) @@ -262,7 +262,7 @@ main(int argc, char **argv) dbg_csp = fscs; /* ... and dump it */ - for(dbg_csc=0; dbg_cscdi_nlink==0) { + if (dp.dp1->di_nlink == 0) { DBG_LEAVE; return; /* inode not in use */ } @@ -368,7 +368,7 @@ dump_whole_ufs1_inode(ino_t inode, int level) if (level & 0x100) { DBG_DUMP_INO(&sblock, comment, - ino); + dp.dp1); } if (!(level & 0x200)) { @@ -379,13 +379,13 @@ dump_whole_ufs1_inode(ino_t inode, int level) /* * Ok, now prepare for dumping all direct and indirect pointers. */ - rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR; - if(rb>0) { + rb = howmany(dp.dp1->di_size, sblock.fs_bsize) - UFS_NDADDR; + if (rb > 0) { /* * Dump single indirect block. */ - if (bread(&disk, fsbtodb(&sblock, ino->di_ib[0]), (void *)&i1blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, dp.dp1->di_ib[0]), + (void *)&i1blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 0", @@ -394,14 +394,14 @@ dump_whole_ufs1_inode(ino_t inode, int level) comment, i1blk, (size_t)rb); - rb-=howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t)); + rb -= howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t)); } - if(rb>0) { + if (rb > 0) { /* * Dump double indirect blocks. */ - if (bread(&disk, fsbtodb(&sblock, ino->di_ib[1]), (void *)&i2blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, dp.dp1->di_ib[1]), + (void *)&i2blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 1", @@ -410,12 +410,12 @@ dump_whole_ufs1_inode(ino_t inode, int level) comment, i2blk, howmany(rb, howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t)))); - for(ind2ctr=0; ((ind2ctr < howmany(sblock.fs_bsize, - sizeof(ufs1_daddr_t))) && (rb>0)); ind2ctr++) { - ind2ptr=&((ufs1_daddr_t *)(void *)&i2blk)[ind2ctr]; + for (ind2ctr = 0; ((ind2ctr < howmany(sblock.fs_bsize, + sizeof(ufs1_daddr_t))) && (rb > 0)); ind2ctr++) { + ind2ptr = &((ufs1_daddr_t *)(void *)&i2blk)[ind2ctr]; - if (bread(&disk, fsbtodb(&sblock, *ind2ptr), (void *)&i1blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, *ind2ptr), + (void *)&i1blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), @@ -425,15 +425,15 @@ dump_whole_ufs1_inode(ino_t inode, int level) comment, i1blk, (size_t)rb); - rb-=howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t)); + rb -= howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t)); } } - if(rb>0) { + if (rb > 0) { /* * Dump triple indirect blocks. */ - if (bread(&disk, fsbtodb(&sblock, ino->di_ib[2]), (void *)&i3blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, dp.dp1->di_ib[2]), + (void *)&i3blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 2", @@ -445,12 +445,12 @@ dump_whole_ufs1_inode(ino_t inode, int level) howmany(rb, SQUARE(howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t))))); #undef SQUARE - for(ind3ctr=0; ((ind3ctr0)); ind3ctr++) { - ind3ptr=&((ufs1_daddr_t *)(void *)&i3blk)[ind3ctr]; + for (ind3ctr = 0; ((ind3ctr < howmany(sblock.fs_bsize, + sizeof(ufs1_daddr_t))) && (rb > 0)); ind3ctr++) { + ind3ptr = &((ufs1_daddr_t *)(void *)&i3blk)[ind3ctr]; - if (bread(&disk, fsbtodb(&sblock, *ind3ptr), (void *)&i2blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, *ind3ptr), + (void *)&i2blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), @@ -461,8 +461,8 @@ dump_whole_ufs1_inode(ino_t inode, int level) i2blk, howmany(rb, howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t)))); - for(ind2ctr=0; ((ind2ctr < howmany(sblock.fs_bsize, - sizeof(ufs1_daddr_t)))&&(rb>0)); ind2ctr++) { + for (ind2ctr = 0; ((ind2ctr < howmany(sblock.fs_bsize, + sizeof(ufs1_daddr_t))) && (rb > 0)); ind2ctr++) { ind2ptr=&((ufs1_daddr_t *)(void *)&i2blk) [ind2ctr]; if (bread(&disk, fsbtodb(&sblock, *ind2ptr), @@ -477,7 +477,7 @@ dump_whole_ufs1_inode(ino_t inode, int level) comment, i1blk, (size_t)rb); - rb-=howmany(sblock.fs_bsize, + rb -= howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t)); } } @@ -496,8 +496,8 @@ void dump_whole_ufs2_inode(ino_t inode, int level) { DBG_FUNC("dump_whole_ufs2_inode") - struct ufs2_dinode *ino; - int rb, mode; + union dinodep dp; + int rb; unsigned int ind2ctr, ind3ctr; ufs2_daddr_t *ind2ptr, *ind3ptr; char comment[80]; @@ -507,10 +507,10 @@ dump_whole_ufs2_inode(ino_t inode, int level) /* * Read the inode from disk/cache. */ - if (getino(&disk, (void **)&ino, inode, &mode) == -1) - err(1, "getino: %s", disk.d_error); + if (getinode(&disk, &dp, inode) == -1) + err(1, "getinode: %s", disk.d_error); - if (ino->di_nlink == 0) { + if (dp.dp2->di_nlink == 0) { DBG_LEAVE; return; /* inode not in use */ } @@ -520,7 +520,7 @@ dump_whole_ufs2_inode(ino_t inode, int level) */ snprintf(comment, sizeof(comment), "Inode 0x%08jx", (uintmax_t)inode); if (level & 0x100) { - DBG_DUMP_INO(&sblock, comment, ino); + DBG_DUMP_INO(&sblock, comment, dp.dp2); } if (!(level & 0x200)) { @@ -531,13 +531,13 @@ dump_whole_ufs2_inode(ino_t inode, int level) /* * Ok, now prepare for dumping all direct and indirect pointers. */ - rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR; + rb = howmany(dp.dp2->di_size, sblock.fs_bsize) - UFS_NDADDR; if (rb > 0) { /* * Dump single indirect block. */ - if (bread(&disk, fsbtodb(&sblock, ino->di_ib[0]), (void *)&i1blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, dp.dp2->di_ib[0]), + (void *)&i1blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 0", @@ -549,8 +549,8 @@ dump_whole_ufs2_inode(ino_t inode, int level) /* * Dump double indirect blocks. */ - if (bread(&disk, fsbtodb(&sblock, ino->di_ib[1]), (void *)&i2blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, dp.dp2->di_ib[1]), + (void *)&i2blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 1", @@ -563,8 +563,8 @@ dump_whole_ufs2_inode(ino_t inode, int level) sizeof(ufs2_daddr_t))) && (rb>0)); ind2ctr++) { ind2ptr = &((ufs2_daddr_t *)(void *)&i2blk)[ind2ctr]; - if (bread(&disk, fsbtodb(&sblock, *ind2ptr), (void *)&i1blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, *ind2ptr), + (void *)&i1blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), @@ -578,8 +578,8 @@ dump_whole_ufs2_inode(ino_t inode, int level) /* * Dump triple indirect blocks. */ - if (bread(&disk, fsbtodb(&sblock, ino->di_ib[2]), (void *)&i3blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, dp.dp2->di_ib[2]), + (void *)&i3blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 2", @@ -595,8 +595,8 @@ dump_whole_ufs2_inode(ino_t inode, int level) sizeof(ufs2_daddr_t))) && (rb > 0)); ind3ctr++) { ind3ptr = &((ufs2_daddr_t *)(void *)&i3blk)[ind3ctr]; - if (bread(&disk, fsbtodb(&sblock, *ind3ptr), (void *)&i2blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, *ind3ptr), + (void *)&i2blk, (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), @@ -610,8 +610,9 @@ dump_whole_ufs2_inode(ino_t inode, int level) for (ind2ctr = 0; ((ind2ctr < howmany(sblock.fs_bsize, sizeof(ufs2_daddr_t))) && (rb > 0)); ind2ctr++) { ind2ptr = &((ufs2_daddr_t *)(void *)&i2blk) [ind2ctr]; - if (bread(&disk, fsbtodb(&sblock, *ind2ptr), (void *)&i1blk, - (size_t)sblock.fs_bsize) == -1) { + if (bread(&disk, fsbtodb(&sblock, *ind2ptr), + (void *)&i1blk, (size_t)sblock.fs_bsize) + == -1) { err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/fsck_ffs/dir.c Tue Nov 13 21:40:56 2018 (r340411) @@ -254,14 +254,14 @@ fileerror(ino_t cwd, ino_t ino, const char *errmesg) char pathbuf[MAXPATHLEN + 1]; pwarn("%s ", errmesg); - pinode(ino); - printf("\n"); - getpathname(pathbuf, cwd, ino); if (ino < UFS_ROOTINO || ino > maxino) { - pfatal("NAME=%s\n", pathbuf); + pfatal("out-of-range inode number %ju", (uintmax_t)ino); return; } dp = ginode(ino); + prtinode(ino, dp); + printf("\n"); + getpathname(pathbuf, cwd, ino); if (ftypeok(dp)) pfatal("%s=%s\n", (DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE", @@ -309,7 +309,7 @@ adjust(struct inodesc *idesc, int lcnt) if (lcnt != 0) { pwarn("LINK COUNT %s", (lfdir == idesc->id_number) ? lfname : ((DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE")); - pinode(idesc->id_number); + prtinode(idesc->id_number, dp); printf(" COUNT %d SHOULD BE %d", DIP(dp, di_nlink), DIP(dp, di_nlink) - lcnt); if (preen || usedsoftdep) { @@ -390,7 +390,8 @@ linkup(ino_t orphan, ino_t parentdir, char *name) dp = ginode(orphan); lostdir = (DIP(dp, di_mode) & IFMT) == IFDIR; pwarn("UNREF %s ", lostdir ? "DIR" : "FILE"); - pinode(orphan); + prtinode(orphan, dp); + printf("\n"); if (preen && DIP(dp, di_size) == 0) return (0); if (cursnapshot != 0) { Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/fsck_ffs/fsck.h Tue Nov 13 21:40:56 2018 (r340411) @@ -463,8 +463,8 @@ void pass4(void); int pass4check(struct inodesc *); void pass5(void); void pfatal(const char *fmt, ...) __printflike(1, 2); -void pinode(ino_t ino); void propagate(void); +void prtinode(ino_t ino, union dinode *dp); void pwarn(const char *fmt, ...) __printflike(1, 2); int readsb(int listerr); int reply(const char *question); Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/fsck_ffs/gjournal.c Tue Nov 13 21:40:56 2018 (r340411) @@ -392,13 +392,12 @@ clear_inode(struct ufs2_dinode *dino) void gjournal_check(const char *filesys) { - struct ufs2_dinode *dino; - void *p; + union dinodep dp; struct cgchain *cgc; struct cg *cgp; uint8_t *inosused; ino_t cino, ino; - int cg, mode; + int cg; devnam = filesys; opendisk(); @@ -444,19 +443,20 @@ gjournal_check(const char *filesys) /* Unallocated? Skip it. */ if (isclr(inosused, cino)) continue; - if (getino(diskp, &p, ino, &mode) == -1) - err(1, "getino(cg=%d ino=%ju)", - cg, (uintmax_t)ino); - dino = p; + if (getinode(diskp, &dp, ino) == -1) + err(1, "getinode (cg=%d ino=%ju) %s", + cg, (uintmax_t)ino, diskp->d_error); /* Not a regular file nor directory? Skip it. */ - if (!S_ISREG(dino->di_mode) && !S_ISDIR(dino->di_mode)) + if (!S_ISREG(dp.dp2->di_mode) && + !S_ISDIR(dp.dp2->di_mode)) continue; /* Has reference(s)? Skip it. */ - if (dino->di_nlink > 0) + if (dp.dp2->di_nlink > 0) continue; - //printf("Clearing inode=%d (size=%jd)\n", ino, (intmax_t)dino->di_size); + /* printf("Clearing inode=%d (size=%jd)\n", ino, + (intmax_t)dp.dp2->di_size); */ /* Free inode's blocks. */ - clear_inode(dino); + clear_inode(dp.dp2); /* Deallocate it. */ clrbit(inosused, cino); /* Update position of last used inode. */ @@ -469,17 +469,17 @@ gjournal_check(const char *filesys) cgp->cg_unrefs--; fs->fs_unrefs--; /* If this is directory, update related statistics. */ - if (S_ISDIR(dino->di_mode)) { + if (S_ISDIR(dp.dp2->di_mode)) { cgp->cg_cs.cs_ndir--; fs->fs_cs(fs, cg).cs_ndir--; fs->fs_cstotal.cs_ndir--; } /* Zero-fill the inode. */ - *dino = ufs2_zino; + *dp.dp2 = ufs2_zino; /* Write the inode back. */ - if (putino(diskp) == -1) - err(1, "putino(cg=%d ino=%ju)", - cg, (uintmax_t)ino); + if (putinode(diskp) == -1) + err(1, "putinode (cg=%d ino=%ju) %s", + cg, (uintmax_t)ino, diskp->d_error); if (cgp->cg_unrefs == 0) { //printf("No more unreferenced inodes in cg=%d.\n", cg); break; Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/fsck_ffs/inode.c Tue Nov 13 21:40:56 2018 (r340411) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "fsck.h" @@ -342,7 +343,11 @@ getnextinode(ino_t inumber, int rebuildcg) nextinop = inobuf.b_un.b_buf; } dp = (union dinode *)nextinop; - if (rebuildcg && nextinop == inobuf.b_un.b_buf) { + if (sblock.fs_magic == FS_UFS1_MAGIC) + nextinop += sizeof(struct ufs1_dinode); + else + nextinop += sizeof(struct ufs2_dinode); + if (rebuildcg && (char *)dp == inobuf.b_un.b_buf) { /* * Try to determine if we have reached the end of the * allocated inodes. @@ -355,7 +360,7 @@ getnextinode(ino_t inumber, int rebuildcg) UFS_NIADDR * sizeof(ufs2_daddr_t)) || dp->dp2.di_mode || dp->dp2.di_size) return (NULL); - goto inodegood; + return (dp); } if (!ftypeok(dp)) return (NULL); @@ -389,11 +394,6 @@ getnextinode(ino_t inumber, int rebuildcg) if (DIP(dp, di_ib[j]) != 0) return (NULL); } -inodegood: - if (sblock.fs_magic == FS_UFS1_MAGIC) - nextinop += sizeof(struct ufs1_dinode); - else - nextinop += sizeof(struct ufs2_dinode); return (dp); } @@ -534,7 +534,8 @@ clri(struct inodesc *idesc, const char *type, int flag if (flag == 1) { pwarn("%s %s", type, (DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE"); - pinode(idesc->id_number); + prtinode(idesc->id_number, dp); + printf("\n"); } if (preen || reply("CLEAR") == 1) { if (preen) @@ -600,9 +601,8 @@ clearentry(struct inodesc *idesc) } void -pinode(ino_t ino) +prtinode(ino_t ino, union dinode *dp) { - union dinode *dp; char *p; struct passwd *pw; time_t t; @@ -610,7 +610,6 @@ pinode(ino_t ino) printf(" I=%lu ", (u_long)ino); if (ino < UFS_ROOTINO || ino > maxino) return; - dp = ginode(ino); printf(" OWNER="); if ((pw = getpwuid((int)DIP(dp, di_uid))) != NULL) printf("%s ", pw->pw_name); Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/fsck_ffs/main.c Tue Nov 13 21:40:56 2018 (r340411) @@ -458,30 +458,40 @@ checkfilesys(char *filesys) if (preen == 0 && yflag == 0 && sblock.fs_magic != FS_UFS1_MAGIC && fswritefd != -1 && getosreldate() >= P_OSREL_CK_CYLGRP) { if ((sblock.fs_metackhash & CK_CYLGRP) == 0 && - reply("ADD CYLINDER GROUP CHECK-HASH PROTECTION") != 0) + reply("ADD CYLINDER GROUP CHECK-HASH PROTECTION") != 0) { ckhashadd |= CK_CYLGRP; + sblock.fs_metackhash |= CK_CYLGRP; + } if ((sblock.fs_metackhash & CK_SUPERBLOCK) == 0 && getosreldate() >= P_OSREL_CK_SUPERBLOCK && reply("ADD SUPERBLOCK CHECK-HASH PROTECTION") != 0) { + ckhashadd |= CK_SUPERBLOCK; sblock.fs_metackhash |= CK_SUPERBLOCK; - sbdirty(); } #ifdef notyet if ((sblock.fs_metackhash & CK_INODE) == 0 && getosreldate() >= P_OSREL_CK_INODE && - reply("ADD INODE CHECK-HASH PROTECTION") != 0) + reply("ADD INODE CHECK-HASH PROTECTION") != 0) { ckhashadd |= CK_INODE; + sblock.fs_metackhash |= CK_INODE; + } if ((sblock.fs_metackhash & CK_INDIR) == 0 && getosreldate() >= P_OSREL_CK_INDIR && - reply("ADD INDIRECT BLOCK CHECK-HASH PROTECTION") != 0) + reply("ADD INDIRECT BLOCK CHECK-HASH PROTECTION") != 0) { ckhashadd |= CK_INDIR; + sblock.fs_metackhash |= CK_INDIR; + } if ((sblock.fs_metackhash & CK_DIR) == 0 && getosreldate() >= P_OSREL_CK_DIR && - reply("ADD DIRECTORY CHECK-HASH PROTECTION") != 0) + reply("ADD DIRECTORY CHECK-HASH PROTECTION") != 0) { ckhashadd |= CK_DIR; + sblock.fs_metackhash |= CK_DIR; + } #endif /* notyet */ - if (ckhashadd != 0) + if (ckhashadd != 0) { sblock.fs_flags |= FS_METACKHASH; + sbdirty(); + } } /* * Cleared if any questions answered no. Used to decide if Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/fsck_ffs/pass5.c Tue Nov 13 21:40:56 2018 (r340411) @@ -74,11 +74,8 @@ pass5(void) memset(newcg, 0, (size_t)fs->fs_cgsize); newcg->cg_niblk = fs->fs_ipg; /* check to see if we are to add a cylinder group check hash */ - if ((ckhashadd & CK_CYLGRP) != 0) { - fs->fs_metackhash |= CK_CYLGRP; + if ((ckhashadd & CK_CYLGRP) != 0) rewritecg = 1; - sbdirty(); - } if (cvtlevel >= 3) { if (fs->fs_maxcontig < 2 && fs->fs_contigsumsize > 0) { if (preen) Modified: head/sbin/fsirand/fsirand.c ============================================================================== --- head/sbin/fsirand/fsirand.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/fsirand/fsirand.c Tue Nov 13 21:40:56 2018 (r340411) @@ -175,7 +175,7 @@ fsirand(char *device) } /* For each cylinder group, randomize inodes and update backup sblock */ - for (cg = 0, inumber = 0; cg < (int)sblock->fs_ncg; cg++) { + for (cg = 0, inumber = UFS_ROOTINO; cg < (int)sblock->fs_ncg; cg++) { /* Read in inodes, then print or randomize generation nums */ dblk = fsbtodb(sblock, ino_to_fsba(sblock, inumber)); if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { @@ -187,21 +187,22 @@ fsirand(char *device) return (1); } - for (n = 0; n < (int)sblock->fs_ipg; n++, inumber++) { - if (sblock->fs_magic == FS_UFS1_MAGIC) - dp1 = &((struct ufs1_dinode *)inodebuf)[n]; - else - dp2 = &((struct ufs2_dinode *)inodebuf)[n]; - if (inumber >= UFS_ROOTINO) { - if (printonly) - (void)printf("ino %ju gen %08x\n", - (uintmax_t)inumber, - sblock->fs_magic == FS_UFS1_MAGIC ? - dp1->di_gen : dp2->di_gen); - else if (sblock->fs_magic == FS_UFS1_MAGIC) - dp1->di_gen = random(); - else - dp2->di_gen = random(); + dp1 = (struct ufs1_dinode *)(void *)inodebuf; + dp2 = (struct ufs2_dinode *)(void *)inodebuf; + for (n = cg > 0 ? 0 : UFS_ROOTINO; + n < (int)sblock->fs_ipg; + n++, inumber++) { + if (printonly) { + (void)printf("ino %ju gen %08x\n", + (uintmax_t)inumber, + sblock->fs_magic == FS_UFS1_MAGIC ? + dp1->di_gen : dp2->di_gen); + } else if (sblock->fs_magic == FS_UFS1_MAGIC) { + dp1->di_gen = arc4random(); + dp1++; + } else { + dp2->di_gen = arc4random(); + dp2++; } } Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/growfs/growfs.c Tue Nov 13 21:40:56 2018 (r340411) @@ -301,16 +301,21 @@ initcg(int cylno, time_t modtime, int fso, unsigned in { DBG_FUNC("initcg") static caddr_t iobuf; + static long iobufsize; long blkno, start; ino_t ino; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; struct csum *cs; uint j, d, dupper, dlower; - if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize * 3)) == NULL) - errx(37, "panic: cannot allocate I/O buffer"); - + if (iobuf == NULL) { + iobufsize = 2 * sblock.fs_bsize; + if ((iobuf = malloc(iobufsize)) == NULL) + errx(37, "panic: cannot allocate I/O buffer"); + memset(iobuf, '\0', iobufsize); + } /* * Determine block bounds for cylinder group. * Allow space for super block summary information in first @@ -375,12 +380,29 @@ initcg(int cylno, time_t modtime, int fso, unsigned in acg.cg_cs.cs_nifree--; } /* + * Initialize the initial inode blocks. + */ + dp1 = (struct ufs1_dinode *)(void *)iobuf; + dp2 = (struct ufs2_dinode *)(void *)iobuf; + for (i = 0; i < acg.cg_initediblk; i++) { + if (sblock.fs_magic == FS_UFS1_MAGIC) { + dp1->di_gen = arc4random(); + dp1++; + } else { + dp2->di_gen = arc4random(); + dp2++; + } + } + wtfs(fsbtodb(&sblock, cgimin(&sblock, cylno)), iobufsize, iobuf, + fso, Nflag); + /* * For the old file system, we have to initialize all the inodes. */ - if (sblock.fs_magic == FS_UFS1_MAGIC) { - bzero(iobuf, sblock.fs_bsize); - for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); - i += sblock.fs_frag) { + if (sblock.fs_magic == FS_UFS1_MAGIC && + sblock.fs_ipg > 2 * INOPB(&sblock)) { + for (i = 2 * sblock.fs_frag; + i < sblock.fs_ipg / INOPF(&sblock); + i += sblock.fs_frag) { dp1 = (struct ufs1_dinode *)(void *)iobuf; for (j = 0; j < INOPB(&sblock); j++) { dp1->di_gen = arc4random(); @@ -463,12 +485,8 @@ initcg(int cylno, time_t modtime, int fso, unsigned in *cs = acg.cg_cs; cgckhash(&acg); - memcpy(iobuf, &acg, sblock.fs_cgsize); - memset(iobuf + sblock.fs_cgsize, '\0', - sblock.fs_bsize * 3 - sblock.fs_cgsize); - - wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), - sblock.fs_bsize * 3, iobuf, fso, Nflag); + wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), sblock.fs_cgsize, &acg, + fso, Nflag); DBG_DUMP_CG(&sblock, "new cg", &acg); DBG_LEAVE; Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/newfs/mkfs.c Tue Nov 13 21:40:56 2018 (r340411) @@ -1029,7 +1029,7 @@ goth: void iput(union dinode *ip, ino_t ino) { - ufs2_daddr_t d; + union dinodep dp; bread(&disk, part_ofs + fsbtodb(&sblock, cgtod(&sblock, 0)), (char *)&acg, sblock.fs_cgsize); @@ -1043,20 +1043,15 @@ iput(union dinode *ip, ino_t ino) err(1, "iput: cgput: %s", disk.d_error); sblock.fs_cstotal.cs_nifree--; fscs[0].cs_nifree--; - if (ino >= (unsigned long)sblock.fs_ipg * sblock.fs_ncg) { - printf("fsinit: inode value out of range (%ju).\n", - (uintmax_t)ino); + if (getinode(&disk, &dp, ino) == -1) { + printf("iput: %s\n", disk.d_error); exit(32); } - d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino)); - bread(&disk, part_ofs + d, (char *)iobuf, sblock.fs_bsize); if (sblock.fs_magic == FS_UFS1_MAGIC) - ((struct ufs1_dinode *)iobuf)[ino_to_fsbo(&sblock, ino)] = - ip->dp1; + *dp.dp1 = ip->dp1; else - ((struct ufs2_dinode *)iobuf)[ino_to_fsbo(&sblock, ino)] = - ip->dp2; - wtfs(d, sblock.fs_bsize, (char *)iobuf); + *dp.dp2 = ip->dp2; + putinode(&disk); } /* Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Tue Nov 13 21:29:56 2018 (r340410) +++ head/sbin/tunefs/tunefs.c Tue Nov 13 21:40:56 2018 (r340411) @@ -679,41 +679,36 @@ dir_search(ufs2_daddr_t blk, int bytes) static ino_t journal_findfile(void) { - struct ufs1_dinode *dp1; - struct ufs2_dinode *dp2; + union dinodep dp; ino_t ino; - int mode; - void *ip; int i; - if (getino(&disk, &ip, UFS_ROOTINO, &mode) != 0) { - warn("Failed to get root inode"); + if (getinode(&disk, &dp, UFS_ROOTINO) != 0) { + warn("Failed to get root inode: %s", disk.d_error); return (-1); } - dp2 = ip; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Nov 13 22:41:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A38A01134E06; Tue, 13 Nov 2018 22:41:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23C997C182; Tue, 13 Nov 2018 22:41:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79B7F168C4; Tue, 13 Nov 2018 22:41:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADMfLh1056129; Tue, 13 Nov 2018 22:41:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADMfLL5056118; Tue, 13 Nov 2018 22:41:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811132241.wADMfLL5056118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Nov 2018 22:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340412 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 340412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23C997C182 X-Spamd-Result: default: False [-103.09 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 22:41:23 -0000 Author: imp Date: Tue Nov 13 22:41:20 2018 New Revision: 340412 URL: https://svnweb.freebsd.org/changeset/base/340412 Log: Use atomic_load_acq_int() here too to poll done, ala r328521 Modified: head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Tue Nov 13 21:40:56 2018 (r340411) +++ head/sys/dev/nvme/nvme_ns.c Tue Nov 13 22:41:20 2018 (r340412) @@ -535,11 +535,11 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t if (!mtx_initialized(&ns->lock)) mtx_init(&ns->lock, "nvme ns lock", NULL, MTX_DEF); - status.done = FALSE; + status.done = 0; nvme_ctrlr_cmd_identify_namespace(ctrlr, id, &ns->data, nvme_completion_poll_cb, &status); - while (status.done == FALSE) - DELAY(5); + while (!atomic_load_acq_int(&status.done)) + pause("nvme", 1); if (nvme_completion_is_error(&status.cpl)) { nvme_printf(ctrlr, "nvme_identify_namespace failed\n"); return (ENXIO); From owner-svn-src-head@freebsd.org Tue Nov 13 22:58:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52C601135BE3; Tue, 13 Nov 2018 22:58:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E0867D2DF; Tue, 13 Nov 2018 22:58:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C4B416BB5; Tue, 13 Nov 2018 22:58:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADMwd1B063538; Tue, 13 Nov 2018 22:58:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADMwctL063533; Tue, 13 Nov 2018 22:58:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811132258.wADMwctL063533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Nov 2018 22:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340413 - in head/sys: kern net sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern net sys X-SVN-Commit-Revision: 340413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E0867D2DF X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 22:58:40 -0000 Author: glebius Date: Tue Nov 13 22:58:38 2018 New Revision: 340413 URL: https://svnweb.freebsd.org/changeset/base/340413 Log: For compatibility KPI functions like if_addr_rlock() that used to have mutexes but now are converted to epoch(9) use thread-private epoch_tracker. Embedding tracker into ifnet(9) or ifnet derived structures creates a non reentrable function, that will fail miserably if called simultaneously from two different contexts. A thread private tracker will provide a single tracker that would allow to call these functions safely. It doesn't allow nested call, but this is not expected from compatibility KPIs. Reviewed by: markj Modified: head/sys/kern/kern_thread.c head/sys/kern/subr_epoch.c head/sys/net/if.c head/sys/net/if_var.h head/sys/sys/epoch.h head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue Nov 13 22:41:20 2018 (r340412) +++ head/sys/kern/kern_thread.c Tue Nov 13 22:58:38 2018 (r340413) @@ -272,6 +272,7 @@ thread_init(void *mem, int size, int flags) td->td_rlqe = NULL; EVENTHANDLER_DIRECT_INVOKE(thread_init, td); umtx_thread_init(td); + epoch_thread_init(td); td->td_kstack = 0; td->td_sel = NULL; return (0); @@ -291,6 +292,7 @@ thread_fini(void *mem, int size) turnstile_free(td->td_turnstile); sleepq_free(td->td_sleepqueue); umtx_thread_fini(td); + epoch_thread_fini(td); seltdfini(td); } Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Tue Nov 13 22:41:20 2018 (r340412) +++ head/sys/kern/subr_epoch.c Tue Nov 13 22:58:38 2018 (r340413) @@ -667,3 +667,17 @@ in_epoch(epoch_t epoch) { return (in_epoch_verbose(epoch, 0)); } + +void +epoch_thread_init(struct thread *td) +{ + + td->td_et = malloc(sizeof(struct epoch_tracker), M_EPOCH, M_WAITOK); +} + +void +epoch_thread_fini(struct thread *td) +{ + + free(td->td_et, M_EPOCH); +} Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Nov 13 22:41:20 2018 (r340412) +++ head/sys/net/if.c Tue Nov 13 22:58:38 2018 (r340413) @@ -1767,35 +1767,29 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd) void if_addr_rlock(struct ifnet *ifp) { - MPASS(*(uint64_t *)&ifp->if_addr_et == 0); - epoch_enter_preempt(net_epoch_preempt, &ifp->if_addr_et); + + epoch_enter_preempt(net_epoch_preempt, curthread->td_et); } void if_addr_runlock(struct ifnet *ifp) { - epoch_exit_preempt(net_epoch_preempt, &ifp->if_addr_et); -#ifdef INVARIANTS - bzero(&ifp->if_addr_et, sizeof(struct epoch_tracker)); -#endif + + epoch_exit_preempt(net_epoch_preempt, curthread->td_et); } void if_maddr_rlock(if_t ifp) { - MPASS(*(uint64_t *)&ifp->if_maddr_et == 0); - epoch_enter_preempt(net_epoch_preempt, &ifp->if_maddr_et); + epoch_enter_preempt(net_epoch_preempt, curthread->td_et); } void if_maddr_runlock(if_t ifp) { - epoch_exit_preempt(net_epoch_preempt, &ifp->if_maddr_et); -#ifdef INVARIANTS - bzero(&ifp->if_maddr_et, sizeof(struct epoch_tracker)); -#endif + epoch_exit_preempt(net_epoch_preempt, curthread->td_et); } /* Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Nov 13 22:41:20 2018 (r340412) +++ head/sys/net/if_var.h Tue Nov 13 22:58:38 2018 (r340413) @@ -381,8 +381,6 @@ struct ifnet { */ struct netdump_methods *if_netdump_methods; struct epoch_context if_epoch_ctx; - struct epoch_tracker if_addr_et; - struct epoch_tracker if_maddr_et; /* * Spare fields to be added before branching a stable branch, so Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Tue Nov 13 22:41:20 2018 (r340412) +++ head/sys/sys/epoch.h Tue Nov 13 22:58:38 2018 (r340413) @@ -82,5 +82,8 @@ void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t void epoch_enter(epoch_t epoch); void epoch_exit(epoch_t epoch); +void epoch_thread_init(struct thread *); +void epoch_thread_fini(struct thread *); + #endif /* _KERNEL */ #endif /* _SYS_EPOCH_H_ */ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Nov 13 22:41:20 2018 (r340412) +++ head/sys/sys/proc.h Tue Nov 13 22:58:38 2018 (r340413) @@ -193,6 +193,7 @@ struct trapframe; struct turnstile; struct vm_map; struct vm_map_entry; +struct epoch_tracker; /* * XXX: Does this belong in resource.h or resourcevar.h instead? @@ -360,6 +361,7 @@ struct thread { int td_lastcpu; /* (t) Last cpu we were on. */ int td_oncpu; /* (t) Which cpu we are on. */ void *td_lkpi_task; /* LinuxKPI task struct pointer */ + struct epoch_tracker *td_et; /* (k) compat KPI spare tracker */ int td_pmcpend; }; From owner-svn-src-head@freebsd.org Tue Nov 13 23:08:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91CBB113654B; Tue, 13 Nov 2018 23:08:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2019E7E22B; Tue, 13 Nov 2018 23:08:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0124D16D82; Tue, 13 Nov 2018 23:08:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADN8kaR068930; Tue, 13 Nov 2018 23:08:46 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADN8kCJ068929; Tue, 13 Nov 2018 23:08:46 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201811132308.wADN8kCJ068929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 13 Nov 2018 23:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340414 - head/sys/amd64/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/amd64/conf X-SVN-Commit-Revision: 340414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2019E7E22B X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 23:08:47 -0000 Author: mmacy Date: Tue Nov 13 23:08:46 2018 New Revision: 340414 URL: https://svnweb.freebsd.org/changeset/base/340414 Log: Add ZFS to amd64 NOTES to catch future breakage of static linking Modified: head/sys/amd64/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Nov 13 22:58:38 2018 (r340413) +++ head/sys/amd64/conf/NOTES Tue Nov 13 23:08:46 2018 (r340414) @@ -642,6 +642,11 @@ options LINPROCFS options LINSYSFS ##################################################################### +# ZFS support + +options ZFS + +##################################################################### # VM OPTIONS # KSTACK_PAGES is the number of memory pages to assign to the kernel From owner-svn-src-head@freebsd.org Tue Nov 13 23:20:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95B111136FAA; Tue, 13 Nov 2018 23:20:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 187B57F774; Tue, 13 Nov 2018 23:20:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79A7317034; Tue, 13 Nov 2018 23:20:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADNKu8i074414; Tue, 13 Nov 2018 23:20:56 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADNKuGo074412; Tue, 13 Nov 2018 23:20:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811132320.wADNKuGo074412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Nov 2018 23:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340415 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 187B57F774 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 23:20:58 -0000 Author: glebius Date: Tue Nov 13 23:20:55 2018 New Revision: 340415 URL: https://svnweb.freebsd.org/changeset/base/340415 Log: The dualism between epoch_tracker and epoch_thread is fragile and unnecessary. So, expose CK types to kernel and use a single normal structure for epoch_tracker. Reviewed by: jtl, gallatin Modified: head/sys/kern/subr_epoch.c head/sys/sys/epoch.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Tue Nov 13 23:08:46 2018 (r340414) +++ head/sys/kern/subr_epoch.c Tue Nov 13 23:20:55 2018 (r340415) @@ -55,25 +55,13 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); -typedef struct epoch_thread { -#ifdef EPOCH_TRACKER_DEBUG - uint64_t et_magic_pre; -#endif - TAILQ_ENTRY(epoch_thread) et_link; /* Epoch queue. */ - struct thread *et_td; /* pointer to thread in section */ - ck_epoch_section_t et_section; /* epoch section object */ -#ifdef EPOCH_TRACKER_DEBUG - uint64_t et_magic_post; -#endif -} *epoch_thread_t; -TAILQ_HEAD (epoch_tdlist, epoch_thread); - #ifdef __amd64__ #define EPOCH_ALIGN CACHE_LINE_SIZE*2 #else #define EPOCH_ALIGN CACHE_LINE_SIZE #endif +TAILQ_HEAD (epoch_tdlist, epoch_tracker); typedef struct epoch_record { ck_epoch_record_t er_read_record; ck_epoch_record_t er_write_record; @@ -252,27 +240,25 @@ void epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) { struct epoch_record *er; - struct epoch_thread *etd; struct thread_lite *td; MPASS(cold || epoch != NULL); INIT_CHECK(epoch); - etd = (void *)et; MPASS(epoch->e_flags & EPOCH_PREEMPT); #ifdef EPOCH_TRACKER_DEBUG - etd->et_magic_pre = EPOCH_MAGIC0; - etd->et_magic_post = EPOCH_MAGIC1; + et->et_magic_pre = EPOCH_MAGIC0; + et->et_magic_post = EPOCH_MAGIC1; #endif td = (struct thread_lite *)curthread; - etd->et_td = (void*)td; + et->et_td = (void*)td; td->td_epochnest++; critical_enter(); sched_pin_lite(td); td->td_pre_epoch_prio = td->td_priority; er = epoch_currecord(epoch); - TAILQ_INSERT_TAIL(&er->er_tdlist, etd, et_link); - ck_epoch_begin(&er->er_read_record, (ck_epoch_section_t *)&etd->et_section); + TAILQ_INSERT_TAIL(&er->er_tdlist, et, et_link); + ck_epoch_begin(&er->er_read_record, &et->et_section); critical_exit(); } @@ -296,7 +282,6 @@ void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) { struct epoch_record *er; - struct epoch_thread *etd; struct thread_lite *td; INIT_CHECK(epoch); @@ -307,19 +292,19 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) td->td_epochnest--; er = epoch_currecord(epoch); MPASS(epoch->e_flags & EPOCH_PREEMPT); - etd = (void *)et; - MPASS(etd != NULL); - MPASS(etd->et_td == (struct thread *)td); + MPASS(et != NULL); + MPASS(et->et_td == (struct thread *)td); #ifdef EPOCH_TRACKER_DEBUG - MPASS(etd->et_magic_pre == EPOCH_MAGIC0); - MPASS(etd->et_magic_post == EPOCH_MAGIC1); - etd->et_magic_pre = 0; - etd->et_magic_post = 0; + MPASS(et->et_magic_pre == EPOCH_MAGIC0); + MPASS(et->et_magic_post == EPOCH_MAGIC1); + et->et_magic_pre = 0; + et->et_magic_post = 0; #endif - etd->et_td = (void*)0xDEADBEEF; - ck_epoch_end(&er->er_read_record, - (ck_epoch_section_t *)&etd->et_section); - TAILQ_REMOVE(&er->er_tdlist, etd, et_link); +#ifdef INVARIANTS + et->et_td = (void*)0xDEADBEEF; +#endif + ck_epoch_end(&er->er_read_record, &et->et_section); + TAILQ_REMOVE(&er->er_tdlist, et, et_link); er->er_gen++; if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) epoch_adjust_prio((struct thread *)td, td->td_pre_epoch_prio); @@ -351,7 +336,7 @@ epoch_block_handler_preempt(struct ck_epoch *global __ { epoch_record_t record; struct thread *td, *owner, *curwaittd; - struct epoch_thread *tdwait; + struct epoch_tracker *tdwait; struct turnstile *ts; struct lock_object *lock; int spincount, gen; @@ -633,7 +618,7 @@ epoch_call_task(void *arg __unused) int in_epoch_verbose(epoch_t epoch, int dump_onfail) { - struct epoch_thread *tdwait; + struct epoch_tracker *tdwait; struct thread *td; epoch_record_t er; Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Tue Nov 13 23:08:46 2018 (r340414) +++ head/sys/sys/epoch.h Tue Nov 13 23:20:55 2018 (r340415) @@ -30,31 +30,16 @@ #ifndef _SYS_EPOCH_H_ #define _SYS_EPOCH_H_ -/* - * XXXGL: temporarily keep epoch_tracker exposed to userland until - * we remove trackers embedded into network structs. - */ - struct epoch_context { void *data[2]; } __aligned(sizeof(void *)); typedef struct epoch_context *epoch_context_t; -struct epoch_tracker { - void *datap[3]; -#ifdef EPOCH_TRACKER_DEBUG - int datai[5]; -#else - int datai[1]; -#endif -} __aligned(sizeof(void *)); - -typedef struct epoch_tracker *epoch_tracker_t; - #ifdef _KERNEL #include #include +#include struct epoch; typedef struct epoch *epoch_t; @@ -64,6 +49,21 @@ typedef struct epoch *epoch_t; extern epoch_t global_epoch; extern epoch_t global_epoch_preempt; + +struct epoch_tracker { +#ifdef EPOCH_TRACKER_DEBUG +#define EPOCH_MAGIC0 0xFADECAFEF00DD00D +#define EPOCH_MAGIC1 0xBADDBABEDEEDFEED + uint64_t et_magic_pre; +#endif + TAILQ_ENTRY(epoch_tracker) et_link; + struct thread *et_td; + ck_epoch_section_t et_section; +#ifdef EPOCH_TRACKER_DEBUG + uint64_t et_magic_post; +#endif +} __aligned(sizeof(void *)); +typedef struct epoch_tracker *epoch_tracker_t; epoch_t epoch_alloc(int flags); void epoch_free(epoch_t epoch); From owner-svn-src-head@freebsd.org Tue Nov 13 23:44:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 157901100A5A; Tue, 13 Nov 2018 23:44:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9600880586; Tue, 13 Nov 2018 23:44:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D2DD173FE; Tue, 13 Nov 2018 23:44:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADNiS7E089291; Tue, 13 Nov 2018 23:44:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADNiRs3089288; Tue, 13 Nov 2018 23:44:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811132344.wADNiRs3089288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Nov 2018 23:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340416 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 340416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9600880586 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 23:44:29 -0000 Author: glebius Date: Tue Nov 13 23:44:27 2018 New Revision: 340416 URL: https://svnweb.freebsd.org/changeset/base/340416 Log: Plug build break after r340411. Modified: head/sbin/dump/dump.h head/sbin/dump/main.c head/sbin/dump/traverse.c Modified: head/sbin/dump/dump.h ============================================================================== --- head/sbin/dump/dump.h Tue Nov 13 23:20:55 2018 (r340415) +++ head/sbin/dump/dump.h Tue Nov 13 23:44:27 2018 (r340416) @@ -126,7 +126,7 @@ void dumpabort(int signo) __dead2; void dump_getfstab(void); char *rawname(char *cp); -union dinode *getinode(ino_t inum, int *mode); +union dinode *getinode0(ino_t inum, int *mode); /* rdump routines */ #ifdef RDUMP Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Tue Nov 13 23:20:55 2018 (r340415) +++ head/sbin/dump/main.c Tue Nov 13 23:44:27 2018 (r340416) @@ -549,7 +549,7 @@ main(int argc, char *argv[]) /* * Skip directory inodes deleted and maybe reallocated */ - dp = getinode(ino, &mode); + dp = getinode0(ino, &mode); if (mode != IFDIR) continue; (void)dumpino(dp, ino); @@ -568,7 +568,7 @@ main(int argc, char *argv[]) /* * Skip inodes deleted and reallocated as directories. */ - dp = getinode(ino, &mode); + dp = getinode0(ino, &mode); if (mode == IFDIR) continue; (void)dumpino(dp, ino); Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Tue Nov 13 23:20:55 2018 (r340415) +++ head/sbin/dump/traverse.c Tue Nov 13 23:44:27 2018 (r340416) @@ -195,7 +195,7 @@ mapfiles(ino_t maxino, long *tapesize) } for (i = 0; i < inosused; i++, ino++) { if (ino < UFS_ROOTINO || - (dp = getinode(ino, &mode)) == NULL || + (dp = getinode0(ino, &mode)) == NULL || (mode & IFMT) == 0) continue; if (ino >= maxino) { @@ -277,7 +277,7 @@ mapdirs(ino_t maxino, long *tapesize) nodump = !nonodump && (TSTINO(ino, usedinomap) == 0); if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump)) continue; - dp = getinode(ino, &i); + dp = getinode0(ino, &i); /* * inode buf may change in searchdir(). */ @@ -421,7 +421,7 @@ searchdir( continue; } if (nodump) { - ip = getinode(dp->d_ino, &mode); + ip = getinode0(dp->d_ino, &mode); if (TSTINO(dp->d_ino, dumpinomap)) { CLRINO(dp->d_ino, dumpinomap); *tapesize -= blockest(ip); @@ -875,7 +875,7 @@ writeheader(ino_t ino) } union dinode * -getinode(ino_t inum, int *modep) +getinode0(ino_t inum, int *modep) { static ino_t minino, maxino; static caddr_t inoblock; From owner-svn-src-head@freebsd.org Tue Nov 13 23:45:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C2CF1100AFE; Tue, 13 Nov 2018 23:45:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBEDA80721; Tue, 13 Nov 2018 23:45:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC3F8173FF; Tue, 13 Nov 2018 23:45:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADNjcOQ089392; Tue, 13 Nov 2018 23:45:38 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADNjc8N089391; Tue, 13 Nov 2018 23:45:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811132345.wADNjc8N089391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Nov 2018 23:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340417 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DBEDA80721 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 23:45:39 -0000 Author: glebius Date: Tue Nov 13 23:45:38 2018 New Revision: 340417 URL: https://svnweb.freebsd.org/changeset/base/340417 Log: With epoch not inlined, there is no point in using _lite KPI. While here, remove some unnecessary casts. Modified: head/sys/kern/genoffset.c head/sys/kern/subr_epoch.c Modified: head/sys/kern/genoffset.c ============================================================================== --- head/sys/kern/genoffset.c Tue Nov 13 23:44:27 2018 (r340416) +++ head/sys/kern/genoffset.c Tue Nov 13 23:45:38 2018 (r340417) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -OFFSYM(td_pre_epoch_prio, thread, u_char); OFFSYM(td_priority, thread, u_char); OFFSYM(td_epochnest, thread, u_char); OFFSYM(td_critnest, thread, u_int); Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Tue Nov 13 23:44:27 2018 (r340416) +++ head/sys/kern/subr_epoch.c Tue Nov 13 23:45:38 2018 (r340417) @@ -240,7 +240,7 @@ void epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) { struct epoch_record *er; - struct thread_lite *td; + struct thread *td; MPASS(cold || epoch != NULL); INIT_CHECK(epoch); @@ -249,11 +249,11 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) et->et_magic_pre = EPOCH_MAGIC0; et->et_magic_post = EPOCH_MAGIC1; #endif - td = (struct thread_lite *)curthread; - et->et_td = (void*)td; + td = curthread; + et->et_td = td; td->td_epochnest++; critical_enter(); - sched_pin_lite(td); + sched_pin(); td->td_pre_epoch_prio = td->td_priority; er = epoch_currecord(epoch); @@ -265,12 +265,12 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) void epoch_enter(epoch_t epoch) { - struct thread_lite *td; + struct thread *td; epoch_record_t er; MPASS(cold || epoch != NULL); INIT_CHECK(epoch); - td = (struct thread_lite *)curthread; + td = curthread; td->td_epochnest++; critical_enter(); @@ -282,18 +282,18 @@ void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) { struct epoch_record *er; - struct thread_lite *td; + struct thread *td; INIT_CHECK(epoch); - td = (struct thread_lite *)curthread; + td = curthread; critical_enter(); - sched_unpin_lite(td); + sched_unpin(); MPASS(td->td_epochnest); td->td_epochnest--; er = epoch_currecord(epoch); MPASS(epoch->e_flags & EPOCH_PREEMPT); MPASS(et != NULL); - MPASS(et->et_td == (struct thread *)td); + MPASS(et->et_td == td); #ifdef EPOCH_TRACKER_DEBUG MPASS(et->et_magic_pre == EPOCH_MAGIC0); MPASS(et->et_magic_post == EPOCH_MAGIC1); @@ -307,18 +307,18 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) TAILQ_REMOVE(&er->er_tdlist, et, et_link); er->er_gen++; if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) - epoch_adjust_prio((struct thread *)td, td->td_pre_epoch_prio); + epoch_adjust_prio(td, td->td_pre_epoch_prio); critical_exit(); } void epoch_exit(epoch_t epoch) { - struct thread_lite *td; + struct thread *td; epoch_record_t er; INIT_CHECK(epoch); - td = (struct thread_lite *)curthread; + td = curthread; MPASS(td->td_epochnest); td->td_epochnest--; er = epoch_currecord(epoch); From owner-svn-src-head@freebsd.org Tue Nov 13 23:53:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 295C41100F05; Tue, 13 Nov 2018 23:53:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABBBC80CE5; Tue, 13 Nov 2018 23:53:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CDC81758E; Tue, 13 Nov 2018 23:53:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADNrPPR094351; Tue, 13 Nov 2018 23:53:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADNrPWF094349; Tue, 13 Nov 2018 23:53:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811132353.wADNrPWF094349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Nov 2018 23:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340418 - head/sys/dev/tws X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/tws X-SVN-Commit-Revision: 340418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABBBC80CE5 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 23:53:26 -0000 Author: imp Date: Tue Nov 13 23:53:24 2018 New Revision: 340418 URL: https://svnweb.freebsd.org/changeset/base/340418 Log: Remove support for versions prior to FreeBSD 7.0 from twa(4) This was for pre-7.0 CAM support. Neither the CAM nor the busdma changes over the years have not been ifdef'd. The code cannot build on 6.x anymore. Support for 6.4 ended in 2010, so remove them. Modified: head/sys/dev/tws/tws.c head/sys/dev/tws/tws_cam.c head/sys/dev/tws/tws_services.h Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Tue Nov 13 23:45:38 2018 (r340417) +++ head/sys/dev/tws/tws.c Tue Nov 13 23:53:24 2018 (r340418) @@ -445,9 +445,7 @@ tws_setup_intr(struct tws_softc *sc, int irqs) if (!(sc->intr_handle[i])) { if ((error = bus_setup_intr(sc->tws_dev, sc->irq_res[i], INTR_TYPE_CAM | INTR_MPSAFE, -#if (__FreeBSD_version >= 700000) NULL, -#endif tws_intr, sc, &sc->intr_handle[i]))) { tws_log(sc, SETUP_INTR_RES); return(FAILURE); Modified: head/sys/dev/tws/tws_cam.c ============================================================================== --- head/sys/dev/tws/tws_cam.c Tue Nov 13 23:45:38 2018 (r340417) +++ head/sys/dev/tws/tws_cam.c Tue Nov 13 23:53:24 2018 (r340418) @@ -160,9 +160,7 @@ tws_cam_attach(struct tws_softc *sc) */ sc->sim = cam_sim_alloc(tws_action, tws_poll, "tws", sc, device_get_unit(sc->tws_dev), -#if (__FreeBSD_version >= 700000) &sc->sim_lock, -#endif tws_cam_depth, 1, devq); /* 1, 1, devq); */ if (sc->sim == NULL) { @@ -172,9 +170,7 @@ tws_cam_attach(struct tws_softc *sc) /* Register the bus. */ mtx_lock(&sc->sim_lock); if (xpt_bus_register(sc->sim, -#if (__FreeBSD_version >= 700000) sc->tws_dev, -#endif 0) != CAM_SUCCESS) { cam_sim_free(sc->sim, TRUE); /* passing true will free the devq */ sc->sim = NULL; /* so cam_detach will not try to free it */ @@ -269,7 +265,6 @@ tws_action(struct cam_sim *sim, union ccb *ccb) { TWS_TRACE_DEBUG(sc, "get tran settings", sim, ccb); -#if (__FreeBSD_version >= 700000 ) ccb->cts.protocol = PROTO_SCSI; ccb->cts.protocol_version = SCSI_REV_2; ccb->cts.transport = XPORT_SPI; @@ -279,10 +274,6 @@ tws_action(struct cam_sim *sim, union ccb *ccb) ccb->cts.xport_specific.spi.flags = CTS_SPI_FLAGS_DISC_ENB; ccb->cts.proto_specific.scsi.valid = CTS_SCSI_VALID_TQ; ccb->cts.proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB; -#else - ccb->cts.valid = (CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID); - ccb->cts.flags &= ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); -#endif ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -314,13 +305,11 @@ tws_action(struct cam_sim *sim, union ccb *ccb) strlcpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(ccb->cpi.hba_vid, "3ware", HBA_IDLEN); strlcpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN); -#if (__FreeBSD_version >= 700000 ) ccb->cpi.transport = XPORT_SPI; ccb->cpi.transport_version = 2; ccb->cpi.protocol = PROTO_SCSI; ccb->cpi.protocol_version = SCSI_REV_2; ccb->cpi.maxio = TWS_MAX_IO_SIZE; -#endif ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); Modified: head/sys/dev/tws/tws_services.h ============================================================================== --- head/sys/dev/tws/tws_services.h Tue Nov 13 23:45:38 2018 (r340417) +++ head/sys/dev/tws/tws_services.h Tue Nov 13 23:53:24 2018 (r340418) @@ -131,12 +131,5 @@ struct error_desc { /* ------------------------ */ -#if (__FreeBSD_version >= 700000) #include #define TWS_LOCAL_TIME (time_second - utc_offset()) -#else -#include -#define TWS_LOCAL_TIME (time_second - (tz_minuteswest * 60) - \ - (wall_cmos_clock ? adjkerntz : 0)) -#endif - From owner-svn-src-head@freebsd.org Tue Nov 13 23:57:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D702110141C; Tue, 13 Nov 2018 23:57:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3AFE81441; Tue, 13 Nov 2018 23:57:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4BC11759C; Tue, 13 Nov 2018 23:57:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADNvYTh095355; Tue, 13 Nov 2018 23:57:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADNvYEw095354; Tue, 13 Nov 2018 23:57:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811132357.wADNvYEw095354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Nov 2018 23:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340419 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3AFE81441 X-Spamd-Result: default: False [-103.10 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 23:57:35 -0000 Author: glebius Date: Tue Nov 13 23:57:34 2018 New Revision: 340419 URL: https://svnweb.freebsd.org/changeset/base/340419 Log: style(9), mostly adjusting overly long lines. Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Tue Nov 13 23:53:24 2018 (r340418) +++ head/sys/kern/subr_epoch.c Tue Nov 13 23:57:34 2018 (r340419) @@ -141,11 +141,15 @@ epoch_init(void *arg __unused) epoch_call_count = counter_u64_alloc(M_WAITOK); epoch_call_task_count = counter_u64_alloc(M_WAITOK); - pcpu_zone_record = uma_zcreate("epoch_record pcpu", sizeof(struct epoch_record), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); + pcpu_zone_record = uma_zcreate("epoch_record pcpu", + sizeof(struct epoch_record), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, UMA_ZONE_PCPU); CPU_FOREACH(cpu) { - GROUPTASK_INIT(DPCPU_ID_PTR(cpu, epoch_cb_task), 0, epoch_call_task, NULL); - taskqgroup_attach_cpu(qgroup_softirq, DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, -1, "epoch call task"); + GROUPTASK_INIT(DPCPU_ID_PTR(cpu, epoch_cb_task), 0, + epoch_call_task, NULL); + taskqgroup_attach_cpu(qgroup_softirq, + DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, -1, + "epoch call task"); } inited = 1; global_epoch = epoch_alloc(0); @@ -327,12 +331,12 @@ epoch_exit(epoch_t epoch) } /* - * epoch_block_handler_preempt is a callback from the ck code when another thread is - * currently in an epoch section. + * epoch_block_handler_preempt() is a callback from the CK code when another + * thread is currently in an epoch section. */ static void -epoch_block_handler_preempt(struct ck_epoch *global __unused, ck_epoch_record_t *cr, - void *arg __unused) +epoch_block_handler_preempt(struct ck_epoch *global __unused, + ck_epoch_record_t *cr, void *arg __unused) { epoch_record_t record; struct thread *td, *owner, *curwaittd; @@ -424,25 +428,27 @@ epoch_block_handler_preempt(struct ck_epoch *global __ if (TD_IS_INHIBITED(curwaittd) && TD_ON_LOCK(curwaittd) && ((ts = curwaittd->td_blocked) != NULL)) { /* - * We unlock td to allow turnstile_wait to reacquire the - * the thread lock. Before unlocking it we enter a critical - * section to prevent preemption after we reenable interrupts - * by dropping the thread lock in order to prevent curwaittd - * from getting to run. + * We unlock td to allow turnstile_wait to reacquire + * the thread lock. Before unlocking it we enter a + * critical section to prevent preemption after we + * reenable interrupts by dropping the thread lock in + * order to prevent curwaittd from getting to run. */ critical_enter(); thread_unlock(td); owner = turnstile_lock(ts, &lock); /* - * The owner pointer indicates that the lock succeeded. Only - * in case we hold the lock and the turnstile we locked is still - * the one that curwaittd is blocked on can we continue. Otherwise - * The turnstile pointer has been changed out from underneath - * us, as in the case where the lock holder has signalled curwaittd, + * The owner pointer indicates that the lock succeeded. + * Only in case we hold the lock and the turnstile we + * locked is still the one that curwaittd is blocked on + * can we continue. Otherwise the turnstile pointer has + * been changed out from underneath us, as in the case + * where the lock holder has signalled curwaittd, * and we need to continue. */ if (owner != NULL && ts == curwaittd->td_blocked) { - MPASS(TD_IS_INHIBITED(curwaittd) && TD_ON_LOCK(curwaittd)); + MPASS(TD_IS_INHIBITED(curwaittd) && + TD_ON_LOCK(curwaittd)); critical_exit(); turnstile_wait(ts, owner, curwaittd->td_tsqueue); counter_u64_add(turnstile_count, 1); @@ -492,9 +498,8 @@ epoch_wait_preempt(epoch_t epoch) if ((epoch->e_flags & EPOCH_LOCKED) == 0) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "epoch_wait() can be long running"); - KASSERT(!in_epoch(epoch), - ("epoch_wait_preempt() called in the middle " - "of an epoch section of the same epoch")); + KASSERT(!in_epoch(epoch), ("epoch_wait_preempt() called in the middle " + "of an epoch section of the same epoch")); #endif thread_lock(td); DROP_GIANT(); @@ -507,7 +512,8 @@ epoch_wait_preempt(epoch_t epoch) td->td_pinned = 0; sched_bind(td, old_cpu); - ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler_preempt, NULL); + ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler_preempt, + NULL); /* restore CPU binding, if any */ if (was_bound != 0) { @@ -608,7 +614,7 @@ epoch_call_task(void *arg __unused) head = ck_stack_batch_pop_npsc(&cb_stack); for (cursor = head; cursor != NULL; cursor = next) { struct ck_epoch_entry *entry = - ck_epoch_entry_container(cursor); + ck_epoch_entry_container(cursor); next = CK_STACK_NEXT(cursor); entry->function(entry); From owner-svn-src-head@freebsd.org Wed Nov 14 00:12:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D5CD1101BC9; Wed, 14 Nov 2018 00:12:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A7A781C1F; Wed, 14 Nov 2018 00:12:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C712178B6; Wed, 14 Nov 2018 00:12:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE0C59D003357; Wed, 14 Nov 2018 00:12:05 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE0C5Y1003356; Wed, 14 Nov 2018 00:12:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201811140012.wAE0C5Y1003356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 14 Nov 2018 00:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340420 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A7A781C1F X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 00:12:06 -0000 Author: mmacy Date: Wed Nov 14 00:12:04 2018 New Revision: 340420 URL: https://svnweb.freebsd.org/changeset/base/340420 Log: epoch(9) revert r340097 - no longer a need for multiple sections per cpu I spoke with Samy Bahra and recent changes to CK to make ck_epoch_call and ck_epoch_poll not modify the record have eliminated the need for this. Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Tue Nov 13 23:57:34 2018 (r340419) +++ head/sys/kern/subr_epoch.c Wed Nov 14 00:12:04 2018 (r340420) @@ -63,8 +63,7 @@ static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based re TAILQ_HEAD (epoch_tdlist, epoch_tracker); typedef struct epoch_record { - ck_epoch_record_t er_read_record; - ck_epoch_record_t er_write_record; + ck_epoch_record_t er_record; volatile struct epoch_tdlist er_tdlist; volatile uint32_t er_gen; uint32_t er_cpuid; @@ -176,8 +175,7 @@ epoch_ctor(epoch_t epoch) CPU_FOREACH(cpu) { er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); bzero(er, sizeof(*er)); - ck_epoch_register(&epoch->e_epoch, &er->er_read_record, NULL); - ck_epoch_register(&epoch->e_epoch, &er->er_write_record, NULL); + ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); er->er_cpuid = cpu; } @@ -262,7 +260,7 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) td->td_pre_epoch_prio = td->td_priority; er = epoch_currecord(epoch); TAILQ_INSERT_TAIL(&er->er_tdlist, et, et_link); - ck_epoch_begin(&er->er_read_record, &et->et_section); + ck_epoch_begin(&er->er_record, &et->et_section); critical_exit(); } @@ -279,7 +277,7 @@ epoch_enter(epoch_t epoch) td->td_epochnest++; critical_enter(); er = epoch_currecord(epoch); - ck_epoch_begin(&er->er_read_record, NULL); + ck_epoch_begin(&er->er_record, NULL); } void @@ -307,7 +305,7 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) #ifdef INVARIANTS et->et_td = (void*)0xDEADBEEF; #endif - ck_epoch_end(&er->er_read_record, &et->et_section); + ck_epoch_end(&er->er_record, &et->et_section); TAILQ_REMOVE(&er->er_tdlist, et, et_link); er->er_gen++; if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) @@ -326,7 +324,7 @@ epoch_exit(epoch_t epoch) MPASS(td->td_epochnest); td->td_epochnest--; er = epoch_currecord(epoch); - ck_epoch_end(&er->er_read_record, NULL); + ck_epoch_end(&er->er_record, NULL); critical_exit(); } @@ -346,7 +344,7 @@ epoch_block_handler_preempt(struct ck_epoch *global __ int spincount, gen; int locksheld __unused; - record = __containerof(cr, struct epoch_record, er_read_record); + record = __containerof(cr, struct epoch_record, er_record); td = curthread; locksheld = td->td_locks; spincount = 0; @@ -574,7 +572,7 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* critical_enter(); *DPCPU_PTR(epoch_cb_count) += 1; er = epoch_currecord(epoch); - ck_epoch_call(&er->er_write_record, cb, (ck_epoch_cb_t *)callback); + ck_epoch_call(&er->er_record, cb, (ck_epoch_cb_t *)callback); critical_exit(); return; boottime: @@ -598,7 +596,7 @@ epoch_call_task(void *arg __unused) if (__predict_false((epoch = allepochs[i]) == NULL)) continue; er = epoch_currecord(epoch); - record = &er->er_write_record; + record = &er->er_record; if ((npending = record->n_pending) == 0) continue; ck_epoch_poll_deferred(record, &cb_stack); From owner-svn-src-head@freebsd.org Wed Nov 14 00:21:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07EBA1101F26; Wed, 14 Nov 2018 00:21:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8960D82FD4; Wed, 14 Nov 2018 00:21:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50FB117A45; Wed, 14 Nov 2018 00:21:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE0Lrhf008268; Wed, 14 Nov 2018 00:21:53 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE0LqWa008265; Wed, 14 Nov 2018 00:21:52 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201811140021.wAE0LqWa008265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 14 Nov 2018 00:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340422 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 340422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8960D82FD4 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 00:21:54 -0000 Author: mckusick Date: Wed Nov 14 00:21:52 2018 New Revision: 340422 URL: https://svnweb.freebsd.org/changeset/base/340422 Log: Fix build break from dump incompatibility I introduced in -r340411 Pointy-hat to: mckusick Modified: head/sbin/dump/dump.h head/sbin/dump/main.c head/sbin/dump/traverse.c Modified: head/sbin/dump/dump.h ============================================================================== --- head/sbin/dump/dump.h Wed Nov 14 00:21:49 2018 (r340421) +++ head/sbin/dump/dump.h Wed Nov 14 00:21:52 2018 (r340422) @@ -126,7 +126,7 @@ void dumpabort(int signo) __dead2; void dump_getfstab(void); char *rawname(char *cp); -union dinode *getinode0(ino_t inum, int *mode); +union dinode *getino(ino_t inum, int *mode); /* rdump routines */ #ifdef RDUMP Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Wed Nov 14 00:21:49 2018 (r340421) +++ head/sbin/dump/main.c Wed Nov 14 00:21:52 2018 (r340422) @@ -549,7 +549,7 @@ main(int argc, char *argv[]) /* * Skip directory inodes deleted and maybe reallocated */ - dp = getinode0(ino, &mode); + dp = getino(ino, &mode); if (mode != IFDIR) continue; (void)dumpino(dp, ino); @@ -568,7 +568,7 @@ main(int argc, char *argv[]) /* * Skip inodes deleted and reallocated as directories. */ - dp = getinode0(ino, &mode); + dp = getino(ino, &mode); if (mode == IFDIR) continue; (void)dumpino(dp, ino); Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Wed Nov 14 00:21:49 2018 (r340421) +++ head/sbin/dump/traverse.c Wed Nov 14 00:21:52 2018 (r340422) @@ -195,7 +195,7 @@ mapfiles(ino_t maxino, long *tapesize) } for (i = 0; i < inosused; i++, ino++) { if (ino < UFS_ROOTINO || - (dp = getinode0(ino, &mode)) == NULL || + (dp = getino(ino, &mode)) == NULL || (mode & IFMT) == 0) continue; if (ino >= maxino) { @@ -277,7 +277,7 @@ mapdirs(ino_t maxino, long *tapesize) nodump = !nonodump && (TSTINO(ino, usedinomap) == 0); if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump)) continue; - dp = getinode0(ino, &i); + dp = getino(ino, &i); /* * inode buf may change in searchdir(). */ @@ -421,7 +421,7 @@ searchdir( continue; } if (nodump) { - ip = getinode0(dp->d_ino, &mode); + ip = getino(dp->d_ino, &mode); if (TSTINO(dp->d_ino, dumpinomap)) { CLRINO(dp->d_ino, dumpinomap); *tapesize -= blockest(ip); @@ -875,7 +875,7 @@ writeheader(ino_t ino) } union dinode * -getinode0(ino_t inum, int *modep) +getino(ino_t inum, int *modep) { static ino_t minino, maxino; static caddr_t inoblock; From owner-svn-src-head@freebsd.org Wed Nov 14 00:21:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80C3F1101F1E; Wed, 14 Nov 2018 00:21:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01CD082FC6; Wed, 14 Nov 2018 00:21:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6F3B17A40; Wed, 14 Nov 2018 00:21:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE0LoB5008218; Wed, 14 Nov 2018 00:21:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE0LnWL008210; Wed, 14 Nov 2018 00:21:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811140021.wAE0LnWL008210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Nov 2018 00:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340421 - head/usr.sbin/cpucontrol X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/cpucontrol X-SVN-Commit-Revision: 340421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01CD082FC6 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 00:21:51 -0000 Author: cem Date: Wed Nov 14 00:21:49 2018 New Revision: 340421 URL: https://svnweb.freebsd.org/changeset/base/340421 Log: cpucontrol(8): De-duplicate common update logic Every µcode-updater must open the cpucontrol devfs node RDWR, open a firmware file, validate the FW file has a positive length, mmap it, etc. De-duplicate that identical logic between every individual platform. Also, constify references to the readonly-mapped firmware files while here. Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/cpucontrol/amd.c head/usr.sbin/cpucontrol/amd10h.c head/usr.sbin/cpucontrol/cpucontrol.c head/usr.sbin/cpucontrol/cpucontrol.h head/usr.sbin/cpucontrol/intel.c head/usr.sbin/cpucontrol/via.c Modified: head/usr.sbin/cpucontrol/amd.c ============================================================================== --- head/usr.sbin/cpucontrol/amd.c Wed Nov 14 00:12:04 2018 (r340420) +++ head/usr.sbin/cpucontrol/amd.c Wed Nov 14 00:21:49 2018 (r340421) @@ -73,16 +73,16 @@ amd_probe(int fd) } void -amd_update(const char *dev, const char *path) +amd_update(const struct ucode_update_params *params) { - int fd, devfd; + int devfd; unsigned int i; - struct stat st; - uint32_t *fw_image; - amd_fw_header_t *fw_header; + const char *dev, *path; + const uint32_t *fw_image; + const amd_fw_header_t *fw_header; uint32_t sum; uint32_t signature; - uint32_t *fw_data; + const uint32_t *fw_data; size_t fw_size; cpuctl_cpuid_args_t idargs = { .level = 1, /* Request signature. */ @@ -90,16 +90,14 @@ amd_update(const char *dev, const char *path) cpuctl_update_args_t args; int error; + dev = params->dev_path; + path = params->fw_path; + devfd = params->devfd; + fw_image = params->fwimage; + assert(path); assert(dev); - fd = -1; - fw_image = MAP_FAILED; - devfd = open(dev, O_RDWR); - if (devfd < 0) { - WARN(0, "could not open %s for writing", dev); - return; - } error = ioctl(devfd, CPUCTL_CPUID, &idargs); if (error < 0) { WARN(0, "ioctl()"); @@ -115,37 +113,18 @@ amd_update(const char *dev, const char *path) /* * Open the firmware file. */ - fd = open(path, O_RDONLY, 0); - if (fd < 0) { - WARN(0, "open(%s)", path); - goto fail; - } - error = fstat(fd, &st); - if (error != 0) { - WARN(0, "fstat(%s)", path); - goto fail; - } - if (st.st_size < 0 || (unsigned)st.st_size < sizeof(*fw_header)) { + if (params->fwsize < sizeof(*fw_header)) { WARNX(2, "file too short: %s", path); goto fail; } - /* - * mmap the whole image. - */ - fw_image = (uint32_t *)mmap(NULL, st.st_size, PROT_READ, - MAP_PRIVATE, fd, 0); - if (fw_image == MAP_FAILED) { - WARN(0, "mmap(%s)", path); - goto fail; - } - fw_header = (amd_fw_header_t *)fw_image; + fw_header = (const amd_fw_header_t *)fw_image; if ((fw_header->magic >> 8) != AMD_MAGIC) { WARNX(2, "%s is not a valid amd firmware: version mismatch", path); goto fail; } - fw_data = (uint32_t *)(fw_header + 1); - fw_size = (st.st_size - sizeof(*fw_header)) / sizeof(uint32_t); + fw_data = (const uint32_t *)(fw_header + 1); + fw_size = (params->fwsize - sizeof(*fw_header)) / sizeof(uint32_t); /* * Check the primary checksum. @@ -160,8 +139,8 @@ amd_update(const char *dev, const char *path) if (signature == fw_header->signature) { fprintf(stderr, "%s: updating cpu %s... ", path, dev); - args.data = fw_image; - args.size = st.st_size; + args.data = __DECONST(void *, fw_image); + args.size = params->fwsize; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { fprintf(stderr, "failed.\n"); @@ -172,12 +151,5 @@ amd_update(const char *dev, const char *path) } fail: - if (fd >= 0) - close(fd); - if (devfd >= 0) - close(devfd); - if (fw_image != MAP_FAILED) - if(munmap(fw_image, st.st_size) != 0) - warn("munmap(%s)", path); return; } Modified: head/usr.sbin/cpucontrol/amd10h.c ============================================================================== --- head/usr.sbin/cpucontrol/amd10h.c Wed Nov 14 00:12:04 2018 (r340420) +++ head/usr.sbin/cpucontrol/amd10h.c Wed Nov 14 00:21:49 2018 (r340421) @@ -88,9 +88,8 @@ amd10h_probe(int fd) * source code. */ void -amd10h_update(const char *dev, const char *path) +amd10h_update(const struct ucode_update_params *params) { - struct stat st; cpuctl_cpuid_args_t idargs; cpuctl_msr_args_t msrargs; cpuctl_update_args_t args; @@ -100,27 +99,27 @@ amd10h_update(const char *dev, const char *path) const section_header_t *section_header; const container_header_t *container_header; const uint8_t *fw_data; - uint8_t *fw_image; + const uint8_t *fw_image; + const char *dev, *path; size_t fw_size; size_t selected_size; uint32_t revision; uint32_t new_rev; uint32_t signature; uint16_t equiv_id; - int fd, devfd; + int devfd; unsigned int i; int error; + dev = params->dev_path; + path = params->fw_path; + devfd = params->devfd; + fw_image = params->fwimage; + fw_size = params->fwsize; + assert(path); assert(dev); - fd = -1; - fw_image = MAP_FAILED; - devfd = open(dev, O_RDWR); - if (devfd < 0) { - WARN(0, "could not open %s for writing", dev); - return; - } idargs.level = 1; error = ioctl(devfd, CPUCTL_CPUID, &idargs); if (error < 0) { @@ -149,33 +148,15 @@ amd10h_update(const char *dev, const char *path) * Open the firmware file. */ WARNX(1, "checking %s for update.", path); - fd = open(path, O_RDONLY, 0); - if (fd < 0) { - WARN(0, "open(%s)", path); - goto done; - } - error = fstat(fd, &st); - if (error != 0) { - WARN(0, "fstat(%s)", path); - goto done; - } - if (st.st_size < 0 || (size_t)st.st_size < + if (fw_size < (sizeof(*container_header) + sizeof(*section_header))) { WARNX(2, "file too short: %s", path); goto done; } - fw_size = st.st_size; /* * mmap the whole image. */ - fw_image = (uint8_t *)mmap(NULL, st.st_size, PROT_READ, - MAP_PRIVATE, fd, 0); - if (fw_image == MAP_FAILED) { - WARN(0, "mmap(%s)", path); - goto done; - } - fw_data = fw_image; container_header = (const container_header_t *)fw_data; if (container_header->magic != AMD_10H_MAGIC) { @@ -306,12 +287,5 @@ amd10h_update(const char *dev, const char *path) WARNX(0, "revision after update %#x", new_rev); done: - if (fd >= 0) - close(fd); - if (devfd >= 0) - close(devfd); - if (fw_image != MAP_FAILED) - if (munmap(fw_image, st.st_size) != 0) - warn("munmap(%s)", path); return; } Modified: head/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.c Wed Nov 14 00:12:04 2018 (r340420) +++ head/usr.sbin/cpucontrol/cpucontrol.c Wed Nov 14 00:21:49 2018 (r340421) @@ -34,18 +34,20 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include +#include #include #include #include #include -#include -#include #include -#include #include #include #include +#include #include #include #include @@ -74,16 +76,6 @@ int verbosity_level = 0; #define HIGH(val) (uint32_t)(((val) >> 32) & 0xffffffff) #define LOW(val) (uint32_t)((val) & 0xffffffff) -/* - * Macros for freeing SLISTs, probably must be in /sys/queue.h - */ -#define SLIST_FREE(head, field, freef) do { \ - typeof(SLIST_FIRST(head)) __elm0; \ - typeof(SLIST_FIRST(head)) __elm; \ - SLIST_FOREACH_SAFE(__elm, (head), field, __elm0) \ - (void)(freef)(__elm); \ -} while(0); - struct datadir { const char *path; SLIST_ENTRY(datadir) next; @@ -102,7 +94,6 @@ static struct ucode_handler { #define NHANDLERS (sizeof(handlers) / sizeof(*handlers)) static void usage(void); -static int isdir(const char *path); static int do_cpuid(const char *cmdarg, const char *dev); static int do_cpuid_count(const char *cmdarg, const char *dev); static int do_msr(const char *cmdarg, const char *dev); @@ -123,20 +114,6 @@ usage(void) } static int -isdir(const char *path) -{ - int error; - struct stat st; - - error = stat(path, &st); - if (error < 0) { - WARN(0, "stat(%s)", path); - return (error); - } - return (st.st_mode & S_IFDIR); -} - -static int do_cpuid(const char *cmdarg, const char *dev) { unsigned int level; @@ -361,16 +338,77 @@ do_eval_cpu_features(const char *dev) } static int +try_a_fw_image(const char *dev_path, int devfd, int fwdfd, const char *dpath, + const char *fname, struct ucode_handler *handler) +{ + struct ucode_update_params parm; + struct stat st; + char *fw_path; + void *fw_map; + int fwfd, rc; + + rc = 0; + fw_path = NULL; + fw_map = MAP_FAILED; + fwfd = openat(fwdfd, fname, O_RDONLY); + if (fwfd < 0) { + WARN(0, "openat(%s, %s)", dpath, fname); + goto out; + } + + rc = asprintf(&fw_path, "%s/%s", dpath, fname); + if (rc == -1) { + WARNX(0, "out of memory"); + rc = ENOMEM; + goto out; + } + + rc = fstat(fwfd, &st); + if (rc != 0) { + WARN(0, "fstat(%s)", fw_path); + rc = 0; + goto out; + } + if (st.st_size <= 0) { + WARN(0, "%s: empty", fw_path); + goto out; + } + + fw_map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fwfd, 0); + if (fw_map == MAP_FAILED) { + WARN(0, "mmap(%s)", fw_path); + goto out; + } + + + memset(&parm, 0, sizeof(parm)); + parm.devfd = devfd; + parm.fwimage = fw_map; + parm.fwsize = st.st_size; + parm.dev_path = dev_path; + parm.fw_path = fw_path; + + handler->update(&parm); + +out: + if (fw_map != MAP_FAILED) + munmap(fw_map, st.st_size); + free(fw_path); + if (fwfd >= 0) + close(fwfd); + return (rc); +} + +static int do_update(const char *dev) { - int fd; + int fd, fwdfd; unsigned int i; int error; struct ucode_handler *handler; struct datadir *dir; DIR *dirp; struct dirent *direntry; - char buf[MAXPATHLEN]; fd = open(dev, O_RDONLY); if (fd < 0) { @@ -379,7 +417,7 @@ do_update(const char *dev) } /* - * Find the appropriate handler for device. + * Find the appropriate handler for CPU. */ for (i = 0; i < NHANDLERS; i++) if (handlers[i].probe(fd) == 0) @@ -387,39 +425,54 @@ do_update(const char *dev) if (i < NHANDLERS) handler = &handlers[i]; else { - WARNX(0, "cannot find the appropriate handler for device"); + WARNX(0, "cannot find the appropriate handler for %s", dev); close(fd); return (1); } close(fd); + fd = open(dev, O_RDWR); + if (fd < 0) { + WARN(0, "error opening %s for writing", dev); + return (1); + } + /* * Process every image in specified data directories. */ SLIST_FOREACH(dir, &datadirs, next) { - dirp = opendir(dir->path); - if (dirp == NULL) { - WARNX(1, "skipping directory %s: not accessible", dir->path); + fwdfd = open(dir->path, O_RDONLY); + if (fwdfd < 0) { + WARN(1, "skipping directory %s: not accessible", dir->path); continue; } + dirp = fdopendir(fwdfd); + if (dirp == NULL) { + WARNX(0, "out of memory"); + close(fwdfd); + close(fd); + return (1); + } + while ((direntry = readdir(dirp)) != NULL) { if (direntry->d_namlen == 0) continue; - error = snprintf(buf, sizeof(buf), "%s/%s", dir->path, - direntry->d_name); - if ((unsigned)error >= sizeof(buf)) - WARNX(0, "skipping %s, buffer too short", - direntry->d_name); - if (isdir(buf) != 0) { - WARNX(2, "skipping %s: is a directory", buf); + if (direntry->d_type == DT_DIR) continue; + + error = try_a_fw_image(dev, fd, fwdfd, dir->path, + direntry->d_name, handler); + if (error != 0) { + closedir(dirp); + close(fd); + return (1); } - handler->update(dev, buf); } error = closedir(dirp); if (error != 0) WARN(0, "closedir(%s)", dir->path); } + close(fd); return (0); } @@ -441,6 +494,7 @@ datadir_add(const char *path) int main(int argc, char *argv[]) { + struct datadir *elm; int c, flags; const char *cmdarg; const char *dev; @@ -511,6 +565,9 @@ main(int argc, char *argv[]) default: usage(); /* Only one command can be selected. */ } - SLIST_FREE(&datadirs, next, free); + while ((elm = SLIST_FIRST(&datadirs)) != NULL) { + SLIST_REMOVE_HEAD(&datadirs, next); + free(elm); + } return (error == 0 ? 0 : 1); } Modified: head/usr.sbin/cpucontrol/cpucontrol.h ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.h Wed Nov 14 00:12:04 2018 (r340420) +++ head/usr.sbin/cpucontrol/cpucontrol.h Wed Nov 14 00:21:49 2018 (r340421) @@ -30,8 +30,17 @@ #ifndef CPUCONTROL_H #define CPUCONTROL_H +#include + typedef int ucode_probe_t(int fd); -typedef void ucode_update_t(const char *dev, const char *image); +struct ucode_update_params { + int devfd; /* RDWR handle to cpucontrol device */ + const void *fwimage; /* READ mapping of firmware image */ + size_t fwsize; /* Non-zero size of firmware image */ + const char *dev_path; /* cpucontrol device path, for logging */ + const char *fw_path; /* firmware image path, for logging */ +}; +typedef void ucode_update_t(const struct ucode_update_params *params); extern int verbosity_level; Modified: head/usr.sbin/cpucontrol/intel.c ============================================================================== --- head/usr.sbin/cpucontrol/intel.c Wed Nov 14 00:12:04 2018 (r340420) +++ head/usr.sbin/cpucontrol/intel.c Wed Nov 14 00:21:49 2018 (r340421) @@ -76,23 +76,23 @@ intel_probe(int fd) } void -intel_update(const char *dev, const char *path) +intel_update(const struct ucode_update_params *params) { - int fd, devfd; - struct stat st; - uint32_t *fw_image; + int devfd; + const char *dev, *path; + const uint32_t *fw_image; int have_ext_table; uint32_t sum; unsigned int i; size_t payload_size; - intel_fw_header_t *fw_header; - intel_cpu_signature_t *ext_table; - intel_ext_header_t *ext_header; + const intel_fw_header_t *fw_header; + const intel_cpu_signature_t *ext_table; + const intel_ext_header_t *ext_header; uint32_t sig, signature, flags; int32_t revision; ssize_t ext_size; size_t ext_table_size; - void *fw_data; + const void *fw_data; size_t data_size, total_size; cpuctl_msr_args_t msrargs = { .msr = MSR_BIOS_SIGN, @@ -104,18 +104,17 @@ intel_update(const char *dev, const char *path) cpuctl_update_args_t args; int error; + dev = params->dev_path; + path = params->fw_path; + devfd = params->devfd; + fw_image = params->fwimage; + assert(path); assert(dev); - fd = -1; - fw_image = MAP_FAILED; ext_table = NULL; ext_header = NULL; - devfd = open(dev, O_RDWR); - if (devfd < 0) { - WARN(0, "could not open %s for writing", dev); - return; - } + error = ioctl(devfd, CPUCTL_WRMSR, &msrargs); if (error < 0) { WARN(0, "ioctl(%s)", dev); @@ -151,31 +150,12 @@ intel_update(const char *dev, const char *path) /* * Open firmware image. */ - fd = open(path, O_RDONLY, 0); - if (fd < 0) { - WARN(0, "open(%s)", path); - goto fail; - } - error = fstat(fd, &st); - if (error != 0) { - WARN(0, "fstat(%s)", path); - goto fail; - } - if (st.st_size < 0 || (unsigned)st.st_size < sizeof(*fw_header)) { + if (params->fwsize < sizeof(*fw_header)) { WARNX(2, "file too short: %s", path); goto fail; } - /* - * mmap the whole image. - */ - fw_image = (uint32_t *)mmap(NULL, st.st_size, PROT_READ, - MAP_PRIVATE, fd, 0); - if (fw_image == MAP_FAILED) { - WARN(0, "mmap(%s)", path); - goto fail; - } - fw_header = (intel_fw_header_t *)fw_image; + fw_header = (const intel_fw_header_t *)fw_image; if (fw_header->header_version != INTEL_HEADER_VERSION || fw_header->loader_revision != INTEL_LOADER_REVISION) { WARNX(2, "%s is not a valid intel firmware: version mismatch", @@ -193,7 +173,7 @@ intel_update(const char *dev, const char *path) total_size = data_size + sizeof(*fw_header); else total_size = fw_header->total_size; - if (total_size > (unsigned)st.st_size || st.st_size < 0) { + if (total_size > params->fwsize) { WARNX(2, "file too short: %s", path); goto fail; } @@ -204,7 +184,7 @@ intel_update(const char *dev, const char *path) */ sum = 0; for (i = 0; i < (payload_size / sizeof(uint32_t)); i++) - sum += *((uint32_t *)fw_image + i); + sum += *((const uint32_t *)fw_image + i); if (sum != 0) { WARNX(2, "%s: update data checksum invalid", path); goto fail; @@ -217,9 +197,9 @@ intel_update(const char *dev, const char *path) have_ext_table = 0; if (ext_size > (signed)sizeof(*ext_header)) { - ext_header = - (intel_ext_header_t *)((char *)fw_image + payload_size); - ext_table = (intel_cpu_signature_t *)(ext_header + 1); + ext_header = (const intel_ext_header_t *) + ((const char *)fw_image + payload_size); + ext_table = (const intel_cpu_signature_t *)(ext_header + 1); /* * Check the extended table size. @@ -236,7 +216,7 @@ intel_update(const char *dev, const char *path) */ sum = 0; for (i = 0; i < (ext_table_size / sizeof(uint32_t)); i++) - sum += *((uint32_t *)ext_header + i); + sum += *((const uint32_t *)ext_header + i); if (sum != 0) { WARNX(2, "%s: extended signature table checksum invalid", @@ -273,7 +253,7 @@ matched: } fprintf(stderr, "%s: updating cpu %s from rev %#x to rev %#x... ", path, dev, revision, fw_header->revision); - args.data = fw_data; + args.data = __DECONST(void *, fw_data); args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { @@ -286,11 +266,5 @@ matched: fprintf(stderr, "done.\n"); fail: - if (fw_image != MAP_FAILED) - if (munmap(fw_image, st.st_size) != 0) - warn("munmap(%s)", path); - if (devfd >= 0) - close(devfd); - if (fd >= 0) - close(fd); + return; } Modified: head/usr.sbin/cpucontrol/via.c ============================================================================== --- head/usr.sbin/cpucontrol/via.c Wed Nov 14 00:12:04 2018 (r340420) +++ head/usr.sbin/cpucontrol/via.c Wed Nov 14 00:21:49 2018 (r340421) @@ -76,18 +76,18 @@ via_probe(int fd) } void -via_update(const char *dev, const char *path) +via_update(const struct ucode_update_params *params) { - int fd, devfd; - struct stat st; - uint32_t *fw_image; + int devfd; + const char *dev, *path; + const uint32_t *fw_image; uint32_t sum; unsigned int i; size_t payload_size; - via_fw_header_t *fw_header; + const via_fw_header_t *fw_header; uint32_t signature; int32_t revision; - void *fw_data; + const void *fw_data; size_t data_size, total_size; cpuctl_msr_args_t msrargs = { .msr = MSR_IA32_PLATFORM_ID, @@ -98,17 +98,14 @@ via_update(const char *dev, const char *path) cpuctl_update_args_t args; int error; + dev = params->dev_path; + path = params->fw_path; + devfd = params->devfd; + fw_image = params->fwimage; + assert(path); assert(dev); - fd = -1; - devfd = -1; - fw_image = MAP_FAILED; - devfd = open(dev, O_RDWR); - if (devfd < 0) { - WARN(0, "could not open %s for writing", dev); - return; - } error = ioctl(devfd, CPUCTL_CPUID, &idargs); if (error < 0) { WARN(0, "ioctl(%s)", dev); @@ -134,34 +131,13 @@ via_update(const char *dev, const char *path) WARNX(2, "found cpu type %#x family %#x model %#x stepping %#x.", (signature >> 12) & 0x03, (signature >> 8) & 0x0f, (signature >> 4) & 0x0f, (signature >> 0) & 0x0f); - /* - * Open firmware image. - */ - fd = open(path, O_RDONLY, 0); - if (fd < 0) { - WARN(0, "open(%s)", path); - goto fail; - } - error = fstat(fd, &st); - if (error != 0) { - WARN(0, "fstat(%s)", path); - goto fail; - } - if (st.st_size < 0 || (unsigned)st.st_size < sizeof(*fw_header)) { + + if (params->fwsize < sizeof(*fw_header)) { WARNX(2, "file too short: %s", path); goto fail; } - /* - * mmap the whole image. - */ - fw_image = (uint32_t *)mmap(NULL, st.st_size, PROT_READ, - MAP_PRIVATE, fd, 0); - if (fw_image == MAP_FAILED) { - WARN(0, "mmap(%s)", path); - goto fail; - } - fw_header = (via_fw_header_t *)fw_image; + fw_header = (const via_fw_header_t *)fw_image; if (fw_header->signature != VIA_HEADER_SIGNATURE || fw_header->loader_revision != VIA_LOADER_REVISION) { WARNX(2, "%s is not a valid via firmware: version mismatch", @@ -170,7 +146,7 @@ via_update(const char *dev, const char *path) } data_size = fw_header->data_size; total_size = fw_header->total_size; - if (total_size > (unsigned)st.st_size || st.st_size < 0) { + if (total_size > params->fwsize) { WARNX(2, "file too short: %s", path); goto fail; } @@ -181,7 +157,7 @@ via_update(const char *dev, const char *path) */ sum = 0; for (i = 0; i < (payload_size / sizeof(uint32_t)); i++) - sum += *((uint32_t *)fw_image + i); + sum += *((const uint32_t *)fw_image + i); if (sum != 0) { WARNX(2, "%s: update data checksum invalid", path); goto fail; @@ -202,25 +178,18 @@ via_update(const char *dev, const char *path) } fprintf(stderr, "%s: updating cpu %s from rev %#x to rev %#x... ", path, dev, revision, fw_header->revision); - args.data = fw_data; + args.data = __DECONST(void *, fw_data); args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { error = errno; - fprintf(stderr, "failed.\n"); + fprintf(stderr, "failed.\n"); errno = error; - WARN(0, "ioctl()"); - goto fail; + WARN(0, "ioctl()"); + goto fail; } fprintf(stderr, "done.\n"); fail: - if (fw_image != MAP_FAILED) - if (munmap(fw_image, st.st_size) != 0) - warn("munmap(%s)", path); - if (devfd >= 0) - close(devfd); - if (fd >= 0) - close(fd); return; } From owner-svn-src-head@freebsd.org Wed Nov 14 00:33:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49C561102418; Wed, 14 Nov 2018 00:33:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC714837B6; Wed, 14 Nov 2018 00:33:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADFF817C06; Wed, 14 Nov 2018 00:33:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE0X38P015876; Wed, 14 Nov 2018 00:33:03 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE0X3AS015875; Wed, 14 Nov 2018 00:33:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811140033.wAE0X3AS015875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 14 Nov 2018 00:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340423 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC714837B6 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 00:33:04 -0000 Author: glebius Date: Wed Nov 14 00:33:03 2018 New Revision: 340423 URL: https://svnweb.freebsd.org/changeset/base/340423 Log: Fix build on some architectures after r340413. On amd64 epoch.h appeared to be included implicitly. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Nov 14 00:21:52 2018 (r340422) +++ head/sys/kern/kern_thread.c Wed Nov 14 00:33:03 2018 (r340423) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Wed Nov 14 00:46:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E5711029B2; Wed, 14 Nov 2018 00:46:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9F4683E77; Wed, 14 Nov 2018 00:46:03 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AE5117DB3; Wed, 14 Nov 2018 00:46:03 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE0k3tH021223; Wed, 14 Nov 2018 00:46:03 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE0k3sD021218; Wed, 14 Nov 2018 00:46:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811140046.wAE0k3sD021218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 14 Nov 2018 00:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340424 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 340424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9F4683E77 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 00:46:04 -0000 Author: brooks Date: Wed Nov 14 00:46:02 2018 New Revision: 340424 URL: https://svnweb.freebsd.org/changeset/base/340424 Log: Use the main capabilities.conf for freebsd32. Allow the location of capabilities.conf to be configured. Also allow a per-abi syscall prefix to be configured with the abi_func_prefix syscalls.conf variable and check syscalls against entries in capabilities.conf with and without the prefix amended. Take advantage of these two features to allow use shared capabilities.conf between the default syscall vector and the freebsd32 compatability layer. We've been inconsistent about keeping the two in sync as evidenced by the bugs fixed in r340294. This eliminates that problem going forward. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17932 Deleted: head/sys/compat/freebsd32/capabilities.conf Modified: head/sys/compat/freebsd32/Makefile head/sys/compat/freebsd32/syscalls.conf head/sys/kern/makesyscalls.sh Modified: head/sys/compat/freebsd32/Makefile ============================================================================== --- head/sys/compat/freebsd32/Makefile Wed Nov 14 00:33:03 2018 (r340423) +++ head/sys/compat/freebsd32/Makefile Wed Nov 14 00:46:02 2018 (r340424) @@ -11,7 +11,7 @@ all: sysent: freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c : \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf capabilities.conf + ../../kern/makesyscalls.sh syscalls.master syscalls.conf ../../kern/capabilities.conf sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf clean: Modified: head/sys/compat/freebsd32/syscalls.conf ============================================================================== --- head/sys/compat/freebsd32/syscalls.conf Wed Nov 14 00:33:03 2018 (r340423) +++ head/sys/compat/freebsd32/syscalls.conf Wed Nov 14 00:46:02 2018 (r340424) @@ -9,3 +9,5 @@ syscallprefix="FREEBSD32_SYS_" switchname="freebsd32_sysent" namesname="freebsd32_syscallnames" systrace="freebsd32_systrace_args.c" +abi_func_prefix="freebsd32_" +capabilities_conf="../../kern/capabilities.conf" Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Wed Nov 14 00:33:03 2018 (r340423) +++ head/sys/kern/makesyscalls.sh Wed Nov 14 00:46:02 2018 (r340424) @@ -45,14 +45,8 @@ sysarg="sysarg.switch.$$" sysprotoend="sysprotoend.$$" systracetmp="systrace.$$" systraceret="systraceret.$$" +capabilities_conf="capabilities.conf" -if [ -r capabilities.conf ]; then - capenabled=`egrep -v '^#|^$' capabilities.conf` - capenabled=`echo $capenabled | sed 's/ /,/g'` -else - capenabled="" -fi - trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $syscompat11 $syscompat11dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0 touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $syscompat11 $syscompat11dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret @@ -67,6 +61,13 @@ if [ -n "$2" ]; then . $2 fi +if [ -r $capabilities_conf ]; then + capenabled=`egrep -v '^#|^$' $capabilities_conf` + capenabled=`echo $capenabled | sed 's/ /,/g'` +else + capenabled="" +fi + sed -e ' # FreeBSD ID, includes, comments, and blank lines /.*\$FreeBSD/b done_joining @@ -137,6 +138,7 @@ sed -e ' switchname = \"$switchname\" namesname = \"$namesname\" infile = \"$1\" + abi_func_prefix = \"$abi_func_prefix\" capenabled_string = \"$capenabled\" "' @@ -381,7 +383,8 @@ sed -e ' # from it. # for (cap in capenabled) { - if (funcname == capenabled[cap]) { + if (funcname == capenabled[cap] || + funcname == abi_func_prefix capenabled[cap]) { flags = "SYF_CAPENABLED"; break; } From owner-svn-src-head@freebsd.org Wed Nov 14 00:53:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A54A61102C69 for ; Wed, 14 Nov 2018 00:53:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x130.google.com (mail-it1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3B2484398 for ; Wed, 14 Nov 2018 00:53:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x130.google.com with SMTP id k206-v6so21396910ite.0 for ; Tue, 13 Nov 2018 16:53:15 -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=5JR8y7AUBGAkFSJ4dR4cQUyI5p43bR8FQ53Ctz9vW/8=; b=w547Z751wbqE+8H0VzH7pU7cVDkreHmRh8sdJI+97Aa+rvVS4W4OqJh+4lAKT9XLEk s+Vgc/aZYLNoOvHt6Wf6DeFyI9rkLBkXFOyWIae8yJcOE2OyQ5T+Fu6HMO2WMBPs4ZiB HON0ZvXN1e0PKvx+Rdz3I8L4iMtuvnknwGlCN2cbNAVocTKJ14mWyVu646+4bdBKiDVI sG3Wcj//T3S1iayEI/nCa+hKm4mSuavKOLLF/cx16w1/yR6Pe/Enk7j5xXBJwZM2Wj8M nIIMS+SjZG0HeVO2Z99kgu1REFUL0qe0iV8vi6veLr6G35nxy6JuDWBZjl2KjYQ/uxbl wlRA== 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=5JR8y7AUBGAkFSJ4dR4cQUyI5p43bR8FQ53Ctz9vW/8=; b=QRlUILf838XTE/I2S//O8p1Q3B+s9ESRkaJ4FSyxKkZolSktCXuy6nJ0vaINWabCPH 2IttaepU6F+RynaASQPw1SF9RqTImhCDss9OxcEkkGa9j9xQI+PGyExhbMMBUcIq6Rdd rNyBTD83jYOgLvse3XKUdvve0kbYX+zbHuuTZrSdHkIWfH/Niw+lvVg9hVEC2UUvg6Dt 2653FeetbFexfIVO6hYTA1oiBw57otUna0vxt9z8rP7oGiGMhvBNSWUDJFXKPQ5hJN58 TLzhtcKF5vk2zPiiLfqxZmO3u2XWJ3aYEUcTWx3o3V7nvSfnpYzChA87z4NgEfuzdjjD lyCA== X-Gm-Message-State: AGRZ1gJWZEShbpBZEiGyJfVLtcklWVSruau0tF8fiPo89jewDu/BuqEp i8H6NNqVpTlvZp9m1AH0E5AByYaibAanwAZsgZlV+A== X-Google-Smtp-Source: AJdET5ejjynyd9puBwajBUOl/CmnSBV2NH1zMHvWVes+h0+ykEthNjGTqjbZ29QkBtqYJQGnruxsG2bjoaA65pWiHqU= X-Received: by 2002:a02:31d:: with SMTP id y29-v6mr6921364jad.98.1542156794846; Tue, 13 Nov 2018 16:53:14 -0800 (PST) MIME-Version: 1.0 References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> <1533478958.9860.18.camel@freebsd.org> <20180806074507.E920@besplex.bde.org> <20180806095604.J860@besplex.bde.org> In-Reply-To: <20180806095604.J860@besplex.bde.org> From: Warner Losh Date: Tue, 13 Nov 2018 17:53:04 -0700 Message-ID: Subject: Re: svn commit: r337334 - head/lib/libc/sys To: Bruce Evans Cc: Ian Lepore , "Rodney W. Grimes" , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: D3B2484398 X-Spamd-Result: default: False [-5.48 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[0.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.49)[ip: (-7.71), ipnet: 2607:f8b0::/32(-2.77), asn: 15169(-1.86), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 00:53:16 -0000 On Sun, Aug 5, 2018 at 6:46 PM Bruce Evans wrote: > On Mon, 6 Aug 2018, Bruce Evans wrote: > > > ... > > I forgot about FAT times, and only remembered that utc_offset() was used > > for RTC drivers. I thought that utc_offset() is 0 unless something sets > > the timezone to nonzero or the RTC is on local time (wall_cmos_clock > case). > > However, since the kernel needs the timezone for FAT times, it must be > > known even if the RTC is on UTC time. Now I don't see how FAT times can > > even work unless the wall_cmos_clock. They are just the UTC minus > > utc_offset(), where utc_offset() is > > > > (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0)) > > > > Here wall_cmos_clock is only for managing the RTC offset. It must be 0 > > unless the RTC is on local time. But then either FAT times or RTC times > > must be broken except in the Greenwich meridian. Otherwise, > tz_minuteswest > > must be nonzero to ajust FAT times right, but this makes utc_offset() > > unusable for the RTC offset. > > I verified the brokenness: > - adjkerntz() normally leaves tz_minuteswest as 0. I verified that it does > this when there is a nonzero dst adjustment. dst adjustments are folded > into machdep.adjkerntz. > Right. adjkerntz() was supposed to completely replace tz_minuteswest. > - when wall_cmos_clock == 0, adjkerntz(8) does little or nothing, so all > adjustments are 0, so utc_offset() is 0, so FAT times are broken except > in the Greenwich meridian. > > The broken FAT times are not completely obvious, since getting and setting > them use the same wrong offset of 0, so the times appear to be correct when > displayed on FreeBSD. The are only obviously wrong when displayed on > another > system with non-broken FAT times, perhaps by rebooting to the other system > or by moving removable media to such a system. > > FAT times are used by other file systems. I checked this in FreeBSD-9 > so as to find axed file systems. The were used by smbfs, nwfs and msdosfs. > Now they are only used by msdosfs. I never liked de-deduplicating their > implementation into an over-engineered version with especially excessive > handling for leap years. Leap year handling is unimportant compared with > offset handling. > And tz_minuteswest won't fix this, except on a single user system. And it is duplicative of adjkerntz. > tz_minuteswest is used by compatibility code. It cannot usefully be > removed from the native version, since non-native syscalls use it and > non-native applications might use it. Of course, it must have a correct > value to work in compatibility. Its normal value of 0 breaks compatibility > code much like the bugs in utc_offset() breaks FAT time. It is used in the > following compatibility code: > - amd64 linux32 linux_gettimeofday(). Like native gettimeofday(). It also > reconstructs the dstflag part of the timezone struct. If linux drops > this, > then strict compatiility requires the support to depend on the linux > version. > - amd64 linux32 linux_settimeofday(). Like native settimeofday(). Has > invisible reference to tz_minuteswest hidden in assignment of timezones. > I only grepped for tz_minuteswest and only checked this indirect > reference. > - freebsd32 freebsd32_gettimeofday(). Similarly, except we control it, so > can avoid needing version checks by not dropping support. > - dev/tws/tws_services.h. This uses utc_offset() for FreeBSD-7 and later, > and its reference to tz_minuteswest is only explicit for older versions > where it open-codes utc_offset() with bug for bug compatibility except > for > adding style bugs. > - smbfs. This uses FAT times, and in nearby code it uses tzoff for the > offset > and has commented-out code with an open-coded fully-buggy utc_offset(). > - ibcs2 xenix_ftime(). This is similar to gettimeofday(). > All of these are somewhat irrelevant. If anybody really cares about these cases, they can fix them to use the adjkerntz() facility (or in the case of tws, just remove the bogus code). The question is, does anybody use this feature? It's been obsolete for 2 decades and we should just remove it. Warner From owner-svn-src-head@freebsd.org Wed Nov 14 03:42:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4B7F1107406; Wed, 14 Nov 2018 03:42:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4297A8A789; Wed, 14 Nov 2018 03:42:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23C9E19AE1; Wed, 14 Nov 2018 03:42:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE3geQl012898; Wed, 14 Nov 2018 03:42:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE3gd87012897; Wed, 14 Nov 2018 03:42:39 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811140342.wAE3gd87012897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Nov 2018 03:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340425 - in head/sys/dev: amdsmn amdtemp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 340425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4297A8A789 X-Spamd-Result: default: False [-103.09 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 03:42:40 -0000 Author: cem Date: Wed Nov 14 03:42:39 2018 New Revision: 340425 URL: https://svnweb.freebsd.org/changeset/base/340425 Log: amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridges As reported, tested, and patch supplied by Johannes. There may be future work to do to support multiple sensors, but for now, any sensor at all is a strict improvement for Ryzen 2 systems. PR: 228480 Submitted by: Johannes Lundberg (earlier version) Reported by: deischen@, Johannes, and numerous others MFC after: 3.72 days Modified: head/sys/dev/amdsmn/amdsmn.c head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdsmn/amdsmn.c ============================================================================== --- head/sys/dev/amdsmn/amdsmn.c Wed Nov 14 00:46:02 2018 (r340424) +++ head/sys/dev/amdsmn/amdsmn.c Wed Nov 14 03:42:39 2018 (r340425) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -53,14 +54,21 @@ __FBSDID("$FreeBSD$"); #define SMN_ADDR_REG 0x60 #define SMN_DATA_REG 0x64 +#define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 +#define PCI_DEVICE_ID_AMD_17H_ROOT_DF_F3 0x1463 +#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 +#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT_DF_F3 0x15eb + struct amdsmn_softc { struct mtx smn_lock; }; static struct pciid { - uint32_t device_id; + uint16_t amdsmn_vendorid; + uint16_t amdsmn_deviceid; } amdsmn_ids[] = { - { 0x14501022 }, + { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_ROOT }, + { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT }, }; /* @@ -89,18 +97,21 @@ static driver_t amdsmn_driver = { static devclass_t amdsmn_devclass; DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL); MODULE_VERSION(amdsmn, 1); -MODULE_PNP_INFO("W32:vendor/device", pci, amdsmn, amdsmn_ids, +MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdsmn, amdsmn_ids, nitems(amdsmn_ids)); static bool amdsmn_match(device_t parent) { - uint32_t devid; + uint16_t vendor, device; size_t i; - devid = pci_get_devid(parent); + vendor = pci_get_vendor(parent); + device = pci_get_device(parent); + for (i = 0; i < nitems(amdsmn_ids); i++) - if (amdsmn_ids[i].device_id == devid) + if (vendor == amdsmn_ids[i].amdsmn_vendorid && + device == amdsmn_ids[i].amdsmn_deviceid) return (true); return (false); } Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Wed Nov 14 00:46:02 2018 (r340424) +++ head/sys/dev/amdtemp/amdtemp.c Wed Nov 14 03:42:39 2018 (r340425) @@ -86,7 +86,10 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16 0x1533 #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_MISC17 0x141d -#define DEVICEID_AMD_HOSTB17H 0x1450 +#define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 +#define DEVICEID_AMD_HOSTB17H_DF_F3 0x1463 +#define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 +#define DEVICEID_AMD_HOSTB17H_M10H_DF_F3 0x15eb static struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -101,7 +104,8 @@ static struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC16 }, { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H }, { VENDORID_AMD, DEVICEID_AMD_MISC17 }, - { VENDORID_AMD, DEVICEID_AMD_HOSTB17H }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT }, }; /* From owner-svn-src-head@freebsd.org Wed Nov 14 04:50:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E10F611094F0; Wed, 14 Nov 2018 04:50:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 644058CFEF; Wed, 14 Nov 2018 04:50:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 403921A489; Wed, 14 Nov 2018 04:50:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE4oURd043646; Wed, 14 Nov 2018 04:50:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE4oUWW043645; Wed, 14 Nov 2018 04:50:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811140450.wAE4oUWW043645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Nov 2018 04:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340426 - head/sys/dev/amdtemp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/amdtemp X-SVN-Commit-Revision: 340426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 644058CFEF X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 04:50:31 -0000 Author: cem Date: Wed Nov 14 04:50:29 2018 New Revision: 340426 URL: https://svnweb.freebsd.org/changeset/base/340426 Log: amdtemp(4): Fix temperature reporting on AMD 2990WX Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255 OSRR, section 4.2.1. For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the range -49..206; i.e., subtract 49°C. Submitted by: gallatin@ Reported by: bcran@ Reviewed by: me (long ago) MFC after: 22.57 seconds Relnotes: yea Differential Revision: https://reviews.freebsd.org/D16855 Modified: head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Wed Nov 14 03:42:39 2018 (r340425) +++ head/sys/dev/amdtemp/amdtemp.c Wed Nov 14 04:50:29 2018 (r340426) @@ -115,8 +115,15 @@ static struct amdtemp_product { /* * Reported Temperature, Family 17h + * + * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of this register + * provide the current temp. bit 19, when clear, means the temp is reported in + * a range 0.."225C" (probable typo for 255C), and when set changes the range + * to -49..206C. */ -#define AMDTEMP_17H_CUR_TMP 0x59800 +#define AMDTEMP_17H_CUR_TMP 0x59800 +#define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) +#define AMDTEMP_17H_CUR_TMP_RANGE_OFF 490 /* * Thermaltrip Status Register (Family 0Fh only) @@ -595,13 +602,15 @@ static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) { struct amdtemp_softc *sc = device_get_softc(dev); - uint32_t temp; + uint32_t temp, val; int error; - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &temp); + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); KASSERT(error == 0, ("amdsmn_read")); - temp = ((temp >> 21) & 0x7ff) * 5 / 4; + temp = ((val >> 21) & 0x7ff) * 5 / 4; + if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) + temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF; temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; return (temp); From owner-svn-src-head@freebsd.org Wed Nov 14 08:45:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE177110EF56; Wed, 14 Nov 2018 08:45:49 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 781836D4FF; Wed, 14 Nov 2018 08:45:49 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 406331CB2B; Wed, 14 Nov 2018 08:45:49 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE8jnwM067730; Wed, 14 Nov 2018 08:45:49 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE8jmat067727; Wed, 14 Nov 2018 08:45:48 GMT (envelope-from se@FreeBSD.org) Message-Id: <201811140845.wAE8jmat067727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Wed, 14 Nov 2018 08:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340428 - in head: . usr.sbin/ctm/ctm X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head: . usr.sbin/ctm/ctm X-SVN-Commit-Revision: 340428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 781836D4FF X-Spamd-Result: default: False [-106.88 / 200.00]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 08:45:50 -0000 Author: se Date: Wed Nov 14 08:45:48 2018 New Revision: 340428 URL: https://svnweb.freebsd.org/changeset/base/340428 Log: Prepare move of ctm from base to a port (misc/ctm) by: - Adding a note to UPDATING - Adding a note to the history section of the manpage ctm.1 - Adding a message printed to STDERR to the ctm program This version is meant for release in FreeBSD-12.0 and should remain in FreeBSD-12 over its life-time. A follow-up commit will remove ctm from -CURRENT after the MFC to 12 has happened. Approved by: imp, rgrimes, bcr (man-page) MFC after: 3 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D17969 Modified: head/UPDATING head/usr.sbin/ctm/ctm/ctm.1 head/usr.sbin/ctm/ctm/ctm.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Nov 14 06:46:44 2018 (r340427) +++ head/UPDATING Wed Nov 14 08:45:48 2018 (r340428) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20181115: + The set of CTM commands (ctm, ctm_smail, ctm_rmail, ctm_dequeue) + has been converted to a port (misc/ctm) and will be removed from + FreeBSD-13. It is available as a package (ctm) for all supported + FreeBSD versions. + 20181110: The default newsyslog.conf(5) file has been changed to only include files in /etc/newsyslog.conf.d/ and /usr/local/etc/newsyslog.conf.d/ if Modified: head/usr.sbin/ctm/ctm/ctm.1 ============================================================================== --- head/usr.sbin/ctm/ctm/ctm.1 Wed Nov 14 06:46:44 2018 (r340427) +++ head/usr.sbin/ctm/ctm/ctm.1 Wed Nov 14 08:45:48 2018 (r340428) @@ -12,7 +12,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2016 +.Dd November 15, 2018 .Dt CTM 1 .Os .Sh NAME @@ -321,6 +321,12 @@ The .Nm command appeared in .Fx 2.1 . +.Pp +The latest +.Nm +code has been made available as a port (misc/ctm) in preparation of removal +from base in +.Fx 13.0 . .Sh AUTHORS .An -nosplit The CTM system has been designed and implemented by Modified: head/usr.sbin/ctm/ctm/ctm.c ============================================================================== --- head/usr.sbin/ctm/ctm/ctm.c Wed Nov 14 06:46:44 2018 (r340427) +++ head/usr.sbin/ctm/ctm/ctm.c Wed Nov 14 08:45:48 2018 (r340428) @@ -144,6 +144,9 @@ main(int argc, char **argv) warnx("%d errors during option processing",stat); return Exit_Pilot; } + fprintf(stderr, "CTM will be removed from FreeBSD-13, and will be " + "provided as a port (misc/ctm) or package (ctm).\n\n"); + stat = Exit_Done; argc -= optind; argv += optind; From owner-svn-src-head@freebsd.org Wed Nov 14 09:06:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AC52110FC12; Wed, 14 Nov 2018 09:06:17 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 993616E090; Wed, 14 Nov 2018 09:06:16 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A3581CE79; Wed, 14 Nov 2018 09:06:16 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAE96GBi078100; Wed, 14 Nov 2018 09:06:16 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAE96Fav078096; Wed, 14 Nov 2018 09:06:15 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811140906.wAE96Fav078096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 14 Nov 2018 09:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340429 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 340429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 993616E090 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 09:06:17 -0000 Author: yuripv Date: Wed Nov 14 09:06:15 2018 New Revision: 340429 URL: https://svnweb.freebsd.org/changeset/base/340429 Log: Fix WITHOUT_ICONV build after r340276. Reported by: olivier Approved by: kib (mentor, implicit) Modified: head/lib/libc/locale/c16rtomb.c head/lib/libc/locale/c32rtomb.c head/lib/libc/locale/mbrtoc16.c head/lib/libc/locale/mbrtoc32.c Modified: head/lib/libc/locale/c16rtomb.c ============================================================================== --- head/lib/libc/locale/c16rtomb.c Wed Nov 14 08:45:48 2018 (r340428) +++ head/lib/libc/locale/c16rtomb.c Wed Nov 14 09:06:15 2018 (r340429) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "xlocale_private.h" +#include "mblocal.h" typedef struct { char16_t lead_surrogate; @@ -47,7 +47,7 @@ c16rtomb_l(char * __restrict s, char16_t c16, mbstate_ FIX_LOCALE(locale); if (ps == NULL) - ps = &locale->c16rtomb; + ps = &(XLOCALE_CTYPE(locale)->c16rtomb); cs = (_Char16State *)ps; /* If s is a null pointer, the value of parameter c16 is ignored. */ Modified: head/lib/libc/locale/c32rtomb.c ============================================================================== --- head/lib/libc/locale/c32rtomb.c Wed Nov 14 08:45:48 2018 (r340428) +++ head/lib/libc/locale/c32rtomb.c Wed Nov 14 09:06:15 2018 (r340429) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include "xlocale_private.h" +#include "mblocal.h" size_t c32rtomb_l(char * __restrict s, char32_t c32, mbstate_t * __restrict ps, @@ -47,7 +47,7 @@ c32rtomb_l(char * __restrict s, char32_t c32, mbstate_ FIX_LOCALE(locale); if (ps == NULL) - ps = &locale->c32rtomb; + ps = &(XLOCALE_CTYPE(locale)->c32rtomb); /* Assume wchar_t uses UTF-32. */ return (wcrtomb_l(s, c32, ps, locale)); Modified: head/lib/libc/locale/mbrtoc16.c ============================================================================== --- head/lib/libc/locale/mbrtoc16.c Wed Nov 14 08:45:48 2018 (r340428) +++ head/lib/libc/locale/mbrtoc16.c Wed Nov 14 09:06:15 2018 (r340429) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include -#include "xlocale_private.h" +#include "mblocal.h" typedef struct { char16_t trail_surrogate; @@ -47,7 +47,7 @@ mbrtoc16_l(char16_t * __restrict pc16, const char * __ FIX_LOCALE(locale); if (ps == NULL) - ps = &locale->mbrtoc16; + ps = &(XLOCALE_CTYPE(locale)->mbrtoc16); cs = (_Char16State *)ps; /* Modified: head/lib/libc/locale/mbrtoc32.c ============================================================================== --- head/lib/libc/locale/mbrtoc32.c Wed Nov 14 08:45:48 2018 (r340428) +++ head/lib/libc/locale/mbrtoc32.c Wed Nov 14 09:06:15 2018 (r340429) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "xlocale_private.h" +#include "mblocal.h" size_t mbrtoc32_l(char32_t * __restrict pc32, const char * __restrict s, size_t n, @@ -40,7 +40,7 @@ mbrtoc32_l(char32_t * __restrict pc32, const char * __ FIX_LOCALE(locale); if (ps == NULL) - ps = &locale->mbrtoc32; + ps = &(XLOCALE_CTYPE(locale)->mbrtoc32); /* Assume wchar_t uses UTF-32. */ return (mbrtowc_l(pc32, s, n, ps, locale)); From owner-svn-src-head@freebsd.org Wed Nov 14 09:34:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B3CF112181C; Wed, 14 Nov 2018 09:34:04 +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 726496F39D; Wed, 14 Nov 2018 09:34:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id MrYegpEE0jQc4MrYgg2VUD; Wed, 14 Nov 2018 02:34:02 -0700 X-Authority-Analysis: v=2.3 cv=bOrH382Z c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=JHtHm7312UAA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=x3EF6gkvdQ5J0HSWIAUA:9 a=jPecpB6AOpLXUzJM:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A32381F1; Wed, 14 Nov 2018 01:34:00 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wAE9XxfJ003618; Wed, 14 Nov 2018 01:33:59 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id wAE9XxSL003613; Wed, 14 Nov 2018 01:33:59 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201811140933.wAE9XxSL003613@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 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: Gleb Smirnoff cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340413 - in head/sys: kern net sys In-Reply-To: Message from Gleb Smirnoff of "Tue, 13 Nov 2018 22:58:38 +0000." <201811132258.wADMwctL063533@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 14 Nov 2018 01:33:59 -0800 X-CMAE-Envelope: MS4wfLYxtUQst65UrwI7ayLtvBHhfEWkxe4UtwQF6S28HhtHSiW+z1GE/Om2tvfqfQbwW/Ro2yfOJOzRdbwLbhoakmpO6kPu12BNSyFalsn+CLE653q8L84b IdHapkNQROHvGnAqWHd/2AU0NZygQkT7DyHgcx3AoQ0LbYS948YpvxjiB32M6c9nwhOtfBZ0l0LpM2zwI4HHGihkB/RYSC2eG4q+rizpE9+YC2Kag/bB49tU JF/N1yugNHHJX2pXgejPhDUg/alcoGQ1UVLrCxVq3TNviOkG6PtIQdO21RKDs8ku X-Rspamd-Queue-Id: 726496F39D X-Spamd-Result: default: False [-3.65 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-1.01)[ipnet: 64.59.128.0/20(-2.75), asn: 6327(-2.20), country: CA(-0.10)]; RCVD_IN_DNSWL_LOW(-0.10)[9.134.59.64.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 09:34:04 -0000 In message <201811132258.wADMwctL063533@repo.freebsd.org>, Gleb Smirnoff writes : > Author: glebius > Date: Tue Nov 13 22:58:38 2018 > New Revision: 340413 > URL: https://svnweb.freebsd.org/changeset/base/340413 > > Log: > For compatibility KPI functions like if_addr_rlock() that used to have > mutexes but now are converted to epoch(9) use thread-private epoch_tracker. > Embedding tracker into ifnet(9) or ifnet derived structures creates a non > reentrable function, that will fail miserably if called simultaneously from > two different contexts. > A thread private tracker will provide a single tracker that would allow to > call these functions safely. It doesn't allow nested call, but this is not > expected from compatibility KPIs. > > Reviewed by: markj > > Modified: > head/sys/kern/kern_thread.c > head/sys/kern/subr_epoch.c > head/sys/net/if.c > head/sys/net/if_var.h > head/sys/sys/epoch.h > head/sys/sys/proc.h > > Modified: head/sys/kern/kern_thread.c > ============================================================================= > = > --- head/sys/kern/kern_thread.c Tue Nov 13 22:41:20 2018 (r34041 > 2) > +++ head/sys/kern/kern_thread.c Tue Nov 13 22:58:38 2018 (r34041 > 3) > @@ -272,6 +272,7 @@ thread_init(void *mem, int size, int flags) > td->td_rlqe = NULL; > EVENTHANDLER_DIRECT_INVOKE(thread_init, td); > umtx_thread_init(td); > + epoch_thread_init(td); > td->td_kstack = 0; > td->td_sel = NULL; > return (0); > @@ -291,6 +292,7 @@ thread_fini(void *mem, int size) > turnstile_free(td->td_turnstile); > sleepq_free(td->td_sleepqueue); > umtx_thread_fini(td); > + epoch_thread_fini(td); > seltdfini(td); > } > > > Modified: head/sys/kern/subr_epoch.c > ============================================================================= > = > --- head/sys/kern/subr_epoch.c Tue Nov 13 22:41:20 2018 (r34041 > 2) > +++ head/sys/kern/subr_epoch.c Tue Nov 13 22:58:38 2018 (r34041 > 3) > @@ -667,3 +667,17 @@ in_epoch(epoch_t epoch) > { > return (in_epoch_verbose(epoch, 0)); > } > + > +void > +epoch_thread_init(struct thread *td) > +{ > + > + td->td_et = malloc(sizeof(struct epoch_tracker), M_EPOCH, M_WAITOK); > +} > + > +void > +epoch_thread_fini(struct thread *td) > +{ > + > + free(td->td_et, M_EPOCH); > +} > > Modified: head/sys/net/if.c > ============================================================================= > = > --- head/sys/net/if.c Tue Nov 13 22:41:20 2018 (r340412) > +++ head/sys/net/if.c Tue Nov 13 22:58:38 2018 (r340413) > @@ -1767,35 +1767,29 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd) > void > if_addr_rlock(struct ifnet *ifp) > { > - MPASS(*(uint64_t *)&ifp->if_addr_et == 0); > - epoch_enter_preempt(net_epoch_preempt, &ifp->if_addr_et); > + > + epoch_enter_preempt(net_epoch_preempt, curthread->td_et); > } > > void > if_addr_runlock(struct ifnet *ifp) > { > - epoch_exit_preempt(net_epoch_preempt, &ifp->if_addr_et); > -#ifdef INVARIANTS > - bzero(&ifp->if_addr_et, sizeof(struct epoch_tracker)); > -#endif > + > + epoch_exit_preempt(net_epoch_preempt, curthread->td_et); > } > > void > if_maddr_rlock(if_t ifp) > { > > - MPASS(*(uint64_t *)&ifp->if_maddr_et == 0); > - epoch_enter_preempt(net_epoch_preempt, &ifp->if_maddr_et); > + epoch_enter_preempt(net_epoch_preempt, curthread->td_et); Hi Gleb, I was wrong. It's happening here, called from line 084 in if_sk.c. ~cy > } > > void > if_maddr_runlock(if_t ifp) > { > > - epoch_exit_preempt(net_epoch_preempt, &ifp->if_maddr_et); > -#ifdef INVARIANTS > - bzero(&ifp->if_maddr_et, sizeof(struct epoch_tracker)); > -#endif > + epoch_exit_preempt(net_epoch_preempt, curthread->td_et); > } > > /* > > Modified: head/sys/net/if_var.h > ============================================================================= > = > --- head/sys/net/if_var.h Tue Nov 13 22:41:20 2018 (r340412) > +++ head/sys/net/if_var.h Tue Nov 13 22:58:38 2018 (r340413) > @@ -381,8 +381,6 @@ struct ifnet { > */ > struct netdump_methods *if_netdump_methods; > struct epoch_context if_epoch_ctx; > - struct epoch_tracker if_addr_et; > - struct epoch_tracker if_maddr_et; > > /* > * Spare fields to be added before branching a stable branch, so > > Modified: head/sys/sys/epoch.h > ============================================================================= > = > --- head/sys/sys/epoch.h Tue Nov 13 22:41:20 2018 (r340412) > +++ head/sys/sys/epoch.h Tue Nov 13 22:58:38 2018 (r340413) > @@ -82,5 +82,8 @@ void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t > void epoch_enter(epoch_t epoch); > void epoch_exit(epoch_t epoch); > > +void epoch_thread_init(struct thread *); > +void epoch_thread_fini(struct thread *); > + > #endif /* _KERNEL */ > #endif /* _SYS_EPOCH_H_ */ > > Modified: head/sys/sys/proc.h > ============================================================================= > = > --- head/sys/sys/proc.h Tue Nov 13 22:41:20 2018 (r340412) > +++ head/sys/sys/proc.h Tue Nov 13 22:58:38 2018 (r340413) > @@ -193,6 +193,7 @@ struct trapframe; > struct turnstile; > struct vm_map; > struct vm_map_entry; > +struct epoch_tracker; > > /* > * XXX: Does this belong in resource.h or resourcevar.h instead? > @@ -360,6 +361,7 @@ struct thread { > int td_lastcpu; /* (t) Last cpu we were on. */ > int td_oncpu; /* (t) Which cpu we are on. */ > void *td_lkpi_task; /* LinuxKPI task struct pointer */ > + struct epoch_tracker *td_et; /* (k) compat KPI spare tracker */ > int td_pmcpend; > }; > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Nov 14 09:46:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A861121CE8; Wed, 14 Nov 2018 09:46:11 +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 D83F36F9E1; Wed, 14 Nov 2018 09:46:10 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id MrkIgpHmijQc4MrkJg2W5M; Wed, 14 Nov 2018 02:46:04 -0700 X-Authority-Analysis: v=2.3 cv=bOrH382Z c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=JHtHm7312UAA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=VxmjJ2MpAAAA:8 a=62JuAEmFnlXWmhZl7QoA:9 a=jPecpB6AOpLXUzJM:21 a=CjuIK1q_8ugA:10 a=xb5iFRXg2qMA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 4C5E5226; Wed, 14 Nov 2018 01:46:02 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wAE9k2rd004245; Wed, 14 Nov 2018 01:46:02 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id wAE9k1QM004242; Wed, 14 Nov 2018 01:46:01 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201811140946.wAE9k1QM004242@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 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: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340413 - in head/sys: kern net sys In-Reply-To: Message from Cy Schubert of "Wed, 14 Nov 2018 01:33:59 -0800." <201811140933.wAE9XxSL003613@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 14 Nov 2018 01:46:01 -0800 X-CMAE-Envelope: MS4wfIYwIlZcKmjlLzQ1X5RYClHMNKNLJ5qM18mBv/nIQ2mGGkNKCgfEy7DPXFmdceDyl+y5Muceo63n8zmI4mk9ls69fGQGEwigR7c7FZm8Fr4FMeNOZCrc UKVgtFat6dItdNcb+46MxinExi3t97X2HJyVBXoju4f6VktDq/5762bI4SESrEoULvNh2DW8eI8Xz/RGC5/9ZP84iD2NLFhQR9b6iqJlwtESEy0T4Yd7GMqF YqgvOhofbKxhqiQ/KvB/hPj6o7ZN/MBRrih+HOQ8hKhhOqqEoQ0uduo0fn/zNcIf X-Rspamd-Queue-Id: D83F36F9E1 X-Spamd-Result: default: False [-3.57 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.88)[-0.881,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-0.98)[ipnet: 64.59.128.0/20(-2.66), asn: 6327(-2.13), country: CA(-0.10)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 09:46:12 -0000 Sorry. This should have been a private email. But now that it's in the wild, if_sk.c calls epoch_enter_preempt() at line 84 which causes panic early in boot. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message <201811140933.wAE9XxSL003613@slippy.cwsent.com>, Cy Schubert writes: > In message <201811132258.wADMwctL063533@repo.freebsd.org>, Gleb > Smirnoff writes > : > > Author: glebius > > Date: Tue Nov 13 22:58:38 2018 > > New Revision: 340413 > > URL: https://svnweb.freebsd.org/changeset/base/340413 > > > > Log: > > For compatibility KPI functions like if_addr_rlock() that used to have > > mutexes but now are converted to epoch(9) use thread-private epoch_tracke > r. > > Embedding tracker into ifnet(9) or ifnet derived structures creates a non > > reentrable function, that will fail miserably if called simultaneously fr > om > > two different contexts. > > A thread private tracker will provide a single tracker that would allow t > o > > call these functions safely. It doesn't allow nested call, but this is no > t > > expected from compatibility KPIs. > > > > Reviewed by: markj > > > > Modified: > > head/sys/kern/kern_thread.c > > head/sys/kern/subr_epoch.c > > head/sys/net/if.c > > head/sys/net/if_var.h > > head/sys/sys/epoch.h > > head/sys/sys/proc.h > > > > Modified: head/sys/kern/kern_thread.c > > =========================================================================== > == > > = > > --- head/sys/kern/kern_thread.c Tue Nov 13 22:41:20 2018 (r34041 > > 2) > > +++ head/sys/kern/kern_thread.c Tue Nov 13 22:58:38 2018 (r34041 > > 3) > > @@ -272,6 +272,7 @@ thread_init(void *mem, int size, int flags) > > td->td_rlqe = NULL; > > EVENTHANDLER_DIRECT_INVOKE(thread_init, td); > > umtx_thread_init(td); > > + epoch_thread_init(td); > > td->td_kstack = 0; > > td->td_sel = NULL; > > return (0); > > @@ -291,6 +292,7 @@ thread_fini(void *mem, int size) > > turnstile_free(td->td_turnstile); > > sleepq_free(td->td_sleepqueue); > > umtx_thread_fini(td); > > + epoch_thread_fini(td); > > seltdfini(td); > > } > > > > > > Modified: head/sys/kern/subr_epoch.c > > =========================================================================== > == > > = > > --- head/sys/kern/subr_epoch.c Tue Nov 13 22:41:20 2018 (r34041 > > 2) > > +++ head/sys/kern/subr_epoch.c Tue Nov 13 22:58:38 2018 (r34041 > > 3) > > @@ -667,3 +667,17 @@ in_epoch(epoch_t epoch) > > { > > return (in_epoch_verbose(epoch, 0)); > > } > > + > > +void > > +epoch_thread_init(struct thread *td) > > +{ > > + > > + td->td_et = malloc(sizeof(struct epoch_tracker), M_EPOCH, M_WAITOK); > > +} > > + > > +void > > +epoch_thread_fini(struct thread *td) > > +{ > > + > > + free(td->td_et, M_EPOCH); > > +} > > > > Modified: head/sys/net/if.c > > =========================================================================== > == > > = > > --- head/sys/net/if.c Tue Nov 13 22:41:20 2018 (r340412) > > +++ head/sys/net/if.c Tue Nov 13 22:58:38 2018 (r340413) > > @@ -1767,35 +1767,29 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd > ) > > void > > if_addr_rlock(struct ifnet *ifp) > > { > > - MPASS(*(uint64_t *)&ifp->if_addr_et == 0); > > - epoch_enter_preempt(net_epoch_preempt, &ifp->if_addr_et); > > + > > + epoch_enter_preempt(net_epoch_preempt, curthread->td_et); > > } > > > > void > > if_addr_runlock(struct ifnet *ifp) > > { > > - epoch_exit_preempt(net_epoch_preempt, &ifp->if_addr_et); > > -#ifdef INVARIANTS > > - bzero(&ifp->if_addr_et, sizeof(struct epoch_tracker)); > > -#endif > > + > > + epoch_exit_preempt(net_epoch_preempt, curthread->td_et); > > } > > > > void > > if_maddr_rlock(if_t ifp) > > { > > > > - MPASS(*(uint64_t *)&ifp->if_maddr_et == 0); > > - epoch_enter_preempt(net_epoch_preempt, &ifp->if_maddr_et); > > + epoch_enter_preempt(net_epoch_preempt, curthread->td_et); > > > Hi Gleb, > > I was wrong. It's happening here, called from line 084 in if_sk.c. > > ~cy > > > } > > > > void > > if_maddr_runlock(if_t ifp) > > { > > > > - epoch_exit_preempt(net_epoch_preempt, &ifp->if_maddr_et); > > -#ifdef INVARIANTS > > - bzero(&ifp->if_maddr_et, sizeof(struct epoch_tracker)); > > -#endif > > + epoch_exit_preempt(net_epoch_preempt, curthread->td_et); > > } > > > > /* > > > > Modified: head/sys/net/if_var.h > > =========================================================================== > == > > = > > --- head/sys/net/if_var.h Tue Nov 13 22:41:20 2018 (r340412) > > +++ head/sys/net/if_var.h Tue Nov 13 22:58:38 2018 (r340413) > > @@ -381,8 +381,6 @@ struct ifnet { > > */ > > struct netdump_methods *if_netdump_methods; > > struct epoch_context if_epoch_ctx; > > - struct epoch_tracker if_addr_et; > > - struct epoch_tracker if_maddr_et; > > > > /* > > * Spare fields to be added before branching a stable branch, so > > > > Modified: head/sys/sys/epoch.h > > =========================================================================== > == > > = > > --- head/sys/sys/epoch.h Tue Nov 13 22:41:20 2018 (r340412) > > +++ head/sys/sys/epoch.h Tue Nov 13 22:58:38 2018 (r340413) > > @@ -82,5 +82,8 @@ void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t > > void epoch_enter(epoch_t epoch); > > void epoch_exit(epoch_t epoch); > > > > +void epoch_thread_init(struct thread *); > > +void epoch_thread_fini(struct thread *); > > + > > #endif /* _KERNEL */ > > #endif /* _SYS_EPOCH_H_ */ > > > > Modified: head/sys/sys/proc.h > > =========================================================================== > == > > = > > --- head/sys/sys/proc.h Tue Nov 13 22:41:20 2018 (r340412) > > +++ head/sys/sys/proc.h Tue Nov 13 22:58:38 2018 (r340413) > > @@ -193,6 +193,7 @@ struct trapframe; > > struct turnstile; > > struct vm_map; > > struct vm_map_entry; > > +struct epoch_tracker; > > > > /* > > * XXX: Does this belong in resource.h or resourcevar.h instead? > > @@ -360,6 +361,7 @@ struct thread { > > int td_lastcpu; /* (t) Last cpu we were on. */ > > int td_oncpu; /* (t) Which cpu we are on. */ > > void *td_lkpi_task; /* LinuxKPI task struct pointer */ > > + struct epoch_tracker *td_et; /* (k) compat KPI spare tracker */ > > int td_pmcpend; > > }; > > > > > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > From owner-svn-src-head@freebsd.org Wed Nov 14 10:07:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EAA61122712; Wed, 14 Nov 2018 10:07:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 CBAF570587; Wed, 14 Nov 2018 10:07:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [178.17.145.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2BB5D260293; Wed, 14 Nov 2018 11:07:11 +0100 (CET) Subject: Re: svn commit: r340413 - in head/sys: kern net sys To: Cy Schubert , Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811140933.wAE9XxSL003613@slippy.cwsent.com> From: Hans Petter Selasky Message-ID: <178c3d69-4a3b-49cb-dab4-f6f4139dfc1a@selasky.org> Date: Wed, 14 Nov 2018 11:06:38 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0.1 MIME-Version: 1.0 In-Reply-To: <201811140933.wAE9XxSL003613@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: CBAF570587 X-Spamd-Result: default: False [-6.75 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mail.turbocat.net]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-3.45)[ip: (-9.53), ipnet: 88.99.0.0/16(-4.85), asn: 24940(-2.84), country: DE(-0.01)]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 10:07:14 -0000 On 11/14/18 10:33 AM, Cy Schubert wrote: > + epoch_thread_init(td); Did you forget to call epoch_thread_init() for thread0 ? --HPS From owner-svn-src-head@freebsd.org Wed Nov 14 13:06:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C56761127696; Wed, 14 Nov 2018 13:06:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56C3975E8C; Wed, 14 Nov 2018 13:06:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 385091F5DA; Wed, 14 Nov 2018 13:06:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAED6nRp099654; Wed, 14 Nov 2018 13:06:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAED6n1J099653; Wed, 14 Nov 2018 13:06:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811141306.wAED6n1J099653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 14 Nov 2018 13:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340430 - head/contrib/jemalloc/src X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/contrib/jemalloc/src X-SVN-Commit-Revision: 340430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56C3975E8C X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 13:06:50 -0000 Author: trasz Date: Wed Nov 14 13:06:48 2018 New Revision: 340430 URL: https://svnweb.freebsd.org/changeset/base/340430 Log: Pick 57553c3b1a5592dc4c03f3c6831d9b794e523865 from upstream: Avoid touching all pages in extent_recycle for debug build. We may have a large number of pages with *zero set (since they are populated on demand). Only check the first page to avoid paging in all of them. This makes it easy to compare performance with and without 'retain:true'. Discussed with: jasone Obtained from: Qi Wang MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/contrib/jemalloc/src/extent.c Modified: head/contrib/jemalloc/src/extent.c ============================================================================== --- head/contrib/jemalloc/src/extent.c Wed Nov 14 09:06:15 2018 (r340429) +++ head/contrib/jemalloc/src/extent.c Wed Nov 14 13:06:48 2018 (r340430) @@ -1113,14 +1113,15 @@ extent_recycle(tsdn_t *tsdn, arena_t *arena, extent_ho if (*zero) { void *addr = extent_base_get(extent); - size_t size = extent_size_get(extent); if (!extent_zeroed_get(extent)) { + size_t size = extent_size_get(extent); if (pages_purge_forced(addr, size)) { memset(addr, 0, size); } } else if (config_debug) { size_t *p = (size_t *)(uintptr_t)addr; - for (size_t i = 0; i < size / sizeof(size_t); i++) { + /* Check the first page only. */ + for (size_t i = 0; i < PAGE / sizeof(size_t); i++) { assert(p[i] == 0); } } From owner-svn-src-head@freebsd.org Wed Nov 14 14:18:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE8E51129688; Wed, 14 Nov 2018 14:18:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC5CC78E50; Wed, 14 Nov 2018 14:18:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2BF3201C5; Wed, 14 Nov 2018 14:18:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEEIcdM035882; Wed, 14 Nov 2018 14:18:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEEIaA6035870; Wed, 14 Nov 2018 14:18:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811141418.wAEEIaA6035870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Nov 2018 14:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340431 - in head: lib/libc/sys share/man/man5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/cd9660 sys/fs/devfs sys/fs/ext2fs sys/fs/fdescfs sys/fs/msdosfs sys/fs/nandfs sys/fs... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/sys share/man/man5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/cd9660 sys/fs/devfs sys/fs/ext2fs sys/fs/fdescfs sys/fs/msdosfs sys/fs/nandfs sys/fs/pseudofs sys/fs/udf sys/... X-SVN-Commit-Revision: 340431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC5CC78E50 X-Spamd-Result: default: False [-103.06 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 14:18:40 -0000 Author: kib Date: Wed Nov 14 14:18:35 2018 New Revision: 340431 URL: https://svnweb.freebsd.org/changeset/base/340431 Log: Add d_off support for multiple filesystems. The d_off field has been added to the dirent structure recently. Currently filesystems don't support this feature. Support has been added and tested for zfs, ufs, ext2fs, fdescfs, msdosfs and unionfs. A stub implementation is available for cd9660, nandfs, udf and pseudofs but hasn't been tested. Motivation for this feature: our usecase is for a userspace nfs server (nfs-ganesha) with zfs. At the moment we cache direntry offsets by calling lseek once per entry, with this patch we can get the offset directly from getdirentries(2) calls which provides a significant speedup. Submitted by: Jack Halford Reviewed by: mckusick, pfg, rmacklem (previous versions) Sponsored by: Gandi.net MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17917 Modified: head/lib/libc/sys/getdirentries.2 head/share/man/man5/dir.5 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/lib/libc/sys/getdirentries.2 ============================================================================== --- head/lib/libc/sys/getdirentries.2 Wed Nov 14 13:06:48 2018 (r340430) +++ head/lib/libc/sys/getdirentries.2 Wed Nov 14 14:18:35 2018 (r340431) @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd May 28, 2017 +.Dd Nov 14, 2018 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -88,6 +88,11 @@ Files that are linked by hard links (see have the same .Fa d_fileno . The +.Fa d_off +field returns a cookie which can be used with +.Xr lseek 2 +to position the directory descriptor to the next entry. +The .Fa d_reclen entry is the length, in bytes, of the directory record. The @@ -140,8 +145,17 @@ a value returned in the location pointed to by .Fa basep .Po Fn getdirentries only -.Pc +.Pc , +a value returned in the +.Fa d_off +field, or zero. +.Sh IMPLEMENTATION NOTES +The +.Fa d_off +field is being used as a cookie to readdir for nfs servers. +These cookies can be cached and allow to read directory entries at a specific +offset on demand. .Sh RETURN VALUES If successful, the number of bytes actually transferred is returned. Otherwise, -1 is returned and the global variable Modified: head/share/man/man5/dir.5 ============================================================================== --- head/share/man/man5/dir.5 Wed Nov 14 13:06:48 2018 (r340430) +++ head/share/man/man5/dir.5 Wed Nov 14 14:18:35 2018 (r340431) @@ -28,7 +28,7 @@ .\" @(#)dir.5 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd June 20, 2018 +.Dd November 14, 2018 .Dt DIR 5 .Os .Sh NAME @@ -101,7 +101,7 @@ The directory entry format is defined in the file struct dirent { ino_t d_fileno; /* file number of entry */ - off_t d_off; /* directory offset of entry */ + off_t d_off; /* directory offset of the next entry */ __uint16_t d_reclen; /* length of this record */ __uint8_t d_type; /* file type, see below */ __uint8_t d_namlen; /* length of string in d_name */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Nov 14 14:18:35 2018 (r340431) @@ -1097,6 +1097,8 @@ zfsctl_snapdir_readdir(ap) strcpy(entry.d_name, snapname); entry.d_namlen = strlen(entry.d_name); entry.d_reclen = sizeof(entry); + /* NOTE: d_off is the offset for the *next* entry. */ + entry.d_off = cookie + dots_offset; error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -2529,8 +2529,8 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * */ eodp->ed_ino = objnum; eodp->ed_reclen = reclen; - /* NOTE: ed_off is the offset for the *next* entry */ - next = &(eodp->ed_off); + /* NOTE: ed_off is the offset for the *next* entry. */ + next = &eodp->ed_off; eodp->ed_eflags = zap.za_normalization_conflict ? ED_CASE_CONFLICT : 0; (void) strncpy(eodp->ed_name, zap.za_name, @@ -2543,6 +2543,8 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * odp->d_ino = objnum; odp->d_reclen = reclen; odp->d_namlen = strlen(zap.za_name); + /* NOTE: d_off is the offset for the *next* entry. */ + next = &odp->d_off; (void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); odp->d_type = type; odp = (dirent64_t *)((intptr_t)odp + reclen); @@ -2567,6 +2569,9 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * offset += 1; } + /* Fill the offset right after advancing the cursor. */ + if (next != NULL) + *next = offset; if (cooks != NULL) { *cooks++ = offset; ncooks--; Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/fs/cd9660/cd9660_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -576,6 +576,8 @@ cd9660_readdir(ap) entryoffsetinblock; idp->curroff += reclen; + /* NOTE: d_off is the offset of *next* entry. */ + idp->current.d_off = idp->curroff; switch (imp->iso_ftype) { case ISO_FTYPE_RRIP: Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/fs/devfs/devfs_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -1381,6 +1381,8 @@ devfs_readdir(struct vop_readdir_args *ap) if (dp->d_reclen > uio->uio_resid) break; dp->d_fileno = de->de_inode; + /* NOTE: d_off is the offset for the *next* entry. */ + dp->d_off = off + dp->d_reclen; if (off >= uio->uio_offset) { error = vfs_read_dirent(ap, dp, off); if (error) Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/fs/ext2fs/ext2_lookup.c Wed Nov 14 14:18:35 2018 (r340431) @@ -224,6 +224,8 @@ ext2_readdir(struct vop_readdir_args *ap) dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); dstdp.d_name[dstdp.d_namlen] = '\0'; + /* NOTE: d_off is the offset of the *next* entry. */ + dstdp.d_off = offset + dp->e2d_reclen; if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/fs/fdescfs/fdesc_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -574,6 +574,8 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_fileno = i + FD_DESC; break; } + /* NOTE: d_off is the offset of the *next* entry. */ + dp->d_off = UIO_MX * (i + 1); if (dp->d_namlen != 0) { /* * And ship to userland Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -1558,6 +1558,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) break; } dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); + /* NOTE: d_off is the offset of the *next* entry. */ + dirbuf.d_off = offset + sizeof(struct direntry); if (uio->uio_resid < dirbuf.d_reclen) goto out; error = uiomove(&dirbuf, dirbuf.d_reclen, uio); @@ -1681,6 +1683,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) mbnambuf_flush(&nb, &dirbuf); chksum = -1; dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); + /* NOTE: d_off is the offset of the *next* entry. */ + dirbuf.d_off = offset + sizeof(struct direntry); if (uio->uio_resid < dirbuf.d_reclen) { brelse(bp); goto out; Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/fs/nandfs/nandfs_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -1233,6 +1233,8 @@ nandfs_readdir(struct vop_readdir_args *ap) dirent.d_namlen = name_len; strncpy(dirent.d_name, ndirent->name, name_len); dirent.d_reclen = GENERIC_DIRSIZ(&dirent); + /* NOTE: d_off is the offset of the *next* entry. */ + dirent.d_off = diroffset + ndirent->rec_len; DPRINTF(READDIR, ("copying `%*.*s`\n", name_len, name_len, dirent.d_name)); } Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -830,6 +830,8 @@ pfs_readdir(struct vop_readdir_args *va) pfsent->entry.d_name[i] = pn->pn_name[i]; pfsent->entry.d_name[i] = 0; pfsent->entry.d_namlen = i; + /* NOTE: d_off is the offset of the *next* entry. */ + pfsent->entry.d_off = offset + PFS_DELEN; switch (pn->pn_type) { case pfstype_procdir: KASSERT(p != NULL, Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/fs/udf/udf_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -846,6 +846,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_name[1] = '\0'; dir.d_namlen = 1; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = 1; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 1); if (error) @@ -858,6 +859,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_name[2] = '\0'; dir.d_namlen = 2; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = 2; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 2); } else { @@ -867,6 +869,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = (fid->file_char & UDF_FILE_CHAR_DIR) ? DT_DIR : DT_UNKNOWN; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = ds->this_off; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Nov 14 13:06:48 2018 (r340430) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Nov 14 14:18:35 2018 (r340431) @@ -2218,6 +2218,8 @@ ufs_readdir(ap) dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); dstdp.d_name[dstdp.d_namlen] = '\0'; + /* NOTE: d_off is the offset of the *next* entry. */ + dstdp.d_off = offset + dp->d_reclen; if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; From owner-svn-src-head@freebsd.org Wed Nov 14 14:26:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23BD81129A16; Wed, 14 Nov 2018 14:26:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A04087930A; Wed, 14 Nov 2018 14:26:33 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8172620372; Wed, 14 Nov 2018 14:26:33 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEEQXdG041441; Wed, 14 Nov 2018 14:26:33 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEEQWoK041437; Wed, 14 Nov 2018 14:26:32 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201811141426.wAEEQWoK041437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 14 Nov 2018 14:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340432 - in head/sys/arm: conf mv X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: in head/sys/arm: conf mv X-SVN-Commit-Revision: 340432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A04087930A X-Spamd-Result: default: False [-102.90 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.79)[-0.793,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 14:26:34 -0000 Author: loos Date: Wed Nov 14 14:26:32 2018 New Revision: 340432 URL: https://svnweb.freebsd.org/changeset/base/340432 Log: Add the driver for the SPI controller on ARMADA38X. Tested on Clearfog (Pro) and SG-3100. Sponsored by: Rubicon Communications, LLC (Netgate) Added: head/sys/arm/mv/mv_spi.c (contents, props changed) Modified: head/sys/arm/conf/ARMADA38X head/sys/arm/conf/GENERIC head/sys/arm/mv/files.arm7 Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Wed Nov 14 14:18:35 2018 (r340431) +++ head/sys/arm/conf/ARMADA38X Wed Nov 14 14:26:32 2018 (r340432) @@ -76,6 +76,11 @@ device iic device iicbus device twsi +# SPI +device spibus +device spigen +device mv_spi + # Wireless NIC cards device wlan # 802.11 support device ath # Atheros NIC's Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Wed Nov 14 14:18:35 2018 (r340431) +++ head/sys/arm/conf/GENERIC Wed Nov 14 14:26:32 2018 (r340432) @@ -169,6 +169,7 @@ device aw_cir device spibus device spigen device bcm2835_spi +device mv_spi device ti_spi # ADC support Modified: head/sys/arm/mv/files.arm7 ============================================================================== --- head/sys/arm/mv/files.arm7 Wed Nov 14 14:18:35 2018 (r340431) +++ head/sys/arm/mv/files.arm7 Wed Nov 14 14:26:32 2018 (r340432) @@ -18,6 +18,7 @@ arm/mv/armada38x/armada38x_mp.c optional smp arm/mv/armada38x/pmsu.c standard arm/mv/armada38x/armada38x_rtc.c standard arm/mv/armada38x/armada38x_pl310.c optional pl310 +arm/mv/mv_spi.c optional mv_spi spibus dev/sdhci/sdhci_fdt.c optional sdhci arm/mv/rtc.c standard Added: head/sys/arm/mv/mv_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/mv_spi.c Wed Nov 14 14:26:32 2018 (r340432) @@ -0,0 +1,351 @@ +/*- + * Copyright (c) 2017-2018, Rubicon Communications, LLC (Netgate) + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "spibus_if.h" + +struct mv_spi_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource *sc_mem_res; + struct resource *sc_irq_res; + struct spi_command *sc_cmd; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + uint32_t sc_len; + uint32_t sc_read; + uint32_t sc_flags; + uint32_t sc_written; + void *sc_intrhand; +}; + +#define MV_SPI_BUSY 0x1 +#define MV_SPI_WRITE(_sc, _off, _val) \ + bus_space_write_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off), (_val)) +#define MV_SPI_READ(_sc, _off) \ + bus_space_read_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off)) +#define MV_SPI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define MV_SPI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) + +#define MV_SPI_CONTROL 0 +#define MV_SPI_CTRL_CS_SHIFT 2 +#define MV_SPI_CTRL_SMEMREADY (1 << 1) +#define MV_SPI_CTRL_CS_ACTIVE (1 << 0) +#define MV_SPI_CONF 0x4 +#define MV_SPI_CONF_BYTELEN (1 << 5) +#define MV_SPI_DATAOUT 0x8 +#define MV_SPI_DATAIN 0xc +#define MV_SPI_INTR_STAT 0x10 +#define MV_SPI_INTR_MASK 0x14 +#define MV_SPI_INTR_SMEMREADY (1 << 0) + +static struct ofw_compat_data compat_data[] = { + {"marvell,armada-380-spi", 1}, + {NULL, 0} +}; + +static void mv_spi_intr(void *); + +static int +mv_spi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Marvell SPI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +mv_spi_attach(device_t dev) +{ + struct mv_spi_softc *sc; + int rid; + uint32_t reg; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + /* Deactivate the bus - just in case... */ + reg = MV_SPI_READ(sc, MV_SPI_CONTROL); + MV_SPI_WRITE(sc, MV_SPI_CONTROL, reg & ~MV_SPI_CTRL_CS_ACTIVE); + + /* Disable the two bytes FIFO. */ + reg = MV_SPI_READ(sc, MV_SPI_CONF); + MV_SPI_WRITE(sc, MV_SPI_CONF, reg & ~MV_SPI_CONF_BYTELEN); + + /* Clear and disable interrupts. */ + MV_SPI_WRITE(sc, MV_SPI_INTR_MASK, 0); + MV_SPI_WRITE(sc, MV_SPI_INTR_STAT, 0); + + /* Hook up our interrupt handler. */ + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, mv_spi_intr, sc, &sc->sc_intrhand)) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot setup the interrupt handler\n"); + return (ENXIO); + } + + mtx_init(&sc->sc_mtx, "mv_spi", NULL, MTX_DEF); + + device_add_child(dev, "spibus", -1); + + /* Probe and attach the spibus when interrupts are available. */ + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + + return (0); +} + +static int +mv_spi_detach(device_t dev) +{ + struct mv_spi_softc *sc; + + bus_generic_detach(dev); + + sc = device_get_softc(dev); + mtx_destroy(&sc->sc_mtx); + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (0); +} + +static __inline void +mv_spi_rx_byte(struct mv_spi_softc *sc) +{ + struct spi_command *cmd; + uint32_t read; + uint8_t *p; + + cmd = sc->sc_cmd; + p = (uint8_t *)cmd->rx_cmd; + read = sc->sc_read++; + if (read >= cmd->rx_cmd_sz) { + p = (uint8_t *)cmd->rx_data; + read -= cmd->rx_cmd_sz; + } + p[read] = MV_SPI_READ(sc, MV_SPI_DATAIN) & 0xff; +} + +static __inline void +mv_spi_tx_byte(struct mv_spi_softc *sc) +{ + struct spi_command *cmd; + uint32_t written; + uint8_t *p; + + cmd = sc->sc_cmd; + p = (uint8_t *)cmd->tx_cmd; + written = sc->sc_written++; + if (written >= cmd->tx_cmd_sz) { + p = (uint8_t *)cmd->tx_data; + written -= cmd->tx_cmd_sz; + } + MV_SPI_WRITE(sc, MV_SPI_DATAOUT, p[written]); +} + +static void +mv_spi_intr(void *arg) +{ + struct mv_spi_softc *sc; + + sc = (struct mv_spi_softc *)arg; + MV_SPI_LOCK(sc); + + /* Filter stray interrupts. */ + if ((sc->sc_flags & MV_SPI_BUSY) == 0) { + MV_SPI_UNLOCK(sc); + return; + } + + /* RX */ + mv_spi_rx_byte(sc); + + /* TX */ + mv_spi_tx_byte(sc); + + /* Check for end of transfer. */ + if (sc->sc_written == sc->sc_len && sc->sc_read == sc->sc_len) + wakeup(sc->sc_dev); + + MV_SPI_UNLOCK(sc); +} + +static int +mv_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct mv_spi_softc *sc; + uint32_t cs, reg; + int resid, timeout; + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX/RX command sizes should be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX/RX data sizes should be equal")); + + /* Get the proper chip select for this child. */ + spibus_get_cs(child, &cs); + cs &= ~SPIBUS_CS_HIGH; + + sc = device_get_softc(dev); + MV_SPI_LOCK(sc); + + /* Wait until the controller is free. */ + while (sc->sc_flags & MV_SPI_BUSY) + mtx_sleep(dev, &sc->sc_mtx, 0, "mv_spi", 0); + + /* Now we have control over SPI controller. */ + sc->sc_flags = MV_SPI_BUSY; + + /* Save a pointer to the SPI command. */ + sc->sc_cmd = cmd; + sc->sc_read = 0; + sc->sc_written = 0; + sc->sc_len = cmd->tx_cmd_sz + cmd->tx_data_sz; + + MV_SPI_WRITE(sc, MV_SPI_CONTROL, cs << MV_SPI_CTRL_CS_SHIFT); + reg = MV_SPI_READ(sc, MV_SPI_CONTROL); + MV_SPI_WRITE(sc, MV_SPI_CONTROL, reg | MV_SPI_CTRL_CS_ACTIVE); + + while ((resid = sc->sc_len - sc->sc_written) > 0) { + + MV_SPI_WRITE(sc, MV_SPI_INTR_STAT, 0); + + /* + * Write to start the transmission and read the byte + * back when ready. + */ + mv_spi_tx_byte(sc); + timeout = 1000; + while (--timeout > 0) { + reg = MV_SPI_READ(sc, MV_SPI_CONTROL); + if (reg & MV_SPI_CTRL_SMEMREADY) + break; + DELAY(1); + } + if (timeout == 0) + break; + mv_spi_rx_byte(sc); + } + + /* Stop the controller. */ + reg = MV_SPI_READ(sc, MV_SPI_CONTROL); + MV_SPI_WRITE(sc, MV_SPI_CONTROL, reg & ~MV_SPI_CTRL_CS_ACTIVE); + MV_SPI_WRITE(sc, MV_SPI_INTR_MASK, 0); + MV_SPI_WRITE(sc, MV_SPI_INTR_STAT, 0); + + /* Release the controller and wakeup the next thread waiting for it. */ + sc->sc_flags = 0; + wakeup_one(dev); + MV_SPI_UNLOCK(sc); + + /* + * Check for transfer timeout. The SPI controller doesn't + * return errors. + */ + return ((timeout == 0) ? EIO : 0); +} + +static phandle_t +mv_spi_get_node(device_t bus, device_t dev) +{ + + return (ofw_bus_get_node(bus)); +} + +static device_method_t mv_spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mv_spi_probe), + DEVMETHOD(device_attach, mv_spi_attach), + DEVMETHOD(device_detach, mv_spi_detach), + + /* SPI interface */ + DEVMETHOD(spibus_transfer, mv_spi_transfer), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, mv_spi_get_node), + + DEVMETHOD_END +}; + +static devclass_t mv_spi_devclass; + +static driver_t mv_spi_driver = { + "spi", + mv_spi_methods, + sizeof(struct mv_spi_softc), +}; + +DRIVER_MODULE(mv_spi, simplebus, mv_spi_driver, mv_spi_devclass, 0, 0); From owner-svn-src-head@freebsd.org Wed Nov 14 15:15:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C27112ADEF; Wed, 14 Nov 2018 15:15:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFC337AD71; Wed, 14 Nov 2018 15:15:07 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FE9D20BC3; Wed, 14 Nov 2018 15:15:07 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEFF7Ka066833; Wed, 14 Nov 2018 15:15:07 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEFF7VN066832; Wed, 14 Nov 2018 15:15:07 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811141515.wAEFF7VN066832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 14 Nov 2018 15:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340433 - head/contrib/smbfs/smbutil X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/contrib/smbfs/smbutil X-SVN-Commit-Revision: 340433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFC337AD71 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 15:15:08 -0000 Author: 0mp (ports committer) Date: Wed Nov 14 15:15:07 2018 New Revision: 340433 URL: https://svnweb.freebsd.org/changeset/base/340433 Log: smbutil(1): Improve mdoc formatting. Also, make the path to the example configuration file absolute. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17985 Modified: head/contrib/smbfs/smbutil/smbutil.1 Modified: head/contrib/smbfs/smbutil/smbutil.1 ============================================================================== --- head/contrib/smbfs/smbutil/smbutil.1 Wed Nov 14 14:26:32 2018 (r340432) +++ head/contrib/smbfs/smbutil/smbutil.1 Wed Nov 14 15:15:07 2018 (r340433) @@ -1,5 +1,5 @@ .\" $Id: smbutil.1,v 1.5 2002/04/16 02:48:16 bp Exp $ -.Dd November 1, 2018 +.Dd November 14, 2018 .Dt SMBUTIL 1 .Os .Sh NAME @@ -9,7 +9,7 @@ .Nm .Op Fl hv .Ar command -.Op Fl Ar options +.Op Ar options .Op Ar args .Sh DESCRIPTION The @@ -50,8 +50,8 @@ Print usage information about List active connections and their parameters. .It Xo .Cm login -.Op Fl Ar connection_options -.No // Ns Ar user Ns @ Ns Ar server Ns Op / Ns Ar share +.Op Ar connection_options +.Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Op Cm \&/ Ns Ar share .Xc Login/attach to the specified .Ar server @@ -65,13 +65,13 @@ Thus, it is possible to login only once and then use other SMB commands without authentication procedure and additional connections. For the description of -.Fl Ar connection_options +.Ar connection_options refer to the .Xr mount_smbfs 8 -manpage (all uppercase options are connection options). +manual page (all uppercase options are connection options). .It Xo .Cm logout -.No // Ns Ar user Ns @ Ns Ar server Ns Op / Ns Ar share +.Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Op Cm \&/ Ns Ar share .Xc Logout/detach from the specified .Ar server @@ -97,8 +97,8 @@ The NetBIOS name server can be directly specified via option. .It Xo .Cm print -.Op Fl Ar connection_options -.No // Ns Ar user Ns @ Ns Ar server Ns / Ns Ar share +.Op Ar connection_options +.Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Op Cm \&/ Ns Ar share .Ar file .Xc Send the given @@ -107,12 +107,12 @@ to the specified queue on the remote server. If .Ar file is -.Pa - , +.Dq Pa - , then standard input will be used. .It Xo .Cm view -.Op Fl Ar connection_options -.No // Ns Ar user Ns @ Ns Ar server +.Op Ar connection_options +.Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server .Xc List resources available on the specified .Ar server @@ -124,7 +124,7 @@ for the user .It Pa ~/.nsmbrc Keeps description for each connection. See -.Pa ./examples/dot.nsmbrc +.Pa /usr/share/examples/smbfs/dot.nsmbrc for details. .El .Sh SEE ALSO From owner-svn-src-head@freebsd.org Wed Nov 14 15:16:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED73112AEDC; Wed, 14 Nov 2018 15:16:46 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 357C87AF24; Wed, 14 Nov 2018 15:16:46 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13B4D20BD3; Wed, 14 Nov 2018 15:16:46 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEFGjam066943; Wed, 14 Nov 2018 15:16:45 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEFGjfk066942; Wed, 14 Nov 2018 15:16:45 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811141516.wAEFGjfk066942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 14 Nov 2018 15:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340434 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 340434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 357C87AF24 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 15:16:46 -0000 Author: shurd Date: Wed Nov 14 15:16:45 2018 New Revision: 340434 URL: https://svnweb.freebsd.org/changeset/base/340434 Log: Fix leaks caused by ifc_nhwtxqs never being initialized r333502 removed initialization of ifc_nhwtxqs, and it's not clear there's a need to copy it into the struct iflib_ctx at all. Use ctx->ifc_sctx->isc_ntxqs instead. Further, iflib_stop() did not clear the last ring in the case where isc_nfl != isc_nrxqs (such as when IFLIB_HAS_RXCQ is set). Use ctx->ifc_sctx->isc_nrxqs here instead of isc_nfl. Reported by: pkelsey Reviewed by: pkelsey MFC after: 3 days Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17979 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Nov 14 15:15:07 2018 (r340433) +++ head/sys/net/iflib.c Wed Nov 14 15:16:45 2018 (r340434) @@ -175,8 +175,6 @@ struct iflib_ctx { struct sx ifc_ctx_sx; struct mtx ifc_state_mtx; - uint16_t ifc_nhwtxqs; - iflib_txq_t ifc_txqs; iflib_rxq_t ifc_rxqs; uint32_t ifc_if_flags; @@ -1771,6 +1769,7 @@ iflib_txq_setup(iflib_txq_t txq) { if_ctx_t ctx = txq->ift_ctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; iflib_dma_info_t di; int i; @@ -1784,11 +1783,11 @@ iflib_txq_setup(iflib_txq_t txq) txq->ift_pidx = txq->ift_cidx = txq->ift_npending = 0; txq->ift_size = scctx->isc_ntxd[txq->ift_br_offset]; - for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++) + for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bzero((void *)di->idi_vaddr, di->idi_size); IFDI_TXQ_SETUP(ctx, txq->ift_id); - for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++) + for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bus_dmamap_sync(di->idi_tag, di->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); @@ -2375,6 +2374,7 @@ iflib_stop(if_ctx_t ctx) iflib_txq_t txq = ctx->ifc_txqs; iflib_rxq_t rxq = ctx->ifc_rxqs; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; iflib_dma_info_t di; iflib_fl_t fl; int i, j; @@ -2408,13 +2408,13 @@ iflib_stop(if_ctx_t ctx) txq->ift_no_tx_dma_setup = txq->ift_txd_encap_efbig = txq->ift_map_failed = 0; txq->ift_pullups = 0; ifmp_ring_reset_stats(txq->ift_br); - for (j = 0, di = txq->ift_ifdi; j < ctx->ifc_nhwtxqs; j++, di++) + for (j = 0, di = txq->ift_ifdi; j < sctx->isc_ntxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); } for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - for (j = 0, di = rxq->ifr_ifdi; j < rxq->ifr_nfl; j++, di++) + for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) @@ -5516,11 +5516,12 @@ static void iflib_tx_structures_free(if_ctx_t ctx) { iflib_txq_t txq = ctx->ifc_txqs; + if_shared_ctx_t sctx = ctx->ifc_sctx; int i, j; for (i = 0; i < NTXQSETS(ctx); i++, txq++) { iflib_txq_destroy(txq); - for (j = 0; j < ctx->ifc_nhwtxqs; j++) + for (j = 0; j < sctx->isc_ntxqs; j++) iflib_dma_free(&txq->ift_ifdi[j]); } free(ctx->ifc_txqs, M_IFLIB); From owner-svn-src-head@freebsd.org Wed Nov 14 15:23:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A175E112B225; Wed, 14 Nov 2018 15:23:40 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DBFE7B467; Wed, 14 Nov 2018 15:23:40 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2E7720D6D; Wed, 14 Nov 2018 15:23:39 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEFNdYJ071820; Wed, 14 Nov 2018 15:23:39 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEFNdiH071819; Wed, 14 Nov 2018 15:23:39 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811141523.wAEFNdiH071819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 14 Nov 2018 15:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340435 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 340435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DBFE7B467 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 15:23:40 -0000 Author: shurd Date: Wed Nov 14 15:23:39 2018 New Revision: 340435 URL: https://svnweb.freebsd.org/changeset/base/340435 Log: Prevent POLA violation with TSO/CSUM offload Ensure that any time CSUM_IP_TSO or CSUM_IP6_TSO is set that the corresponding CSUM_IP6?_TCP / CSUM_IP flags are also set. Rather than requireing drivers to bake-in an understanding that TSO implies checksum offloads, make it explicit. This change requires us to move the IFLIB_NEED_ZERO_CSUM implementation to ensure it's zeroed for TSO. Reported by: Jacob Keller MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17801 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Nov 14 15:16:45 2018 (r340434) +++ head/sys/net/iflib.c Wed Nov 14 15:23:39 2018 (r340435) @@ -2973,9 +2973,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip->ip_p; pi->ipi_flags |= IPI_TX_IPV4; - if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) - ip->ip_sum = 0; - /* TCP checksum offload may require TCP header length */ if (IS_TX_OFFLOAD4(pi)) { if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { @@ -2992,6 +2989,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (IS_TSO4(pi)) { if (__predict_false(ip->ip_p != IPPROTO_TCP)) return (ENXIO); + /* + * TSO always requires hardware checksum offload. + */ + pi->ipi_csum_flags |= (CSUM_IP_TCP | CSUM_IP); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; @@ -3001,6 +3002,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, } } } + if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) + ip->ip_sum = 0; + break; } #endif @@ -3038,9 +3042,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) return (ENXIO); /* - * The corresponding flag is set by the stack in the IPv4 - * TSO case, but not in IPv6 (at least in FreeBSD 10.2). - * So, set it here because the rest of the flow requires it. + * TSO always requires hardware checksum offload. */ pi->ipi_csum_flags |= CSUM_IP6_TCP; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); From owner-svn-src-head@freebsd.org Wed Nov 14 15:26:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D81B0112B343; Wed, 14 Nov 2018 15:25:59 +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 6A13E7B673; Wed, 14 Nov 2018 15:25:58 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id Mx35gSZqOctraMx37gjcsy; Wed, 14 Nov 2018 08:25:51 -0700 X-Authority-Analysis: v=2.3 cv=Io3Pj43g c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=JHtHm7312UAA:10 a=ndaoGXS1AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=Fpq-x6Lq_2B51bxh6WgA:9 a=CjuIK1q_8ugA:10 a=mFeOnlTyF09QQMGr2mMI:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 04A1C9E1; Wed, 14 Nov 2018 07:25:47 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wAEFPklh080729; Wed, 14 Nov 2018 07:25:46 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id wAEFPj2s080726; Wed, 14 Nov 2018 07:25:46 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201811141525.wAEFPj2s080726@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 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: Hans Petter Selasky cc: Cy Schubert , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340413 - in head/sys: kern net sys In-Reply-To: Message from Hans Petter Selasky of "Wed, 14 Nov 2018 11:06:38 +0100." <178c3d69-4a3b-49cb-dab4-f6f4139dfc1a@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 14 Nov 2018 07:25:45 -0800 X-CMAE-Envelope: MS4wfMAv8j3vMA6mVkoanIVtI5tFOm1iOAWSchoYjskFfQS2hS8lnF5aRjQBoFACIhiaI68Zp+oBbILKxJjRDqPg3kXqePhlAtxK2j/1gnYzMI8eglnx1Dt1 FN9mPFNpi8dcFL/XLTp1+MFkByRtJ4aIOD5SAPQRAsrJMzoAJFb0Z8dHhudzfDGbJRDcFAy9Zwrt5hhlZOhEy9ziA7QFbJFGkO85LI1f+phP8aaW97ZHz3qu ZevO1s/kas1mmdNW4vYDSdZcwAd7jzdqZ1a5tKLM2i1oIvbG1GMJCqQf6BOh2tl7/DZfe1XCusdkB3NBEcYkfg== X-Rspamd-Queue-Id: 6A13E7B673 X-Spamd-Result: default: False [-3.54 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.88)[-0.883,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[138.136.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-0.95)[ipnet: 64.59.128.0/20(-2.58), asn: 6327(-2.07), country: CA(-0.10)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 15:26:00 -0000 In message <178c3d69-4a3b-49cb-dab4-f6f4139dfc1a@selasky.org>, Hans Petter Sela sky writes: > On 11/14/18 10:33 AM, Cy Schubert wrote: > > + epoch_thread_init(td); > > Did you forget to call epoch_thread_init() for thread0 ? > > --HPS It appears that interfaces that call if_maddr_rlock(ifp) have the issue. This suggests epoch_thread_init() for thread0 hasn't been called yet when interfaces (specifically those that call if_maddr_rlock()) attach. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Nov 14 15:39:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FC90112BAA3; Wed, 14 Nov 2018 15:39:50 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D903F7C12A; Wed, 14 Nov 2018 15:39:49 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9C8120F23; Wed, 14 Nov 2018 15:39:49 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEFdnnN077431; Wed, 14 Nov 2018 15:39:49 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEFdnKQ077428; Wed, 14 Nov 2018 15:39:49 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811141539.wAEFdnKQ077428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 14 Nov 2018 15:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340436 - in head/sys/dev: netmap virtio/network X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys/dev: netmap virtio/network X-SVN-Commit-Revision: 340436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D903F7C12A X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 15:39:50 -0000 Author: vmaffione Date: Wed Nov 14 15:39:48 2018 New Revision: 340436 URL: https://svnweb.freebsd.org/changeset/base/340436 Log: vtnet: fix netmap support netmap(4) support for vtnet(4) was incomplete and had multiple bugs. This commit fixes those bugs to bring netmap on vtnet in a functional state. Changelist: - handle errors returned by virtqueue_enqueue() properly (they were previously ignored) - make sure netmap XOR rest of the kernel access each virtqueue. - compute the number of netmap slots for TX and RX separately, according to whether indirect descriptors are used or not for a given virtqueue. - make sure sglist are freed according to their type (mbufs or netmap buffers) - add support for mulitiqueue and netmap host (aka sw) rings. - intercept VQ interrupts directly instead of intercepting them in txq_eof and rxq_eof. This simplifies the code and makes it easier to make sure taskqueues are not running for a VQ while it is in netmap mode. - implement vntet_netmap_config() to cope with changes in the number of queues. Reviewed by: bryanv Approved by: gnn (mentor) MFC after: 3 days Sponsored by: Sunny Valley Networks Differential Revision: https://reviews.freebsd.org/D17916 Modified: head/sys/dev/netmap/if_vtnet_netmap.h head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- head/sys/dev/netmap/if_vtnet_netmap.h Wed Nov 14 15:23:39 2018 (r340435) +++ head/sys/dev/netmap/if_vtnet_netmap.h Wed Nov 14 15:39:48 2018 (r340436) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Vincenzo Maffione, Luigi Rizzo. All rights reserved. + * Copyright (C) 2014-2018 Vincenzo Maffione, Luigi Rizzo. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,74 +33,148 @@ #include /* vtophys ? */ #include +/* + * Return 1 if the queue identified by 't' and 'idx' is in netmap mode. + */ +static int +vtnet_netmap_queue_on(struct vtnet_softc *sc, enum txrx t, int idx) +{ + struct netmap_adapter *na = NA(sc->vtnet_ifp); -#define SOFTC_T vtnet_softc + if (!nm_native_on(na)) + return 0; -/* Free all the unused buffer in all the RX virtqueues. - * This function is called when entering and exiting netmap mode. - * - buffers queued by the virtio driver return skbuf/mbuf pointer - * and need to be freed; - * - buffers queued by netmap return the txq/rxq, and do not need work - */ + if (t == NR_RX) + return !!(idx < na->num_rx_rings && + na->rx_rings[idx]->nr_mode == NKR_NETMAP_ON); + + return !!(idx < na->num_tx_rings && + na->tx_rings[idx]->nr_mode == NKR_NETMAP_ON); +} + static void -vtnet_netmap_free_bufs(struct SOFTC_T* sc) +vtnet_free_used(struct virtqueue *vq, int netmap_bufs, enum txrx t, int idx) { - int i, nmb = 0, n = 0, last; + void *cookie; + int deq = 0; - for (i = 0; i < sc->vtnet_max_vq_pairs; i++) { - struct vtnet_rxq *rxq = &sc->vtnet_rxqs[i]; - struct virtqueue *vq; - struct mbuf *m; - struct vtnet_txq *txq = &sc->vtnet_txqs[i]; - struct vtnet_tx_header *txhdr; + while ((cookie = virtqueue_dequeue(vq, NULL)) != NULL) { + if (netmap_bufs) { + /* These are netmap buffers: there is nothing to do. */ + } else { + /* These are mbufs that we need to free. */ + struct mbuf *m; - last = 0; - vq = rxq->vtnrx_vq; - while ((m = virtqueue_drain(vq, &last)) != NULL) { - n++; - if (m != (void *)rxq) + if (t == NR_TX) { + struct vtnet_tx_header *txhdr = cookie; + m = txhdr->vth_mbuf; m_freem(m); - else - nmb++; - } - - last = 0; - vq = txq->vtntx_vq; - while ((txhdr = virtqueue_drain(vq, &last)) != NULL) { - n++; - if (txhdr != (void *)txq) { - m_freem(txhdr->vth_mbuf); uma_zfree(vtnet_tx_header_zone, txhdr); - } else - nmb++; + } else { + m = cookie; + m_freem(m); + } } + deq++; } - D("freed %d mbufs, %d netmap bufs on %d queues", - n - nmb, nmb, i); + + if (deq) + nm_prinf("%d sgs dequeued from %s-%d (netmap=%d)\n", + deq, nm_txrx2str(t), idx, netmap_bufs); } /* Register and unregister. */ static int -vtnet_netmap_reg(struct netmap_adapter *na, int onoff) +vtnet_netmap_reg(struct netmap_adapter *na, int state) { - struct ifnet *ifp = na->ifp; - struct SOFTC_T *sc = ifp->if_softc; + struct ifnet *ifp = na->ifp; + struct vtnet_softc *sc = ifp->if_softc; + int success; + enum txrx t; + int i; + /* Drain the taskqueues to make sure that there are no worker threads + * accessing the virtqueues. */ + vtnet_drain_taskqueues(sc); + VTNET_CORE_LOCK(sc); - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - /* enable or disable flags and callbacks in na and ifp */ - if (onoff) { + + /* We need nm_netmap_on() to return true when called by + * vtnet_init_locked() below. */ + if (state) nm_set_native_flags(na); + + /* We need to trigger a device reset in order to unexpose guest buffers + * published to the host. */ + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + /* Get pending used buffers. The way they are freed depends on whether + * they are netmap buffer or they are mbufs. We can tell apart the two + * cases by looking at kring->nr_mode, before this is possibly updated + * in the loop below. */ + for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { + struct vtnet_txq *txq = &sc->vtnet_txqs[i]; + struct vtnet_rxq *rxq = &sc->vtnet_rxqs[i]; + struct netmap_kring *kring; + + VTNET_TXQ_LOCK(txq); + kring = NMR(na, NR_TX)[i]; + vtnet_free_used(txq->vtntx_vq, + kring->nr_mode == NKR_NETMAP_ON, NR_TX, i); + VTNET_TXQ_UNLOCK(txq); + + VTNET_RXQ_LOCK(rxq); + kring = NMR(na, NR_RX)[i]; + vtnet_free_used(rxq->vtnrx_vq, + kring->nr_mode == NKR_NETMAP_ON, NR_RX, i); + VTNET_RXQ_UNLOCK(rxq); + } + vtnet_init_locked(sc); + success = (ifp->if_drv_flags & IFF_DRV_RUNNING) ? 0 : ENXIO; + + if (state) { + for_rx_tx(t) { + /* Hardware rings. */ + for (i = 0; i < nma_get_nrings(na, t); i++) { + struct netmap_kring *kring = NMR(na, t)[i]; + + if (nm_kring_pending_on(kring)) + kring->nr_mode = NKR_NETMAP_ON; + } + + /* Host rings. */ + for (i = 0; i < nma_get_host_nrings(na, t); i++) { + struct netmap_kring *kring = + NMR(na, t)[nma_get_nrings(na, t) + i]; + + if (nm_kring_pending_on(kring)) + kring->nr_mode = NKR_NETMAP_ON; + } + } } else { nm_clear_native_flags(na); + for_rx_tx(t) { + /* Hardware rings. */ + for (i = 0; i < nma_get_nrings(na, t); i++) { + struct netmap_kring *kring = NMR(na, t)[i]; + + if (nm_kring_pending_off(kring)) + kring->nr_mode = NKR_NETMAP_OFF; + } + + /* Host rings. */ + for (i = 0; i < nma_get_host_nrings(na, t); i++) { + struct netmap_kring *kring = + NMR(na, t)[nma_get_nrings(na, t) + i]; + + if (nm_kring_pending_off(kring)) + kring->nr_mode = NKR_NETMAP_OFF; + } + } } - /* drain queues so netmap and native drivers - * do not interfere with each other - */ - vtnet_netmap_free_bufs(sc); - vtnet_init_locked(sc); /* also enable intr */ - VTNET_CORE_UNLOCK(sc); - return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); + + VTNET_CORE_UNLOCK(sc); + + return success; } @@ -109,20 +183,19 @@ static int vtnet_netmap_txsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + struct ifnet *ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int ring_nr = kring->ring_id; u_int nm_i; /* index into the netmap ring */ - u_int nic_i; /* index into the NIC ring */ - u_int n; u_int const lim = kring->nkr_num_slots - 1; u_int const head = kring->rhead; /* device-specific */ - struct SOFTC_T *sc = ifp->if_softc; + struct vtnet_softc *sc = ifp->if_softc; struct vtnet_txq *txq = &sc->vtnet_txqs[ring_nr]; struct virtqueue *vq = txq->vtntx_vq; int interrupts = !(kring->nr_kflags & NKR_NOINTR); + u_int n; /* * First part: process new packets to send. @@ -133,15 +206,13 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl if (nm_i != head) { /* we have new packets to send */ struct sglist *sg = txq->vtntx_sg; - nic_i = netmap_idx_k2n(kring, nm_i); - for (n = 0; nm_i != head; n++) { + for (; nm_i != head; nm_i = nm_next(nm_i, lim)) { /* we use an empty header here */ - static struct virtio_net_hdr_mrg_rxbuf hdr; struct netmap_slot *slot = &ring->slot[nm_i]; u_int len = slot->len; uint64_t paddr; void *addr = PNMB(na, slot, &paddr); - int err; + int err; NM_CHECK_ADDR_LEN(na, addr, len); @@ -150,88 +221,63 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl * and kick the hypervisor (if necessary). */ sglist_reset(sg); // cheap - // if vtnet_hdr_size > 0 ... - err = sglist_append(sg, &hdr, sc->vtnet_hdr_size); - // XXX later, support multi segment - err = sglist_append_phys(sg, paddr, len); - /* use na as the cookie */ - err = virtqueue_enqueue(vq, txq, sg, sg->sg_nseg, 0); - if (unlikely(err < 0)) { - D("virtqueue_enqueue failed"); - break; - } - - nm_i = nm_next(nm_i, lim); - nic_i = nm_next(nic_i, lim); + err = sglist_append(sg, &txq->vtntx_shrhdr, sc->vtnet_hdr_size); + err |= sglist_append_phys(sg, paddr, len); + KASSERT(err == 0, ("%s: cannot append to sglist %d", + __func__, err)); + err = virtqueue_enqueue(vq, /*cookie=*/txq, sg, + /*readable=*/sg->sg_nseg, + /*writeable=*/0); + if (unlikely(err)) { + if (err != ENOSPC) + nm_prerr("virtqueue_enqueue(%s) failed: %d\n", + kring->name, err); + break; + } } - /* Update hwcur depending on where we stopped. */ - kring->nr_hwcur = nm_i; /* note we migth break early */ - /* No more free TX slots? Ask the hypervisor for notifications, - * possibly only when a considerable amount of work has been - * done. - */ - ND(3,"sent %d packets, hwcur %d", n, nm_i); - virtqueue_disable_intr(vq); virtqueue_notify(vq); - } else { - if (ring->head != ring->tail) - ND(5, "pure notify ? head %d tail %d nused %d %d", - ring->head, ring->tail, virtqueue_nused(vq), - (virtqueue_dump(vq), 1)); - virtqueue_notify(vq); - if (interrupts) { - virtqueue_enable_intr(vq); // like postpone with 0 - } + + /* Update hwcur depending on where we stopped. */ + kring->nr_hwcur = nm_i; /* note we migth break early */ } - - /* Free used slots. We only consider our own used buffers, recognized - * by the token we passed to virtqueue_add_outbuf. + /* Free used slots. We only consider our own used buffers, recognized + * by the token we passed to virtqueue_enqueue. */ - n = 0; - for (;;) { - struct vtnet_tx_header *txhdr = virtqueue_dequeue(vq, NULL); - if (txhdr == NULL) - break; - if (likely(txhdr == (void *)txq)) { - n++; - if (virtqueue_nused(vq) < 32) { // XXX slow release - break; - } - } else { /* leftover from previous transmission */ - m_freem(txhdr->vth_mbuf); - uma_zfree(vtnet_tx_header_zone, txhdr); - } - } - if (n) { + n = 0; + for (;;) { + void *token = virtqueue_dequeue(vq, NULL); + if (token == NULL) + break; + if (unlikely(token != (void *)txq)) + nm_prerr("BUG: TX token mismatch\n"); + else + n++; + } + if (n > 0) { kring->nr_hwtail += n; if (kring->nr_hwtail > lim) kring->nr_hwtail -= lim + 1; } - if (nm_i != kring->nr_hwtail /* && vtnet_txq_below_threshold(txq) == 0*/) { - ND(3, "disable intr, hwcur %d", nm_i); - virtqueue_disable_intr(vq); - } else if (interrupts) { - ND(3, "enable intr, hwcur %d", nm_i); - virtqueue_postpone_intr(vq, VQ_POSTPONE_SHORT); - } - return 0; + if (interrupts && virtqueue_nfree(vq) < 32) + virtqueue_postpone_intr(vq, VQ_POSTPONE_LONG); + + return 0; } static int -vtnet_refill_rxq(struct netmap_kring *kring, u_int nm_i, u_int head) +vtnet_netmap_kring_refill(struct netmap_kring *kring, u_int nm_i, u_int head) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + struct ifnet *ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int ring_nr = kring->ring_id; u_int const lim = kring->nkr_num_slots - 1; - u_int n; /* device-specific */ - struct SOFTC_T *sc = ifp->if_softc; + struct vtnet_softc *sc = ifp->if_softc; struct vtnet_rxq *rxq = &sc->vtnet_rxqs[ring_nr]; struct virtqueue *vq = rxq->vtnrx_vq; @@ -239,12 +285,11 @@ vtnet_refill_rxq(struct netmap_kring *kring, u_int nm_ struct sglist_seg ss[2]; struct sglist sg = { ss, 0, 0, 2 }; - for (n = 0; nm_i != head; n++) { - static struct virtio_net_hdr_mrg_rxbuf hdr; + for (; nm_i != head; nm_i = nm_next(nm_i, lim)) { struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; void *addr = PNMB(na, slot, &paddr); - int err = 0; + int err; if (addr == NETMAP_BUF_BASE(na)) { /* bad buf */ if (netmap_ring_reinit(kring)) @@ -252,99 +297,134 @@ vtnet_refill_rxq(struct netmap_kring *kring, u_int nm_ } slot->flags &= ~NS_BUF_CHANGED; - sglist_reset(&sg); // cheap - err = sglist_append(&sg, &hdr, sc->vtnet_hdr_size); - err = sglist_append_phys(&sg, paddr, NETMAP_BUF_SIZE(na)); + sglist_reset(&sg); + err = sglist_append(&sg, &rxq->vtnrx_shrhdr, sc->vtnet_hdr_size); + err |= sglist_append_phys(&sg, paddr, NETMAP_BUF_SIZE(na)); + KASSERT(err == 0, ("%s: cannot append to sglist %d", + __func__, err)); /* writable for the host */ - err = virtqueue_enqueue(vq, rxq, &sg, 0, sg.sg_nseg); - if (err < 0) { - D("virtqueue_enqueue failed"); + err = virtqueue_enqueue(vq, /*cookie=*/rxq, &sg, + /*readable=*/0, /*writeable=*/sg.sg_nseg); + if (unlikely(err)) { + if (err != ENOSPC) + nm_prerr("virtqueue_enqueue(%s) failed: %d\n", + kring->name, err); break; } - nm_i = nm_next(nm_i, lim); } + return nm_i; } +/* + * Publish netmap buffers on a RX virtqueue. + * Returns -1 if this virtqueue is not being opened in netmap mode. + * If the virtqueue is being opened in netmap mode, return 0 on success and + * a positive error code on failure. + */ +static int +vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq) +{ + struct netmap_adapter *na = NA(rxq->vtnrx_sc->vtnet_ifp); + struct netmap_kring *kring; + int error; + + if (!nm_native_on(na) || rxq->vtnrx_id >= na->num_rx_rings) + return -1; + + kring = na->rx_rings[rxq->vtnrx_id]; + if (!(nm_kring_pending_on(kring) || + kring->nr_pending_mode == NKR_NETMAP_ON)) + return -1; + + /* Expose all the RX netmap buffers. Note that the number of + * netmap slots in the RX ring matches the maximum number of + * 2-elements sglist that the RX virtqueue can accommodate. */ + error = vtnet_netmap_kring_refill(kring, 0, na->num_rx_desc); + virtqueue_notify(rxq->vtnrx_vq); + + return error < 0 ? ENXIO : 0; +} + /* Reconcile kernel and user view of the receive ring. */ static int vtnet_netmap_rxsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + struct ifnet *ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int ring_nr = kring->ring_id; u_int nm_i; /* index into the netmap ring */ - // u_int nic_i; /* index into the NIC ring */ - u_int n; u_int const lim = kring->nkr_num_slots - 1; u_int const head = kring->rhead; - int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; + int force_update = (flags & NAF_FORCE_READ) || + (kring->nr_kflags & NKR_PENDINTR); int interrupts = !(kring->nr_kflags & NKR_NOINTR); /* device-specific */ - struct SOFTC_T *sc = ifp->if_softc; + struct vtnet_softc *sc = ifp->if_softc; struct vtnet_rxq *rxq = &sc->vtnet_rxqs[ring_nr]; struct virtqueue *vq = rxq->vtnrx_vq; - /* XXX netif_carrier_ok ? */ - - if (head > lim) - return netmap_ring_reinit(kring); - rmb(); /* * First part: import newly received packets. - * Only accept our - * own buffers (matching the token). We should only get - * matching buffers, because of vtnet_netmap_free_rx_unused_bufs() - * and vtnet_netmap_init_buffers(). + * Only accept our own buffers (matching the token). We should only get + * matching buffers. We may need to stop early to avoid hwtail to overrun + * hwcur. */ if (netmap_no_pendintr || force_update) { - struct netmap_adapter *token; + uint32_t hwtail_lim = nm_prev(kring->nr_hwcur, lim); + void *token; - nm_i = kring->nr_hwtail; - n = 0; - for (;;) { + vtnet_rxq_disable_intr(rxq); + + nm_i = kring->nr_hwtail; + while (nm_i != hwtail_lim) { int len; - token = virtqueue_dequeue(vq, &len); - if (token == NULL) - break; - if (likely(token == (void *)rxq)) { - ring->slot[nm_i].len = len; - ring->slot[nm_i].flags = 0; - nm_i = nm_next(nm_i, lim); - n++; - } else { - D("This should not happen"); - } + token = virtqueue_dequeue(vq, &len); + if (token == NULL) { + if (interrupts && vtnet_rxq_enable_intr(rxq)) { + vtnet_rxq_disable_intr(rxq); + continue; + } + break; + } + if (unlikely(token != (void *)rxq)) { + nm_prerr("BUG: RX token mismatch\n"); + } else { + /* Skip the virtio-net header. */ + len -= sc->vtnet_hdr_size; + if (unlikely(len < 0)) { + RD(1, "Truncated virtio-net-header, " + "missing %d bytes", -len); + len = 0; + } + ring->slot[nm_i].len = len; + ring->slot[nm_i].flags = 0; + nm_i = nm_next(nm_i, lim); + } } kring->nr_hwtail = nm_i; kring->nr_kflags &= ~NKR_PENDINTR; } - ND("[B] h %d c %d hwcur %d hwtail %d", - ring->head, ring->cur, kring->nr_hwcur, - kring->nr_hwtail); + ND("[B] h %d c %d hwcur %d hwtail %d", ring->head, ring->cur, + kring->nr_hwcur, kring->nr_hwtail); /* * Second part: skip past packets that userspace has released. */ nm_i = kring->nr_hwcur; /* netmap ring index */ if (nm_i != head) { - int err = vtnet_refill_rxq(kring, nm_i, head); - if (err < 0) - return 1; - kring->nr_hwcur = err; + int nm_j = vtnet_netmap_kring_refill(kring, nm_i, head); + if (nm_j < 0) + return nm_j; + kring->nr_hwcur = nm_j; virtqueue_notify(vq); - /* After draining the queue may need an intr from the hypervisor */ - if (interrupts) { - vtnet_rxq_enable_intr(rxq); - } } - ND("[C] h %d c %d t %d hwcur %d hwtail %d", - ring->head, ring->cur, ring->tail, - kring->nr_hwcur, kring->nr_hwtail); + ND("[C] h %d c %d t %d hwcur %d hwtail %d", ring->head, ring->cur, + ring->tail, kring->nr_hwcur, kring->nr_hwtail); return 0; } @@ -352,9 +432,9 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl /* Enable/disable interrupts on all virtqueues. */ static void -vtnet_netmap_intr(struct netmap_adapter *na, int onoff) +vtnet_netmap_intr(struct netmap_adapter *na, int state) { - struct SOFTC_T *sc = na->ifp->if_softc; + struct vtnet_softc *sc = na->ifp->if_softc; int i; for (i = 0; i < sc->vtnet_max_vq_pairs; i++) { @@ -362,7 +442,7 @@ vtnet_netmap_intr(struct netmap_adapter *na, int onoff struct vtnet_txq *txq = &sc->vtnet_txqs[i]; struct virtqueue *txvq = txq->vtntx_vq; - if (onoff) { + if (state) { vtnet_rxq_enable_intr(rxq); virtqueue_enable_intr(txvq); } else { @@ -372,60 +452,88 @@ vtnet_netmap_intr(struct netmap_adapter *na, int onoff } } -/* Make RX virtqueues buffers pointing to netmap buffers. */ static int -vtnet_netmap_init_rx_buffers(struct SOFTC_T *sc) +vtnet_netmap_tx_slots(struct vtnet_softc *sc) { - struct ifnet *ifp = sc->vtnet_ifp; - struct netmap_adapter* na = NA(ifp); - unsigned int r; + int div; - if (!nm_native_on(na)) - return 0; - for (r = 0; r < na->num_rx_rings; r++) { - struct netmap_kring *kring = na->rx_rings[r]; - struct vtnet_rxq *rxq = &sc->vtnet_rxqs[r]; - struct virtqueue *vq = rxq->vtnrx_vq; - struct netmap_slot* slot; - int err = 0; + /* We need to prepend a virtio-net header to each netmap buffer to be + * transmitted, therefore calling virtqueue_enqueue() passing sglist + * with 2 elements. + * TX virtqueues use indirect descriptors if the feature was negotiated + * with the host, and if sc->vtnet_tx_nsegs > 1. With indirect + * descriptors, a single virtio descriptor is sufficient to reference + * each TX sglist. Without them, we need two separate virtio descriptors + * for each TX sglist. We therefore compute the number of netmap TX + * slots according to these assumptions. + */ + if ((sc->vtnet_flags & VTNET_FLAG_INDIRECT) && sc->vtnet_tx_nsegs > 1) + div = 1; + else + div = 2; - slot = netmap_reset(na, NR_RX, r, 0); - if (!slot) { - D("strange, null netmap ring %d", r); - return 0; - } - /* Add up to na>-num_rx_desc-1 buffers to this RX virtqueue. - * It's important to leave one virtqueue slot free, otherwise - * we can run into ring->cur/ring->tail wraparounds. - */ - err = vtnet_refill_rxq(kring, 0, na->num_rx_desc-1); - if (err < 0) - return 0; - virtqueue_notify(vq); - } + return virtqueue_size(sc->vtnet_txqs[0].vtntx_vq) / div; +} - return 1; +static int +vtnet_netmap_rx_slots(struct vtnet_softc *sc) +{ + int div; + + /* We need to prepend a virtio-net header to each netmap buffer to be + * received, therefore calling virtqueue_enqueue() passing sglist + * with 2 elements. + * RX virtqueues use indirect descriptors if the feature was negotiated + * with the host, and if sc->vtnet_rx_nsegs > 1. With indirect + * descriptors, a single virtio descriptor is sufficient to reference + * each RX sglist. Without them, we need two separate virtio descriptors + * for each RX sglist. We therefore compute the number of netmap RX + * slots according to these assumptions. + */ + if ((sc->vtnet_flags & VTNET_FLAG_INDIRECT) && sc->vtnet_rx_nsegs > 1) + div = 1; + else + div = 2; + + return virtqueue_size(sc->vtnet_rxqs[0].vtnrx_vq) / div; } +static int +vtnet_netmap_config(struct netmap_adapter *na, struct nm_config_info *info) +{ + struct vtnet_softc *sc = na->ifp->if_softc; + + info->num_tx_rings = sc->vtnet_act_vq_pairs; + info->num_rx_rings = sc->vtnet_act_vq_pairs; + info->num_tx_descs = vtnet_netmap_tx_slots(sc); + info->num_rx_descs = vtnet_netmap_rx_slots(sc); + info->rx_buf_maxsize = NETMAP_BUF_SIZE(na); + + return 0; +} + static void -vtnet_netmap_attach(struct SOFTC_T *sc) +vtnet_netmap_attach(struct vtnet_softc *sc) { struct netmap_adapter na; bzero(&na, sizeof(na)); na.ifp = sc->vtnet_ifp; - na.num_tx_desc = 1024;// sc->vtnet_rx_nmbufs; - na.num_rx_desc = 1024; // sc->vtnet_rx_nmbufs; + na.na_flags = 0; + na.num_tx_desc = vtnet_netmap_tx_slots(sc); + na.num_rx_desc = vtnet_netmap_rx_slots(sc); + na.num_tx_rings = na.num_rx_rings = sc->vtnet_max_vq_pairs; + na.rx_buf_maxsize = 0; na.nm_register = vtnet_netmap_reg; na.nm_txsync = vtnet_netmap_txsync; na.nm_rxsync = vtnet_netmap_rxsync; na.nm_intr = vtnet_netmap_intr; - na.num_tx_rings = na.num_rx_rings = sc->vtnet_max_vq_pairs; - D("max rings %d", sc->vtnet_max_vq_pairs); + na.nm_config = vtnet_netmap_config; + netmap_attach(&na); - D("virtio attached txq=%d, txd=%d rxq=%d, rxd=%d", + nm_prinf("vtnet attached txq=%d, txd=%d rxq=%d, rxd=%d\n", na.num_tx_rings, na.num_tx_desc, na.num_tx_rings, na.num_rx_desc); } Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Wed Nov 14 15:23:39 2018 (r340435) +++ head/sys/dev/virtio/network/if_vtnet.c Wed Nov 14 15:39:48 2018 (r340436) @@ -1192,6 +1192,12 @@ vtnet_rxq_populate(struct vtnet_rxq *rxq) struct virtqueue *vq; int nbufs, error; +#ifdef DEV_NETMAP + error = vtnet_netmap_rxq_populate(rxq); + if (error >= 0) + return (error); +#endif /* DEV_NETMAP */ + vq = rxq->vtnrx_vq; error = ENOSPC; @@ -1221,12 +1227,20 @@ vtnet_rxq_free_mbufs(struct vtnet_rxq *rxq) struct virtqueue *vq; struct mbuf *m; int last; +#ifdef DEV_NETMAP + int netmap_bufs = vtnet_netmap_queue_on(rxq->vtnrx_sc, NR_RX, + rxq->vtnrx_id); +#else /* !DEV_NETMAP */ + int netmap_bufs = 0; +#endif /* !DEV_NETMAP */ vq = rxq->vtnrx_vq; last = 0; - while ((m = virtqueue_drain(vq, &last)) != NULL) - m_freem(m); + while ((m = virtqueue_drain(vq, &last)) != NULL) { + if (!netmap_bufs) + m_freem(m); + } KASSERT(virtqueue_empty(vq), ("%s: mbufs remaining in rx queue %p", __func__, rxq)); @@ -1772,12 +1786,6 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) VTNET_RXQ_LOCK_ASSERT(rxq); -#ifdef DEV_NETMAP - if (netmap_rx_irq(ifp, 0, &deq)) { - return (FALSE); - } -#endif /* DEV_NETMAP */ - while (count-- > 0) { m = virtqueue_dequeue(vq, &len); if (m == NULL) @@ -1871,6 +1879,11 @@ vtnet_rx_vq_intr(void *xrxq) return; } +#ifdef DEV_NETMAP + if (netmap_rx_irq(ifp, rxq->vtnrx_id, &more) != NM_IRQ_PASS) + return; +#endif /* DEV_NETMAP */ + VTNET_RXQ_LOCK(rxq); again: @@ -1971,13 +1984,21 @@ vtnet_txq_free_mbufs(struct vtnet_txq *txq) struct virtqueue *vq; struct vtnet_tx_header *txhdr; int last; +#ifdef DEV_NETMAP + int netmap_bufs = vtnet_netmap_queue_on(txq->vtntx_sc, NR_TX, + txq->vtntx_id); +#else /* !DEV_NETMAP */ + int netmap_bufs = 0; +#endif /* !DEV_NETMAP */ vq = txq->vtntx_vq; last = 0; while ((txhdr = virtqueue_drain(vq, &last)) != NULL) { - m_freem(txhdr->vth_mbuf); - uma_zfree(vtnet_tx_header_zone, txhdr); + if (!netmap_bufs) { + m_freem(txhdr->vth_mbuf); + uma_zfree(vtnet_tx_header_zone, txhdr); + } } KASSERT(virtqueue_empty(vq), @@ -2465,13 +2486,6 @@ vtnet_txq_eof(struct vtnet_txq *txq) deq = 0; VTNET_TXQ_LOCK_ASSERT(txq); -#ifdef DEV_NETMAP - if (netmap_tx_irq(txq->vtntx_sc->vtnet_ifp, txq->vtntx_id)) { - virtqueue_disable_intr(vq); // XXX luigi - return 0; // XXX or 1 ? - } -#endif /* DEV_NETMAP */ - while ((txhdr = virtqueue_dequeue(vq, NULL)) != NULL) { m = txhdr->vth_mbuf; deq++; @@ -2513,6 +2527,11 @@ vtnet_tx_vq_intr(void *xtxq) return; } +#ifdef DEV_NETMAP + if (netmap_tx_irq(ifp, txq->vtntx_id) != NM_IRQ_PASS) + return; +#endif /* DEV_NETMAP */ + VTNET_TXQ_LOCK(txq); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { @@ -2769,11 +2788,6 @@ vtnet_drain_rxtx_queues(struct vtnet_softc *sc) struct vtnet_txq *txq; int i; -#ifdef DEV_NETMAP - if (nm_native_on(NA(sc->vtnet_ifp))) - return; -#endif /* DEV_NETMAP */ - for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { rxq = &sc->vtnet_rxqs[i]; vtnet_rxq_free_mbufs(rxq); @@ -2938,11 +2952,6 @@ vtnet_init_rx_queues(struct vtnet_softc *sc) ("%s: too many rx mbufs %d for %d segments", __func__, sc->vtnet_rx_nmbufs, sc->vtnet_rx_nsegs)); -#ifdef DEV_NETMAP - if (vtnet_netmap_init_rx_buffers(sc)) - return 0; -#endif /* DEV_NETMAP */ - for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { rxq = &sc->vtnet_rxqs[i]; @@ -3092,13 +3101,6 @@ vtnet_init(void *xsc) struct vtnet_softc *sc; sc = xsc; - -#ifdef DEV_NETMAP - if (!NA(sc->vtnet_ifp)) { - D("try to attach again"); - vtnet_netmap_attach(sc); - } -#endif /* DEV_NETMAP */ VTNET_CORE_LOCK(sc); vtnet_init_locked(sc); Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Wed Nov 14 15:23:39 2018 (r340435) +++ head/sys/dev/virtio/network/if_vtnetvar.h Wed Nov 14 15:39:48 2018 (r340436) @@ -79,6 +79,9 @@ struct vtnet_rxq { struct vtnet_rxq_stats vtnrx_stats; struct taskqueue *vtnrx_tq; struct task vtnrx_intrtask; +#ifdef DEV_NETMAP + struct virtio_net_hdr_mrg_rxbuf vtnrx_shrhdr; +#endif /* DEV_NETMAP */ char vtnrx_name[16]; } __aligned(CACHE_LINE_SIZE); @@ -114,6 +117,9 @@ struct vtnet_txq { #ifndef VTNET_LEGACY_TX struct task vtntx_defrtask; #endif +#ifdef DEV_NETMAP + struct virtio_net_hdr_mrg_rxbuf vtntx_shrhdr; +#endif /* DEV_NETMAP */ char vtntx_name[16]; } __aligned(CACHE_LINE_SIZE); From owner-svn-src-head@freebsd.org Wed Nov 14 16:15:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBDB6112CEEE; Wed, 14 Nov 2018 16:15:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67A157D94D; Wed, 14 Nov 2018 16:15:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4459021610; Wed, 14 Nov 2018 16:15:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEGFbHA097938; Wed, 14 Nov 2018 16:15:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEGFbAV097937; Wed, 14 Nov 2018 16:15:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811141615.wAEGFbAV097937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Nov 2018 16:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340437 - head X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67A157D94D X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 16:15:38 -0000 Author: markj Date: Wed Nov 14 16:15:36 2018 New Revision: 340437 URL: https://svnweb.freebsd.org/changeset/base/340437 Log: Fix the path to malloc_domain.9. Reported by: yuripv MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Nov 14 15:39:48 2018 (r340436) +++ head/ObsoleteFiles.inc Wed Nov 14 16:15:36 2018 (r340437) @@ -42,7 +42,7 @@ OLD_LIBS+=lib/casper/libcap_dns.so.1 OLD_LIBS+=usr/lib32/libcap_dns.so.1 # 20181030: malloc_domain(9) KPI change -OLD_FILES+=share/man/man9/malloc_domain.9.gz +OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz # 20181026: joy(4) removal OLD_FILES+=usr/share/man/man4/joy.4.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports From owner-svn-src-head@freebsd.org Wed Nov 14 16:18:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76010112CFD5; Wed, 14 Nov 2018 16:18:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06DAF7DAF0; Wed, 14 Nov 2018 16:18:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7F3B21615; Wed, 14 Nov 2018 16:18:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEGIDwg098085; Wed, 14 Nov 2018 16:18:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEGIDLc098084; Wed, 14 Nov 2018 16:18:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811141618.wAEGIDLc098084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Nov 2018 16:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340438 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 340438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 06DAF7DAF0 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 16:18:14 -0000 Author: markj Date: Wed Nov 14 16:18:13 2018 New Revision: 340438 URL: https://svnweb.freebsd.org/changeset/base/340438 Log: Hook mac_ntpd.4 up to the build. PR: 232757 Submitted by: Yasuhiro KIMURA MFC after: 3 days Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Nov 14 16:15:36 2018 (r340437) +++ head/share/man/man4/Makefile Wed Nov 14 16:18:13 2018 (r340438) @@ -264,6 +264,7 @@ MAN= aac.4 \ mac_lomac.4 \ mac_mls.4 \ mac_none.4 \ + mac_ntpd.4 \ mac_partition.4 \ mac_portacl.4 \ mac_seeotheruids.4 \ From owner-svn-src-head@freebsd.org Wed Nov 14 16:19:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D416112D03F; Wed, 14 Nov 2018 16:19:16 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D4797DC47; Wed, 14 Nov 2018 16:19:16 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E5E921617; Wed, 14 Nov 2018 16:19:16 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEGJFUH098194; Wed, 14 Nov 2018 16:19:15 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEGJFDl098193; Wed, 14 Nov 2018 16:19:15 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201811141619.wAEGJFDl098193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Wed, 14 Nov 2018 16:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340439 - head/usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: garga X-SVN-Commit-Paths: head/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 340439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D4797DC47 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 16:19:16 -0000 Author: garga (ports committer) Date: Wed Nov 14 16:19:15 2018 New Revision: 340439 URL: https://svnweb.freebsd.org/changeset/base/340439 Log: Fix /etc/ntp permissions. According to mtree it must be 0700 Reviewed by: imp Approved by: imp MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D17973 Modified: head/usr.sbin/ntp/ntpd/Makefile Modified: head/usr.sbin/ntp/ntpd/Makefile ============================================================================== --- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:18:13 2018 (r340438) +++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018 (r340439) @@ -7,9 +7,12 @@ MAN= .PATH: ${SRCTOP}/contrib/ntp/ntpd \ ${.OBJDIR} +DIRS= ETC_NTP +ETC_NTP= /etc/ntp +ETN_NTP_MODE= 0700 CONFS= ntp.conf FILES= leap-seconds -FILESDIR= /etc/ntp +FILESDIR= ETC_NTP FILESMODE= 644 PROG= ntpd From owner-svn-src-head@freebsd.org Wed Nov 14 16:28:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4EF5112D5CA; Wed, 14 Nov 2018 16:28:34 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CAA77E277; Wed, 14 Nov 2018 16:28:33 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id wAEGSVDQ053015 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 14 Nov 2018 08:28:32 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id wAEGSViq053014; Wed, 14 Nov 2018 08:28:31 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 14 Nov 2018 08:28:31 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340413 - in head/sys: kern net sys Message-ID: <20181114162831.GM9744@FreeBSD.org> References: <201811140933.wAE9XxSL003613@slippy.cwsent.com> <178c3d69-4a3b-49cb-dab4-f6f4139dfc1a@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <178c3d69-4a3b-49cb-dab4-f6f4139dfc1a@selasky.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 0CAA77E277 X-Spamd-Result: default: False [-103.12 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; IP_SCORE(-0.02)[country: US(-0.10)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:2906, ipnet:198.45.48.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 16:28:35 -0000 On Wed, Nov 14, 2018 at 11:06:38AM +0100, Hans Petter Selasky wrote: H> On 11/14/18 10:33 AM, Cy Schubert wrote: H> > + epoch_thread_init(td); H> H> Did you forget to call epoch_thread_init() for thread0 ? Yes, this is my guess. I'm preparing patch for Cy to test. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Nov 14 16:33:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5EAA112D874; Wed, 14 Nov 2018 16:33:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 091637E6DF; Wed, 14 Nov 2018 16:33:30 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAEGXSJI036706; Wed, 14 Nov 2018 08:33:28 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAEGXSsn036705; Wed, 14 Nov 2018 08:33:28 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811141633.wAEGXSsn036705@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340426 - head/sys/dev/amdtemp In-Reply-To: <201811140450.wAE4oUWW043645@repo.freebsd.org> To: Conrad Meyer Date: Wed, 14 Nov 2018 08:33:28 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 091637E6DF X-Spamd-Result: default: False [0.22 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.28)[-0.277,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.24)[-0.242,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.10)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.13)[-0.131,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 16:33:32 -0000 > Author: cem > Date: Wed Nov 14 04:50:29 2018 > New Revision: 340426 > URL: https://svnweb.freebsd.org/changeset/base/340426 > > Log: > amdtemp(4): Fix temperature reporting on AMD 2990WX > > Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255 > OSRR, section 4.2.1. > > For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the > range -49..206; i.e., subtract 49?C. > > Submitted by: gallatin@ > Reported by: bcran@ > Reviewed by: me (long ago) As per recent discussion on @developers, me@ is actually a valid committers name and should not be used to describe one self in commit messages. > MFC after: 22.57 seconds > Relnotes: yea I do not believe the relnotes processor understands slang. > Differential Revision: https://reviews.freebsd.org/D16855 > > Modified: > head/sys/dev/amdtemp/amdtemp.c > > Modified: head/sys/dev/amdtemp/amdtemp.c > ============================================================================== > --- head/sys/dev/amdtemp/amdtemp.c Wed Nov 14 03:42:39 2018 (r340425) > +++ head/sys/dev/amdtemp/amdtemp.c Wed Nov 14 04:50:29 2018 (r340426) > @@ -115,8 +115,15 @@ static struct amdtemp_product { > > /* > * Reported Temperature, Family 17h > + * > + * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of this register > + * provide the current temp. bit 19, when clear, means the temp is reported in > + * a range 0.."225C" (probable typo for 255C), and when set changes the range > + * to -49..206C. > */ > -#define AMDTEMP_17H_CUR_TMP 0x59800 > +#define AMDTEMP_17H_CUR_TMP 0x59800 > +#define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) > +#define AMDTEMP_17H_CUR_TMP_RANGE_OFF 490 > > /* > * Thermaltrip Status Register (Family 0Fh only) > @@ -595,13 +602,15 @@ static int32_t > amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) > { > struct amdtemp_softc *sc = device_get_softc(dev); > - uint32_t temp; > + uint32_t temp, val; > int error; > > - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &temp); > + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); > KASSERT(error == 0, ("amdsmn_read")); > > - temp = ((temp >> 21) & 0x7ff) * 5 / 4; > + temp = ((val >> 21) & 0x7ff) * 5 / 4; > + if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) > + temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF; > temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; > > return (temp); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Nov 14 16:33:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665F7112D89C; Wed, 14 Nov 2018 16:33:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94D217E7E5; Wed, 14 Nov 2018 16:33:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 682CB10A87D; Wed, 14 Nov 2018 11:33:42 -0500 (EST) Subject: Re: svn commit: r340439 - head/usr.sbin/ntp/ntpd To: Renato Botelho , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811141619.wAEGJFDl098193@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <6f9ea19e-0904-25d3-f2fb-70b088e493f8@FreeBSD.org> Date: Wed, 14 Nov 2018 08:33:41 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201811141619.wAEGJFDl098193@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 14 Nov 2018 11:33:42 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 94D217E7E5 X-Spamd-Result: default: False [-106.73 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; R_SPF_SOFTFAIL(0.00)[~all]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-3.62)[ip: (-9.91), ipnet: 2001:470::/32(-4.53), asn: 6939(-3.57), country: US(-0.10)]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 16:33:46 -0000 On 11/14/18 8:19 AM, Renato Botelho wrote: > Author: garga (ports committer) > Date: Wed Nov 14 16:19:15 2018 > New Revision: 340439 > URL: https://svnweb.freebsd.org/changeset/base/340439 > > Log: > Fix /etc/ntp permissions. According to mtree it must be 0700 > > Reviewed by: imp > Approved by: imp > MFC after: 3 days > Sponsored by: Rubicon Communications, LLC (Netgate) > Differential Revision: https://reviews.freebsd.org/D17973 > > Modified: > head/usr.sbin/ntp/ntpd/Makefile > > Modified: head/usr.sbin/ntp/ntpd/Makefile > ============================================================================== > --- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:18:13 2018 (r340438) > +++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018 (r340439) > @@ -7,9 +7,12 @@ MAN= > .PATH: ${SRCTOP}/contrib/ntp/ntpd \ > ${.OBJDIR} > > +DIRS= ETC_NTP > +ETC_NTP= /etc/ntp > +ETN_NTP_MODE= 0700 s/ETN/ETC/? -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Wed Nov 14 18:12:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC4E71130596; Wed, 14 Nov 2018 18:12:53 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0892A8377B; Wed, 14 Nov 2018 18:12:53 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x735.google.com with SMTP id q1so27437231qkf.13; Wed, 14 Nov 2018 10:12:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WsDmzdHfGULYfd/BDTFBGgtWuMgKxFcuY1kBKO/Xum8=; b=peTVkYXlQ+JLwxz3WsSloxXoLHCOhoD98Hbg+X9K9m02wF9a0MBXx6IXgdV7pzALWl R7NVTWZWIgOSx1ob82CLQyETkE/axj+MF4vBVJyp6O9YsBqY2rbj80rSNai3zbWipPG6 /Qbo479goSs5f7rtqaeZ7Jr8t2vDc1yMzJ+RXfp3q6cB6yERP1MTLnxGEJxu6QuFFutS IsYE7ylxI+X9tag9rWyw9l5sR8AiH5oEz/NPVqdAPgOSuZ4n64kH0ph8R5dn77VHc8H4 V+JqRQXrq12l3OPrbWnBhChl4bAQowbsFbDMo4p0L+3ZwrFyI4jQCGz5dSPiJ9LjVsXg Ku4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=WsDmzdHfGULYfd/BDTFBGgtWuMgKxFcuY1kBKO/Xum8=; b=Y5zlHjynTqOyyeziC05cEZgtifV+ZeF4Pw4mAcTMysX0xvRiCqSElJYPZgigPQkp1K 2QhfWG+M52SduBysrH1lKMU3lrAs2MV6ClHXkaWeJaM/vKVXLp7AnY+YSsTSf2Zc5wIB KodRTXffPRe4eMTTZu5VuYf39KDKSltEu2YWHyNyemVdjqe6DTXkqNindw1WaTPGnn3B 3M4hMbhmZ6XnuE6TpmJp+V8Ii/aOC707qX8EE7KfRxwLmKrj8gEnWkj366lNPDSYUXie YEFmh+atO6EoJ6yFeb7CEhqvbDjk/YdDTeSNiMsiOpdxZTCAu0vwu366HCWKt8Plf4fL Xd9A== X-Gm-Message-State: AGRZ1gLMyPo78MFjA+M5UMmYuOc2EDe7nv7PBZME6otzlJng0n6ph0Hc iklQJVLz6cT7aIQkdPgT/Z8TYjJy X-Google-Smtp-Source: AJdET5frxpS1HwKHJt9R9W07eqm2JFqI0HVWm0+FiL7K/7neiCKqIhwn5D6wrvgYJhlo90OUxKraUQ== X-Received: by 2002:a0c:b746:: with SMTP id q6mr2856834qve.235.1542219172002; Wed, 14 Nov 2018 10:12:52 -0800 (PST) Received: from mbp.home ([2804:f1c:800:e00:c9ce:c02:64d4:da58]) by smtp.gmail.com with ESMTPSA id l51sm15083659qtk.11.2018.11.14.10.12.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 10:12:51 -0800 (PST) Sender: Renato Botelho Subject: Re: svn commit: r340439 - head/usr.sbin/ntp/ntpd To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811141619.wAEGJFDl098193@repo.freebsd.org> <6f9ea19e-0904-25d3-f2fb-70b088e493f8@FreeBSD.org> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/UM7ATQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABwsB8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: Date: Wed, 14 Nov 2018 16:12:48 -0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <6f9ea19e-0904-25d3-f2fb-70b088e493f8@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0892A8377B X-Spamd-Result: default: False [-4.08 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.91)[ipnet: 2607:f8b0::/32(-2.65), asn: 15169(-1.79), country: US(-0.10)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[5.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 18:12:54 -0000 On 14/11/18 14:33, John Baldwin wrote: > On 11/14/18 8:19 AM, Renato Botelho wrote: >> Author: garga (ports committer) >> Date: Wed Nov 14 16:19:15 2018 >> New Revision: 340439 >> URL: https://svnweb.freebsd.org/changeset/base/340439 >> >> Log: >> Fix /etc/ntp permissions. According to mtree it must be 0700 >> >> Reviewed by: imp >> Approved by: imp >> MFC after: 3 days >> Sponsored by: Rubicon Communications, LLC (Netgate) >> Differential Revision: https://reviews.freebsd.org/D17973 >> >> Modified: >> head/usr.sbin/ntp/ntpd/Makefile >> >> Modified: head/usr.sbin/ntp/ntpd/Makefile >> ============================================================================== >> --- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:18:13 2018 (r340438) >> +++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018 (r340439) >> @@ -7,9 +7,12 @@ MAN= >> .PATH: ${SRCTOP}/contrib/ntp/ntpd \ >> ${.OBJDIR} >> >> +DIRS= ETC_NTP >> +ETC_NTP= /etc/ntp >> +ETN_NTP_MODE= 0700 > > s/ETN/ETC/? Yes, I need to commit a fix. Do I need to request a new approval from a src committer? Index: ntpd/Makefile =================================================================== --- ntpd/Makefile (revision 340439) +++ ntpd/Makefile (working copy) @@ -9,7 +9,7 @@ DIRS= ETC_NTP ETC_NTP= /etc/ntp -ETN_NTP_MODE= 0700 +ETC_NTP_MODE= 0700 CONFS= ntp.conf FILES= leap-seconds FILESDIR= ETC_NTP -- Renato Botelho From owner-svn-src-head@freebsd.org Wed Nov 14 18:24:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044131130BE3; Wed, 14 Nov 2018 18:24:16 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 307E283F35; Wed, 14 Nov 2018 18:24:05 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAEINvYu012486 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Nov 2018 19:23:58 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: garga@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAEINu9Z054479 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 15 Nov 2018 01:23:56 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r340439 - head/usr.sbin/ntp/ntpd To: Renato Botelho , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811141619.wAEGJFDl098193@repo.freebsd.org> <6f9ea19e-0904-25d3-f2fb-70b088e493f8@FreeBSD.org> From: Eugene Grosbein Message-ID: Date: Thu, 15 Nov 2018 01:23:50 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 307E283F35 X-Spamd-Result: default: False [-5.33 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MX_INVALID(0.50)[greylisted]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; R_SPF_PERMFAIL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-2.74)[ip: (-7.96), ipnet: 2a01:4f8::/29(-2.89), asn: 24940(-2.83), country: DE(-0.01)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 18:24:16 -0000 15.11.2018 1:12, Renato Botelho wrote: >>> Modified: head/usr.sbin/ntp/ntpd/Makefile >>> ============================================================================== >>> --- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:18:13 2018 (r340438) >>> +++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018 (r340439) >>> @@ -7,9 +7,12 @@ MAN= >>> .PATH: ${SRCTOP}/contrib/ntp/ntpd \ >>> ${.OBJDIR} >>> >>> +DIRS= ETC_NTP >>> +ETC_NTP= /etc/ntp >>> +ETN_NTP_MODE= 0700 >> >> s/ETN/ETC/? > > Yes, I need to commit a fix. Do I need to request a new approval from a > src committer? > > Index: ntpd/Makefile > =================================================================== > --- ntpd/Makefile (revision 340439) > +++ ntpd/Makefile (working copy) > @@ -9,7 +9,7 @@ > > DIRS= ETC_NTP > ETC_NTP= /etc/ntp > -ETN_NTP_MODE= 0700 > +ETC_NTP_MODE= 0700 > CONFS= ntp.conf > FILES= leap-seconds > FILESDIR= ETC_NTP > Yes, you need. Approved. From owner-svn-src-head@freebsd.org Wed Nov 14 18:28:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 921C71130CE4; Wed, 14 Nov 2018 18:28:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01E78840FE; Wed, 14 Nov 2018 18:28:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8774D10AFCD; Wed, 14 Nov 2018 13:28:25 -0500 (EST) Subject: Re: svn commit: r340426 - head/sys/dev/amdtemp To: rgrimes@freebsd.org, Conrad Meyer References: <201811141633.wAEGXSsn036705@pdx.rh.CN85.dnsmgr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <4ad05a1b-4352-adda-77b3-4144f37f4547@FreeBSD.org> Date: Wed, 14 Nov 2018 10:28:24 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201811141633.wAEGXSsn036705@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 14 Nov 2018 13:28:26 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 01E78840FE X-Spamd-Result: default: False [-106.73 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-3.63)[ip: (-9.91), ipnet: 2001:470::/32(-4.54), asn: 6939(-3.58), country: US(-0.10)]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 18:28:27 -0000 On 11/14/18 8:33 AM, Rodney W. Grimes wrote: >> MFC after: 22.57 seconds >> Relnotes: yea > > I do not believe the relnotes processor understands slang. This is quite possibly a typo ('a' and 's' are adjacent keys in QWERTY). However, no one uses 'Relnotes: no', so it seems like you should probably just match on '^Relnotes:' and ignore the value. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Wed Nov 14 18:38:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD0711130FCC; Wed, 14 Nov 2018 18:38:28 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3593D845ED; Wed, 14 Nov 2018 18:38:28 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07B2122CFD; Wed, 14 Nov 2018 18:38:28 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEIcRXX070303; Wed, 14 Nov 2018 18:38:27 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEIcRId070302; Wed, 14 Nov 2018 18:38:27 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201811141838.wAEIcRId070302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Wed, 14 Nov 2018 18:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340440 - head/usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: garga X-SVN-Commit-Paths: head/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 340440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3593D845ED X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 18:38:28 -0000 Author: garga (ports committer) Date: Wed Nov 14 18:38:27 2018 New Revision: 340440 URL: https://svnweb.freebsd.org/changeset/base/340440 Log: Fix typo introduced in r340439 - s/ETN/ETC/ Reported by: jhb, yuripv Approved by: eugen MFC after: 3 days X-MFC-With: 340439 Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/usr.sbin/ntp/ntpd/Makefile Modified: head/usr.sbin/ntp/ntpd/Makefile ============================================================================== --- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018 (r340439) +++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 18:38:27 2018 (r340440) @@ -9,7 +9,7 @@ MAN= DIRS= ETC_NTP ETC_NTP= /etc/ntp -ETN_NTP_MODE= 0700 +ETC_NTP_MODE= 0700 CONFS= ntp.conf FILES= leap-seconds FILESDIR= ETC_NTP From owner-svn-src-head@freebsd.org Wed Nov 14 18:39:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC8251131012; Wed, 14 Nov 2018 18:39:02 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF1E8473F; Wed, 14 Nov 2018 18:39:02 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x72c.google.com with SMTP id q70so10090441qkh.6; Wed, 14 Nov 2018 10:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JumYIPxBpLyIk866opeNPmxbavnA2umwdAjQiqRNZcw=; b=IZ5WjSiPakFExkKkTyYrNe2Js7T08dPg/fH/5OtJSJxr7+tWelKGIjRfxPu3eRShzH SyPAeSwzEr5jZuG0+3LHVhrn7LCdkpHtWsFfM7myyrnLfF7rUdpXZ45Nfpy6QJo07lZo HntIdroTj6+hmXOpIhm2EKIzXC/uFQ+me+TjpAmnvq7qlmnEB8LZ/sRa7Dv/b2ieecLN 6oO1FfJ1HpYZkJmpVHUDyS2xAgBbRY37EhB0RgWKEzJVU/OYdbczW+umtLm3p8xhyUta AE4nnStioOuiF8EpyC8xxrqdJdo3IbMGXQzk0CnzVikKT0cU3ewzCCY4enkGcABAxVPo wJ5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=JumYIPxBpLyIk866opeNPmxbavnA2umwdAjQiqRNZcw=; b=pnHhS8EtgM9Zbblf/pL5oT3xVxlS/twZq9Z6mY2hksuYwaRTevILSM9gRIr6TmLL9j EC3ZcUAwF7h8jGDGVf912DVtwdVr1GG9Um2qRZQ+0Qn5OwEHyfo2+4fL/5FUY6LQ8ANW pdIbjRJ9YR+v7WxefqYtx2/uehKeUoKIU0qr+kgJgucCml/bP7rHcQIEil0vn76SQXFa K2c6CqWae6S4Q+keTIv4kZPBbX6QrhSmMjpfvy8AW7qxbMwlzTY/jQNeWLE8LNx2lD+2 6PEobJApwQIqh/MAXavntV9dAiU3yk/XvWAacCXUO+fTPCadqQUs7dfo5E6JnBM851my roOA== X-Gm-Message-State: AGRZ1gJCdjuLfjnqXFVdnATbuKTnhWZTylTvrVq/W6S8nKROtEI70ldG cH5VjPtkzFBJzMyd8v6rFw4fwvKt X-Google-Smtp-Source: AJdET5ep2j79l3JCZgSCKRzGiudhquJ5FP8i0h5KG7QjZUMNuER1/XltYGSKLHInAAGMhJHla0Vj4g== X-Received: by 2002:ac8:4454:: with SMTP id m20mr2796686qtn.381.1542220741532; Wed, 14 Nov 2018 10:39:01 -0800 (PST) Received: from mbp.home ([2804:f1c:800:e00:c9ce:c02:64d4:da58]) by smtp.gmail.com with ESMTPSA id g25sm6549471qki.29.2018.11.14.10.38.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 10:39:00 -0800 (PST) Sender: Renato Botelho Subject: Re: svn commit: r340439 - head/usr.sbin/ntp/ntpd To: Eugene Grosbein , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811141619.wAEGJFDl098193@repo.freebsd.org> <6f9ea19e-0904-25d3-f2fb-70b088e493f8@FreeBSD.org> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/UM7ATQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABwsB8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <054f5cdf-5690-7ccc-fbf7-0589652891bd@FreeBSD.org> Date: Wed, 14 Nov 2018 16:38:57 -0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3AF1E8473F X-Spamd-Result: default: False [-4.10 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[c.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; IP_SCORE(-0.91)[ipnet: 2607:f8b0::/32(-2.68), asn: 15169(-1.80), country: US(-0.10)]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 18:39:03 -0000 On 14/11/18 16:23, Eugene Grosbein wrote: > 15.11.2018 1:12, Renato Botelho wrote: > >>>> Modified: head/usr.sbin/ntp/ntpd/Makefile >>>> ============================================================================== >>>> --- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:18:13 2018 (r340438) >>>> +++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018 (r340439) >>>> @@ -7,9 +7,12 @@ MAN= >>>> .PATH: ${SRCTOP}/contrib/ntp/ntpd \ >>>> ${.OBJDIR} >>>> >>>> +DIRS= ETC_NTP >>>> +ETC_NTP= /etc/ntp >>>> +ETN_NTP_MODE= 0700 >>> >>> s/ETN/ETC/? >> >> Yes, I need to commit a fix. Do I need to request a new approval from a >> src committer? >> >> Index: ntpd/Makefile >> =================================================================== >> --- ntpd/Makefile (revision 340439) >> +++ ntpd/Makefile (working copy) >> @@ -9,7 +9,7 @@ >> >> DIRS= ETC_NTP >> ETC_NTP= /etc/ntp >> -ETN_NTP_MODE= 0700 >> +ETC_NTP_MODE= 0700 >> CONFS= ntp.conf >> FILES= leap-seconds >> FILESDIR= ETC_NTP >> > > Yes, you need. Approved. Fixed in 340440. Thanks! -- Renato Botelho From owner-svn-src-head@freebsd.org Wed Nov 14 18:45:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F08A611313CA; Wed, 14 Nov 2018 18:45:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80EEE84C34; Wed, 14 Nov 2018 18:45:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6211122E93; Wed, 14 Nov 2018 18:45:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEIjYmd075338; Wed, 14 Nov 2018 18:45:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEIjYwP075337; Wed, 14 Nov 2018 18:45:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811141845.wAEIjYwP075337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 14 Nov 2018 18:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340441 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 340441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80EEE84C34 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 18:45:35 -0000 Author: jhb Date: Wed Nov 14 18:45:33 2018 New Revision: 340441 URL: https://svnweb.freebsd.org/changeset/base/340441 Log: Revert r332735 and fix MSI-X to properly fail allocations when full. The off-by-one errors in 332735 weren't actual errors and were preventing the last MSI interrupt source from being used. Instead, the issue is that when all MSI interrupt sources were allocated, the loop in msix_alloc() would terminate with 'msi' still set to non-null. The only check for 'i' overflowing was in the 'msi' == NULL case, so msix_alloc() would try to reuse the last MSI interrupt source instead of failing. Fix by moving the check for all sources being in use to just after the loop. Reviewed by: kib, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D17976 Modified: head/sys/x86/x86/msi.c Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Wed Nov 14 18:38:27 2018 (r340440) +++ head/sys/x86/x86/msi.c Wed Nov 14 18:45:33 2018 (r340441) @@ -409,7 +409,7 @@ again: /* Do we need to create some new sources? */ if (cnt < count) { /* If we would exceed the max, give up. */ - if (i + (count - cnt) >= first_msi_irq + NUM_MSI_INTS) { + if (i + (count - cnt) > first_msi_irq + NUM_MSI_INTS) { mtx_unlock(&msi_lock); free(mirqs, M_MSI); return (ENXIO); @@ -647,13 +647,14 @@ again: break; } + /* Are all IRQs in use? */ + if (i == first_msi_irq + NUM_MSI_INTS) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + /* Do we need to create a new source? */ if (msi == NULL) { - /* If we would exceed the max, give up. */ - if (i + 1 >= first_msi_irq + NUM_MSI_INTS) { - mtx_unlock(&msi_lock); - return (ENXIO); - } mtx_unlock(&msi_lock); /* Create a new source. */ From owner-svn-src-head@freebsd.org Wed Nov 14 19:04:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C13641131C4F for ; Wed, 14 Nov 2018 19:04:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (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 18AAA859CE for ; Wed, 14 Nov 2018 19:04:44 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1542222213; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=ulKne+PRwXt1B/xX0ZfPnfCCpxiDlzlKM+RJ/ggAFXHNtBCyn90jt0e3dqMlUq/SA2wDrzfqc7B91 Io2dSpoupNUp3q5jKMeXD/9xAc6on22HA43i1eIDEUBjLZiJJw4e4vNf6iwKNwbywbI9KVGjSHnVen DhiCx4hFoUYAFXI2mIy2knhm93Tm3JNQuJLbz/e6wiBzw9iUZjgxB7NE9QOfbAj6LoaZxwT1Z+h69d 421PxSOcc1cdNCsjMNBOm0f95v+VsJgCUKb7BBVPCvR9OwPYkTTRfoOGf7ShqYuNqQRDqR9srzwZPD 64IzL5Zg2rmQXXX8MUQkxmQHI0cc+dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=XnhkjN1aoS3ZyU0mrta6ArFcpDXBhOECOqOfEmdejH8=; b=WdM3c5sGxeepQsEGGWKEO5DRRYaNEesXp5a3ylpqSST5dtSd2wSgk8m5e+AzwFpIxVeqXhnzdnEL8 c7vQPW52eM8v2uFyqfosIu/dTXnDCmd1kpYXcsClfGAhlBMv0btfuhcBIltSt3PzY3MRf3MOP+nW7j vG6KQgpHx7V7/ANRuQyvZvgL+YcieLwSlzlPlIwRZNtp5ANOkCk5E6npRTCuhb33C0JaWMeHPOmUJ3 TMK0juhqtBl/k98ED7aJq5zQY2F/UJPdyo2cpyd1a2k3lDfLtC+6XWmuIO8LmwBLuFAavc9FnqDQfJ Qo1rYc1AqCJF7fzlqH5llHUUBJFMU5Q== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=XnhkjN1aoS3ZyU0mrta6ArFcpDXBhOECOqOfEmdejH8=; b=JxocxGwZaAR3irk+M/J8nTUnfAcWQ7OL6KkhhVWIWOPi8Hmi6y3oh7Cghhf0bqMp25c88uJAh/K5i OFdoZVD2lU9Be39IFU0Ju2TOIMxGBRMYcolb6HN8/lN3Q8+ZrR9ZEsCZjHmDzGAJ3iwPPJeo368t8r SHGvmKZXPC9PuCpgDG1DX0uEEqTfvXfxjvwmkNs5rR6YebV6VJB/A6NRW/j1Sx3kWhU58PQJs5vXbm t+Ziu+T4W7zOQfHdytiUaChgH7tt+rJV7ZPzUoD8L8oRavdOBH08Nb88Oj0N4/vGMX8G88L4rikvAA 2wd+R1x/vFqr7IKLD9rdMAj+lu36g6Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: fa90c30f-e83f-11e8-a59a-7b143e15dabc X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id fa90c30f-e83f-11e8-a59a-7b143e15dabc; Wed, 14 Nov 2018 19:03:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wAEJ3YpR000629; Wed, 14 Nov 2018 12:03:34 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1542222214.52306.230.camel@freebsd.org> Subject: Re: svn commit: r340426 - head/sys/dev/amdtemp From: Ian Lepore To: rgrimes@freebsd.org, Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 14 Nov 2018 12:03:34 -0700 In-Reply-To: <201811141633.wAEGXSsn036705@pdx.rh.CN85.dnsmgr.net> References: <201811141633.wAEGXSsn036705@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18AAA859CE X-Spamd-Result: default: False [-103.93 / 200.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; HAS_XOIP(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[outbound.mailhop.org:+]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.14)[asn: 16509(-0.59), country: US(-0.10)]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; ARC_ALLOW(-1.00)[i=1]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[60.211.177.67.zen.spamhaus.org : 127.0.0.10]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[outbound.mailhop.org]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[195.57.186.54.list.dnswl.org : 127.0.20.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 19:04:45 -0000 On Wed, 2018-11-14 at 08:33 -0800, Rodney W. Grimes wrote: > > > > Author: cem > > Date: Wed Nov 14 04:50:29 2018 > > New Revision: 340426 > > URL: https://svnweb.freebsd.org/changeset/base/340426 > > > > Log: > >   amdtemp(4): Fix temperature reporting on AMD 2990WX > >    > >   Update the AMD family 17h temperature reporting based on AMD Tech > > Doc 56255 > >   OSRR, section 4.2.1. > >    > >   For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature > > into the > >   range -49..206; i.e., subtract 49?C. > >    > >   Submitted by: gallatin@ > >   Reported by: bcran@ > >   Reviewed by: me (long ago) > As per recent discussion on @developers, me@ is actually a valid > committers name and should not be used to describe one self in > commit messages. > There is NO ambiguity, not even a tiny little bit, between the self- referential me and the committer me@ in the context of that commit message. Is there no code to be written? No PRs to be closed? Do we all have so much free time that there's nothing better to do than argue about this kind of stupid angels-on-a-pin thing? -- Ian > > > >   MFC after: 22.57 seconds > >   Relnotes: yea > I do not believe the relnotes processor understands slang. > > > > >   Differential Revision: https://reviews.freebsd.org/D16855 > > > > Modified: > >   head/sys/dev/amdtemp/amdtemp.c > > > > Modified: head/sys/dev/amdtemp/amdtemp.c > > =================================================================== > > =========== > > --- head/sys/dev/amdtemp/amdtemp.c Wed Nov 14 03:42:39 2018 > > (r340425) > > +++ head/sys/dev/amdtemp/amdtemp.c Wed Nov 14 04:50:29 2018 > > (r340426) > > @@ -115,8 +115,15 @@ static struct amdtemp_product { > >   > >  /* > >   * Reported Temperature, Family 17h > > + * > > + * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of > > this register > > + * provide the current temp.  bit 19, when clear, means the temp > > is reported in > > + * a range 0.."225C" (probable typo for 255C), and when set > > changes the range > > + * to -49..206C. > >   */ > > -#define AMDTEMP_17H_CUR_TMP 0x59800 > > +#define AMDTEMP_17H_CUR_TMP 0x59800 > > +#define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) > > +#define AMDTEMP_17H_CUR_TMP_RANGE_OFF 490 > >   > >  /* > >   * Thermaltrip Status Register (Family 0Fh only) > > @@ -595,13 +602,15 @@ static int32_t > >  amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) > >  { > >   struct amdtemp_softc *sc = device_get_softc(dev); > > - uint32_t temp; > > + uint32_t temp, val; > >   int error; > >   > > - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, > > &temp); > > + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, > > &val); > >   KASSERT(error == 0, ("amdsmn_read")); > >   > > - temp = ((temp >> 21) & 0x7ff) * 5 / 4; > > + temp = ((val >> 21) & 0x7ff) * 5 / 4; > > + if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) > > + temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF; > >   temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; > >   > >   return (temp); > > > > From owner-svn-src-head@freebsd.org Wed Nov 14 19:06:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 361311131CC4; Wed, 14 Nov 2018 19:06:45 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0D2385B12; Wed, 14 Nov 2018 19:06:44 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DD27231DD; Wed, 14 Nov 2018 19:06:44 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEJ6ilL085637; Wed, 14 Nov 2018 19:06:44 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEJ6imf085636; Wed, 14 Nov 2018 19:06:44 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201811141906.wAEJ6imf085636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Wed, 14 Nov 2018 19:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340442 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 340442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0D2385B12 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 19:06:45 -0000 Author: sef Date: Wed Nov 14 19:06:43 2018 New Revision: 340442 URL: https://svnweb.freebsd.org/changeset/base/340442 Log: mountd has no way to configure the listen queue depth; rather than add a new option, we pass -1 down to listen, which causes it to use the kern.ipc.soacceptqueue sysctl. Approved by: mav MFC after: 2 weeks Sponsored by: iXsystems Inc Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Wed Nov 14 18:45:33 2018 (r340441) +++ head/usr.sbin/mountd/mountd.c Wed Nov 14 19:06:43 2018 (r340442) @@ -908,8 +908,12 @@ complete_service(struct netconfig *nconf, char *port_s if (fd < 0) continue; + /* + * Using -1 tells listen(2) to use + * kern.ipc.soacceptqueue for the backlog. + */ if (nconf->nc_semantics != NC_TPI_CLTS) - listen(fd, SOMAXCONN); + listen(fd, -1); if (nconf->nc_semantics == NC_TPI_CLTS ) transp = svc_dg_create(fd, 0, 0); From owner-svn-src-head@freebsd.org Wed Nov 14 19:10:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B733D1131DDC; Wed, 14 Nov 2018 19:10:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44E5D85CF4; Wed, 14 Nov 2018 19:10:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 243F9231EB; Wed, 14 Nov 2018 19:10:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEJAZGB085885; Wed, 14 Nov 2018 19:10:35 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEJAZd5085884; Wed, 14 Nov 2018 19:10:35 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811141910.wAEJAZd5085884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 14 Nov 2018 19:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340443 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44E5D85CF4 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 19:10:36 -0000 Author: glebius Date: Wed Nov 14 19:10:35 2018 New Revision: 340443 URL: https://svnweb.freebsd.org/changeset/base/340443 Log: Initialize compatibility epoch tracker for thread0. Fixes panics for drivers that call if_maddr_lock() during startup. Reported by: cy Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Nov 14 19:06:43 2018 (r340442) +++ head/sys/kern/init_main.c Wed Nov 14 19:10:35 2018 (r340443) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -510,6 +511,7 @@ proc0_init(void *dummy __unused) td->td_pflags = TDP_KTHREAD; td->td_cpuset = cpuset_thread0(); td->td_domain.dr_policy = td->td_cpuset->cs_domain; + epoch_thread_init(td); prison0_init(); p->p_peers = 0; p->p_leader = p; From owner-svn-src-head@freebsd.org Wed Nov 14 19:44:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA98111330FC; Wed, 14 Nov 2018 19:44:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 92BBE872FA; Wed, 14 Nov 2018 19:44:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAEJiWlw037424; Wed, 14 Nov 2018 11:44:32 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAEJiWFq037423; Wed, 14 Nov 2018 11:44:32 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811141944.wAEJiWFq037423@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340436 - in head/sys/dev: netmap virtio/network In-Reply-To: <201811141539.wAEFdnKQ077428@repo.freebsd.org> To: Vincenzo Maffione Date: Wed, 14 Nov 2018 11:44:32 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 92BBE872FA X-Spamd-Result: default: False [-0.28 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.21)[-0.209,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.19)[-0.190,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.10)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.76)[-0.756,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 19:44:39 -0000 > Author: vmaffione > Date: Wed Nov 14 15:39:48 2018 > New Revision: 340436 > URL: https://svnweb.freebsd.org/changeset/base/340436 > > Log: > vtnet: fix netmap support > > netmap(4) support for vtnet(4) was incomplete and had multiple bugs. > This commit fixes those bugs to bring netmap on vtnet in a functional state. > > Changelist: > - handle errors returned by virtqueue_enqueue() properly (they were > previously ignored) > - make sure netmap XOR rest of the kernel access each virtqueue. > - compute the number of netmap slots for TX and RX separately, according to > whether indirect descriptors are used or not for a given virtqueue. > - make sure sglist are freed according to their type (mbufs or netmap > buffers) > - add support for mulitiqueue and netmap host (aka sw) rings. > - intercept VQ interrupts directly instead of intercepting them in txq_eof > and rxq_eof. This simplifies the code and makes it easier to make sure > taskqueues are not running for a VQ while it is in netmap mode. > - implement vntet_netmap_config() to cope with changes in the number of queues. > > Reviewed by: bryanv > Approved by: gnn (mentor) > MFC after: 3 days > Sponsored by: Sunny Valley Networks > Differential Revision: https://reviews.freebsd.org/D17916 I would like to get some wider test of this in ^head/ specifically with use in a bhyve guest before we do an early merge to stable/12 so that this can be in the next build. If you are capable of testing this within bhyve as a guest please do so and provide feedback. It does not need to be a ^/head host, just the guest needs to be using vtnet nic's. Thanks, Rod > > Modified: > head/sys/dev/netmap/if_vtnet_netmap.h > head/sys/dev/virtio/network/if_vtnet.c > head/sys/dev/virtio/network/if_vtnetvar.h > > Modified: head/sys/dev/netmap/if_vtnet_netmap.h > ============================================================================== > --- head/sys/dev/netmap/if_vtnet_netmap.h Wed Nov 14 15:23:39 2018 (r340435) > +++ head/sys/dev/netmap/if_vtnet_netmap.h Wed Nov 14 15:39:48 2018 (r340436) > @@ -1,5 +1,5 @@ > /* > - * Copyright (C) 2014 Vincenzo Maffione, Luigi Rizzo. All rights reserved. > + * Copyright (C) 2014-2018 Vincenzo Maffione, Luigi Rizzo. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -33,74 +33,148 @@ > #include /* vtophys ? */ > #include > > +/* > + * Return 1 if the queue identified by 't' and 'idx' is in netmap mode. > + */ > +static int > +vtnet_netmap_queue_on(struct vtnet_softc *sc, enum txrx t, int idx) > +{ > + struct netmap_adapter *na = NA(sc->vtnet_ifp); > > -#define SOFTC_T vtnet_softc > + if (!nm_native_on(na)) > + return 0; > > -/* Free all the unused buffer in all the RX virtqueues. > - * This function is called when entering and exiting netmap mode. > - * - buffers queued by the virtio driver return skbuf/mbuf pointer > - * and need to be freed; > - * - buffers queued by netmap return the txq/rxq, and do not need work > - */ > + if (t == NR_RX) > + return !!(idx < na->num_rx_rings && > + na->rx_rings[idx]->nr_mode == NKR_NETMAP_ON); > + > + return !!(idx < na->num_tx_rings && > + na->tx_rings[idx]->nr_mode == NKR_NETMAP_ON); > +} > + > static void > -vtnet_netmap_free_bufs(struct SOFTC_T* sc) > +vtnet_free_used(struct virtqueue *vq, int netmap_bufs, enum txrx t, int idx) > { > - int i, nmb = 0, n = 0, last; > + void *cookie; > + int deq = 0; > > - for (i = 0; i < sc->vtnet_max_vq_pairs; i++) { > - struct vtnet_rxq *rxq = &sc->vtnet_rxqs[i]; > - struct virtqueue *vq; > - struct mbuf *m; > - struct vtnet_txq *txq = &sc->vtnet_txqs[i]; > - struct vtnet_tx_header *txhdr; > + while ((cookie = virtqueue_dequeue(vq, NULL)) != NULL) { > + if (netmap_bufs) { > + /* These are netmap buffers: there is nothing to do. */ > + } else { > + /* These are mbufs that we need to free. */ > + struct mbuf *m; > > - last = 0; > - vq = rxq->vtnrx_vq; > - while ((m = virtqueue_drain(vq, &last)) != NULL) { > - n++; > - if (m != (void *)rxq) > + if (t == NR_TX) { > + struct vtnet_tx_header *txhdr = cookie; > + m = txhdr->vth_mbuf; > m_freem(m); > - else > - nmb++; > - } > - > - last = 0; > - vq = txq->vtntx_vq; > - while ((txhdr = virtqueue_drain(vq, &last)) != NULL) { > - n++; > - if (txhdr != (void *)txq) { > - m_freem(txhdr->vth_mbuf); > uma_zfree(vtnet_tx_header_zone, txhdr); > - } else > - nmb++; > + } else { > + m = cookie; > + m_freem(m); > + } > } > + deq++; > } > - D("freed %d mbufs, %d netmap bufs on %d queues", > - n - nmb, nmb, i); > + > + if (deq) > + nm_prinf("%d sgs dequeued from %s-%d (netmap=%d)\n", > + deq, nm_txrx2str(t), idx, netmap_bufs); > } > > /* Register and unregister. */ > static int > -vtnet_netmap_reg(struct netmap_adapter *na, int onoff) > +vtnet_netmap_reg(struct netmap_adapter *na, int state) > { > - struct ifnet *ifp = na->ifp; > - struct SOFTC_T *sc = ifp->if_softc; > + struct ifnet *ifp = na->ifp; > + struct vtnet_softc *sc = ifp->if_softc; > + int success; > + enum txrx t; > + int i; > > + /* Drain the taskqueues to make sure that there are no worker threads > + * accessing the virtqueues. */ > + vtnet_drain_taskqueues(sc); > + > VTNET_CORE_LOCK(sc); > - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); > - /* enable or disable flags and callbacks in na and ifp */ > - if (onoff) { > + > + /* We need nm_netmap_on() to return true when called by > + * vtnet_init_locked() below. */ > + if (state) > nm_set_native_flags(na); > + > + /* We need to trigger a device reset in order to unexpose guest buffers > + * published to the host. */ > + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); > + /* Get pending used buffers. The way they are freed depends on whether > + * they are netmap buffer or they are mbufs. We can tell apart the two > + * cases by looking at kring->nr_mode, before this is possibly updated > + * in the loop below. */ > + for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { > + struct vtnet_txq *txq = &sc->vtnet_txqs[i]; > + struct vtnet_rxq *rxq = &sc->vtnet_rxqs[i]; > + struct netmap_kring *kring; > + > + VTNET_TXQ_LOCK(txq); > + kring = NMR(na, NR_TX)[i]; > + vtnet_free_used(txq->vtntx_vq, > + kring->nr_mode == NKR_NETMAP_ON, NR_TX, i); > + VTNET_TXQ_UNLOCK(txq); > + > + VTNET_RXQ_LOCK(rxq); > + kring = NMR(na, NR_RX)[i]; > + vtnet_free_used(rxq->vtnrx_vq, > + kring->nr_mode == NKR_NETMAP_ON, NR_RX, i); > + VTNET_RXQ_UNLOCK(rxq); > + } > + vtnet_init_locked(sc); > + success = (ifp->if_drv_flags & IFF_DRV_RUNNING) ? 0 : ENXIO; > + > + if (state) { > + for_rx_tx(t) { > + /* Hardware rings. */ > + for (i = 0; i < nma_get_nrings(na, t); i++) { > + struct netmap_kring *kring = NMR(na, t)[i]; > + > + if (nm_kring_pending_on(kring)) > + kring->nr_mode = NKR_NETMAP_ON; > + } > + > + /* Host rings. */ > + for (i = 0; i < nma_get_host_nrings(na, t); i++) { > + struct netmap_kring *kring = > + NMR(na, t)[nma_get_nrings(na, t) + i]; > + > + if (nm_kring_pending_on(kring)) > + kring->nr_mode = NKR_NETMAP_ON; > + } > + } > } else { > nm_clear_native_flags(na); > + for_rx_tx(t) { > + /* Hardware rings. */ > + for (i = 0; i < nma_get_nrings(na, t); i++) { > + struct netmap_kring *kring = NMR(na, t)[i]; > + > + if (nm_kring_pending_off(kring)) > + kring->nr_mode = NKR_NETMAP_OFF; > + } > + > + /* Host rings. */ > + for (i = 0; i < nma_get_host_nrings(na, t); i++) { > + struct netmap_kring *kring = > + NMR(na, t)[nma_get_nrings(na, t) + i]; > + > + if (nm_kring_pending_off(kring)) > + kring->nr_mode = NKR_NETMAP_OFF; > + } > + } > } > - /* drain queues so netmap and native drivers > - * do not interfere with each other > - */ > - vtnet_netmap_free_bufs(sc); > - vtnet_init_locked(sc); /* also enable intr */ > - VTNET_CORE_UNLOCK(sc); > - return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); > + > + VTNET_CORE_UNLOCK(sc); > + > + return success; > } > > > @@ -109,20 +183,19 @@ static int > vtnet_netmap_txsync(struct netmap_kring *kring, int flags) > { > struct netmap_adapter *na = kring->na; > - struct ifnet *ifp = na->ifp; > + struct ifnet *ifp = na->ifp; > struct netmap_ring *ring = kring->ring; > u_int ring_nr = kring->ring_id; > u_int nm_i; /* index into the netmap ring */ > - u_int nic_i; /* index into the NIC ring */ > - u_int n; > u_int const lim = kring->nkr_num_slots - 1; > u_int const head = kring->rhead; > > /* device-specific */ > - struct SOFTC_T *sc = ifp->if_softc; > + struct vtnet_softc *sc = ifp->if_softc; > struct vtnet_txq *txq = &sc->vtnet_txqs[ring_nr]; > struct virtqueue *vq = txq->vtntx_vq; > int interrupts = !(kring->nr_kflags & NKR_NOINTR); > + u_int n; > > /* > * First part: process new packets to send. > @@ -133,15 +206,13 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl > if (nm_i != head) { /* we have new packets to send */ > struct sglist *sg = txq->vtntx_sg; > > - nic_i = netmap_idx_k2n(kring, nm_i); > - for (n = 0; nm_i != head; n++) { > + for (; nm_i != head; nm_i = nm_next(nm_i, lim)) { > /* we use an empty header here */ > - static struct virtio_net_hdr_mrg_rxbuf hdr; > struct netmap_slot *slot = &ring->slot[nm_i]; > u_int len = slot->len; > uint64_t paddr; > void *addr = PNMB(na, slot, &paddr); > - int err; > + int err; > > NM_CHECK_ADDR_LEN(na, addr, len); > > @@ -150,88 +221,63 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl > * and kick the hypervisor (if necessary). > */ > sglist_reset(sg); // cheap > - // if vtnet_hdr_size > 0 ... > - err = sglist_append(sg, &hdr, sc->vtnet_hdr_size); > - // XXX later, support multi segment > - err = sglist_append_phys(sg, paddr, len); > - /* use na as the cookie */ > - err = virtqueue_enqueue(vq, txq, sg, sg->sg_nseg, 0); > - if (unlikely(err < 0)) { > - D("virtqueue_enqueue failed"); > - break; > - } > - > - nm_i = nm_next(nm_i, lim); > - nic_i = nm_next(nic_i, lim); > + err = sglist_append(sg, &txq->vtntx_shrhdr, sc->vtnet_hdr_size); > + err |= sglist_append_phys(sg, paddr, len); > + KASSERT(err == 0, ("%s: cannot append to sglist %d", > + __func__, err)); > + err = virtqueue_enqueue(vq, /*cookie=*/txq, sg, > + /*readable=*/sg->sg_nseg, > + /*writeable=*/0); > + if (unlikely(err)) { > + if (err != ENOSPC) > + nm_prerr("virtqueue_enqueue(%s) failed: %d\n", > + kring->name, err); > + break; > + } > } > - /* Update hwcur depending on where we stopped. */ > - kring->nr_hwcur = nm_i; /* note we migth break early */ > > - /* No more free TX slots? Ask the hypervisor for notifications, > - * possibly only when a considerable amount of work has been > - * done. > - */ > - ND(3,"sent %d packets, hwcur %d", n, nm_i); > - virtqueue_disable_intr(vq); > virtqueue_notify(vq); > - } else { > - if (ring->head != ring->tail) > - ND(5, "pure notify ? head %d tail %d nused %d %d", > - ring->head, ring->tail, virtqueue_nused(vq), > - (virtqueue_dump(vq), 1)); > - virtqueue_notify(vq); > - if (interrupts) { > - virtqueue_enable_intr(vq); // like postpone with 0 > - } > + > + /* Update hwcur depending on where we stopped. */ > + kring->nr_hwcur = nm_i; /* note we migth break early */ > } > > - > - /* Free used slots. We only consider our own used buffers, recognized > - * by the token we passed to virtqueue_add_outbuf. > + /* Free used slots. We only consider our own used buffers, recognized > + * by the token we passed to virtqueue_enqueue. > */ > - n = 0; > - for (;;) { > - struct vtnet_tx_header *txhdr = virtqueue_dequeue(vq, NULL); > - if (txhdr == NULL) > - break; > - if (likely(txhdr == (void *)txq)) { > - n++; > - if (virtqueue_nused(vq) < 32) { // XXX slow release > - break; > - } > - } else { /* leftover from previous transmission */ > - m_freem(txhdr->vth_mbuf); > - uma_zfree(vtnet_tx_header_zone, txhdr); > - } > - } > - if (n) { > + n = 0; > + for (;;) { > + void *token = virtqueue_dequeue(vq, NULL); > + if (token == NULL) > + break; > + if (unlikely(token != (void *)txq)) > + nm_prerr("BUG: TX token mismatch\n"); > + else > + n++; > + } > + if (n > 0) { > kring->nr_hwtail += n; > if (kring->nr_hwtail > lim) > kring->nr_hwtail -= lim + 1; > } > - if (nm_i != kring->nr_hwtail /* && vtnet_txq_below_threshold(txq) == 0*/) { > - ND(3, "disable intr, hwcur %d", nm_i); > - virtqueue_disable_intr(vq); > - } else if (interrupts) { > - ND(3, "enable intr, hwcur %d", nm_i); > - virtqueue_postpone_intr(vq, VQ_POSTPONE_SHORT); > - } > > - return 0; > + if (interrupts && virtqueue_nfree(vq) < 32) > + virtqueue_postpone_intr(vq, VQ_POSTPONE_LONG); > + > + return 0; > } > > static int > -vtnet_refill_rxq(struct netmap_kring *kring, u_int nm_i, u_int head) > +vtnet_netmap_kring_refill(struct netmap_kring *kring, u_int nm_i, u_int head) > { > struct netmap_adapter *na = kring->na; > - struct ifnet *ifp = na->ifp; > + struct ifnet *ifp = na->ifp; > struct netmap_ring *ring = kring->ring; > u_int ring_nr = kring->ring_id; > u_int const lim = kring->nkr_num_slots - 1; > - u_int n; > > /* device-specific */ > - struct SOFTC_T *sc = ifp->if_softc; > + struct vtnet_softc *sc = ifp->if_softc; > struct vtnet_rxq *rxq = &sc->vtnet_rxqs[ring_nr]; > struct virtqueue *vq = rxq->vtnrx_vq; > > @@ -239,12 +285,11 @@ vtnet_refill_rxq(struct netmap_kring *kring, u_int nm_ > struct sglist_seg ss[2]; > struct sglist sg = { ss, 0, 0, 2 }; > > - for (n = 0; nm_i != head; n++) { > - static struct virtio_net_hdr_mrg_rxbuf hdr; > + for (; nm_i != head; nm_i = nm_next(nm_i, lim)) { > struct netmap_slot *slot = &ring->slot[nm_i]; > uint64_t paddr; > void *addr = PNMB(na, slot, &paddr); > - int err = 0; > + int err; > > if (addr == NETMAP_BUF_BASE(na)) { /* bad buf */ > if (netmap_ring_reinit(kring)) > @@ -252,99 +297,134 @@ vtnet_refill_rxq(struct netmap_kring *kring, u_int nm_ > } > > slot->flags &= ~NS_BUF_CHANGED; > - sglist_reset(&sg); // cheap > - err = sglist_append(&sg, &hdr, sc->vtnet_hdr_size); > - err = sglist_append_phys(&sg, paddr, NETMAP_BUF_SIZE(na)); > + sglist_reset(&sg); > + err = sglist_append(&sg, &rxq->vtnrx_shrhdr, sc->vtnet_hdr_size); > + err |= sglist_append_phys(&sg, paddr, NETMAP_BUF_SIZE(na)); > + KASSERT(err == 0, ("%s: cannot append to sglist %d", > + __func__, err)); > /* writable for the host */ > - err = virtqueue_enqueue(vq, rxq, &sg, 0, sg.sg_nseg); > - if (err < 0) { > - D("virtqueue_enqueue failed"); > + err = virtqueue_enqueue(vq, /*cookie=*/rxq, &sg, > + /*readable=*/0, /*writeable=*/sg.sg_nseg); > + if (unlikely(err)) { > + if (err != ENOSPC) > + nm_prerr("virtqueue_enqueue(%s) failed: %d\n", > + kring->name, err); > break; > } > - nm_i = nm_next(nm_i, lim); > } > + > return nm_i; > } > > +/* > + * Publish netmap buffers on a RX virtqueue. > + * Returns -1 if this virtqueue is not being opened in netmap mode. > + * If the virtqueue is being opened in netmap mode, return 0 on success and > + * a positive error code on failure. > + */ > +static int > +vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq) > +{ > + struct netmap_adapter *na = NA(rxq->vtnrx_sc->vtnet_ifp); > + struct netmap_kring *kring; > + int error; > + > + if (!nm_native_on(na) || rxq->vtnrx_id >= na->num_rx_rings) > + return -1; > + > + kring = na->rx_rings[rxq->vtnrx_id]; > + if (!(nm_kring_pending_on(kring) || > + kring->nr_pending_mode == NKR_NETMAP_ON)) > + return -1; > + > + /* Expose all the RX netmap buffers. Note that the number of > + * netmap slots in the RX ring matches the maximum number of > + * 2-elements sglist that the RX virtqueue can accommodate. */ > + error = vtnet_netmap_kring_refill(kring, 0, na->num_rx_desc); > + virtqueue_notify(rxq->vtnrx_vq); > + > + return error < 0 ? ENXIO : 0; > +} > + > /* Reconcile kernel and user view of the receive ring. */ > static int > vtnet_netmap_rxsync(struct netmap_kring *kring, int flags) > { > struct netmap_adapter *na = kring->na; > - struct ifnet *ifp = na->ifp; > + struct ifnet *ifp = na->ifp; > struct netmap_ring *ring = kring->ring; > u_int ring_nr = kring->ring_id; > u_int nm_i; /* index into the netmap ring */ > - // u_int nic_i; /* index into the NIC ring */ > - u_int n; > u_int const lim = kring->nkr_num_slots - 1; > u_int const head = kring->rhead; > - int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; > + int force_update = (flags & NAF_FORCE_READ) || > + (kring->nr_kflags & NKR_PENDINTR); > int interrupts = !(kring->nr_kflags & NKR_NOINTR); > > /* device-specific */ > - struct SOFTC_T *sc = ifp->if_softc; > + struct vtnet_softc *sc = ifp->if_softc; > struct vtnet_rxq *rxq = &sc->vtnet_rxqs[ring_nr]; > struct virtqueue *vq = rxq->vtnrx_vq; > > - /* XXX netif_carrier_ok ? */ > - > - if (head > lim) > - return netmap_ring_reinit(kring); > - > rmb(); > /* > * First part: import newly received packets. > - * Only accept our > - * own buffers (matching the token). We should only get > - * matching buffers, because of vtnet_netmap_free_rx_unused_bufs() > - * and vtnet_netmap_init_buffers(). > + * Only accept our own buffers (matching the token). We should only get > + * matching buffers. We may need to stop early to avoid hwtail to overrun > + * hwcur. > */ > if (netmap_no_pendintr || force_update) { > - struct netmap_adapter *token; > + uint32_t hwtail_lim = nm_prev(kring->nr_hwcur, lim); > + void *token; > > - nm_i = kring->nr_hwtail; > - n = 0; > - for (;;) { > + vtnet_rxq_disable_intr(rxq); > + > + nm_i = kring->nr_hwtail; > + while (nm_i != hwtail_lim) { > int len; > - token = virtqueue_dequeue(vq, &len); > - if (token == NULL) > - break; > - if (likely(token == (void *)rxq)) { > - ring->slot[nm_i].len = len; > - ring->slot[nm_i].flags = 0; > - nm_i = nm_next(nm_i, lim); > - n++; > - } else { > - D("This should not happen"); > - } > + token = virtqueue_dequeue(vq, &len); > + if (token == NULL) { > + if (interrupts && vtnet_rxq_enable_intr(rxq)) { > + vtnet_rxq_disable_intr(rxq); > + continue; > + } > + break; > + } > + if (unlikely(token != (void *)rxq)) { > + nm_prerr("BUG: RX token mismatch\n"); > + } else { > + /* Skip the virtio-net header. */ > + len -= sc->vtnet_hdr_size; > + if (unlikely(len < 0)) { > + RD(1, "Truncated virtio-net-header, " > + "missing %d bytes", -len); > + len = 0; > + } > + ring->slot[nm_i].len = len; > + ring->slot[nm_i].flags = 0; > + nm_i = nm_next(nm_i, lim); > + } > } > kring->nr_hwtail = nm_i; > kring->nr_kflags &= ~NKR_PENDINTR; > } > - ND("[B] h %d c %d hwcur %d hwtail %d", > - ring->head, ring->cur, kring->nr_hwcur, > - kring->nr_hwtail); > + ND("[B] h %d c %d hwcur %d hwtail %d", ring->head, ring->cur, > + kring->nr_hwcur, kring->nr_hwtail); > > /* > * Second part: skip past packets that userspace has released. > */ > nm_i = kring->nr_hwcur; /* netmap ring index */ > if (nm_i != head) { > - int err = vtnet_refill_rxq(kring, nm_i, head); > - if (err < 0) > - return 1; > - kring->nr_hwcur = err; > + int nm_j = vtnet_netmap_kring_refill(kring, nm_i, head); > + if (nm_j < 0) > + return nm_j; > + kring->nr_hwcur = nm_j; > virtqueue_notify(vq); > - /* After draining the queue may need an intr from the hypervisor */ > - if (interrupts) { > - vtnet_rxq_enable_intr(rxq); > - } > } > > - ND("[C] h %d c %d t %d hwcur %d hwtail %d", > - ring->head, ring->cur, ring->tail, > - kring->nr_hwcur, kring->nr_hwtail); > + ND("[C] h %d c %d t %d hwcur %d hwtail %d", ring->head, ring->cur, > + ring->tail, kring->nr_hwcur, kring->nr_hwtail); > > return 0; > } > @@ -352,9 +432,9 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl > > /* Enable/disable interrupts on all virtqueues. */ > static void > -vtnet_netmap_intr(struct netmap_adapter *na, int onoff) > +vtnet_netmap_intr(struct netmap_adapter *na, int state) > { > - struct SOFTC_T *sc = na->ifp->if_softc; > + struct vtnet_softc *sc = na->ifp->if_softc; > int i; > > for (i = 0; i < sc->vtnet_max_vq_pairs; i++) { > @@ -362,7 +442,7 @@ vtnet_netmap_intr(struct netmap_adapter *na, int onoff > struct vtnet_txq *txq = &sc->vtnet_txqs[i]; > struct virtqueue *txvq = txq->vtntx_vq; > > - if (onoff) { > + if (state) { > vtnet_rxq_enable_intr(rxq); > virtqueue_enable_intr(txvq); > } else { > @@ -372,60 +452,88 @@ vtnet_netmap_intr(struct netmap_adapter *na, int onoff > } > } > > -/* Make RX virtqueues buffers pointing to netmap buffers. */ > static int > -vtnet_netmap_init_rx_buffers(struct SOFTC_T *sc) > +vtnet_netmap_tx_slots(struct vtnet_softc *sc) > { > - struct ifnet *ifp = sc->vtnet_ifp; > - struct netmap_adapter* na = NA(ifp); > - unsigned int r; > + int div; > > - if (!nm_native_on(na)) > - return 0; > - for (r = 0; r < na->num_rx_rings; r++) { > - struct netmap_kring *kring = na->rx_rings[r]; > - struct vtnet_rxq *rxq = &sc->vtnet_rxqs[r]; > - struct virtqueue *vq = rxq->vtnrx_vq; > - struct netmap_slot* slot; > - int err = 0; > + /* We need to prepend a virtio-net header to each netmap buffer to be > + * transmitted, therefore calling virtqueue_enqueue() passing sglist > + * with 2 elements. > + * TX virtqueues use indirect descriptors if the feature was negotiated > + * with the host, and if sc->vtnet_tx_nsegs > 1. With indirect > + * descriptors, a single virtio descriptor is sufficient to reference > + * each TX sglist. Without them, we need two separate virtio descriptors > + * for each TX sglist. We therefore compute the number of netmap TX > + * slots according to these assumptions. > + */ > + if ((sc->vtnet_flags & VTNET_FLAG_INDIRECT) && sc->vtnet_tx_nsegs > 1) > + div = 1; > + else > + div = 2; > > - slot = netmap_reset(na, NR_RX, r, 0); > - if (!slot) { > - D("strange, null netmap ring %d", r); > - return 0; > - } > - /* Add up to na>-num_rx_desc-1 buffers to this RX virtqueue. > - * It's important to leave one virtqueue slot free, otherwise > - * we can run into ring->cur/ring->tail wraparounds. > - */ > - err = vtnet_refill_rxq(kring, 0, na->num_rx_desc-1); > - if (err < 0) > - return 0; > - virtqueue_notify(vq); > - } > + return virtqueue_size(sc->vtnet_txqs[0].vtntx_vq) / div; > +} > > - return 1; > +static int > +vtnet_netmap_rx_slots(struct vtnet_softc *sc) > +{ > + int div; > + > + /* We need to prepend a virtio-net header to each netmap buffer to be > + * received, therefore calling virtqueue_enqueue() passing sglist > + * with 2 elements. > + * RX virtqueues use indirect descriptors if the feature was negotiated > + * with the host, and if sc->vtnet_rx_nsegs > 1. With indirect > + * descriptors, a single virtio descriptor is sufficient to reference > + * each RX sglist. Without them, we need two separate virtio descriptors > + * for each RX sglist. We therefore compute the number of netmap RX > + * slots according to these assumptions. > + */ > + if ((sc->vtnet_flags & VTNET_FLAG_INDIRECT) && sc->vtnet_rx_nsegs > 1) > + div = 1; > + else > + div = 2; > + > + return virtqueue_size(sc->vtnet_rxqs[0].vtnrx_vq) / div; > } > > +static int > +vtnet_netmap_config(struct netmap_adapter *na, struct nm_config_info *info) > +{ > + struct vtnet_softc *sc = na->ifp->if_softc; > + > + info->num_tx_rings = sc->vtnet_act_vq_pairs; > + info->num_rx_rings = sc->vtnet_act_vq_pairs; > + info->num_tx_descs = vtnet_netmap_tx_slots(sc); > + info->num_rx_descs = vtnet_netmap_rx_slots(sc); > + info->rx_buf_maxsize = NETMAP_BUF_SIZE(na); > + > + return 0; > +} > + > static void > -vtnet_netmap_attach(struct SOFTC_T *sc) > +vtnet_netmap_attach(struct vtnet_softc *sc) > { > struct netmap_adapter na; > > bzero(&na, sizeof(na)); > > na.ifp = sc->vtnet_ifp; > - na.num_tx_desc = 1024;// sc->vtnet_rx_nmbufs; > - na.num_rx_desc = 1024; // sc->vtnet_rx_nmbufs; > + na.na_flags = 0; > + na.num_tx_desc = vtnet_netmap_tx_slots(sc); > + na.num_rx_desc = vtnet_netmap_rx_slots(sc); > + na.num_tx_rings = na.num_rx_rings = sc->vtnet_max_vq_pairs; > + na.rx_buf_maxsize = 0; > na.nm_register = vtnet_netmap_reg; > na.nm_txsync = vtnet_netmap_txsync; > na.nm_rxsync = vtnet_netmap_rxsync; > na.nm_intr = vtnet_netmap_intr; > - na.num_tx_rings = na.num_rx_rings = sc->vtnet_max_vq_pairs; > - D("max rings %d", sc->vtnet_max_vq_pairs); > + na.nm_config = vtnet_netmap_config; > + > netmap_attach(&na); > > - D("virtio attached txq=%d, txd=%d rxq=%d, rxd=%d", > + nm_prinf("vtnet attached txq=%d, txd=%d rxq=%d, rxd=%d\n", > na.num_tx_rings, na.num_tx_desc, > na.num_tx_rings, na.num_rx_desc); > } > > Modified: head/sys/dev/virtio/network/if_vtnet.c > ============================================================================== > --- head/sys/dev/virtio/network/if_vtnet.c Wed Nov 14 15:23:39 2018 (r340435) > +++ head/sys/dev/virtio/network/if_vtnet.c Wed Nov 14 15:39:48 2018 (r340436) > @@ -1192,6 +1192,12 @@ vtnet_rxq_populate(struct vtnet_rxq *rxq) > struct virtqueue *vq; > int nbufs, error; > > +#ifdef DEV_NETMAP > + error = vtnet_netmap_rxq_populate(rxq); > + if (error >= 0) > + return (error); > +#endif /* DEV_NETMAP */ > + > vq = rxq->vtnrx_vq; > error = ENOSPC; > > @@ -1221,12 +1227,20 @@ vtnet_rxq_free_mbufs(struct vtnet_rxq *rxq) > struct virtqueue *vq; > struct mbuf *m; > int last; > +#ifdef DEV_NETMAP > + int netmap_bufs = vtnet_netmap_queue_on(rxq->vtnrx_sc, NR_RX, > + rxq->vtnrx_id); > +#else /* !DEV_NETMAP */ > + int netmap_bufs = 0; > +#endif /* !DEV_NETMAP */ > > vq = rxq->vtnrx_vq; > last = 0; > > - while ((m = virtqueue_drain(vq, &last)) != NULL) > - m_freem(m); > + while ((m = virtqueue_drain(vq, &last)) != NULL) { > + if (!netmap_bufs) > + m_freem(m); > + } > > KASSERT(virtqueue_empty(vq), > ("%s: mbufs remaining in rx queue %p", __func__, rxq)); > @@ -1772,12 +1786,6 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > > VTNET_RXQ_LOCK_ASSERT(rxq); > > -#ifdef DEV_NETMAP > - if (netmap_rx_irq(ifp, 0, &deq)) { > - return (FALSE); > - } > -#endif /* DEV_NETMAP */ > - > while (count-- > 0) { > m = virtqueue_dequeue(vq, &len); > if (m == NULL) > @@ -1871,6 +1879,11 @@ vtnet_rx_vq_intr(void *xrxq) > return; > } > > +#ifdef DEV_NETMAP > + if (netmap_rx_irq(ifp, rxq->vtnrx_id, &more) != NM_IRQ_PASS) > + return; > +#endif /* DEV_NETMAP */ > + > VTNET_RXQ_LOCK(rxq); > > again: > @@ -1971,13 +1984,21 @@ vtnet_txq_free_mbufs(struct vtnet_txq *txq) > struct virtqueue *vq; > struct vtnet_tx_header *txhdr; > int last; > +#ifdef DEV_NETMAP > + int netmap_bufs = vtnet_netmap_queue_on(txq->vtntx_sc, NR_TX, > + txq->vtntx_id); > +#else /* !DEV_NETMAP */ > + int netmap_bufs = 0; > +#endif /* !DEV_NETMAP */ > > vq = txq->vtntx_vq; > last = 0; > > while ((txhdr = virtqueue_drain(vq, &last)) != NULL) { > - m_freem(txhdr->vth_mbuf); > - uma_zfree(vtnet_tx_header_zone, txhdr); > + if (!netmap_bufs) { > + m_freem(txhdr->vth_mbuf); > + uma_zfree(vtnet_tx_header_zone, txhdr); > + } > } > > KASSERT(virtqueue_empty(vq), > @@ -2465,13 +2486,6 @@ vtnet_txq_eof(struct vtnet_txq *txq) > deq = 0; > VTNET_TXQ_LOCK_ASSERT(txq); > > -#ifdef DEV_NETMAP > - if (netmap_tx_irq(txq->vtntx_sc->vtnet_ifp, txq->vtntx_id)) { > - virtqueue_disable_intr(vq); // XXX luigi > - return 0; // XXX or 1 ? > - } > -#endif /* DEV_NETMAP */ > - > while ((txhdr = virtqueue_dequeue(vq, NULL)) != NULL) { > m = txhdr->vth_mbuf; > deq++; > @@ -2513,6 +2527,11 @@ vtnet_tx_vq_intr(void *xtxq) > return; > } > > +#ifdef DEV_NETMAP > + if (netmap_tx_irq(ifp, txq->vtntx_id) != NM_IRQ_PASS) > + return; > +#endif /* DEV_NETMAP */ > + > VTNET_TXQ_LOCK(txq); > > if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { > @@ -2769,11 +2788,6 @@ vtnet_drain_rxtx_queues(struct vtnet_softc *sc) > struct vtnet_txq *txq; > int i; > > -#ifdef DEV_NETMAP > - if (nm_native_on(NA(sc->vtnet_ifp))) > - return; > -#endif /* DEV_NETMAP */ > - > for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { > rxq = &sc->vtnet_rxqs[i]; > vtnet_rxq_free_mbufs(rxq); > @@ -2938,11 +2952,6 @@ vtnet_init_rx_queues(struct vtnet_softc *sc) > ("%s: too many rx mbufs %d for %d segments", __func__, > sc->vtnet_rx_nmbufs, sc->vtnet_rx_nsegs)); > > -#ifdef DEV_NETMAP > - if (vtnet_netmap_init_rx_buffers(sc)) > - return 0; > -#endif /* DEV_NETMAP */ > - > for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { > rxq = &sc->vtnet_rxqs[i]; > > @@ -3092,13 +3101,6 @@ vtnet_init(void *xsc) > struct vtnet_softc *sc; > > sc = xsc; > - > -#ifdef DEV_NETMAP > - if (!NA(sc->vtnet_ifp)) { > - D("try to attach again"); > - vtnet_netmap_attach(sc); > - } > -#endif /* DEV_NETMAP */ > > VTNET_CORE_LOCK(sc); > vtnet_init_locked(sc); > > Modified: head/sys/dev/virtio/network/if_vtnetvar.h > ============================================================================== > --- head/sys/dev/virtio/network/if_vtnetvar.h Wed Nov 14 15:23:39 2018 (r340435) > +++ head/sys/dev/virtio/network/if_vtnetvar.h Wed Nov 14 15:39:48 2018 (r340436) > @@ -79,6 +79,9 @@ struct vtnet_rxq { > struct vtnet_rxq_stats vtnrx_stats; > struct taskqueue *vtnrx_tq; > struct task vtnrx_intrtask; > +#ifdef DEV_NETMAP > + struct virtio_net_hdr_mrg_rxbuf vtnrx_shrhdr; > +#endif /* DEV_NETMAP */ > char vtnrx_name[16]; > } __aligned(CACHE_LINE_SIZE); > > @@ -114,6 +117,9 @@ struct vtnet_txq { > #ifndef VTNET_LEGACY_TX > struct task vtntx_defrtask; > #endif > +#ifdef DEV_NETMAP > + struct virtio_net_hdr_mrg_rxbuf vtntx_shrhdr; > +#endif /* DEV_NETMAP */ > char vtntx_name[16]; > } __aligned(CACHE_LINE_SIZE); > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Nov 14 20:28:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F7F911341A9; Wed, 14 Nov 2018 20:28:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 6FE4E6AC23; Wed, 14 Nov 2018 20:28:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wAEKRmIl008503 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 Nov 2018 22:27:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wAEKRmIl008503 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wAEKRm8I008502; Wed, 14 Nov 2018 22:27:48 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 14 Nov 2018 22:27:48 +0200 From: Konstantin Belousov To: Gleb Smirnoff Cc: Hans Petter Selasky , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340413 - in head/sys: kern net sys Message-ID: <20181114202748.GM2378@kib.kiev.ua> References: <201811140933.wAE9XxSL003613@slippy.cwsent.com> <178c3d69-4a3b-49cb-dab4-f6f4139dfc1a@selasky.org> <20181114162831.GM9744@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181114162831.GM9744@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 6FE4E6AC23 X-Spamd-Result: default: False [-5.20 / 200.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.20)[ip: (-2.79), ipnet: 2001:470::/32(-4.54), asn: 6939(-3.58), country: US(-0.10)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 20:28:05 -0000 On Wed, Nov 14, 2018 at 08:28:31AM -0800, Gleb Smirnoff wrote: > On Wed, Nov 14, 2018 at 11:06:38AM +0100, Hans Petter Selasky wrote: > H> On 11/14/18 10:33 AM, Cy Schubert wrote: > H> > + epoch_thread_init(td); > H> > H> Did you forget to call epoch_thread_init() for thread0 ? > > Yes, this is my guess. I'm preparing patch for Cy to test. Is this stuff allocated for each thread, unconditionally ? If yes, why is it allocatable instead of embedding it into struct thread ? From owner-svn-src-head@freebsd.org Wed Nov 14 20:36:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A8D91134745; Wed, 14 Nov 2018 20:36:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81D526B344; Wed, 14 Nov 2018 20:36:19 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63DDA240C4; Wed, 14 Nov 2018 20:36:19 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEKaJf7031950; Wed, 14 Nov 2018 20:36:19 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEKaJWW031949; Wed, 14 Nov 2018 20:36:19 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811142036.wAEKaJWW031949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 14 Nov 2018 20:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340445 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 340445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 81D526B344 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 20:36:20 -0000 Author: shurd Date: Wed Nov 14 20:36:18 2018 New Revision: 340445 URL: https://svnweb.freebsd.org/changeset/base/340445 Log: Clear RX completion queue state veriables in iflib_stop() iflib_stop() was not resetting the rxq completion queue state variables. This meant that for any driver that has receive completion queues, after a reinit, iflib would start asking what's available on the rx side starting at whatever the completion queue index was prior to the stop, instead of at 0. Submitted by: pkelsey Reported by: pkelsey MFC after: 3 days Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Nov 14 20:35:04 2018 (r340444) +++ head/sys/net/iflib.c Wed Nov 14 20:36:18 2018 (r340445) @@ -2414,6 +2414,7 @@ iflib_stop(if_ctx_t ctx) for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ + rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ From owner-svn-src-head@freebsd.org Wed Nov 14 20:46:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFF3C1134AF6; Wed, 14 Nov 2018 20:46:35 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 715DC6B84D; Wed, 14 Nov 2018 20:46:35 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: vmaffione) by smtp.freebsd.org (Postfix) with ESMTPSA id 35D7B2DBEB; Wed, 14 Nov 2018 20:46:35 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: by mail-qk1-f174.google.com with SMTP id w204so28316269qka.2; Wed, 14 Nov 2018 12:46:35 -0800 (PST) X-Gm-Message-State: AGRZ1gImo7eu7o6r/HwkMQWfQInQyTHNVZIW90lFpCkSKNk1b6nvZg2T gWWNR2T55Q9o5Kv2E6NnVowKiydHtDO+qmXT8rY= X-Google-Smtp-Source: AJdET5dWYOC40ppj9FVKEtl3dBnjSAuCrmYi5/UxI/L9mkuyLtJzFwLTbNxxVh7gmBOO4GFwdKr/9AB6Tl/yytG/osk= X-Received: by 2002:a37:bb82:: with SMTP id l124mr3282474qkf.188.1542228394572; Wed, 14 Nov 2018 12:46:34 -0800 (PST) MIME-Version: 1.0 References: <201811141539.wAEFdnKQ077428@repo.freebsd.org> <201811141944.wAEJiWFq037423@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811141944.wAEJiWFq037423@pdx.rh.CN85.dnsmgr.net> From: Vincenzo Maffione Date: Wed, 14 Nov 2018 21:46:23 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340436 - in head/sys/dev: netmap virtio/network To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 715DC6B84D X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 20:46:36 -0000 On Wed, Nov 14, 2018, 8:44 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > Author: vmaffione > > Date: Wed Nov 14 15:39:48 2018 > > New Revision: 340436 > > URL: https://svnweb.freebsd.org/changeset/base/340436 > > > > Log: > > vtnet: fix netmap support > > > > netmap(4) support for vtnet(4) was incomplete and had multiple bugs. > > This commit fixes those bugs to bring netmap on vtnet in a functional > state. > > > > Changelist: > > - handle errors returned by virtqueue_enqueue() properly (they were > > previously ignored) > > - make sure netmap XOR rest of the kernel access each virtqueue. > > - compute the number of netmap slots for TX and RX separately, > according to > > whether indirect descriptors are used or not for a given virtqueue. > > - make sure sglist are freed according to their type (mbufs or netmap > > buffers) > > - add support for mulitiqueue and netmap host (aka sw) rings. > > - intercept VQ interrupts directly instead of intercepting them in > txq_eof > > and rxq_eof. This simplifies the code and makes it easier to make > sure > > taskqueues are not running for a VQ while it is in netmap mode. > > - implement vntet_netmap_config() to cope with changes in the number > of queues. > > > > Reviewed by: bryanv > > Approved by: gnn (mentor) > > MFC after: 3 days > > Sponsored by: Sunny Valley Networks > > Differential Revision: https://reviews.freebsd.org/D17916 > > I would like to get some wider test of this in ^head/ > specifically with use in a bhyve guest before we do > an early merge to stable/12 so that this can be in > the next build. > > If you are capable of testing this within bhyve as a guest > please do so and provide feedback. It does not need to be > a ^/head host, just the guest needs to be using vtnet > nic's. > > The tests I did are reported here https://reviews.freebsd.org/D17916 , and consist of one or two ^/head guests, each one having a vtnet NIC. The hypervisor is qemu-kvm, running in the host. Unfortunately I cannot do tests with bhyve as an hypervisor, because that requires a FreeBSD host (e.g., ^/head , stable/12 or stable/11), and at the moment I don't have one. Cheers, Vincenzo From owner-svn-src-head@freebsd.org Wed Nov 14 21:08:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AF021135229; Wed, 14 Nov 2018 21:08:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 7CB756C2B2; Wed, 14 Nov 2018 21:08:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAEL89G9037783; Wed, 14 Nov 2018 13:08:09 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAEL89rT037782; Wed, 14 Nov 2018 13:08:09 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811142108.wAEL89rT037782@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340436 - in head/sys/dev: netmap virtio/network In-Reply-To: To: Vincenzo Maffione Date: Wed, 14 Nov 2018 13:08:09 -0800 (PST) CC: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 7CB756C2B2 X-Spamd-Result: default: False [0.65 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.19)[-0.193,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.18)[-0.176,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.10)]; NEURAL_SPAM_SHORT(0.15)[0.151,0]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 21:08:14 -0000 > On Wed, Nov 14, 2018, 8:44 PM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > > > Author: vmaffione > > > Date: Wed Nov 14 15:39:48 2018 > > > New Revision: 340436 > > > URL: https://svnweb.freebsd.org/changeset/base/340436 > > > > > > Log: > > > vtnet: fix netmap support > > > > > > netmap(4) support for vtnet(4) was incomplete and had multiple bugs. > > > This commit fixes those bugs to bring netmap on vtnet in a functional > > state. > > > > > > Changelist: > > > - handle errors returned by virtqueue_enqueue() properly (they were > > > previously ignored) > > > - make sure netmap XOR rest of the kernel access each virtqueue. > > > - compute the number of netmap slots for TX and RX separately, > > according to > > > whether indirect descriptors are used or not for a given virtqueue. > > > - make sure sglist are freed according to their type (mbufs or netmap > > > buffers) > > > - add support for mulitiqueue and netmap host (aka sw) rings. > > > - intercept VQ interrupts directly instead of intercepting them in > > txq_eof > > > and rxq_eof. This simplifies the code and makes it easier to make > > sure > > > taskqueues are not running for a VQ while it is in netmap mode. > > > - implement vntet_netmap_config() to cope with changes in the number > > of queues. > > > > > > Reviewed by: bryanv > > > Approved by: gnn (mentor) > > > MFC after: 3 days > > > Sponsored by: Sunny Valley Networks > > > Differential Revision: https://reviews.freebsd.org/D17916 > > > > I would like to get some wider test of this in ^head/ > > specifically with use in a bhyve guest before we do > > an early merge to stable/12 so that this can be in > > the next build. > > > > If you are capable of testing this within bhyve as a guest > > please do so and provide feedback. It does not need to be > > a ^/head host, just the guest needs to be using vtnet > > nic's. > > > > > The tests I did are reported here https://reviews.freebsd.org/D17916 , and > consist of one or two ^/head guests, each > one having a vtnet NIC. The hypervisor is qemu-kvm, running in the host. > Unfortunately I cannot do tests with bhyve as an hypervisor, because that > requires a FreeBSD host (e.g., ^/head , stable/12 or stable/11), > and at the moment I don't have one. Ok, thanks for the update information, I miss understood, so what we need is testing of ^/head bhyve using a ^/head guest. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Nov 14 23:15:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 901281103CED; Wed, 14 Nov 2018 23:15:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D23F373039; Wed, 14 Nov 2018 23:15:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99AFC25B56; Wed, 14 Nov 2018 23:15:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAENFpta017477; Wed, 14 Nov 2018 23:15:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAENFp4g017475; Wed, 14 Nov 2018 23:15:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811142315.wAENFp4g017475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Nov 2018 23:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340448 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 340448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D23F373039 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 23:15:52 -0000 Author: imp Date: Wed Nov 14 23:15:50 2018 New Revision: 340448 URL: https://svnweb.freebsd.org/changeset/base/340448 Log: Remove trailing white space in advance of other changes. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed Nov 14 22:05:20 2018 (r340447) +++ head/sys/cam/ata/ata_da.c Wed Nov 14 23:15:50 2018 (r340448) @@ -987,7 +987,7 @@ adaclose(struct disk *dp) cam_periph_sleep(periph, &softc->refcount, PRIBIO, "adaclose", 1); cam_periph_unlock(periph); cam_periph_release(periph); - return (0); + return (0); } static void @@ -1011,7 +1011,7 @@ adastrategy(struct bio *bp) { struct cam_periph *periph; struct ada_softc *softc; - + periph = (struct cam_periph *)bp->bio_disk->d_drv1; softc = (struct ada_softc *)periph->softc; @@ -1035,7 +1035,7 @@ adastrategy(struct bio *bp) */ if (bp->bio_cmd == BIO_ZONE) bp->bio_flags |= BIO_ORDERED; - + /* * Place it in the queue of disk activities for this disk */ @@ -1068,7 +1068,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical secsize = softc->params.secsize; lba = offset / secsize; count = length / secsize; - if ((periph->flags & CAM_PERIPH_INVALID) != 0) return (ENXIO); @@ -1258,7 +1257,7 @@ adaasync(void *callback_arg, u_int32_t code, { struct ccb_getdev *cgd; cam_status status; - + cgd = (struct ccb_getdev *)arg; if (cgd == NULL) break; @@ -2161,7 +2160,7 @@ ada_zone_cmd(struct cam_periph *periph, union ccb *ccb error = ENOMEM; goto bailout; } - + ata_zac_mgmt_in(&ccb->ataio, /*retries*/ ada_retry_count, /*cbcfnp*/ adadone, @@ -3002,7 +3001,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb */ if ((softc->valid_logdir_len >= ((ATA_IDENTIFY_DATA_LOG + 1) * sizeof(uint16_t))) - && (le16dec(softc->ata_logdir.header) == + && (le16dec(softc->ata_logdir.header) == ATA_GP_LOG_DIR_VERSION) && (le16dec(&softc->ata_logdir.num_pages[ (ATA_IDENTIFY_DATA_LOG * @@ -3022,7 +3021,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb * then ATA logs are effectively not * supported even if the bit is set in the * identify data. - */ + */ softc->flags &= ~(ADA_FLAG_CAN_LOG | ADA_FLAG_CAN_IDLOG); if ((done_ccb->ccb_h.status & @@ -3132,7 +3131,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb softc->state = ADA_STATE_SUP_CAP; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - } else + } else adaprobedone(periph, done_ccb); return; } @@ -3196,11 +3195,10 @@ adadone(struct cam_periph *periph, union ccb *done_ccb * to an earlier spec, it won't have * the field. So, assume all * commands are supported. - */ + */ softc->zone_flags |= ADA_ZONE_FLAG_SUP_MASK; } - } } else { error = adaerror(done_ccb, CAM_RETRY_SELTO, @@ -3237,7 +3235,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb softc->state = ADA_STATE_ZONE; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - } else + } else adaprobedone(periph, done_ccb); return; } @@ -3321,7 +3319,6 @@ adadone(struct cam_periph *periph, union ccb *done_ccb /*getcount_only*/0); } } - } free(ataio->data_ptr, M_ATADA); @@ -3388,7 +3385,7 @@ adagetparams(struct cam_periph *periph, struct ccb_get dp->secs_per_track = cgd->ident_data.sectors; dp->cylinders = cgd->ident_data.cylinders; dp->sectors = cgd->ident_data.cylinders * - (u_int32_t)(dp->heads * dp->secs_per_track); + (u_int32_t)(dp->heads * dp->secs_per_track); } lbasize = (u_int32_t)cgd->ident_data.lba_size_1 | ((u_int32_t)cgd->ident_data.lba_size_2 << 16); @@ -3602,7 +3599,7 @@ adaresume(void *arg) /*openings*/0, /*timeout*/0, /*getcount_only*/0); - + cam_periph_unlock(periph); } } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Nov 14 22:05:20 2018 (r340447) +++ head/sys/cam/scsi/scsi_da.c Wed Nov 14 23:15:50 2018 (r340448) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); * Note that there are probe ordering dependencies here. The order isn't * controlled by this enumeration, but by explicit state transitions in * dastart() and dadone(). Here are some of the dependencies: - * + * * 1. RC should come first, before RC16, unless there is evidence that RC16 * is supported. * 2. BDC needs to come before any of the ATA probes, or the ZONE probe. @@ -163,7 +163,7 @@ typedef enum { DA_CCB_PROBE_ATA_ZONE = 0x11, DA_CCB_PROBE_WP = 0x12, DA_CCB_TYPE_MASK = 0x1F, - DA_CCB_RETRY_UA = 0x20 + DA_CCB_RETRY_UA = 0x20 } da_ccb_state; /* @@ -312,7 +312,7 @@ struct da_softc { LIST_HEAD(, ccb_hdr) pending_ccbs; int refcount; /* Active xpt_action() calls */ da_state state; - da_flags flags; + da_flags flags; da_quirks quirks; int minimum_cmd_size; int error_inject; @@ -700,7 +700,7 @@ static struct da_quirk_entry da_quirk_table[] = { /* * PNY USB Flash keys - * PR: usb/75578, usb/72344, usb/65436 + * PR: usb/75578, usb/72344, usb/65436 */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "*" , "USB DISK*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE @@ -1358,9 +1358,9 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* - * Hama Innostor USB-Stick + * Hama Innostor USB-Stick */ - { T_DIRECT, SIP_MEDIA_REMOVABLE, "Innostor", "Innostor*", "*" }, + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Innostor", "Innostor*", "*" }, /*quirks*/DA_Q_NO_RC16 }, { @@ -1776,7 +1776,7 @@ dastrategy(struct bio *bp) { struct cam_periph *periph; struct da_softc *softc; - + periph = (struct cam_periph *)bp->bio_disk->d_drv1; softc = (struct da_softc *)periph->softc; @@ -1829,7 +1829,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, periph = dp->d_drv1; softc = (struct da_softc *)periph->softc; secsize = softc->params.secsize; - + if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) return (ENXIO); @@ -1856,7 +1856,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, printf("Aborting dump due to I/O error.\n"); return (error); } - + /* * Sync the disk cache contents to the physical media. */ @@ -1913,7 +1913,7 @@ dainit(void) } else if (da_send_ordered) { /* Register our shutdown event handler */ - if ((EVENTHANDLER_REGISTER(shutdown_post_sync, dashutdown, + if ((EVENTHANDLER_REGISTER(shutdown_post_sync, dashutdown, NULL, SHUTDOWN_PRI_DEFAULT)) == NULL) printf("dainit: shutdown event registration failed!\n"); } @@ -2009,7 +2009,7 @@ daasync(void *callback_arg, u_int32_t code, { struct ccb_getdev *cgd; cam_status status; - + cgd = (struct ccb_getdev *)arg; if (cgd == NULL) break; @@ -2237,7 +2237,7 @@ dasysctlinit(void *context, int pending) SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "unmapped_io", - CTLFLAG_RD, + CTLFLAG_RD, &softc->unmappedio, 0, "Unmapped I/O leaf"); @@ -2246,7 +2246,7 @@ dasysctlinit(void *context, int pending) SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "rotating", - CTLFLAG_RD, + CTLFLAG_RD, &softc->rotating, 0, "Rotating media"); @@ -2646,7 +2646,7 @@ daregister(struct cam_periph *periph, void *arg) free(softc, M_DEVBUF); return(CAM_REQ_CMP_ERR); } - + LIST_INIT(&softc->pending_ccbs); softc->state = DA_STATE_PROBE_WP; bioq_init(&softc->delete_run_queue); @@ -2745,7 +2745,7 @@ daregister(struct cam_periph *periph, void *arg) softc->minimum_cmd_size = 10; else softc->minimum_cmd_size = 6; - + /* Predict whether device may support READ CAPACITY(16). */ if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 && (softc->quirks & DA_Q_NO_RC16) == 0) { @@ -2823,7 +2823,7 @@ daregister(struct cam_periph *periph, void *arg) AC_INQ_CHANGED, daasync, periph, periph->path); /* - * Emit an attribute changed notification just in case + * Emit an attribute changed notification just in case * physical path information arrived before our async * event handler was registered, but after anyone attaching * to our disk device polled it. @@ -2987,7 +2987,7 @@ da_zone_cmd(struct cam_periph *periph, union ccb *ccb, error = ENOMEM; goto bailout; } - + if (softc->zone_interface != DA_ZONE_IF_ATA_PASS) { scsi_zbc_in(&ccb->csio, /*retries*/ da_retry_count, @@ -3814,7 +3814,7 @@ out: * single device request, we might have changed the delete * method due to the device incorrectly advertising either * its supported methods or limits. - * + * * To prevent this causing further issues we validate the * against the methods limits, and warn which would * otherwise be unnecessary. @@ -4760,7 +4760,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *d "Attempt to query device " "size failed: %s, %s", sense_key_desc, asc_desc); - } else { + } else { if (have_sense) scsi_sense_print(&done_ccb->csio); else { @@ -4778,7 +4778,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *d * Free up resources. */ cam_periph_invalidate(periph); - } + } } } free(csio->data_ptr, M_SCSIDA); @@ -5069,7 +5069,7 @@ dadone_probebdc(struct cam_periph *periph, union ccb * softc->zone_mode =DA_ZONE_DRIVE_MANAGED; softc->zone_interface = (ata_proto) ? DA_ZONE_IF_ATA_SAT : DA_ZONE_IF_SCSI; - } else if ((bdc->flags & SVPD_ZBC_MASK) != + } else if ((bdc->flags & SVPD_ZBC_MASK) != SVPD_ZBC_NR) { xpt_print(periph->path, "Unknown zoned " "type %#x", @@ -5218,7 +5218,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * /* * If the ATA IDENTIFY failed, we could be talking * to a SCSI drive, although that seems unlikely, - * since the drive did report that it supported the + * since the drive did report that it supported the * ATA Information VPD page. If the ATA IDENTIFY * succeeded, and the SAT layer doesn't support * ZBC -> ZAC translation, continue on to get the @@ -5278,7 +5278,7 @@ dadone_probeatalogdir(struct cam_periph *periph, union */ if ((softc->valid_logdir_len >= ((ATA_IDENTIFY_DATA_LOG + 1) * sizeof(uint16_t))) - && (le16dec(softc->ata_logdir.header) == + && (le16dec(softc->ata_logdir.header) == ATA_GP_LOG_DIR_VERSION) && (le16dec(&softc->ata_logdir.num_pages[ (ATA_IDENTIFY_DATA_LOG * @@ -5298,7 +5298,7 @@ dadone_probeatalogdir(struct cam_periph *periph, union * then ATA logs are effectively not * supported even if the bit is set in the * identify data. - */ + */ softc->flags &= ~(DA_FLAG_CAN_ATA_LOG | DA_FLAG_CAN_ATA_IDLOG); if ((done_ccb->ccb_h.status & @@ -5321,7 +5321,7 @@ dadone_probeatalogdir(struct cam_periph *periph, union xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - } + } daprobedone(periph, done_ccb); return; } @@ -5412,7 +5412,7 @@ dadone_probeataiddir(struct cam_periph *periph, union xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - } + } daprobedone(periph, done_ccb); return; } @@ -5487,10 +5487,9 @@ dadone_probeatasup(struct cam_periph *periph, union cc * to an earlier spec, it won't have * the field. So, assume all * commands are supported. - */ + */ softc->zone_flags |= DA_ZONE_FLAG_SUP_MASK; } - } } else { error = daerror(done_ccb, CAM_RETRY_SELTO, @@ -5526,7 +5525,7 @@ dadone_probeatasup(struct cam_periph *periph, union cc xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - } + } daprobedone(periph, done_ccb); return; } @@ -5862,9 +5861,9 @@ static void daprevent(struct cam_periph *periph, int action) { struct da_softc *softc; - union ccb *ccb; + union ccb *ccb; int error; - + cam_periph_assert(periph, MA_OWNED); softc = (struct da_softc *)periph->softc; @@ -6131,7 +6130,7 @@ scsi_read_defects(struct ccb_scsiio *csio, uint32_t re void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t list_format, uint32_t addr_desc_index, uint8_t *data_ptr, - uint32_t dxfer_len, int minimum_cmd_size, + uint32_t dxfer_len, int minimum_cmd_size, uint8_t sense_len, uint32_t timeout) { uint8_t cdb_len; @@ -6141,7 +6140,7 @@ scsi_read_defects(struct ccb_scsiio *csio, uint32_t re * need to use the 12 byte command. */ if ((minimum_cmd_size <= 10) - && (addr_desc_index == 0) + && (addr_desc_index == 0) && (dxfer_len <= SRDD10_MAX_LENGTH)) { struct scsi_read_defect_data_10 *cdb10; @@ -6209,7 +6208,7 @@ scsi_sanitize(struct ccb_scsiio *csio, u_int32_t retri #endif /* _KERNEL */ void -scsi_zbc_out(struct ccb_scsiio *csio, uint32_t retries, +scsi_zbc_out(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t service_action, uint64_t zone_id, uint8_t zone_flags, uint8_t *data_ptr, uint32_t dxfer_len, @@ -6236,7 +6235,7 @@ scsi_zbc_out(struct ccb_scsiio *csio, uint32_t retries } void -scsi_zbc_in(struct ccb_scsiio *csio, uint32_t retries, +scsi_zbc_in(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t service_action, uint64_t zone_start_lba, uint8_t zone_options, uint8_t *data_ptr, uint32_t dxfer_len, @@ -6265,7 +6264,7 @@ scsi_zbc_in(struct ccb_scsiio *csio, uint32_t retries, } int -scsi_ata_zac_mgmt_out(struct ccb_scsiio *csio, uint32_t retries, +scsi_ata_zac_mgmt_out(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int use_ncq, uint8_t zm_action, uint64_t zone_id, uint8_t zone_flags, @@ -6377,7 +6376,7 @@ bailout: } int -scsi_ata_zac_mgmt_in(struct ccb_scsiio *csio, uint32_t retries, +scsi_ata_zac_mgmt_in(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int use_ncq, uint8_t zm_action, uint64_t zone_id, uint8_t zone_flags, From owner-svn-src-head@freebsd.org Thu Nov 15 01:15:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED98B1107031; Thu, 15 Nov 2018 01:15:30 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 100DD778EE; Thu, 15 Nov 2018 01:15:29 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id wAF1FMNk055988 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 14 Nov 2018 17:15:22 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id wAF1FLmV055987; Wed, 14 Nov 2018 17:15:21 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 14 Nov 2018 17:15:21 -0800 From: Gleb Smirnoff To: Konstantin Belousov Cc: Hans Petter Selasky , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340413 - in head/sys: kern net sys Message-ID: <20181115011521.GR9744@FreeBSD.org> References: <201811140933.wAE9XxSL003613@slippy.cwsent.com> <178c3d69-4a3b-49cb-dab4-f6f4139dfc1a@selasky.org> <20181114162831.GM9744@FreeBSD.org> <20181114202748.GM2378@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181114202748.GM2378@kib.kiev.ua> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 100DD778EE X-Spamd-Result: default: False [-103.13 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; IP_SCORE(-0.02)[country: US(-0.10)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:2906, ipnet:198.45.48.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 01:15:31 -0000 On Wed, Nov 14, 2018 at 10:27:48PM +0200, Konstantin Belousov wrote: K> On Wed, Nov 14, 2018 at 08:28:31AM -0800, Gleb Smirnoff wrote: K> > On Wed, Nov 14, 2018 at 11:06:38AM +0100, Hans Petter Selasky wrote: K> > H> On 11/14/18 10:33 AM, Cy Schubert wrote: K> > H> > + epoch_thread_init(td); K> > H> K> > H> Did you forget to call epoch_thread_init() for thread0 ? K> > K> > Yes, this is my guess. I'm preparing patch for Cy to test. K> K> Is this stuff allocated for each thread, unconditionally ? K> If yes, why is it allocatable instead of embedding it into struct thread ? I wish to do that, but struct thread is exposed to userland, and all epoch structures are not. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Thu Nov 15 14:47:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72B3B11000DA; Thu, 15 Nov 2018 14:47:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 2842C6FFA2; Thu, 15 Nov 2018 14:47:43 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [178.17.145.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E74C9260150; Thu, 15 Nov 2018 15:47:39 +0100 (CET) Subject: Re: svn commit: r340413 - in head/sys: kern net sys To: Gleb Smirnoff , Konstantin Belousov Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811140933.wAE9XxSL003613@slippy.cwsent.com> <178c3d69-4a3b-49cb-dab4-f6f4139dfc1a@selasky.org> <20181114162831.GM9744@FreeBSD.org> <20181114202748.GM2378@kib.kiev.ua> <20181115011521.GR9744@FreeBSD.org> From: Hans Petter Selasky Message-ID: Date: Thu, 15 Nov 2018 15:47:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0.1 MIME-Version: 1.0 In-Reply-To: <20181115011521.GR9744@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2842C6FFA2 X-Spamd-Result: default: False [-6.32 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail.turbocat.net]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-3.02)[ip: (-9.39), ipnet: 2a01:4f8::/29(-2.85), asn: 24940(-2.83), country: DE(-0.01)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 14:47:44 -0000 On 11/15/18 2:15 AM, Gleb Smirnoff wrote: > I wish to do that, but struct thread is exposed to userland, and all > epoch structures are not. There is another way to solve this problem which doesn't involve "struct thread" and is more safe and guards against recursive use of these functions! Can you have a look at this review: https://reviews.freebsd.org/D17996 --HPS From owner-svn-src-head@freebsd.org Thu Nov 15 16:02:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B58D21101C3A; Thu, 15 Nov 2018 16:02:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4767572479; Thu, 15 Nov 2018 16:02:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 249CC10A6E; Thu, 15 Nov 2018 16:02:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFG2ELP040162; Thu, 15 Nov 2018 16:02:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFG2E4w040161; Thu, 15 Nov 2018 16:02:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811151602.wAFG2E4w040161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 15 Nov 2018 16:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340450 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 340450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4767572479 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 16:02:14 -0000 Author: imp Date: Thu Nov 15 16:02:13 2018 New Revision: 340450 URL: https://svnweb.freebsd.org/changeset/base/340450 Log: When converting ns,us,ms to sbt, return the ceil() of the result rather than the floor(). Returning the floor means that sbttoX(Xtosbt(y)) != y for almost all values of y. In practice, this results in a difference of at most 1 in the lsb of the sbintime_t. This difference is meaningless for all current users of these functions, but is important for the newly introduced sysctl conversion routines which implicitly rely on the transformation being idempotent. Sponsored by: Netflix, Inc Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 (r340449) +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 (r340450) @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS results in * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and * microsecond functions are also provided for completeness. + * + * These functions return the smallest sbt larger or equal to the number of + * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 term added + * transforms the >> 32 from floor() to ceil(). */ static __inline int64_t sbttons(sbintime_t _sbt) @@ -173,7 +177,7 @@ static __inline sbintime_t nstosbt(int64_t _ns) { - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) >> 32); } static __inline int64_t @@ -187,7 +191,7 @@ static __inline sbintime_t ustosbt(int64_t _us) { - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) >> 32); } static __inline int64_t @@ -201,7 +205,7 @@ static __inline sbintime_t mstosbt(int64_t _ms) { - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32); } /*- From owner-svn-src-head@freebsd.org Thu Nov 15 16:02:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563AE1101C5D; Thu, 15 Nov 2018 16:02:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9AB47252C; Thu, 15 Nov 2018 16:02:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0530510A7B; Thu, 15 Nov 2018 16:02:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFG2O0h040917; Thu, 15 Nov 2018 16:02:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFG2O4Z040916; Thu, 15 Nov 2018 16:02:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811151602.wAFG2O4Z040916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 15 Nov 2018 16:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340451 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C9AB47252C X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 16:02:27 -0000 Author: imp Date: Thu Nov 15 16:02:24 2018 New Revision: 340451 URL: https://svnweb.freebsd.org/changeset/base/340451 Log: Do proper conversion to/from sbt. Doh! sbttoX and Xtosbt were backwards. While they ran, they produced bogus results. Pointy hat to: imp@ Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Nov 15 16:02:13 2018 (r340450) +++ head/sys/kern/kern_sysctl.c Thu Nov 15 16:02:24 2018 (r340451) @@ -1702,13 +1702,13 @@ sysctl_usec_to_sbintime(SYSCTL_HANDLER_ARGS) sbintime_t sb; tt = *(int64_t *)arg1; - sb = ustosbt(tt); + sb = sbttous(tt); error = sysctl_handle_64(oidp, &sb, 0, req); if (error || !req->newptr) return (error); - tt = sbttous(sb); + tt = ustosbt(sb); *(int64_t *)arg1 = tt; return (0); @@ -1725,13 +1725,13 @@ sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS) sbintime_t sb; tt = *(int64_t *)arg1; - sb = mstosbt(tt); + sb = sbttoms(tt); error = sysctl_handle_64(oidp, &sb, 0, req); if (error || !req->newptr) return (error); - tt = sbttoms(sb); + tt = mstosbt(sb); *(int64_t *)arg1 = tt; return (0); From owner-svn-src-head@freebsd.org Thu Nov 15 16:02:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F2601101C94; Thu, 15 Nov 2018 16:02:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8AD6725EB; Thu, 15 Nov 2018 16:02:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97B8E10A86; Thu, 15 Nov 2018 16:02:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFG2Z4m040975; Thu, 15 Nov 2018 16:02:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFG2ZuO040974; Thu, 15 Nov 2018 16:02:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811151602.wAFG2ZuO040974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 15 Nov 2018 16:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340452 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 340452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8AD6725EB X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 16:02:37 -0000 Author: imp Date: Thu Nov 15 16:02:34 2018 New Revision: 340452 URL: https://svnweb.freebsd.org/changeset/base/340452 Log: Introduce scsi_ata_setfeatures() as a convenient way to make a passthru ATA SETFEATURES command. Sponsored by: Netflix, Inc Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Nov 15 16:02:24 2018 (r340451) +++ head/sys/cam/scsi/scsi_all.c Thu Nov 15 16:02:34 2018 (r340452) @@ -8401,6 +8401,38 @@ scsi_ata_read_log(struct ccb_scsiio *csio, uint32_t re return (retval); } +int scsi_ata_setfeatures(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t feature, + uint64_t lba, uint32_t count, + uint8_t sense_len, uint32_t timeout) +{ + return (scsi_ata_pass(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_NONE, + tag_action, + /*protocol*/AP_PROTO_PIO_IN, + /*ata_flags*/AP_FLAG_TDIR_FROM_DEV | + AP_FLAG_BYT_BLOK_BYTES | + AP_FLAG_TLEN_SECT_CNT, + /*features*/feature, + /*sector_count*/count, + /*lba*/lba, + /*command*/ATA_SETFEATURES, + /*device*/ 0, + /*icc*/ 0, + /*auxiliary*/0, + /*control*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*cdb_storage*/NULL, + /*cdb_storage_len*/0, + /*minimum_cmd_size*/0, + sense_len, + timeout)); +} + /* * Note! This is an unusual CDB building function because it can return * an error in the event that the command in question requires a variable Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Nov 15 16:02:24 2018 (r340451) +++ head/sys/cam/scsi/scsi_all.h Thu Nov 15 16:02:34 2018 (r340452) @@ -4176,6 +4176,12 @@ int scsi_ata_read_log(struct ccb_scsiio *csio, uint32_ uint8_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint8_t sense_len, uint32_t timeout); +int scsi_ata_setfeatures(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t feature, + uint64_t lba, uint32_t count, + uint8_t sense_len, uint32_t timeout); + int scsi_ata_pass(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, uint8_t tag_action, From owner-svn-src-head@freebsd.org Thu Nov 15 16:02:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EE111101CD5; Thu, 15 Nov 2018 16:02:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5595726E5; Thu, 15 Nov 2018 16:02:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3688E10A87; Thu, 15 Nov 2018 16:02:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFG2kMk041031; Thu, 15 Nov 2018 16:02:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFG2jjU041028; Thu, 15 Nov 2018 16:02:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811151602.wAFG2jjU041028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 15 Nov 2018 16:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340453 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 340453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5595726E5 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 16:02:48 -0000 Author: imp Date: Thu Nov 15 16:02:45 2018 New Revision: 340453 URL: https://svnweb.freebsd.org/changeset/base/340453 Log: Add cam_iosched_set_latfcn to set a latency callback for high latency. It's often useful to have a callback when an I/O takes more than a threshold amount of time. This adds the infrastructure for periph devices to register one. One use-case is as a debugging aide when you need a semi-realtime indication of an I/O outlier so you can trigger bus capture gear for vendor analysis. Sponsored by: Netflix, Inc Modified: head/sys/cam/cam_iosched.c head/sys/cam/cam_iosched.h Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Thu Nov 15 16:02:34 2018 (r340452) +++ head/sys/cam/cam_iosched.c Thu Nov 15 16:02:45 2018 (r340453) @@ -294,6 +294,9 @@ struct cam_iosched_softc { uint32_t this_frac; /* Fraction of a second (1024ths) for this tick */ sbintime_t last_time; /* Last time we ticked */ struct control_loop cl; + sbintime_t max_lat; /* when != 0, if iop latency > max_lat, call max_lat_fcn */ + cam_iosched_latfcn_t latfcn; + void *latarg; #endif }; @@ -1171,9 +1174,24 @@ void cam_iosched_sysctl_init(struct cam_iosched_softc OID_AUTO, "load", CTLFLAG_RD, &isc->load, 0, "scaled load average / 100"); + + SYSCTL_ADD_U64(ctx, n, + OID_AUTO, "latency_trigger", CTLFLAG_RW, + &isc->max_lat, 0, + "Latency treshold to trigger callbacks"); #endif } +void +cam_iosched_set_latfcn(struct cam_iosched_softc *isc, + cam_iosched_latfcn_t fnp, void *argp) +{ +#ifdef CAM_IOSCHED_DYNAMIC + isc->latfcn = fnp; + isc->latarg = argp; +#endif +} + /* * Flush outstanding I/O. Consumers of this library don't know all the * queues we may keep, so this allows all I/O to be flushed in one @@ -1510,10 +1528,21 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc printf("Completing command with bio_cmd == %#x\n", bp->bio_cmd); } - if (!(bp->bio_flags & BIO_ERROR) && done_ccb != NULL) - cam_iosched_io_metric_update(isc, - cam_iosched_sbintime_t(done_ccb->ccb_h.qos.periph_data), + if (!(bp->bio_flags & BIO_ERROR) && done_ccb != NULL) { + sbintime_t sim_latency; + + sim_latency = cam_iosched_sbintime_t(done_ccb->ccb_h.qos.periph_data); + + cam_iosched_io_metric_update(isc, sim_latency, bp->bio_cmd, bp->bio_bcount); + /* + * Debugging code: allow callbacks to the periph driver when latency max + * is exceeded. This can be useful for triggering external debugging actions. + */ + if (isc->latfcn && isc->max_lat != 0 && sim_latency > isc->max_lat) + isc->latfcn(isc->latarg, sim_latency, bp); + } + #endif return retval; } Modified: head/sys/cam/cam_iosched.h ============================================================================== --- head/sys/cam/cam_iosched.h Thu Nov 15 16:02:34 2018 (r340452) +++ head/sys/cam/cam_iosched.h Thu Nov 15 16:02:45 2018 (r340453) @@ -80,6 +80,8 @@ cam_iosched_sbintime_t(uintptr_t delta) return (sbintime_t)((uint64_t)delta << CAM_IOSCHED_TIME_SHIFT); } +typedef void (*cam_iosched_latfcn_t)(void *, sbintime_t, struct bio *); + int cam_iosched_init(struct cam_iosched_softc **, struct cam_periph *periph); void cam_iosched_fini(struct cam_iosched_softc *); void cam_iosched_sysctl_init(struct cam_iosched_softc *, struct sysctl_ctx_list *, struct sysctl_oid *); @@ -98,6 +100,7 @@ void cam_iosched_set_work_flags(struct cam_iosched_sof void cam_iosched_clr_work_flags(struct cam_iosched_softc *isc, uint32_t flags); void cam_iosched_trim_done(struct cam_iosched_softc *isc); int cam_iosched_bio_complete(struct cam_iosched_softc *isc, struct bio *bp, union ccb *done_ccb); +void cam_iosched_set_latfcn(struct cam_iosched_softc *isc, cam_iosched_latfcn_t, void *); #endif #endif From owner-svn-src-head@freebsd.org Thu Nov 15 16:13:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A7111023A4; Thu, 15 Nov 2018 16:13:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD66731B6; Thu, 15 Nov 2018 16:13:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E118C10C1A; Thu, 15 Nov 2018 16:13:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFGDPJJ046487; Thu, 15 Nov 2018 16:13:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFGDPO5046486; Thu, 15 Nov 2018 16:13:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201811151613.wAFGDPO5046486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 15 Nov 2018 16:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340455 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 340455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0AD66731B6 X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 16:13:26 -0000 Author: asomers Date: Thu Nov 15 16:13:25 2018 New Revision: 340455 URL: https://svnweb.freebsd.org/changeset/base/340455 Log: fcntl.2: document an additional error condition MFC after: 2 weeks Modified: head/lib/libc/sys/fcntl.2 Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Thu Nov 15 16:03:52 2018 (r340454) +++ head/lib/libc/sys/fcntl.2 Thu Nov 15 16:13:25 2018 (r340455) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd May 2, 2018 +.Dd Nov 15, 2018 .Dt FCNTL 2 .Os .Sh NAME @@ -562,6 +562,10 @@ or and the data to which .Fa arg points is not valid. +.Pp +The argument +.Fa cmd +is invalid. .It Bq Er EMFILE The argument .Fa cmd From owner-svn-src-head@freebsd.org Thu Nov 15 16:29:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8F911027D7; Thu, 15 Nov 2018 16:29:29 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 787527376C; Thu, 15 Nov 2018 16:29:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5577A10DAE; Thu, 15 Nov 2018 16:29:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFGTSA4051751; Thu, 15 Nov 2018 16:29:28 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFGTSJK051750; Thu, 15 Nov 2018 16:29:28 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201811151629.wAFGTSJK051750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 15 Nov 2018 16:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340456 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 340456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 787527376C X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 16:29:29 -0000 Author: loos Date: Thu Nov 15 16:29:27 2018 New Revision: 340456 URL: https://svnweb.freebsd.org/changeset/base/340456 Log: Comment MD_ROOT and remove 'device re' which is not part of the system and can be loaded as module. Modified: head/sys/arm/conf/ARMADA38X Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Thu Nov 15 16:13:25 2018 (r340455) +++ head/sys/arm/conf/ARMADA38X Thu Nov 15 16:29:27 2018 (r340456) @@ -14,7 +14,7 @@ options SOC_MV_ARMADA38X makeoptions WERROR="-Werror" makeoptions MODULES_EXTRA="dtb/mv" -options MD_ROOT +#options MD_ROOT #makeoptions MFS_IMAGE=/path/to/miniroot #options ROOTDEVNAME=\"ufs:md0\" options ROOTDEVNAME=\"/dev/da0s1a\" @@ -39,7 +39,6 @@ device ether device vlan device mii device bpf -device re device mdio device etherswitch device e6000sw From owner-svn-src-head@freebsd.org Thu Nov 15 17:05:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B3E1103627; Thu, 15 Nov 2018 17:05:04 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DAC474CAA; Thu, 15 Nov 2018 17:05:03 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5030211439; Thu, 15 Nov 2018 17:05:03 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFH53Di072227; Thu, 15 Nov 2018 17:05:03 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFH53fH072226; Thu, 15 Nov 2018 17:05:03 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201811151705.wAFH53fH072226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 15 Nov 2018 17:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340458 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 340458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6DAC474CAA X-Spamd-Result: default: False [-106.87 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 17:05:04 -0000 Author: loos Date: Thu Nov 15 17:05:02 2018 New Revision: 340458 URL: https://svnweb.freebsd.org/changeset/base/340458 Log: Set the SPI clock speed and polarity on each transfer to catch up with recent changes in spibus and allow the use of different SPI modes on the same bus. Reported by: ian Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/mv/mv_spi.c Modified: head/sys/arm/mv/mv_spi.c ============================================================================== --- head/sys/arm/mv/mv_spi.c Thu Nov 15 16:42:59 2018 (r340457) +++ head/sys/arm/mv/mv_spi.c Thu Nov 15 17:05:02 2018 (r340458) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "spibus_if.h" struct mv_spi_softc { @@ -70,11 +72,23 @@ struct mv_spi_softc { #define MV_SPI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define MV_SPI_CONTROL 0 +#define MV_SPI_CTRL_CS_MASK 7 #define MV_SPI_CTRL_CS_SHIFT 2 #define MV_SPI_CTRL_SMEMREADY (1 << 1) #define MV_SPI_CTRL_CS_ACTIVE (1 << 0) #define MV_SPI_CONF 0x4 +#define MV_SPI_CONF_MODE_SHIFT 12 +#define MV_SPI_CONF_MODE_MASK (3 << MV_SPI_CONF_MODE_SHIFT) #define MV_SPI_CONF_BYTELEN (1 << 5) +#define MV_SPI_CONF_CLOCK_SPR_MASK 0xf +#define MV_SPI_CONF_CLOCK_SPPR_MASK 1 +#define MV_SPI_CONF_CLOCK_SPPR_SHIFT 4 +#define MV_SPI_CONF_CLOCK_SPPRHI_MASK 3 +#define MV_SPI_CONF_CLOCK_SPPRHI_SHIFT 6 +#define MV_SPI_CONF_CLOCK_MASK \ + ((MV_SPI_CONF_CLOCK_SPPRHI_MASK << MV_SPI_CONF_CLOCK_SPPRHI_SHIFT) | \ + (MV_SPI_CONF_CLOCK_SPPR_MASK << MV_SPI_CONF_CLOCK_SPPR_SHIFT) | \ + MV_SPI_CONF_CLOCK_SPR_MASK) #define MV_SPI_DATAOUT 0x8 #define MV_SPI_DATAIN 0xc #define MV_SPI_INTR_STAT 0x10 @@ -244,10 +258,27 @@ mv_spi_intr(void *arg) } static int +mv_spi_psc_calc(uint32_t clock, uint32_t *spr, uint32_t *sppr) +{ + uint32_t divider, tclk; + + tclk = get_tclk_armada38x(); + for (*spr = 2; *spr <= 15; (*spr)++) { + for (*sppr = 0; *sppr <= 7; (*sppr)++) { + divider = *spr * (1 << *sppr); + if (tclk / divider <= clock) + return (0); + } + } + + return (EINVAL); +} + +static int mv_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) { struct mv_spi_softc *sc; - uint32_t cs, reg; + uint32_t clock, cs, mode, reg, spr, sppr; int resid, timeout; KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, @@ -255,9 +286,23 @@ mv_spi_transfer(device_t dev, device_t child, struct s KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, ("TX/RX data sizes should be equal")); - /* Get the proper chip select for this child. */ + /* Get the proper chip select, mode and clock for this transfer. */ spibus_get_cs(child, &cs); cs &= ~SPIBUS_CS_HIGH; + spibus_get_mode(child, &mode); + if (mode > 3) { + device_printf(dev, + "Invalid mode %u requested by %s\n", mode, + device_get_nameunit(child)); + return (EINVAL); + } + spibus_get_clock(child, &clock); + if (clock == 0 || mv_spi_psc_calc(clock, &spr, &sppr) != 0) { + device_printf(dev, + "Invalid clock %uHz requested by %s\n", clock, + device_get_nameunit(child)); + return (EINVAL); + } sc = device_get_softc(dev); MV_SPI_LOCK(sc); @@ -275,7 +320,20 @@ mv_spi_transfer(device_t dev, device_t child, struct s sc->sc_written = 0; sc->sc_len = cmd->tx_cmd_sz + cmd->tx_data_sz; - MV_SPI_WRITE(sc, MV_SPI_CONTROL, cs << MV_SPI_CTRL_CS_SHIFT); + /* Set SPI Mode and Clock. */ + reg = MV_SPI_READ(sc, MV_SPI_CONF); + reg &= ~(MV_SPI_CONF_MODE_MASK | MV_SPI_CONF_CLOCK_MASK); + reg |= mode << MV_SPI_CONF_MODE_SHIFT; + reg |= spr & MV_SPI_CONF_CLOCK_SPR_MASK; + reg |= (sppr & MV_SPI_CONF_CLOCK_SPPR_MASK) << + MV_SPI_CONF_CLOCK_SPPR_SHIFT; + reg |= (sppr & MV_SPI_CONF_CLOCK_SPPRHI_MASK) << + MV_SPI_CONF_CLOCK_SPPRHI_SHIFT; + MV_SPI_WRITE(sc, MV_SPI_CONTROL, reg); + + /* Set CS number and assert CS. */ + reg = (cs & MV_SPI_CTRL_CS_MASK) << MV_SPI_CTRL_CS_SHIFT; + MV_SPI_WRITE(sc, MV_SPI_CONTROL, reg); reg = MV_SPI_READ(sc, MV_SPI_CONTROL); MV_SPI_WRITE(sc, MV_SPI_CONTROL, reg | MV_SPI_CTRL_CS_ACTIVE); From owner-svn-src-head@freebsd.org Thu Nov 15 18:37:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5876E1105E80; Thu, 15 Nov 2018 18:37:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7B2377D0A; Thu, 15 Nov 2018 18:37:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B825C12332; Thu, 15 Nov 2018 18:37:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFIbgPl018445; Thu, 15 Nov 2018 18:37:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFIbgVN018442; Thu, 15 Nov 2018 18:37:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811151837.wAFIbgVN018442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 15 Nov 2018 18:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340460 - in head/sys/x86: include x86 xen X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/x86: include x86 xen X-SVN-Commit-Revision: 340460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7B2377D0A X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 18:37:43 -0000 Author: jhb Date: Thu Nov 15 18:37:41 2018 New Revision: 340460 URL: https://svnweb.freebsd.org/changeset/base/340460 Log: Convert the number of MSI IRQs on x86 from a constant to a tunable. The number of MSI IRQs still defaults to 512, but it can now be changed at boot time via the machdep.num_msi_irqs tunable. Reviewed by: kib, royger (older version) Reviewed by: markj MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D17977 Modified: head/sys/x86/include/intr_machdep.h head/sys/x86/x86/msi.c head/sys/x86/xen/xen_intr.c head/sys/x86/xen/xen_msi.c Modified: head/sys/x86/include/intr_machdep.h ============================================================================== --- head/sys/x86/include/intr_machdep.h Thu Nov 15 17:25:32 2018 (r340459) +++ head/sys/x86/include/intr_machdep.h Thu Nov 15 18:37:41 2018 (r340460) @@ -58,11 +58,11 @@ * the minimum IRQ value for MSI interrupts to attempt to leave 255 * unused since 255 is used in PCI to indicate an invalid INTx IRQ. */ -#define NUM_MSI_INTS 512 #define MINIMUM_MSI_INT 256 extern u_int first_msi_irq; extern u_int num_io_irqs; +extern u_int num_msi_irqs; /* * Default base address for MSI messages on x86 platforms. Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Thu Nov 15 17:25:32 2018 (r340459) +++ head/sys/x86/x86/msi.c Thu Nov 15 18:37:41 2018 (r340460) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -153,6 +154,10 @@ struct pic msi_pic = { u_int first_msi_irq; +u_int num_msi_irqs = 512; +SYSCTL_UINT(_machdep, OID_AUTO, num_msi_irqs, CTLFLAG_RDTUN, &num_msi_irqs, 0, + "Number of IRQs reserved for MSI and MSI-X interrupts"); + #ifdef SMP /** * Xen hypervisors prior to 4.6.0 do not properly handle updates to @@ -331,8 +336,13 @@ msi_init(void) } #endif + if (num_msi_irqs == 0) + return; + first_msi_irq = max(MINIMUM_MSI_INT, num_io_irqs); - num_io_irqs = first_msi_irq + NUM_MSI_INTS; + if (num_msi_irqs > UINT_MAX - first_msi_irq) + panic("num_msi_irq too high"); + num_io_irqs = first_msi_irq + num_msi_irqs; msi_enabled = 1; intr_register_pic(&msi_pic); @@ -346,7 +356,7 @@ msi_create_source(void) u_int irq; mtx_lock(&msi_lock); - if (msi_last_irq >= NUM_MSI_INTS) { + if (msi_last_irq >= num_msi_irqs) { mtx_unlock(&msi_lock); return; } @@ -390,7 +400,7 @@ again: /* Try to find 'count' free IRQs. */ cnt = 0; - for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + num_msi_irqs; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -409,7 +419,7 @@ again: /* Do we need to create some new sources? */ if (cnt < count) { /* If we would exceed the max, give up. */ - if (i + (count - cnt) > first_msi_irq + NUM_MSI_INTS) { + if (i + (count - cnt) > first_msi_irq + num_msi_irqs) { mtx_unlock(&msi_lock); free(mirqs, M_MSI); return (ENXIO); @@ -585,7 +595,7 @@ msi_map(int irq, uint64_t *addr, uint32_t *data) #ifdef ACPI_DMAR if (!msi->msi_msix) { for (k = msi->msi_count - 1, i = first_msi_irq; k > 0 && - i < first_msi_irq + NUM_MSI_INTS; i++) { + i < first_msi_irq + num_msi_irqs; i++) { if (i == msi->msi_irq) continue; msi1 = (struct msi_intsrc *)intr_lookup_source(i); @@ -635,7 +645,7 @@ again: mtx_lock(&msi_lock); /* Find a free IRQ. */ - for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + num_msi_irqs; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -648,7 +658,7 @@ again: } /* Are all IRQs in use? */ - if (i == first_msi_irq + NUM_MSI_INTS) { + if (i == first_msi_irq + num_msi_irqs) { mtx_unlock(&msi_lock); return (ENXIO); } Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Thu Nov 15 17:25:32 2018 (r340459) +++ head/sys/x86/xen/xen_intr.c Thu Nov 15 18:37:41 2018 (r340460) @@ -690,6 +690,8 @@ void xen_intr_alloc_irqs(void) { + if (num_io_irqs > UINT_MAX - NR_EVENT_CHANNELS) + panic("IRQ allocation overflow (num_msi_irqs too high?)"); first_evtchn_irq = num_io_irqs; num_io_irqs += NR_EVENT_CHANNELS; } Modified: head/sys/x86/xen/xen_msi.c ============================================================================== --- head/sys/x86/xen/xen_msi.c Thu Nov 15 17:25:32 2018 (r340459) +++ head/sys/x86/xen/xen_msi.c Thu Nov 15 18:37:41 2018 (r340460) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -57,7 +58,9 @@ xen_msi_init(void) MPASS(num_io_irqs > 0); first_msi_irq = min(MINIMUM_MSI_INT, num_io_irqs); - num_io_irqs = first_msi_irq + NUM_MSI_INTS; + if (num_msi_irqs > UINT_MAX - first_msi_irq) + panic("num_msi_irq too high"); + num_io_irqs = first_msi_irq + num_msi_irqs; mtx_init(&msi_lock, "msi", NULL, MTX_DEF); } @@ -73,7 +76,7 @@ xen_msi_alloc(device_t dev, int count, int maxcount, i mtx_lock(&msi_lock); /* If we would exceed the max, give up. */ - if ((msi_last_irq + count) > NUM_MSI_INTS) { + if (msi_last_irq + count > num_msi_irqs) { mtx_unlock(&msi_lock); return (ENXIO); } From owner-svn-src-head@freebsd.org Thu Nov 15 20:20:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2D92110875E; Thu, 15 Nov 2018 20:20:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4218A7C652; Thu, 15 Nov 2018 20:20:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2385313388; Thu, 15 Nov 2018 20:20:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFKKePV072371; Thu, 15 Nov 2018 20:20:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFKKdI0072367; Thu, 15 Nov 2018 20:20:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811152020.wAFKKdI0072367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Nov 2018 20:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340463 - head/lib/libc/amd64/string X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libc/amd64/string X-SVN-Commit-Revision: 340463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4218A7C652 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 20:20:40 -0000 Author: mjg Date: Thu Nov 15 20:20:39 2018 New Revision: 340463 URL: https://svnweb.freebsd.org/changeset/base/340463 Log: amd64: convert libc bzero to a C func to avoid future bloat Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17549 Added: head/lib/libc/amd64/string/bzero.c (contents, props changed) Deleted: head/lib/libc/amd64/string/bzero.S Modified: head/lib/libc/amd64/string/Makefile.inc head/lib/libc/amd64/string/memset.S Modified: head/lib/libc/amd64/string/Makefile.inc ============================================================================== --- head/lib/libc/amd64/string/Makefile.inc Thu Nov 15 19:06:07 2018 (r340462) +++ head/lib/libc/amd64/string/Makefile.inc Thu Nov 15 20:20:39 2018 (r340463) @@ -2,7 +2,6 @@ MDSRCS+= \ bcmp.S \ - bzero.S \ memcmp.S \ memcpy.S \ memmove.S \ Added: head/lib/libc/amd64/string/bzero.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/amd64/string/bzero.c Thu Nov 15 20:20:39 2018 (r340463) @@ -0,0 +1,15 @@ +/*- + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void +bzero(void *b, size_t len) +{ + + memset(b, 0, len); +} Modified: head/lib/libc/amd64/string/memset.S ============================================================================== --- head/lib/libc/amd64/string/memset.S Thu Nov 15 19:06:07 2018 (r340462) +++ head/lib/libc/amd64/string/memset.S Thu Nov 15 20:20:39 2018 (r340463) @@ -31,18 +31,12 @@ #include __FBSDID("$FreeBSD$"); -.macro MEMSET bzero erms -.if \bzero == 1 - movq %rsi,%rcx - movq %rsi,%rdx - xorl %eax,%eax -.else +.macro MEMSET erms movq %rdi,%r9 movq %rdx,%rcx movzbq %sil,%r8 movabs $0x0101010101010101,%rax imulq %r8,%rax -.endif cmpq $32,%rcx jb 1016f @@ -95,9 +89,7 @@ __FBSDID("$FreeBSD$"); jl 1000f movb %al,(%rdi) 1000: -.if \bzero == 0 movq %r9,%rax -.endif ret 1256: @@ -112,20 +104,12 @@ __FBSDID("$FreeBSD$"); andb $7,%cl jne 1004b .endif -.if \bzero == 0 movq %r9,%rax -.endif ret .endm -#ifndef BZERO ENTRY(memset) - MEMSET bzero=0 erms=0 + MEMSET erms=0 END(memset) -#else -ENTRY(bzero) - MEMSET bzero=1 erms=0 -END(bzero) -#endif .section .note.GNU-stack,"",%progbits From owner-svn-src-head@freebsd.org Thu Nov 15 20:28:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6C9D1108AC0; Thu, 15 Nov 2018 20:28:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 317EB7CB4F; Thu, 15 Nov 2018 20:28:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 062C31352D; Thu, 15 Nov 2018 20:28:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFKSZE1077133; Thu, 15 Nov 2018 20:28:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFKSZne077132; Thu, 15 Nov 2018 20:28:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811152028.wAFKSZne077132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Nov 2018 20:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340464 - head/lib/libc/amd64/string X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libc/amd64/string X-SVN-Commit-Revision: 340464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 317EB7CB4F X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 20:28:36 -0000 Author: mjg Date: Thu Nov 15 20:28:35 2018 New Revision: 340464 URL: https://svnweb.freebsd.org/changeset/base/340464 Log: amd64: sync up libc memset with the kernel version - tidy up memset to have rax set earlier for small sizes - finish the tail in memset with an overlapping store - align memset buffers to 16 bytes before using rep stos Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/amd64/string/memset.S Modified: head/lib/libc/amd64/string/memset.S ============================================================================== --- head/lib/libc/amd64/string/memset.S Thu Nov 15 20:20:39 2018 (r340463) +++ head/lib/libc/amd64/string/memset.S Thu Nov 15 20:28:35 2018 (r340464) @@ -31,12 +31,14 @@ #include __FBSDID("$FreeBSD$"); +#define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ + .macro MEMSET erms - movq %rdi,%r9 + movq %rdi,%rax movq %rdx,%rcx movzbq %sil,%r8 - movabs $0x0101010101010101,%rax - imulq %r8,%rax + movabs $0x0101010101010101,%r10 + imulq %r8,%r10 cmpq $32,%rcx jb 1016f @@ -45,10 +47,10 @@ __FBSDID("$FreeBSD$"); ja 1256f 1032: - movq %rax,(%rdi) - movq %rax,8(%rdi) - movq %rax,16(%rdi) - movq %rax,24(%rdi) + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,16(%rdi) + movq %r10,24(%rdi) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx @@ -58,54 +60,72 @@ __FBSDID("$FreeBSD$"); 1016: cmpb $16,%cl jl 1008f - movq %rax,(%rdi) - movq %rax,8(%rdi) + movq %r10,(%rdi) + movq %r10,8(%rdi) subb $16,%cl jz 1000f leaq 16(%rdi),%rdi 1008: cmpb $8,%cl jl 1004f - movq %rax,(%rdi) + movq %r10,(%rdi) subb $8,%cl jz 1000f leaq 8(%rdi),%rdi 1004: cmpb $4,%cl jl 1002f - movl %eax,(%rdi) + movl %r10d,(%rdi) subb $4,%cl jz 1000f leaq 4(%rdi),%rdi 1002: cmpb $2,%cl jl 1001f - movw %ax,(%rdi) + movw %r10w,(%rdi) subb $2,%cl jz 1000f leaq 2(%rdi),%rdi 1001: cmpb $1,%cl jl 1000f - movb %al,(%rdi) + movb %r10b,(%rdi) 1000: - movq %r9,%rax ret - + ALIGN_TEXT 1256: + movq %rdi,%r9 + movq %r10,%rax + testl $15,%edi + jnz 3f +1: .if \erms == 1 rep stosb + movq %r9,%rax .else + movq %rcx,%rdx shrq $3,%rcx rep stosq - movq %rdx,%rcx - andb $7,%cl - jne 1004b -.endif movq %r9,%rax + andl $7,%edx + jnz 2f ret +2: + movq %r10,-8(%rdi,%rdx) +.endif + ret + ALIGN_TEXT +3: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %rdi,%r8 + andq $15,%r8 + leaq -16(%rcx,%r8),%rcx + neg %r8 + leaq 16(%rdi,%r8),%rdi + jmp 1b .endm ENTRY(memset) From owner-svn-src-head@freebsd.org Thu Nov 15 22:47:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A6FC110CA3E; Thu, 15 Nov 2018 22:47:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7CA18368C; Thu, 15 Nov 2018 22:47:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8DCF14DF0; Thu, 15 Nov 2018 22:47:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFMllYU050115; Thu, 15 Nov 2018 22:47:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFMllYL050114; Thu, 15 Nov 2018 22:47:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811152247.wAFMllYL050114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 15 Nov 2018 22:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340465 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 340465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7CA18368C X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 22:47:48 -0000 Author: jhb Date: Thu Nov 15 22:47:47 2018 New Revision: 340465 URL: https://svnweb.freebsd.org/changeset/base/340465 Log: Use sbsndptr_adv() instead of sbsndptr() for TOE TLS. For TOE TLS, we just want to advance the send pointer to skip over the record just sent to the TOE. The recently added sbsndptr_adv() is sufficient for that and is cheaper. MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tls.c Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Thu Nov 15 20:28:35 2018 (r340464) +++ head/sys/dev/cxgbe/tom/t4_tls.c Thu Nov 15 22:47:47 2018 (r340465) @@ -1368,7 +1368,7 @@ t4_push_tls_records(struct adapter *sc, struct toepcb tp->snd_max += plen; SOCKBUF_LOCK(sb); - sbsndptr(sb, tls_ofld->sb_off, plen, &sndptroff); + sbsndptr_adv(sb, sb->sb_sndptr, plen); tls_ofld->sb_off += plen; SOCKBUF_UNLOCK(sb); From owner-svn-src-head@freebsd.org Thu Nov 15 23:00:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B556110CED6; Thu, 15 Nov 2018 23:00:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8ADFC83CA0; Thu, 15 Nov 2018 23:00:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 681AA14FAA; Thu, 15 Nov 2018 23:00:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFN0VDa055380; Thu, 15 Nov 2018 23:00:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFN0UK8055372; Thu, 15 Nov 2018 23:00:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811152300.wAFN0UK8055372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 15 Nov 2018 23:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340466 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 340466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8ADFC83CA0 X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 23:00:32 -0000 Author: jhb Date: Thu Nov 15 23:00:30 2018 New Revision: 340466 URL: https://svnweb.freebsd.org/changeset/base/340466 Log: Move the TLS key map into the adapter softc so non-TOE code can use it. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Nov 15 22:47:47 2018 (r340465) +++ head/sys/dev/cxgbe/adapter.h Thu Nov 15 23:00:30 2018 (r340466) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -826,6 +827,7 @@ struct adapter { struct l2t_data *l2t; /* L2 table */ struct smt_data *smt; /* Source MAC Table */ struct tid_info tids; + vmem_t *key_map; uint8_t doorbells; int offload_map; /* ports with IFCAP_TOE enabled */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Nov 15 22:47:47 2018 (r340465) +++ head/sys/dev/cxgbe/t4_main.c Thu Nov 15 23:00:30 2018 (r340466) @@ -1153,6 +1153,9 @@ t4_attach(device_t dev) #ifdef RATELIMIT t4_init_etid_table(sc); #endif + if (sc->vres.key.size != 0) + sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start, + sc->vres.key.size, 8, 0, M_FIRSTFIT | M_WAITOK); /* * Second pass over the ports. This time we know the number of rx and @@ -1438,6 +1441,8 @@ t4_detach_common(device_t dev) #ifdef RATELIMIT t4_free_etid_table(sc); #endif + if (sc->key_map) + vmem_destroy(sc->key_map); #if defined(TCP_OFFLOAD) || defined(RATELIMIT) free(sc->sge.ofld_txq, M_CXGBE); Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Thu Nov 15 22:47:47 2018 (r340465) +++ head/sys/dev/cxgbe/tom/t4_tls.c Thu Nov 15 23:00:30 2018 (r340466) @@ -429,32 +429,13 @@ prepare_txkey_wr(struct tls_keyctx *kwr, struct tls_ke } /* TLS Key memory management */ -int -tls_init_kmap(struct adapter *sc, struct tom_data *td) -{ - - td->key_map = vmem_create("T4TLS key map", sc->vres.key.start, - sc->vres.key.size, 8, 0, M_FIRSTFIT | M_NOWAIT); - if (td->key_map == NULL) - return (ENOMEM); - return (0); -} - -void -tls_free_kmap(struct tom_data *td) -{ - - if (td->key_map != NULL) - vmem_destroy(td->key_map); -} - static int get_new_keyid(struct toepcb *toep, struct tls_key_context *k_ctx) { - struct tom_data *td = toep->td; + struct adapter *sc = td_adapter(toep->td); vmem_addr_t addr; - if (vmem_alloc(td->key_map, TLS_KEY_CONTEXT_SZ, M_NOWAIT | M_FIRSTFIT, + if (vmem_alloc(sc->key_map, TLS_KEY_CONTEXT_SZ, M_NOWAIT | M_FIRSTFIT, &addr) != 0) return (-1); @@ -464,9 +445,9 @@ get_new_keyid(struct toepcb *toep, struct tls_key_cont static void free_keyid(struct toepcb *toep, int keyid) { - struct tom_data *td = toep->td; + struct adapter *sc = td_adapter(toep->td); - vmem_free(td->key_map, keyid, TLS_KEY_CONTEXT_SZ); + vmem_free(sc->key_map, keyid, TLS_KEY_CONTEXT_SZ); } static void Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Nov 15 22:47:47 2018 (r340465) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Nov 15 23:00:30 2018 (r340466) @@ -1093,7 +1093,6 @@ free_tom_data(struct adapter *sc, struct tom_data *td) KASSERT(td->lctx_count == 0, ("%s: lctx hash table is not empty.", __func__)); - tls_free_kmap(td); t4_free_ppod_region(&td->pr); destroy_clip_table(sc, td); @@ -1372,12 +1371,6 @@ t4_tom_activate(struct adapter *sc) /* CLIP table for IPv6 offload */ init_clip_table(sc, td); - - if (sc->vres.key.size != 0) { - rc = tls_init_kmap(sc, td); - if (rc != 0) - goto done; - } /* toedev ops */ tod = &td->tod; Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Nov 15 22:47:47 2018 (r340465) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Nov 15 23:00:30 2018 (r340466) @@ -32,7 +32,6 @@ #ifndef __T4_TOM_H__ #define __T4_TOM_H__ -#include #include "tom/t4_tls.h" #define LISTEN_HASH_SIZE 32 @@ -280,8 +279,6 @@ struct tom_data { struct ppod_region pr; - vmem_t *key_map; - struct mtx clip_table_lock; struct clip_head clip_table; int clip_gen; @@ -426,8 +423,6 @@ void t4_push_tls_records(struct adapter *, struct toep void t4_tls_mod_load(void); void t4_tls_mod_unload(void); void tls_establish(struct toepcb *); -void tls_free_kmap(struct tom_data *); -int tls_init_kmap(struct adapter *, struct tom_data *); void tls_init_toep(struct toepcb *); int tls_rx_key(struct toepcb *); void tls_stop_handshake_timer(struct toepcb *); From owner-svn-src-head@freebsd.org Thu Nov 15 23:03:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B7DE110D14D; Thu, 15 Nov 2018 23:03:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74B4B840AB; Thu, 15 Nov 2018 23:03:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F38115135; Thu, 15 Nov 2018 23:03:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFN30sg060223; Thu, 15 Nov 2018 23:03:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFN30JF060222; Thu, 15 Nov 2018 23:03:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811152303.wAFN30JF060222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 15 Nov 2018 23:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340467 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74B4B840AB X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 23:03:01 -0000 Author: markj Date: Thu Nov 15 23:02:59 2018 New Revision: 340467 URL: https://svnweb.freebsd.org/changeset/base/340467 Log: Remove mostly-useless proc provider probes. For some reason the proc UMA zone's ctor, dtor and init functions are instrumented, but these functions are always available through FBT. Moreover, the probes are not part of the original Solaris proc provider, aren't documented, have no uses (e.g., in dwatch(8)) and have no clear use to begin with. Therefore, remove them. Reviewed by: rpaulo Differential Revision: https://reviews.freebsd.org/D2169 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Nov 15 23:00:30 2018 (r340466) +++ head/sys/kern/kern_proc.c Thu Nov 15 23:02:59 2018 (r340467) @@ -93,15 +93,6 @@ __FBSDID("$FreeBSD$"); #endif SDT_PROVIDER_DEFINE(proc); -SDT_PROBE_DEFINE4(proc, , ctor, entry, "struct proc *", "int", "void *", - "int"); -SDT_PROBE_DEFINE4(proc, , ctor, return, "struct proc *", "int", "void *", - "int"); -SDT_PROBE_DEFINE4(proc, , dtor, entry, "struct proc *", "int", "void *", - "struct thread *"); -SDT_PROBE_DEFINE3(proc, , dtor, return, "struct proc *", "int", "void *"); -SDT_PROBE_DEFINE3(proc, , init, entry, "struct proc *", "int", "int"); -SDT_PROBE_DEFINE3(proc, , init, return, "struct proc *", "int", "int"); MALLOC_DEFINE(M_PGRP, "pgrp", "process group header"); MALLOC_DEFINE(M_SESSION, "session", "session header"); @@ -206,9 +197,7 @@ proc_ctor(void *mem, int size, void *arg, int flags) struct thread *td; p = (struct proc *)mem; - SDT_PROBE4(proc, , ctor , entry, p, size, arg, flags); EVENTHANDLER_DIRECT_INVOKE(process_ctor, p); - SDT_PROBE4(proc, , ctor , return, p, size, arg, flags); td = FIRST_THREAD_IN_PROC(p); if (td != NULL) { /* Make sure all thread constructors are executed */ @@ -229,7 +218,6 @@ proc_dtor(void *mem, int size, void *arg) /* INVARIANTS checks go here */ p = (struct proc *)mem; td = FIRST_THREAD_IN_PROC(p); - SDT_PROBE4(proc, , dtor, entry, p, size, arg, td); if (td != NULL) { #ifdef INVARIANTS KASSERT((p->p_numthreads == 1), @@ -247,7 +235,6 @@ proc_dtor(void *mem, int size, void *arg) EVENTHANDLER_DIRECT_INVOKE(process_dtor, p); if (p->p_ksi != NULL) KASSERT(! KSI_ONQ(p->p_ksi), ("SIGCHLD queue")); - SDT_PROBE3(proc, , dtor, return, p, size, arg); } /* @@ -259,7 +246,6 @@ proc_init(void *mem, int size, int flags) struct proc *p; p = (struct proc *)mem; - SDT_PROBE3(proc, , init, entry, p, size, flags); mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW); mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN | MTX_NEW); mtx_init(&p->p_statmtx, "pstatl", NULL, MTX_SPIN | MTX_NEW); @@ -270,7 +256,6 @@ proc_init(void *mem, int size, int flags) EVENTHANDLER_DIRECT_INVOKE(process_init, p); p->p_stats = pstats_alloc(); p->p_pgrp = NULL; - SDT_PROBE3(proc, , init, return, p, size, flags); return (0); } From owner-svn-src-head@freebsd.org Thu Nov 15 23:10:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 239AD110D5F6; Thu, 15 Nov 2018 23:10:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7F7584448; Thu, 15 Nov 2018 23:10:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8902815167; Thu, 15 Nov 2018 23:10:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFNAkUJ060601; Thu, 15 Nov 2018 23:10:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFNAkfq060600; Thu, 15 Nov 2018 23:10:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811152310.wAFNAkfq060600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 15 Nov 2018 23:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340468 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 340468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7F7584448 X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 23:10:47 -0000 Author: jhb Date: Thu Nov 15 23:10:46 2018 New Revision: 340468 URL: https://svnweb.freebsd.org/changeset/base/340468 Log: Change the quantum for TLS key addresses to 32 bytes. The addresses passed when reading and writing keys are always shifted right by 5 as the memory locations are addressed in 32-byte chunks, so the quantum needs to be 32, not 8. MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Nov 15 23:02:59 2018 (r340467) +++ head/sys/dev/cxgbe/t4_main.c Thu Nov 15 23:10:46 2018 (r340468) @@ -1155,7 +1155,7 @@ t4_attach(device_t dev) #endif if (sc->vres.key.size != 0) sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start, - sc->vres.key.size, 8, 0, M_FIRSTFIT | M_WAITOK); + sc->vres.key.size, 32, 0, M_FIRSTFIT | M_WAITOK); /* * Second pass over the ports. This time we know the number of rx and From owner-svn-src-head@freebsd.org Thu Nov 15 23:31:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA843110DD8A; Thu, 15 Nov 2018 23:31:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 337CC84D49; Thu, 15 Nov 2018 23:31:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14A01155A9; Thu, 15 Nov 2018 23:31:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFNV42e073824; Thu, 15 Nov 2018 23:31:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFNV4pM073823; Thu, 15 Nov 2018 23:31:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811152331.wAFNV4pM073823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 15 Nov 2018 23:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340469 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 340469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 337CC84D49 X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 23:31:06 -0000 Author: jhb Date: Thu Nov 15 23:31:04 2018 New Revision: 340469 URL: https://svnweb.freebsd.org/changeset/base/340469 Log: Remove bogus roundup2() of the key programming work request header. The key context is always placed immediately after the work request header. The total work request length has to be rounded up by 16 however. MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tls.c Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Thu Nov 15 23:10:46 2018 (r340468) +++ head/sys/dev/cxgbe/tom/t4_tls.c Thu Nov 15 23:31:04 2018 (r340469) @@ -492,9 +492,9 @@ tls_program_key_id(struct toepcb *toep, struct tls_key struct tls_key_req *kwr; struct tls_keyctx *kctx; - kwrlen = roundup2(sizeof(*kwr), 16); + kwrlen = sizeof(*kwr); kctxlen = roundup2(sizeof(*kctx), 32); - len = kwrlen + kctxlen; + len = roundup2(kwrlen + kctxlen, 16); if (toep->txsd_avail == 0) return (EAGAIN); @@ -536,7 +536,6 @@ tls_program_key_id(struct toepcb *toep, struct tls_key kwr->sc_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); kwr->sc_len = htobe32(kctxlen); - /* XXX: This assumes that kwrlen == sizeof(*kwr). */ kctx = (struct tls_keyctx *)(kwr + 1); memset(kctx, 0, kctxlen); From owner-svn-src-head@freebsd.org Fri Nov 16 00:44:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 364E71121172; Fri, 16 Nov 2018 00:44:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B967169A5E; Fri, 16 Nov 2018 00:44:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A5881615A; Fri, 16 Nov 2018 00:44:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAG0iNOa011631; Fri, 16 Nov 2018 00:44:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAG0iNjM011630; Fri, 16 Nov 2018 00:44:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811160044.wAG0iNjM011630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Nov 2018 00:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340472 - in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 340472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B967169A5E X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 00:44:24 -0000 Author: mjg Date: Fri Nov 16 00:44:22 2018 New Revision: 340472 URL: https://svnweb.freebsd.org/changeset/base/340472 Log: amd64: handle small memset buffers with overlapping stores Instead of jumping to locations which store the exact number of bytes, use displacement to move the destination. In particular the following clears an area between 8-16 (inclusive) branch-free: movq %r10,(%rdi) movq %r10,-8(%rdi,%rcx) For instance for rcx of 10 the second line is rdi + 10 - 8 = rdi + 2. Writing 8 bytes starting at that offset overlaps with 6 bytes written previously and writes 2 new, giving 10 in total. Provides a nice win for smaller stores. Other ones are erratic depending on the microarchitecture. General idea taken from NetBSD (restricted use of the trick) and bionic string functions (use for various ranges like in this patch). Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17660 Modified: head/lib/libc/amd64/string/memset.S head/sys/amd64/amd64/support.S Modified: head/lib/libc/amd64/string/memset.S ============================================================================== --- head/lib/libc/amd64/string/memset.S Fri Nov 16 00:03:31 2018 (r340471) +++ head/lib/libc/amd64/string/memset.S Fri Nov 16 00:44:22 2018 (r340472) @@ -41,12 +41,12 @@ __FBSDID("$FreeBSD$"); imulq %r8,%r10 cmpq $32,%rcx - jb 1016f + jbe 101632f cmpq $256,%rcx ja 1256f -1032: +103200: movq %r10,(%rdi) movq %r10,8(%rdi) movq %r10,16(%rdi) @@ -54,43 +54,49 @@ __FBSDID("$FreeBSD$"); leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b - cmpb $0,%cl - je 1000f -1016: + ja 103200b cmpb $16,%cl - jl 1008f + ja 201632f + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +101632: + cmpb $16,%cl + jl 100816f +201632: movq %r10,(%rdi) movq %r10,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rdi),%rdi -1008: + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f + jl 100408f movq %r10,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rdi),%rdi -1004: + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f + jl 100204f movl %r10d,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rdi),%rdi -1002: + movl %r10d,-4(%rdi,%rcx) + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f + jl 100001f movw %r10w,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rdi),%rdi -1001: - cmpb $1,%cl - jl 1000f + movw %r10w,-2(%rdi,%rcx) + ret + ALIGN_TEXT +100001: + cmpb $0,%cl + je 100000f movb %r10b,(%rdi) -1000: +100000: ret ALIGN_TEXT 1256: @@ -127,6 +133,7 @@ __FBSDID("$FreeBSD$"); leaq 16(%rdi,%r8),%rdi jmp 1b .endm + ENTRY(memset) MEMSET erms=0 Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Fri Nov 16 00:03:31 2018 (r340471) +++ head/sys/amd64/amd64/support.S Fri Nov 16 00:44:22 2018 (r340472) @@ -459,12 +459,12 @@ END(memcpy_erms) imulq %r8,%r10 cmpq $32,%rcx - jb 1016f + jbe 101632f cmpq $256,%rcx ja 1256f -1032: +103200: movq %r10,(%rdi) movq %r10,8(%rdi) movq %r10,16(%rdi) @@ -472,43 +472,54 @@ END(memcpy_erms) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b - cmpb $0,%cl - je 1000f -1016: + ja 103200b cmpb $16,%cl - jl 1008f + ja 201632f + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +101632: + cmpb $16,%cl + jl 100816f +201632: movq %r10,(%rdi) movq %r10,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rdi),%rdi -1008: + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f + jl 100408f movq %r10,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rdi),%rdi -1004: + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f + jl 100204f movl %r10d,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rdi),%rdi -1002: + movl %r10d,-4(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f + jl 100001f movw %r10w,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rdi),%rdi -1001: - cmpb $1,%cl - jl 1000f + movw %r10w,-2(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100001: + cmpb $0,%cl + je 100000f movb %r10b,(%rdi) -1000: +100000: POP_FRAME_POINTER ret ALIGN_TEXT From owner-svn-src-head@freebsd.org Fri Nov 16 01:27:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13AA31121E15; Fri, 16 Nov 2018 01:27:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9620E6AD11; Fri, 16 Nov 2018 01:27:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77833167C9; Fri, 16 Nov 2018 01:27:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAG1RO1Z032014; Fri, 16 Nov 2018 01:27:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAG1RO3J032013; Fri, 16 Nov 2018 01:27:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811160127.wAG1RO3J032013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 16 Nov 2018 01:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340473 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 340473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9620E6AD11 X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 01:27:25 -0000 Author: jhb Date: Fri Nov 16 01:27:24 2018 New Revision: 340473 URL: https://svnweb.freebsd.org/changeset/base/340473 Log: Restore the header to fix build of cxgbe(4) TOM. vmem's are not just used for TLS memory in TOM and the #include actually predates the TLS code so should not have been removed when the TLS vmem moved in r340466. Pointy hat to: jhb Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri Nov 16 00:44:22 2018 (r340472) +++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Nov 16 01:27:24 2018 (r340473) @@ -32,6 +32,7 @@ #ifndef __T4_TOM_H__ #define __T4_TOM_H__ +#include #include "tom/t4_tls.h" #define LISTEN_HASH_SIZE 32 From owner-svn-src-head@freebsd.org Fri Nov 16 03:42:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E24391124D5C; Fri, 16 Nov 2018 03:42:30 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67B396F0A4; Fri, 16 Nov 2018 03:42:30 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F97317EEC; Fri, 16 Nov 2018 03:42:30 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAG3gUD0003671; Fri, 16 Nov 2018 03:42:30 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAG3gTcd003670; Fri, 16 Nov 2018 03:42:29 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201811160342.wAG3gTcd003670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Fri, 16 Nov 2018 03:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340474 - head/sys/net/altq X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: head/sys/net/altq X-SVN-Commit-Revision: 340474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67B396F0A4 X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 03:42:31 -0000 Author: karels Date: Fri Nov 16 03:42:29 2018 New Revision: 340474 URL: https://svnweb.freebsd.org/changeset/base/340474 Log: Fix flags collision causing inability to enable CBQ in ALTQ The CBQ BORROW flag conflicts with the RMCF_CODEL flag; the two sets of definitions actually define the same things. The symptom is that a kernel with CBQ support and not CODEL fails to load a QoS policy with the obscure error "pfctl: DIOCADDALTQ: Cannot allocate memory." If ALTQ_DEBUG is enabled, the error becomes a little clearer: "rmc_newclass: CODEL not configured for CBQ!" is printed by the kernel. There really shouldn't be two sets of macros that have to be defined consistently, but the include structure isn't right for exporting CBQ flags to altq_rmclass.h. Re-align the definitions, and add CTASSERTs in the kernel to ensure that the definitions are consistent. PR: 215716 Reviewed by: pkelsey MFC after: 2 weeks Sponsored by: Forcepoint LLC Differential Revision: https://reviews.freebsd.org/D17758 Modified: head/sys/net/altq/altq_cbq.h head/sys/net/altq/altq_rmclass.h Modified: head/sys/net/altq/altq_cbq.h ============================================================================== --- head/sys/net/altq/altq_cbq.h Fri Nov 16 01:27:24 2018 (r340473) +++ head/sys/net/altq/altq_cbq.h Fri Nov 16 03:42:29 2018 (r340474) @@ -46,7 +46,7 @@ extern "C" { #define NULL_CLASS_HANDLE 0 -/* class flags should be same as class flags in rm_class.h */ +/* class flags must be same as class flags in altq_rmclass.h */ #define CBQCLF_RED 0x0001 /* use RED */ #define CBQCLF_ECN 0x0002 /* use RED/ECN */ #define CBQCLF_RIO 0x0004 /* use RIO */ @@ -54,6 +54,15 @@ extern "C" { #define CBQCLF_CLEARDSCP 0x0010 /* clear diffserv codepoint */ #define CBQCLF_BORROW 0x0020 /* borrow from parent */ #define CBQCLF_CODEL 0x0040 /* use CoDel */ + +#ifdef _KERNEL +CTASSERT(CBQCLF_RED == RMCF_RED); +CTASSERT(CBQCLF_ECN == RMCF_ECN); +CTASSERT(CBQCLF_RIO == RMCF_RIO); +CTASSERT(CBQCLF_FLOWVALVE == RMCF_FLOWVALVE); +CTASSERT(CBQCLF_CLEARDSCP == RMCF_CLEARDSCP); +CTASSERT(CBQCLF_CODEL == RMCF_CODEL); +#endif /* class flags only for root class */ #define CBQCLF_WRR 0x0100 /* weighted-round robin */ Modified: head/sys/net/altq/altq_rmclass.h ============================================================================== --- head/sys/net/altq/altq_rmclass.h Fri Nov 16 01:27:24 2018 (r340473) +++ head/sys/net/altq/altq_rmclass.h Fri Nov 16 03:42:29 2018 (r340474) @@ -233,13 +233,13 @@ struct rm_ifdat { }; /* flags for rmc_init and rmc_newclass */ -/* class flags */ +/* class flags; must be the same as class flags in altq_cbq.h */ #define RMCF_RED 0x0001 #define RMCF_ECN 0x0002 #define RMCF_RIO 0x0004 #define RMCF_FLOWVALVE 0x0008 /* use flowvalve (aka penalty-box) */ #define RMCF_CLEARDSCP 0x0010 /* clear diffserv codepoint */ -#define RMCF_CODEL 0x0020 +#define RMCF_CODEL 0x0040 /* flags for rmc_init */ #define RMCF_WRR 0x0100 From owner-svn-src-head@freebsd.org Fri Nov 16 09:50:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D51F9112DB35; Fri, 16 Nov 2018 09:50:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 53EC679287; Fri, 16 Nov 2018 09:50:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 87781105BBFC; Fri, 16 Nov 2018 20:50:36 +1100 (AEDT) Date: Fri, 16 Nov 2018 20:50:34 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340472 - in head: lib/libc/amd64/string sys/amd64/amd64 In-Reply-To: <201811160044.wAG0iNjM011630@repo.freebsd.org> Message-ID: <20181116184758.B1835@besplex.bde.org> References: <201811160044.wAG0iNjM011630@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=xSh3073RJmBTSleZU8EA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 53EC679287 X-Spamd-Result: default: False [-2.64 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.75)[-0.751,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[optusnet.com.au]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; IP_SCORE(-0.01)[country: AU(-0.03)]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.58)[-0.575,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 09:50:50 -0000 On Fri, 16 Nov 2018, Mateusz Guzik wrote: > Log: > amd64: handle small memset buffers with overlapping stores > > Instead of jumping to locations which store the exact number of bytes, > use displacement to move the destination. > > In particular the following clears an area between 8-16 (inclusive) > branch-free: > > movq %r10,(%rdi) > movq %r10,-8(%rdi,%rcx) > > For instance for rcx of 10 the second line is rdi + 10 - 8 = rdi + 2. > Writing 8 bytes starting at that offset overlaps with 6 bytes written > previously and writes 2 new, giving 10 in total. > > Provides a nice win for smaller stores. Other ones are erratic depending > on the microarchitecture. > > General idea taken from NetBSD (restricted use of the trick) and bionic > string functions (use for various ranges like in this patch). Why not take such ideas from FreeBSD (or at least from FreeBSD committers) where this one was used between 1996 and 2010 for the i586(npx)-optimized bzero? Testing showed that it wasn't a very good idea, so I didn't use it anywhere else and didn't complain much when it was backed out. It is not very good since it pessimizes the usual case where everything is aligned. Now it is an even larger pessimization for the ERMS case, at least in theory, since "rep movsb" should be able to handle alignment stuff. Here it is for the version in FreeBSD-5: XX i586_bz2: XX fldz XX XX /* XX * Align to an 8 byte boundary (misalignment in the main loop would XX * cost a factor of >= 2). Avoid jumps (at little cost if it is XX * already aligned) by always zeroing 8 bytes and using the part up XX * to the _next_ alignment position. XX */ XX fstl 0(%edx) XX addl %edx,%ecx /* part of %ecx -= new_%edx - %edx */ XX addl $8,%edx XX andl $~7,%edx XX subl %edx,%ecx XX XX /* XX * Similarly align `len' to a multiple of 8. XX */ XX fstl -8(%edx,%ecx) XX decl %ecx XX andl $~7,%ecx This even has comments. The "little" cost mentioned in the comments is just the instruction fetch cost plus an extra fstl in cases where everthing is aligned. The first fstl in the above doesn't have much extra cost since it replaces an fstl in the loop later. The second one is only needed when the alignment stuff is needed (e.g., to write 14 bytes as 8+8 with an overlap of too), but it is always done to reduces branches. With too many instructions to fetch, code like this becomes almost as slow as "rep movs". IIRC, on Haswell, "rep movs[bwlq]" takes 25 cycles to start up (most x86's take about that long to start up string instructions and ERMS doesn't improve this on at least Haswell), and all cases have a throughput of 32 bytes/cycle, so in 25 cycles 800 bytes can be copied and for data smaller than about this size it is best not to use string instructions, provided you don't use methods that take too many cycles to start up. Alignment stuff tends to take too many cycles to start up especially if it has lots of branches which trash the branch target caches. I think the above takes about 3 cycles on Haswell, except for the fstls which are quite slow. IIRC, they have a throughput of about 1 every 2 cycles and a latency of 4 or 8 cycles. The above code was optimized for Pentium-1's where the times in cycles for fstl were not much different from on newer CPUs, but everything else is either wider or faster so going through npx registers is a pessimization. Pentium-1's can barely saturate their slow L1 cache using npx instructions. I don't like the way ERMS is used in -current on amd64: - pagezero_erms: this is useless on at least Haswell since it has the same speed as pagezero_std. ERMS makes "rep stosq" equally fast to "rep stosb" and everything is aligned so there is no difference in the setup overhead. (There might be a difference dividing the count by the access width, but this is done at compile time in pagezero_std, and in the overhead for doing this at runtime is in the noise.) - memmove_erms: with a large size, this should just use "rep movsb" with almost no setup. Instead, it uses the MEMMOVE macro to do lots of setup and to obfuscate its pessimizations. Disassembly shows that memmove_erms ends up with 152 instructions while memmove_std ends up with 164 instructions. There is little difference except that memmove_std has an extra main loop doing "rep movsq". This is implemented by testing the erms arg of MEMMOVE in just 2 places. The non-erms case of course has to divide by the access width, and then has to arrange to copy any remaining bytes. - memmove_std: this still has the pessimization of using "rep movsb" to finish up in some cases. This costs ~25 cycles of setup overhead when it is reached. erms as currently used gives almost no optimizations except by bypassing this pessimization. The finishing should be done using integer registers. Only 1 store is needed using overlapping stores. The macro makes it more difficult to remove this pessimization. - memmove_erms again: with a small size, it is best not to use any string instructions. I think the macro does this OK except it is hard to read. But optimizing for small sizes is especially unimportant. Small sizes are inlined by the compiler in many cases, and when memmove* is actually called, it runs fast, at least if it doesn't use string instructions or have too much setup overhead to optimize the even more unimportant misaligned case. - ifuncs: I don't like ifuncs. The one for pagezero_erms is just an obfuscation. The one for memmove_erms is just to save 1 whole predictable branch near the start of a general memmove function. memmove_erms now has 27 branches. Most of them are no executed for most calls, but I doubt that they cost less than the 1 branch avoided using ifuncs. The pre-erms version of bcopy() has just 1 branch (for the overlap case). Benchmarking branch costs is difficult and micro-benchmarks do it especially badly. The size of the branch target cache on modern x86's is a few K. That is enough to hold all branches for most micro-benchmarks, but kernels and applications are so bloated that it is not large enough to hold all branches for a few real applications. memmove() might be called enough to keep its main branches cached, but that keeps the cache depleted for other uses. - memcpy*: like memmove*, except it is simpler, but this is obfuscated using the MEMMOVE macro for memcpy too. - memset*. similar, but even simpler since it is inherently simpler and the MEMSET macro is only used to obfuscate 2 functions. - bzero: this better API is pessimized by going through memset() so that its fill word has to be constructed at runtime - copyout*, copyin*: these use MEMMOVE for the erms control. This requires further obfuscations in the macro, and duplicates the ~27 branches in memmove_erms many times. I only did efficiency tests of this using the makeworld macro-benchmark. This showed no signficant differences on Haswell. I did some micro-benchmarks related to this in userland. clang turns simple C memcpy() (a loop with *dst++ = *src++) into sort of much better code that all old and new "optimized" asm variants. E.g., if -march indicates that the CPU supports AVX*, then clang generates unportabley AVX* code, which the asm variants can't reasonably do, especially in the kernel. This is only sort of better since, apart from its unportability, clang generates its usualy excessive unrolling and too much setup code. In practice, I couldn't get clang's AVX code to run faster than "rep movsb" on freefall, by on my local Haswell system my benchmarks using AVX in asm run faster than "rep movsb"). gcc-4.2 doesn't support AVX* and mostly generates worse non-AVX code than clang, but sometimes it generates better code. Both compilers generated worse code for i386 with -m32. So for compilers as well as for asm authors, the best code is very MD and is rarely produced or written. Bruce From owner-svn-src-head@freebsd.org Fri Nov 16 10:20:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AC8B112E6E5; Fri, 16 Nov 2018 10:20:37 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E2D87A001; Fri, 16 Nov 2018 10:20:36 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DB941BE16; Fri, 16 Nov 2018 10:20:36 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGAKais002795; Fri, 16 Nov 2018 10:20:36 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGAKamL002794; Fri, 16 Nov 2018 10:20:36 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811161020.wAGAKamL002794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 16 Nov 2018 10:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340475 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 340475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E2D87A001 X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 10:20:37 -0000 Author: vmaffione Date: Fri Nov 16 10:20:35 2018 New Revision: 340475 URL: https://svnweb.freebsd.org/changeset/base/340475 Log: ifnet(9): Add description of IFCAP_NETMAP Describe IFCAP_NETMAP adding a cross reference to netmap(4). Reviewed by: bcr, 0mp Approved by: gnn (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17988 Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Fri Nov 16 03:42:29 2018 (r340474) +++ head/share/man/man9/ifnet.9 Fri Nov 16 10:20:35 2018 (r340475) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2017 +.Dd November 14, 2018 .Dt IFNET 9 .Os .Sh NAME @@ -759,6 +759,9 @@ interfaces (implies .Dv IFCAP_TSO ) . .It Dv IFCAP_LINKSTATE This Ethernet interface supports dynamic link state changes. +.It Dv IFCAP_NETMAP +This Ethernet interface supports +.Xr netmap 4 . .El .Pp The ability of advanced network interfaces to offload certain From owner-svn-src-head@freebsd.org Fri Nov 16 11:17:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56543112FAF5; Fri, 16 Nov 2018 11:17:20 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C44667BA87; Fri, 16 Nov 2018 11:17:19 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4BB11C7B9; Fri, 16 Nov 2018 11:17:19 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGBHJoJ033563; Fri, 16 Nov 2018 11:17:19 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGBHIUB033559; Fri, 16 Nov 2018 11:17:18 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201811161117.wAGBHIUB033559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Fri, 16 Nov 2018 11:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340476 - head/sys/mips/mediatek X-SVN-Group: head X-SVN-Commit-Author: sgalabov X-SVN-Commit-Paths: head/sys/mips/mediatek X-SVN-Commit-Revision: 340476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C44667BA87 X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 11:17:20 -0000 Author: sgalabov Date: Fri Nov 16 11:17:18 2018 New Revision: 340476 URL: https://svnweb.freebsd.org/changeset/base/340476 Log: Implement support for sysctl hw.model for Mediatek/Ralink SoCs These SoCs have CHIPID registers, which store the Chip model, according to the manufacturer; make use of those in order to better identify the chip we're actually running on. If we're unable to read the CHIPID registers for some reason we will use the string "unknown " as a value for hw.model. Reported by: yamori813@yahoo.co.jp Sponsored by: Smartcom - Bulgaria AD Modified: head/sys/mips/mediatek/mtk_machdep.c head/sys/mips/mediatek/mtk_soc.c head/sys/mips/mediatek/mtk_soc.h head/sys/mips/mediatek/mtk_sysctl.h Modified: head/sys/mips/mediatek/mtk_machdep.c ============================================================================== --- head/sys/mips/mediatek/mtk_machdep.c Fri Nov 16 10:20:35 2018 (r340475) +++ head/sys/mips/mediatek/mtk_machdep.c Fri Nov 16 11:17:18 2018 (r340476) @@ -233,6 +233,8 @@ platform_start(__register_t a0 __unused, __register_t while (1); mtk_soc_try_early_detect(); + mtk_soc_set_cpu_model(); + if ((timer_clk = mtk_soc_get_timerclk()) == 0) timer_clk = 1000000000; /* no such speed yet */ Modified: head/sys/mips/mediatek/mtk_soc.c ============================================================================== --- head/sys/mips/mediatek/mtk_soc.c Fri Nov 16 10:20:35 2018 (r340475) +++ head/sys/mips/mediatek/mtk_soc.c Fri Nov 16 11:17:18 2018 (r340476) @@ -52,6 +52,9 @@ static uint32_t mtk_soc_uartclk = 0; static uint32_t mtk_soc_cpuclk = MTK_CPU_CLK_880MHZ; static uint32_t mtk_soc_timerclk = MTK_CPU_CLK_880MHZ / 2; +static uint32_t mtk_soc_chipid0_3 = MTK_UNKNOWN_CHIPID0_3; +static uint32_t mtk_soc_chipid4_7 = MTK_UNKNOWN_CHIPID4_7; + static const struct ofw_compat_data compat_data[] = { { "ralink,rt2880-soc", MTK_SOC_RT2880 }, { "ralink,rt3050-soc", MTK_SOC_RT3050 }, @@ -295,6 +298,10 @@ mtk_soc_try_early_detect(void) if (bus_space_map(bst, base, MTK_DEFAULT_SIZE, 0, &bsh)) return; + /* Get our CHIP ID */ + mtk_soc_chipid0_3 = bus_space_read_4(bst, bsh, SYSCTL_CHIPID0_3); + mtk_soc_chipid4_7 = bus_space_read_4(bst, bsh, SYSCTL_CHIPID4_7); + /* First, figure out the CPU clock */ switch (mtk_soc_socid) { case MTK_SOC_RT2880: @@ -387,6 +394,28 @@ mtk_soc_try_early_detect(void) } bus_space_unmap(bst, bsh, MTK_DEFAULT_SIZE); +} + +extern char cpu_model[]; + +void +mtk_soc_set_cpu_model(void) +{ + uint32_t *p_model = (uint32_t *)cpu_model; + + /* + * CHIPID is always 2x32 bit registers, containing the ASCII + * representation of the chip, so use that directly. + * + * The info is either pre-populated in mtk_soc_try_early_detect() or + * it is left at its default value of "unknown " if it could not be + * obtained for some reason. + */ + p_model[0] = mtk_soc_chipid0_3; + p_model[1] = mtk_soc_chipid4_7; + + /* Null-terminate the string */ + cpu_model[8] = 0; } uint32_t Modified: head/sys/mips/mediatek/mtk_soc.h ============================================================================== --- head/sys/mips/mediatek/mtk_soc.h Fri Nov 16 10:20:35 2018 (r340475) +++ head/sys/mips/mediatek/mtk_soc.h Fri Nov 16 11:17:18 2018 (r340476) @@ -122,6 +122,7 @@ enum mtk_soc_id { #define MTK_DEFAULT_SIZE 0x6000 extern void mtk_soc_try_early_detect(void); +extern void mtk_soc_set_cpu_model(void); extern uint32_t mtk_soc_get_uartclk(void); extern uint32_t mtk_soc_get_cpuclk(void); extern uint32_t mtk_soc_get_timerclk(void); Modified: head/sys/mips/mediatek/mtk_sysctl.h ============================================================================== --- head/sys/mips/mediatek/mtk_sysctl.h Fri Nov 16 10:20:35 2018 (r340475) +++ head/sys/mips/mediatek/mtk_sysctl.h Fri Nov 16 11:17:18 2018 (r340476) @@ -54,6 +54,9 @@ #define RT3350_CHIPID0_3 0x33335452 +#define MTK_UNKNOWN_CHIPID0_3 0x6E6B6E75 /* "unkn" */ +#define MTK_UNKNOWN_CHIPID4_7 0x206E776F /* "own " */ + extern uint32_t mtk_sysctl_get(uint32_t); extern void mtk_sysctl_set(uint32_t, uint32_t); extern void mtk_sysctl_clr_set(uint32_t, uint32_t, uint32_t); From owner-svn-src-head@freebsd.org Fri Nov 16 14:21:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7353D113401B; Fri, 16 Nov 2018 14:21:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03F0280F08; Fri, 16 Nov 2018 14:21:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9C3A1E61B; Fri, 16 Nov 2018 14:21:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGELvF4026057; Fri, 16 Nov 2018 14:21:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGELvZs026056; Fri, 16 Nov 2018 14:21:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811161421.wAGELvZs026056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 16 Nov 2018 14:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340477 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 340477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03F0280F08 X-Spamd-Result: default: False [-102.98 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.87)[-0.873,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 14:21:58 -0000 Author: ae Date: Fri Nov 16 14:21:57 2018 New Revision: 340477 URL: https://svnweb.freebsd.org/changeset/base/340477 Log: Allow configuration of several ipsec interfaces with the same tunnel endpoints. This can be used to configure several IPsec tunnels between two hosts with different security associations. Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/net/if_ipsec.c Modified: head/sys/net/if_ipsec.c ============================================================================== --- head/sys/net/if_ipsec.c Fri Nov 16 11:17:18 2018 (r340476) +++ head/sys/net/if_ipsec.c Fri Nov 16 14:21:57 2018 (r340477) @@ -968,7 +968,7 @@ static int ipsec_set_addresses(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst) { - struct ipsec_softc *sc, *tsc; + struct ipsec_softc *sc; struct secasindex *saidx; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); @@ -982,18 +982,6 @@ ipsec_set_addresses(struct ifnet *ifp, struct sockaddr key_sockaddrcmp(&saidx->dst.sa, dst, 0) == 0) return (0); /* Nothing has been changed. */ - } - /* Check that given addresses aren't already configured */ - CK_LIST_FOREACH(tsc, ipsec_srchash(src), srchash) { - if (tsc == sc) - continue; - MPASS(tsc->family == src->sa_family); - saidx = ipsec_getsaidx(tsc, IPSEC_DIR_OUTBOUND, tsc->family); - if (key_sockaddrcmp(&saidx->src.sa, src, 0) == 0 && - key_sockaddrcmp(&saidx->dst.sa, dst, 0) == 0) { - /* We already have tunnel with such addresses */ - return (EADDRNOTAVAIL); - } } /* If reqid is not set, generate new one. */ if (ipsec_init_reqid(sc) != 0) From owner-svn-src-head@freebsd.org Fri Nov 16 14:29:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59527113436D; Fri, 16 Nov 2018 14:29:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C284B812AB; Fri, 16 Nov 2018 14:29:28 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DE781E64D; Fri, 16 Nov 2018 14:29:28 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGETSTh030440; Fri, 16 Nov 2018 14:29:28 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGETSqh030439; Fri, 16 Nov 2018 14:29:28 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811161429.wAGETSqh030439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 16 Nov 2018 14:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340478 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 340478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C284B812AB X-Spamd-Result: default: False [-102.97 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.86)[-0.860,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 14:29:29 -0000 Author: 0mp (ports committer) Date: Fri Nov 16 14:29:28 2018 New Revision: 340478 URL: https://svnweb.freebsd.org/changeset/base/340478 Log: development(7): Replace "reboot" with "shutdown -r now" We generally document shutdown(8) instead of reboot(8) as it's better for interactive use. In modern FreeBSD is matters a lot less, it's mostly just convention. One minor thing is that shutdown(8) produces a global message, while reboot(8) does not. It is believed that historically, some versions of reboot did not do appropriate safe shutdown checks and just rebooted. It's also just consistency: for example the handbook[1] documents shutdown. There is actually another important difference between reboot and shutdown -r now: reboot does not run /etc/rc.shutdown. This is because reboot has its own shutdown procedure and does not signal init like init 6 and shutdown -r now do (except in the case of rerooting via reboot -r). A few years ago jilles@ proposed changing reboot's default to signalling init (preserving reboot -q which just invokes the reboot system call), but this was not accepted. Perhaps this can be tried again for 13.0. [1]: https://www.freebsd.org/doc/handbook/boot-shutdown.html Reported by: eadler Reviewed by: eadler, jilles Approved by: krion (mentor) Differential Revision: https://reviews.freebsd.org/D16843 Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Fri Nov 16 14:21:57 2018 (r340477) +++ head/share/man/man7/development.7 Fri Nov 16 14:29:28 2018 (r340478) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2018 +.Dd November 16, 2018 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -110,7 +110,7 @@ system: svnlite co https://svn.FreeBSD.org/base/head src cd src make -j8 buildworld buildkernel installkernel -reboot +shutdown -r now .Ed .Pp After reboot: From owner-svn-src-head@freebsd.org Fri Nov 16 16:19:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE1131136566; Fri, 16 Nov 2018 16:19:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47C4484BE0; Fri, 16 Nov 2018 16:19:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19D861F7EB; Fri, 16 Nov 2018 16:19:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGGJG2I086953; Fri, 16 Nov 2018 16:19:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGGJGIW086952; Fri, 16 Nov 2018 16:19:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811161619.wAGGJGIW086952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Nov 2018 16:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340479 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47C4484BE0 X-Spamd-Result: default: False [-103.02 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.91)[-0.912,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 16:19:18 -0000 Author: hselasky Date: Fri Nov 16 16:19:16 2018 New Revision: 340479 URL: https://svnweb.freebsd.org/changeset/base/340479 Log: Implement ktime_get_ts64() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Fri Nov 16 14:29:28 2018 (r340478) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Fri Nov 16 16:19:16 2018 (r340479) @@ -176,6 +176,7 @@ timeval_to_ktime(struct timeval tv) #define ktime_to_timespec64(kt) ns_to_timespec(kt) #define ktime_to_timeval(kt) ns_to_timeval(kt) #define ktime_to_ns(kt) (kt) +#define ktime_get_ts64(ts) ktime_get_ts(ts) static inline int64_t ktime_get_ns(void) From owner-svn-src-head@freebsd.org Fri Nov 16 16:23:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF6A113679A; Fri, 16 Nov 2018 16:23:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECD2785048; Fri, 16 Nov 2018 16:23:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD33A1F97E; Fri, 16 Nov 2018 16:23:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGGNjNk092387; Fri, 16 Nov 2018 16:23:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGGNjIQ092386; Fri, 16 Nov 2018 16:23:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811161623.wAGGNjIQ092386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Nov 2018 16:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340480 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECD2785048 X-Spamd-Result: default: False [-103.02 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 16:23:46 -0000 Author: hselasky Date: Fri Nov 16 16:23:45 2018 New Revision: 340480 URL: https://svnweb.freebsd.org/changeset/base/340480 Log: Define asm macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Fri Nov 16 16:19:16 2018 (r340479) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Fri Nov 16 16:23:45 2018 (r340480) @@ -138,6 +138,8 @@ #define printk(...) printf(__VA_ARGS__) #define vprintk(f, a) vprintf(f, a) +#define asm __asm + extern void linux_dump_stack(void); #define dump_stack() linux_dump_stack() From owner-svn-src-head@freebsd.org Fri Nov 16 16:51:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70E891136E03; Fri, 16 Nov 2018 16:51:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1E5385CBD; Fri, 16 Nov 2018 16:51:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C31481FE0B; Fri, 16 Nov 2018 16:51:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGGpiYe003254; Fri, 16 Nov 2018 16:51:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGGpiED003253; Fri, 16 Nov 2018 16:51:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811161651.wAGGpiED003253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 16 Nov 2018 16:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340481 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 340481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1E5385CBD X-Spamd-Result: default: False [-106.87 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 16:51:45 -0000 Author: imp Date: Fri Nov 16 16:51:44 2018 New Revision: 340481 URL: https://svnweb.freebsd.org/changeset/base/340481 Log: Remove do-nothing nvme_modevent. nvme_modevent no longer does anything interesting, remove it. Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Fri Nov 16 16:23:45 2018 (r340480) +++ head/sys/dev/nvme/nvme.c Fri Nov 16 16:51:44 2018 (r340481) @@ -61,7 +61,6 @@ static int nvme_probe(device_t); static int nvme_attach(device_t); static int nvme_detach(device_t); static int nvme_shutdown(device_t); -static int nvme_modevent(module_t mod, int type, void *arg); static devclass_t nvme_devclass; @@ -80,7 +79,7 @@ static driver_t nvme_pci_driver = { sizeof(struct nvme_controller), }; -DRIVER_MODULE(nvme, pci, nvme_pci_driver, nvme_devclass, nvme_modevent, 0); +DRIVER_MODULE(nvme, pci, nvme_pci_driver, nvme_devclass, NULL, NULL); MODULE_VERSION(nvme, 1); MODULE_DEPEND(nvme, cam, 1, 1, 1); @@ -181,16 +180,6 @@ nvme_uninit(void) SYSUNINIT(nvme_unregister, SI_SUB_DRIVERS, SI_ORDER_SECOND, nvme_uninit, NULL); -static void -nvme_load(void) -{ -} - -static void -nvme_unload(void) -{ -} - static int nvme_shutdown(device_t dev) { @@ -198,24 +187,6 @@ nvme_shutdown(device_t dev) ctrlr = DEVICE2SOFTC(dev); nvme_ctrlr_shutdown(ctrlr); - - return (0); -} - -static int -nvme_modevent(module_t mod, int type, void *arg) -{ - - switch (type) { - case MOD_LOAD: - nvme_load(); - break; - case MOD_UNLOAD: - nvme_unload(); - break; - default: - break; - } return (0); } From owner-svn-src-head@freebsd.org Fri Nov 16 17:07:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B621137895; Fri, 16 Nov 2018 17:07:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFEA786F8C; Fri, 16 Nov 2018 17:07:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C03B01FFEA; Fri, 16 Nov 2018 17:07:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGH7u2w013750; Fri, 16 Nov 2018 17:07:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGH7sPA013741; Fri, 16 Nov 2018 17:07:54 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811161707.wAGH7sPA013741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Nov 2018 17:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340482 - in head/sys: compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: compat/linux kern sys X-SVN-Commit-Revision: 340482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFEA786F8C X-Spamd-Result: default: False [-103.07 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 17:07:57 -0000 Author: mjg Date: Fri Nov 16 17:07:54 2018 New Revision: 340482 URL: https://svnweb.freebsd.org/changeset/base/340482 Log: proc: always store parent pid in p_oppid Doing so removes the dependency on proctree lock from sysctl process list export which further reduces contention during poudriere -j 128 runs. Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17825 Modified: head/sys/compat/linux/linux_fork.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_kthread.c head/sys/kern/kern_proc.c head/sys/kern/kern_prot.c head/sys/kern/sys_procdesc.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/compat/linux/linux_fork.c Fri Nov 16 17:07:54 2018 (r340482) @@ -235,7 +235,7 @@ linux_clone_proc(struct thread *td, struct linux_clone if (args->flags & LINUX_CLONE_PARENT) { sx_xlock(&proctree_lock); PROC_LOCK(p2); - proc_reparent(p2, td->td_proc->p_pptr); + proc_reparent(p2, td->td_proc->p_pptr, true); PROC_UNLOCK(p2); sx_xunlock(&proctree_lock); } Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/kern/kern_exit.c Fri Nov 16 17:07:54 2018 (r340482) @@ -107,14 +107,9 @@ proc_realparent(struct proc *child) struct proc *p, *parent; sx_assert(&proctree_lock, SX_LOCKED); - if ((child->p_treeflag & P_TREE_ORPHANED) == 0) { - if (child->p_oppid == 0 || - child->p_pptr->p_pid == child->p_oppid) - parent = child->p_pptr; - else - parent = initproc; - return (parent); - } + if ((child->p_treeflag & P_TREE_ORPHANED) == 0) + return (child->p_pptr->p_pid == child->p_oppid ? + child->p_pptr : initproc); for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) { /* Cannot use LIST_PREV(), since the list head is not known. */ p = __containerof(p->p_orphan.le_prev, struct proc, @@ -144,7 +139,7 @@ reaper_abandon_children(struct proc *p, bool exiting) LIST_INSERT_HEAD(&p1->p_reaplist, p2, p_reapsibling); if (exiting && p2->p_pptr == p) { PROC_LOCK(p2); - proc_reparent(p2, p1); + proc_reparent(p2, p1, true); PROC_UNLOCK(p2); } } @@ -458,7 +453,7 @@ exit1(struct thread *td, int rval, int signo) q->p_sigparent = SIGCHLD; if (!(q->p_flag & P_TRACED)) { - proc_reparent(q, q->p_reaper); + proc_reparent(q, q->p_reaper, true); if (q->p_state == PRS_ZOMBIE) { /* * Inform reaper about the reparented @@ -494,10 +489,10 @@ exit1(struct thread *td, int rval, int signo) */ t = proc_realparent(q); if (t == p) { - proc_reparent(q, q->p_reaper); + proc_reparent(q, q->p_reaper, true); } else { PROC_LOCK(t); - proc_reparent(q, t); + proc_reparent(q, t, true); PROC_UNLOCK(t); } /* @@ -589,7 +584,7 @@ exit1(struct thread *td, int rval, int signo) mtx_unlock(&p->p_pptr->p_sigacts->ps_mtx); pp = p->p_pptr; PROC_UNLOCK(pp); - proc_reparent(p, p->p_reaper); + proc_reparent(p, p->p_reaper, true); p->p_sigparent = SIGCHLD; PROC_LOCK(p->p_pptr); @@ -855,7 +850,7 @@ proc_reap(struct thread *td, struct proc *p, int *stat * If we got the child via a ptrace 'attach', we need to give it back * to the old parent. */ - if (p->p_oppid != 0 && p->p_oppid != p->p_pptr->p_pid) { + if (p->p_oppid != p->p_pptr->p_pid) { PROC_UNLOCK(p); t = proc_realparent(p); PROC_LOCK(t); @@ -863,8 +858,7 @@ proc_reap(struct thread *td, struct proc *p, int *stat CTR2(KTR_PTRACE, "wait: traced child %d moved back to parent %d", p->p_pid, t->p_pid); - proc_reparent(p, t); - p->p_oppid = 0; + proc_reparent(p, t, false); PROC_UNLOCK(p); pksignal(t, SIGCHLD, p->p_ksi); wakeup(t); @@ -873,7 +867,6 @@ proc_reap(struct thread *td, struct proc *p, int *stat sx_xunlock(&proctree_lock); return; } - p->p_oppid = 0; PROC_UNLOCK(p); /* @@ -1333,7 +1326,7 @@ loop_locked: * Must be called with an exclusive hold of proctree lock. */ void -proc_reparent(struct proc *child, struct proc *parent) +proc_reparent(struct proc *child, struct proc *parent, bool set_oppid) { sx_assert(&proctree_lock, SX_XLOCKED); @@ -1361,4 +1354,6 @@ proc_reparent(struct proc *child, struct proc *parent) } child->p_pptr = parent; + if (set_oppid) + child->p_oppid = parent->p_pid; } Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/kern/kern_fork.c Fri Nov 16 17:07:54 2018 (r340482) @@ -643,6 +643,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct pptr = p1; } p2->p_pptr = pptr; + p2->p_oppid = pptr->p_pid; LIST_INSERT_HEAD(&pptr->p_children, p2, p_sibling); LIST_INIT(&p2->p_reaplist); LIST_INSERT_HEAD(&p2->p_reaper->p_reaplist, p2, p_reapsibling); @@ -774,7 +775,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct CTR2(KTR_PTRACE, "do_fork: attaching to new child pid %d: oppid %d", p2->p_pid, p2->p_oppid); - proc_reparent(p2, p1->p_pptr); + proc_reparent(p2, p1->p_pptr, false); } PROC_UNLOCK(p2); sx_xunlock(&proctree_lock); Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/kern/kern_kthread.c Fri Nov 16 17:07:54 2018 (r340482) @@ -166,7 +166,7 @@ kproc_exit(int ecode) */ sx_xlock(&proctree_lock); PROC_LOCK(p); - proc_reparent(p, initproc); + proc_reparent(p, initproc, true); PROC_UNLOCK(p); sx_xunlock(&proctree_lock); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/kern/kern_proc.c Fri Nov 16 17:07:54 2018 (r340482) @@ -894,8 +894,6 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc struct sigacts *ps; struct timeval boottime; - /* For proc_realparent. */ - sx_assert(&proctree_lock, SX_LOCKED); PROC_LOCK_ASSERT(p, MA_OWNED); bzero(kp, sizeof(*kp)); @@ -1029,7 +1027,7 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc kp->ki_acflag = p->p_acflag; kp->ki_lock = p->p_lock; if (p->p_pptr) { - kp->ki_ppid = proc_realparent(p)->p_pid; + kp->ki_ppid = p->p_oppid; if (p->p_flag & P_TRACED) kp->ki_tracer = p->p_pptr->p_pid; } @@ -1450,11 +1448,9 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error) return (error); - sx_slock(&proctree_lock); error = pget((pid_t)name[0], PGET_CANSEE, &p); if (error == 0) error = sysctl_out_proc(p, req, flags); - sx_sunlock(&proctree_lock); return (error); } @@ -1482,12 +1478,6 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error != 0) return (error); - /* - * This lock is only needed to safely grab the parent of a - * traced process. Only grab it if we are producing any - * data to begin with. - */ - sx_slock(&proctree_lock); } sx_slock(&allproc_lock); for (doingzomb=0 ; doingzomb < 2 ; doingzomb++) { @@ -1595,8 +1585,6 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } out: sx_sunlock(&allproc_lock); - if (req->oldptr != NULL) - sx_sunlock(&proctree_lock); return (error); } Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/kern/kern_prot.c Fri Nov 16 17:07:54 2018 (r340482) @@ -124,22 +124,8 @@ int kern_getppid(struct thread *td) { struct proc *p = td->td_proc; - struct proc *pp; - int ppid; - PROC_LOCK(p); - if (!(p->p_flag & P_TRACED)) { - ppid = p->p_pptr->p_pid; - PROC_UNLOCK(p); - } else { - PROC_UNLOCK(p); - sx_slock(&proctree_lock); - pp = proc_realparent(p); - ppid = pp->p_pid; - sx_sunlock(&proctree_lock); - } - - return (ppid); + return (p->p_oppid); } /* Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/kern/sys_procdesc.c Fri Nov 16 17:07:54 2018 (r340482) @@ -416,7 +416,7 @@ procdesc_close(struct file *fp, struct thread *td) * terminate with prejudice. */ p->p_sigparent = SIGCHLD; - proc_reparent(p, p->p_reaper); + proc_reparent(p, p->p_reaper, true); if ((pd->pd_flags & PDF_DAEMON) == 0) kern_psignal(p, SIGKILL); PROC_UNLOCK(p); Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/kern/sys_process.c Fri Nov 16 17:07:54 2018 (r340482) @@ -695,7 +695,6 @@ proc_set_traced(struct proc *p, bool stop) if (stop) p->p_flag2 |= P2_PTRACE_FSTP; p->p_ptevents = PTRACE_DEFAULT; - p->p_oppid = p->p_pptr->p_pid; } int @@ -919,7 +918,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi */ proc_set_traced(p, true); if (p->p_pptr != td->td_proc) { - proc_reparent(p, td->td_proc); + proc_reparent(p, td->td_proc, false); } CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid, p->p_oppid); @@ -1113,7 +1112,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi PROC_UNLOCK(p->p_pptr); pp = proc_realparent(p); - proc_reparent(p, pp); + proc_reparent(p, pp, false); if (pp == initproc) p->p_sigparent = SIGCHLD; CTR3(KTR_PTRACE, @@ -1122,7 +1121,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi } else CTR2(KTR_PTRACE, "PT_DETACH: pid %d, sig %d", p->p_pid, data); - p->p_oppid = 0; p->p_ptevents = 0; FOREACH_THREAD_IN_PROC(p, td3) { if ((td3->td_dbgflags & TDB_FSTP) != 0) { Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Nov 16 16:51:44 2018 (r340481) +++ head/sys/sys/proc.h Fri Nov 16 17:07:54 2018 (r340482) @@ -594,10 +594,10 @@ struct proc { struct ksiginfo *p_ksi; /* Locked by parent proc lock */ sigqueue_t p_sigqueue; /* (c) Sigs not delivered to a td. */ #define p_siglist p_sigqueue.sq_signals + pid_t p_oppid; /* (c + e) Real parent pid. */ /* The following fields are all zeroed upon creation in fork. */ -#define p_startzero p_oppid - pid_t p_oppid; /* (c + e) Save ppid in ptrace. XXX */ +#define p_startzero p_vmspace struct vmspace *p_vmspace; /* (b) Address space. */ u_int p_swtick; /* (c) Tick when swapped in or out. */ u_int p_cowgen; /* (c) Generation of COW pointers. */ @@ -1050,7 +1050,7 @@ void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); -void proc_reparent(struct proc *child, struct proc *newparent); +void proc_reparent(struct proc *child, struct proc *newparent, bool set_oppid); void proc_set_traced(struct proc *p, bool stop); void proc_wkilled(struct proc *p); struct pstats *pstats_alloc(void); From owner-svn-src-head@freebsd.org Fri Nov 16 17:41:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74B32110027E; Fri, 16 Nov 2018 17:41:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A21B688BCD; Fri, 16 Nov 2018 17:41:51 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f170.google.com with SMTP id x85-v6so21059491ljb.2; Fri, 16 Nov 2018 09:41:51 -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=Ubj3Pc3E0J43qC88/jOV7RDSJxfNt1rEdCnwa4RXI7o=; b=l2gKu81udGnbhb7sb1zXOFUWjga6bymRm16l3Ijq4A+Z6dMRTnxLzciYlEpBUVoAU8 GoOsPfohDlTXcMwX0hm7leQJxEGJY7xyp2wKLGOr5/IVkKiKdUvyjqGHQ3Di8w8jKZr1 zOGpTaxME+27me/ubYOUnA0lpZ25ccAfk/nurV4Km9RDzX3/PQinvWVo/28fl3Upm47P eiBRaVkJBSpF0W8mK3wEiYUyTxHi9xvlZwPysFEfP1+dPQaaye6mpPttm6V3kvr9nV1R mC1/tDxG7Mga7LEvx8OqCVBPqwld8Vsu4jvHETDRdLj8dyfFFhuzv2kU4wn8Nx1jBB1Q Q/Gg== X-Gm-Message-State: AGRZ1gKdp6CXV3YVyEA0SuXIN0jPIeu989N1iTb4KbCKMIJ1WwjTa277 IXg6oKHDv4i5oCrN3H8JZ2oGrkL+m2KJD4X1eWUufzg+ X-Google-Smtp-Source: AJdET5eBxM9wm9AcxJV1q22ObcxazcETSeYuC0kqw36PROglOnBe1AM16cozgHM5HSpgAJIl7OEQyhfWDtERazK3wrw= X-Received: by 2002:a2e:20c3:: with SMTP id g64-v6mr7137018lji.101.1542389656982; Fri, 16 Nov 2018 09:34:16 -0800 (PST) MIME-Version: 1.0 References: <201805042054.w44KsRtc038808@repo.freebsd.org> In-Reply-To: <201805042054.w44KsRtc038808@repo.freebsd.org> From: Alan Somers Date: Fri, 16 Nov 2018 10:34:04 -0700 Message-ID: Subject: Re: svn commit: r333263 - in head: lib/libjail sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs sys/compat/linsysfs sys/fs/devfs sys/fs/fdescfs sys/fs/nullfs sys/fs/procfs sys/fs/pse... To: jamie@freebsd.org Cc: src-committers , svn-src-all , svn-src-head , ross@ross-williams.net X-Rspamd-Queue-Id: A21B688BCD X-Spamd-Result: default: False [-3.91 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.84)[-0.839,0]; RCVD_IN_DNSWL_NONE(0.00)[170.208.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.06)[ipnet: 209.85.128.0/17(-3.41), asn: 15169(-1.82), country: US(-0.10)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 17:41:52 -0000 On Fri, May 4, 2018 at 2:54 PM Jamie Gritton wrote: > Author: jamie > Date: Fri May 4 20:54:27 2018 > New Revision: 333263 > URL: https://svnweb.freebsd.org/changeset/base/333263 > > Log: > Make it easier for filesystems to count themselves as jail-enabled, > by doing most of the work in a new function prison_add_vfs in kern_jail.c > Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and > the rest is taken care of. This includes adding a jail parameter like > allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed. > Both of these used to be a static list of known filesystems, with > predefined permission bits. > > Reviewed by: kib > Differential Revision: D14681 > > Modified: > head/lib/libjail/jail.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > head/sys/compat/linprocfs/linprocfs.c > head/sys/compat/linsysfs/linsysfs.c > head/sys/fs/devfs/devfs_vfsops.c > head/sys/fs/fdescfs/fdesc_vfsops.c > head/sys/fs/nullfs/null_vfsops.c > head/sys/fs/procfs/procfs.c > head/sys/fs/pseudofs/pseudofs.h > head/sys/fs/tmpfs/tmpfs_vfsops.c > head/sys/kern/kern_jail.c > head/sys/kern/vfs_init.c > head/sys/kern/vfs_mount.c > head/sys/kern/vfs_subr.c > head/sys/sys/jail.h > head/sys/sys/mount.h > head/usr.sbin/jail/jail.8 > > Modified: head/lib/libjail/jail.c > > ============================================================================== > --- head/lib/libjail/jail.c Fri May 4 20:38:26 2018 (r333262) > +++ head/lib/libjail/jail.c Fri May 4 20:54:27 2018 (r333263) > @@ -1048,7 +1048,13 @@ kldload_param(const char *name) > else if (strcmp(name, "sysvmsg") == 0 || strcmp(name, "sysvsem") > == 0 || > strcmp(name, "sysvshm") == 0) > kl = kldload(name); > - else { > + else if (strncmp(name, "allow.mount.", 12) == 0) { > + /* Load the matching filesystem */ > + kl = kldload(name + 12); > + if (kl < 0 && errno == ENOENT && > + strncmp(name + 12, "no", 2) == 0) > + kl = kldload(name + 14); > + } else { > errno = ENOENT; > return (-1); > } > I'm curious about this part of the change. Why is it necessary to load the module in the "allow.mount.noXXXfs" case, when the jail is forbidden to mount the filesystem? It seems like that would just load modules that aren't going to be used. Additional discussion at https://github.com/iocage/iocage/issues/689 . -Alan From owner-svn-src-head@freebsd.org Fri Nov 16 17:55:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E5A011007D8 for ; Fri, 16 Nov 2018 17:55:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9CC489350 for ; Fri, 16 Nov 2018 17:55:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd29.google.com with SMTP id f12-v6so17723986iog.0 for ; Fri, 16 Nov 2018 09:55:32 -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=issg7mUIlJgImKg6ElPQ0LH9+PD7kVIgv+oPzvp6ZyA=; b=GYhTllNvgePMogRxcCX7utNJyI4xC9vJ8qehWIfUb1ZRmN3Nt/ZkgnpKOwY/ttvd56 ckAQ7ITIAjY55fDIu28qOus6d9X5wf/EBqgokpryXFBgmdSPHcasfwPV5yRfaHPio5vP GvmFZiAr2hj4xHhrPEpe4zjY5Fy5fyguFKPr3OUBvTLM7mEKwjcJkc7EOOmHJW+VEEK3 LYRWIS47/J6TcjYYLamLwvrvRrop6Xh9CFx5espb2ERTZlmStV2Xbn8gdugIC+FwKu42 WKJ2+y9pC8ICSjilHSOFW05CJCH31KIQt1NU5+u+i3jqZh/DmNkk1bqR7alb1QhAZpv3 2kCw== 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=issg7mUIlJgImKg6ElPQ0LH9+PD7kVIgv+oPzvp6ZyA=; b=Us1vs+bfKO1Jh7Q6h6ZxQw/Zm4OIdfq0shBJpaO/8GNHpxFIiLHfQZB2QxDKaLOuaj XDXhllJh/TN3o4JaxHuX1kqvmvMI5pmJQqHJYpJC6CyLMSGQDsJF6/ds6ciYMENj2B1I O6BXCyMaeERkiI3D6N/T5nr7qb/pY2N44swM8S4kJXZvYRHEk4nK1mDbJTzU7kfRPMus NGqzc0fjTTGqLR4CpgC0yerKZIJK1lD1YXTlqHxrhEzaygKTMb3PN9bPwQ2Nj9uEK/fv CyswGt10+aF2YM/9qvCOBkHdweK50l5mjYct4tGm61oDV2ZvKs6UIMOjb8FSXSgErMIv Z2HA== X-Gm-Message-State: AGRZ1gJpuEy/mBH/CGSTldlGrDjL7GE0DPCJjXhFD+kPDIb1V++mATh/ MI4+j93JBYeoWIVww6y9mCXnAeE58ia+zB31HlSHFA== X-Google-Smtp-Source: AFSGD/UL8Ou3XXTLbAFvpUAMpE+era92SLzYuQkCIdeA8rMIMFz3qLyahUQYQVhrKOsozsIU5iDgSOXJ94ogflqiZJc= X-Received: by 2002:a5e:8614:: with SMTP id z20-v6mr9554063ioj.37.1542390932044; Fri, 16 Nov 2018 09:55:32 -0800 (PST) MIME-Version: 1.0 References: <201811161429.wAGETSqh030439@repo.freebsd.org> In-Reply-To: <201811161429.wAGETSqh030439@repo.freebsd.org> From: Warner Losh Date: Fri, 16 Nov 2018 10:55:20 -0700 Message-ID: Subject: Re: svn commit: r340478 - head/share/man/man7 To: 0mp@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: B9CC489350 X-Spamd-Result: default: False [-5.30 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[9.2.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.32)[ip: (-7.01), ipnet: 2607:f8b0::/32(-2.67), asn: 15169(-1.82), country: US(-0.10)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 17:55:33 -0000 On Fri, Nov 16, 2018 at 7:29 AM Mateusz Piotrowski <0mp@freebsd.org> wrote: > A few years ago jilles@ proposed changing reboot's default to signalling > init (preserving reboot -q which just invokes the reboot system call), > but > this was not accepted. Perhaps this can be tried again for 13.0. > I didn't like it at the time, however I was wrong. Much of my reasoning for doing it has become muted as well since then, and the need to do it has become more amplified as more rc scripts have grown shutdown functionality... I think if we make what's now reboot 'fastreboot' or 'reboot -q' (both of which are historic replacements), we can make 'reboot' what's now 'shutdown -r now'. Warner From owner-svn-src-head@freebsd.org Fri Nov 16 18:04:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D6851100AB1; Fri, 16 Nov 2018 18:04:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 0530189808; Fri, 16 Nov 2018 18:04:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAGI44W9047388; Fri, 16 Nov 2018 10:04:04 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAGI44WC047387; Fri, 16 Nov 2018 10:04:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811161804.wAGI44WC047387@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340478 - head/share/man/man7 In-Reply-To: To: Warner Losh Date: Fri, 16 Nov 2018 10:04:04 -0800 (PST) CC: 0mp@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 0530189808 X-Spamd-Result: default: False [0.83 / 40.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.19)[0.185,0]; NEURAL_HAM_LONG(-0.60)[-0.597,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_MEDIUM(0.37)[0.375,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 18:04:08 -0000 > On Fri, Nov 16, 2018 at 7:29 AM Mateusz Piotrowski <0mp@freebsd.org> wrote: > > > A few years ago jilles@ proposed changing reboot's default to signalling > > init (preserving reboot -q which just invokes the reboot system call), > > but > > this was not accepted. Perhaps this can be tried again for 13.0. > > > > I didn't like it at the time, however I was wrong. Much of my reasoning for > doing it has become muted as well since then, and the need to do it has > become more amplified as more rc scripts have grown shutdown > functionality... > > I think if we make what's now reboot 'fastreboot' or 'reboot -q' (both of > which are historic replacements), we can make 'reboot' what's now 'shutdown > -r now'. I support this position. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Nov 16 18:32:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5697B1101651; Fri, 16 Nov 2018 18:32:51 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF9348A79D; Fri, 16 Nov 2018 18:32:49 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AAA720ED9; Fri, 16 Nov 2018 18:32:49 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGIWnDQ060282; Fri, 16 Nov 2018 18:32:49 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGIWn6K060281; Fri, 16 Nov 2018 18:32:49 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201811161832.wAGIWn6K060281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 16 Nov 2018 18:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340483 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 340483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF9348A79D X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 18:32:51 -0000 Author: jtl Date: Fri Nov 16 18:32:48 2018 New Revision: 340483 URL: https://svnweb.freebsd.org/changeset/base/340483 Log: Add some additional length checks to the IPv4 fragmentation code. Specifically, block 0-length fragments, even when the MF bit is clear. Also, ensure that every fragment with the MF bit clear ends at the same offset and that no subsequently-received fragments exceed that offset. Reviewed by: glebius, markj MFC after: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D17922 Modified: head/sys/netinet/ip_reass.c head/sys/netinet/ip_var.h Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Fri Nov 16 17:07:54 2018 (r340482) +++ head/sys/netinet/ip_reass.c Fri Nov 16 18:32:48 2018 (r340483) @@ -211,19 +211,21 @@ ip_reass(struct mbuf *m) * convert offset of this to bytes. */ ip->ip_len = htons(ntohs(ip->ip_len) - hlen); - if (ip->ip_off & htons(IP_MF)) { - /* - * Make sure that fragments have a data length - * that's a non-zero multiple of 8 bytes. - */ - if (ip->ip_len == htons(0) || (ntohs(ip->ip_len) & 0x7) != 0) { - IPSTAT_INC(ips_toosmall); /* XXX */ - IPSTAT_INC(ips_fragdropped); - m_freem(m); - return (NULL); - } + /* + * Make sure that fragments have a data length + * that's a non-zero multiple of 8 bytes, unless + * this is the last fragment. + */ + if (ip->ip_len == htons(0) || + ((ip->ip_off & htons(IP_MF)) && (ntohs(ip->ip_len) & 0x7) != 0)) { + IPSTAT_INC(ips_toosmall); /* XXX */ + IPSTAT_INC(ips_fragdropped); + m_freem(m); + return (NULL); + } + if (ip->ip_off & htons(IP_MF)) m->m_flags |= M_IP_FRAG; - } else + else m->m_flags &= ~M_IP_FRAG; ip->ip_off = htons(ntohs(ip->ip_off) << 3); @@ -301,9 +303,28 @@ ip_reass(struct mbuf *m) fp->ipq_src = ip->ip_src; fp->ipq_dst = ip->ip_dst; fp->ipq_frags = m; + if (m->m_flags & M_IP_FRAG) + fp->ipq_maxoff = -1; + else + fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len); m->m_nextpkt = NULL; goto done; } else { + /* + * If we already saw the last fragment, make sure + * this fragment's offset looks sane. Otherwise, if + * this is the last fragment, record its endpoint. + */ + if (fp->ipq_maxoff > 0) { + i = ntohs(ip->ip_off) + ntohs(ip->ip_len); + if (((m->m_flags & M_IP_FRAG) && i >= fp->ipq_maxoff) || + ((m->m_flags & M_IP_FRAG) == 0 && + i != fp->ipq_maxoff)) { + fp = NULL; + goto dropfrag; + } + } else if ((m->m_flags & M_IP_FRAG) == 0) + fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len); fp->ipq_nfrags++; atomic_add_int(&nfrags, 1); #ifdef MAC Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Fri Nov 16 17:07:54 2018 (r340482) +++ head/sys/netinet/ip_var.h Fri Nov 16 18:32:48 2018 (r340483) @@ -61,6 +61,7 @@ struct ipq { u_char ipq_ttl; /* time for reass q to live */ u_char ipq_p; /* protocol of this fragment */ u_short ipq_id; /* sequence id for reassembly */ + int ipq_maxoff; /* total length of packet */ struct mbuf *ipq_frags; /* to ip headers of fragments */ struct in_addr ipq_src,ipq_dst; u_char ipq_nfrags; /* # frags in this packet */ From owner-svn-src-head@freebsd.org Fri Nov 16 18:41:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C305811017B2; Fri, 16 Nov 2018 18:41:23 +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 11BB98AA8F; Fri, 16 Nov 2018 18:41:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id Nj3Hg5KZCjQc4Nj3JgBQRH; Fri, 16 Nov 2018 11:41:14 -0700 X-Authority-Analysis: v=2.3 cv=bOrH382Z c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=JHtHm7312UAA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=zz0iWlY3h4kUr2BHtDAA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 1EEC9A7C; Fri, 16 Nov 2018 10:41:11 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wAGIeqKc090911; Fri, 16 Nov 2018 10:40:52 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id wAGIeqdQ090908; Fri, 16 Nov 2018 10:40:52 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201811161840.wAGIeqdQ090908@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 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: rgrimes@freebsd.org cc: Warner Losh , 0mp@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340478 - head/share/man/man7 In-Reply-To: Message from "Rodney W. Grimes" of "Fri, 16 Nov 2018 10:04:04 -0800." <201811161804.wAGI44WC047387@pdx.rh.CN85.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 16 Nov 2018 10:40:52 -0800 X-CMAE-Envelope: MS4wfNxNGVLNL1PKCtOzJRsvNhCBGpzjlCnekdNsydOmfX1KYXd4eoqUp3wjp+VZS7oV2WcP7PdSVif9Rnm/hO153lqo4HLkyMxAgs+e2dpRVp/9kYOhtnkU Y1Ak9CQa8YayQGkvyC+XddxEK5lkG2yDfl+LcmrVVpXfRdMcFUSgI/Kz7jNVnS6DDPe26dsoLNlhpOvP/XToEoPqH/MEM5b8U39fI6152aMk6BzvtrInsVM3 IBm1jy/LvRHhv/VAm8/2sJ5xS1I80k7ZUe4CGvNTCxnwsaLisx0OVz1PoQociJ2fiUSavT0kigZWXZx++/AjPNcIPHafREa+OrtSZEWfENc= X-Rspamd-Queue-Id: 11BB98AA8F X-Spamd-Result: default: False [-3.58 / 40.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[9.134.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-0.95)[ipnet: 64.59.128.0/20(-2.58), asn: 6327(-2.06), country: CA(-0.10)]; FROM_EQ_ENVFROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 18:41:24 -0000 In message <201811161804.wAGI44WC047387@pdx.rh.CN85.dnsmgr.net>, "Rodney W. Gri mes" writes: > > On Fri, Nov 16, 2018 at 7:29 AM Mateusz Piotrowski <0mp@freebsd.org> wrote: > > > > > A few years ago jilles@ proposed changing reboot's default to signallin > g > > > init (preserving reboot -q which just invokes the reboot system call), > > > but > > > this was not accepted. Perhaps this can be tried again for 13.0. > > > > > > > I didn't like it at the time, however I was wrong. Much of my reasoning for > > doing it has become muted as well since then, and the need to do it has > > become more amplified as more rc scripts have grown shutdown > > functionality... > > > > I think if we make what's now reboot 'fastreboot' or 'reboot -q' (both of > > which are historic replacements), we can make 'reboot' what's now 'shutdown > > -r now'. > > I support this position. reboot(2) should be changed to signal init(8). RB_AUTOBOOT should signal init while a new RB_FASTBOOT or RB_LEGACY (or pick a name) would preserve traditional behavior. RB_POWEROFF, RB_POWERCYCLE and RB_HALT would also signal init except when RB_FASTBOOT flag is set. This aligns us better with what Linux is currently doing. IIRC Solaris still uses the legacy behavior however Solaris isn't relevant any more. Linux is pretty much the standard and we should endeavour to conform as much as we can. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Nov 16 19:00:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D317E1101CDD; Fri, 16 Nov 2018 18:59:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D7A98B297; Fri, 16 Nov 2018 18:59:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 272F32121F; Fri, 16 Nov 2018 18:59:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGIxw0E071038; Fri, 16 Nov 2018 18:59:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGIxwU1071035; Fri, 16 Nov 2018 18:59:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811161859.wAGIxwU1071035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 16 Nov 2018 18:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340484 - in head: . tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . tests/sys/netinet X-SVN-Commit-Revision: 340484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D7A98B297 X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 19:00:00 -0000 Author: markj Date: Fri Nov 16 18:59:58 2018 New Revision: 340484 URL: https://svnweb.freebsd.org/changeset/base/340484 Log: Rename the SO_REUSEPORT_LB test file to be consistent with other tests. MFC after: 1 week Added: head/tests/sys/netinet/so_reuseport_lb_test.c - copied unchanged from r340483, head/tests/sys/netinet/reuseport_lb.c Deleted: head/tests/sys/netinet/reuseport_lb.c Modified: head/ObsoleteFiles.inc head/tests/sys/netinet/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Nov 16 18:32:48 2018 (r340483) +++ head/ObsoleteFiles.inc Fri Nov 16 18:59:58 2018 (r340484) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20181116: Rename test file. +OLD_FILES+=usr/tests/sys/netinet/reuseport_lb # 20181112: Cleanup old libcap_dns. OLD_LIBS+=lib/casper/libcap_dns.so.1 OLD_LIBS+=usr/lib32/libcap_dns.so.1 Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Fri Nov 16 18:32:48 2018 (r340483) +++ head/tests/sys/netinet/Makefile Fri Nov 16 18:59:58 2018 (r340484) @@ -3,7 +3,7 @@ TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR} -ATF_TESTS_C= reuseport_lb +ATF_TESTS_C= so_reuseport_lb_test ATF_TESTS_SH= fibs_test Copied: head/tests/sys/netinet/so_reuseport_lb_test.c (from r340483, head/tests/sys/netinet/reuseport_lb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/so_reuseport_lb_test.c Fri Nov 16 18:59:58 2018 (r340484, copy of r340483, head/tests/sys/netinet/reuseport_lb.c) @@ -0,0 +1,242 @@ +/*- + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include +#include +#include +#include + +#include + +/* + * Given an array of non-blocking listening sockets configured in a LB group + * for "addr", try connecting to "addr" in a loop and verify that connections + * are roughly balanced across the sockets. + */ +static void +lb_simple_accept_loop(int domain, const struct sockaddr *addr, int sds[], + size_t nsds, int nconns) +{ + size_t i; + int *acceptcnt; + int csd, error, excnt, sd; + + /* + * We expect each listening socket to accept roughly nconns/nsds + * connections, but allow for some error. + */ + excnt = nconns / nsds / 8; + acceptcnt = calloc(nsds, sizeof(*acceptcnt)); + ATF_REQUIRE_MSG(acceptcnt != NULL, "calloc() failed: %s", + strerror(errno)); + + while (nconns-- > 0) { + sd = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(sd >= 0, "socket() failed: %s", + strerror(errno)); + + error = connect(sd, addr, addr->sa_len); + ATF_REQUIRE_MSG(error == 0, "connect() failed: %s", + strerror(errno)); + + /* + * Poll the listening sockets. + */ + do { + for (i = 0; i < nsds; i++) { + csd = accept(sds[i], NULL, NULL); + if (csd < 0) { + ATF_REQUIRE_MSG(errno == EWOULDBLOCK || + errno == EAGAIN, + "accept() failed: %s", + strerror(errno)); + continue; + } + + error = close(csd); + ATF_REQUIRE_MSG(error == 0, + "close() failed: %s", strerror(errno)); + + acceptcnt[i]++; + break; + } + } while (i == nsds); + + error = close(sd); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } + + for (i = 0; i < nsds; i++) + ATF_REQUIRE_MSG(acceptcnt[i] > excnt, "uneven balancing"); +} + +static int +lb_listen_socket(int domain, int flags) +{ + size_t one; + int error, sd; + + sd = socket(domain, SOCK_STREAM | flags, 0); + ATF_REQUIRE_MSG(sd >= 0, "socket() failed: %s", strerror(errno)); + + one = 1; + error = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT_LB, &one, sizeof(one)); + ATF_REQUIRE_MSG(error == 0, "setsockopt(SO_REUSEPORT_LB) failed: %s", + strerror(errno)); + + return (sd); +} + +ATF_TC_WITHOUT_HEAD(basic_ipv4); +ATF_TC_BODY(basic_ipv4, tc) +{ + struct sockaddr_in addr; + socklen_t slen; + size_t i; + const int nconns = 16384; + int error, sds[16]; + uint16_t port; + + sds[0] = lb_listen_socket(PF_INET, SOCK_NONBLOCK); + + memset(&addr, 0, sizeof(addr)); + addr.sin_len = sizeof(addr); + addr.sin_family = AF_INET; + addr.sin_port = htons(0); + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + error = bind(sds[0], (const struct sockaddr *)&addr, sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + error = listen(sds[0], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", strerror(errno)); + + slen = sizeof(addr); + error = getsockname(sds[0], (struct sockaddr *)&addr, &slen); + ATF_REQUIRE_MSG(error == 0, "getsockname() failed: %s", + strerror(errno)); + ATF_REQUIRE_MSG(slen == sizeof(addr), "sockaddr size changed"); + port = addr.sin_port; + + memset(&addr, 0, sizeof(addr)); + addr.sin_len = sizeof(addr); + addr.sin_family = AF_INET; + addr.sin_port = port; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + for (i = 1; i < nitems(sds); i++) { + sds[i] = lb_listen_socket(PF_INET, SOCK_NONBLOCK); + + error = bind(sds[i], (const struct sockaddr *)&addr, + sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", + strerror(errno)); + error = listen(sds[i], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", + strerror(errno)); + } + + lb_simple_accept_loop(PF_INET, (struct sockaddr *)&addr, sds, + nitems(sds), nconns); + for (i = 0; i < nitems(sds); i++) { + error = close(sds[i]); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } +} + +ATF_TC_WITHOUT_HEAD(basic_ipv6); +ATF_TC_BODY(basic_ipv6, tc) +{ + const struct in6_addr loopback6 = IN6ADDR_LOOPBACK_INIT; + struct sockaddr_in6 addr; + socklen_t slen; + size_t i; + const int nconns = 16384; + int error, sds[16]; + uint16_t port; + + sds[0] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); + + memset(&addr, 0, sizeof(addr)); + addr.sin6_len = sizeof(addr); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(0); + addr.sin6_addr = loopback6; + error = bind(sds[0], (const struct sockaddr *)&addr, sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + error = listen(sds[0], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", strerror(errno)); + + slen = sizeof(addr); + error = getsockname(sds[0], (struct sockaddr *)&addr, &slen); + ATF_REQUIRE_MSG(error == 0, "getsockname() failed: %s", + strerror(errno)); + ATF_REQUIRE_MSG(slen == sizeof(addr), "sockaddr size changed"); + port = addr.sin6_port; + + memset(&addr, 0, sizeof(addr)); + addr.sin6_len = sizeof(addr); + addr.sin6_family = AF_INET6; + addr.sin6_port = port; + addr.sin6_addr = loopback6; + for (i = 1; i < nitems(sds); i++) { + sds[i] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); + + error = bind(sds[i], (const struct sockaddr *)&addr, + sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", + strerror(errno)); + error = listen(sds[i], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", + strerror(errno)); + } + + lb_simple_accept_loop(PF_INET6, (struct sockaddr *)&addr, sds, + nitems(sds), nconns); + for (i = 0; i < nitems(sds); i++) { + error = close(sds[i]); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, basic_ipv4); + ATF_TP_ADD_TC(tp, basic_ipv6); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Fri Nov 16 19:04:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08A0B1101F34; Fri, 16 Nov 2018 19:04:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E6B58B6DD; Fri, 16 Nov 2018 19:04:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DFCB213B4; Fri, 16 Nov 2018 19:04:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGJ4DWe075740; Fri, 16 Nov 2018 19:04:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGJ4Dhm075739; Fri, 16 Nov 2018 19:04:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811161904.wAGJ4Dhm075739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 16 Nov 2018 19:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340485 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 340485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E6B58B6DD X-Spamd-Result: default: False [-106.88 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 19:04:14 -0000 Author: markj Date: Fri Nov 16 19:04:12 2018 New Revision: 340485 URL: https://svnweb.freebsd.org/changeset/base/340485 Log: Add regression tests for r340313 and r340483. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17926 Added: head/tests/sys/netinet/ip_reass_test.c (contents, props changed) Modified: head/tests/sys/netinet/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Fri Nov 16 18:59:58 2018 (r340484) +++ head/tests/sys/netinet/Makefile Fri Nov 16 19:04:12 2018 (r340485) @@ -3,7 +3,8 @@ TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR} -ATF_TESTS_C= so_reuseport_lb_test +ATF_TESTS_C= ip_reass_test \ + so_reuseport_lb_test ATF_TESTS_SH= fibs_test Added: head/tests/sys/netinet/ip_reass_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/ip_reass_test.c Fri Nov 16 19:04:12 2018 (r340485) @@ -0,0 +1,381 @@ +/*- + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct lopacket { + u_int family; + struct ip hdr; + char payload[]; +}; + +static void +update_cksum(struct ip *ip) +{ + size_t i; + uint32_t cksum; + uint16_t *cksump; + + ip->ip_sum = 0; + cksump = (uint16_t *)ip; + for (cksum = 0, i = 0; i < sizeof(*ip) / sizeof(*cksump); cksump++, i++) + cksum += ntohs(*cksump); + cksum = (cksum >> 16) + (cksum & 0xffff); + cksum = ~(cksum + (cksum >> 16)); + ip->ip_sum = htons((uint16_t)cksum); +} + +static struct lopacket * +alloc_lopacket(in_addr_t dstaddr, size_t payloadlen) +{ + struct ip *ip; + struct lopacket *packet; + size_t pktlen; + + pktlen = sizeof(*packet) + payloadlen; + packet = malloc(pktlen); + ATF_REQUIRE(packet != NULL); + + memset(packet, 0, pktlen); + packet->family = AF_INET; + + ip = &packet->hdr; + ip->ip_hl = sizeof(struct ip) >> 2; + ip->ip_v = 4; + ip->ip_tos = 0; + ip->ip_len = htons(sizeof(*ip) + payloadlen); + ip->ip_id = 0; + ip->ip_off = 0; + ip->ip_ttl = 1; + ip->ip_p = IPPROTO_IP; + ip->ip_sum = 0; + ip->ip_src.s_addr = dstaddr; + ip->ip_dst.s_addr = dstaddr; + update_cksum(ip); + + return (packet); +} + +static void +free_lopacket(struct lopacket *packet) +{ + + free(packet); +} + +static void +write_lopacket(int bpffd, struct lopacket *packet) +{ + struct timespec ts; + ssize_t n; + size_t len; + + len = sizeof(packet->family) + ntohs(packet->hdr.ip_len); + n = write(bpffd, packet, len); + ATF_REQUIRE_MSG(n >= 0, "packet write failed: %s", strerror(errno)); + ATF_REQUIRE_MSG((size_t)n == len, "wrote %zd bytes instead of %zu", + n, len); + + /* + * Loopback packets are dispatched asynchronously, give netisr some + * time. + */ + ts.tv_sec = 0; + ts.tv_nsec = 5000000; /* 5ms */ + (void)nanosleep(&ts, NULL); +} + +static int +open_lobpf(in_addr_t *addrp) +{ + struct ifreq ifr; + struct ifaddrs *ifa, *ifap; + int error, fd; + + fd = open("/dev/bpf0", O_RDWR); + if (fd < 0 && errno == ENOENT) + atf_tc_skip("no BPF device available"); + ATF_REQUIRE_MSG(fd >= 0, "open(/dev/bpf0): %s", strerror(errno)); + + error = getifaddrs(&ifap); + ATF_REQUIRE(error == 0); + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) + if ((ifa->ifa_flags & IFF_LOOPBACK) != 0 && + ifa->ifa_addr->sa_family == AF_INET) + break; + if (ifa == NULL) + atf_tc_skip("no loopback address found"); + + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); + error = ioctl(fd, BIOCSETIF, &ifr); + ATF_REQUIRE_MSG(error == 0, "ioctl(BIOCSETIF): %s", strerror(errno)); + + *addrp = ((struct sockaddr_in *)(void *)ifa->ifa_addr)->sin_addr.s_addr; + + freeifaddrs(ifap); + + return (fd); +} + +static void +get_ipstat(struct ipstat *stat) +{ + size_t len; + int error; + + memset(stat, 0, sizeof(*stat)); + len = sizeof(*stat); + error = sysctlbyname("net.inet.ip.stats", stat, &len, NULL, 0); + ATF_REQUIRE_MSG(error == 0, "sysctl(net.inet.ip.stats) failed: %s", + strerror(errno)); + ATF_REQUIRE(len == sizeof(*stat)); +} + +#define CHECK_IP_COUNTER(oldp, newp, counter) \ + ATF_REQUIRE_MSG((oldp)->ips_ ## counter < (newp)->ips_ ## counter, \ + "ips_" #counter " wasn't incremented (%ju vs. %ju)", \ + (uintmax_t)old.ips_ ## counter, (uintmax_t)new.ips_## counter); + +/* + * Make sure a fragment with MF set doesn't come after the last fragment of a + * packet. Make sure that multiple fragments with MF clear have the same offset + * and length. + */ +ATF_TC(ip_reass__multiple_last_fragments); +ATF_TC_HEAD(ip_reass__multiple_last_fragments, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__multiple_last_fragments, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2, *packet3, *packet4; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + packet1 = alloc_lopacket(addr, 16); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 16); + ip = &packet2->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x20); + update_cksum(ip); + + packet3 = alloc_lopacket(addr, 16); + ip = &packet3->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x8); + update_cksum(ip); + + packet4 = alloc_lopacket(addr, 32); + ip = &packet4->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + write_lopacket(fd, packet1); + + /* packet2 comes after packet1. */ + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet2 comes after packet1 and has MF set. */ + packet2->hdr.ip_off = htons(IP_MF | 0x20); + update_cksum(&packet2->hdr); + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet3 comes before packet1 but overlaps. */ + get_ipstat(&old); + write_lopacket(fd, packet3); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet4 has the same offset as packet1 but is longer. */ + get_ipstat(&old); + write_lopacket(fd, packet4); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +/* + * Make sure that we reject zero-length fragments. + */ +ATF_TC(ip_reass__zero_length_fragment); +ATF_TC_HEAD(ip_reass__zero_length_fragment, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__zero_length_fragment, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + /* + * Create two packets, one with MF set, one without. + */ + packet1 = alloc_lopacket(addr, 0); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(IP_MF | 0x10); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 0); + ip = &packet2->hdr; + ip->ip_id = ~ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + get_ipstat(&old); + write_lopacket(fd, packet1); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toosmall); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toosmall); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +ATF_TC(ip_reass__large_fragment); +ATF_TC_HEAD(ip_reass__large_fragment, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__large_fragment, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + /* + * Create two packets, one with MF set, one without. + * + * 16 + (0x1fff << 3) > IP_MAXPACKET, so these should fail the check. + */ + packet1 = alloc_lopacket(addr, 16); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(IP_MF | 0x1fff); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 16); + ip = &packet2->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x1fff); + update_cksum(ip); + + get_ipstat(&old); + write_lopacket(fd, packet1); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toolong); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toolong); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, ip_reass__multiple_last_fragments); + ATF_TP_ADD_TC(tp, ip_reass__zero_length_fragment); + ATF_TP_ADD_TC(tp, ip_reass__large_fragment); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Fri Nov 16 19:08:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FADB1102010; Fri, 16 Nov 2018 19:08:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC7008B8AA; Fri, 16 Nov 2018 19:08:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7A03213BC; Fri, 16 Nov 2018 19:08:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGJ8rRD075969; Fri, 16 Nov 2018 19:08:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGJ8r6c075964; Fri, 16 Nov 2018 19:08:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811161908.wAGJ8r6c075964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 16 Nov 2018 19:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340486 - in head/sys/dev/cxgbe: crypto tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/dev/cxgbe: crypto tom X-SVN-Commit-Revision: 340486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC7008B8AA X-Spamd-Result: default: False [-103.11 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 19:08:54 -0000 Author: jhb Date: Fri Nov 16 19:08:52 2018 New Revision: 340486 URL: https://svnweb.freebsd.org/changeset/base/340486 Log: Consolidate on a single set of constants for SCMD fields. Both ccr(4) and the TOE TLS code had separate sets of constants for fields in SCMD messages. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/dev/cxgbe/crypto/t4_crypto.h head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/cxgbe/tom/t4_tls.h Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Fri Nov 16 19:04:12 2018 (r340485) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Fri Nov 16 19:08:52 2018 (r340486) @@ -444,10 +444,10 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, if (s->mode == HMAC) { use_opad = 1; - hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; + hmac_ctrl = SCMD_HMAC_CTRL_NO_TRUNC; } else { use_opad = 0; - hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NOP; + hmac_ctrl = SCMD_HMAC_CTRL_NOP; } /* PADs must be 128-bit aligned. */ @@ -513,8 +513,8 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | - V_SCMD_CIPH_MODE(CHCR_SCMD_CIPHER_MODE_NOP) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_CIPH_MODE(SCMD_CIPH_MODE_NOP) | V_SCMD_AUTH_MODE(s->hmac.auth_mode) | V_SCMD_HMAC_CTRL(hmac_ctrl)); crwr->sec_cpl.ivgen_hdrlen = htobe32( @@ -682,11 +682,11 @@ ccr_blkcipher(struct ccr_softc *sc, struct ccr_session /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | V_SCMD_ENC_DEC_CTRL(op_type) | V_SCMD_CIPH_MODE(s->blkcipher.cipher_mode) | - V_SCMD_AUTH_MODE(CHCR_SCMD_AUTH_MODE_NOP) | - V_SCMD_HMAC_CTRL(CHCR_SCMD_HMAC_CTRL_NOP) | + V_SCMD_AUTH_MODE(SCMD_AUTH_MODE_NOP) | + V_SCMD_HMAC_CTRL(SCMD_HMAC_CTRL_NOP) | V_SCMD_IV_SIZE(s->blkcipher.iv_len / 2) | V_SCMD_NUM_IVS(0)); crwr->sec_cpl.ivgen_hdrlen = htobe32( @@ -760,12 +760,12 @@ ccr_hmac_ctrl(unsigned int hashsize, unsigned int auth { if (authsize == 10) - return (CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366); + return (SCMD_HMAC_CTRL_TRUNC_RFC4366); if (authsize == 12) - return (CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT); + return (SCMD_HMAC_CTRL_IPSEC_96BIT); if (authsize == hashsize / 2) - return (CHCR_SCMD_HMAC_CTRL_DIV2); - return (CHCR_SCMD_HMAC_CTRL_NO_TRUNC); + return (SCMD_HMAC_CTRL_DIV2); + return (SCMD_HMAC_CTRL_NO_TRUNC); } static int @@ -1018,7 +1018,7 @@ ccr_authenc(struct ccr_softc *sc, struct ccr_session * hmac_ctrl = ccr_hmac_ctrl(axf->hashsize, hash_size_in_response); crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | V_SCMD_ENC_DEC_CTRL(op_type) | V_SCMD_CIPH_AUTH_SEQ_CTRL(op_type == CHCR_ENCRYPT_OP ? 1 : 0) | V_SCMD_CIPH_MODE(s->blkcipher.cipher_mode) | @@ -1361,11 +1361,11 @@ ccr_gcm(struct ccr_softc *sc, struct ccr_session *s, s hmac_ctrl = ccr_hmac_ctrl(AES_GMAC_HASH_LEN, hash_size_in_response); crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | V_SCMD_ENC_DEC_CTRL(op_type) | V_SCMD_CIPH_AUTH_SEQ_CTRL(op_type == CHCR_ENCRYPT_OP ? 1 : 0) | - V_SCMD_CIPH_MODE(CHCR_SCMD_CIPHER_MODE_AES_GCM) | - V_SCMD_AUTH_MODE(CHCR_SCMD_AUTH_MODE_GHASH) | + V_SCMD_CIPH_MODE(SCMD_CIPH_MODE_AES_GCM) | + V_SCMD_AUTH_MODE(SCMD_AUTH_MODE_GHASH) | V_SCMD_HMAC_CTRL(hmac_ctrl) | V_SCMD_IV_SIZE(iv_len / 2) | V_SCMD_NUM_IVS(0)); @@ -1933,8 +1933,8 @@ ccr_newsession(device_t dev, crypto_session_t cses, st cipher = NULL; hash = NULL; auth_hash = NULL; - auth_mode = CHCR_SCMD_AUTH_MODE_NOP; - cipher_mode = CHCR_SCMD_CIPHER_MODE_NOP; + auth_mode = SCMD_AUTH_MODE_NOP; + cipher_mode = SCMD_CIPH_MODE_NOP; iv_len = 0; mk_size = 0; partial_digest_len = 0; @@ -1960,35 +1960,35 @@ ccr_newsession(device_t dev, crypto_session_t cses, st case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: auth_hash = &auth_hash_hmac_sha1; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA1; + auth_mode = SCMD_AUTH_MODE_SHA1; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_160; partial_digest_len = SHA1_HASH_LEN; break; case CRYPTO_SHA2_224: case CRYPTO_SHA2_224_HMAC: auth_hash = &auth_hash_hmac_sha2_224; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA224; + auth_mode = SCMD_AUTH_MODE_SHA224; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; partial_digest_len = SHA2_256_HASH_LEN; break; case CRYPTO_SHA2_256: case CRYPTO_SHA2_256_HMAC: auth_hash = &auth_hash_hmac_sha2_256; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA256; + auth_mode = SCMD_AUTH_MODE_SHA256; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; partial_digest_len = SHA2_256_HASH_LEN; break; case CRYPTO_SHA2_384: case CRYPTO_SHA2_384_HMAC: auth_hash = &auth_hash_hmac_sha2_384; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA512_384; + auth_mode = SCMD_AUTH_MODE_SHA512_384; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_512; partial_digest_len = SHA2_512_HASH_LEN; break; case CRYPTO_SHA2_512: case CRYPTO_SHA2_512_HMAC: auth_hash = &auth_hash_hmac_sha2_512; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA512_512; + auth_mode = SCMD_AUTH_MODE_SHA512_512; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_512; partial_digest_len = SHA2_512_HASH_LEN; break; @@ -1996,7 +1996,7 @@ ccr_newsession(device_t dev, crypto_session_t cses, st case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: gcm_hash = true; - auth_mode = CHCR_SCMD_AUTH_MODE_GHASH; + auth_mode = SCMD_AUTH_MODE_GHASH; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_128; break; } @@ -2019,19 +2019,19 @@ ccr_newsession(device_t dev, crypto_session_t cses, st cipher = c; switch (c->cri_alg) { case CRYPTO_AES_CBC: - cipher_mode = CHCR_SCMD_CIPHER_MODE_AES_CBC; + cipher_mode = SCMD_CIPH_MODE_AES_CBC; iv_len = AES_BLOCK_LEN; break; case CRYPTO_AES_ICM: - cipher_mode = CHCR_SCMD_CIPHER_MODE_AES_CTR; + cipher_mode = SCMD_CIPH_MODE_AES_CTR; iv_len = AES_BLOCK_LEN; break; case CRYPTO_AES_NIST_GCM_16: - cipher_mode = CHCR_SCMD_CIPHER_MODE_AES_GCM; + cipher_mode = SCMD_CIPH_MODE_AES_GCM; iv_len = AES_GCM_IV_LEN; break; case CRYPTO_AES_XTS: - cipher_mode = CHCR_SCMD_CIPHER_MODE_AES_XTS; + cipher_mode = SCMD_CIPH_MODE_AES_XTS; iv_len = AES_BLOCK_LEN; break; } @@ -2046,7 +2046,7 @@ ccr_newsession(device_t dev, crypto_session_t cses, st return (EINVAL); } } - if (gcm_hash != (cipher_mode == CHCR_SCMD_CIPHER_MODE_AES_GCM)) + if (gcm_hash != (cipher_mode == SCMD_CIPH_MODE_AES_GCM)) return (EINVAL); if (hash == NULL && cipher == NULL) return (EINVAL); Modified: head/sys/dev/cxgbe/crypto/t4_crypto.h ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.h Fri Nov 16 19:04:12 2018 (r340485) +++ head/sys/dev/cxgbe/crypto/t4_crypto.h Fri Nov 16 19:08:52 2018 (r340486) @@ -132,36 +132,41 @@ struct phys_sge_pairs { #define CHCR_ENCRYPT_OP 0 #define CHCR_DECRYPT_OP 1 -#define CHCR_SCMD_PROTO_VERSION_GENERIC 4 +#define SCMD_ENCDECCTRL_ENCRYPT 0 +#define SCMD_ENCDECCTRL_DECRYPT 1 -#define CHCR_SCMD_CIPHER_MODE_NOP 0 -#define CHCR_SCMD_CIPHER_MODE_AES_CBC 1 -#define CHCR_SCMD_CIPHER_MODE_AES_GCM 2 -#define CHCR_SCMD_CIPHER_MODE_AES_CTR 3 -#define CHCR_SCMD_CIPHER_MODE_GENERIC_AES 4 -#define CHCR_SCMD_CIPHER_MODE_AES_XTS 6 -#define CHCR_SCMD_CIPHER_MODE_AES_CCM 7 +#define SCMD_PROTO_VERSION_TLS_1_2 0 +#define SCMD_PROTO_VERSION_TLS_1_1 1 +#define SCMD_PROTO_VERSION_GENERIC 4 -#define CHCR_SCMD_AUTH_MODE_NOP 0 -#define CHCR_SCMD_AUTH_MODE_SHA1 1 -#define CHCR_SCMD_AUTH_MODE_SHA224 2 -#define CHCR_SCMD_AUTH_MODE_SHA256 3 -#define CHCR_SCMD_AUTH_MODE_GHASH 4 -#define CHCR_SCMD_AUTH_MODE_SHA512_224 5 -#define CHCR_SCMD_AUTH_MODE_SHA512_256 6 -#define CHCR_SCMD_AUTH_MODE_SHA512_384 7 -#define CHCR_SCMD_AUTH_MODE_SHA512_512 8 -#define CHCR_SCMD_AUTH_MODE_CBCMAC 9 -#define CHCR_SCMD_AUTH_MODE_CMAC 10 +#define SCMD_CIPH_MODE_NOP 0 +#define SCMD_CIPH_MODE_AES_CBC 1 +#define SCMD_CIPH_MODE_AES_GCM 2 +#define SCMD_CIPH_MODE_AES_CTR 3 +#define SCMD_CIPH_MODE_GENERIC_AES 4 +#define SCMD_CIPH_MODE_AES_XTS 6 +#define SCMD_CIPH_MODE_AES_CCM 7 -#define CHCR_SCMD_HMAC_CTRL_NOP 0 -#define CHCR_SCMD_HMAC_CTRL_NO_TRUNC 1 -#define CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366 2 -#define CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT 3 -#define CHCR_SCMD_HMAC_CTRL_PL1 4 -#define CHCR_SCMD_HMAC_CTRL_PL2 5 -#define CHCR_SCMD_HMAC_CTRL_PL3 6 -#define CHCR_SCMD_HMAC_CTRL_DIV2 7 +#define SCMD_AUTH_MODE_NOP 0 +#define SCMD_AUTH_MODE_SHA1 1 +#define SCMD_AUTH_MODE_SHA224 2 +#define SCMD_AUTH_MODE_SHA256 3 +#define SCMD_AUTH_MODE_GHASH 4 +#define SCMD_AUTH_MODE_SHA512_224 5 +#define SCMD_AUTH_MODE_SHA512_256 6 +#define SCMD_AUTH_MODE_SHA512_384 7 +#define SCMD_AUTH_MODE_SHA512_512 8 +#define SCMD_AUTH_MODE_CBCMAC 9 +#define SCMD_AUTH_MODE_CMAC 10 + +#define SCMD_HMAC_CTRL_NOP 0 +#define SCMD_HMAC_CTRL_NO_TRUNC 1 +#define SCMD_HMAC_CTRL_TRUNC_RFC4366 2 +#define SCMD_HMAC_CTRL_IPSEC_96BIT 3 +#define SCMD_HMAC_CTRL_PL1 4 +#define SCMD_HMAC_CTRL_PL2 5 +#define SCMD_HMAC_CTRL_PL3 6 +#define SCMD_HMAC_CTRL_DIV2 7 /* This are not really mac key size. They are intermediate values * of sha engine and its size Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Fri Nov 16 19:04:12 2018 (r340485) +++ head/sys/dev/cxgbe/tom/t4_tls.c Fri Nov 16 19:08:52 2018 (r340486) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #ifdef TCP_OFFLOAD #include "common/common.h" #include "common/t4_tcb.h" +#include "crypto/t4_crypto.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" Modified: head/sys/dev/cxgbe/tom/t4_tls.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.h Fri Nov 16 19:04:12 2018 (r340485) +++ head/sys/dev/cxgbe/tom/t4_tls.h Fri Nov 16 19:08:52 2018 (r340486) @@ -249,16 +249,6 @@ enum { CH_MK_SIZE_NOP, }; -#define SCMD_ENCDECCTRL_ENCRYPT 0 -#define SCMD_ENCDECCTRL_DECRYPT 1 - -#define SCMD_CIPH_MODE_NOP 0 -#define SCMD_CIPH_MODE_AES_CBC 1 -#define SCMD_CIPH_MODE_AES_GCM 2 -#define SCMD_CIPH_MODE_AES_CTR 3 -#define SCMD_CIPH_MODE_AES_GEN 4 -#define SCMD_CIPH_MODE_AES_CCM 7 - struct tls_scmd { __be32 seqno_numivs; __be32 ivgen_hdrlen; From owner-svn-src-head@freebsd.org Fri Nov 16 20:09:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E42A1103500; Fri, 16 Nov 2018 20:09:52 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B661C8D56F; Fri, 16 Nov 2018 20:09:51 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x42e.google.com with SMTP id u9-v6so26080286wrr.0; Fri, 16 Nov 2018 12:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CcZ5O5elEwJLGO6MNOWhXc9CvGl17p0vR9M+IAmzYoA=; b=cTQ8ZCjT+2B6x1KkfKV2ZTDOv9XIqqTav425CDYz2UThNHet+Dl3YMgvIqF+uJwZtb suhAtQfsFxK2MMfFN2G3ws174aV7mw0d7/OrFpLtwNS/9ks6q5TwFqN7jp4zMOgysrnW hXZYLOXg+o0+9hxkOzLruV9pl0E+Nnkj7NlrgD8Nt/8wVyLElGvoWf1m0KdLtR7OzLRE OJfQnoo47XSikLduSWsg8Zh/OlzqcAE4gSsJz6TZmbm/TPLZxvTBu1sV+TQi6rupk+PX cOFdcb3S4h8bPkBlGTxMiMjjtxty9FNM31pZfejg2vbeeIrhpTCt8eEV5uxHyYaRWYb8 EWAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; bh=CcZ5O5elEwJLGO6MNOWhXc9CvGl17p0vR9M+IAmzYoA=; b=l/Cl4ZJXKzLnIRC1vkpJg10/RQ/mm1F/mmg5kTAJ3biRykJRrACbEoB1T4HkE5fAR3 nqMjA9CuU1y0DWdMZGViTm/MT3gOL/fbPCd5pxw2ItP3hJyq2jqycYJaQsYWYRnS+apK GIOwSKBa+mq5PqGMhdSHSdIz46Yb9XcjQsUYrPNMxTbDewBGYIFsy7Pimv2ISwmf0N5F T6SHwHxSAaksUY/GuAP7E0RYd3zfrL0qHG0lG4Fn96hIKs7EZetA4sqq1gLmEZRT+MXR VD0kVuMoFB0iNsGbyBhseLHm6SxetRTFvJAma/T150zLDFLdMca2cYEcjfF8GIhoEH1A rC3w== X-Gm-Message-State: AGRZ1gKF9E6yaGgHv0+ws9jVv/FjvJqasbZas7fNtQ2WHYjB59IC7IKF 6qKjrk/gkKHHPaiLWGzvsxImmq44 X-Google-Smtp-Source: AJdET5faNHtqXv5e3HK0+88brBBIUJNM9iclouzjgHMgosISM5Q70CG7r0Xs18Y+33L+Bq6YRm/Fxw== X-Received: by 2002:adf:b253:: with SMTP id y19-v6mr10396802wra.213.1542398989685; Fri, 16 Nov 2018 12:09:49 -0800 (PST) Received: from [192.168.0.10] (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id y34sm5856770wrd.68.2018.11.16.12.09.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 12:09:48 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r340478 - head/share/man/man7 From: =?utf-8?Q?Edward_Tomasz_Napiera=C5=82a?= X-Mailer: iPhone Mail (16B92) In-Reply-To: <201811161840.wAGIeqdQ090908@slippy.cwsent.com> Date: Fri, 16 Nov 2018 20:09:44 +0000 Cc: rgrimes@freebsd.org, Warner Losh , 0mp@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201811161840.wAGIeqdQ090908@slippy.cwsent.com> To: Cy Schubert X-Rspamd-Queue-Id: B661C8D56F X-Spamd-Result: default: False [-3.35 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.88)[-0.880,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[e.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.76)[ipnet: 2a00:1450::/32(-1.91), asn: 15169(-1.82), country: US(-0.10)]; FORGED_SENDER(0.30)[trasz@FreeBSD.org,etnapierala@gmail.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@FreeBSD.org,etnapierala@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 20:09:52 -0000 > On 16 Nov 2018, at 18:40, Cy Schubert wrote: >=20 > In message <201811161804.wAGI44WC047387@pdx.rh.CN85.dnsmgr.net>,=20 > "Rodney W. Gri > mes" writes: >>>> On Fri, Nov 16, 2018 at 7:29 AM Mateusz Piotrowski <0mp@freebsd.org> wr= ote: >>>>=20 >>>> A few years ago jilles@ proposed changing reboot's default to signalli= n >> g >>>> init (preserving reboot -q which just invokes the reboot system call),= >>>> but >>>> this was not accepted. Perhaps this can be tried again for 13.0. >>>>=20 >>>=20 >>> I didn't like it at the time, however I was wrong. Much of my reasoning f= or >>> doing it has become muted as well since then, and the need to do it has >>> become more amplified as more rc scripts have grown shutdown >>> functionality... >>>=20 >>> I think if we make what's now reboot 'fastreboot' or 'reboot -q' (both o= f >>> which are historic replacements), we can make 'reboot' what's now 'shutd= own >>> -r now'. >>=20 >> I support this position. >=20 > reboot(2) should be changed to signal init(8). RB_AUTOBOOT should=20 > signal init while a new RB_FASTBOOT or RB_LEGACY (or pick a name) would=20= > preserve traditional behavior. RB_POWEROFF, RB_POWERCYCLE and RB_HALT=20 > would also signal init except when RB_FASTBOOT flag is set. Wouldn=E2=80=99t this break rebooting when UID 1 is not init(8)? From owner-svn-src-head@freebsd.org Fri Nov 16 21:27:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 402141104E94; Fri, 16 Nov 2018 21:27:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAEED8F9AD; Fri, 16 Nov 2018 21:27:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B4DB22AD8; Fri, 16 Nov 2018 21:27:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGLRCs7047771; Fri, 16 Nov 2018 21:27:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGLRBiZ047766; Fri, 16 Nov 2018 21:27:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811162127.wAGLRBiZ047766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Nov 2018 21:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340487 - in head/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Commit-Revision: 340487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BAEED8F9AD X-Spamd-Result: default: False [-106.87 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 21:27:13 -0000 Author: kib Date: Fri Nov 16 21:27:11 2018 New Revision: 340487 URL: https://svnweb.freebsd.org/changeset/base/340487 Log: Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068. SDM rev. 068 was released yesterday and it contains the description of the MSR 0x10a IA32_ARCH_CAP. This change adds symbolic definitions for all bits present in the document, and decode them in the CPU identification lines printed on boot. But also, the document defines SSB_NO as bit 4, while FreeBSD used but 2 to detect the need to work-around Speculative Store Bypass issue. Change code to use the bit from SDM. Similarly, the document describes bit 3 as an indicator that L1TF issue is not present, in particular, no L1D flush is needed on VMENTRY. We used RDCL_NO to avoid flushing, and again I changed the code to follow new spec from SDM. In fact my Apollo Lake machine with latest ucode shows this: IA32_ARCH_CAPS=0x19 Reviewed by: bwidawsk Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D18006 Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/x86/include/specialreg.h head/sys/x86/x86/cpu_machdep.c head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Nov 16 19:08:52 2018 (r340486) +++ head/sys/amd64/vmm/intel/vmx.c Fri Nov 16 21:27:11 2018 (r340487) @@ -814,7 +814,8 @@ vmx_init(int ipinum) return (error); } - guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; + guest_l1d_flush = (cpu_ia32_arch_caps & + IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY) == 0; TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); /* Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Fri Nov 16 19:08:52 2018 (r340486) +++ head/sys/x86/include/specialreg.h Fri Nov 16 21:27:11 2018 (r340487) @@ -434,7 +434,9 @@ /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 #define IA32_ARCH_CAP_IBRS_ALL 0x00000002 -#define IA32_ARCH_CAP_SSBD_NO 0x00000004 +#define IA32_ARCH_CAP_RSBA 0x00000004 +#define IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY 0x00000008 +#define IA32_ARCH_CAP_SSB_NO 0x00000010 /* * CPUID manufacturers identifiers Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Fri Nov 16 19:08:52 2018 (r340486) +++ head/sys/x86/x86/cpu_machdep.c Fri Nov 16 21:27:11 2018 (r340487) @@ -891,7 +891,7 @@ hw_ssb_recalculate(bool all_cpus) hw_ssb_set(true, all_cpus); break; case 2: /* auto */ - hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSBD_NO) != 0 ? + hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSB_NO) != 0 ? false : true, all_cpus); break; } Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Fri Nov 16 19:08:52 2018 (r340486) +++ head/sys/x86/x86/identcpu.c Fri Nov 16 21:27:11 2018 (r340487) @@ -1014,6 +1014,9 @@ printcpuinfo(void) "\020" "\001RDCL_NO" "\002IBRS_ALL" + "\003RSBA" + "\004SKIP_L1DFL_VME" + "\005SSB_NO" ); } From owner-svn-src-head@freebsd.org Fri Nov 16 21:28:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4D721104F4A; Fri, 16 Nov 2018 21:28:46 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gritton.org", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D1438FB3D; Fri, 16 Nov 2018 21:28:46 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) by gritton.org (8.15.2/8.15.2) with ESMTP id wAGLSdbL037314; Fri, 16 Nov 2018 14:28:39 -0700 (MST) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Date: Fri, 16 Nov 2018 14:28:39 -0700 From: James Gritton To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head , ross@ross-williams.net Subject: Re: svn commit: r333263 - in head: lib/libjail sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs sys/compat/linsysfs sys/fs/devfs sys/fs/fdescfs sys/fs/nullfs sys/fs/procfs sys/fs/pse... In-Reply-To: References: <201805042054.w44KsRtc038808@repo.freebsd.org> Message-ID: X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.3.6 X-Rspamd-Queue-Id: 2D1438FB3D X-Spamd-Result: default: False [-103.08 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; IP_SCORE(-0.02)[country: US(-0.10)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:30247, ipnet:199.192.164.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 21:28:47 -0000 On 2018-11-16 10:34, Alan Somers wrote: > On Fri, May 4, 2018 at 2:54 PM Jamie Gritton wrote: > >> Author: jamie >> Date: Fri May 4 20:54:27 2018 >> New Revision: 333263 >> URL: https://svnweb.freebsd.org/changeset/base/333263 >> >> Log: >> Make it easier for filesystems to count themselves as jail-enabled, >> by doing most of the work in a new function prison_add_vfs in kern_jail.c >> Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and >> the rest is taken care of. This includes adding a jail parameter like >> allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed. >> Both of these used to be a static list of known filesystems, with >> predefined permission bits. >> >> Reviewed by: kib >> Differential Revision: D14681 >> >> Modified: >> head/lib/libjail/jail.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >> head/sys/compat/linprocfs/linprocfs.c >> head/sys/compat/linsysfs/linsysfs.c >> head/sys/fs/devfs/devfs_vfsops.c >> head/sys/fs/fdescfs/fdesc_vfsops.c >> head/sys/fs/nullfs/null_vfsops.c >> head/sys/fs/procfs/procfs.c >> head/sys/fs/pseudofs/pseudofs.h >> head/sys/fs/tmpfs/tmpfs_vfsops.c >> head/sys/kern/kern_jail.c >> head/sys/kern/vfs_init.c >> head/sys/kern/vfs_mount.c >> head/sys/kern/vfs_subr.c >> head/sys/sys/jail.h >> head/sys/sys/mount.h >> head/usr.sbin/jail/jail.8 >> >> Modified: head/lib/libjail/jail.c >> ============================================================================== >> --- head/lib/libjail/jail.c Fri May 4 20:38:26 2018 (r333262) >> +++ head/lib/libjail/jail.c Fri May 4 20:54:27 2018 (r333263) >> @@ -1048,7 +1048,13 @@ kldload_param(const char *name) >> else if (strcmp(name, "sysvmsg") == 0 || strcmp(name, "sysvsem") == 0 || >> strcmp(name, "sysvshm") == 0) >> kl = kldload(name); >> - else { >> + else if (strncmp(name, "allow.mount.", 12) == 0) { >> + /* Load the matching filesystem */ >> + kl = kldload(name + 12); >> + if (kl < 0 && errno == ENOENT && >> + strncmp(name + 12, "no", 2) == 0) >> + kl = kldload(name + 14); >> + } else { >> errno = ENOENT; >> return (-1); >> } > > I'm curious about this part of the change. Why is it necessary to load the module in the "allow.mount.noXXXfs" case, when the jail is forbidden to mount the filesystem? It seems like that would just load modules that aren't going to be used. > > Additional discussion at https://github.com/iocage/iocage/issues/689 . > > -Alan Presumably such a parameter would be included in some jails in conjunction with the positive being included in others (perhaps as a default). The truth is I never really considered whether the "no" option would be used, I just always treat these option as pairs. It may be reasonable (at least in the allow.mount.* case) to silently disregard a "no" option that doesn't exist, but I don't know how many places would need to be modified for that to go smoothly. Though I don't expect that there would be too many people who bother to include a jail parameter about a filesystem which they're not planning to use. - Jamie From owner-svn-src-head@freebsd.org Fri Nov 16 22:38:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C101106A5A; Fri, 16 Nov 2018 22:38:50 +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 3A72A6C991; Fri, 16 Nov 2018 22:38:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id Nml9gh7s3ctraNmlBgsN2W; Fri, 16 Nov 2018 15:38:46 -0700 X-Authority-Analysis: v=2.3 cv=Io3Pj43g c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=8nJEP1OIZ-IA:10 a=JHtHm7312UAA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=iKhvJSA4AAAA:8 a=_bTUhD4FoDNiF-lAkjQA:9 a=wPNLvfGTeEIA:10 a=UJ0tAi3fqDAA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=odh9cflL3HIXMm4fY7Wr:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 22672CE0; Fri, 16 Nov 2018 14:38:43 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wAGMcJVd030584; Fri, 16 Nov 2018 14:38:19 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id wAGMcJ92030581; Fri, 16 Nov 2018 14:38:19 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201811162238.wAGMcJ92030581@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 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: =?utf-8?Q?Edward_Tomasz_Napiera=C5=82a?= cc: Cy Schubert , rgrimes@freebsd.org, Warner Losh , 0mp@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340478 - head/share/man/man7 In-Reply-To: Message from =?utf-8?Q?Edward_Tomasz_Napiera=C5=82a?= of "Fri, 16 Nov 2018 20:09:44 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Fri, 16 Nov 2018 14:38:19 -0800 X-CMAE-Envelope: MS4wfFjeQSoSKYVzjAQz0D55H0OiVcji4b6G4NIAPfuAEM+9INcg0poliFLVYfOSMlYctI1PDeXH0gq2GKqFrgIY9h26Z0jfnRC5TRWoKArFHd7GE5XmI02u /6BBXte5SX58HJaEHVSbKPYL76+bAAIALPN5L+MsvX/wsh9JHSeEoiT1FaFCpUwr1FKvOMek+o75awFc6Vnd7iKpNXYq1pMOUshkX8PRqXEETceKdxO2nmdR XKqzI7tG/zFDReMFCeI6Opj11VlHkC6EfLTEs73l0wjSH4LiIgQxiR/PfPyjX/ivBFu4bPl2Zg+gDZZ7vnDNOQWkGB7dOvtdsJELx1KWll4E48f4/PywZKD9 u+GLmtUo9gx478bjDxlKmK+EDyHPPQ== X-Rspamd-Queue-Id: 3A72A6C991 X-Spamd-Result: default: False [-4.82 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; RCPT_COUNT_SEVEN(0.00)[8]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-2.13)[ip: (-6.05), ipnet: 64.59.128.0/20(-2.51), asn: 6327(-2.01), country: CA(-0.10)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 22:38:51 -0000 In message , =?utf-8?Q?Edward _Tomasz_Napiera=C5=82a?= writes: > > > > On 16 Nov 2018, at 18:40, Cy Schubert wrote: > > > > In message <201811161804.wAGI44WC047387@pdx.rh.CN85.dnsmgr.net>, > > "Rodney W. Gri > > mes" writes: > >>>> On Fri, Nov 16, 2018 at 7:29 AM Mateusz Piotrowski <0mp@freebsd.org> wro > te: > >>>> > >>>> A few years ago jilles@ proposed changing reboot's default to signallin > >> g > >>>> init (preserving reboot -q which just invokes the reboot system call), > >>>> but > >>>> this was not accepted. Perhaps this can be tried again for 13.0. > >>>> > >>> > >>> I didn't like it at the time, however I was wrong. Much of my reasoning f > or > >>> doing it has become muted as well since then, and the need to do it has > >>> become more amplified as more rc scripts have grown shutdown > >>> functionality... > >>> > >>> I think if we make what's now reboot 'fastreboot' or 'reboot -q' (both of > >>> which are historic replacements), we can make 'reboot' what's now 'shutdo > wn > >>> -r now'. > >> > >> I support this position. > > > > reboot(2) should be changed to signal init(8). RB_AUTOBOOT should > > signal init while a new RB_FASTBOOT or RB_LEGACY (or pick a name) would > > preserve traditional behavior. RB_POWEROFF, RB_POWERCYCLE and RB_HALT > > would also signal init except when RB_FASTBOOT flag is set. > > Wouldn’t this break rebooting when UID 1 is not init(8)? You mean PID 1, right? This would obviously require special case handling when the caller is PID 1. Tangentially, though Linux vaguely documents RB_*, they document LINUX_REBOOT_* in their man page, which obviously doesn't work here. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Nov 16 22:52:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA1B01107068; Fri, 16 Nov 2018 22:52:14 +0000 (UTC) (envelope-from jbeich@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)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFA286D36F; Fri, 16 Nov 2018 22:52:13 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id B1541200F; Fri, 16 Nov 2018 22:52:13 +0000 (UTC) From: Jan Beich To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338990 - in head/sys: compat/freebsd32 dev/pci References: <201809272108.w8RL8Xqn052122@repo.freebsd.org> Date: Fri, 16 Nov 2018 23:52:09 +0100 Message-ID: <7ehc-y6sm-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: DFA286D36F X-Spamd-Result: default: False [-106.81 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; R_SPF_SOFTFAIL(0.00)[~all]; IP_SCORE(-3.70)[ip: (-9.66), ipnet: 96.47.64.0/20(-4.83), asn: 11403(-3.91), country: US(-0.10)]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 22:52:14 -0000 Brooks Davis writes: > Author: brooks > Date: Thu Sep 27 21:08:32 2018 > New Revision: 338990 > URL: https://svnweb.freebsd.org/changeset/base/338990 > > Log: > Centralize compat support for PCIOCGETCONF. > > The pre-7.x compat for both native and 32-bit code was already in > pci_user.c. Use this infrastructure to add implement 32-bit support. > This is more correct as ioctl(2) commands only have meaning in the > context of a file descriptor. > > Reviewed by: kib > Approved by: re (gjb) > Obtained from: CheriBSD > Sponsored by: DARPA, AFRL > Differential revision: https://reviews.freebsd.org/D17324 After this commit getdevice() from pciconf(8) and pci_find_conf() in tools/tools/dmardump/dmardump.c always fail in EPERM in -m32 mode. Found via graphics/libdrm where PCIOCGETCONF is used to get a list of DRM devices for use by OpenGL/Vulkan/VAAPI userland drivers. Can you fix the regression before 12.0R or back the commit out? https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html From owner-svn-src-head@freebsd.org Fri Nov 16 23:09:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EADC11073F1; Fri, 16 Nov 2018 23:09:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 445BD6D9DC; Fri, 16 Nov 2018 23:09:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wAGN91Cv003234 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Nov 2018 01:09:04 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wAGN91Cv003234 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wAGN91RW003233; Sat, 17 Nov 2018 01:09:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 17 Nov 2018 01:09:01 +0200 From: Konstantin Belousov To: Jan Beich Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338990 - in head/sys: compat/freebsd32 dev/pci Message-ID: <20181116230901.GR2378@kib.kiev.ua> References: <201809272108.w8RL8Xqn052122@repo.freebsd.org> <7ehc-y6sm-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7ehc-y6sm-wny@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 445BD6D9DC X-Spamd-Result: default: False [-2.19 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.18)[ip: (-2.64), ipnet: 2001:470::/32(-4.56), asn: 6939(-3.59), country: US(-0.10)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 23:09:17 -0000 On Fri, Nov 16, 2018 at 11:52:09PM +0100, Jan Beich wrote: > Brooks Davis writes: > > > Author: brooks > > Date: Thu Sep 27 21:08:32 2018 > > New Revision: 338990 > > URL: https://svnweb.freebsd.org/changeset/base/338990 > > > > Log: > > Centralize compat support for PCIOCGETCONF. > > > > The pre-7.x compat for both native and 32-bit code was already in > > pci_user.c. Use this infrastructure to add implement 32-bit support. > > This is more correct as ioctl(2) commands only have meaning in the > > context of a file descriptor. > > > > Reviewed by: kib > > Approved by: re (gjb) > > Obtained from: CheriBSD > > Sponsored by: DARPA, AFRL > > Differential revision: https://reviews.freebsd.org/D17324 > > After this commit getdevice() from pciconf(8) and pci_find_conf() in > tools/tools/dmardump/dmardump.c always fail in EPERM in -m32 mode. > Found via graphics/libdrm where PCIOCGETCONF is used to get a list of > DRM devices for use by OpenGL/Vulkan/VAAPI userland drivers. > > Can you fix the regression before 12.0R or back the commit out? > > https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html Try this. diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c index 380beff0d31..b6a53dd0982 100644 --- a/sys/dev/pci/pci_user.c +++ b/sys/dev/pci/pci_user.c @@ -945,6 +945,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t if (!(flag & FWRITE)) { switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 @@ -962,6 +965,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 From owner-svn-src-head@freebsd.org Fri Nov 16 23:10:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A78781107487; Fri, 16 Nov 2018 23:10:49 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A647E6DB81; Fri, 16 Nov 2018 23:10:48 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 1D0723C475F; Fri, 16 Nov 2018 23:10:47 +0000 (UTC) Date: Fri, 16 Nov 2018 23:10:47 +0000 From: Brooks Davis To: Jan Beich Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338990 - in head/sys: compat/freebsd32 dev/pci Message-ID: <20181116231047.GA94365@spindle.one-eyed-alien.net> References: <201809272108.w8RL8Xqn052122@repo.freebsd.org> <7ehc-y6sm-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline In-Reply-To: <7ehc-y6sm-wny@FreeBSD.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: A647E6DB81 X-Spamd-Result: default: False [-4.53 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-3.62)[ip: (-9.40), ipnet: 199.48.128.0/22(-4.70), asn: 36236(-3.92), country: US(-0.10)]; MX_GOOD(-0.01)[cached: spindle.one-eyed-alien.net]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 23:10:50 -0000 --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 16, 2018 at 11:52:09PM +0100, Jan Beich wrote: > Brooks Davis writes: >=20 > > Author: brooks > > Date: Thu Sep 27 21:08:32 2018 > > New Revision: 338990 > > URL: https://svnweb.freebsd.org/changeset/base/338990 > > > > Log: > > Centralize compat support for PCIOCGETCONF. > > =20 > > The pre-7.x compat for both native and 32-bit code was already in > > pci_user.c. Use this infrastructure to add implement 32-bit support. > > This is more correct as ioctl(2) commands only have meaning in the > > context of a file descriptor. > > =20 > > Reviewed by: kib > > Approved by: re (gjb) > > Obtained from: CheriBSD > > Sponsored by: DARPA, AFRL > > Differential revision: https://reviews.freebsd.org/D17324 >=20 > After this commit getdevice() from pciconf(8) and pci_find_conf() in > tools/tools/dmardump/dmardump.c always fail in EPERM in -m32 mode. > Found via graphics/libdrm where PCIOCGETCONF is used to get a list of > DRM devices for use by OpenGL/Vulkan/VAAPI userland drivers. >=20 > Can you fix the regression before 12.0R or back the commit out? >=20 > https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.= html Eeek, looks like I missed a case statment in a switch that I somehow didn't hit in testing. I'm building a potential fix now. -- Brooks --CE+1k2dSO48ffgeK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJb7052AAoJEKzQXbSebgfA0MgH/3C9SUppFZABfuIFrj09Ez6K D+C5RqEpnaD3HordXoGCkS/drfyacO1S0KOBkDqikXmQfOalOlBUti1kDmf03puy G8GMfZL+LEOYxcX/rTlD47lmECt+iB6NTkXXixFKduixjj6bVBTU8ABcrq2iYHzf 115uieGyRAZtAcRA8gq4+6/cWephH+H40hPK9um6i3cR8CLRehPe318DMlHecrXL ZVdxkSwXc3S7nB/0Jy/s0w5C2OR33i8LFmb/nRn6MRRptcWLkfhd4SDTUUpknvpr ip/sSY3CK5vL99UDhMg9ap2510h6Ls8nxPf6x3Co6MKZ9iM7VuIYiALoDv3+Ebg= =yY6t -----END PGP SIGNATURE----- --CE+1k2dSO48ffgeK-- From owner-svn-src-head@freebsd.org Fri Nov 16 23:30:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C0741107AFF; Fri, 16 Nov 2018 23:30:24 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FADB6E47A; Fri, 16 Nov 2018 23:30:23 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f178.google.com with SMTP id u6-v6so21757065ljd.1; Fri, 16 Nov 2018 15:30: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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3UeV2CTVPlC2ZPOU+gPRRQWYK93FCzwnnefMpz0FBAA=; b=Ab0JZZnJt3/y5l0fY2YpjNA5m1KFE5+FcghwyPDqRQo/ZJRrLWJQz9btdxwaOdStGi /AyMd2U9DPuLgtVZwc5339RzRq5JWl+YnZy83HAEjI6RFmu2arhbN2o36VFHfLe2GiTh o1nREJhLVIPHktFCR03u08ccdffyDOGU2M1dms1k+NvWF2ZA+Yz+8Cvg8bqsicEWW7+w t1Q6hmlgD3TyCortWV9AQcu4uxHXV/Qr3TEmVEJW3wIa23jhaIb0Njh5Vtgcp0HLLRwS OjPP/gtYkxR3yLZY0MTXuyN6j1Y4kveP1SOA/rAX53SgiKkJQtmFvZ7KbaIA7o2I0Yyd c1iA== X-Gm-Message-State: AGRZ1gLNtipVGPT2Xr+hxHtqDfFaAOO0qWk1sQZrCrAzhoAvjHD8BDI/ c+CmCOXuU3JYaYdzUmFrdT1GMLCHx5wpUdpBpbh6eA== X-Google-Smtp-Source: AJdET5cr6gI5F71qJ9KDj6NCvS1SVSbnNls2nZh4bWAE0DIcJMxjiDGCPOw6eApgXRctl62YWXuQTsES2sgvfoH1Lt0= X-Received: by 2002:a2e:45d:: with SMTP id 90-v6mr7164121lje.110.1542411015753; Fri, 16 Nov 2018 15:30:15 -0800 (PST) MIME-Version: 1.0 References: <201805042054.w44KsRtc038808@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Fri, 16 Nov 2018 16:30:03 -0700 Message-ID: Subject: Re: svn commit: r333263 - in head: lib/libjail sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs sys/compat/linsysfs sys/fs/devfs sys/fs/fdescfs sys/fs/nullfs sys/fs/procfs sys/fs/pse... To: jamie@freebsd.org Cc: src-committers , svn-src-all , svn-src-head , Ross Williams X-Rspamd-Queue-Id: 2FADB6E47A X-Spamd-Result: default: False [-1.05 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[178.208.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.04)[ipnet: 209.85.128.0/17(-3.31), asn: 15169(-1.82), country: US(-0.10)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 23:30:24 -0000 On Fri, Nov 16, 2018 at 2:28 PM James Gritton wrote: > On 2018-11-16 10:34, Alan Somers wrote: > > On Fri, May 4, 2018 at 2:54 PM Jamie Gritton wrote: > >> Author: jamie >> Date: Fri May 4 20:54:27 2018 >> New Revision: 333263 >> URL: https://svnweb.freebsd.org/changeset/base/333263 >> >> Log: >> Make it easier for filesystems to count themselves as jail-enabled, >> by doing most of the work in a new function prison_add_vfs in >> kern_jail.c >> Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and >> the rest is taken care of. This includes adding a jail parameter like >> allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed. >> Both of these used to be a static list of known filesystems, with >> predefined permission bits. >> >> Reviewed by: kib >> Differential Revision: D14681 >> >> Modified: >> head/lib/libjail/jail.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >> head/sys/compat/linprocfs/linprocfs.c >> head/sys/compat/linsysfs/linsysfs.c >> head/sys/fs/devfs/devfs_vfsops.c >> head/sys/fs/fdescfs/fdesc_vfsops.c >> head/sys/fs/nullfs/null_vfsops.c >> head/sys/fs/procfs/procfs.c >> head/sys/fs/pseudofs/pseudofs.h >> head/sys/fs/tmpfs/tmpfs_vfsops.c >> head/sys/kern/kern_jail.c >> head/sys/kern/vfs_init.c >> head/sys/kern/vfs_mount.c >> head/sys/kern/vfs_subr.c >> head/sys/sys/jail.h >> head/sys/sys/mount.h >> head/usr.sbin/jail/jail.8 >> >> Modified: head/lib/libjail/jail.c >> >> ============================================================================== >> --- head/lib/libjail/jail.c Fri May 4 20:38:26 2018 (r333262) >> +++ head/lib/libjail/jail.c Fri May 4 20:54:27 2018 (r333263) >> @@ -1048,7 +1048,13 @@ kldload_param(const char *name) >> else if (strcmp(name, "sysvmsg") == 0 || strcmp(name, "sysvsem") >> == 0 || >> strcmp(name, "sysvshm") == 0) >> kl = kldload(name); >> - else { >> + else if (strncmp(name, "allow.mount.", 12) == 0) { >> + /* Load the matching filesystem */ >> + kl = kldload(name + 12); >> + if (kl < 0 && errno == ENOENT && >> + strncmp(name + 12, "no", 2) == 0) >> + kl = kldload(name + 14); >> + } else { >> errno = ENOENT; >> return (-1); >> } >> > > I'm curious about this part of the change. Why is it necessary to load > the module in the "allow.mount.noXXXfs" case, when the jail is forbidden to > mount the filesystem? It seems like that would just load modules that > aren't going to be used. > > Additional discussion at https://github.com/iocage/iocage/issues/689 . > > -Alan > > > Presumably such a parameter would be included in some jails in conjunction > with the positive being included in others (perhaps as a default). The > truth is I never really considered whether the "no" option would be used, I > just always treat these option as pairs. > > It may be reasonable (at least in the allow.mount.* case) to silently > disregard a "no" option that doesn't exist, but I don't know how many > places would need to be modified for that to go smoothly. Though I don't > expect that there would be too many people who bother to include a jail > parameter about a filesystem which they're not planning to use. > > - Jamie > Well, many people use the "no" option because one of the most popular jail managers, iocage, uses it under the hood. But since "no" is the default, its presence on the command line is a noop. Are there any situations in which the "no" option has an effect? The only two possibilities I could think of were: 1) Somebody puts both the positive and negative options on the same command line. From experiment, it seems like the last option takes effect. In this case, the presence of the positive option would cause the kld to be loaded, regardless of the presence of the negative option. 2) When using hierarchical jails, it might make sense to use the positive option for the outer jail and the negative option for the inner jail. But this would only be important if the inner jail inherited the outer jail's parameters, which doesn't seem to be the case. So I can't think of any reason to continue to mount the kld for "no" options. Can you? From owner-svn-src-head@freebsd.org Fri Nov 16 23:39:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 694F21107DFE; Fri, 16 Nov 2018 23:39:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1091B6E987; Fri, 16 Nov 2018 23:39:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5C7A2404A; Fri, 16 Nov 2018 23:39:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGNdeIB014096; Fri, 16 Nov 2018 23:39:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGNdeVE014093; Fri, 16 Nov 2018 23:39:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811162339.wAGNdeVE014093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 16 Nov 2018 23:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340488 - in head/sys/x86: include x86 xen X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/x86: include x86 xen X-SVN-Commit-Revision: 340488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1091B6E987 X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 23:39:41 -0000 Author: jhb Date: Fri Nov 16 23:39:39 2018 New Revision: 340488 URL: https://svnweb.freebsd.org/changeset/base/340488 Log: Axe MINIMUM_MSI_INT. Just allow MSI interrupts to always start at the end of the I/O APIC pins. Since existing machines already have more than 255 I/O APIC pins, IRQ 255 is no longer reliably invalid, so just remove the minimum starting value for MSI. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D17991 Modified: head/sys/x86/include/intr_machdep.h head/sys/x86/x86/msi.c head/sys/x86/xen/pvcpu_enum.c head/sys/x86/xen/xen_msi.c Modified: head/sys/x86/include/intr_machdep.h ============================================================================== --- head/sys/x86/include/intr_machdep.h Fri Nov 16 21:27:11 2018 (r340487) +++ head/sys/x86/include/intr_machdep.h Fri Nov 16 23:39:39 2018 (r340488) @@ -51,15 +51,11 @@ * IRQ values returned by ACPI methods such as _CRS can be used * directly by the ACPI bus driver. * - * MSI interrupts allocate a block of interrupts starting at either - * the end of the I/O APIC range or 256, whichever is higher. When - * running under the Xen Hypervisor, an additional range of IRQ values - * are available for binding to event channel events. We use 256 as - * the minimum IRQ value for MSI interrupts to attempt to leave 255 - * unused since 255 is used in PCI to indicate an invalid INTx IRQ. + * MSI interrupts allocate a block of interrupts starting at the end + * of the I/O APIC range. When running under the Xen Hypervisor, an + * additional range of IRQ values are available for binding to event + * channel events. */ -#define MINIMUM_MSI_INT 256 - extern u_int first_msi_irq; extern u_int num_io_irqs; extern u_int num_msi_irqs; Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Fri Nov 16 21:27:11 2018 (r340487) +++ head/sys/x86/x86/msi.c Fri Nov 16 23:39:39 2018 (r340488) @@ -153,6 +153,8 @@ struct pic msi_pic = { }; u_int first_msi_irq; +SYSCTL_UINT(_machdep, OID_AUTO, first_msi_irq, CTLFLAG_RD, &first_msi_irq, 0, + "Number of first IRQ reserved for MSI and MSI-X interrupts"); u_int num_msi_irqs = 512; SYSCTL_UINT(_machdep, OID_AUTO, num_msi_irqs, CTLFLAG_RDTUN, &num_msi_irqs, 0, @@ -339,7 +341,7 @@ msi_init(void) if (num_msi_irqs == 0) return; - first_msi_irq = max(MINIMUM_MSI_INT, num_io_irqs); + first_msi_irq = num_io_irqs; if (num_msi_irqs > UINT_MAX - first_msi_irq) panic("num_msi_irq too high"); num_io_irqs = first_msi_irq + num_msi_irqs; Modified: head/sys/x86/xen/pvcpu_enum.c ============================================================================== --- head/sys/x86/xen/pvcpu_enum.c Fri Nov 16 21:27:11 2018 (r340487) +++ head/sys/x86/xen/pvcpu_enum.c Fri Nov 16 23:39:39 2018 (r340488) @@ -199,7 +199,7 @@ xenpv_setup_io(void) * this is legacy code so just keep using the previous * behaviour and assume a maximum of 256 interrupts. */ - num_io_irqs = max(MINIMUM_MSI_INT - 1, num_io_irqs); + num_io_irqs = max(255, num_io_irqs); acpi_SetDefaultIntrModel(ACPI_INTR_APIC); } Modified: head/sys/x86/xen/xen_msi.c ============================================================================== --- head/sys/x86/xen/xen_msi.c Fri Nov 16 21:27:11 2018 (r340487) +++ head/sys/x86/xen/xen_msi.c Fri Nov 16 23:39:39 2018 (r340488) @@ -57,7 +57,7 @@ xen_msi_init(void) { MPASS(num_io_irqs > 0); - first_msi_irq = min(MINIMUM_MSI_INT, num_io_irqs); + first_msi_irq = num_io_irqs; if (num_msi_irqs > UINT_MAX - first_msi_irq) panic("num_msi_irq too high"); num_io_irqs = first_msi_irq + num_msi_irqs; From owner-svn-src-head@freebsd.org Fri Nov 16 23:58:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22885110858A; Fri, 16 Nov 2018 23:58:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9A296F8B2; Fri, 16 Nov 2018 23:58:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9509E2438C; Fri, 16 Nov 2018 23:58:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAGNwpNN024407; Fri, 16 Nov 2018 23:58:51 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAGNwphJ024406; Fri, 16 Nov 2018 23:58:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811162358.wAGNwphJ024406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 16 Nov 2018 23:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340489 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9A296F8B2 X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 23:58:52 -0000 Author: brooks Date: Fri Nov 16 23:58:51 2018 New Revision: 340489 URL: https://svnweb.freebsd.org/changeset/base/340489 Log: Fix freebsd32 support for PCIOCGETCONF. This fixes regresssions in pciconf -l and some ports as reported on freebsd-current: https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html Reported by: jbeich Reviewed by: kib (also proposed an idential patch) Tested by: jbeich MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18011 Modified: head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Fri Nov 16 23:39:39 2018 (r340488) +++ head/sys/dev/pci/pci_user.c Fri Nov 16 23:58:51 2018 (r340489) @@ -945,6 +945,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, if (!(flag & FWRITE)) { switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 @@ -962,6 +965,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 From owner-svn-src-head@freebsd.org Sat Nov 17 00:03:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDD111108AC6; Sat, 17 Nov 2018 00:03:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84EAF6FE19; Sat, 17 Nov 2018 00:03:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61E112452A; Sat, 17 Nov 2018 00:03:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAH035Ba029330; Sat, 17 Nov 2018 00:03:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAH0356Q029329; Sat, 17 Nov 2018 00:03:05 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811170003.wAH0356Q029329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 17 Nov 2018 00:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340490 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84EAF6FE19 X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 00:03:06 -0000 Author: brooks Date: Sat Nov 17 00:03:04 2018 New Revision: 340490 URL: https://svnweb.freebsd.org/changeset/base/340490 Log: Fix stray tab. Reported by: jbeich MFC after: 3 days MFC with: r340489 Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18011 Modified: head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Fri Nov 16 23:58:51 2018 (r340489) +++ head/sys/dev/pci/pci_user.c Sat Nov 17 00:03:04 2018 (r340490) @@ -966,7 +966,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, switch (cmd) { case PCIOCGETCONF: #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF32: + case PCIOCGETCONF32: #endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: From owner-svn-src-head@freebsd.org Sat Nov 17 00:07:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B051108BC7; Sat, 17 Nov 2018 00:07:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B138C6FFDB; Sat, 17 Nov 2018 00:07:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5429C10B476; Fri, 16 Nov 2018 19:06:55 -0500 (EST) Subject: Re: svn commit: r340488 - in head/sys/x86: include x86 xen From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811162339.wAGNdeVE014093@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 16 Nov 2018 16:06:54 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201811162339.wAGNdeVE014093@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 16 Nov 2018 19:06:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: B138C6FFDB X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 00:07:02 -0000 On 11/16/18 3:39 PM, John Baldwin wrote: > Author: jhb > Date: Fri Nov 16 23:39:39 2018 > New Revision: 340488 > URL: https://svnweb.freebsd.org/changeset/base/340488 > > Log: > Axe MINIMUM_MSI_INT. > > Just allow MSI interrupts to always start at the end of the I/O APIC > pins. Since existing machines already have more than 255 I/O APIC > pins, IRQ 255 is no longer reliably invalid, so just remove the > minimum starting value for MSI. > > Reviewed by: kib, markj > Differential Revision: https://reviews.freebsd.org/D17991 Note that this will renumber IRQ values. If you are used to seeing IRQ values > 256 as meaning MSI, that will no longer be true. If you must know which interrupts are MSI you can check the machdep.first_msi_irq sysctl. I've also considered renaming them to 'msi' instead of 'irq' in vmstat -i output. We still have to have a number for cpuset -x to work, otherwise we could name MSI interrupts after the device perhaps. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Sat Nov 17 02:15:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16E5E110DC5E; Sat, 17 Nov 2018 02:15:53 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gritton.org", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5466974E79; Sat, 17 Nov 2018 02:15:52 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) by gritton.org (8.15.2/8.15.2) with ESMTP id wAH2Fn26044925; Fri, 16 Nov 2018 19:15:50 -0700 (MST) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Date: Fri, 16 Nov 2018 19:15:49 -0700 From: James Gritton To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head , Ross Williams Subject: Re: svn commit: r333263 - in head: lib/libjail sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs sys/compat/linsysfs sys/fs/devfs sys/fs/fdescfs sys/fs/nullfs sys/fs/procfs sys/fs/pse... In-Reply-To: References: <201805042054.w44KsRtc038808@repo.freebsd.org> Message-ID: X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.3.6 X-Rspamd-Queue-Id: 5466974E79 X-Spamd-Result: default: False [0.67 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.67)[0.673,0]; ASN(0.00)[asn:30247, ipnet:199.192.164.0/22, country:US] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 02:15:53 -0000 On 2018-11-16 16:30, Alan Somers wrote: > On Fri, Nov 16, 2018 at 2:28 PM James Gritton wrote: > > On 2018-11-16 10:34, Alan Somers wrote: > > On Fri, May 4, 2018 at 2:54 PM Jamie Gritton wrote: > Author: jamie > Date: Fri May 4 20:54:27 2018 > New Revision: 333263 > URL: https://svnweb.freebsd.org/changeset/base/333263 > > Log: > Make it easier for filesystems to count themselves as jail-enabled, > by doing most of the work in a new function prison_add_vfs in kern_jail.c > Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and > the rest is taken care of. This includes adding a jail parameter like > allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed. > Both of these used to be a static list of known filesystems, with > predefined permission bits. > > Reviewed by: kib > Differential Revision: D14681 > > Modified: > head/lib/libjail/jail.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > head/sys/compat/linprocfs/linprocfs.c > head/sys/compat/linsysfs/linsysfs.c > head/sys/fs/devfs/devfs_vfsops.c > head/sys/fs/fdescfs/fdesc_vfsops.c > head/sys/fs/nullfs/null_vfsops.c > head/sys/fs/procfs/procfs.c > head/sys/fs/pseudofs/pseudofs.h > head/sys/fs/tmpfs/tmpfs_vfsops.c > head/sys/kern/kern_jail.c > head/sys/kern/vfs_init.c > head/sys/kern/vfs_mount.c > head/sys/kern/vfs_subr.c > head/sys/sys/jail.h > head/sys/sys/mount.h > head/usr.sbin/jail/jail.8 > > Modified: head/lib/libjail/jail.c > ============================================================================== > --- head/lib/libjail/jail.c Fri May 4 20:38:26 2018 (r333262) > +++ head/lib/libjail/jail.c Fri May 4 20:54:27 2018 (r333263) > @@ -1048,7 +1048,13 @@ kldload_param(const char *name) > else if (strcmp(name, "sysvmsg") == 0 || strcmp(name, "sysvsem") == 0 || > strcmp(name, "sysvshm") == 0) > kl = kldload(name); > - else { > + else if (strncmp(name, "allow.mount.", 12) == 0) { > + /* Load the matching filesystem */ > + kl = kldload(name + 12); > + if (kl < 0 && errno == ENOENT && > + strncmp(name + 12, "no", 2) == 0) > + kl = kldload(name + 14); > + } else { > errno = ENOENT; > return (-1); > } > I'm curious about this part of the change. Why is it necessary to load the module in the "allow.mount.noXXXfs" case, when the jail is forbidden to mount the filesystem? It seems like that would just load modules that aren't going to be used. > Additional discussion at https://github.com/iocage/iocage/issues/689 . > -Alan Presumably such a parameter would be included in some jails in conjunction with the positive being included in others (perhaps as a default). The truth is I never really considered whether the "no" option would be used, I just always treat these option as pairs. It may be reasonable (at least in the allow.mount.* case) to silently disregard a "no" option that doesn't exist, but I don't know how many places would need to be modified for that to go smoothly. Though I don't expect that there would be too many people who bother to include a jail parameter about a filesystem which they're not planning to use. - Jamie Well, many people use the "no" option because one of the most popular jail managers, iocage, uses it under the hood. But since "no" is the default, its presence on the command line is a noop. Are there any situations in which the "no" option has an effect? The only two possibilities I could think of were: 1) Somebody puts both the positive and negative options on the same command line. From experiment, it seems like the last option takes effect. In this case, the presence of the positive option would cause the kld to be loaded, regardless of the presence of the negative option. 2) When using hierarchical jails, it might make sense to use the positive option for the outer jail and the negative option for the inner jail. But this would only be important if the inner jail inherited the outer jail's parameters, which doesn't seem to be the case. So I can't think of any reason to continue to mount the kld for "no" options. Can you? 3) There's allow.mount.foofs as a global parameter, with some jails overriding that with a jail-specific allow.mount.nofoofs. In that case, KLD loading shouldn't be a problem as global parameters typically come first. It makes sense not to load a KLD for a "no" option, as long as that option is then silently ignored. I wouldn't want it to error out with "unknown parameter". From owner-svn-src-head@freebsd.org Sat Nov 17 10:36:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5694E11300B8; Sat, 17 Nov 2018 10:36:01 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3AC4849DC; Sat, 17 Nov 2018 10:36:00 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0E502AFA3; Sat, 17 Nov 2018 10:36:00 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHAa055052243; Sat, 17 Nov 2018 10:36:00 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHAa0AL052241; Sat, 17 Nov 2018 10:36:00 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811171036.wAHAa0AL052241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 17 Nov 2018 10:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340491 - in head: share/ctypedef tools/tools/locale tools/tools/locale/etc tools/tools/locale/tools X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: share/ctypedef tools/tools/locale tools/tools/locale/etc tools/tools/locale/tools X-SVN-Commit-Revision: 340491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3AC4849DC X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.39)[0.386,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 10:36:01 -0000 Author: yuripv Date: Sat Nov 17 10:36:00 2018 New Revision: 340491 URL: https://svnweb.freebsd.org/changeset/base/340491 Log: Use UnicodeData.txt to create UTF-8 ctype map. This should provide more complete coverage of currently defined Unicode characters as compared to manually assembled one we use currently. Comparison of original and new UTF-8 ctype maps by character class: TYPE ORIG NEW alnum 94229 126029 alpha 93557 125419 blank 4 2 cntrl 73 137685 digit 469 622 graph 109615 137203 lower 1478 2145 print 109641 137222 punct 3428 797 rune 110481 274907 space 33 24 upper 983 1781 xdigit 469 622 Large number of added cntrl definitions is due to the fact that private-use planes are currently defined as such, this can change in the future. Discussed with: bapt Approved by: kib (mentor, implicit) MFC after: 1 month Differential revision: https://reviews.freebsd.org/D17842 Deleted: head/tools/tools/locale/etc/common.UTF-8.src head/tools/tools/locale/etc/manual-input.UTF-8 Modified: head/share/ctypedef/C.UTF-8.src head/tools/tools/locale/Makefile head/tools/tools/locale/tools/utf8-rollup.pl Modified: head/share/ctypedef/C.UTF-8.src ============================================================================== --- head/share/ctypedef/C.UTF-8.src Sat Nov 17 00:03:04 2018 (r340490) +++ head/share/ctypedef/C.UTF-8.src Sat Nov 17 10:36:00 2018 (r340491) @@ -7,386 +7,27606 @@ comment_char * escape_char / LC_CTYPE - -********************************************************************** -* 0x0000 - 0x007F Basic Latin -* 0x0080 - 0x00FF Latin-1 Supplement -* 0x0100 - 0x017F Latin Extended-A -* 0x0180 - 0x024F Latin Extended-B -* 0x0250 - 0x02AF IPA Extensions -* 0x1D00 - 0x1D7F Phonetic Extensions -* 0x1D80 - 0x1DBF Phonetic Extensions Supplement -* 0x1E00 - 0x1EFF Latin Extended Additional -* 0x2150 - 0x218F Number Forms (partial - Roman Numerals) -* 0x2C60 - 0x2C7F Latin Extended-C -* 0xA720 - 0xA7FF Latin Extended-D -* 0xAB30 - 0xAB6F Latin Extended-E -* 0xFB00 - 0xFF4F Alphabetic Presentation Forms (partial) -* 0xFF00 - 0xFFEF Halfwidth and Fullwidth Forms (partial) -********************************************************************** -upper ;...;;/ - ;...;;/ - ;...;;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;...;;/ - ;...;;/ - ;/ - ;/ - ;...;;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;...;;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;...;;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;...;;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;...;;/ - ;/ - ;/ - ;...;;/ - ;/ - ;/ - ;/ - ;...;;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;...;;/ - ;...;;/ - ;/ - ;...; -lower ;...;;/ - ;/ +alpha ;/ ;/ - ;...;;/ - ;...;;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Nov 17 13:00:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F9CE1133AB8; Sat, 17 Nov 2018 13:00:00 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482A06B0CE; Sat, 17 Nov 2018 13:00:00 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2962F2C623; Sat, 17 Nov 2018 13:00:00 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHCxxW8024049; Sat, 17 Nov 2018 12:59:59 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHCxxNf024048; Sat, 17 Nov 2018 12:59:59 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811171259.wAHCxxNf024048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 17 Nov 2018 12:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340492 - head/contrib/netbsd-tests/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/locale X-SVN-Commit-Revision: 340492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 482A06B0CE X-Spamd-Result: default: False [0.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 13:00:00 -0000 Author: yuripv Date: Sat Nov 17 12:59:59 2018 New Revision: 340492 URL: https://svnweb.freebsd.org/changeset/base/340492 Log: Make mbstowcs_basic test pass, now that we have more ctype definitions. Reported by: jenkins Approved by: kib (mentor, implicit) Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Sat Nov 17 10:36:00 2018 (r340491) +++ head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Sat Nov 17 12:59:59 2018 (r340492) @@ -88,7 +88,7 @@ static struct test { 0xFFFF, 0x5D, 0x5B, 0x10000, 0x10FFFF, 0x5D, 0x0A }, #ifdef __FreeBSD__ - { 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, + { 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, #else { 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, #endif From owner-svn-src-head@freebsd.org Sat Nov 17 16:08:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5E741137130; Sat, 17 Nov 2018 16:08:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF41700AB; Sat, 17 Nov 2018 16:08:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 386412E4C3; Sat, 17 Nov 2018 16:08:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHG8bpH021239; Sat, 17 Nov 2018 16:08:37 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHG8a9H021238; Sat, 17 Nov 2018 16:08:36 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811171608.wAHG8a9H021238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 17 Nov 2018 16:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340493 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 340493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5CF41700AB X-Spamd-Result: default: False [-0.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.142,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 16:08:38 -0000 Author: bz Date: Sat Nov 17 16:08:36 2018 New Revision: 340493 URL: https://svnweb.freebsd.org/changeset/base/340493 Log: Retire arpresolve_addr(), which is not used anywhere, from if_ether.c. Modified: head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sat Nov 17 12:59:59 2018 (r340492) +++ head/sys/netinet/if_ether.c Sat Nov 17 16:08:36 2018 (r340493) @@ -573,21 +573,6 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flag } /* - * Resolve an IP address into an ethernet address. - */ -int -arpresolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst, - char *desten, uint32_t *pflags, struct llentry **plle) -{ - int error; - - flags |= LLE_ADDRONLY; - error = arpresolve_full(ifp, 0, flags, NULL, dst, desten, pflags, plle); - return (error); -} - - -/* * Lookups link header based on an IP address. * On input: * ifp is the interface we use Modified: head/sys/netinet/if_ether.h ============================================================================== --- head/sys/netinet/if_ether.h Sat Nov 17 12:59:59 2018 (r340492) +++ head/sys/netinet/if_ether.h Sat Nov 17 16:08:36 2018 (r340493) @@ -117,9 +117,6 @@ extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN]; struct ifaddr; struct llentry; -int arpresolve_addr(struct ifnet *ifp, int flags, - const struct sockaddr *dst, char *desten, uint32_t *pflags, - struct llentry **plle); int arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m, const struct sockaddr *dst, u_char *desten, uint32_t *pflags, struct llentry **plle); From owner-svn-src-head@freebsd.org Sat Nov 17 16:13:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9866113737D; Sat, 17 Nov 2018 16:13:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73A917054B; Sat, 17 Nov 2018 16:13:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 551E72E653; Sat, 17 Nov 2018 16:13:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHGDAQl026216; Sat, 17 Nov 2018 16:13:10 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHGDAWG026215; Sat, 17 Nov 2018 16:13:10 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811171613.wAHGDAWG026215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 17 Nov 2018 16:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340494 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 340494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73A917054B X-Spamd-Result: default: False [-0.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.142,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 16:13:11 -0000 Author: bz Date: Sat Nov 17 16:13:09 2018 New Revision: 340494 URL: https://svnweb.freebsd.org/changeset/base/340494 Log: Improve the comment for arpresolve_full() in if_ether.c. No functional changes. MFC after: 6 weeks Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sat Nov 17 16:08:36 2018 (r340493) +++ head/sys/netinet/if_ether.c Sat Nov 17 16:13:09 2018 (r340494) @@ -433,10 +433,10 @@ arprequest(struct ifnet *ifp, const struct in_addr *si /* * Resolve an IP address into an ethernet address - heavy version. * Used internally by arpresolve(). - * We have already checked than we can't use existing lle without - * modification so we have to acquire LLE_EXCLUSIVE lle lock. + * We have already checked that we can't use an existing lle without + * modification so we have to acquire an LLE_EXCLUSIVE lle lock. * - * On success, desten and flags are filled in and the function returns 0; + * On success, desten and pflags are filled in and the function returns 0; * If the packet must be held pending resolution, we return EWOULDBLOCK * On other errors, we return the corresponding error code. * Note that m_freem() handles NULL. From owner-svn-src-head@freebsd.org Sat Nov 17 17:21:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED6E21138C44; Sat, 17 Nov 2018 17:21:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9765272644; Sat, 17 Nov 2018 17:21:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78BCB2F19D; Sat, 17 Nov 2018 17:21:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHHLaJK060181; Sat, 17 Nov 2018 17:21:36 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHHLahU060180; Sat, 17 Nov 2018 17:21:36 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811171721.wAHHLahU060180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 17 Nov 2018 17:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340495 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 340495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9765272644 X-Spamd-Result: default: False [-0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.06)[-0.063,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 17:21:37 -0000 Author: marius Date: Sat Nov 17 17:21:36 2018 New Revision: 340495 URL: https://svnweb.freebsd.org/changeset/base/340495 Log: - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sat Nov 17 16:13:09 2018 (r340494) +++ head/sys/dev/mmc/mmc.c Sat Nov 17 17:21:36 2018 (r340495) @@ -830,9 +830,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -843,8 +848,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -863,13 +868,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -881,7 +886,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2164,7 +2169,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2230,6 +2235,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); From owner-svn-src-head@freebsd.org Sat Nov 17 19:15:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CD7A1102AF7; Sat, 17 Nov 2018 19:15:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7726E7A8AC; Sat, 17 Nov 2018 19:15:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A59C47B; Sat, 17 Nov 2018 19:15:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHJFUoS026426; Sat, 17 Nov 2018 19:15:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHJFTZX026424; Sat, 17 Nov 2018 19:15:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811171915.wAHJFTZX026424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Nov 2018 19:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340507 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 340507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7726E7A8AC X-Spamd-Result: default: False [0.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.07)[0.068,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 19:15:31 -0000 Author: kevans Date: Sat Nov 17 19:15:29 2018 New Revision: 340507 URL: https://svnweb.freebsd.org/changeset/base/340507 Log: libbe(3): rewrite init to support chroot usage libbe(3) currently uses zfs_be_root and locates which of its children is currently mounted at "/". This is reasonable, but not correct in the case of a chroot, for two reasons: - chroot root may be of a different zpool than zfs_be_root - chroot root will not show up as mounted at "/" Fix both of these by rewriting libbe_init to work from the rootfs down. zfs_path_to_zhandle on / will resolve to the dataset mounted at the new root, rather than the real root. From there, we can derive the BE root/pool and grab the bootfs off of the new pool. This does no harm in the average case, and opens up bectl to operating on different pools for scenarios where one may be, for instance, updating a pool that generally gets re-rooted into from a separate UFS root or zfs bootpool. While here, I've also: - Eliminated the check for /boot and / to be on the same partition. This leaves one open to a setup where /boot (and consequently, kernel/modules) are not included in the boot environment. This may very well be an intentional setup done by someone that knows what they're doing, we should not kill BE usage because of it. - Eliminated the validation bits of BEs and snapshots that enforced 'mountpoint' to be "/" -- this broke when trying to operate on an imported pool with an altroot, but we need not be this picky. Reported by: philip Reviewed by: philip, allanjude (previous version) Tested by: philip MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18012 Modified: head/lib/libbe/be.c head/lib/libbe/be_info.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Sat Nov 17 19:02:50 2018 (r340506) +++ head/lib/libbe/be.c Sat Nov 17 19:15:29 2018 (r340507) @@ -29,11 +29,12 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include -#include +#include #include -#include #include #include #include @@ -55,23 +56,16 @@ static int be_create_child_cloned(libbe_handle_t *lbh, * zfs_be_root set by loader(8). data is expected to be a libbe_handle_t *. */ static int -be_locate_rootfs(zfs_handle_t *chkds, void *data) +be_locate_rootfs(libbe_handle_t *lbh) { - libbe_handle_t *lbh; - char *mntpoint; + zfs_handle_t *zfs; - lbh = (libbe_handle_t *)data; - if (lbh == NULL) + zfs = zfs_path_to_zhandle(lbh->lzh, "/", ZFS_TYPE_FILESYSTEM); + if (zfs == NULL) return (1); - mntpoint = NULL; - if (zfs_is_mounted(chkds, &mntpoint) && strcmp(mntpoint, "/") == 0) { - strlcpy(lbh->rootfs, zfs_get_name(chkds), sizeof(lbh->rootfs)); - free(mntpoint); - return (1); - } else if(mntpoint != NULL) - free(mntpoint); - + strlcpy(lbh->rootfs, zfs_get_name(zfs), sizeof(lbh->rootfs)); + zfs_close(zfs); return (0); } @@ -82,49 +76,29 @@ be_locate_rootfs(zfs_handle_t *chkds, void *data) libbe_handle_t * libbe_init(void) { - struct stat sb; - dev_t root_dev, boot_dev; libbe_handle_t *lbh; - zfs_handle_t *rootds; char *poolname, *pos; int pnamelen; lbh = NULL; poolname = pos = NULL; - rootds = NULL; - /* Verify that /boot and / are mounted on the same filesystem */ - /* TODO: use errno here?? */ - if (stat("/", &sb) != 0) - goto err; - - root_dev = sb.st_dev; - - if (stat("/boot", &sb) != 0) - goto err; - - boot_dev = sb.st_dev; - - if (root_dev != boot_dev) { - fprintf(stderr, "/ and /boot not on same device, quitting\n"); - goto err; - } - if ((lbh = calloc(1, sizeof(libbe_handle_t))) == NULL) goto err; if ((lbh->lzh = libzfs_init()) == NULL) goto err; - /* Obtain path to boot environment root */ - if ((kenv(KENV_GET, "zfs_be_root", lbh->root, - sizeof(lbh->root))) == -1) + /* Grab rootfs, we'll work backwards from there */ + if (be_locate_rootfs(lbh) != 0) goto err; - /* Remove leading 'zfs:' if present, otherwise use value as-is */ - if (strcmp(lbh->root, "zfs:") == 0) - strlcpy(lbh->root, strchr(lbh->root, ':') + sizeof(char), - sizeof(lbh->root)); + /* Strip off the final slash from the rootfs to get the be root */ + strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); + pos = strrchr(lbh->root, '/'); + if (pos == NULL) + goto err; + *pos = '\0'; if ((pos = strchr(lbh->root, '/')) == NULL) goto err; @@ -144,17 +118,6 @@ libbe_init(void) sizeof(lbh->bootfs), NULL, true) != 0) goto err; - /* Obtain path to boot environment rootfs (currently booted) */ - /* XXX Get dataset mounted at / by kenv/GUID from mountroot? */ - if ((rootds = zfs_open(lbh->lzh, lbh->root, ZFS_TYPE_DATASET)) == NULL) - goto err; - - zfs_iter_filesystems(rootds, be_locate_rootfs, lbh); - zfs_close(rootds); - rootds = NULL; - if (*lbh->rootfs == '\0') - goto err; - return (lbh); err: if (lbh != NULL) { @@ -503,10 +466,6 @@ be_create_from_existing(libbe_handle_t *lbh, const cha int be_validate_snap(libbe_handle_t *lbh, const char *snap_name) { - zfs_handle_t *zfs_hdl; - char buf[BE_MAXPATHLEN]; - char *delim_pos; - int err = BE_ERR_SUCCESS; if (strlen(snap_name) >= BE_MAXPATHLEN) return (BE_ERR_PATHLEN); @@ -515,27 +474,7 @@ be_validate_snap(libbe_handle_t *lbh, const char *snap ZFS_TYPE_SNAPSHOT)) return (BE_ERR_NOENT); - strlcpy(buf, snap_name, sizeof(buf)); - - /* Find the base filesystem of the snapshot */ - if ((delim_pos = strchr(buf, '@')) == NULL) - return (BE_ERR_INVALIDNAME); - *delim_pos = '\0'; - - if ((zfs_hdl = - zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) - return (BE_ERR_NOORIGIN); - - if ((err = zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, buf, - sizeof(buf), NULL, NULL, 0, 1)) != 0) - err = BE_ERR_BADMOUNT; - - if ((err != 0) && (strncmp(buf, "/", sizeof(buf)) != 0)) - err = BE_ERR_BADMOUNT; - - zfs_close(zfs_hdl); - - return (err); + return (BE_ERR_SUCCESS); } Modified: head/lib/libbe/be_info.c ============================================================================== --- head/lib/libbe/be_info.c Sat Nov 17 19:02:50 2018 (r340506) +++ head/lib/libbe/be_info.c Sat Nov 17 19:15:29 2018 (r340507) @@ -289,30 +289,11 @@ int be_exists(libbe_handle_t *lbh, char *be) { char buf[BE_MAXPATHLEN]; - nvlist_t *dsprops; - char *mntpoint; - bool valid; be_root_concat(lbh, be, buf); if (!zfs_dataset_exists(lbh->lzh, buf, ZFS_TYPE_DATASET)) return (BE_ERR_NOENT); - /* Also check if it's mounted at / */ - if (be_prop_list_alloc(&dsprops) != 0) - return (BE_ERR_UNKNOWN); - - if (be_get_dataset_props(lbh, buf, dsprops) != 0) { - nvlist_free(dsprops); - return (BE_ERR_UNKNOWN); - } - - if (nvlist_lookup_string(dsprops, "mountpoint", &mntpoint) == 0) { - valid = (strcmp(mntpoint, "/") == 0); - nvlist_free(dsprops); - return (valid ? BE_ERR_SUCCESS : BE_ERR_BADMOUNT); - } - - nvlist_free(dsprops); - return (BE_ERR_BADMOUNT); + return (BE_ERR_SUCCESS); } From owner-svn-src-head@freebsd.org Sat Nov 17 19:19:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 438331102C2B; Sat, 17 Nov 2018 19:19:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE0E87AA82; Sat, 17 Nov 2018 19:19:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC1A0488; Sat, 17 Nov 2018 19:19:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHJJbS7026636; Sat, 17 Nov 2018 19:19:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHJJbXB026635; Sat, 17 Nov 2018 19:19:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811171919.wAHJJbXB026635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Nov 2018 19:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340508 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 340508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE0E87AA82 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.064,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 19:19:38 -0000 Author: kevans Date: Sat Nov 17 19:19:37 2018 New Revision: 340508 URL: https://svnweb.freebsd.org/changeset/base/340508 Log: libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2) Go through the ZFS layer instead; given a BE, we can derive the dataset, zfs_open it, then zfs_unmount. ZFS takes care of the dirty details and likely gets it more correct than we did for more interesting setups. MFC after: 3 days Modified: head/lib/libbe/be_access.c Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Sat Nov 17 19:15:29 2018 (r340507) +++ head/lib/libbe/be_access.c Sat Nov 17 19:19:37 2018 (r340508) @@ -164,37 +164,18 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla { int err, mntflags; char be[BE_MAXPATHLEN]; - struct statfs *mntbuf; - int mntsize; - char *mntpath; + zfs_handle_t *root_hdl; if ((err = be_root_concat(lbh, bootenv, be)) != 0) return (set_error(lbh, err)); - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) { - if (errno == EIO) - return (set_error(lbh, BE_ERR_IO)); - return (set_error(lbh, BE_ERR_NOMOUNT)); - } + if ((root_hdl = zfs_open(lbh->lzh, be, ZFS_TYPE_FILESYSTEM)) == NULL) + return (set_error(lbh, BE_ERR_ZFSOPEN)); - mntpath = NULL; - for (int i = 0; i < mntsize; ++i) { - /* 0x000000de is the type number of zfs */ - if (mntbuf[i].f_type != 0x000000de) - continue; + mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; - if (strcmp(mntbuf[i].f_mntfromname, be) == 0) { - mntpath = mntbuf[i].f_mntonname; - break; - } - } - - if (mntpath == NULL) - return (set_error(lbh, BE_ERR_NOMOUNT)); - - mntflags = (flags & BE_MNT_FORCE) ? MNT_FORCE : 0; - - if ((err = unmount(mntpath, mntflags)) != 0) { + if (zfs_unmount(root_hdl, NULL, mntflags) != 0) { + zfs_close(root_hdl); switch (errno) { case ENAMETOOLONG: return (set_error(lbh, BE_ERR_PATHLEN)); @@ -210,6 +191,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla return (set_error(lbh, BE_ERR_UNKNOWN)); } } + zfs_close(root_hdl); - return (set_error(lbh, BE_ERR_SUCCESS)); + return (BE_ERR_SUCCESS); } From owner-svn-src-head@freebsd.org Sat Nov 17 21:35:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC62E1106C85; Sat, 17 Nov 2018 21:35:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6493E80E9F; Sat, 17 Nov 2018 21:35:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38ED21BCA; Sat, 17 Nov 2018 21:35:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHLZ2CI099789; Sat, 17 Nov 2018 21:35:02 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHLZ2Up099788; Sat, 17 Nov 2018 21:35:02 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201811172135.wAHLZ2Up099788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 17 Nov 2018 21:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340525 - head/sbin/mount_fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/mount_fusefs X-SVN-Commit-Revision: 340525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6493E80E9F X-Spamd-Result: default: False [0.35 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.35)[0.354,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 21:35:02 -0000 Author: asomers Date: Sat Nov 17 21:35:01 2018 New Revision: 340525 URL: https://svnweb.freebsd.org/changeset/base/340525 Log: mount_fusefs.8: expand HISTORY section Note that fuse was available from ports long before joining the base system. Also, update the upstream URL. MFC after: 2 weeks Modified: head/sbin/mount_fusefs/mount_fusefs.8 Modified: head/sbin/mount_fusefs/mount_fusefs.8 ============================================================================== --- head/sbin/mount_fusefs/mount_fusefs.8 Sat Nov 17 20:59:50 2018 (r340524) +++ head/sbin/mount_fusefs/mount_fusefs.8 Sat Nov 17 21:35:01 2018 (r340525) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2016 +.Dd November 17, 2018 .Dt MOUNT_FUSEFS 8 .Os .Sh NAME @@ -339,12 +339,16 @@ does not call any external utility and also provides a .Xr umount 8 .Sh HISTORY .Nm -appeared in -.Fx 10.0 -as the part of the +was written as the part of the .Fx -implementation of the Fuse userspace filesystem -framework (see http://fuse.sourceforge.net). +implementation of the Fuse userspace filesystem framework (see +.Xr https://github.com/libfuse/libfuse ) +and first appeared in the +.Pa sysutils/fusefs-kmod +port, supporting +.Fx 6.0 . +It was added to the base system in +.Fx 10.0 . .Sh CAVEATS This user interface is .Fx From owner-svn-src-head@freebsd.org Sat Nov 17 22:01:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6288C1107BFB; Sat, 17 Nov 2018 22:01:26 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-it1-x133.google.com (mail-it1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B27A82750; Sat, 17 Nov 2018 22:01:25 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-it1-x133.google.com with SMTP id g85so1468408ita.3; Sat, 17 Nov 2018 14:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P8KqskL6gW1NQvOzqGKhomib6Lq4rJjo/qAwnaHp0zo=; b=D0NZwIxTTycZaqJma2wODZ8BJeac2dNOgoS7/JGxwAnMonh9Vrx+n5i4WnJeiMQbCP v7oeJizK9rzBH5by1t65eIvIXeo17o54ka8K3tRYVRlk/UwxBrhDgZGpwGu1I7pZNTJK X5UHb+XHNCwMvZbZLtQ+vMbTu9orNhwKTTtFThGQAnsMXwl2/RltKqWKwzTyatBZ4AcL wpmF3RoBYSthPRyVfuYqFnHnXZLbV3/NWl5PdezwGrJxfc5h5ppXhAtL2Fl0a+9+5lBi lakzQbh+1jFjRZpNkhqxn4EnsDk313siCVEbFRXchuHbi10VIvDwrsBqc55uEuymhVqI FgVA== 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=P8KqskL6gW1NQvOzqGKhomib6Lq4rJjo/qAwnaHp0zo=; b=MJAa3PfAGQd9vasBiZlAGj7G0a0q/QT6zety3ZdHXCMqc8bROjZMZ7BzN0HulZtsww 2VblEHb+CtFs6Y4aA+bKm1H7Rq4qru8ooH8OwT23L92DvA56uW8hc1pynosnwJj4f/sS jsvLqodwlzQbnbEGh1kUWKlOGKRvpasjZTu/1XFw910Uk3Ontr9kXFoqbIqI7lvwHXIu 35yp05KQwNaUE7ckL7n019qZbaKs2vG7cdZ1VLBEnFWdjaWKYV1Qn6ttCemQeDNs2YgF Bf/C7/hymamb+lIzu1ljo6KXHs2JNsmhVVt9wQrEf/Dn4UsvxditlNRypQpuHrBx4QA5 yzlQ== X-Gm-Message-State: AGRZ1gL3V6xC/AtLKM3XAWSdnihQf9h/Sh4ddKO5Pe2cjep0Ji9/spo5 FeJLJbyV0ACZUd0drtRW5E7bqTgHKMp9+rgwBi+k2Q== X-Google-Smtp-Source: AFSGD/W1pGgWb3/WmSojuXxjKC0o4Am78X7Zvq+pg8xevCNle5IqzpToR3p29TslFYLDpfmRoV0XYmAK/eHAIUrSwxs= X-Received: by 2002:a05:660c:11d8:: with SMTP id p24mr3455987itm.20.1542492084563; Sat, 17 Nov 2018 14:01:24 -0800 (PST) MIME-Version: 1.0 References: <201810222055.w9MKtZPt013627@repo.freebsd.org> In-Reply-To: <201810222055.w9MKtZPt013627@repo.freebsd.org> From: Matthew Macy Date: Sat, 17 Nov 2018 14:01:13 -0800 Message-ID: Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux To: Tijl Coosemans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 9B27A82750 X-Spamd-Result: default: False [-4.49 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-2.65)[ip: (-8.77), ipnet: 2607:f8b0::/32(-2.61), asn: 15169(-1.78), country: US(-0.10)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.83)[-0.826,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 22:01:26 -0000 You should probably revert this. The implied understanding of the _relaxed version is incorrect. compiler_membar is there to prevent instruction reordering which is possible on FreeBSD because the accesses are done in C. The relaxed variants still do not permit instruction reordering. On Linux __compiler_member (referred to as barrier there) isn=E2=80=99t necessary in= the mmio accessors because they always use volatile asm which can=E2=80=99t be reordered. The distinction between the relaxed and non relaxed variants is that the relaxed variant lacks memory barriers (sync / lwsync / eieio on ppc, membar on sparc, etc). Most of the time we don=E2=80=99t run in to pro= blems on x86 because with TSO the only reordering possible is writes that happen before reads can become visible in memory after they occur in the instruction stream. Thanks. -M On Mon, Oct 22, 2018 at 13:55 Tijl Coosemans wrote: > Author: tijl > Date: Mon Oct 22 20:55:35 2018 > New Revision: 339618 > URL: https://svnweb.freebsd.org/changeset/base/339618 > > Log: > Define linuxkpi readq for 64-bit architectures. It is used by drm-kmod= . > Currently the compiler picks up the definition in machine/cpufunc.h. > > Add compiler memory barriers to read* and write*. The Linux x86 > implementation of these functions uses inline asm with "memory" clobber= . > The Linux x86 implementation of read_relaxed* and write_relaxed* uses t= he > same inline asm without "memory" clobber. > > Implement ioread* and iowrite* in terms of read* and write* so they als= o > have memory barriers. > > Qualify the addr parameter in write* as volatile. > > Like Linux, define macros with the same name as the inline functions. > > Only define 64-bit versions on 64-bit architectures because generally > 32-bit architectures can't do atomic 64-bit loads and stores. > > Regroup the functions a bit and add brief comments explaining what they > do: > - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping > - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian > - read*, write*: atomic, with barriers, little-endian > > Add a comment that says our implementation of ioread* and iowrite* > only handles MMIO and does not support port IO. > > Reviewed by: hselasky > MFC after: 3 days > > Modified: > head/sys/compat/linuxkpi/common/include/linux/io.h > > Modified: head/sys/compat/linuxkpi/common/include/linux/io.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/compat/linuxkpi/common/include/linux/io.h Mon Oct 22 > 20:22:33 2018 (r339617) > +++ head/sys/compat/linuxkpi/common/include/linux/io.h Mon Oct 22 > 20:55:35 2018 (r339618) > @@ -38,153 +38,309 @@ > #include > #include > > +/* > + * XXX This is all x86 specific. It should be bus space access. > + */ > + > +/* Access MMIO registers atomically without barriers and byte swapping. = */ > + > +static inline uint8_t > +__raw_readb(const volatile void *addr) > +{ > + return (*(const volatile uint8_t *)addr); > +} > +#define __raw_readb(addr) __raw_readb(addr) > + > +static inline void > +__raw_writeb(uint8_t v, volatile void *addr) > +{ > + *(volatile uint8_t *)addr =3D v; > +} > +#define __raw_writeb(v, addr) __raw_writeb(v, addr) > + > +static inline uint16_t > +__raw_readw(const volatile void *addr) > +{ > + return (*(const volatile uint16_t *)addr); > +} > +#define __raw_readw(addr) __raw_readw(addr) > + > +static inline void > +__raw_writew(uint16_t v, volatile void *addr) > +{ > + *(volatile uint16_t *)addr =3D v; > +} > +#define __raw_writew(v, addr) __raw_writew(v, addr) > + > static inline uint32_t > __raw_readl(const volatile void *addr) > { > - return *(const volatile uint32_t *)addr; > + return (*(const volatile uint32_t *)addr); > } > +#define __raw_readl(addr) __raw_readl(addr) > > static inline void > -__raw_writel(uint32_t b, volatile void *addr) > +__raw_writel(uint32_t v, volatile void *addr) > { > - *(volatile uint32_t *)addr =3D b; > + *(volatile uint32_t *)addr =3D v; > } > +#define __raw_writel(v, addr) __raw_writel(v, addr) > > +#ifdef __LP64__ > static inline uint64_t > __raw_readq(const volatile void *addr) > { > - return *(const volatile uint64_t *)addr; > + return (*(const volatile uint64_t *)addr); > } > +#define __raw_readq(addr) __raw_readq(addr) > > static inline void > -__raw_writeq(uint64_t b, volatile void *addr) > +__raw_writeq(uint64_t v, volatile void *addr) > { > - *(volatile uint64_t *)addr =3D b; > + *(volatile uint64_t *)addr =3D v; > } > +#define __raw_writeq(v, addr) __raw_writeq(v, addr) > +#endif > > -/* > - * XXX This is all x86 specific. It should be bus space access. > - */ > #define mmiowb() barrier() > > -#undef writel > +/* Access little-endian MMIO registers atomically with memory barriers. = */ > + > +#undef readb > +static inline uint8_t > +readb(const volatile void *addr) > +{ > + uint8_t v; > + > + __compiler_membar(); > + v =3D *(const volatile uint8_t *)addr; > + __compiler_membar(); > + return (v); > +} > +#define readb(addr) readb(addr) > + > +#undef writeb > static inline void > -writel(uint32_t b, void *addr) > +writeb(uint8_t v, volatile void *addr) > { > - *(volatile uint32_t *)addr =3D b; > + __compiler_membar(); > + *(volatile uint8_t *)addr =3D v; > + __compiler_membar(); > } > +#define writeb(v, addr) writeb(v, addr) > > -#undef writel_relaxed > +#undef readw > +static inline uint16_t > +readw(const volatile void *addr) > +{ > + uint16_t v; > + > + __compiler_membar(); > + v =3D *(const volatile uint16_t *)addr; > + __compiler_membar(); > + return (v); > +} > +#define readw(addr) readw(addr) > + > +#undef writew > static inline void > -writel_relaxed(uint32_t b, void *addr) > +writew(uint16_t v, volatile void *addr) > { > - *(volatile uint32_t *)addr =3D b; > + __compiler_membar(); > + *(volatile uint16_t *)addr =3D v; > + __compiler_membar(); > } > +#define writew(v, addr) writew(v, addr) > > +#undef readl > +static inline uint32_t > +readl(const volatile void *addr) > +{ > + uint32_t v; > + > + __compiler_membar(); > + v =3D *(const volatile uint32_t *)addr; > + __compiler_membar(); > + return (v); > +} > +#define readl(addr) readl(addr) > + > +#undef writel > +static inline void > +writel(uint32_t v, volatile void *addr) > +{ > + __compiler_membar(); > + *(volatile uint32_t *)addr =3D v; > + __compiler_membar(); > +} > +#define writel(v, addr) writel(v, addr) > + > +#undef readq > #undef writeq > +#ifdef __LP64__ > +static inline uint64_t > +readq(const volatile void *addr) > +{ > + uint64_t v; > + > + __compiler_membar(); > + v =3D *(const volatile uint64_t *)addr; > + __compiler_membar(); > + return (v); > +} > +#define readq(addr) readq(addr) > + > static inline void > -writeq(uint64_t b, void *addr) > +writeq(uint64_t v, volatile void *addr) > { > - *(volatile uint64_t *)addr =3D b; > + __compiler_membar(); > + *(volatile uint64_t *)addr =3D v; > + __compiler_membar(); > } > +#define writeq(v, addr) writeq(v, addr) > +#endif > > -#undef writeb > +/* Access little-endian MMIO registers atomically without memory > barriers. */ > + > +#undef readb_relaxed > +static inline uint8_t > +readb_relaxed(const volatile void *addr) > +{ > + return (*(const volatile uint8_t *)addr); > +} > +#define readb_relaxed(addr) readb_relaxed(addr) > + > +#undef writeb_relaxed > static inline void > -writeb(uint8_t b, void *addr) > +writeb_relaxed(uint8_t v, volatile void *addr) > { > - *(volatile uint8_t *)addr =3D b; > + *(volatile uint8_t *)addr =3D v; > } > +#define writeb_relaxed(v, addr) writeb_relaxed(v, addr) > > -#undef writew > +#undef readw_relaxed > +static inline uint16_t > +readw_relaxed(const volatile void *addr) > +{ > + return (*(const volatile uint16_t *)addr); > +} > +#define readw_relaxed(addr) readw_relaxed(addr) > + > +#undef writew_relaxed > static inline void > -writew(uint16_t b, void *addr) > +writew_relaxed(uint16_t v, volatile void *addr) > { > - *(volatile uint16_t *)addr =3D b; > + *(volatile uint16_t *)addr =3D v; > } > +#define writew_relaxed(v, addr) writew_relaxed(v, addr) > > +#undef readl_relaxed > +static inline uint32_t > +readl_relaxed(const volatile void *addr) > +{ > + return (*(const volatile uint32_t *)addr); > +} > +#define readl_relaxed(addr) readl_relaxed(addr) > + > +#undef writel_relaxed > +static inline void > +writel_relaxed(uint32_t v, volatile void *addr) > +{ > + *(volatile uint32_t *)addr =3D v; > +} > +#define writel_relaxed(v, addr) writel_relaxed(v, addr) > + > +#undef readq_relaxed > +#undef writeq_relaxed > +#ifdef __LP64__ > +static inline uint64_t > +readq_relaxed(const volatile void *addr) > +{ > + return (*(const volatile uint64_t *)addr); > +} > +#define readq_relaxed(addr) readq_relaxed(addr) > + > +static inline void > +writeq_relaxed(uint64_t v, volatile void *addr) > +{ > + *(volatile uint64_t *)addr =3D v; > +} > +#define writeq_relaxed(v, addr) writeq_relaxed(v, addr) > +#endif > + > +/* XXX On Linux ioread and iowrite handle both MMIO and port IO. */ > + > #undef ioread8 > static inline uint8_t > ioread8(const volatile void *addr) > { > - return *(const volatile uint8_t *)addr; > + return (readb(addr)); > } > +#define ioread8(addr) ioread8(addr) > > #undef ioread16 > static inline uint16_t > ioread16(const volatile void *addr) > { > - return *(const volatile uint16_t *)addr; > + return (readw(addr)); > } > +#define ioread16(addr) ioread16(addr) > > #undef ioread16be > static inline uint16_t > ioread16be(const volatile void *addr) > { > - return be16toh(*(const volatile uint16_t *)addr); > + return (bswap16(readw(addr))); > } > +#define ioread16be(addr) ioread16be(addr) > > #undef ioread32 > static inline uint32_t > ioread32(const volatile void *addr) > { > - return *(const volatile uint32_t *)addr; > + return (readl(addr)); > } > +#define ioread32(addr) ioread32(addr) > > #undef ioread32be > static inline uint32_t > ioread32be(const volatile void *addr) > { > - return be32toh(*(const volatile uint32_t *)addr); > + return (bswap32(readl(addr))); > } > +#define ioread32be(addr) ioread32be(addr) > > #undef iowrite8 > static inline void > iowrite8(uint8_t v, volatile void *addr) > { > - *(volatile uint8_t *)addr =3D v; > + writeb(v, addr); > } > +#define iowrite8(v, addr) iowrite8(v, addr) > > #undef iowrite16 > static inline void > iowrite16(uint16_t v, volatile void *addr) > { > - *(volatile uint16_t *)addr =3D v; > + writew(v, addr); > } > +#define iowrite16 iowrite16 > > #undef iowrite32 > static inline void > iowrite32(uint32_t v, volatile void *addr) > { > - *(volatile uint32_t *)addr =3D v; > + writel(v, addr); > } > +#define iowrite32(v, addr) iowrite32(v, addr) > > #undef iowrite32be > static inline void > iowrite32be(uint32_t v, volatile void *addr) > { > - *(volatile uint32_t *)addr =3D htobe32(v); > + writel(bswap32(v), addr); > } > - > -#undef readb > -static inline uint8_t > -readb(const volatile void *addr) > -{ > - return *(const volatile uint8_t *)addr; > -} > - > -#undef readw > -static inline uint16_t > -readw(const volatile void *addr) > -{ > - return *(const volatile uint16_t *)addr; > -} > - > -#undef readl > -static inline uint32_t > -readl(const volatile void *addr) > -{ > - return *(const volatile uint32_t *)addr; > -} > +#define iowrite32be(v, addr) iowrite32be(v, addr) > > #if defined(__i386__) || defined(__amd64__) > static inline void > > From owner-svn-src-head@freebsd.org Sat Nov 17 22:55:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EB84110981C; Sat, 17 Nov 2018 22:55:18 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-it1-x133.google.com (mail-it1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9D91846AA; Sat, 17 Nov 2018 22:55:17 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-it1-x133.google.com with SMTP id a185so1915601itc.0; Sat, 17 Nov 2018 14:55:17 -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:content-transfer-encoding; bh=E/2sZ2asVeE2a1FHqciXkaPDgzyKbDlEp12UNZshaS4=; b=OT/kRelG2yHn+I6KmTdvZIMgKMooC6ibF86BLxcHbZ1bxPWZqKGF3j41fFGaeGls+O V1Bad3MKdGGmLk8SmEU2aql4fWQxpKtPRu+lytg8K5+37lFw+ruEhqP1B4wfW4wAnjjk jOJelSoWtJeZhHOANc2HwPy9HhW0gzc6kzVmUVShbQEBVyn99gaQzRcPfcmPWPtEnQgU DYIIwWYn5p5wdUo/XxPJpvrE9e5/KSMuydpTEgZqrJdE+zy+QM3bltrHYw8ALdzarIXW ahaGAM7WQwlE7EhCiAqv+OSKdUVZWO6PDcrE6/qujAG/eDAAmvUDBZayBEVqZONWzhhb BAvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=E/2sZ2asVeE2a1FHqciXkaPDgzyKbDlEp12UNZshaS4=; b=ixUa7ukHpTHpS5DgfETJauvnn/hG8aV5JOY5tGZZaCMc+KA/MtspVPMN+/z8/h22JB nLpN1IwEDAfXMt68wYVBqZOK/CC8RIu7gKvmXnV8TJ+aAczI2kb1vlTwSkKMykXcmNnj 33K7AWUIvMTizr9of+5ljXcngm/0z/7pZicMwZEfwB3eVoCy+CNy+yiXuDB8WCe4N9uC ErFe6s79iiHi7bVpFR7j208aUwj19ScSfBeqfQMfm6wfwsdS3vu8/96W+jYD2Ovhfr3O 1BhpbzLJK3/+hE25tV55tYlJ+4W8VSXzzoKi3kuWt/xmsaUQUNQYmAQJ8jS3cAuqsJxc LOOA== X-Gm-Message-State: AGRZ1gIppp3LWjAdopc/doChSnoYF/wBFELoDwV6yrMzduIf2F3Y1Ytb ARlF7eHejt6HCJVC5jFK2KLP8PoQ6yQsUG/0tFyjANqu X-Google-Smtp-Source: AJdET5e31b0Wua6nKWWh2AXqPiuCXKX/8OLXgnnzLzMu/fpe6W/C2yT8GnfgVNCCzs7Vh0aWg31fGoTo3sqijlT6Ypw= X-Received: by 2002:a02:56d3:: with SMTP id u80-v6mr14651848jad.88.1542495316820; Sat, 17 Nov 2018 14:55:16 -0800 (PST) MIME-Version: 1.0 References: <201810222055.w9MKtZPt013627@repo.freebsd.org> In-Reply-To: From: Matthew Macy Date: Sat, 17 Nov 2018 14:55:05 -0800 Message-ID: Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux To: Tijl Coosemans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D9D91846AA X-Spamd-Result: default: False [-4.56 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-2.68)[ip: (-8.93), ipnet: 2607:f8b0::/32(-2.62), asn: 15169(-1.78), country: US(-0.10)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.87)[-0.870,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 22:55:18 -0000 When looking at powerpc io.h raw and relaxed are not aliases, but it appears that on x86, they are: https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/io.h Sorry for the noise. But let's starting moving the x86 specific atomic.h and io.h under asm/x86. Thanks. On Sat, Nov 17, 2018 at 2:01 PM Matthew Macy wrote: > > You should probably revert this. The implied understanding of the _relaxe= d version is incorrect. compiler_membar is there to prevent instruction reo= rdering which is possible on FreeBSD because the accesses are done in C. Th= e relaxed variants still do not permit instruction reordering. On Linux __c= ompiler_member (referred to as barrier there) isn=E2=80=99t necessary in th= e mmio accessors because they always use volatile asm which can=E2=80=99t b= e reordered. The distinction between the relaxed and non relaxed variants i= s that the relaxed variant lacks memory barriers (sync / lwsync / eieio on = ppc, membar on sparc, etc). Most of the time we don=E2=80=99t run in to pro= blems on x86 because with TSO the only reordering possible is writes that h= appen before reads can become visible in memory after they occur in the ins= truction stream. > > Thanks. > -M > > On Mon, Oct 22, 2018 at 13:55 Tijl Coosemans wrote: >> >> Author: tijl >> Date: Mon Oct 22 20:55:35 2018 >> New Revision: 339618 >> URL: https://svnweb.freebsd.org/changeset/base/339618 >> >> Log: >> Define linuxkpi readq for 64-bit architectures. It is used by drm-kmo= d. >> Currently the compiler picks up the definition in machine/cpufunc.h. >> >> Add compiler memory barriers to read* and write*. The Linux x86 >> implementation of these functions uses inline asm with "memory" clobbe= r. >> The Linux x86 implementation of read_relaxed* and write_relaxed* uses = the >> same inline asm without "memory" clobber. >> >> Implement ioread* and iowrite* in terms of read* and write* so they al= so >> have memory barriers. >> >> Qualify the addr parameter in write* as volatile. >> >> Like Linux, define macros with the same name as the inline functions. >> >> Only define 64-bit versions on 64-bit architectures because generally >> 32-bit architectures can't do atomic 64-bit loads and stores. >> >> Regroup the functions a bit and add brief comments explaining what the= y do: >> - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping >> - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian >> - read*, write*: atomic, with barriers, little-endian >> >> Add a comment that says our implementation of ioread* and iowrite* >> only handles MMIO and does not support port IO. >> >> Reviewed by: hselasky >> MFC after: 3 days >> >> Modified: >> head/sys/compat/linuxkpi/common/include/linux/io.h >> >> Modified: head/sys/compat/linuxkpi/common/include/linux/io.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/compat/linuxkpi/common/include/linux/io.h Mon Oct 22 20:22= :33 2018 (r339617) >> +++ head/sys/compat/linuxkpi/common/include/linux/io.h Mon Oct 22 20:55= :35 2018 (r339618) >> @@ -38,153 +38,309 @@ >> #include >> #include >> >> +/* >> + * XXX This is all x86 specific. It should be bus space access. >> + */ >> + >> +/* Access MMIO registers atomically without barriers and byte swapping.= */ >> + >> +static inline uint8_t >> +__raw_readb(const volatile void *addr) >> +{ >> + return (*(const volatile uint8_t *)addr); >> +} >> +#define __raw_readb(addr) __raw_readb(addr) >> + >> +static inline void >> +__raw_writeb(uint8_t v, volatile void *addr) >> +{ >> + *(volatile uint8_t *)addr =3D v; >> +} >> +#define __raw_writeb(v, addr) __raw_writeb(v, addr) >> + >> +static inline uint16_t >> +__raw_readw(const volatile void *addr) >> +{ >> + return (*(const volatile uint16_t *)addr); >> +} >> +#define __raw_readw(addr) __raw_readw(addr) >> + >> +static inline void >> +__raw_writew(uint16_t v, volatile void *addr) >> +{ >> + *(volatile uint16_t *)addr =3D v; >> +} >> +#define __raw_writew(v, addr) __raw_writew(v, addr) >> + >> static inline uint32_t >> __raw_readl(const volatile void *addr) >> { >> - return *(const volatile uint32_t *)addr; >> + return (*(const volatile uint32_t *)addr); >> } >> +#define __raw_readl(addr) __raw_readl(addr) >> >> static inline void >> -__raw_writel(uint32_t b, volatile void *addr) >> +__raw_writel(uint32_t v, volatile void *addr) >> { >> - *(volatile uint32_t *)addr =3D b; >> + *(volatile uint32_t *)addr =3D v; >> } >> +#define __raw_writel(v, addr) __raw_writel(v, addr) >> >> +#ifdef __LP64__ >> static inline uint64_t >> __raw_readq(const volatile void *addr) >> { >> - return *(const volatile uint64_t *)addr; >> + return (*(const volatile uint64_t *)addr); >> } >> +#define __raw_readq(addr) __raw_readq(addr) >> >> static inline void >> -__raw_writeq(uint64_t b, volatile void *addr) >> +__raw_writeq(uint64_t v, volatile void *addr) >> { >> - *(volatile uint64_t *)addr =3D b; >> + *(volatile uint64_t *)addr =3D v; >> } >> +#define __raw_writeq(v, addr) __raw_writeq(v, addr) >> +#endif >> >> -/* >> - * XXX This is all x86 specific. It should be bus space access. >> - */ >> #define mmiowb() barrier() >> >> -#undef writel >> +/* Access little-endian MMIO registers atomically with memory barriers.= */ >> + >> +#undef readb >> +static inline uint8_t >> +readb(const volatile void *addr) >> +{ >> + uint8_t v; >> + >> + __compiler_membar(); >> + v =3D *(const volatile uint8_t *)addr; >> + __compiler_membar(); >> + return (v); >> +} >> +#define readb(addr) readb(addr) >> + >> +#undef writeb >> static inline void >> -writel(uint32_t b, void *addr) >> +writeb(uint8_t v, volatile void *addr) >> { >> - *(volatile uint32_t *)addr =3D b; >> + __compiler_membar(); >> + *(volatile uint8_t *)addr =3D v; >> + __compiler_membar(); >> } >> +#define writeb(v, addr) writeb(v, addr) >> >> -#undef writel_relaxed >> +#undef readw >> +static inline uint16_t >> +readw(const volatile void *addr) >> +{ >> + uint16_t v; >> + >> + __compiler_membar(); >> + v =3D *(const volatile uint16_t *)addr; >> + __compiler_membar(); >> + return (v); >> +} >> +#define readw(addr) readw(addr) >> + >> +#undef writew >> static inline void >> -writel_relaxed(uint32_t b, void *addr) >> +writew(uint16_t v, volatile void *addr) >> { >> - *(volatile uint32_t *)addr =3D b; >> + __compiler_membar(); >> + *(volatile uint16_t *)addr =3D v; >> + __compiler_membar(); >> } >> +#define writew(v, addr) writew(v, addr) >> >> +#undef readl >> +static inline uint32_t >> +readl(const volatile void *addr) >> +{ >> + uint32_t v; >> + >> + __compiler_membar(); >> + v =3D *(const volatile uint32_t *)addr; >> + __compiler_membar(); >> + return (v); >> +} >> +#define readl(addr) readl(addr) >> + >> +#undef writel >> +static inline void >> +writel(uint32_t v, volatile void *addr) >> +{ >> + __compiler_membar(); >> + *(volatile uint32_t *)addr =3D v; >> + __compiler_membar(); >> +} >> +#define writel(v, addr) writel(v, addr) >> + >> +#undef readq >> #undef writeq >> +#ifdef __LP64__ >> +static inline uint64_t >> +readq(const volatile void *addr) >> +{ >> + uint64_t v; >> + >> + __compiler_membar(); >> + v =3D *(const volatile uint64_t *)addr; >> + __compiler_membar(); >> + return (v); >> +} >> +#define readq(addr) readq(addr) >> + >> static inline void >> -writeq(uint64_t b, void *addr) >> +writeq(uint64_t v, volatile void *addr) >> { >> - *(volatile uint64_t *)addr =3D b; >> + __compiler_membar(); >> + *(volatile uint64_t *)addr =3D v; >> + __compiler_membar(); >> } >> +#define writeq(v, addr) writeq(v, addr) >> +#endif >> >> -#undef writeb >> +/* Access little-endian MMIO registers atomically without memory barrie= rs. */ >> + >> +#undef readb_relaxed >> +static inline uint8_t >> +readb_relaxed(const volatile void *addr) >> +{ >> + return (*(const volatile uint8_t *)addr); >> +} >> +#define readb_relaxed(addr) readb_relaxed(addr) >> + >> +#undef writeb_relaxed >> static inline void >> -writeb(uint8_t b, void *addr) >> +writeb_relaxed(uint8_t v, volatile void *addr) >> { >> - *(volatile uint8_t *)addr =3D b; >> + *(volatile uint8_t *)addr =3D v; >> } >> +#define writeb_relaxed(v, addr) writeb_relaxed(v, addr) >> >> -#undef writew >> +#undef readw_relaxed >> +static inline uint16_t >> +readw_relaxed(const volatile void *addr) >> +{ >> + return (*(const volatile uint16_t *)addr); >> +} >> +#define readw_relaxed(addr) readw_relaxed(addr) >> + >> +#undef writew_relaxed >> static inline void >> -writew(uint16_t b, void *addr) >> +writew_relaxed(uint16_t v, volatile void *addr) >> { >> - *(volatile uint16_t *)addr =3D b; >> + *(volatile uint16_t *)addr =3D v; >> } >> +#define writew_relaxed(v, addr) writew_relaxed(v, addr) >> >> +#undef readl_relaxed >> +static inline uint32_t >> +readl_relaxed(const volatile void *addr) >> +{ >> + return (*(const volatile uint32_t *)addr); >> +} >> +#define readl_relaxed(addr) readl_relaxed(addr) >> + >> +#undef writel_relaxed >> +static inline void >> +writel_relaxed(uint32_t v, volatile void *addr) >> +{ >> + *(volatile uint32_t *)addr =3D v; >> +} >> +#define writel_relaxed(v, addr) writel_relaxed(v, addr) >> + >> +#undef readq_relaxed >> +#undef writeq_relaxed >> +#ifdef __LP64__ >> +static inline uint64_t >> +readq_relaxed(const volatile void *addr) >> +{ >> + return (*(const volatile uint64_t *)addr); >> +} >> +#define readq_relaxed(addr) readq_relaxed(addr) >> + >> +static inline void >> +writeq_relaxed(uint64_t v, volatile void *addr) >> +{ >> + *(volatile uint64_t *)addr =3D v; >> +} >> +#define writeq_relaxed(v, addr) writeq_relaxed(v, addr) >> +#endif >> + >> +/* XXX On Linux ioread and iowrite handle both MMIO and port IO. */ >> + >> #undef ioread8 >> static inline uint8_t >> ioread8(const volatile void *addr) >> { >> - return *(const volatile uint8_t *)addr; >> + return (readb(addr)); >> } >> +#define ioread8(addr) ioread8(addr) >> >> #undef ioread16 >> static inline uint16_t >> ioread16(const volatile void *addr) >> { >> - return *(const volatile uint16_t *)addr; >> + return (readw(addr)); >> } >> +#define ioread16(addr) ioread16(addr) >> >> #undef ioread16be >> static inline uint16_t >> ioread16be(const volatile void *addr) >> { >> - return be16toh(*(const volatile uint16_t *)addr); >> + return (bswap16(readw(addr))); >> } >> +#define ioread16be(addr) ioread16be(addr) >> >> #undef ioread32 >> static inline uint32_t >> ioread32(const volatile void *addr) >> { >> - return *(const volatile uint32_t *)addr; >> + return (readl(addr)); >> } >> +#define ioread32(addr) ioread32(addr) >> >> #undef ioread32be >> static inline uint32_t >> ioread32be(const volatile void *addr) >> { >> - return be32toh(*(const volatile uint32_t *)addr); >> + return (bswap32(readl(addr))); >> } >> +#define ioread32be(addr) ioread32be(addr) >> >> #undef iowrite8 >> static inline void >> iowrite8(uint8_t v, volatile void *addr) >> { >> - *(volatile uint8_t *)addr =3D v; >> + writeb(v, addr); >> } >> +#define iowrite8(v, addr) iowrite8(v, addr) >> >> #undef iowrite16 >> static inline void >> iowrite16(uint16_t v, volatile void *addr) >> { >> - *(volatile uint16_t *)addr =3D v; >> + writew(v, addr); >> } >> +#define iowrite16 iowrite16 >> >> #undef iowrite32 >> static inline void >> iowrite32(uint32_t v, volatile void *addr) >> { >> - *(volatile uint32_t *)addr =3D v; >> + writel(v, addr); >> } >> +#define iowrite32(v, addr) iowrite32(v, addr) >> >> #undef iowrite32be >> static inline void >> iowrite32be(uint32_t v, volatile void *addr) >> { >> - *(volatile uint32_t *)addr =3D htobe32(v); >> + writel(bswap32(v), addr); >> } >> - >> -#undef readb >> -static inline uint8_t >> -readb(const volatile void *addr) >> -{ >> - return *(const volatile uint8_t *)addr; >> -} >> - >> -#undef readw >> -static inline uint16_t >> -readw(const volatile void *addr) >> -{ >> - return *(const volatile uint16_t *)addr; >> -} >> - >> -#undef readl >> -static inline uint32_t >> -readl(const volatile void *addr) >> -{ >> - return *(const volatile uint32_t *)addr; >> -} >> +#define iowrite32be(v, addr) iowrite32be(v, addr) >> >> #if defined(__i386__) || defined(__amd64__) >> static inline void >>