From owner-svn-src-all@freebsd.org Sun Nov 11 00:04:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 00:21:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 00:39:21 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 00:57:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 01:07:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 01:08:48 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 01:34:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 01:38:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 01:46:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 01:54:44 2018 Return-Path: Delivered-To: svn-src-all@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 7D190112417A for ; Sun, 11 Nov 2018 01:54:44 +0000 (UTC) (envelope-from wlosh@bsdimp.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 6964E86FCE for ; Sun, 11 Nov 2018 01:54:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x133.google.com with SMTP id v11so8762219itj.0 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=Nw2O4MvLAH2ZlXGC+tSpOJicDoL92xu4OiGhb2VwfToiZEW+4PVpDpkX5SYstDAXgh I6Bwx5LI3PwDJn3Ro9B/v3Egh/wFnTGb+8NvboLIbtTA0nz9oBa3SCv5HMFftFaFVO3/ K5NT7c2jw/f9c9E6LoaoNbJHLiNR/FJJeyUvHtV3EdHLl/FU39PIbCHfuiJ/zwWY/K9L buhsKvXdvsLAB60I1VQFG03NLYpTN4nvFdnyODBeIkpRq4WXAGnyurVSZeOX2TYWD1Zl lVzdVQz6+eLux9ZXbPR3quHoHcnvZ4SLLmalHa7gosdySWiZ8fc36f66V/PvO9Khe44G kwtg== X-Gm-Message-State: AGRZ1gIeOqTZtls0BRDuhh27YzPLA0zQ80l54foGeLdhZ6/Bj4pLDGz7 AS70P0p3rA3UcRUnRPCNiyy0GtFMC8Prs8MBu1KAHQ== 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: 6964E86FCE 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-all@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)[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]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 06:05:31 2018 Return-Path: Delivered-To: svn-src-all@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 B9766112C557; Sun, 11 Nov 2018 06:05:30 +0000 (UTC) (envelope-from dteske@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 3F80371362; Sun, 11 Nov 2018 06:05:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C13B6359; Sun, 11 Nov 2018 06:05:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAB65TB6052987; Sun, 11 Nov 2018 06:05:29 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAB65Tjp052983; Sun, 11 Nov 2018 06:05:29 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201811110605.wAB65Tjp052983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 11 Nov 2018 06:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340348 - in stable/12: libexec/rc share/man/man5 share/man/man8 X-SVN-Group: stable-12 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in stable/12: libexec/rc share/man/man5 share/man/man8 X-SVN-Commit-Revision: 340348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F80371362 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)[4]; 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.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 06:05:31 -0000 Author: dteske Date: Sun Nov 11 06:05:28 2018 New Revision: 340348 URL: https://svnweb.freebsd.org/changeset/base/340348 Log: MFC r339971: Add new rc keywords: enable, disable, delete This adds new keywords to rc/service to enable/disable a service's rc.conf(5) variable and "delete" to remove the variable. When the "service_delete_empty" variable in rc.conf(5) is set to "YES" (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is deleted if empty after modification using "service $foo delete". Submitted by: lme (modified) Reviewed by: 0mp (previous version), lme, bcr Approved by: re (rgrimes) Relnotes: yes Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D17113 Modified: stable/12/libexec/rc/rc.conf stable/12/libexec/rc/rc.subr stable/12/share/man/man5/rc.conf.5 stable/12/share/man/man8/rc.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.conf ============================================================================== --- stable/12/libexec/rc/rc.conf Sun Nov 11 01:46:48 2018 (r340347) +++ stable/12/libexec/rc/rc.conf Sun Nov 11 06:05:28 2018 (r340348) @@ -617,6 +617,7 @@ savecore_enable="YES" # Extract core from dump devices savecore_flags="-m 10" # Used if dumpdev is enabled above, and present. # By default, only the 10 most recent kernel dumps # are saved. +service_delete_empty="NO" # Have 'service delete' remove empty rc.conf.d files. crashinfo_enable="YES" # Automatically generate crash dump summary. crashinfo_program="/usr/sbin/crashinfo" # Script to generate crash dump summary. quota_enable="NO" # turn on quotas on startup (or NO). Modified: stable/12/libexec/rc/rc.subr ============================================================================== --- stable/12/libexec/rc/rc.subr Sun Nov 11 01:46:48 2018 (r340347) +++ stable/12/libexec/rc/rc.subr Sun Nov 11 06:05:28 2018 (r340348) @@ -922,7 +922,7 @@ run_rc_command() eval _override_command=\$${name}_program command=${_override_command:-$command} - _keywords="start stop restart rcvar enabled describe extracommands $extra_commands" + _keywords="start stop restart rcvar enable disable delete enabled describe extracommands $extra_commands" rc_pid= _pidcmd= _procname=${procname:-${command}} @@ -977,12 +977,13 @@ run_rc_command() if [ "$_elem" != "$rc_arg" ]; then continue fi - # if ${rcvar} is set, $1 is not "rcvar" and not "describe" - # and ${rc_pid} is not set, then run + # if ${rcvar} is set, $1 is not "rcvar", "describe", + # "enable" or "delete", and ${rc_pid} is not set, run: # checkyesno ${rcvar} # and return if that failed # if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != "stop" \ + -a "$rc_arg" != "delete" -a "$rc_arg" != "enable" \ -a "$rc_arg" != "describe" ] || [ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z "${rc_pid}" ]; then if ! checkyesno ${rcvar}; then @@ -1028,6 +1029,31 @@ run_rc_command() extracommands) echo "$extra_commands" + ;; + + enable) + _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=YES") && + echo "$name enabled in ${_out%%:*}" + ;; + + disable) + _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=NO") && + echo "$name disabled in ${_out%%:*}" + ;; + + delete) + _files= + for _file in $(sysrc -lEs "$name"); do + _out=$(sysrc -Fif $_file "$rcvar") && _files="$_files $_file" + done + /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar deleted in ${_files# }" + # delete file in rc.conf.d if desired and empty. + checkyesno service_delete_empty || _files= + for _file in $_files; do + [ "$_file" = "${_file#*/rc.conf.d/}" ] && continue + [ $(/usr/bin/stat -f%z $_file) -gt 0 ] && continue + /bin/rm "$_file" && echo "Empty file $_file removed" + done ;; status) Modified: stable/12/share/man/man5/rc.conf.5 ============================================================================== --- stable/12/share/man/man5/rc.conf.5 Sun Nov 11 01:46:48 2018 (r340347) +++ stable/12/share/man/man5/rc.conf.5 Sun Nov 11 06:05:28 2018 (r340348) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2018 +.Dd October 24, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -4511,6 +4511,14 @@ at boot time. The directory where the files exported by USB LUN are located. The default directory is .Pa /var/cfumass . +.It Va service_delete_empty +.Pq Vt bool +If set to +.Dq Li YES , +.Ql Li service delete +removes empty +.Dq Li rc.conf.d +files. .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact @@ -4599,6 +4607,7 @@ The default directory is .Xr rwhod 8 , .Xr savecore 8 , .Xr sdpd 8 , +.Xr service 8 , .Xr sshd 8 , .Xr swapon 8 , .Xr sysctl 8 , Modified: stable/12/share/man/man8/rc.8 ============================================================================== --- stable/12/share/man/man8/rc.8 Sun Nov 11 01:46:48 2018 (r340347) +++ stable/12/share/man/man8/rc.8 Sun Nov 11 06:05:28 2018 (r340348) @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd April 25, 2017 +.Dd September 18, 2018 .Dt RC 8 .Os .Sh NAME @@ -326,6 +326,21 @@ If the script starts a process (rather than performing operation), show the status of the process. Otherwise it is not necessary to support this argument. Defaults to displaying the process ID of the program (if running). +.It Cm enable +Enable the service in +.Xr rc.conf 5 . +.It Cm disable +Disable the service in +.Xr rc.conf 5 . +.It Cm delete +Remove the service from +.Xr rc.conf 5 . +If +.Ql Li service_delete_empty +is set to +.Dq Li YES , +.Pa /etc/rc.conf.d/$servicename +will be deleted if empty after modification. .It Cm describe Print a short description of what the script does. .It Cm extracommands From owner-svn-src-all@freebsd.org Sun Nov 11 06:49:06 2018 Return-Path: Delivered-To: svn-src-all@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 BB0B0112D601; Sun, 11 Nov 2018 06:49:06 +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 46C3D724AA; Sun, 11 Nov 2018 06:49:06 +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 24A1469F9; Sun, 11 Nov 2018 06:49:06 +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 wAB6n52I073289; Sun, 11 Nov 2018 06:49:05 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAB6n5XE073288; Sun, 11 Nov 2018 06:49:05 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811110649.wAB6n5XE073288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sun, 11 Nov 2018 06:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340349 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 340349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46C3D724AA 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)[4]; 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.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 06:49:06 -0000 Author: eugen Date: Sun Nov 11 06:49:05 2018 New Revision: 340349 URL: https://svnweb.freebsd.org/changeset/base/340349 Log: MFC r340249: ipfw.8: fix small syntax error in an example Modified: stable/11/sbin/ipfw/ipfw.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Sun Nov 11 06:05:28 2018 (r340348) +++ stable/11/sbin/ipfw/ipfw.8 Sun Nov 11 06:49:05 2018 (r340349) @@ -3899,7 +3899,7 @@ In the following example per-interface firewall is cre .Pp The following example illustrate usage of flow tables: .Pp -.Dl "ipfw table fl create type flow:flow:src-ip,proto,dst-ip,dst-port" +.Dl "ipfw table fl create type flow:src-ip,proto,dst-ip,dst-port" .Dl "ipfw table fl add 2a02:6b8:77::88,tcp,2a02:6b8:77::99,80 11" .Dl "ipfw table fl add 10.0.0.1,udp,10.0.0.2,53 12" .Dl ".." From owner-svn-src-all@freebsd.org Sun Nov 11 12:31:28 2018 Return-Path: Delivered-To: svn-src-all@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 469F31103024; Sun, 11 Nov 2018 12:31:28 +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 CAE617E478; Sun, 11 Nov 2018 12:31:27 +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 AA4BB12349; Sun, 11 Nov 2018 12:31:27 +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 wABCVR5E051961; Sun, 11 Nov 2018 12:31:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wABCVRHm051960; Sun, 11 Nov 2018 12:31:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811111231.wABCVRHm051960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 11 Nov 2018 12:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340350 - stable/12/sys/dev/sound/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/sound/usb X-SVN-Commit-Revision: 340350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAE617E478 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 12:31:28 -0000 Author: hselasky Date: Sun Nov 11 12:31:27 2018 New Revision: 340350 URL: https://svnweb.freebsd.org/changeset/base/340350 Log: MFC r340248: Don't read the USB audio sync endpoint when we don't use it to save isochronous bandwidth. Approved by: re (kib) Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/sound/usb/uaudio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/12/sys/dev/sound/usb/uaudio.c Sun Nov 11 06:49:05 2018 (r340349) +++ stable/12/sys/dev/sound/usb/uaudio.c Sun Nov 11 12:31:27 2018 (r340350) @@ -100,7 +100,7 @@ static int uaudio_default_channels = 0; /* use defaul static int uaudio_buffer_ms = 8; #ifdef USB_DEBUG -static int uaudio_debug = 0; +static int uaudio_debug; static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); @@ -136,6 +136,8 @@ uaudio_buffer_ms_sysctl(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), uaudio_buffer_ms_sysctl, "I", "uaudio buffering delay from 2ms to 8ms"); +#else +#define uaudio_debug 0 #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ @@ -2161,6 +2163,14 @@ uaudio_chan_play_sync_callback(struct usb_xfer *xfer, break; case USB_ST_SETUP: + /* + * Check if the recording stream can be used as a + * source of jitter information to save some + * isochronous bandwidth: + */ + if (ch->priv_sc->sc_rec_chan.num_alt != 0 && + uaudio_debug == 0) + break; usbd_xfer_set_frames(xfer, 1); usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_framelen(xfer)); usbd_transfer_submit(xfer); From owner-svn-src-all@freebsd.org Sun Nov 11 12:33:17 2018 Return-Path: Delivered-To: svn-src-all@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 8BEA7110326C; Sun, 11 Nov 2018 12:33: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 16D337E6C1; Sun, 11 Nov 2018 12:33: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 EBE5C1239B; Sun, 11 Nov 2018 12:33:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wABCXGCM053710; Sun, 11 Nov 2018 12:33:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wABCXGB9053709; Sun, 11 Nov 2018 12:33:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811111233.wABCXGB9053709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 11 Nov 2018 12:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340351 - stable/11/sys/dev/sound/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/sound/usb X-SVN-Commit-Revision: 340351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16D337E6C1 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)[4]; 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)[]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 12:33:17 -0000 Author: hselasky Date: Sun Nov 11 12:33:16 2018 New Revision: 340351 URL: https://svnweb.freebsd.org/changeset/base/340351 Log: MFC r340248: Don't read the USB audio sync endpoint when we don't use it to save isochronous bandwidth. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/sound/usb/uaudio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/11/sys/dev/sound/usb/uaudio.c Sun Nov 11 12:31:27 2018 (r340350) +++ stable/11/sys/dev/sound/usb/uaudio.c Sun Nov 11 12:33:16 2018 (r340351) @@ -98,7 +98,7 @@ static int uaudio_default_channels = 0; /* use defaul static int uaudio_buffer_ms = 8; #ifdef USB_DEBUG -static int uaudio_debug = 0; +static int uaudio_debug; static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); @@ -134,6 +134,8 @@ uaudio_buffer_ms_sysctl(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), uaudio_buffer_ms_sysctl, "I", "uaudio buffering delay from 2ms to 8ms"); +#else +#define uaudio_debug 0 #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ @@ -2159,6 +2161,14 @@ uaudio_chan_play_sync_callback(struct usb_xfer *xfer, break; case USB_ST_SETUP: + /* + * Check if the recording stream can be used as a + * source of jitter information to save some + * isochronous bandwidth: + */ + if (ch->priv_sc->sc_rec_chan.num_alt != 0 && + uaudio_debug == 0) + break; usbd_xfer_set_frames(xfer, 1); usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_framelen(xfer)); usbd_transfer_submit(xfer); From owner-svn-src-all@freebsd.org Sun Nov 11 12:34:20 2018 Return-Path: Delivered-To: svn-src-all@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 40BB41103316; Sun, 11 Nov 2018 12:34:20 +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 BD5AB7E81D; Sun, 11 Nov 2018 12:34:19 +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 9F5BA1239E; Sun, 11 Nov 2018 12:34:19 +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 wABCYJ7Y053809; Sun, 11 Nov 2018 12:34:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wABCYJ4d053808; Sun, 11 Nov 2018 12:34:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811111234.wABCYJ4d053808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 11 Nov 2018 12:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340352 - stable/10/sys/dev/sound/usb X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/sound/usb X-SVN-Commit-Revision: 340352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD5AB7E81D 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)[4]; 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)[]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 12:34:20 -0000 Author: hselasky Date: Sun Nov 11 12:34:19 2018 New Revision: 340352 URL: https://svnweb.freebsd.org/changeset/base/340352 Log: MFC r340248: Don't read the USB audio sync endpoint when we don't use it to save isochronous bandwidth. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/sound/usb/uaudio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.c Sun Nov 11 12:33:16 2018 (r340351) +++ stable/10/sys/dev/sound/usb/uaudio.c Sun Nov 11 12:34:19 2018 (r340352) @@ -98,7 +98,7 @@ static int uaudio_default_channels = 0; /* use defaul static int uaudio_buffer_ms = 8; #ifdef USB_DEBUG -static int uaudio_debug = 0; +static int uaudio_debug; static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); @@ -140,6 +140,8 @@ uaudio_buffer_ms_sysctl(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), uaudio_buffer_ms_sysctl, "I", "uaudio buffering delay from 2ms to 8ms"); +#else +#define uaudio_debug 0 #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ @@ -2165,6 +2167,14 @@ uaudio_chan_play_sync_callback(struct usb_xfer *xfer, break; case USB_ST_SETUP: + /* + * Check if the recording stream can be used as a + * source of jitter information to save some + * isochronous bandwidth: + */ + if (ch->priv_sc->sc_rec_chan.num_alt != 0 && + uaudio_debug == 0) + break; usbd_xfer_set_frames(xfer, 1); usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_framelen(xfer)); usbd_transfer_submit(xfer); From owner-svn-src-all@freebsd.org Sun Nov 11 12:35:31 2018 Return-Path: Delivered-To: svn-src-all@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 94FB111033EB; Sun, 11 Nov 2018 12:35:31 +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 0EBEF7E9C0; Sun, 11 Nov 2018 12:35:31 +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 E3E32123A3; Sun, 11 Nov 2018 12:35:30 +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 wABCZU3K053923; Sun, 11 Nov 2018 12:35:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wABCZUs3053922; Sun, 11 Nov 2018 12:35:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811111235.wABCZUs3053922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 11 Nov 2018 12:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r340353 - stable/9/sys/dev/sound/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/sound/usb X-SVN-Commit-Revision: 340353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0EBEF7E9C0 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)[4]; 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)[]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 12:35:31 -0000 Author: hselasky Date: Sun Nov 11 12:35:30 2018 New Revision: 340353 URL: https://svnweb.freebsd.org/changeset/base/340353 Log: MFC r340248: Don't read the USB audio sync endpoint when we don't use it to save isochronous bandwidth. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Sun Nov 11 12:34:19 2018 (r340352) +++ stable/9/sys/dev/sound/usb/uaudio.c Sun Nov 11 12:35:30 2018 (r340353) @@ -97,7 +97,7 @@ static int uaudio_default_bits = 32; static int uaudio_default_channels = 0; /* use default */ #ifdef USB_DEBUG -static int uaudio_debug = 0; +static int uaudio_debug; static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); @@ -115,6 +115,8 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTL TUNABLE_INT("hw.usb.uaudio.default_channels", &uaudio_default_channels); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RW, &uaudio_default_channels, 0, "uaudio default sample channels"); +#else +#define uaudio_debug 0 #endif #define UAUDIO_IRQS (8000 / UAUDIO_NFRAMES) /* interrupts per second */ @@ -2128,6 +2130,14 @@ uaudio_chan_play_sync_callback(struct usb_xfer *xfer, break; case USB_ST_SETUP: + /* + * Check if the recording stream can be used as a + * source of jitter information to save some + * isochronous bandwidth: + */ + if (ch->priv_sc->sc_rec_chan.num_alt != 0 && + uaudio_debug == 0) + break; usbd_xfer_set_frames(xfer, 1); usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_framelen(xfer)); usbd_transfer_submit(xfer); From owner-svn-src-all@freebsd.org Sun Nov 11 13:41:35 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Nov 11 19:15:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 02:40:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 05:24:21 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 07:14:36 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 09:12:51 2018 Return-Path: Delivered-To: svn-src-all@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 E240C11000C6 for ; Mon, 12 Nov 2018 09:12:50 +0000 (UTC) (envelope-from jose@webadminusa.com) Received: from mail-yw1-xc41.google.com (mail-yw1-xc41.google.com [IPv6:2607:f8b0:4864:20::c41]) (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 1CBE684ED4 for ; Mon, 12 Nov 2018 09:12:50 +0000 (UTC) (envelope-from jose@webadminusa.com) Received: by mail-yw1-xc41.google.com with SMTP id v199-v6so4136885ywg.1 for ; Mon, 12 Nov 2018 01:12:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=webadminusa-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=+0zIMuTmvk3i73+Kpd7elFqblaY1tNdqQqtzUnD5hMM=; b=fb2U4S1Az9fYjTEDRApn4DtzeezMb6ra6QfN2EjRk2KF6OD29qxbmMvDfLMTd3zW16 b66ZehjehN3VQqxyyRg74HPV3vFoyQ0eO0o2ITYw2cDiptZjc5NmkiIvGl00FYK0J3iN vUtH7qaW1advrxvuxaXKBj5CifrIpzzf/LVFieKh7MDgkEbLxs08OX4xAFxTj5dN9R2P SnZWkdD+eHsWjJWNXj97cZZH77AEkNGW4m8hXwnKHgjyHYCHa6IgG5WXR8Ua30hPK/MX 6Ojq2fcAABV1/93iPv2stXfEqDzKHj3NgfKtdBB/QNlsxWI/aGHG5Y89pfnYSSBvfXqh ynmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=+0zIMuTmvk3i73+Kpd7elFqblaY1tNdqQqtzUnD5hMM=; b=tNBYWbZTh5XRlCPu9lTrXx9kii+mymTq5nR6EdDLLuNGYmqb6LESV3Ms5kPINeEmwq B3gcIOwsghcI6BLBIJY+AOE+4PRGS598Tyus+ToJfr1zGfDs/yeWzsDA2sMuvlSSe1Pl LC7agm7g1g8aK5OlLzf7/tfLNxDlmDptEd0WFPQrHSHVx3j3gyiSCQ79IaZnfUv43CUH gLPVGWYeZjEuMRJ2NFw0TP5tFiK6N2vchuuI1tw01GCuRhugzgyeiGqlzv2AhJ9gqBLH tUy+p1FcjY+Mhwx0lkTVLH27uWaERhEt/3w+TCFhbruldYiLNLToLoH7lwmbqrs0gHLp M85w== X-Gm-Message-State: AGRZ1gKx3ozirNDmtd5LSli66g3+tStKReXekKGX/O0ZelYyIXlWF0rE 33fJSi46rkRYxpH11CJJG/skpYuiO/vMj3PVkdJqcN21 X-Google-Smtp-Source: AJdET5dQPTvcstj87Q8sFSAuoIMBbXVyNUtZA3xmVNZ51B7+t09DgzpKOcS2E+AjkS5HhHgsFBxtbi9izzoeWtnGpis= X-Received: by 2002:a0d:f185:: with SMTP id a127-v6mr105729ywf.330.1542013969403; Mon, 12 Nov 2018 01:12:49 -0800 (PST) Received: from 52669349336 named unknown by gmailapi.google.com with HTTPREST; Mon, 12 Nov 2018 01:12:48 -0800 MIME-Version: 1.0 Sender: Jose Quagliri From: Jose Quagliri Date: Mon, 12 Nov 2018 01:12:48 -0800 X-Google-Sender-Auth: DqtYSMl5XdKiFwcH3gBTFpdGIec Message-ID: Subject: What has happened to your gdeepak.com ? To: Svn-Src-All X-Rspamd-Queue-Id: 1CBE684ED4 X-Spamd-Result: default: False [-1.85 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.975,0]; R_DKIM_ALLOW(-0.20)[webadminusa-com.20150623.gappssmtp.com]; URL_IN_SUBJECT(0.40)[gdeepak.com]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[webadminusa.com]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.97)[-0.966,0]; MANY_INVISIBLE_PARTS(1.00)[10]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[webadminusa-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,alt4.aspmx.l.google.com,alt3.aspmx.l.google.com,alt2.aspmx.l.google.com,aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[1.4.c.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.80)[-0.796,0]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-1.00)[ipnet: 2607:f8b0::/32(-2.93), asn: 15169(-1.97), country: US(-0.09)] 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 09:12:51 -0000 Hello *gdeepak.com * Team, *Get your website on Google=E2=80=99s Front Page search:* I would like to disclose some facts about your website. I hope you won=E2= =80=99t mind spending only 2-3 minutes to have a look at the following lines: *We found some major issues with your website:* *1. *Your website seems to be attracting traffic, but this traffic is almost stagnant and limited, which affects potential sales as you move forward. *2. *Your website doesn't feature in Google's first search page for some of the major keywords in your niche, which affects visibility. *3.* Your website has been diagnosed with coding issues, which affects ranking. *4.* Your back links profile is not efficient enough to help your search engine visibility. *5.* Your website is currently not being properly promoted online, which is affecting your marketing strategy and goals. *6.* Your presence in social media platform (*Face book, Twitter, etc*.) is minimal. This is depriving you of a huge market of prospective referral clients. We excel in running promotional online marketing campaign for websites. We have a host of ethical services and techniques, which you can utilize to improve your website's performance. We could send you more details regarding your present website status; we would be glad to share *=E2=80=9C= PRE SEO REPORT=E2=80=9D or =E2=80=9CWEBSITE ANALYSIS REPORT for FREE=E2= =80=9D.* Let me know your thought and if possible give me the best time to make further discussion. Best Regards, *Jose Quagliri *| Senior Sales Advisor *--------------------------------------------------------------------------= -------------------------* *PS 1*: If you are *interested* then I will *send more details* on our *=E2= =80=9CSEO ROPOSAL=E2=80=9D* *and* =E2=80=9C*FREE WEBSITE ANALYSIS REPORT=E2=80=9D.* *PS 2*: I found your site using Google search and after having a look over your website I recommend you to implement future technologies such as *HTML 5 and Responsive Design* to make your site more accessible in mobile phone, tablets, desktop etc. From owner-svn-src-all@freebsd.org Mon Nov 12 09:30:53 2018 Return-Path: Delivered-To: svn-src-all@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 0A35E11007E8 for ; Mon, 12 Nov 2018 09:30:53 +0000 (UTC) (envelope-from info@archdeco.jp) Received: from sv3076.xserver.jp (sv3076.xserver.jp [202.254.234.77]) (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 5AED585ABD for ; Mon, 12 Nov 2018 09:30:52 +0000 (UTC) (envelope-from info@archdeco.jp) Received: from virusgw2401.xserver.jp (virusgw2401.xserver.jp [202.254.232.243]) by sv3076.xserver.jp (Postfix) with ESMTP id B003F115B0892E for ; Mon, 12 Nov 2018 18:22:03 +0900 (JST) Received: from sv3076.xserver.jp (202.254.234.77) by virusgw2401.xserver.jp (F-Secure/fsigk_smtp/521/virusgw2401.xserver.jp); Mon, 12 Nov 2018 18:22:03 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/521/virusgw2401.xserver.jp) Received: from WIN-2LPEFJ7HNBJ (ec2-52-199-66-0.ap-northeast-1.compute.amazonaws.com [52.199.66.0]) by sv3076.xserver.jp (Postfix) with ESMTPA id 8D0F51151834CF for ; Mon, 12 Nov 2018 18:22:03 +0900 (JST) From: "Charles Mayiga" Subject: AN INVESTMENT OFFER. To: svn-src-all@freebsd.org MIME-Version: 1.0 Reply-To: charlesmayiga@investportals.com Date: Mon, 12 Nov 2018 09:22:00 +0000 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Message-Id: <20181112092203.8D0F51151834CF@sv3076.xserver.jp> X-Rspamd-Queue-Id: 5AED585ABD X-Spamd-Result: default: False [7.51 / 200.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[charlesmayiga@investportals.com]; R_MISSING_CHARSET(2.50)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: archdeco.jp]; SUBJ_ALL_CAPS(1.50)[20]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:9371, ipnet:202.254.232.0/21, country:JP]; IP_SCORE(0.32)[asn: 9371(1.67), country: JP(-0.10)]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.32)[0.315,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[0.997,0]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[archdeco.jp]; NEURAL_SPAM_LONG(1.00)[0.996,0]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; R_SPF_NA(0.00)[]; GREYLIST(0.00)[pass,body] X-Rspamd-Server: mx1.freebsd.org X-Spam: Yes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 09:30:53 -0000 Greetings, We are international project financiers and we specialize in both star= t up projects and existing businesses needing funding or Loan for expa= nsion. We are committed to helping businesses develop and succeed. We will like to partner with you/your company should you be interested= or may require funding for the expansion of your business. We will be= glad to receiving your terms and condition before proceeding further. We are currently seeking means of expanding and relocating our busines= s interest and we are open for discussion to any lucrative investments= you can recommend to us which will be implemented under a blind trust= investment venture. Looking forward to hear from you. Sincere regards, Charles Mayiga. From owner-svn-src-all@freebsd.org Mon Nov 12 11:21:01 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 13:00:09 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 13:26:15 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 14:19:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 14:34:45 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 15:10:47 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 15:16:25 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 15:18:11 2018 Return-Path: Delivered-To: svn-src-all@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 64AA51108491; Mon, 12 Nov 2018 15:18:11 +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 B8D7672740; Mon, 12 Nov 2018 15:18:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 999BB226D8; Mon, 12 Nov 2018 15:18:10 +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 wACFIArL082721; Mon, 12 Nov 2018 15:18:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACFIA5d082719; Mon, 12 Nov 2018 15:18:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811121518.wACFIA5d082719@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 15:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340362 - in stable/12/sys: conf tools/fdt X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/sys: conf tools/fdt X-SVN-Commit-Revision: 340362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8D7672740 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)[4]; 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.936,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 15:18:11 -0000 Author: kevans Date: Mon Nov 12 15:18:09 2018 New Revision: 340362 URL: https://svnweb.freebsd.org/changeset/base/340362 Log: MFC r340297: Use ${ECHO} in dtb/dtbo build, pass in from dtb.mk for -s Approved by: re (kib) Modified: stable/12/sys/conf/dtb.mk stable/12/sys/tools/fdt/make_dtb.sh stable/12/sys/tools/fdt/make_dtbo.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/dtb.mk ============================================================================== --- stable/12/sys/conf/dtb.mk Mon Nov 12 13:26:13 2018 (r340361) +++ stable/12/sys/conf/dtb.mk Mon Nov 12 15:18:09 2018 (r340362) @@ -58,8 +58,8 @@ all: ${DTB} ${DTBO} .export DTC .for _dts in ${DTS} ${_dts:R:S/$/.dtb/}: ${_dts} ${OP_META} - @echo Generating ${.TARGET} from ${_dts} - @${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${_dts} ${.OBJDIR} + @${ECHO} Generating ${.TARGET} from ${_dts} + @env ECHO=${ECHO} ${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${_dts} ${.OBJDIR} CLEANFILES+=${_dts:R:S/$/.dtb/} .endfor .endif @@ -68,8 +68,8 @@ CLEANFILES+=${_dts:R:S/$/.dtb/} .export DTC .for _dtso in ${DTSO} ${_dtso:R:S/$/.dtbo/}: ${_dtso} ${OP_META} - @echo Generating ${.TARGET} from ${_dtso} - @${SYSDIR}/tools/fdt/make_dtbo.sh ${SYSDIR} overlays/${_dtso} ${.OBJDIR} + @${ECHO} Generating ${.TARGET} from ${_dtso} + @env ECHO=${ECHO} ${SYSDIR}/tools/fdt/make_dtbo.sh ${SYSDIR} overlays/${_dtso} ${.OBJDIR} CLEANFILES+=${_dtso:R:S/$/.dtbo/} .endfor .endif Modified: stable/12/sys/tools/fdt/make_dtb.sh ============================================================================== --- stable/12/sys/tools/fdt/make_dtb.sh Mon Nov 12 13:26:13 2018 (r340361) +++ stable/12/sys/tools/fdt/make_dtb.sh Mon Nov 12 15:18:09 2018 (r340362) @@ -17,10 +17,11 @@ if [ -z "${MACHINE}" ]; then fi : ${DTC:=dtc} +: ${ECHO:=echo} for d in ${dts}; do dtb=${dtb_path}/`basename $d .dts`.dtb - echo "converting $d -> $dtb" + ${ECHO} "converting $d -> $dtb" cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -I $S/gnu/dts/ -include $d /dev/null | ${DTC} -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} -i $S/gnu/dts/ done Modified: stable/12/sys/tools/fdt/make_dtbo.sh ============================================================================== --- stable/12/sys/tools/fdt/make_dtbo.sh Mon Nov 12 13:26:13 2018 (r340361) +++ stable/12/sys/tools/fdt/make_dtbo.sh Mon Nov 12 15:18:09 2018 (r340362) @@ -17,10 +17,11 @@ if [ -z "${MACHINE}" ]; then fi : ${DTC:=dtc} +: ${ECHO:=echo} for d in ${dtso}; do dtb=${dtbo_path}/`basename $d .dtso`.dtbo - echo "converting $d -> $dtb" + ${ECHO} "converting $d -> $dtb" cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | ${DTC} -@ -O dtb -o $dtb -i $S/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} done From owner-svn-src-all@freebsd.org Mon Nov 12 15:52:48 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 15:59:33 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 16:08:15 2018 Return-Path: Delivered-To: svn-src-all@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 8CFAF1109D26; Mon, 12 Nov 2018 16:08:15 +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 F219274CB1; Mon, 12 Nov 2018 16:08:14 +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 D2EE322F3D; Mon, 12 Nov 2018 16:08:14 +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 wACG8Ens008238; Mon, 12 Nov 2018 16:08:14 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACG8EUj008237; Mon, 12 Nov 2018 16:08:14 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811121608.wACG8EUj008237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 12 Nov 2018 16:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340365 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F219274CB1 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 16:08:15 -0000 Author: shurd Date: Mon Nov 12 16:08:14 2018 New Revision: 340365 URL: https://svnweb.freebsd.org/changeset/base/340365 Log: MFC r340236: Fix rxcsum issue introduced in r338838 r338838 attempted to fix issues with rxcsum and rxcsum6. However, the rxcsum bits were set as though if_setcapenablebit() was being called, not if_togglecapenable() which is in use. As a result, it was not possible to disable rxcsum when rxcsum6 was supported. PR: 233004 Reported by: lev Reviewed by: lev Approved by: re (kib) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17881 Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Mon Nov 12 15:59:32 2018 (r340364) +++ stable/12/sys/net/iflib.c Mon Nov 12 16:08:14 2018 (r340365) @@ -4256,18 +4256,13 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) setmask |= (mask & IFCAP_WOL); /* - * If we're disabling any RX csum, disable all the ones - * the driver supports. This assumes all supported are - * enabled. - * - * Otherwise, if they've changed, enable all of them. + * If any RX csum has changed, change all the ones that + * are supported by the driver. */ - if ((setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) < - (oldmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))) - setmask &= ~(IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); - else if ((setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) != - (oldmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))) - setmask |= (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)); + if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + setmask |= ctx->ifc_softc_ctx.isc_capabilities & + (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); + } /* * want to ensure that traffic has stopped before we change any of the flags From owner-svn-src-all@freebsd.org Mon Nov 12 16:28:09 2018 Return-Path: Delivered-To: svn-src-all@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 2AD70110A45A; Mon, 12 Nov 2018 16:28:09 +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 A9C9675966; Mon, 12 Nov 2018 16:28:08 +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 8627D23273; Mon, 12 Nov 2018 16:28:08 +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 wACGS84V018639; Mon, 12 Nov 2018 16:28:08 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACGS8mn018638; Mon, 12 Nov 2018 16:28:08 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811121628.wACGS8mn018638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 12 Nov 2018 16:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340366 - stable/12/sys/dev/e1000 X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/dev/e1000 X-SVN-Commit-Revision: 340366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9C9675966 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)[-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)]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 16:28:09 -0000 Author: shurd Date: Mon Nov 12 16:28:07 2018 New Revision: 340366 URL: https://svnweb.freebsd.org/changeset/base/340366 Log: MFC r340310: Fix first-packet completion The first packet after the ring is initialized was never completed as isc_txd_credits_update() would not include it in the count of completed packets. This caused netmap to never complete a batch. See PR 233022 for more details. PR: 233022 Reported by: lev Reviewed by: lev Approved by: re (kib) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17931 Modified: stable/12/sys/dev/e1000/em_txrx.c stable/12/sys/dev/e1000/igb_txrx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/e1000/em_txrx.c ============================================================================== --- stable/12/sys/dev/e1000/em_txrx.c Mon Nov 12 16:08:14 2018 (r340365) +++ stable/12/sys/dev/e1000/em_txrx.c Mon Nov 12 16:28:07 2018 (r340366) @@ -458,7 +458,13 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, b ntxd = scctx->isc_ntxd[0]; do { delta = (int32_t)cur - (int32_t)prev; + /* + * XXX This appears to be a hack for first-packet. + * A correct fix would prevent prev == cur in the first place. + */ MPASS(prev == 0 || delta != 0); + if (prev == 0 && cur == 0) + delta += 1; if (delta < 0) delta += ntxd; DPRINTF(iflib_get_dev(adapter->ctx), Modified: stable/12/sys/dev/e1000/igb_txrx.c ============================================================================== --- stable/12/sys/dev/e1000/igb_txrx.c Mon Nov 12 16:08:14 2018 (r340365) +++ stable/12/sys/dev/e1000/igb_txrx.c Mon Nov 12 16:28:07 2018 (r340366) @@ -333,7 +333,13 @@ igb_isc_txd_credits_update(void *arg, uint16_t txqid, ntxd = scctx->isc_ntxd[0]; do { delta = (int32_t)cur - (int32_t)prev; + /* + * XXX This appears to be a hack for first-packet. + * A correct fix would prevent prev == cur in the first place. + */ MPASS(prev == 0 || delta != 0); + if (prev == 0 && cur == 0) + delta += 1; if (delta < 0) delta += ntxd; From owner-svn-src-all@freebsd.org Mon Nov 12 16:37:24 2018 Return-Path: Delivered-To: svn-src-all@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 BC0B0110A7D7; Mon, 12 Nov 2018 16:37:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 2EB9475FB5; Mon, 12 Nov 2018 16:37:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1123823427; Mon, 12 Nov 2018 16:37:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACGbNik023949; Mon, 12 Nov 2018 16:37:23 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACGbN0K023947; Mon, 12 Nov 2018 16:37:23 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811121637.wACGbN0K023947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 12 Nov 2018 16:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340367 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 340367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EB9475FB5 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)[4]; 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)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 16:37:25 -0000 Author: bz Date: Mon Nov 12 16:37:23 2018 New Revision: 340367 URL: https://svnweb.freebsd.org/changeset/base/340367 Log: MFC r340251: Update rum(4) and run(4) man pages to reflect that newer versions of TP-LINK TL-WN321G are run(4) and not rum(4) anymore. Reported by: J (tech-lists zyxst.net) Approved by: re (kib) Modified: stable/12/share/man/man4/rum.4 stable/12/share/man/man4/run.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/rum.4 ============================================================================== --- stable/12/share/man/man4/rum.4 Mon Nov 12 16:28:07 2018 (r340366) +++ stable/12/share/man/man4/rum.4 Mon Nov 12 16:37:23 2018 (r340367) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 9, 2016 +.Dd November 8, 2018 .Dt RUM 4 .Os .Sh NAME @@ -123,7 +123,7 @@ including: .It "Sitecom WL-113 ver 2" Ta USB .It "Sitecom WL-172" Ta USB .It "Sweex LW053" Ta USB -.It "TP-LINK TL-WN321G" Ta USB +.It "TP-LINK TL-WN321G v1/v2/v3" Ta USB .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): Modified: stable/12/share/man/man4/run.4 ============================================================================== --- stable/12/share/man/man4/run.4 Mon Nov 12 16:28:07 2018 (r340366) +++ stable/12/share/man/man4/run.4 Mon Nov 12 16:37:23 2018 (r340367) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2018 +.Dd November 8, 2018 .Dt RUN 4 .Os .Sh NAME @@ -176,6 +176,7 @@ driver supports the following wireless adapters: .It Sweex LW303 .It Sweex LW313 .It TP-LINK TL-WDN3200 +.It TP-LINK TL-WN321G v4 .It TP-LINK TL-WN727N v3 .It Unex DNUR-81 .It Unex DNUR-82 From owner-svn-src-all@freebsd.org Mon Nov 12 16:43:55 2018 Return-Path: Delivered-To: svn-src-all@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 EF4A7110AAE7; Mon, 12 Nov 2018 16:43:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 79C0D76578; Mon, 12 Nov 2018 16:43:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AD68235B7; Mon, 12 Nov 2018 16:43:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACGhsHr028938; Mon, 12 Nov 2018 16:43:54 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACGhsk2028936; Mon, 12 Nov 2018 16:43:54 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811121643.wACGhsk2028936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 12 Nov 2018 16:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340369 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 340369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79C0D76578 X-Spamd-Result: default: False [-106.87 / 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(-0.99)[-0.990,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)]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 16:43:55 -0000 Author: bz Date: Mon Nov 12 16:43:53 2018 New Revision: 340369 URL: https://svnweb.freebsd.org/changeset/base/340369 Log: MFC r340251: Update rum(4) and run(4) man pages to reflect that newer versions of TP-LINK TL-WN321G are run(4) and not rum(4) anymore. Reported by: J (tech-lists zyxst.net) Modified: stable/11/share/man/man4/rum.4 stable/11/share/man/man4/run.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/rum.4 ============================================================================== --- stable/11/share/man/man4/rum.4 Mon Nov 12 16:41:41 2018 (r340368) +++ stable/11/share/man/man4/rum.4 Mon Nov 12 16:43:53 2018 (r340369) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 9, 2016 +.Dd November 8, 2018 .Dt RUM 4 .Os .Sh NAME @@ -123,7 +123,7 @@ including: .It "Sitecom WL-113 ver 2" Ta USB .It "Sitecom WL-172" Ta USB .It "Sweex LW053" Ta USB -.It "TP-LINK TL-WN321G" Ta USB +.It "TP-LINK TL-WN321G v1/v2/v3" Ta USB .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): Modified: stable/11/share/man/man4/run.4 ============================================================================== --- stable/11/share/man/man4/run.4 Mon Nov 12 16:41:41 2018 (r340368) +++ stable/11/share/man/man4/run.4 Mon Nov 12 16:43:53 2018 (r340369) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 19, 2015 +.Dd November 8, 2018 .Dt RUN 4 .Os .Sh NAME @@ -175,6 +175,7 @@ driver supports the following wireless adapters: .It Sweex LW303 .It Sweex LW313 .It TP-LINK TL-WDN3200 +.It TP-LINK TL-WN321G v4 .It TP-LINK TL-WN727N v3 .It Unex DNUR-81 .It Unex DNUR-82 From owner-svn-src-all@freebsd.org Mon Nov 12 16:44:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 16:49:08 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 16:50:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 16:55:21 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 17:10:45 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 17:40:49 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 17:47:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 17:52:15 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 17:55:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 17:57:13 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 17:59:17 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 18:01:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 18:21:19 2018 Return-Path: Delivered-To: svn-src-all@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 6A13C110D863; Mon, 12 Nov 2018 18:21:19 +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 EA7007BEF1; Mon, 12 Nov 2018 18:21:18 +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 CCFDE2457B; Mon, 12 Nov 2018 18:21:18 +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 wACILIF2078356; Mon, 12 Nov 2018 18:21:18 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACILHcd077656; Mon, 12 Nov 2018 18:21:17 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811121821.wACILHcd077656@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 18:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340378 - in stable/12/sys: compat/freebsd32 kern X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 340378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA7007BEF1 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)[4]; 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.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 18:21:19 -0000 Author: brooks Date: Mon Nov 12 18:21:17 2018 New Revision: 340378 URL: https://svnweb.freebsd.org/changeset/base/340378 Log: MFC r340272, r340274, r340294 r340272: Make __sysctl follow the freebsd32_foo convention. Sponsored by: DARPA, AFRL r340274: Make freebsd32_umtx_op follow the freebsd32_foo convention. Sponsored by: DARPA, AFRL r340294: Fix a number of bugs in freebsd32's capabilities.conf. Bugs range from failure to update after changing syscall implementaion names to using the wrong name. Somewhat confusingly, the name in capabilities.conf is exactly the string that appears in syscalls.master, not the name with a COMPAT* prefix which is the actual function name. Found while making a change to use the default capabilities.conf. Fixes: r335177, r336980, r340272, r340274, others Reviewed by: kib, emaste Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17925 Modified: stable/12/sys/compat/freebsd32/capabilities.conf stable/12/sys/compat/freebsd32/freebsd32_misc.c stable/12/sys/compat/freebsd32/syscalls.master stable/12/sys/kern/kern_umtx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/freebsd32/capabilities.conf ============================================================================== --- stable/12/sys/compat/freebsd32/capabilities.conf Mon Nov 12 18:01:36 2018 (r340377) +++ stable/12/sys/compat/freebsd32/capabilities.conf Mon Nov 12 18:21:17 2018 (r340378) @@ -47,14 +47,14 @@ __mac_get_fd __mac_get_proc __mac_set_fd __mac_set_proc -freebsd32_sysctl -freebsd32_umtx_op +freebsd32___sysctl +freebsd32__umtx_op abort2 accept accept4 aio_cancel freebsd32_aio_error -aio_fsync +freebsd32_aio_fsync freebsd32_aio_read freebsd32_aio_return freebsd32_aio_suspend @@ -94,17 +94,18 @@ freebsd32_fexecve flock fork fpathconf -freebsd11_freebsd32_fstat -freebsd11_freebsd32_fstatat -freebsd11_freebsd32_getdirentries -freebsd11_freebsd32_fstatfs -freebsd11_freebsd32_mknodat -freebsd6_freebsd32_ftruncate -freebsd6_freebsd32_lseek -freebsd6_freebsd32_mmap -freebsd6_freebsd32_pread -freebsd6_freebsd32_pwrite freebsd32_fstat +freebsd32_fstatat +freebsd32_getdirentries +freebsd32_fstatfs +freebsd32_mknodat +freebsd32_ftruncate +freebsd32_lseek +freebsd32_mmap +mmap +freebsd32_pread +freebsd32_pwrite +freebsd32_fstat fstatfs fsync ftruncate @@ -115,7 +116,7 @@ getaudit getaudit_addr getauid freebsd32_getcontext -getdents +freebsd32_getdents freebsd32_getdirentries getdirentries getdomainname @@ -178,7 +179,7 @@ freebsd32_nanosleep ntp_gettime freebsd6_freebsd32_aio_read freebsd6_freebsd32_aio_write -obreak +break freebsd6_freebsd32_lio_listio chflagsat faccessat @@ -222,7 +223,7 @@ sched_get_priority_max sched_get_priority_min sched_getparam sched_getscheduler -sched_rr_get_interval +freebsd32_sched_rr_get_interval sched_setparam sched_setscheduler sched_yield @@ -259,11 +260,15 @@ freebsd32_sigaction freebsd32_sigaltstack freebsd32_sigblock freebsd32_sigpending +sigpending +freebsd32_sigprocmask sigprocmask +freebsd32_sigqueue sigqueue freebsd32_sigreturn freebsd32_sigsetmask -ofreebsd32_sigstack +freebsd32_sigstack +freebsd32_sigsuspend sigsuspend freebsd32_sigtimedwait freebsd32_sigvec Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 12 18:01:36 2018 (r340377) +++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 12 18:21:17 2018 (r340378) @@ -2260,7 +2260,7 @@ freebsd11_freebsd32_fhstat(struct thread *td, #endif int -freebsd32_sysctl(struct thread *td, struct freebsd32_sysctl_args *uap) +freebsd32___sysctl(struct thread *td, struct freebsd32___sysctl_args *uap) { int error, name[CTL_MAXNAME]; size_t j, oldlen; Modified: stable/12/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/12/sys/compat/freebsd32/syscalls.master Mon Nov 12 18:01:36 2018 (r340377) +++ stable/12/sys/compat/freebsd32/syscalls.master Mon Nov 12 18:21:17 2018 (r340378) @@ -377,7 +377,7 @@ uint32_t length2); } 201 AUE_FTRUNCATE COMPAT6 { int freebsd32_ftruncate(int fd, int pad, \ uint32_t length1, uint32_t length2); } -202 AUE_SYSCTL STD { int freebsd32_sysctl(int *name, \ +202 AUE_SYSCTL STD { int freebsd32___sysctl(int *name, \ u_int namelen, void *old, \ uint32_t *oldlenp, void *new, \ uint32_t newlen); } @@ -809,7 +809,7 @@ struct auditinfo_addr *auditinfo_addr, \ u_int length); } 453 AUE_AUDITCTL NOPROTO { int auditctl(char *path); } -454 AUE_NULL STD { int freebsd32_umtx_op(void *obj, int op,\ +454 AUE_NULL STD { int freebsd32__umtx_op(void *obj, int op,\ u_long val, void *uaddr, \ void *uaddr2); } 455 AUE_THR_NEW STD { int freebsd32_thr_new( \ Modified: stable/12/sys/kern/kern_umtx.c ============================================================================== --- stable/12/sys/kern/kern_umtx.c Mon Nov 12 18:01:36 2018 (r340377) +++ stable/12/sys/kern/kern_umtx.c Mon Nov 12 18:21:17 2018 (r340378) @@ -4351,7 +4351,7 @@ static const _umtx_op_func op_table_compat32[] = { }; int -freebsd32_umtx_op(struct thread *td, struct freebsd32_umtx_op_args *uap) +freebsd32__umtx_op(struct thread *td, struct freebsd32__umtx_op_args *uap) { if ((unsigned)uap->op < nitems(op_table_compat32)) { From owner-svn-src-all@freebsd.org Mon Nov 12 18:23:53 2018 Return-Path: Delivered-To: svn-src-all@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 A93D9110D8FC; Mon, 12 Nov 2018 18:23:53 +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 366717C25F; Mon, 12 Nov 2018 18:23:53 +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 16882246CA; Mon, 12 Nov 2018 18:23:53 +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 wACINrOL080735; Mon, 12 Nov 2018 18:23:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACINqEX080731; Mon, 12 Nov 2018 18:23:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811121823.wACINqEX080731@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 18:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340379 - stable/12/sys/compat/freebsd32 X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/compat/freebsd32 X-SVN-Commit-Revision: 340379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 366717C25F 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)[4]; 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.90), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 18:23:53 -0000 Author: brooks Date: Mon Nov 12 18:23:51 2018 New Revision: 340379 URL: https://svnweb.freebsd.org/changeset/base/340379 Log: Regen after r340377: MFC r340272, r340274, r340294 r340272: Make __sysctl follow the freebsd32_foo convention. r340274: Make freebsd32_umtx_op follow the freebsd32_foo convention. r340294: Fix a number of bugs in freebsd32's capabilities.conf. Approved by: re (gjb, implicit) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17925 Modified: stable/12/sys/compat/freebsd32/freebsd32_proto.h stable/12/sys/compat/freebsd32/freebsd32_syscall.h stable/12/sys/compat/freebsd32/freebsd32_syscalls.c stable/12/sys/compat/freebsd32/freebsd32_sysent.c stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: stable/12/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 12 18:21:17 2018 (r340378) +++ stable/12/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 12 18:23:51 2018 (r340379) @@ -162,7 +162,7 @@ struct freebsd32_shmsys_args { char a3_l_[PADL_(uint32_t)]; uint32_t a3; char a3_r_[PADR_(uint32_t)]; char a4_l_[PADL_(uint32_t)]; uint32_t a4; char a4_r_[PADR_(uint32_t)]; }; -struct freebsd32_sysctl_args { +struct freebsd32___sysctl_args { char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; @@ -350,7 +350,7 @@ struct freebsd32_ksem_timedwait_args { struct freebsd32_thr_suspend_args { char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; }; -struct freebsd32_umtx_op_args { +struct freebsd32__umtx_op_args { char obj_l_[PADL_(void *)]; void * obj; char obj_r_[PADR_(void *)]; char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; char val_l_[PADL_(u_long)]; u_long val; char val_r_[PADR_(u_long)]; @@ -736,7 +736,7 @@ int freebsd32_sysarch(struct thread *, struct freebsd3 int freebsd32_semsys(struct thread *, struct freebsd32_semsys_args *); int freebsd32_msgsys(struct thread *, struct freebsd32_msgsys_args *); int freebsd32_shmsys(struct thread *, struct freebsd32_shmsys_args *); -int freebsd32_sysctl(struct thread *, struct freebsd32_sysctl_args *); +int freebsd32___sysctl(struct thread *, struct freebsd32___sysctl_args *); int freebsd32_futimes(struct thread *, struct freebsd32_futimes_args *); int freebsd32_msgsnd(struct thread *, struct freebsd32_msgsnd_args *); int freebsd32_msgrcv(struct thread *, struct freebsd32_msgrcv_args *); @@ -776,7 +776,7 @@ int freebsd32_setcontext(struct thread *, struct freeb int freebsd32_swapcontext(struct thread *, struct freebsd32_swapcontext_args *); int freebsd32_ksem_timedwait(struct thread *, struct freebsd32_ksem_timedwait_args *); int freebsd32_thr_suspend(struct thread *, struct freebsd32_thr_suspend_args *); -int freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *); +int freebsd32__umtx_op(struct thread *, struct freebsd32__umtx_op_args *); int freebsd32_thr_new(struct thread *, struct freebsd32_thr_new_args *); int freebsd32_sigqueue(struct thread *, struct freebsd32_sigqueue_args *); int freebsd32_kmq_open(struct thread *, struct freebsd32_kmq_open_args *); @@ -1282,7 +1282,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lseek AUE_LSEEK #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_truncate AUE_TRUNCATE #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_ftruncate AUE_FTRUNCATE -#define FREEBSD32_SYS_AUE_freebsd32_sysctl AUE_SYSCTL +#define FREEBSD32_SYS_AUE_freebsd32___sysctl AUE_SYSCTL #define FREEBSD32_SYS_AUE_freebsd32_futimes AUE_FUTIMES #define FREEBSD32_SYS_AUE_freebsd7_freebsd32_semctl AUE_SEMCTL #define FREEBSD32_SYS_AUE_freebsd7_freebsd32_msgctl AUE_MSGCTL @@ -1335,7 +1335,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_swapcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_ksem_timedwait AUE_SEMWAIT #define FREEBSD32_SYS_AUE_freebsd32_thr_suspend AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_umtx_op AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32__umtx_op AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_thr_new AUE_THR_NEW #define FREEBSD32_SYS_AUE_freebsd32_sigqueue AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_kmq_open AUE_MQ_OPEN Modified: stable/12/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_syscall.h Mon Nov 12 18:21:17 2018 (r340378) +++ stable/12/sys/compat/freebsd32/freebsd32_syscall.h Mon Nov 12 18:23:51 2018 (r340379) @@ -188,7 +188,7 @@ /* 199 is freebsd6 freebsd32_lseek */ /* 200 is freebsd6 freebsd32_truncate */ /* 201 is freebsd6 freebsd32_ftruncate */ -#define FREEBSD32_SYS_freebsd32_sysctl 202 +#define FREEBSD32_SYS_freebsd32___sysctl 202 #define FREEBSD32_SYS_mlock 203 #define FREEBSD32_SYS_munlock 204 #define FREEBSD32_SYS_undelete 205 @@ -374,7 +374,7 @@ #define FREEBSD32_SYS_getaudit_addr 451 #define FREEBSD32_SYS_setaudit_addr 452 #define FREEBSD32_SYS_auditctl 453 -#define FREEBSD32_SYS_freebsd32_umtx_op 454 +#define FREEBSD32_SYS_freebsd32__umtx_op 454 #define FREEBSD32_SYS_freebsd32_thr_new 455 #define FREEBSD32_SYS_freebsd32_sigqueue 456 #define FREEBSD32_SYS_freebsd32_kmq_open 457 Modified: stable/12/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_syscalls.c Mon Nov 12 18:21:17 2018 (r340378) +++ stable/12/sys/compat/freebsd32/freebsd32_syscalls.c Mon Nov 12 18:23:51 2018 (r340379) @@ -211,7 +211,7 @@ const char *freebsd32_syscallnames[] = { "compat6.freebsd32_lseek", /* 199 = freebsd6 freebsd32_lseek */ "compat6.freebsd32_truncate", /* 200 = freebsd6 freebsd32_truncate */ "compat6.freebsd32_ftruncate", /* 201 = freebsd6 freebsd32_ftruncate */ - "freebsd32_sysctl", /* 202 = freebsd32_sysctl */ + "freebsd32___sysctl", /* 202 = freebsd32___sysctl */ "mlock", /* 203 = mlock */ "munlock", /* 204 = munlock */ "undelete", /* 205 = undelete */ @@ -463,7 +463,7 @@ const char *freebsd32_syscallnames[] = { "getaudit_addr", /* 451 = getaudit_addr */ "setaudit_addr", /* 452 = setaudit_addr */ "auditctl", /* 453 = auditctl */ - "freebsd32_umtx_op", /* 454 = freebsd32_umtx_op */ + "freebsd32__umtx_op", /* 454 = freebsd32__umtx_op */ "freebsd32_thr_new", /* 455 = freebsd32_thr_new */ "freebsd32_sigqueue", /* 456 = freebsd32_sigqueue */ "freebsd32_kmq_open", /* 457 = freebsd32_kmq_open */ Modified: stable/12/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_sysent.c Mon Nov 12 18:21:17 2018 (r340378) +++ stable/12/sys/compat/freebsd32/freebsd32_sysent.c Mon Nov 12 18:23:51 2018 (r340379) @@ -73,7 +73,7 @@ struct sysent freebsd32_sysent[] = { { compat11(AS(freebsd11_freebsd32_mknod_args),freebsd32_mknod), AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = freebsd11 freebsd32_mknod */ { AS(chmod_args), (sy_call_t *)sys_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)sys_chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */ - { AS(break_args), (sy_call_t *)sys_break, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */ + { AS(break_args), (sy_call_t *)sys_break, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = break */ { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 freebsd32_getfsstat */ { compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 19 = old freebsd32_lseek */ { 0, (sy_call_t *)sys_getpid, AUE_GETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 20 = getpid */ @@ -104,7 +104,7 @@ struct sysent freebsd32_sysent[] = { { AS(ktrace_args), (sy_call_t *)sys_ktrace, AUE_KTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ktrace */ { compat(AS(ofreebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = old freebsd32_sigaction */ { 0, (sy_call_t *)sys_getgid, AUE_GETGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = getgid */ - { compat(AS(ofreebsd32_sigprocmask_args),freebsd32_sigprocmask), AUE_SIGPROCMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = old freebsd32_sigprocmask */ + { compat(AS(ofreebsd32_sigprocmask_args),freebsd32_sigprocmask), AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = old freebsd32_sigprocmask */ { AS(getlogin_args), (sy_call_t *)sys_getlogin, AUE_GETLOGIN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = getlogin */ { AS(setlogin_args), (sy_call_t *)sys_setlogin, AUE_SETLOGIN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = setlogin */ { AS(acct_args), (sy_call_t *)sys_acct, AUE_ACCT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 51 = acct */ @@ -127,7 +127,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 68 = obsolete vwrite */ { AS(sbrk_args), (sy_call_t *)sys_sbrk, AUE_SBRK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 69 = sbrk */ { AS(sstk_args), (sy_call_t *)sys_sstk, AUE_SSTK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 70 = sstk */ - { compat(AS(ommap_args),mmap), AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 71 = old mmap */ + { compat(AS(ommap_args),mmap), AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 71 = old mmap */ { compat11(AS(freebsd11_vadvise_args),vadvise), AUE_O_VADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 72 = freebsd11 vadvise */ { AS(munmap_args), (sy_call_t *)sys_munmap, AUE_MUNMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 73 = munmap */ { AS(freebsd32_mprotect_args), (sy_call_t *)freebsd32_mprotect, AUE_MPROTECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 74 = freebsd32_mprotect */ @@ -167,8 +167,8 @@ struct sysent freebsd32_sysent[] = { { compat(AS(ofreebsd32_sigvec_args),freebsd32_sigvec), AUE_O_SIGVEC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 108 = old freebsd32_sigvec */ { compat(AS(ofreebsd32_sigblock_args),freebsd32_sigblock), AUE_O_SIGBLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 109 = old freebsd32_sigblock */ { compat(AS(ofreebsd32_sigsetmask_args),freebsd32_sigsetmask), AUE_O_SIGSETMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 110 = old freebsd32_sigsetmask */ - { compat(AS(ofreebsd32_sigsuspend_args),freebsd32_sigsuspend), AUE_SIGSUSPEND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 111 = old freebsd32_sigsuspend */ - { compat(AS(ofreebsd32_sigstack_args),freebsd32_sigstack), AUE_O_SIGSTACK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 112 = old freebsd32_sigstack */ + { compat(AS(ofreebsd32_sigsuspend_args),freebsd32_sigsuspend), AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 111 = old freebsd32_sigsuspend */ + { compat(AS(ofreebsd32_sigstack_args),freebsd32_sigstack), AUE_O_SIGSTACK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 112 = old freebsd32_sigstack */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 113 = obsolete orecvmsg */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 114 = obsolete osendmsg */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 115 = obsolete vtrace */ @@ -214,7 +214,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 155 = nfssvc */ { compat(AS(ofreebsd32_getdirentries_args),freebsd32_getdirentries), AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 156 = old freebsd32_getdirentries */ { compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = freebsd4 freebsd32_statfs */ - { compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = freebsd4 freebsd32_fstatfs */ + { compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 158 = freebsd4 freebsd32_fstatfs */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 159 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 160 = lgetfh */ { AS(getfh_args), (sy_call_t *)sys_getfh, AUE_NFS_GETFH, NULL, 0, 0, 0, SY_THR_STATIC }, /* 161 = getfh */ @@ -258,7 +258,7 @@ struct sysent freebsd32_sysent[] = { { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 199 = freebsd6 freebsd32_lseek */ { compat6(AS(freebsd6_freebsd32_truncate_args),freebsd32_truncate), AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 200 = freebsd6 freebsd32_truncate */ { compat6(AS(freebsd6_freebsd32_ftruncate_args),freebsd32_ftruncate), AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 201 = freebsd6 freebsd32_ftruncate */ - { AS(freebsd32_sysctl_args), (sy_call_t *)freebsd32_sysctl, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 202 = freebsd32_sysctl */ + { AS(freebsd32___sysctl_args), (sy_call_t *)freebsd32___sysctl, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 202 = freebsd32___sysctl */ { AS(mlock_args), (sy_call_t *)sys_mlock, AUE_MLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 203 = mlock */ { AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 204 = munlock */ { AS(undelete_args), (sy_call_t *)sys_undelete, AUE_UNDELETE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 205 = undelete */ @@ -328,7 +328,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 269 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 270 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 271 = nosys */ - { compat11(AS(freebsd11_freebsd32_getdents_args),freebsd32_getdents), AUE_O_GETDENTS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = freebsd11 freebsd32_getdents */ + { compat11(AS(freebsd11_freebsd32_getdents_args),freebsd32_getdents), AUE_O_GETDENTS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 272 = freebsd11 freebsd32_getdents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = nosys */ { AS(lchmod_args), (sy_call_t *)sys_lchmod, AUE_LCHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = lchmod */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 275 = obsolete netbsd_lchown */ @@ -390,7 +390,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 331 = sched_yield */ { AS(sched_get_priority_max_args), (sy_call_t *)sys_sched_get_priority_max, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 332 = sched_get_priority_max */ { AS(sched_get_priority_min_args), (sy_call_t *)sys_sched_get_priority_min, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 333 = sched_get_priority_min */ - { AS(freebsd32_sched_rr_get_interval_args), (sy_call_t *)freebsd32_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = freebsd32_sched_rr_get_interval */ + { AS(freebsd32_sched_rr_get_interval_args), (sy_call_t *)freebsd32_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 334 = freebsd32_sched_rr_get_interval */ { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 freebsd32_sendfile */ { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ @@ -399,7 +399,7 @@ struct sysent freebsd32_sysent[] = { { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 342 = freebsd4 freebsd32_sigaction */ - { AS(sigpending_args), (sy_call_t *)sys_sigpending, AUE_SIGPENDING, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = sigpending */ + { AS(sigpending_args), (sy_call_t *)sys_sigpending, AUE_SIGPENDING, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 343 = sigpending */ { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 344 = freebsd4 freebsd32_sigreturn */ { AS(freebsd32_sigtimedwait_args), (sy_call_t *)freebsd32_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 345 = freebsd32_sigtimedwait */ { AS(freebsd32_sigwaitinfo_args), (sy_call_t *)freebsd32_sigwaitinfo, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 346 = freebsd32_sigwaitinfo */ @@ -510,9 +510,9 @@ struct sysent freebsd32_sysent[] = { { AS(getaudit_addr_args), (sy_call_t *)sys_getaudit_addr, AUE_GETAUDIT_ADDR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 451 = getaudit_addr */ { AS(setaudit_addr_args), (sy_call_t *)sys_setaudit_addr, AUE_SETAUDIT_ADDR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 452 = setaudit_addr */ { AS(auditctl_args), (sy_call_t *)sys_auditctl, AUE_AUDITCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 453 = auditctl */ - { AS(freebsd32_umtx_op_args), (sy_call_t *)freebsd32_umtx_op, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 454 = freebsd32_umtx_op */ + { AS(freebsd32__umtx_op_args), (sy_call_t *)freebsd32__umtx_op, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 454 = freebsd32__umtx_op */ { AS(freebsd32_thr_new_args), (sy_call_t *)freebsd32_thr_new, AUE_THR_NEW, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = freebsd32_thr_new */ - { AS(freebsd32_sigqueue_args), (sy_call_t *)freebsd32_sigqueue, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 456 = freebsd32_sigqueue */ + { AS(freebsd32_sigqueue_args), (sy_call_t *)freebsd32_sigqueue, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 456 = freebsd32_sigqueue */ { AS(freebsd32_kmq_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 457 = freebsd32_kmq_open */ { AS(freebsd32_kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 458 = freebsd32_kmq_setattr */ { AS(freebsd32_kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 459 = freebsd32_kmq_timedreceive */ @@ -521,7 +521,7 @@ struct sysent freebsd32_sysent[] = { { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 464 = thr_set_name */ - { AS(freebsd32_aio_fsync_args), (sy_call_t *)freebsd32_aio_fsync, AUE_AIO_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 465 = freebsd32_aio_fsync */ + { AS(freebsd32_aio_fsync_args), (sy_call_t *)freebsd32_aio_fsync, AUE_AIO_FSYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 465 = freebsd32_aio_fsync */ { AS(rtprio_thread_args), (sy_call_t *)sys_rtprio_thread, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 466 = rtprio_thread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 467 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */ @@ -567,7 +567,7 @@ struct sysent freebsd32_sysent[] = { { AS(linkat_args), (sy_call_t *)sys_linkat, AUE_LINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 495 = linkat */ { AS(mkdirat_args), (sy_call_t *)sys_mkdirat, AUE_MKDIRAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 496 = mkdirat */ { AS(mkfifoat_args), (sy_call_t *)sys_mkfifoat, AUE_MKFIFOAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 497 = mkfifoat */ - { compat11(AS(freebsd11_freebsd32_mknodat_args),freebsd32_mknodat), AUE_MKNODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 498 = freebsd11 freebsd32_mknodat */ + { compat11(AS(freebsd11_freebsd32_mknodat_args),freebsd32_mknodat), AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 498 = freebsd11 freebsd32_mknodat */ { AS(openat_args), (sy_call_t *)sys_openat, AUE_OPENAT_RWTC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 499 = openat */ { AS(readlinkat_args), (sy_call_t *)sys_readlinkat, AUE_READLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 500 = readlinkat */ { AS(renameat_args), (sy_call_t *)sys_renameat, AUE_RENAMEAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 501 = renameat */ Modified: stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Nov 12 18:21:17 2018 (r340378) +++ stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Nov 12 18:23:51 2018 (r340379) @@ -935,9 +935,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 0; break; } - /* freebsd32_sysctl */ + /* freebsd32___sysctl */ case 202: { - struct freebsd32_sysctl_args *p = params; + struct freebsd32___sysctl_args *p = params; uarg[0] = (intptr_t) p->name; /* int * */ uarg[1] = p->namelen; /* u_int */ uarg[2] = (intptr_t) p->old; /* void * */ @@ -2182,9 +2182,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } - /* freebsd32_umtx_op */ + /* freebsd32__umtx_op */ case 454: { - struct freebsd32_umtx_op_args *p = params; + struct freebsd32__umtx_op_args *p = params; uarg[0] = (intptr_t) p->obj; /* void * */ iarg[1] = p->op; /* int */ uarg[2] = p->val; /* u_long */ @@ -4755,7 +4755,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d /* nosys */ case 198: break; - /* freebsd32_sysctl */ + /* freebsd32___sysctl */ case 202: switch(ndx) { case 0: @@ -6765,7 +6765,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* freebsd32_umtx_op */ + /* freebsd32__umtx_op */ case 454: switch(ndx) { case 0: @@ -9305,7 +9305,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* nosys */ case 198: - /* freebsd32_sysctl */ + /* freebsd32___sysctl */ case 202: if (ndx == 0 || ndx == 1) p = "int"; @@ -10040,7 +10040,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* freebsd32_umtx_op */ + /* freebsd32__umtx_op */ case 454: if (ndx == 0 || ndx == 1) p = "int"; From owner-svn-src-all@freebsd.org Mon Nov 12 18:34:56 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 18:37:33 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 18:43:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 19:12:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 19:17:28 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 20:38:45 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 20:44:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 21:01:30 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 21:51:38 2018 Return-Path: Delivered-To: svn-src-all@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 7CD6111242FE; Mon, 12 Nov 2018 21:51:38 +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 F280785ED0; Mon, 12 Nov 2018 21:51:37 +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 D242326891; Mon, 12 Nov 2018 21:51:37 +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 wACLpbaE092326; Mon, 12 Nov 2018 21:51:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACLpbxr092324; Mon, 12 Nov 2018 21:51:37 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811122151.wACLpbxr092324@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 21:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340388 - in stable/12/sys: compat/freebsd32 kern X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 340388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F280785ED0 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 21:51:38 -0000 Author: brooks Date: Mon Nov 12 21:51:36 2018 New Revision: 340388 URL: https://svnweb.freebsd.org/changeset/base/340388 Log: MFC r340302: Fix freebsd32 mknod(at). As dev_t is now a 64-bit integer, it requires special handling as a system call argument. 64-bit arguments are split between two 64-bit integers due to the way arguments are promoted to allow reuse of most system call implementations. They must be reassembled before use. Further, 64-bit arguments at an odd offset (counting from zero) are padded and slid to the next slot on powerpc and mips. Fix the non-COMPAT11 system call by adding a freebsd32_mknodat() and appropriately padded declerations. The COMPAT11 system calls are fully compatible with the 64-bit implementations so remove the freebsd32_ versions. Use uint32_t consistently as the type of the old dev_t. This matches the old definition. Reviewed by: kib Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17928 Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c stable/12/sys/compat/freebsd32/syscalls.master stable/12/sys/kern/syscalls.master Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 12 21:01:28 2018 (r340387) +++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 12 21:51:36 2018 (r340388) @@ -463,25 +463,14 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_ return (error); } -#if defined(COMPAT_FREEBSD11) -int -freebsd11_freebsd32_mknod(struct thread *td, - struct freebsd11_freebsd32_mknod_args *uap) -{ - return (kern_mknodat(td, AT_FDCWD, uap->path, UIO_USERSPACE, uap->mode, - uap->dev)); -} - int -freebsd11_freebsd32_mknodat(struct thread *td, - struct freebsd11_freebsd32_mknodat_args *uap) +freebsd32_mknodat(struct thread *td, struct freebsd32_mknodat_args *uap) { - return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE, uap->mode, - uap->dev)); + return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE, + uap->mode, PAIR32TO64(dev_t, uap->dev))); } -#endif /* COMPAT_FREEBSD11 */ int freebsd32_mprotect(struct thread *td, struct freebsd32_mprotect_args *uap) Modified: stable/12/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/12/sys/compat/freebsd32/syscalls.master Mon Nov 12 21:01:28 2018 (r340387) +++ stable/12/sys/compat/freebsd32/syscalls.master Mon Nov 12 21:51:36 2018 (r340388) @@ -83,8 +83,8 @@ 11 AUE_NULL OBSOL execv 12 AUE_CHDIR NOPROTO { int chdir(char *path); } 13 AUE_FCHDIR NOPROTO { int fchdir(int fd); } -14 AUE_MKNOD COMPAT11 { int freebsd32_mknod(char *path, \ - int mode, int dev); } +14 AUE_MKNOD COMPAT11|NOPROTO { int mknod(char *path, \ + int mode, uint32_t dev); } 15 AUE_CHMOD NOPROTO { int chmod(char *path, int mode); } 16 AUE_CHOWN NOPROTO { int chown(char *path, int uid, int gid); } 17 AUE_NULL NOPROTO { caddr_t break(char *nsize); } @@ -943,7 +943,7 @@ mode_t mode); } 497 AUE_MKFIFOAT NOPROTO { int mkfifoat(int fd, char *path, \ mode_t mode); } -498 AUE_MKNODAT COMPAT11 { int freebsd32_mknodat(int fd, char *path, \ +498 AUE_MKNODAT COMPAT11|NOPROTO { int mknodat(int fd, char *path, \ mode_t mode, uint32_t dev); } 499 AUE_OPENAT_RWTC NOPROTO { int openat(int fd, char *path, int flag, \ mode_t mode); } @@ -1095,8 +1095,15 @@ long bufsize, int mode); } 558 AUE_FHSTATFS NOPROTO { int fhstatfs(const struct fhandle *u_fhp, \ struct statfs32 *buf); } -559 AUE_MKNODAT NOPROTO { int mknodat(int fd, char *path, mode_t mode, \ - dev_t dev); } +#ifdef PAD64_REQUIRED +559 AUE_MKNODAT STD { int freebsd32_mknodat(int fd, \ + char *path, mode_t mode, \ + int pad, uint32_t dev1, uint32_t dev2); } +#else +559 AUE_MKNODAT STD { int freebsd32_mknodat(int fd, \ + char *path, mode_t mode, \ + uint32_t dev1, uint32_t dev2); } +#endif 560 AUE_KEVENT STD { int freebsd32_kevent(int fd, \ const struct kevent32 *changelist, \ int nchanges, \ Modified: stable/12/sys/kern/syscalls.master ============================================================================== --- stable/12/sys/kern/syscalls.master Mon Nov 12 21:01:28 2018 (r340387) +++ stable/12/sys/kern/syscalls.master Mon Nov 12 21:51:36 2018 (r340388) @@ -114,7 +114,7 @@ 12 AUE_CHDIR STD { int chdir(_In_z_ char *path); } 13 AUE_FCHDIR STD { int fchdir(int fd); } 14 AUE_MKNOD COMPAT11 { int mknod(_In_z_ char *path, int mode, \ - int dev); } + uint32_t dev); } 15 AUE_CHMOD STD { int chmod(_In_z_ char *path, int mode); } 16 AUE_CHOWN STD { int chown(_In_z_ char *path, \ int uid, int gid); } From owner-svn-src-all@freebsd.org Mon Nov 12 21:53:49 2018 Return-Path: Delivered-To: svn-src-all@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 5351B11244E8; Mon, 12 Nov 2018 21:53:49 +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 DD902860D9; Mon, 12 Nov 2018 21:53:48 +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 A9F30269FA; Mon, 12 Nov 2018 21:53:48 +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 wACLrmvc094173; Mon, 12 Nov 2018 21:53:48 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACLrlkK094168; Mon, 12 Nov 2018 21:53:47 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811122153.wACLrlkK094168@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 21:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340389 - in stable/12/sys: compat/freebsd32 sys X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/sys: compat/freebsd32 sys X-SVN-Commit-Revision: 340389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD902860D9 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 21:53:49 -0000 Author: brooks Date: Mon Nov 12 21:53:47 2018 New Revision: 340389 URL: https://svnweb.freebsd.org/changeset/base/340389 Log: Regen after r340388: MFC r340302: Fix freebsd32 mknod(at). Approved by: re (gjb, implicit) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17928 Modified: stable/12/sys/compat/freebsd32/freebsd32_proto.h stable/12/sys/compat/freebsd32/freebsd32_syscall.h stable/12/sys/compat/freebsd32/freebsd32_syscalls.c stable/12/sys/compat/freebsd32/freebsd32_sysent.c stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c stable/12/sys/sys/sysproto.h Modified: stable/12/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 12 21:51:36 2018 (r340388) +++ stable/12/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 12 21:53:47 2018 (r340389) @@ -684,6 +684,24 @@ struct freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct stat32 *)]; struct stat32 * sb; char sb_r_[PADR_(struct stat32 *)]; }; +#ifdef PAD64_REQUIRED +struct freebsd32_mknodat_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char dev1_l_[PADL_(uint32_t)]; uint32_t dev1; char dev1_r_[PADR_(uint32_t)]; + char dev2_l_[PADL_(uint32_t)]; uint32_t dev2; char dev2_r_[PADR_(uint32_t)]; +}; +#else +struct freebsd32_mknodat_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; + char dev1_l_[PADL_(uint32_t)]; uint32_t dev1; char dev1_r_[PADR_(uint32_t)]; + char dev2_l_[PADL_(uint32_t)]; uint32_t dev2; char dev2_r_[PADR_(uint32_t)]; +}; +#endif struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -839,6 +857,11 @@ int freebsd32_utimensat(struct thread *, struct freebs int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_fstatat(struct thread *, struct freebsd32_fstatat_args *); int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); +#ifdef PAD64_REQUIRED +int freebsd32_mknodat(struct thread *, struct freebsd32_mknodat_args *); +#else +int freebsd32_mknodat(struct thread *, struct freebsd32_mknodat_args *); +#endif int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); @@ -916,6 +939,9 @@ struct ofreebsd32_getdirentries_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *); int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *); int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *); @@ -987,6 +1013,9 @@ struct freebsd4_freebsd32_sigreturn_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd4_freebsd32_getfsstat(struct thread *, struct freebsd4_freebsd32_getfsstat_args *); int freebsd4_freebsd32_statfs(struct thread *, struct freebsd4_freebsd32_statfs_args *); int freebsd4_freebsd32_fstatfs(struct thread *, struct freebsd4_freebsd32_fstatfs_args *); @@ -1072,6 +1101,9 @@ struct freebsd6_freebsd32_lio_listio_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd6_freebsd32_pread(struct thread *, struct freebsd6_freebsd32_pread_args *); int freebsd6_freebsd32_pwrite(struct thread *, struct freebsd6_freebsd32_pwrite_args *); int freebsd6_freebsd32_mmap(struct thread *, struct freebsd6_freebsd32_mmap_args *); @@ -1118,6 +1150,9 @@ struct freebsd7_freebsd32_shmctl_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd7_freebsd32_semctl(struct thread *, struct freebsd7_freebsd32_semctl_args *); int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); @@ -1142,6 +1177,9 @@ int freebsd7_freebsd32_shmctl(struct thread *, struct #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd10_freebsd32_pipe(struct thread *, struct freebsd10_freebsd32_pipe_args *); #endif /* COMPAT_FREEBSD10 */ @@ -1152,11 +1190,6 @@ int freebsd10_freebsd32_pipe(struct thread *, struct f #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) #define PAD64_REQUIRED #endif -struct freebsd11_freebsd32_mknod_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; - char dev_l_[PADL_(int)]; int dev; char dev_r_[PADR_(int)]; -}; struct freebsd11_freebsd32_stat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * ub; char ub_r_[PADR_(struct freebsd11_stat32 *)]; @@ -1204,19 +1237,15 @@ struct freebsd11_freebsd32_fstatat_args { char buf_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * buf; char buf_r_[PADR_(struct freebsd11_stat32 *)]; char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; -struct freebsd11_freebsd32_mknodat_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; - char dev_l_[PADL_(uint32_t)]; uint32_t dev; char dev_r_[PADR_(uint32_t)]; -}; #ifdef PAD64_REQUIRED #else #endif #ifdef PAD64_REQUIRED #else #endif -int freebsd11_freebsd32_mknod(struct thread *, struct freebsd11_freebsd32_mknod_args *); +#ifdef PAD64_REQUIRED +#else +#endif int freebsd11_freebsd32_stat(struct thread *, struct freebsd11_freebsd32_stat_args *); int freebsd11_freebsd32_fstat(struct thread *, struct freebsd11_freebsd32_fstat_args *); int freebsd11_freebsd32_lstat(struct thread *, struct freebsd11_freebsd32_lstat_args *); @@ -1225,12 +1254,10 @@ int freebsd11_freebsd32_getdents(struct thread *, stru int freebsd11_freebsd32_fhstat(struct thread *, struct freebsd11_freebsd32_fhstat_args *); int freebsd11_freebsd32_kevent(struct thread *, struct freebsd11_freebsd32_kevent_args *); int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fstatat_args *); -int freebsd11_freebsd32_mknodat(struct thread *, struct freebsd11_freebsd32_mknodat_args *); #endif /* COMPAT_FREEBSD11 */ #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_mknod AUE_MKNOD #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT #define FREEBSD32_SYS_AUE_ofreebsd32_lseek AUE_LSEEK #define FREEBSD32_SYS_AUE_freebsd32_recvmsg AUE_RECVMSG @@ -1364,7 +1391,6 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fexecve AUE_FEXECVE #define FREEBSD32_SYS_AUE_freebsd11_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_futimesat AUE_FUTIMESAT -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_mknodat AUE_MKNODAT #define FREEBSD32_SYS_AUE_freebsd32_jail_get AUE_JAIL_GET #define FREEBSD32_SYS_AUE_freebsd32_jail_set AUE_JAIL_SET #define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL @@ -1388,6 +1414,8 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT +#define FREEBSD32_SYS_AUE_freebsd32_mknodat AUE_MKNODAT +#define FREEBSD32_SYS_AUE_freebsd32_mknodat AUE_MKNODAT #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL Modified: stable/12/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_syscall.h Mon Nov 12 21:51:36 2018 (r340388) +++ stable/12/sys/compat/freebsd32/freebsd32_syscall.h Mon Nov 12 21:53:47 2018 (r340389) @@ -19,7 +19,7 @@ /* 11 is obsolete execv */ #define FREEBSD32_SYS_chdir 12 #define FREEBSD32_SYS_fchdir 13 -#define FREEBSD32_SYS_freebsd11_freebsd32_mknod 14 +#define FREEBSD32_SYS_freebsd11_mknod 14 #define FREEBSD32_SYS_chmod 15 #define FREEBSD32_SYS_chown 16 #define FREEBSD32_SYS_break 17 @@ -421,7 +421,7 @@ #define FREEBSD32_SYS_linkat 495 #define FREEBSD32_SYS_mkdirat 496 #define FREEBSD32_SYS_mkfifoat 497 -#define FREEBSD32_SYS_freebsd11_freebsd32_mknodat 498 +#define FREEBSD32_SYS_freebsd11_mknodat 498 #define FREEBSD32_SYS_openat 499 #define FREEBSD32_SYS_readlinkat 500 #define FREEBSD32_SYS_renameat 501 @@ -484,7 +484,8 @@ #define FREEBSD32_SYS_fstatfs 556 #define FREEBSD32_SYS_getfsstat 557 #define FREEBSD32_SYS_fhstatfs 558 -#define FREEBSD32_SYS_mknodat 559 +#define FREEBSD32_SYS_freebsd32_mknodat 559 +#define FREEBSD32_SYS_freebsd32_mknodat 559 #define FREEBSD32_SYS_freebsd32_kevent 560 #define FREEBSD32_SYS_freebsd32_cpuset_getdomain 561 #define FREEBSD32_SYS_freebsd32_cpuset_setdomain 562 Modified: stable/12/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_syscalls.c Mon Nov 12 21:51:36 2018 (r340388) +++ stable/12/sys/compat/freebsd32/freebsd32_syscalls.c Mon Nov 12 21:53:47 2018 (r340389) @@ -23,7 +23,7 @@ const char *freebsd32_syscallnames[] = { "obs_execv", /* 11 = obsolete execv */ "chdir", /* 12 = chdir */ "fchdir", /* 13 = fchdir */ - "compat11.freebsd32_mknod", /* 14 = freebsd11 freebsd32_mknod */ + "compat11.mknod", /* 14 = freebsd11 mknod */ "chmod", /* 15 = chmod */ "chown", /* 16 = chown */ "break", /* 17 = break */ @@ -520,7 +520,7 @@ const char *freebsd32_syscallnames[] = { "linkat", /* 495 = linkat */ "mkdirat", /* 496 = mkdirat */ "mkfifoat", /* 497 = mkfifoat */ - "compat11.freebsd32_mknodat", /* 498 = freebsd11 freebsd32_mknodat */ + "compat11.mknodat", /* 498 = freebsd11 mknodat */ "openat", /* 499 = openat */ "readlinkat", /* 500 = readlinkat */ "renameat", /* 501 = renameat */ @@ -591,7 +591,11 @@ const char *freebsd32_syscallnames[] = { "fstatfs", /* 556 = fstatfs */ "getfsstat", /* 557 = getfsstat */ "fhstatfs", /* 558 = fhstatfs */ - "mknodat", /* 559 = mknodat */ +#ifdef PAD64_REQUIRED + "freebsd32_mknodat", /* 559 = freebsd32_mknodat */ +#else + "freebsd32_mknodat", /* 559 = freebsd32_mknodat */ +#endif "freebsd32_kevent", /* 560 = freebsd32_kevent */ "freebsd32_cpuset_getdomain", /* 561 = freebsd32_cpuset_getdomain */ "freebsd32_cpuset_setdomain", /* 562 = freebsd32_cpuset_setdomain */ Modified: stable/12/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_sysent.c Mon Nov 12 21:51:36 2018 (r340388) +++ stable/12/sys/compat/freebsd32/freebsd32_sysent.c Mon Nov 12 21:53:47 2018 (r340389) @@ -70,7 +70,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 11 = obsolete execv */ { AS(chdir_args), (sy_call_t *)sys_chdir, AUE_CHDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = chdir */ { AS(fchdir_args), (sy_call_t *)sys_fchdir, AUE_FCHDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 13 = fchdir */ - { compat11(AS(freebsd11_freebsd32_mknod_args),freebsd32_mknod), AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = freebsd11 freebsd32_mknod */ + { compat11(AS(freebsd11_mknod_args),mknod), AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = freebsd11 mknod */ { AS(chmod_args), (sy_call_t *)sys_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)sys_chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */ { AS(break_args), (sy_call_t *)sys_break, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = break */ @@ -567,7 +567,7 @@ struct sysent freebsd32_sysent[] = { { AS(linkat_args), (sy_call_t *)sys_linkat, AUE_LINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 495 = linkat */ { AS(mkdirat_args), (sy_call_t *)sys_mkdirat, AUE_MKDIRAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 496 = mkdirat */ { AS(mkfifoat_args), (sy_call_t *)sys_mkfifoat, AUE_MKFIFOAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 497 = mkfifoat */ - { compat11(AS(freebsd11_freebsd32_mknodat_args),freebsd32_mknodat), AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 498 = freebsd11 freebsd32_mknodat */ + { compat11(AS(freebsd11_mknodat_args),mknodat), AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 498 = freebsd11 mknodat */ { AS(openat_args), (sy_call_t *)sys_openat, AUE_OPENAT_RWTC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 499 = openat */ { AS(readlinkat_args), (sy_call_t *)sys_readlinkat, AUE_READLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 500 = readlinkat */ { AS(renameat_args), (sy_call_t *)sys_renameat, AUE_RENAMEAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 501 = renameat */ @@ -638,7 +638,11 @@ struct sysent freebsd32_sysent[] = { { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 556 = fstatfs */ { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ { AS(fhstatfs_args), (sy_call_t *)sys_fhstatfs, AUE_FHSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 558 = fhstatfs */ - { AS(mknodat_args), (sy_call_t *)sys_mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 559 = mknodat */ +#ifdef PAD64_REQUIRED + { AS(freebsd32_mknodat_args), (sy_call_t *)freebsd32_mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 559 = freebsd32_mknodat */ +#else + { AS(freebsd32_mknodat_args), (sy_call_t *)freebsd32_mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 559 = freebsd32_mknodat */ +#endif { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 560 = freebsd32_kevent */ { AS(freebsd32_cpuset_getdomain_args), (sy_call_t *)freebsd32_cpuset_getdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 561 = freebsd32_cpuset_getdomain */ { AS(freebsd32_cpuset_setdomain_args), (sy_call_t *)freebsd32_cpuset_setdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 562 = freebsd32_cpuset_setdomain */ Modified: stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Nov 12 21:51:36 2018 (r340388) +++ stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Nov 12 21:53:47 2018 (r340389) @@ -3201,16 +3201,32 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* mknodat */ +#ifdef PAD64_REQUIRED + /* freebsd32_mknodat */ case 559: { - struct mknodat_args *p = params; + struct freebsd32_mknodat_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->path; /* char * */ iarg[2] = p->mode; /* mode_t */ - iarg[3] = p->dev; /* dev_t */ - *n_args = 4; + iarg[3] = p->pad; /* int */ + uarg[4] = p->dev1; /* uint32_t */ + uarg[5] = p->dev2; /* uint32_t */ + *n_args = 6; break; } +#else + /* freebsd32_mknodat */ + case 559: { + struct freebsd32_mknodat_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->path; /* char * */ + iarg[2] = p->mode; /* mode_t */ + uarg[3] = p->dev1; /* uint32_t */ + uarg[4] = p->dev2; /* uint32_t */ + *n_args = 5; + break; + } +#endif /* freebsd32_kevent */ case 560: { struct freebsd32_kevent_args *p = params; @@ -8642,7 +8658,8 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* mknodat */ +#ifdef PAD64_REQUIRED + /* freebsd32_mknodat */ case 559: switch(ndx) { case 0: @@ -8655,12 +8672,42 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "mode_t"; break; case 3: - p = "dev_t"; + p = "int"; break; + case 4: + p = "uint32_t"; + break; + case 5: + p = "uint32_t"; + break; default: break; }; break; +#else + /* freebsd32_mknodat */ + case 559: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "userland char *"; + break; + case 2: + p = "mode_t"; + break; + case 3: + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + default: + break; + }; + break; +#endif /* freebsd32_kevent */ case 560: switch(ndx) { @@ -10574,11 +10621,19 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* mknodat */ +#ifdef PAD64_REQUIRED + /* freebsd32_mknodat */ case 559: if (ndx == 0 || ndx == 1) p = "int"; break; +#else + /* freebsd32_mknodat */ + case 559: + if (ndx == 0 || ndx == 1) + p = "int"; + break; +#endif /* freebsd32_kevent */ case 560: if (ndx == 0 || ndx == 1) Modified: stable/12/sys/sys/sysproto.h ============================================================================== --- stable/12/sys/sys/sysproto.h Mon Nov 12 21:51:36 2018 (r340388) +++ stable/12/sys/sys/sysproto.h Mon Nov 12 21:53:47 2018 (r340389) @@ -2487,7 +2487,7 @@ int freebsd10_pipe(struct thread *, struct freebsd10_p struct freebsd11_mknod_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; - char dev_l_[PADL_(int)]; int dev; char dev_r_[PADR_(int)]; + char dev_l_[PADL_(uint32_t)]; uint32_t dev; char dev_r_[PADR_(uint32_t)]; }; struct freebsd11_vadvise_args { char anom_l_[PADL_(int)]; int anom; char anom_r_[PADR_(int)]; From owner-svn-src-all@freebsd.org Mon Nov 12 22:12:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 22:18:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Nov 12 22:34:03 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 00:23:06 2018 Return-Path: Delivered-To: svn-src-all@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 BB04A1127FE9 for ; Tue, 13 Nov 2018 00:23:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12d.google.com (mail-it1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (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 965758BA62 for ; Tue, 13 Nov 2018 00:23:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12d.google.com with SMTP id k206-v6so15498662ite.0 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=QI+sy3gB0pU08VbdgvhLZwoqvYZHER1m8kjMZNYE3YhCn5X3YMj8DXiYKTdybSEjnK n2UuZvM1FPLU6yS8AKayywVjHXLrIuGDWDYjF8vvG9Crq4vB/BKnoDIlPf7zetF8GE2j bgeN5RK8Yf1tT4j8jDNDO5R3+OWFajJpWLDAK22ACs8C1n6eOCOrrYfjFhMEZhhA4OYN MoDOryZxfzLd8QHvoRyCBeT3GW69FGhzEh81pgMev9e0h4utPoKZPHUCGEWeexdMg91s 0mlRkChA2BhIxTcC84T8B1RcqNsV3CaSNt4vIoCtXqcmz4By3/m1cVJ3+tnsg0smAjga MYPQ== X-Gm-Message-State: AGRZ1gLy05tFcnf4xK5NmZjHehN17xNFk8gvaqe3PYA6OpbBGb+KK+ry Zul0ykDa3OEUp/DDJ5lmqnOI7dj6C7W0V6xO7/roXg== 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: 965758BA62 X-Spamd-Result: default: False [-5.60 / 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.99)[-0.990,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@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:+]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[d.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]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.70)[ip: (-8.59), 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 00:23:07 -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-all@freebsd.org Tue Nov 13 00:30:10 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 00:49:36 2018 Return-Path: Delivered-To: svn-src-all@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 AE39B112897C for ; Tue, 13 Nov 2018 00:49:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 E80BF8C7FA for ; Tue, 13 Nov 2018 00:49:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd41.google.com with SMTP id u19so3387063ioc.2 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=CBl/B7w2LtgOs0ASaXDF/zDXxRDxvKE8ZE0seLNz0esWDjI3DdP7R/p3lnsG/JNf2b MUWqJZx8QOiM+UeQizkKk2H5AnXlc+j2qxFYvBRhrR/7l1Vye96uO9Q0lM9Bq57ALkkO bZ3oyO85z7BGM9jR1PL+dlvUauVXBKwNbjKCXdX5p6yGWg3a3rT2/8e52x80IYuNzd8E 7sBkbBMp/P01rUnK/vKYyCKifcpy8QqaIdJK9H404+s0Hr8eacMH4MiS45E9ICrP6g5C iyRaOHmD9StrDcsoEgIcaXj2r36xwFRmDkIpfCMsUjvwNG4pkLdA4pUGcONjGOncf9fr xuiA== X-Gm-Message-State: AGRZ1gIT0pvGptJKlOt286pAiBl9zm1p6YL5owFsDAtQNnrukEjQ/C3Z et+mxMH5ZZ3+80FewFf06JqkoFIX7MSDMAhx53YIdV9F 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: E80BF8C7FA 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-all@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)[1.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 01:30:32 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 04:34:32 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 06:10:26 2018 Return-Path: Delivered-To: svn-src-all@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 9F6C011051DD for ; Tue, 13 Nov 2018 06:10:26 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-it1-x135.google.com (mail-it1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 2DFF47455E for ; Tue, 13 Nov 2018 06:10:24 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-it1-x135.google.com with SMTP id k141-v6so16795766itk.3 for ; Mon, 12 Nov 2018 22:10:24 -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=o3wQDld6Gb4r1io+mmnPvQKOHoO4QfPSl9949wOgayP9Y2IIKKwqsO7gfuRxJo5bFi H+6l7lqdwXatqTA8xXOfPuaJTzutHnmMcFRvLxYN1L2mZf6ODuyPVF6/tPu/4AwfFotw CJJ5ek8MFEooBsF7otiNkxuMZ/7WZ0+HySFcMwW0X1Xjw86VbABt1zFkIa10DflL614d ttKpG7j6ui604XwSAKMxTB+d12TgpzWjYi542xw3Z/oRPGgzBbj0AuJUW72pplAraRjl YVKE9n9kNiGp5JdzsASlAX4IeEgirfwIVJQAvIN1WCHHLvQcMSk379yRCtRQZLMmMBj6 Zd2w== X-Gm-Message-State: AGRZ1gLGyHHYTrg5kIiYKVE3623AA1posaHukoFrVcHvP+eJsSydOTMU ZhmpMJjoELY50ZfnjTMG2c4YbV7fB9f6a3t9QAsmEw== 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: 2DFF47455E X-Spamd-Result: default: False [-5.73 / 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-all@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)[5.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.99)[-0.986,0]; R_DKIM_PERMFAIL(0.00)[kev009.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.43)[ip: (-7.25), 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 06:26:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 06:28:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 09:19:08 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 13:57:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 15:28:28 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 15:58:02 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 16:51:33 2018 Return-Path: Delivered-To: svn-src-all@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 1C30E112A7D9; Tue, 13 Nov 2018 16:51:33 +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 980946D6DA; Tue, 13 Nov 2018 16:51:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D6A112F8F; Tue, 13 Nov 2018 16:51:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADGpWbu076059; Tue, 13 Nov 2018 16:51:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADGpVFL076053; Tue, 13 Nov 2018 16:51:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811131651.wADGpVFL076053@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 16:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340396 - in stable/12/sys: kern vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern vm X-SVN-Commit-Revision: 340396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 980946D6DA 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 16:51:33 -0000 Author: markj Date: Tue Nov 13 16:51:30 2018 New Revision: 340396 URL: https://svnweb.freebsd.org/changeset/base/340396 Log: MFC r339925: Fix some problems that manifest when NUMA domain 0 is empty. Approved by: re (gjb) Modified: stable/12/sys/kern/kern_cpuset.c stable/12/sys/vm/uma_core.c stable/12/sys/vm/vm_init.c stable/12/sys/vm/vm_kern.c stable/12/sys/vm/vm_page.c stable/12/sys/vm/vm_pageout.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_cpuset.c ============================================================================== --- stable/12/sys/kern/kern_cpuset.c Tue Nov 13 15:28:27 2018 (r340395) +++ stable/12/sys/kern/kern_cpuset.c Tue Nov 13 16:51:30 2018 (r340396) @@ -492,20 +492,29 @@ _domainset_create(struct domainset *domain, struct dom } /* - * Are any of the domains in the mask empty? If so, silently - * remove them. If only empty domains are present, we must - * return failure. + * Are any of the domains in the mask empty? If so, silently + * remove them and update the domainset accordingly. If only empty + * domains are present, we must return failure. */ static bool domainset_empty_vm(struct domainset *domain) { - int i, max; + int i, j, max; max = DOMAINSET_FLS(&domain->ds_mask) + 1; - for (i = 0; i < max; i++) { - if (DOMAINSET_ISSET(i, &domain->ds_mask) && - VM_DOMAIN_EMPTY(i)) + for (i = 0; i < max; i++) + if (DOMAINSET_ISSET(i, &domain->ds_mask) && VM_DOMAIN_EMPTY(i)) DOMAINSET_CLR(i, &domain->ds_mask); + domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask); + max = DOMAINSET_FLS(&domain->ds_mask) + 1; + for (i = j = 0; i < max; i++) { + if (DOMAINSET_ISSET(i, &domain->ds_mask)) + domain->ds_order[j++] = i; + else if (domain->ds_policy == DOMAINSET_POLICY_PREFER && + domain->ds_prefer == i && domain->ds_cnt > 1) { + domain->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + domain->ds_prefer = -1; + } } return (DOMAINSET_EMPTY(&domain->ds_mask)); @@ -1378,7 +1387,7 @@ cpuset_setithread(lwpid_t id, int cpu) /* * Initialize static domainsets after NUMA information is available. This is - * called very early during boot. + * called before memory allocators are initialized. */ void domainset_init(void) @@ -1407,7 +1416,7 @@ domainset_init(void) void domainset_zero(void) { - struct domainset *dset; + struct domainset *dset, *tmp; mtx_init(&cpuset_lock, "cpuset", NULL, MTX_SPIN | MTX_RECURSE); @@ -1422,8 +1431,9 @@ domainset_zero(void) kernel_object->domain.dr_policy = _domainset_create(&domainset2, NULL); /* Remove empty domains from the global policies. */ - LIST_FOREACH(dset, &cpuset_domains, ds_link) - (void)domainset_empty_vm(dset); + LIST_FOREACH_SAFE(dset, &cpuset_domains, ds_link, tmp) + if (domainset_empty_vm(dset)) + LIST_REMOVE(dset, ds_link); } /* Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Tue Nov 13 15:28:27 2018 (r340395) +++ stable/12/sys/vm/uma_core.c Tue Nov 13 16:51:30 2018 (r340396) @@ -3608,29 +3608,30 @@ uma_zone_reserve_kva(uma_zone_t zone, int count) void uma_prealloc(uma_zone_t zone, int items) { + struct vm_domainset_iter di; uma_domain_t dom; uma_slab_t slab; uma_keg_t keg; - int domain, slabs; + int domain, flags, slabs; keg = zone_first_keg(zone); if (keg == NULL) return; KEG_LOCK(keg); slabs = items / keg->uk_ipers; - domain = 0; if (slabs * keg->uk_ipers < items) slabs++; + flags = M_WAITOK; + vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, &flags); while (slabs-- > 0) { - slab = keg_alloc_slab(keg, zone, domain, M_WAITOK); + slab = keg_alloc_slab(keg, zone, domain, flags); if (slab == NULL) return; MPASS(slab->us_keg == keg); dom = &keg->uk_domain[slab->us_domain]; LIST_INSERT_HEAD(&dom->ud_free_slab, slab, us_link); - do { - domain = (domain + 1) % vm_ndomains; - } while (VM_DOMAIN_EMPTY(domain)); + if (vm_domainset_iter_policy(&di, &domain) != 0) + break; } KEG_UNLOCK(keg); } Modified: stable/12/sys/vm/vm_init.c ============================================================================== --- stable/12/sys/vm/vm_init.c Tue Nov 13 15:28:27 2018 (r340395) +++ stable/12/sys/vm/vm_init.c Tue Nov 13 16:51:30 2018 (r340396) @@ -123,11 +123,17 @@ vm_mem_init(void *dummy) domainset_init(); /* - * Initializes resident memory structures. From here on, all physical + * Initialize resident memory structures. From here on, all physical * memory is accounted for, and we use only virtual addresses. */ vm_set_page_size(); virtual_avail = vm_page_startup(virtual_avail); + + /* + * Set an initial domain policy for thread0 so that allocations + * can work. + */ + domainset_zero(); #ifdef UMA_MD_SMALL_ALLOC /* Announce page availability to UMA. */ Modified: stable/12/sys/vm/vm_kern.c ============================================================================== --- stable/12/sys/vm/vm_kern.c Tue Nov 13 15:28:27 2018 (r340395) +++ stable/12/sys/vm/vm_kern.c Tue Nov 13 16:51:30 2018 (r340396) @@ -800,7 +800,6 @@ kmem_bootstrap_free(vm_offset_t start, vm_size_t size) vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); vm_phys_free_pages(m, 0); - vmd->vmd_page_count++; vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, 1); Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Tue Nov 13 15:28:27 2018 (r340395) +++ stable/12/sys/vm/vm_page.c Tue Nov 13 16:51:30 2018 (r340396) @@ -855,11 +855,6 @@ vm_page_startup(vm_offset_t vaddr) */ vm_reserv_init(); #endif - /* - * Set an initial domain policy for thread0 so that allocations - * can work. - */ - domainset_zero(); return (vaddr); } Modified: stable/12/sys/vm/vm_pageout.c ============================================================================== --- stable/12/sys/vm/vm_pageout.c Tue Nov 13 15:28:27 2018 (r340395) +++ stable/12/sys/vm/vm_pageout.c Tue Nov 13 16:51:30 2018 (r340396) @@ -2072,41 +2072,41 @@ vm_pageout_init(void) static void vm_pageout(void) { - int error; - int i; + struct proc *p; + struct thread *td; + int error, first, i; + p = curproc; + td = curthread; + swap_pager_swap_init(); - snprintf(curthread->td_name, sizeof(curthread->td_name), "dom0"); - error = kthread_add(vm_pageout_laundry_worker, NULL, curproc, NULL, - 0, 0, "laundry: dom0"); - if (error != 0) - panic("starting laundry for domain 0, error %d", error); - for (i = 1; i < vm_ndomains; i++) { + for (first = -1, i = 0; i < vm_ndomains; i++) { if (VM_DOMAIN_EMPTY(i)) { if (bootverbose) printf("domain %d empty; skipping pageout\n", i); continue; } - - error = kthread_add(vm_pageout_worker, (void *)(uintptr_t)i, - curproc, NULL, 0, 0, "dom%d", i); - if (error != 0) { - panic("starting pageout for domain %d, error %d\n", - i, error); + if (first == -1) + first = i; + else { + error = kthread_add(vm_pageout_worker, + (void *)(uintptr_t)i, p, NULL, 0, 0, "dom%d", i); + if (error != 0) + panic("starting pageout for domain %d: %d\n", + i, error); } error = kthread_add(vm_pageout_laundry_worker, - (void *)(uintptr_t)i, curproc, NULL, 0, 0, - "laundry: dom%d", i); + (void *)(uintptr_t)i, p, NULL, 0, 0, "laundry: dom%d", i); if (error != 0) - panic("starting laundry for domain %d, error %d", - i, error); + panic("starting laundry for domain %d: %d", i, error); } - error = kthread_add(uma_reclaim_worker, NULL, curproc, NULL, - 0, 0, "uma"); + error = kthread_add(uma_reclaim_worker, NULL, p, NULL, 0, 0, "uma"); if (error != 0) panic("starting uma_reclaim helper, error %d\n", error); - vm_pageout_worker((void *)(uintptr_t)0); + + snprintf(td->td_name, sizeof(td->td_name), "dom%d", first); + vm_pageout_worker((void *)(uintptr_t)first); } /* From owner-svn-src-all@freebsd.org Tue Nov 13 17:25:35 2018 Return-Path: Delivered-To: svn-src-all@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 B6BE7112B31B; Tue, 13 Nov 2018 17:25:35 +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 4660E6E75B; Tue, 13 Nov 2018 17:25:35 +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 27A0313530; Tue, 13 Nov 2018 17:25:35 +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 wADHPZ8L091983; Tue, 13 Nov 2018 17:25:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADHPZEm091982; Tue, 13 Nov 2018 17:25:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811131725.wADHPZEm091982@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 17:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340397 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 340397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4660E6E75B X-Spamd-Result: default: False [-102.72 / 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)[4]; 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.61)[-0.615,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 17:25:35 -0000 Author: markj Date: Tue Nov 13 17:25:34 2018 New Revision: 340397 URL: https://svnweb.freebsd.org/changeset/base/340397 Log: MFC r340313: Ensure that IP fragments do not extend beyond IP_MAXPACKET. Approved by: re (gjb) Modified: stable/12/sys/netinet/ip_reass.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_reass.c ============================================================================== --- stable/12/sys/netinet/ip_reass.c Tue Nov 13 16:51:30 2018 (r340396) +++ stable/12/sys/netinet/ip_reass.c Tue Nov 13 17:25:34 2018 (r340397) @@ -228,6 +228,16 @@ ip_reass(struct mbuf *m) ip->ip_off = htons(ntohs(ip->ip_off) << 3); /* + * Make sure the fragment lies within a packet of valid size. + */ + if (ntohs(ip->ip_len) + ntohs(ip->ip_off) > IP_MAXPACKET) { + IPSTAT_INC(ips_toolong); + IPSTAT_INC(ips_fragdropped); + m_freem(m); + return (NULL); + } + + /* * Attempt reassembly; if it succeeds, proceed. * ip_reass() will return a different mbuf. */ From owner-svn-src-all@freebsd.org Tue Nov 13 17:43:17 2018 Return-Path: Delivered-To: svn-src-all@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 7D461112BB51; Tue, 13 Nov 2018 17:43:17 +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 09F946F418; Tue, 13 Nov 2018 17:43:17 +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 D714F1386A; Tue, 13 Nov 2018 17:43:16 +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 wADHhGea002427; Tue, 13 Nov 2018 17:43:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADHhGDR002426; Tue, 13 Nov 2018 17:43:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811131743.wADHhGDR002426@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 17:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340398 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 340398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09F946F418 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)[4]; 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.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 17:43:17 -0000 Author: markj Date: Tue Nov 13 17:43:16 2018 New Revision: 340398 URL: https://svnweb.freebsd.org/changeset/base/340398 Log: MFC r340331: Re-apply r336984, reverting r339934. Approved by: re (gjb) Modified: stable/12/sys/vm/vm_object.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_object.c ============================================================================== --- stable/12/sys/vm/vm_object.c Tue Nov 13 17:25:34 2018 (r340397) +++ stable/12/sys/vm/vm_object.c Tue Nov 13 17:43:16 2018 (r340398) @@ -2143,8 +2143,9 @@ vm_object_coalesce(vm_object_t prev_object, vm_ooffset next_size >>= PAGE_SHIFT; next_pindex = OFF_TO_IDX(prev_offset) + prev_size; - if ((prev_object->ref_count > 1) && - (prev_object->size != next_pindex)) { + if (prev_object->ref_count > 1 && + prev_object->size != next_pindex && + (prev_object->flags & OBJ_ONEMAPPING) == 0) { VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } From owner-svn-src-all@freebsd.org Tue Nov 13 18:04:37 2018 Return-Path: Delivered-To: svn-src-all@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 C2DB8112C616 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 07E1A70717 for ; Tue, 13 Nov 2018 18:04:35 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1542131303; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=MXVxPi0e1sN261tugp5oozFEnpMT6JMQ3E6iLnDsMBOx7VrpoO2o0SUyG5A/opXf3x4YXvcuFNRIA An+jhkKdKdsNVZWrpQc6ZgcB0f/+JA0yLO/PkNCYEUwzSbONUAFH764k7JKsG1A3MYH2FiFrHvOT51 YwTo58SOCE2w5Yo/jtWKQUONyb6sLLF+X9WQlxc/7UjkHRJMAL/mPyef+jMfUsjjk8OMaWc5WiiIsz fZvqrwanjbq66ZjjJB3Qf2wF6gLslbkDLv2mE1k0RJ6at5GYs5nmgay3AZDbPjMkY1FdyJS11mYMRZ kjJIazZI75f0L/U9g2wZXBPlMydqRJg== 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: 07E1A70717 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)[]; IP_SCORE(-0.16)[asn: 16509(-0.68), country: US(-0.09)]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[60.211.177.67.zen.spamhaus.org : 127.0.0.10]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_ALLOW(-1.00)[i=1]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 18:12:08 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 18:20:28 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 18:21:53 2018 Return-Path: Delivered-To: svn-src-all@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 D8BE9112D3A6; Tue, 13 Nov 2018 18:21:52 +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 704D9718AA; Tue, 13 Nov 2018 18:21:52 +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 51D7513EC2; Tue, 13 Nov 2018 18:21:52 +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 wADILq1E024079; Tue, 13 Nov 2018 18:21:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADILmbe023364; Tue, 13 Nov 2018 18:21:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811131821.wADILmbe023364@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:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340401 - in stable/12: . share/man/man9 sys/dev/hwpmc sys/i386/i386 sys/kern sys/sys sys/vm sys/x86/iommu sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: . share/man/man9 sys/dev/hwpmc sys/i386/i386 sys/kern sys/sys sys/vm sys/x86/iommu sys/x86/x86 X-SVN-Commit-Revision: 340401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 704D9718AA 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 18:21:53 -0000 Author: markj Date: Tue Nov 13 18:21:47 2018 New Revision: 340401 URL: https://svnweb.freebsd.org/changeset/base/340401 Log: MFC r339927: Add malloc_domainset(9) and _domainset variants to other allocator KPIs. Approved by: re (gjb) Modified: stable/12/ObsoleteFiles.inc stable/12/share/man/man9/Makefile stable/12/share/man/man9/contigmalloc.9 stable/12/share/man/man9/domainset.9 stable/12/share/man/man9/malloc.9 stable/12/sys/dev/hwpmc/hwpmc_logging.c stable/12/sys/dev/hwpmc/hwpmc_mod.c stable/12/sys/i386/i386/pmap.c stable/12/sys/kern/kern_cpuset.c stable/12/sys/kern/kern_malloc.c stable/12/sys/kern/kern_mbuf.c stable/12/sys/kern/kern_pmc.c stable/12/sys/kern/subr_busdma_bufalloc.c stable/12/sys/sys/domainset.h stable/12/sys/sys/malloc.h stable/12/sys/vm/uma_core.c stable/12/sys/vm/vm_extern.h stable/12/sys/vm/vm_kern.c stable/12/sys/x86/iommu/busdma_dmar.c stable/12/sys/x86/x86/busdma_bounce.c Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/ObsoleteFiles.inc Tue Nov 13 18:21:47 2018 (r340401) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20181030: malloc_domain(9) KPI change +OLD_FILES+=share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports OLD_LIBS+=lib/libcrypto.so.9 OLD_LIBS+=usr/lib/libssl.so.9 Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/share/man/man9/Makefile Tue Nov 13 18:21:47 2018 (r340401) @@ -811,7 +811,8 @@ MLINKS+=condvar.9 cv_broadcast.9 \ MLINKS+=config_intrhook.9 config_intrhook_disestablish.9 \ config_intrhook.9 config_intrhook_establish.9 \ config_intrhook.9 config_intrhook_oneshot.9 -MLINKS+=contigmalloc.9 contigfree.9 +MLINKS+=contigmalloc.9 contigmalloc_domainset.9 \ + contigmalloc.9 contigfree.9 MLINKS+=casuword.9 casueword.9 \ casuword.9 casueword32.9 \ casuword.9 casuword32.9 @@ -1286,7 +1287,7 @@ MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 make_dev_p.9 \ make_dev.9 make_dev_s.9 MLINKS+=malloc.9 free.9 \ - malloc.9 malloc_domain.9 \ + malloc.9 malloc_domainset.9 \ malloc.9 free_domain.9 \ malloc.9 mallocarray.9 \ malloc.9 MALLOC_DECLARE.9 \ Modified: stable/12/share/man/man9/contigmalloc.9 ============================================================================== --- stable/12/share/man/man9/contigmalloc.9 Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/share/man/man9/contigmalloc.9 Tue Nov 13 18:21:47 2018 (r340401) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2015 +.Dd October 30, 2018 .Dt CONTIGMALLOC 9 .Os .Sh NAME @@ -50,6 +50,19 @@ .Fa "unsigned long size" .Fa "struct malloc_type *type" .Fc +.In sys/param.h +.In sys/domainset.h +.Ft "void *" +.Fo contigmalloc_domainset +.Fa "unsigned long size" +.Fa "struct malloc_type *type" +.Fa "struct domainset *ds" +.Fa "int flags" +.Fa "vm_paddr_t low" +.Fa "vm_paddr_t high" +.Fa "unsigned long alignment" +.Fa "vm_paddr_t boundary" +.Fc .Sh DESCRIPTION The .Fn contigmalloc @@ -70,6 +83,15 @@ address range of bytes allocated from the kernel virtual address (KVA) map. .Pp The +.Fn contigmalloc_domainset +variant allows the caller to additionally specify a +.Xr numa 4 +domain selection policy. +See +.Xr domainset 9 +for some example policies. +.Pp +The .Fa flags parameter modifies .Fn contigmalloc Ns 's @@ -90,7 +112,9 @@ Other flags (if present) are ignored. The .Fn contigfree function deallocates memory allocated by a previous call to -.Fn contigmalloc . +.Fn contigmalloc +or +.Fn contigmalloc_domainset . .Sh IMPLEMENTATION NOTES The .Fn contigmalloc Modified: stable/12/share/man/man9/domainset.9 ============================================================================== --- stable/12/share/man/man9/domainset.9 Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/share/man/man9/domainset.9 Tue Nov 13 18:21:47 2018 (r340401) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd October 30, 2018 .Dt DOMAINSET 9 .Os .Sh NAME @@ -43,7 +43,11 @@ struct domainset { }; .Ed .Pp +.Ft struct domainset * +.Fn DOMAINSET_FIXED domain +.Ft struct domainset * .Fn DOMAINSET_RR +.Ft struct domainset * .Fn DOMAINSET_PREF domain .Ft struct domainset * .Fn domainset_create "const struct domainset *key" @@ -98,11 +102,26 @@ efficiency higher and is preferential to round-robin f .El .Pp The +.Fn DOMAINSET_FIXED , .Fn DOMAINSET_RR and .Fn DOMAINSET_PREF -provide pointers to global pre-defined policies for use when the +macros provide pointers to global pre-defined policies for use when the desired policy is known at compile time. +.Fn DOMAINSET_FIXED +is a policy which only permits allocations from the specified domain. +.Fn DOMAINSET_RR +provides round-robin selection among all domains in the system. +The +.Fn DOMAINSET_PREF +policies attempt allocation from the specified domain, but unlike +.Fn DOMAINSET_FIXED +will fall back to other domains to satisfy the request. +These policies should be used in preference to +.Fn DOMAINSET_FIXED +to avoid blocking indefinitely on a +.Dv M_WAITOK +request. The .Fn domainset_create function takes a partially filled in domainset as a key and returns a Modified: stable/12/share/man/man9/malloc.9 ============================================================================== --- stable/12/share/man/man9/malloc.9 Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/share/man/man9/malloc.9 Tue Nov 13 18:21:47 2018 (r340401) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd October 30, 2018 .Dt MALLOC 9 .Os .Sh NAME @@ -46,13 +46,9 @@ .Ft void * .Fn malloc "size_t size" "struct malloc_type *type" "int flags" .Ft void * -.Fn malloc_domain "size_t size" "struct malloc_type *type" "int domain" "int flags" -.Ft void * .Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags" .Ft void .Fn free "void *addr" "struct malloc_type *type" -.Ft void -.Fn free_domain "void *addr" "struct malloc_type *type" .Ft void * .Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags" .Ft void * @@ -62,6 +58,12 @@ .In sys/malloc.h .In sys/kernel.h .Fn MALLOC_DEFINE type shortdesc longdesc +.In sys/param.h +.In sys/domainset.h +.Ft void * +.Fn malloc_domainset "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" +.Ft void +.Fn free_domain "void *addr" "struct malloc_type *type" .Sh DESCRIPTION The .Fn malloc @@ -70,12 +72,15 @@ object whose size is specified by .Fa size . .Pp The -.Fn malloc_domain -variant allocates the object from the specified memory domain. Memory allocated -with this function should be returned with -.Fn free_domain . +.Fn malloc_domainset +variant allocates memory from a specific +.Xr numa 4 +domain using the specified domain selection policy. See -.Xr numa 9 for more details. +.Xr domainset 9 +for some example policies. +Memory allocated with this function should be returned with +.Fn free_domain . .Pp The .Fn mallocarray @@ -310,7 +315,9 @@ functions. Failing consistency checks will cause a panic or a system console message. .Sh SEE ALSO +.Xr numa 4 , .Xr vmstat 8 , .Xr contigmalloc 9 , +.Xr domainset 9 , .Xr memguard 9 , .Xr vnode 9 Modified: stable/12/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_logging.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/dev/hwpmc/hwpmc_logging.c Tue Nov 13 18:21:47 2018 (r340401) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1231,8 +1232,8 @@ pmclog_process_userlog(struct pmc_owner *po, struct pm void pmclog_initialize() { - int domain; struct pmclog_buffer *plb; + int domain, ncpus, total; if (pmclog_buffer_size <= 0 || pmclog_buffer_size > 16*1024) { (void) printf("hwpmc: tunable logbuffersize=%d must be " @@ -1253,16 +1254,17 @@ pmclog_initialize() pmclog_buffer_size = PMC_LOG_BUFFER_SIZE; } for (domain = 0; domain < vm_ndomains; domain++) { - int ncpus = pmc_dom_hdrs[domain]->pdbh_ncpus; - int total = ncpus*pmc_nlogbuffers_pcpu; + ncpus = pmc_dom_hdrs[domain]->pdbh_ncpus; + total = ncpus * pmc_nlogbuffers_pcpu; - plb = malloc_domain(sizeof(struct pmclog_buffer)*total, M_PMC, domain, M_WAITOK|M_ZERO); + plb = malloc_domainset(sizeof(struct pmclog_buffer) * total, + M_PMC, DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); pmc_dom_hdrs[domain]->pdbh_plbs = plb; - for (int i = 0; i < total; i++, plb++) { + for (; total > 0; total--, plb++) { void *buf; - buf = malloc_domain(1024 * pmclog_buffer_size, M_PMC, domain, - M_WAITOK|M_ZERO); + buf = malloc_domainset(1024 * pmclog_buffer_size, M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); PMCLOG_INIT_BUFFER_DESCRIPTOR(plb, buf, domain); pmc_plb_rele_unlocked(plb); } Modified: stable/12/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_mod.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/dev/hwpmc/hwpmc_mod.c Tue Nov 13 18:21:47 2018 (r340401) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -78,14 +79,6 @@ __FBSDID("$FreeBSD$"); #include "hwpmc_soft.h" -#ifdef NUMA -#define NDOMAINS vm_ndomains -#else -#define NDOMAINS 1 -#define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) -#define free_domain(addr, type) free(addr, type) -#endif - #define PMC_EPOCH_ENTER() struct epoch_tracker pmc_et; epoch_enter_preempt(global_epoch_preempt, &pmc_et) #define PMC_EPOCH_EXIT() epoch_exit_preempt(global_epoch_preempt, &pmc_et) @@ -5643,15 +5636,16 @@ pmc_initialize(void) continue; pc = pcpu_find(cpu); domain = pc->pc_domain; - sb = malloc_domain(sizeof(struct pmc_samplebuffer) + - pmc_nsamples * sizeof(struct pmc_sample), M_PMC, domain, - M_WAITOK|M_ZERO); + sb = malloc_domainset(sizeof(struct pmc_samplebuffer) + + pmc_nsamples * sizeof(struct pmc_sample), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); KASSERT(pmc_pcpu[cpu] != NULL, ("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu)); - sb->ps_callchains = malloc_domain(pmc_callchaindepth * pmc_nsamples * - sizeof(uintptr_t), M_PMC, domain, M_WAITOK|M_ZERO); + sb->ps_callchains = malloc_domainset(pmc_callchaindepth * + pmc_nsamples * sizeof(uintptr_t), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++) ps->ps_pc = sb->ps_callchains + @@ -5659,35 +5653,27 @@ pmc_initialize(void) pmc_pcpu[cpu]->pc_sb[PMC_HR] = sb; - sb = malloc_domain(sizeof(struct pmc_samplebuffer) + - pmc_nsamples * sizeof(struct pmc_sample), M_PMC, domain, - M_WAITOK|M_ZERO); + sb = malloc_domainset(sizeof(struct pmc_samplebuffer) + + pmc_nsamples * sizeof(struct pmc_sample), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); - KASSERT(pmc_pcpu[cpu] != NULL, - ("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu)); - - sb->ps_callchains = malloc_domain(pmc_callchaindepth * pmc_nsamples * - sizeof(uintptr_t), M_PMC, domain, M_WAITOK|M_ZERO); - + sb->ps_callchains = malloc_domainset(pmc_callchaindepth * + pmc_nsamples * sizeof(uintptr_t), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++) ps->ps_pc = sb->ps_callchains + (n * pmc_callchaindepth); pmc_pcpu[cpu]->pc_sb[PMC_SR] = sb; - sb = malloc_domain(sizeof(struct pmc_samplebuffer) + - pmc_nsamples * sizeof(struct pmc_sample), M_PMC, domain, - M_WAITOK|M_ZERO); - - KASSERT(pmc_pcpu[cpu] != NULL, - ("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu)); - - sb->ps_callchains = malloc_domain(pmc_callchaindepth * pmc_nsamples * - sizeof(uintptr_t), M_PMC, domain, M_WAITOK|M_ZERO); - + sb = malloc_domainset(sizeof(struct pmc_samplebuffer) + + pmc_nsamples * sizeof(struct pmc_sample), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); + sb->ps_callchains = malloc_domainset(pmc_callchaindepth * + pmc_nsamples * sizeof(uintptr_t), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++) - ps->ps_pc = sb->ps_callchains + - (n * pmc_callchaindepth); + ps->ps_pc = sb->ps_callchains + n * pmc_callchaindepth; pmc_pcpu[cpu]->pc_sb[PMC_UR] = sb; } Modified: stable/12/sys/i386/i386/pmap.c ============================================================================== --- stable/12/sys/i386/i386/pmap.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/i386/i386/pmap.c Tue Nov 13 18:21:47 2018 (r340401) @@ -864,8 +864,8 @@ pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, int /* Inform UMA that this allocator uses kernel_map/object. */ *flags = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_contig_domain(domain, bytes, wait, 0x0ULL, - 0xffffffffULL, 1, 0, VM_MEMATTR_DEFAULT)); + return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain), + bytes, wait, 0x0ULL, 0xffffffffULL, 1, 0, VM_MEMATTR_DEFAULT)); } #endif Modified: stable/12/sys/kern/kern_cpuset.c ============================================================================== --- stable/12/sys/kern/kern_cpuset.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/kern/kern_cpuset.c Tue Nov 13 18:21:47 2018 (r340401) @@ -119,6 +119,7 @@ __FBSDID("$FreeBSD$"); */ LIST_HEAD(domainlist, domainset); +struct domainset __read_mostly domainset_fixed[MAXMEMDOM]; struct domainset __read_mostly domainset_prefer[MAXMEMDOM]; struct domainset __read_mostly domainset_roundrobin; @@ -1402,6 +1403,12 @@ domainset_init(void) _domainset_create(dset, NULL); for (i = 0; i < vm_ndomains; i++) { + dset = &domainset_fixed[i]; + DOMAINSET_ZERO(&dset->ds_mask); + DOMAINSET_SET(i, &dset->ds_mask); + dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + _domainset_create(dset, NULL); + dset = &domainset_prefer[i]; DOMAINSET_COPY(&all_domains, &dset->ds_mask); dset->ds_policy = DOMAINSET_POLICY_PREFER; Modified: stable/12/sys/kern/kern_malloc.c ============================================================================== --- stable/12/sys/kern/kern_malloc.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/kern/kern_malloc.c Tue Nov 13 18:21:47 2018 (r340401) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -453,13 +454,13 @@ contigmalloc(unsigned long size, struct malloc_type *t } void * -contigmalloc_domain(unsigned long size, struct malloc_type *type, - int domain, int flags, vm_paddr_t low, vm_paddr_t high, +contigmalloc_domainset(unsigned long size, struct malloc_type *type, + struct domainset *ds, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) { void *ret; - ret = (void *)kmem_alloc_contig_domain(domain, size, flags, low, high, + ret = (void *)kmem_alloc_contig_domainset(ds, size, flags, low, high, alignment, boundary, VM_MEMATTR_DEFAULT); if (ret != NULL) malloc_type_allocated(type, round_page(size)); @@ -595,9 +596,8 @@ void * return ((void *) va); } -void * -malloc_domain(size_t size, struct malloc_type *mtp, int domain, - int flags) +static void * +malloc_domain(size_t size, struct malloc_type *mtp, int domain, int flags) { int indx; caddr_t va; @@ -638,6 +638,24 @@ malloc_domain(size_t size, struct malloc_type *mtp, in va = redzone_setup(va, osize); #endif return ((void *) va); +} + +void * +malloc_domainset(size_t size, struct malloc_type *mtp, struct domainset *ds, + int flags) +{ + struct vm_domainset_iter di; + void *ret; + int domain; + + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); + do { + ret = malloc_domain(size, mtp, domain, flags); + if (ret != NULL) + break; + } while (vm_domainset_iter_policy(&di, &domain) == 0); + + return (ret); } void * Modified: stable/12/sys/kern/kern_mbuf.c ============================================================================== --- stable/12/sys/kern/kern_mbuf.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/kern/kern_mbuf.c Tue Nov 13 18:21:47 2018 (r340401) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_param.h" #include +#include #include #include #include @@ -586,8 +587,9 @@ mbuf_jumbo_alloc(uma_zone_t zone, vm_size_t bytes, int /* Inform UMA that this allocator uses kernel_map/object. */ *flags = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_contig_domain(domain, bytes, wait, - (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT)); + return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain), + bytes, wait, (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, + VM_MEMATTR_DEFAULT)); } /* Modified: stable/12/sys/kern/kern_pmc.c ============================================================================== --- stable/12/sys/kern/kern_pmc.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/kern/kern_pmc.c Tue Nov 13 18:21:47 2018 (r340401) @@ -35,8 +35,9 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" -#include +#include #include +#include #include #include #include @@ -330,22 +331,6 @@ pmc_soft_ev_release(struct pmc_soft *ps) mtx_unlock_spin(&pmc_softs_mtx); } -#ifdef NUMA -#define NDOMAINS vm_ndomains - -static int -getdomain(int cpu) -{ - struct pcpu *pc; - - pc = pcpu_find(cpu); - return (pc->pc_domain); -} -#else -#define NDOMAINS 1 -#define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) -#define getdomain(cpu) 0 -#endif /* * Initialise hwpmc. */ @@ -363,14 +348,16 @@ init_hwpmc(void *dummy __unused) pmc_softs = malloc(pmc_softevents * sizeof(struct pmc_soft *), M_PMCHOOKS, M_NOWAIT|M_ZERO); KASSERT(pmc_softs != NULL, ("cannot allocate soft events table")); - for (domain = 0; domain < NDOMAINS; domain++) { - pmc_dom_hdrs[domain] = malloc_domain(sizeof(struct pmc_domain_buffer_header), M_PMC, domain, - M_WAITOK|M_ZERO); + + for (domain = 0; domain < vm_ndomains; domain++) { + pmc_dom_hdrs[domain] = malloc_domainset( + sizeof(struct pmc_domain_buffer_header), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); mtx_init(&pmc_dom_hdrs[domain]->pdbh_mtx, "pmc_bufferlist_mtx", "pmc-leaf", MTX_SPIN); TAILQ_INIT(&pmc_dom_hdrs[domain]->pdbh_head); } CPU_FOREACH(cpu) { - domain = getdomain(cpu); + domain = pcpu_find(cpu)->pc_domain; KASSERT(pmc_dom_hdrs[domain] != NULL, ("no mem allocated for domain: %d", domain)); pmc_dom_hdrs[domain]->pdbh_ncpus++; } Modified: stable/12/sys/kern/subr_busdma_bufalloc.c ============================================================================== --- stable/12/sys/kern/subr_busdma_bufalloc.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/kern/subr_busdma_bufalloc.c Tue Nov 13 18:21:47 2018 (r340401) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -152,18 +153,15 @@ void * busdma_bufalloc_alloc_uncacheable(uma_zone_t zone, vm_size_t size, int domain, uint8_t *pflag, int wait) { -#ifdef VM_MEMATTR_UNCACHEABLE +#ifdef VM_MEMATTR_UNCACHEABLE /* Inform UMA that this allocator uses kernel_arena/object. */ *pflag = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_attr_domain(domain, size, wait, 0, - BUS_SPACE_MAXADDR, VM_MEMATTR_UNCACHEABLE)); - + return ((void *)kmem_alloc_attr_domainset(DOMAINSET_FIXED(domain), size, + wait, 0, BUS_SPACE_MAXADDR, VM_MEMATTR_UNCACHEABLE)); #else - panic("VM_MEMATTR_UNCACHEABLE unavailable"); - #endif /* VM_MEMATTR_UNCACHEABLE */ } Modified: stable/12/sys/sys/domainset.h ============================================================================== --- stable/12/sys/sys/domainset.h Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/sys/domainset.h Tue Nov 13 18:21:47 2018 (r340401) @@ -96,7 +96,8 @@ struct domainset { domainid_t ds_order[MAXMEMDOM]; /* nth domain table. */ }; -extern struct domainset domainset_prefer[MAXMEMDOM]; +extern struct domainset domainset_fixed[MAXMEMDOM], domainset_prefer[MAXMEMDOM]; +#define DOMAINSET_FIXED(domain) (&domainset_fixed[(domain)]) #define DOMAINSET_PREF(domain) (&domainset_prefer[(domain)]) extern struct domainset domainset_roundrobin; #define DOMAINSET_RR() (&domainset_roundrobin) Modified: stable/12/sys/sys/malloc.h ============================================================================== --- stable/12/sys/sys/malloc.h Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/sys/malloc.h Tue Nov 13 18:21:47 2018 (r340401) @@ -160,6 +160,7 @@ MALLOC_DECLARE(M_TEMP); */ MALLOC_DECLARE(M_IOV); +struct domainset; extern struct mtx malloc_mtx; /* @@ -172,8 +173,8 @@ void *contigmalloc(unsigned long size, struct malloc_t vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) __malloc_like __result_use_check __alloc_size(1) __alloc_align(6); -void *contigmalloc_domain(unsigned long size, struct malloc_type *type, - int domain, int flags, vm_paddr_t low, vm_paddr_t high, +void *contigmalloc_domainset(unsigned long size, struct malloc_type *type, + struct domainset *ds, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) __malloc_like __result_use_check __alloc_size(1) __alloc_align(6); void free(void *addr, struct malloc_type *type); @@ -230,8 +231,9 @@ void *malloc(size_t size, struct malloc_type *type, in _malloc_item; \ }) -void *malloc_domain(size_t size, struct malloc_type *type, int domain, - int flags) __malloc_like __result_use_check __alloc_size(1); +void *malloc_domainset(size_t size, struct malloc_type *type, + struct domainset *ds, int flags) __malloc_like __result_use_check + __alloc_size(1); void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size2(1, 2); Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/vm/uma_core.c Tue Nov 13 18:21:47 2018 (r340401) @@ -1172,7 +1172,7 @@ page_alloc(uma_zone_t zone, vm_size_t bytes, int domai void *p; /* Returned page */ *pflag = UMA_SLAB_KERNEL; - p = (void *) kmem_malloc_domain(domain, bytes, wait); + p = (void *)kmem_malloc_domainset(DOMAINSET_FIXED(domain), bytes, wait); return (p); } @@ -3718,6 +3718,7 @@ uma_zone_exhausted_nolock(uma_zone_t zone) void * uma_large_malloc_domain(vm_size_t size, int domain, int wait) { + struct domainset *policy; vm_offset_t addr; uma_slab_t slab; @@ -3729,10 +3730,9 @@ uma_large_malloc_domain(vm_size_t size, int domain, in slab = zone_alloc_item(slabzone, NULL, domain, wait); if (slab == NULL) return (NULL); - if (domain == UMA_ANYDOMAIN) - addr = kmem_malloc(size, wait); - else - addr = kmem_malloc_domain(domain, size, wait); + policy = (domain == UMA_ANYDOMAIN) ? DOMAINSET_RR() : + DOMAINSET_FIXED(domain); + addr = kmem_malloc_domainset(policy, size, wait); if (addr != 0) { vsetslab(addr, slab); slab->us_data = (void *)addr; Modified: stable/12/sys/vm/vm_extern.h ============================================================================== --- stable/12/sys/vm/vm_extern.h Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/vm/vm_extern.h Tue Nov 13 18:21:47 2018 (r340401) @@ -44,6 +44,7 @@ struct vmem; #ifdef _KERNEL struct cdev; struct cdevsw; +struct domainset; /* These operate on kernel virtual addresses only. */ vm_offset_t kva_alloc(vm_size_t); @@ -56,16 +57,17 @@ void kmap_free_wakeup(vm_map_t, vm_offset_t, vm_size_t /* These operate on virtual addresses backed by memory. */ vm_offset_t kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); -vm_offset_t kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, - vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); +vm_offset_t kmem_alloc_attr_domainset(struct domainset *ds, vm_size_t size, + int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); vm_offset_t kmem_alloc_contig(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); -vm_offset_t kmem_alloc_contig_domain(int domain, vm_size_t size, int flags, - vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, - vm_memattr_t memattr); +vm_offset_t kmem_alloc_contig_domainset(struct domainset *ds, vm_size_t size, + int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, + vm_paddr_t boundary, vm_memattr_t memattr); vm_offset_t kmem_malloc(vm_size_t size, int flags); -vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags); +vm_offset_t kmem_malloc_domainset(struct domainset *ds, vm_size_t size, + int flags); void kmem_free(vm_offset_t addr, vm_size_t size); /* This provides memory for previously allocated address space. */ Modified: stable/12/sys/vm/vm_kern.c ============================================================================== --- stable/12/sys/vm/vm_kern.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/vm/vm_kern.c Tue Nov 13 18:21:47 2018 (r340401) @@ -175,7 +175,7 @@ kva_free(vm_offset_t addr, vm_size_t size) * necessarily physically contiguous. If M_ZERO is specified through the * given flags, then the pages are zeroed before they are mapped. */ -vm_offset_t +static vm_offset_t kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr) { @@ -231,11 +231,20 @@ vm_offset_t kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr) { + + return (kmem_alloc_attr_domainset(DOMAINSET_RR(), size, flags, low, + high, memattr)); +} + +vm_offset_t +kmem_alloc_attr_domainset(struct domainset *ds, vm_size_t size, int flags, + vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr) +{ struct vm_domainset_iter di; vm_offset_t addr; int domain; - vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); do { addr = kmem_alloc_attr_domain(domain, size, flags, low, high, memattr); @@ -254,7 +263,7 @@ kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t * through the given flags, then the pages are zeroed before they are * mapped. */ -vm_offset_t +static vm_offset_t kmem_alloc_contig_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) @@ -315,11 +324,21 @@ vm_offset_t kmem_alloc_contig(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { + + return (kmem_alloc_contig_domainset(DOMAINSET_RR(), size, flags, low, + high, alignment, boundary, memattr)); +} + +vm_offset_t +kmem_alloc_contig_domainset(struct domainset *ds, vm_size_t size, int flags, + vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr) +{ struct vm_domainset_iter di; vm_offset_t addr; int domain; - vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); do { addr = kmem_alloc_contig_domain(domain, size, flags, low, high, alignment, boundary, memattr); @@ -368,11 +387,11 @@ kmem_suballoc(vm_map_t parent, vm_offset_t *min, vm_of } /* - * kmem_malloc: + * kmem_malloc_domain: * * Allocate wired-down pages in the kernel's address space. */ -vm_offset_t +static vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags) { vmem_t *arena; @@ -402,11 +421,18 @@ kmem_malloc_domain(int domain, vm_size_t size, int fla vm_offset_t kmem_malloc(vm_size_t size, int flags) { + + return (kmem_malloc_domainset(DOMAINSET_RR(), size, flags)); +} + +vm_offset_t +kmem_malloc_domainset(struct domainset *ds, vm_size_t size, int flags) +{ struct vm_domainset_iter di; vm_offset_t addr; int domain; - vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); do { addr = kmem_malloc_domain(domain, size, flags); if (addr != 0) Modified: stable/12/sys/x86/iommu/busdma_dmar.c ============================================================================== --- stable/12/sys/x86/iommu/busdma_dmar.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/x86/iommu/busdma_dmar.c Tue Nov 13 18:21:47 2018 (r340401) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -373,16 +374,16 @@ dmar_bus_dmamap_create(bus_dma_tag_t dmat, int flags, WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); tag = (struct bus_dma_tag_dmar *)dmat; - map = malloc_domain(sizeof(*map), M_DMAR_DMAMAP, - tag->common.domain, M_NOWAIT | M_ZERO); + map = malloc_domainset(sizeof(*map), M_DMAR_DMAMAP, + DOMAINSET_PREF(tag->common.domain), M_NOWAIT | M_ZERO); if (map == NULL) { *mapp = NULL; return (ENOMEM); } if (tag->segments == NULL) { - tag->segments = malloc_domain(sizeof(bus_dma_segment_t) * + tag->segments = malloc_domainset(sizeof(bus_dma_segment_t) * tag->common.nsegments, M_DMAR_DMAMAP, - tag->common.domain, M_NOWAIT); + DOMAINSET_PREF(tag->common.domain), M_NOWAIT); if (tag->segments == NULL) { free_domain(map, M_DMAR_DMAMAP); *mapp = NULL; @@ -447,13 +448,13 @@ dmar_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr if (tag->common.maxsize < PAGE_SIZE && tag->common.alignment <= tag->common.maxsize && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc_domain(tag->common.maxsize, M_DEVBUF, - tag->common.domain, mflags); + *vaddr = malloc_domainset(tag->common.maxsize, M_DEVBUF, + DOMAINSET_PREF(tag->common.domain), mflags); map->flags |= BUS_DMAMAP_DMAR_MALLOC; } else { - *vaddr = (void *)kmem_alloc_attr_domain(tag->common.domain, - tag->common.maxsize, mflags, 0ul, BUS_SPACE_MAXADDR, - attr); + *vaddr = (void *)kmem_alloc_attr_domainset( + DOMAINSET_PREF(tag->common.domain), tag->common.maxsize, + mflags, 0ul, BUS_SPACE_MAXADDR, attr); map->flags |= BUS_DMAMAP_DMAR_KMEM_ALLOC; } if (*vaddr == NULL) { Modified: stable/12/sys/x86/x86/busdma_bounce.c ============================================================================== --- stable/12/sys/x86/x86/busdma_bounce.c Tue Nov 13 18:20:27 2018 (r340400) +++ stable/12/sys/x86/x86/busdma_bounce.c Tue Nov 13 18:21:47 2018 (r340401) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -294,9 +295,9 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags error = 0; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc_domain( + dmat->segments = (bus_dma_segment_t *)malloc_domainset( sizeof(bus_dma_segment_t) * dmat->common.nsegments, - M_DEVBUF, dmat->common.domain, M_NOWAIT); + M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -317,8 +318,8 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags } bz = dmat->bounce_zone; - *mapp = (bus_dmamap_t)malloc_domain(sizeof(**mapp), M_DEVBUF, - dmat->common.domain, M_NOWAIT | M_ZERO); + *mapp = (bus_dmamap_t)malloc_domainset(sizeof(**mapp), M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), M_NOWAIT | M_ZERO); if (*mapp == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -411,9 +412,9 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad *mapp = NULL; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc_domain( + dmat->segments = (bus_dma_segment_t *)malloc_domainset( sizeof(bus_dma_segment_t) * dmat->common.nsegments, - M_DEVBUF, dmat->common.domain, mflags); + M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), mflags); if (dmat->segments == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->common.flags, ENOMEM); @@ -452,20 +453,21 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad (dmat->common.alignment <= dmat->common.maxsize) && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc_domain(dmat->common.maxsize, M_DEVBUF, - dmat->common.domain, mflags); + *vaddr = malloc_domainset(dmat->common.maxsize, M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), mflags); } else if (dmat->common.nsegments >= howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && dmat->common.alignment <= PAGE_SIZE && (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ - *vaddr = (void *)kmem_alloc_attr_domain(dmat->common.domain, - dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, - attr); + *vaddr = (void *)kmem_alloc_attr_domainset( + DOMAINSET_PREF(dmat->common.domain), dmat->common.maxsize, + mflags, 0ul, dmat->common.lowaddr, attr); dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; } else { - *vaddr = (void *)kmem_alloc_contig_domain(dmat->common.domain, - dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, + *vaddr = (void *)kmem_alloc_contig_domainset( + DOMAINSET_PREF(dmat->common.domain), dmat->common.maxsize, + mflags, 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, dmat->common.boundary, attr); dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; @@ -1149,14 +1151,14 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) while (numpages > 0) { struct bounce_page *bpage; - bpage = (struct bounce_page *)malloc_domain(sizeof(*bpage), - M_DEVBUF, dmat->common.domain, M_NOWAIT | M_ZERO); + bpage = malloc_domainset(sizeof(*bpage), M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), M_NOWAIT | M_ZERO); if (bpage == NULL) break; - bpage->vaddr = (vm_offset_t)contigmalloc_domain(PAGE_SIZE, - M_DEVBUF, dmat->common.domain, M_NOWAIT, 0ul, - bz->lowaddr, PAGE_SIZE, 0); + bpage->vaddr = (vm_offset_t)contigmalloc_domainset(PAGE_SIZE, + M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), M_NOWAIT, + 0ul, bz->lowaddr, PAGE_SIZE, 0); if (bpage->vaddr == 0) { free_domain(bpage, M_DEVBUF); break; From owner-svn-src-all@freebsd.org Tue Nov 13 18:40:02 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 18:49:44 2018 Return-Path: Delivered-To: svn-src-all@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 8D182112DD12; Tue, 13 Nov 2018 18:49:44 +0000 (UTC) (envelope-from scottl@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 1A17E728EB; Tue, 13 Nov 2018 18:49:44 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF5661422A; Tue, 13 Nov 2018 18:49:43 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADInh0X035754; Tue, 13 Nov 2018 18:49:43 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADInhkw035752; Tue, 13 Nov 2018 18:49:43 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201811131849.wADInhkw035752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 13 Nov 2018 18:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340403 - in stable/11/sys/dev: mpr mps X-SVN-Group: stable-11 X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in stable/11/sys/dev: mpr mps X-SVN-Commit-Revision: 340403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A17E728EB 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)[4]; 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)[]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 18:49:44 -0000 Author: scottl Date: Tue Nov 13 18:49:43 2018 New Revision: 340403 URL: https://svnweb.freebsd.org/changeset/base/340403 Log: Fix a regression from prior to 11.2 that caused MSI (not MSI-X) interrupt allocation to fail. While here, refactor the code so that it's more clear and less likely to break in the future. This is not an MFC due to the code in 12/head being very different, but it follows the latter's structure more closely than before. Reported by: Harry Schmalzbauer Modified: stable/11/sys/dev/mpr/mpr_pci.c stable/11/sys/dev/mps/mps_pci.c Modified: stable/11/sys/dev/mpr/mpr_pci.c ============================================================================== --- stable/11/sys/dev/mpr/mpr_pci.c Tue Nov 13 18:40:01 2018 (r340402) +++ stable/11/sys/dev/mpr/mpr_pci.c Tue Nov 13 18:49:43 2018 (r340403) @@ -262,12 +262,16 @@ mpr_pci_alloc_interrupts(struct mpr_softc *sc) error = 0; msgs = 0; - if ((sc->disable_msix == 0) && - ((msgs = pci_msix_count(dev)) >= MPR_MSI_COUNT)) - error = mpr_alloc_msix(sc, MPR_MSI_COUNT); - if ((error != 0) && (sc->disable_msi == 0) && - ((msgs = pci_msi_count(dev)) >= MPR_MSI_COUNT)) - error = mpr_alloc_msi(sc, MPR_MSI_COUNT); + if (sc->disable_msix == 0) { + msgs = pci_msix_count(dev); + if (msgs >= MPR_MSI_COUNT) + error = mpr_alloc_msix(sc, MPR_MSI_COUNT); + } + if (((error != 0) || (msgs == 0)) && (sc->disable_msi == 0)) { + msgs = pci_msi_count(dev); + if (msgs >= MPR_MSI_COUNT) + error = mpr_alloc_msi(sc, MPR_MSI_COUNT); + } if (error != 0) msgs = 0; Modified: stable/11/sys/dev/mps/mps_pci.c ============================================================================== --- stable/11/sys/dev/mps/mps_pci.c Tue Nov 13 18:40:01 2018 (r340402) +++ stable/11/sys/dev/mps/mps_pci.c Tue Nov 13 18:49:43 2018 (r340403) @@ -247,12 +247,16 @@ mps_pci_alloc_interrupts(struct mps_softc *sc) error = 0; msgs = 0; - if ((sc->disable_msix == 0) && - ((msgs = pci_msix_count(dev)) >= MPS_MSI_COUNT)) - error = mps_alloc_msix(sc, MPS_MSI_COUNT); - if ((error != 0) && (sc->disable_msi == 0) && - ((msgs = pci_msi_count(dev)) >= MPS_MSI_COUNT)) - error = mps_alloc_msi(sc, MPS_MSI_COUNT); + if (sc->disable_msix == 0) { + msgs = pci_msix_count(dev); + if (msgs >= MPS_MSI_COUNT) + error = mps_alloc_msix(sc, MPS_MSI_COUNT); + } + if (((error != 0) || (msgs == 0)) && (sc->disable_msi == 0)) { + msgs = pci_msi_count(dev); + if (msgs >= MPS_MSI_COUNT) + error = mps_alloc_msi(sc, MPS_MSI_COUNT); + } if (error != 0) msgs = 0; From owner-svn-src-all@freebsd.org Tue Nov 13 19:02:12 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 19:44:42 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 19:51:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 19:53:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 20:07:57 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 20:40:19 2018 Return-Path: Delivered-To: svn-src-all@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 6FDF51131437 for ; Tue, 13 Nov 2018 20:40:19 +0000 (UTC) (envelope-from scr18-proc@ccrr.jp) Received: from www900.sakura.ne.jp (www900.sakura.ne.jp [219.94.128.110]) (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 D62F576F39 for ; Tue, 13 Nov 2018 20:40:16 +0000 (UTC) (envelope-from scr18-proc@ccrr.jp) Received: from WIN-2LPEFJ7HNBJ (ec2-52-199-66-0.ap-northeast-1.compute.amazonaws.com [52.199.66.0]) (authenticated bits=0) by www900.sakura.ne.jp (8.15.2/8.15.2) with ESMTPA id wADKY41w025169 for ; Wed, 14 Nov 2018 05:40:05 +0900 (JST) (envelope-from scr18-proc@ccrr.jp) Message-Id: <201811132040.wADKY41w025169@www900.sakura.ne.jp> From: "Charles Mayiga" Subject: AN INVESTMENT OFFER. To: svn-src-all@freebsd.org MIME-Version: 1.0 Reply-To: charlesmayiga@investportals.com Date: Tue, 13 Nov 2018 20:39:58 +0000 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D62F576F39 X-Spamd-Result: default: False [9.17 / 200.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[charlesmayiga@investportals.com]; R_MISSING_CHARSET(2.50)[]; R_SPF_ALLOW(0.00)[+a:www900.sakura.ne.jp]; TO_DN_NONE(0.00)[]; MX_GOOD(-0.01)[ccrr.jp]; SUBJ_ALL_CAPS(1.50)[20]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.34)[ipnet: 219.94.128.0/17(0.33), asn: 9371(1.49), country: JP(-0.10)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:9371, ipnet:219.94.128.0/17, country:JP]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.84)[0.845,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[ccrr.jp]; NEURAL_SPAM_MEDIUM(1.00)[0.998,0]; RCPT_COUNT_ONE(0.00)[1]; BAD_REP_POLICIES(0.10)[]; RBL_VIRUSFREE_BOTNET(2.00)[110.128.94.219.bip.virusfree.cz : 127.0.0.2]; NEURAL_SPAM_LONG(1.00)[0.996,0]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; GREYLIST(0.00)[pass,body] X-Rspamd-Server: mx1.freebsd.org X-Spam: Yes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 20:40:19 -0000 Greetings, We are international project financiers and we specialize in both star= t up projects and existing businesses needing funding or Loan for expa= nsion. We are committed to helping businesses develop and succeed. We will like to partner with you/your company should you be interested= or may require funding for the expansion of your business. We will be= glad to receiving your terms and condition before proceeding further. We are currently seeking means of expanding and relocating our busines= s interest and we are open for discussion to any lucrative investments= you can recommend to us which will be implemented under a blind trust= investment venture. Looking forward to hear from you. Sincere regards, Charles Mayiga. From owner-svn-src-all@freebsd.org Tue Nov 13 20:48:07 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 21:29:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 21:41:01 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 22:41:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 22:58:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 23:08:47 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 23:20:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 23:44:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 23:45:39 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 23:53:26 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Nov 13 23:57:35 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 00:12:06 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 00:21:54 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 00:21:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 00:33:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 00:46:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 00:53:16 2018 Return-Path: Delivered-To: svn-src-all@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 AB3C91102C6A for ; Wed, 14 Nov 2018 00:53:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12a.google.com (mail-it1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 D3AFF84397 for ; Wed, 14 Nov 2018 00:53:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12a.google.com with SMTP id r12-v6so21391991ita.3 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=Z+BLiJENpNnMI1Hp39gEFtmWpSjTWrGbWfQZ60q+SOa4AbURa+A+Dt8pRu741WgyiB aWLEgwul7GuWFoS+6WcWwzYr9rcnGNGCUhEuYWW2YpxnL5IBEGUSH9GEwLW/RC18Pkqh wmfZZr9nwxzztg7sPQCZhiZB0N5si0c3vFjryboUzhui30meeGl8t0wSYAANf9+URv06 zrHf37j0c5QWdaeSZy6OZmp/LQoJAnTE4m/YATQoNYkIVWbMJ+RPasHZO9uiGYdGq5B2 w2xAfLq2JoWtlWJYwz81/aZZCkI7vNm+5iZTDPKq7DCA5/qgZskm5G0d2ZXOmFlnAdXp V59w== X-Gm-Message-State: AGRZ1gLOIoBdeGEW0hxixn2m7OTKf4y3oUnMJM7bvZyo2aY/9niZPRd1 trV6PXK3iNYv0x/0M2bLF0saLZK+QcUk/oc9Duzt6Q== 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: D3AFF84397 X-Spamd-Result: default: False [-4.73 / 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.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@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)[a.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]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.74)[ip: (-4.00), 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 03:42:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 04:50:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 08:45:50 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 09:06:17 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 09:34:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 09:46:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 10:07:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 13:06:49 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 14:18:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 14:26:34 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 15:15:08 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 15:16:46 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 15:23:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 15:26:00 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 15:39:50 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 16:15:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 16:18:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 16:19:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 16:28:34 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 16:33:32 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 16:33:46 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 18:12:54 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 18:24:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 18:28:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 18:38:28 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 18:39:03 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 18:45:35 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 19:06:45 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 19:10:36 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 19:12:53 2018 Return-Path: Delivered-To: svn-src-all@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 CBABC11320EE for ; Wed, 14 Nov 2018 19:12:53 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 082DF8618F; Wed, 14 Nov 2018 19:12:53 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x32f.google.com with SMTP id f10-v6so16488558wme.3; Wed, 14 Nov 2018 11:12:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=A4d5y1A0J8uIeT/WrcrbAnSuFLZfNqj5ZDvypm4NL2k=; b=rbOv8s8Be88+MJjJYzglnt1vM66tmBQpPhrw64jxZknmLqf532g/7XMQvk3I884oaR ad4f6ZN8i6vXffst3eXMW+pEhLuCvMWI4XE+WuVMNXP4BMJlUtekqDezU4Bv75JXnPts OmxHDvuy0pQ8BI0b7wxjAO1bPcSOJPGUwcUf2rvLQCA/6QDourDBVG+EshbMnRdnCjxY 3NuPXG7ukD3pnFvd52kVDgO/CowmnxgtMkfxQqyke1DOkCB4fk3TErx1KGz0QeGy8ajm cPpZrZoO3vjFvzyWwztJ+0j7P1cS12YVMbW9/QdoRR1RUOiudL5kc3hem8gq/HEHSwb0 CsCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=A4d5y1A0J8uIeT/WrcrbAnSuFLZfNqj5ZDvypm4NL2k=; b=NDBFIvsPcqbECGCUWTAVyol9kU8qtKXINzaHHthn5VI0Yj4YMXv4Zj5RvPSShOAQwI f42vj/nGrP9peNlD4Wv+NeXJkVD0IGEh86i94tg0jkQQYVxPCrB1DUFqiIaclio3GwJ1 PXxdP/h47afE+c6jB8RkC1JoU0IcumEtD3GG3a+5fedLp7Dg03eA+sgsVu8Ryr2BnY2R M49fj6vUOz6wpIgmzxxjnrK1BIz2TBg3Trv6dx2akNvLc4VLuwyQkZ4efvGbKkysOCMQ nFFpQpUSZb4apERi/P4hmsRVdpoMVUHd/s0erNp7zBzrlpHdLLNaGpxggEFc/jBaP9WP uboA== X-Gm-Message-State: AGRZ1gL0mFyGsdgeJh7CjO0jsH9UfUx2011fvX/DllifA44I7HCXvDOE 6kEn70GLf6r6vilSt/AvWFGhn/JI X-Google-Smtp-Source: AJdET5ffHCDoRwwIFw4uFK92YzGY0eDyKQaEq8tJKj70J9D/MBFxkMYRjOFQeMELlo0UhkReca4Qwg== X-Received: by 2002:a7b:c083:: with SMTP id r3-v6mr2928168wmh.101.1542222771714; Wed, 14 Nov 2018 11:12:51 -0800 (PST) Received: from ernst.home (p5B02380D.dip0.t-ipconnect.de. [91.2.56.13]) by smtp.gmail.com with ESMTPSA id y4-v6sm34047271wrd.61.2018.11.14.11.12.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 11:12:50 -0800 (PST) Date: Wed, 14 Nov 2018 20:12:47 +0100 From: Gary Jennejohn To: svn-src-all@freebsd.org Cc: rgrimes@freebsd.org Subject: Re: svn commit: r340426 - head/sys/dev/amdtemp Message-ID: <20181114201247.12cee208@ernst.home> In-Reply-To: <201811141633.wAEGXSsn036705@pdx.rh.CN85.dnsmgr.net> References: <201811140450.wAE4oUWW043645@repo.freebsd.org> <201811141633.wAEGXSsn036705@pdx.rh.CN85.dnsmgr.net> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.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: 082DF8618F X-Spamd-Result: default: False [-4.64 / 200.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.88)[-0.880,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; IP_SCORE(-0.75)[ipnet: 2a00:1450::/32(-1.84), asn: 15169(-1.80), country: US(-0.10)]; 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_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[f.2.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] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 19:12:54 -0000 On Wed, 14 Nov 2018 08:33:28 -0800 (PST) "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. > Actually, me@ (Michael Elbel) was never a committer. He worked with Jordan (jkh@) and myself (gj@) in Germany and Jordan gave him a login on freefall in the very early FreeBSD days. But, it might be less confusing to use myself rather than me in log messages. -- Gary Jennejohn From owner-svn-src-all@freebsd.org Wed Nov 14 19:19:47 2018 Return-Path: Delivered-To: svn-src-all@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 9613111323B8 for ; Wed, 14 Nov 2018 19:19:47 +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 C8DC6863A7 for ; Wed, 14 Nov 2018 19:19:46 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1542222214; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=CE2XcoFqaduAhgYVyLxS6bPqFZm0UsOBG/AXmw5N0QbFbB7Cvc9c/pv/AB0OF+D9brwpZ2G+xn/uM yEeH0p+4PQAO/inNx9tmlKPC/eWhrpka4WsHFaNvM3cvQhC9gof0Osvn4Bix2eJbqGdK85m/f+6AFG 7yGXqUDC0/ytR9Ggc8LJJvPi6svLMue1Me0JmeUOynzHq5Nzn7TMN4WuS32sVZBNnH7Sf8pRg+q4i2 BbJL8s8NgQFOx3HcbaXjTEBdz4Vopvucu3RNQgfZFBL47Nq94sRNg+CaU4rtkFRyQyuljONeJhDurk /SP26N+v4xQIOXS0WiRH+s+40D0xUZQ== 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: C8DC6863A7 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 19:19:47 -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-all@freebsd.org Wed Nov 14 19:44:39 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 20:28:05 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 20:35:06 2018 Return-Path: Delivered-To: svn-src-all@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 09BF4113469B; Wed, 14 Nov 2018 20:35:06 +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 7CF9F6B1D7; Wed, 14 Nov 2018 20:35:05 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5922C240BD; Wed, 14 Nov 2018 20:35:05 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAEKZ57U031856; Wed, 14 Nov 2018 20:35:05 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEKZ4Jk031853; Wed, 14 Nov 2018 20:35:04 GMT (envelope-from se@FreeBSD.org) Message-Id: <201811142035.wAEKZ4Jk031853@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 20:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340444 - in stable/12: . usr.sbin/ctm/ctm X-SVN-Group: stable-12 X-SVN-Commit-Author: se X-SVN-Commit-Paths: in stable/12: . usr.sbin/ctm/ctm X-SVN-Commit-Revision: 340444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CF9F6B1D7 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)[4]; 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)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 20:35:06 -0000 Author: se Date: Wed Nov 14 20:35:04 2018 New Revision: 340444 URL: https://svnweb.freebsd.org/changeset/base/340444 Log: MFC S340428: 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: re Relnotes: yes Differential Revision: https://reviews.freebsd.org/D17969 Modified: stable/12/UPDATING stable/12/usr.sbin/ctm/ctm/ctm.1 stable/12/usr.sbin/ctm/ctm/ctm.c Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Wed Nov 14 19:10:35 2018 (r340443) +++ stable/12/UPDATING Wed Nov 14 20:35:04 2018 (r340444) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +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. A depreciation warning will be printed to stderr by + the ctm command, but the functionality will remain in base for all + FreeBSD-12 releases. + 20181019: The stable/12 branch has been created in subversion from head revision r339432. Modified: stable/12/usr.sbin/ctm/ctm/ctm.1 ============================================================================== --- stable/12/usr.sbin/ctm/ctm/ctm.1 Wed Nov 14 19:10:35 2018 (r340443) +++ stable/12/usr.sbin/ctm/ctm/ctm.1 Wed Nov 14 20:35:04 2018 (r340444) @@ -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: stable/12/usr.sbin/ctm/ctm/ctm.c ============================================================================== --- stable/12/usr.sbin/ctm/ctm/ctm.c Wed Nov 14 19:10:35 2018 (r340443) +++ stable/12/usr.sbin/ctm/ctm/ctm.c Wed Nov 14 20:35:04 2018 (r340444) @@ -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-all@freebsd.org Wed Nov 14 20:36:20 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 20:46:36 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 21:08:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Nov 14 21:31:28 2018 Return-Path: Delivered-To: svn-src-all@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 1AA661135EEB; Wed, 14 Nov 2018 21:31:28 +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 9E1FF6D7C2; Wed, 14 Nov 2018 21:31:27 +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 7F53224A85; Wed, 14 Nov 2018 21:31:27 +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 wAELVRrl059620; Wed, 14 Nov 2018 21:31:27 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAELVRRC059619; Wed, 14 Nov 2018 21:31:27 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811142131.wAELVRRC059619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 14 Nov 2018 21:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340446 - in stable/12/sys/dev: amdsmn amdtemp X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in stable/12/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 340446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E1FF6D7C2 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 21:31:28 -0000 Author: vangyzen Date: Wed Nov 14 21:31:26 2018 New Revision: 340446 URL: https://svnweb.freebsd.org/changeset/base/340446 Log: MFC r340425 (by cem) 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 Early MFC approved by: cem Approved by: re (kib) Relnotes: yes Modified: stable/12/sys/dev/amdsmn/amdsmn.c stable/12/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/amdsmn/amdsmn.c ============================================================================== --- stable/12/sys/dev/amdsmn/amdsmn.c Wed Nov 14 20:36:18 2018 (r340445) +++ stable/12/sys/dev/amdsmn/amdsmn.c Wed Nov 14 21:31:26 2018 (r340446) @@ -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: stable/12/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/12/sys/dev/amdtemp/amdtemp.c Wed Nov 14 20:36:18 2018 (r340445) +++ stable/12/sys/dev/amdtemp/amdtemp.c Wed Nov 14 21:31:26 2018 (r340446) @@ -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-all@freebsd.org Wed Nov 14 22:05:21 2018 Return-Path: Delivered-To: svn-src-all@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 38A251101516; Wed, 14 Nov 2018 22:05: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 8E5D36FB14; Wed, 14 Nov 2018 22:05: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 6F4DE24FC5; Wed, 14 Nov 2018 22:05: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 wAEM5Kwg080999; Wed, 14 Nov 2018 22:05:20 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAEM5KmV080998; Wed, 14 Nov 2018 22:05:20 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811142205.wAEM5KmV080998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 14 Nov 2018 22:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340447 - stable/12/sys/dev/amdtemp X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/12/sys/dev/amdtemp X-SVN-Commit-Revision: 340447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E5D36FB14 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 22:05:21 -0000 Author: vangyzen Date: Wed Nov 14 22:05:20 2018 New Revision: 340447 URL: https://svnweb.freebsd.org/changeset/base/340447 Log: MFC r340426 (by cem) 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: cem (long ago) Approved by: re (kib) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16855 Modified: stable/12/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/12/sys/dev/amdtemp/amdtemp.c Wed Nov 14 21:31:26 2018 (r340446) +++ stable/12/sys/dev/amdtemp/amdtemp.c Wed Nov 14 22:05:20 2018 (r340447) @@ -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-all@freebsd.org Wed Nov 14 23:15:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 01:15:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 08:43:18 2018 Return-Path: Delivered-To: svn-src-all@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 2006A112D8F4; Thu, 15 Nov 2018 08:43:18 +0000 (UTC) (envelope-from ygy@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 9BAC88A512; Thu, 15 Nov 2018 08:43:17 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DCAA4279; Thu, 15 Nov 2018 08:43:17 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAF8hHEB017443; Thu, 15 Nov 2018 08:43:17 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAF8hH3j017442; Thu, 15 Nov 2018 08:43:17 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811150843.wAF8hH3j017442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Thu, 15 Nov 2018 08:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340449 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 340449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BAC88A512 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 08:43:18 -0000 Author: ygy (doc committer) Date: Thu Nov 15 08:43:17 2018 New Revision: 340449 URL: https://svnweb.freebsd.org/changeset/base/340449 Log: MFC r338977: Add description, parameters, options, sysctl and examples of using AQMs to ipfw man page. CoDel, PIE, FQ-CoDel and FQ-PIE AQM for Dummynet exist in FreeBSD 11 and 10.3. Submitted by: ralsaadi@swin.edu.au Reviewed by: AllanJude Differential Revision: https://reviews.freebsd.org/D12507 Modified: stable/11/sbin/ipfw/ipfw.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Wed Nov 14 23:15:50 2018 (r340448) +++ stable/11/sbin/ipfw/ipfw.8 Thu Nov 15 08:43:17 2018 (r340449) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2018 +.Dd September 27, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -2711,7 +2711,7 @@ The following case-insensitive parameters can be confi scheduler: .Pp .Bl -tag -width indent -compact -.It Cm type Ar {fifo | wf2q+ | rr | qfq} +.It Cm type Ar {fifo | wf2q+ | rr | qfq | fq_codel | fq_pie} specifies the scheduling algorithm to use. .Bl -tag -width indent -compact .It Cm fifo @@ -2738,9 +2738,70 @@ with poor service guarantees. implements the QFQ algorithm, which is a very fast variant of WF2Q+, with similar service guarantees and O(1) processing costs (roughly, 200-250ns per packet). +.It Cm fq_codel +implements the FQ-CoDel (FlowQueue-CoDel) scheduler/AQM algorithm, which +uses a modified Deficit Round Robin scheduler to manage two lists of sub-queues +(old sub-queues and new sub-queues) for providing brief periods of priority to +lightweight or short burst flows. +By default, the total number of sub-queues is 1024. +FQ-CoDel's internal, dynamically +created sub-queues are controlled by separate instances of CoDel AQM. +.It Cm fq_pie +implements the FQ-PIE (FlowQueue-PIE) scheduler/AQM algorithm, which similar to +.Cm fq_codel +but uses per sub-queue PIE AQM instance to control the queue delay. .El +.Pp +.Cm fq_codel +inherits AQM parameters and options from +.Cm codel +(see below), and +.Cm fq_pie +inherits AQM parameters and options from +.Cm pie +(see below). +Additionally, both of +.Cm fq_codel +and +.Cm fq_pie +have shared scheduler parameters which are: +.Bl -tag -width indent +.It Cm quantum +.Ar m +specifies the quantum (credit) of the scheduler. +.Ar m +is the number of bytes a queue can serve before being moved to the tail +of old queues list. +The default is 1514 bytes, and the maximum accepable value +is 9000 bytes. +.It Cm limit +.Ar m +specifies the hard size limit (in unit of packets) of all queues managed by an +instance of the scheduler. +The default value of +.Ar m +is 10240 packets, and the maximum accepable value is 20480 packets. +.It Cm flows +.Ar m +specifies the total number of flow queues (sub-queues) that fq_* +creates and manages. +By default, 1024 sub-queues are created when an instance +of the fq_{codel/pie} scheduler is created. +The maximum accepable value is +65536. .El .Pp +Note that any token after +.Cm fq_codel +or +.Cm fq_pie +is considered a parameter for fq_{codel/pie}. +So, ensure all scheduler +configuration options not related to fq_{codel/pie} are written before +.Cm fq_codel/fq_pie +tokens. +.El +.Pp In addition to the type, all parameters allowed for a pipe can also be specified for a scheduler. .Pp @@ -2869,8 +2930,137 @@ greater than zero) specifies the expected maximum packet size, only used when queue thresholds are in bytes (defaults to 1500, must be greater than zero). .El +.Pp +.It Cm codel Oo Cm target Ar time Oc Oo Cm interval Ar time Oc Oo Cm ecn | +.Cm noecn Oc +Make use of the CoDel (Controlled-Delay) queue management algorithm. +.Ar time +is interpreted as milliseconds by default but seconds (s), milliseconds (ms) or +microseconds (us) can be specified instead. +CoDel drops or marks (ECN) packets +depending on packet sojourn time in the queue. +.Cm target +.Ar time +(5ms by default) is the minimum acceptable persistent queue delay that CoDel +allows. +CoDel does not drop packets directly after packets sojourn time becomes +higher than +.Cm target +.Ar time +but waits for +.Cm interval +.Ar time +(100ms default) before dropping. +.Cm interval +.Ar time +should be set to maximum RTT for all expected connections. +.Cm ecn +enables (disabled by default) packet marking (instead of dropping) for +ECN-enabled TCP flows when queue delay becomes high. +.Pp +Note that any token after +.Cm codel +is considered a parameter for CoDel. +So, ensure all pipe/queue +configuration options are written before +.Cm codel +token. +.Pp +The +.Xr sysctl 8 +variables +.Va net.inet.ip.dummynet.codel.target +and +.Va net.inet.ip.dummynet.codel.interval +can be used to set CoDel default parameters. +.Pp +.It Cm pie Oo Cm target Ar time Oc Oo Cm tupdate Ar time Oc Oo +.Cm alpha Ar n Oc Oo Cm beta Ar n Oc Oo Cm max_burst Ar time Oc Oo +.Cm max_ecnth Ar n Oc Oo Cm ecn | Cm noecn Oc Oo Cm capdrop | +.Cm nocapdrop Oc Oo Cm drand | Cm nodrand Oc Oo Cm onoff +.Oc Oo Cm dre | Cm ts Oc +Make use of the PIE (Proportional Integral controller Enhanced) queue management +algorithm. +PIE drops or marks packets depending on a calculated drop probability during +en-queue process, with the aim of achieving high throughput while keeping queue +delay low. +At regular time intervals of +.Cm tupdate +.Ar time +(15ms by default) a background process (re)calculates the probability based on queue delay +deviations from +.Cm target +.Ar time +(15ms by default) and queue delay trends. +PIE approximates current queue +delay by using a departure rate estimation method, or (optionally) by using a +packet timestamp method similar to CoDel. +.Ar time +is interpreted as milliseconds by default but seconds (s), milliseconds (ms) or +microseconds (us) can be specified instead. +The other PIE parameters and options are as follows: +.Bl -tag -width indent +.It Cm alpha Ar n +.Ar n +is a floating point number between 0 and 7 which specifies the weight of queue +delay deviations that is used in drop probability calculation. +0.125 is the default. +.It Cm beta Ar n +.Ar n +is a floating point number between 0 and 7 which specifies is the weight of queue +delay trend that is used in drop probability calculation. +1.25 is the default. +.It Cm max_burst Ar time +The maximum period of time that PIE does not drop/mark packets. +150ms is the +default and 10s is the maximum value. +.It Cm max_ecnth Ar n +Even when ECN is enabled, PIE drops packets instead of marking them when drop +probability becomes higher than ECN probability threshold +.Cm max_ecnth Ar n +, the default is 0.1 (i.e 10%) and 1 is the maximum value. +.It Cm ecn | noecn +enable or disable ECN marking for ECN-enabled TCP flows. +Disabled by default. +.It Cm capdrop | nocapdrop +enable or disable cap drop adjustment. +Cap drop adjustment is enabled by default. +.It Cm drand | nodrand +enable or disable drop probability de-randomisation. +De-randomisation eliminates +the problem of dropping packets too close or too far. +De-randomisation is enabled by default. +.It Cm onoff +enable turning PIE on and off depending on queue load. +If this option is enabled, +PIE turnes on when over 1/3 of queue becomes full. +This option is disabled by +default. +.It Cm dre | ts +Calculate queue delay using departure rate estimation +.Cm dre +or timestamps +.Cm ts . +.Cm dre +is used by default. .El .Pp +Note that any token after +.Cm pie +is considered a parameter for PIE. +So ensure all pipe/queue +the configuration options are written before +.Cm pie +token. +.Xr sysctl 8 +variables can be used to control the +.Cm pie +default parameters. +See the +.Sx SYSCTL VARIABLES +section for more details. +.El +.Pp When used with IPv6 data, .Nm dummynet currently has several limitations. @@ -3456,10 +3646,102 @@ global IP addresses, this will still result in a fully .It Va net.inet.ip.alias.sctp.up_timer: No 300 Timeout value to keep an association up with no traffic. This value cannot be 0. +.It Va net.inet.ip.dummynet.codel.interval : No 100000 +Default +.Cm codel +AQM interval in microseconds. +The value must be in the range 1..5000000. +.It Va net.inet.ip.dummynet.codel.target : No 5000 +Default +.Cm codel +AQM target delay time in microseconds (the minimum acceptable persistent queue +delay). +The value must be in the range 1..5000000. .It Va net.inet.ip.dummynet.expire : No 1 Lazily delete dynamic pipes/queue once they have no pending traffic. You can disable this by setting the variable to 0, in which case the pipes/queues will only be deleted when the threshold is reached. +.It Va net.inet.ip.dummynet.fqcodel.flows : No 1024 +Defines the default total number of flow queues (sub-queues) that +.Cm fq_codel +creates and manages. +The value must be in the range 1..65536. +.It Va net.inet.ip.dummynet.fqcodel.interval : No 100000 +Default +.Cm fq_codel +scheduler/AQM interval in microseconds. +The value must be in the range 1..5000000. +.It Va net.inet.ip.dummynet.fqcodel.limit : No 10240 +The default hard size limit (in unit of packet) of all queues managed by an +instance of the +.Cm fq_codel +scheduler. +The value must be in the range 1..20480. +.It Va net.inet.ip.dummynet.fqcodel.quantum : No 1514 +The default quantum (credit) of the +.Cm fq_codel +in unit of byte. +The value must be in the range 1..9000. +.It Va net.inet.ip.dummynet.fqcodel.target : No 5000 +Default +.Cm fq_codel +scheduler/AQM target delay time in microseconds (the minimum acceptable +persistent queue delay). +The value must be in the range 1..5000000. +.It Va net.inet.ip.dummynet.fqpie.alpha : No 125 +The default +.Ar alpha +parameter (scaled by 1000) for +.Cm fq_pie +scheduler/AQM. +The value must be in the range 1..7000. +.It Va net.inet.ip.dummynet.fqpie.beta : No 1250 +The default +.Ar beta +parameter (scaled by 1000) for +.Cm fq_pie +scheduler/AQM. +The value must be in the range 1..7000. +.It Va net.inet.ip.dummynet.fqpie.flows : No 1024 +Defines the default total number of flow queues (sub-queues) that +.Cm fq_pie +creates and manages. +The value must be in the range 1..65536. +.It Va net.inet.ip.dummynet.fqpie.limit : No 10240 +The default hard size limit (in unit of packet) of all queues managed by an +instance of the +.Cm fq_pie +scheduler. +The value must be in the range 1..20480. +.It Va net.inet.ip.dummynet.fqpie.max_burst : No 150000 +The default maximum period of microseconds that +.Cm fq_pie +scheduler/AQM does not drop/mark packets. +The value must be in the range 1..10000000. +.It Va net.inet.ip.dummynet.fqpie.max_ecnth : No 99 +The default maximum ECN probability threshold (scaled by 1000) for +.Cm fq_pie +scheduler/AQM. +The value must be in the range 1..7000. +.It Va net.inet.ip.dummynet.fqpie.quantum : No 1514 +The default quantum (credit) of the +.Cm fq_pie +in unit of byte. +The value must be in the range 1..9000. +.It Va net.inet.ip.dummynet.fqpie.target : No 15000 +The default +.Cm target +delay of the +.Cm fq_pie +in unit of microsecond. +The value must be in the range 1..5000000. +.It Va net.inet.ip.dummynet.fqpie.tupdate : No 15000 +The default +.Cm tupdate +of the +.Cm fq_pie +in unit of microsecond. +The value must be in the range 1..5000000. .It Va net.inet.ip.dummynet.hash_size : No 64 Default size of the hash table used for dynamic pipes/queues. This value is used when no @@ -3494,6 +3776,44 @@ will be expired even when .It Va net.inet.ip.dummynet.red_max_pkt_size : No 1500 Parameters used in the computations of the drop probability for the RED algorithm. +.It Va net.inet.ip.dummynet.pie.alpha : No 125 +The default +.Ar alpha +parameter (scaled by 1000) for +.Cm pie +AQM. +The value must be in the range 1..7000. +.It Va net.inet.ip.dummynet.pie.beta : No 1250 +The default +.Ar beta +parameter (scaled by 1000) for +.Cm pie +AQM. +The value must be in the range 1..7000. +.It Va net.inet.ip.dummynet.pie.max_burst : No 150000 +The default maximum period of microseconds that +.Cm pie +AQM does not drop/mark packets. +The value must be in the range 1..10000000. +.It Va net.inet.ip.dummynet.pie.max_ecnth : No 99 +The default maximum ECN probability threshold (scaled by 1000) for +.Cm pie +AQM. +The value must be in the range 1..7000. +.It Va net.inet.ip.dummynet.pie.target : No 15000 +The default +.Cm target +delay of +.Cm pie +AQM in unit of microsecond. +The value must be in the range 1..5000000. +.It Va net.inet.ip.dummynet.pie.tupdate : No 15000 +The default +.Cm tupdate +of +.Cm pie +AQM in unit of microsecond. +The value must be in the range 1..5000000. .It Va net.inet.ip.dummynet.pipe_byte_limit : No 1048576 .It Va net.inet.ip.dummynet.pipe_slot_limit : No 100 The maximum queue size that can be specified in bytes or packets. @@ -4024,6 +4344,102 @@ action, if it is not created yet. Later, this dynamic in by .Cm check-state rule. +.Ss CONFIGURING CODEL, PIE, FQ-CODEL and FQ-PIE AQM +.Cm codel +and +.Cm pie +AQM can be configured for +.Nm dummynet +.Cm pipe +or +.Cm queue. +.Pp +To configure a +.Cm pipe +with +.Cm codel +AQM using default configuration for traffic from 192.168.0.0/24 and 1Mbits/s +rate limit, we do: +.Pp +.Dl "ipfw pipe 1 config bw 1mbits/s codel" +.Dl "ipfw add 100 pipe 1 ip from 192.168.0.0/24 to any" +.Pp +To configure a +.Cm queue +with +.Cm codel +AQM using different configurations parameters for traffic from +192.168.0.0/24 and 1Mbits/s rate limit, we do: +.Pp +.Dl "ipfw pipe 1 config bw 1mbits/s" +.Dl "ipfw queue 1 config pipe 1 codel target 8ms interval 160ms ecn" +.Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" +.Pp +To configure a +.Cm pipe +with +.Cm pie +AQM using default configuration for traffic from 192.168.0.0/24 and 1Mbits/s +rate limit, we do: +.Pp +.Dl "ipfw pipe 1 config bw 1mbits/s pie" +.Dl "ipfw add 100 pipe 1 ip from 192.168.0.0/24 to any" +.Pp +To configure a +.Cm queue +with +.Cm pie +AQM using different configuration parameters for traffic from +192.168.0.0/24 and 1Mbits/s rate limit, we do: +.Pp +.Dl "ipfw pipe 1 config bw 1mbits/s" +.Dl "ipfw queue 1 config pipe 1 pie target 20ms tupdate 30ms ecn" +.Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" +.Pp +.Cm fq_codel +and +.Cm fq_pie +AQM can be configured for +.Nm dummynet +schedulers. +.Pp +To configure +.Cm fq_codel +scheduler using different configurations parameters for traffic from +192.168.0.0/24 and 1Mbits/s rate limit, we do: +.Pp +.Dl "ipfw pipe 1 config bw 1mbits/s" +.Dl "ipfw sched 1 config pipe 1 type fq_codel" +.Dl "ipfw queue 1 config sched 1" +.Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" +.Pp +To change +.Cm fq_codel +default configuration for a +.Cm sched +such as disable ECN and change the +.Ar target +to 10ms, we do: +.Pp +.Dl "ipfw sched 1 config pipe 1 type fq_codel target 10ms noecn" +.Pp +Similar to +.Cm fq_codel, +to configure +.Cm fq_pie +scheduler using different configurations parameters for traffic from +192.168.0.0/24 and 1Mbits/s rate limit, we do: +.Pp +.Dl "ipfw pipe 1 config bw 1mbits/s" +.Dl "ipfw sched 1 config pipe 1 type fq_pie" +.Dl "ipfw queue 1 config sched 1" +.Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" +.Pp +The configurations of +.Cm fq_pie +.Cm sched +can be changed in a similar way as for +.Cm fq_codel .Sh SEE ALSO .Xr cpp 1 , .Xr m4 1 , @@ -4058,7 +4474,8 @@ was introduced in Summer 2002. .An Poul-Henning Kamp , .An Alex Nash , .An Archie Cobbs , -.An Luigi Rizzo . +.An Luigi Rizzo , +.An Rasool Al-Saadi . .Pp .An -nosplit API based upon code written by @@ -4093,6 +4510,12 @@ For further information visit: Delay profiles have been developed by Alessandro Cerri and Luigi Rizzo, supported by the European Commission within Projects Onelab and Onelab2. +.Pp +CoDel, PIE, FQ-CoDel and FQ-PIE AQM for Dummynet have been implemented by +.An The Centre for Advanced Internet Architectures (CAIA) +in 2016, supported by The Comcast Innovation Fund. +The primary developer is +Rasool Al-Saadi. .Sh BUGS The syntax has grown over the years and sometimes it might be confusing. Unfortunately, backward compatibility prevents cleaning up mistakes From owner-svn-src-all@freebsd.org Thu Nov 15 14:47:44 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 16:02:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 16:02:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 16:02:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 16:02:48 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 16:03:53 2018 Return-Path: Delivered-To: svn-src-all@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 6AFDE1101DB0; Thu, 15 Nov 2018 16:03:53 +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 ECBEA729EB; Thu, 15 Nov 2018 16:03:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD26510A88; Thu, 15 Nov 2018 16:03:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFG3qgx041125; Thu, 15 Nov 2018 16:03:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFG3qum041124; Thu, 15 Nov 2018 16:03:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811151603.wAFG3qum041124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Nov 2018 16:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340454 - stable/12/lib/libbe X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/lib/libbe X-SVN-Commit-Revision: 340454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECBEA729EB 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 16:03:53 -0000 Author: kevans Date: Thu Nov 15 16:03:52 2018 New Revision: 340454 URL: https://svnweb.freebsd.org/changeset/base/340454 Log: MFC r340334: libbe(3): Set canmount properly when activating a new BE The previously activated BE should have canmount=noauto set on it upon activation of the new BE, but we previously did not touch canmount on either old or new BE. PR: 233113 Approved by: re (gjb) Modified: stable/12/lib/libbe/be.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Thu Nov 15 16:02:45 2018 (r340453) +++ stable/12/lib/libbe/be.c Thu Nov 15 16:03:52 2018 (r340454) @@ -922,7 +922,22 @@ be_set_nextboot(libbe_handle_t *lbh, nvlist_t *config, return (0); } +/* + * Deactivate old BE dataset; currently just sets canmount=noauto + */ +static int +be_deactivate(libbe_handle_t *lbh, const char *ds) +{ + zfs_handle_t *zfs; + if ((zfs = zfs_open(lbh->lzh, ds, ZFS_TYPE_DATASET)) == NULL) + return (1); + if (zfs_prop_set(zfs, "canmount", "noauto") != 0) + return (1); + zfs_close(zfs); + return (0); +} + int be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary) { @@ -961,6 +976,9 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, return (be_set_nextboot(lbh, vdevs, pool_guid, buf)); } else { + if (be_deactivate(lbh, lbh->bootfs) != 0) + return (-1); + /* Obtain bootenv zpool */ err = zpool_set_prop(lbh->active_phandle, "bootfs", be_path); if (err) From owner-svn-src-all@freebsd.org Thu Nov 15 16:13:26 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 16:29:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 16:43:00 2018 Return-Path: Delivered-To: svn-src-all@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 917DB1102EBA; Thu, 15 Nov 2018 16:43:00 +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 05ECD74160; Thu, 15 Nov 2018 16:43:00 +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 DAD3B11109; Thu, 15 Nov 2018 16:42:59 +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 wAFGgxk0062087; Thu, 15 Nov 2018 16:42:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFGgxuZ062086; Thu, 15 Nov 2018 16:42:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811151642.wAFGgxuZ062086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 15 Nov 2018 16:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340457 - stable/12/release/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12/release/scripts X-SVN-Commit-Revision: 340457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05ECD74160 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 16:43:00 -0000 Author: gjb Date: Thu Nov 15 16:42:59 2018 New Revision: 340457 URL: https://svnweb.freebsd.org/changeset/base/340457 Log: MFC r340406: 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. Approved by: re (rgrimes) Sponsored by: The FreeBSD Foundation Modified: stable/12/release/scripts/make-manifest.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/release/scripts/make-manifest.sh ============================================================================== --- stable/12/release/scripts/make-manifest.sh Thu Nov 15 16:29:27 2018 (r340456) +++ stable/12/release/scripts/make-manifest.sh Thu Nov 15 16:42:59 2018 (r340457) @@ -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-all@freebsd.org Thu Nov 15 17:05:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 17:25:34 2018 Return-Path: Delivered-To: svn-src-all@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 A5DB51104172; Thu, 15 Nov 2018 17:25:34 +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 31E767582F; Thu, 15 Nov 2018 17:25:34 +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 1205711777; Thu, 15 Nov 2018 17:25:34 +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 wAFHPXFI082653; Thu, 15 Nov 2018 17:25:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFHPWBh082646; Thu, 15 Nov 2018 17:25:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811151725.wAFHPWBh082646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 15 Nov 2018 17:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340459 - stable/12/usr.bin/systat X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/usr.bin/systat X-SVN-Commit-Revision: 340459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31E767582F 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)[4]; 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.10)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 17:25:34 -0000 Author: tuexen Date: Thu Nov 15 17:25:32 2018 New Revision: 340459 URL: https://svnweb.freebsd.org/changeset/base/340459 Log: MFC r340361: 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. Approved by: re (gjb@) Differential Revision: https://reviews.freebsd.org/D17838 Modified: stable/12/usr.bin/systat/fetch.c stable/12/usr.bin/systat/icmp6.c stable/12/usr.bin/systat/ip.c stable/12/usr.bin/systat/ip6.c stable/12/usr.bin/systat/tcp.c stable/12/usr.bin/systat/zarc.c Modified: stable/12/usr.bin/systat/fetch.c ============================================================================== --- stable/12/usr.bin/systat/fetch.c Thu Nov 15 17:05:02 2018 (r340458) +++ stable/12/usr.bin/systat/fetch.c Thu Nov 15 17:25:32 2018 (r340459) @@ -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: stable/12/usr.bin/systat/icmp6.c ============================================================================== --- stable/12/usr.bin/systat/icmp6.c Thu Nov 15 17:05:02 2018 (r340458) +++ stable/12/usr.bin/systat/icmp6.c Thu Nov 15 17:25:32 2018 (r340459) @@ -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: stable/12/usr.bin/systat/ip.c ============================================================================== --- stable/12/usr.bin/systat/ip.c Thu Nov 15 17:05:02 2018 (r340458) +++ stable/12/usr.bin/systat/ip.c Thu Nov 15 17:25:32 2018 (r340459) @@ -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: stable/12/usr.bin/systat/ip6.c ============================================================================== --- stable/12/usr.bin/systat/ip6.c Thu Nov 15 17:05:02 2018 (r340458) +++ stable/12/usr.bin/systat/ip6.c Thu Nov 15 17:25:32 2018 (r340459) @@ -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: stable/12/usr.bin/systat/tcp.c ============================================================================== --- stable/12/usr.bin/systat/tcp.c Thu Nov 15 17:05:02 2018 (r340458) +++ stable/12/usr.bin/systat/tcp.c Thu Nov 15 17:25:32 2018 (r340459) @@ -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: stable/12/usr.bin/systat/zarc.c ============================================================================== --- stable/12/usr.bin/systat/zarc.c Thu Nov 15 17:05:02 2018 (r340458) +++ stable/12/usr.bin/systat/zarc.c Thu Nov 15 17:25:32 2018 (r340459) @@ -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-all@freebsd.org Thu Nov 15 18:37:43 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 18:51:39 2018 Return-Path: Delivered-To: svn-src-all@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 A068E11062CC; Thu, 15 Nov 2018 18:51:38 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 238FD785D4; Thu, 15 Nov 2018 18:51:38 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05E3E12524; Thu, 15 Nov 2018 18:51:38 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAFIpcZk025098; Thu, 15 Nov 2018 18:51:38 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFIpbA4025094; Thu, 15 Nov 2018 18:51:37 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811151851.wAFIpbA4025094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 15 Nov 2018 18:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340461 - in stable/12/sys/dev: netmap virtio/network X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12/sys/dev: netmap virtio/network X-SVN-Commit-Revision: 340461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 238FD785D4 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 18:51:39 -0000 Author: vmaffione Date: Thu Nov 15 18:51:37 2018 New Revision: 340461 URL: https://svnweb.freebsd.org/changeset/base/340461 Log: MFC :r340436 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. Sponsored by: Sunny Valley Networks Differential Revision: https://reviews.freebsd.org/D17916 Approved by: re (gjb) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h stable/12/sys/dev/virtio/network/if_vtnet.c stable/12/sys/dev/virtio/network/if_vtnetvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Thu Nov 15 18:37:41 2018 (r340460) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Thu Nov 15 18:51:37 2018 (r340461) @@ -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: stable/12/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/12/sys/dev/virtio/network/if_vtnet.c Thu Nov 15 18:37:41 2018 (r340460) +++ stable/12/sys/dev/virtio/network/if_vtnet.c Thu Nov 15 18:51:37 2018 (r340461) @@ -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: stable/12/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- stable/12/sys/dev/virtio/network/if_vtnetvar.h Thu Nov 15 18:37:41 2018 (r340460) +++ stable/12/sys/dev/virtio/network/if_vtnetvar.h Thu Nov 15 18:51:37 2018 (r340461) @@ -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-all@freebsd.org Thu Nov 15 19:06:09 2018 Return-Path: Delivered-To: svn-src-all@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 15F53110679D; Thu, 15 Nov 2018 19:06:09 +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 863C47929D; Thu, 15 Nov 2018 19:06:08 +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 C8D23127F8; Thu, 15 Nov 2018 19:06:07 +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 wAFJ67lh034312; Thu, 15 Nov 2018 19:06:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAFJ67a5034310; Thu, 15 Nov 2018 19:06:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201811151906.wAFJ67a5034310@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 19:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340462 - stable/12/lib/libjail X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/lib/libjail X-SVN-Commit-Revision: 340462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 863C47929D 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 19:06:09 -0000 Author: asomers Date: Thu Nov 15 19:06:07 2018 New Revision: 340462 URL: https://svnweb.freebsd.org/changeset/base/340462 Log: MFC r340314: libjail: fix handling of allow.mount.fusefs in jailparam_init fusefs is inconsistently named. The kernel module is named "fuse", but the mount helper is named "mount_fusefs" and the jail(8) parameter is named "allow.mount.fusefs". Special case it in libjail. Reviewed by: jamie Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17929 Modified: stable/12/lib/libjail/jail.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libjail/jail.c ============================================================================== --- stable/12/lib/libjail/jail.c Thu Nov 15 18:51:37 2018 (r340461) +++ stable/12/lib/libjail/jail.c Thu Nov 15 19:06:07 2018 (r340462) @@ -1050,10 +1050,18 @@ kldload_param(const char *name) kl = kldload(name); else if (strncmp(name, "allow.mount.", 12) == 0) { /* Load the matching filesystem */ - kl = kldload(name + 12); + const char *modname; + + if (strcmp("fusefs", name + 12) == 0 || + strcmp("nofusefs", name + 12) == 0) { + modname = "fuse"; + } else { + modname = name + 12; + } + kl = kldload(modname); if (kl < 0 && errno == ENOENT && - strncmp(name + 12, "no", 2) == 0) - kl = kldload(name + 14); + strncmp(modname, "no", 2) == 0) + kl = kldload(modname + 2); } else { errno = ENOENT; return (-1); From owner-svn-src-all@freebsd.org Thu Nov 15 20:20:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 20:28:36 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 20:46:47 2018 Return-Path: Delivered-To: svn-src-all@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 3F4F6110925F; Thu, 15 Nov 2018 20:46:47 +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 88B707D7E3; Thu, 15 Nov 2018 20:46:46 +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 wAFKki72042883; Thu, 15 Nov 2018 12:46:44 -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 wAFKkiNH042882; Thu, 15 Nov 2018 12:46:44 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811152046.wAFKkiNH042882@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340461 - in stable/12/sys/dev: netmap virtio/network In-Reply-To: <201811151851.wAFIpbA4025094@repo.freebsd.org> To: Vincenzo Maffione Date: Thu, 15 Nov 2018 12:46:44 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@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: 88B707D7E3 X-Spamd-Result: default: False [0.60 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.35)[-0.355,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)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.04)[-0.036,0]; NEURAL_SPAM_MEDIUM(0.12)[0.117,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 20:46:47 -0000 > Author: vmaffione > Date: Thu Nov 15 18:51:37 2018 > New Revision: 340461 > URL: https://svnweb.freebsd.org/changeset/base/340461 > > Log: > MFC :r340436 > > 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. > > Sponsored by: Sunny Valley Networks > Differential Revision: https://reviews.freebsd.org/D17916 > Approved by: re (gjb) Thank you for getting this merged early, intime for RC1. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Nov 15 20:47:48 2018 Return-Path: Delivered-To: svn-src-all@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 704AA1109320; Thu, 15 Nov 2018 20:47:48 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 D1EA57D942; Thu, 15 Nov 2018 20:47:47 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mail-qk1-x72b.google.com with SMTP id d19so34016410qkg.5; Thu, 15 Nov 2018 12:47:47 -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=ny0fKgeVK0clqKnpfIDtREWUZuKNcSpefUZJP7dieWE=; b=iDXTdUI84KOOOaC7SKQR927eto0tZ4wwVknTbOR+Ds8U9nl4jekJIyicxK2hvMzNnj FXPA3QitkPxEGfVHWf/GCYXvR6ixbqC0eRJaGIT8Sn+fPtdT0euH4VWAluAgm6Z/xRbE 0yQHyVKJ6FaEQMbxdciGPsbRhBhDDF2mBoOf0LNJw0U5RulfW++dI9cfupMf7A7CFqjY FoeBTugfG3tJjfF3wUsYK3wCMXWrtOwiU2kw8EEbCx9ii8oc754EAJUyBXU0Lm8kqXM5 Myw5xprzMcGY53DT/brwx4pHV9f7qD+OTDhyjw8Movf+17L5PzctCGtiPArmcdFCNaJ7 ZSQA== 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=ny0fKgeVK0clqKnpfIDtREWUZuKNcSpefUZJP7dieWE=; b=MFv6PO8l1J27cAYysR+8s2M65SMr0lg2jAjkiWWSdA1Y4vPBXsSsgvCTMnhewq6Cg6 h20T9efz4ze2V6Z8Zs9ohRUzY5+99uAF+zmxe0mMAf/5lpjTsQ6wgwOnNffrRi0t6WmN ogr40evJjNVXoOaoCirpdcw5eulxsS4sFx42HF+kvOoi7YBqUuv2bJfw8AwHNtSmwyv9 KM2et2noYNTnxOzvbWQTJavJV+ouXQ45oE08la92aAtXiOWZUGuunhlESMRC7usqgXAl od8P5ZzU7HZn/H6rxUAILte/ZKZVsacwPIvvVcCeeOUdUEvZhJdDHCJaWx7eavkxOcmX Pzyw== X-Gm-Message-State: AA+aEWYxQ0vEdZIsXtS4w755tIgLtNVQbr5ZnHCCB7UJJI9jPo4r2zyH PeNvPwlFigtWIuIP5Fdwd4xK/7KRDfu/yaa9O/0AGxcO X-Google-Smtp-Source: AJdET5fVdC+CVw8u+sDnunIWfB1hB+6xvXLRAstXLC1fUOzCAMdLWMA3i4Jz42zhvvkmF5fWeKs825tKpjdbTj8sxgs= X-Received: by 2002:ac8:543:: with SMTP id c3mr534852qth.34.1542314867038; Thu, 15 Nov 2018 12:47:47 -0800 (PST) MIME-Version: 1.0 References: <201811151851.wAFIpbA4025094@repo.freebsd.org> <201811152046.wAFKkiNH042882@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811152046.wAFKkiNH042882@pdx.rh.CN85.dnsmgr.net> From: Vincenzo Maffione Date: Thu, 15 Nov 2018 21:47:35 +0100 Message-ID: Subject: Re: svn commit: r340461 - in stable/12/sys/dev: netmap virtio/network To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org X-Rspamd-Queue-Id: D1EA57D942 X-Spamd-Result: default: False [-4.89 / 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)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-0.91)[ipnet: 2607:f8b0::/32(-2.66), asn: 15169(-1.81), country: US(-0.10)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[b.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.970,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" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 20:47:48 -0000 No worries Cheers, Vincenzo On Thu, Nov 15, 2018, 9:46 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > Author: vmaffione > > Date: Thu Nov 15 18:51:37 2018 > > New Revision: 340461 > > URL: https://svnweb.freebsd.org/changeset/base/340461 > > > > Log: > > MFC :r340436 > > > > 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. > > > > Sponsored by: Sunny Valley Networks > > Differential Revision: https://reviews.freebsd.org/D17916 > > Approved by: re (gjb) > > Thank you for getting this merged early, intime for RC1. > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Thu Nov 15 22:47:48 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 23:00:32 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 23:03:01 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 23:10:47 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Nov 15 23:31:05 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 00:01:00 2018 Return-Path: Delivered-To: svn-src-all@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 56077110E8B4; Fri, 16 Nov 2018 00:01:00 +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 D8AC285A60; Fri, 16 Nov 2018 00:00:59 +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 BB3CC1597E; Fri, 16 Nov 2018 00:00:59 +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 wAG00xrd089168; Fri, 16 Nov 2018 00:00:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAG00xid089167; Fri, 16 Nov 2018 00:00:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811160000.wAG00xid089167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 16 Nov 2018 00:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340470 - releng/12.0/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/12.0/sys/conf X-SVN-Commit-Revision: 340470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8AC285A60 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 00:01:00 -0000 Author: gjb Date: Fri Nov 16 00:00:59 2018 New Revision: 340470 URL: https://svnweb.freebsd.org/changeset/base/340470 Log: - Copy stable/12@r340462 to releng/12.0 as part of the 12.0-RELEASE cycle. - Prune svn:mergeinfo from the new branch. - Update from BETA4 to RC1. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Added: - copied from r340462, stable/12/ Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/conf/newvers.sh Modified: releng/12.0/sys/conf/newvers.sh ============================================================================== --- stable/12/sys/conf/newvers.sh Thu Nov 15 19:06:07 2018 (r340462) +++ releng/12.0/sys/conf/newvers.sh Fri Nov 16 00:00:59 2018 (r340470) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="BETA4" +BRANCH="RC1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Nov 16 00:03:32 2018 Return-Path: Delivered-To: svn-src-all@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 5738B110EC6C; Fri, 16 Nov 2018 00:03:32 +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 DC3FF85E91; Fri, 16 Nov 2018 00:03:31 +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 B929615AEB; Fri, 16 Nov 2018 00:03:31 +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 wAG03VIp090802; Fri, 16 Nov 2018 00:03:31 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAG03VEX090800; Fri, 16 Nov 2018 00:03:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811160003.wAG03VEX090800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 16 Nov 2018 00:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340471 - in stable/12/sys: conf sys X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12/sys: conf sys X-SVN-Commit-Revision: 340471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC3FF85E91 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)[4]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 00:03:32 -0000 Author: gjb Date: Fri Nov 16 00:03:31 2018 New Revision: 340471 URL: https://svnweb.freebsd.org/changeset/base/340471 Log: - Update stable/12 from BETA4 to PRERELEASE as releng/12.0 had been branched. - Bump __FreeBSD_version. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/conf/newvers.sh stable/12/sys/sys/param.h Modified: stable/12/sys/conf/newvers.sh ============================================================================== --- stable/12/sys/conf/newvers.sh Fri Nov 16 00:00:59 2018 (r340470) +++ stable/12/sys/conf/newvers.sh Fri Nov 16 00:03:31 2018 (r340471) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="BETA4" +BRANCH="PRERELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Fri Nov 16 00:00:59 2018 (r340470) +++ stable/12/sys/sys/param.h Fri Nov 16 00:03:31 2018 (r340471) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200086 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Nov 16 00:44:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 01:27:25 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 03:42:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 09:50:50 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 10:20:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 11:17:20 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 14:21:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 14:29:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 16:19:17 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 16:23:46 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 16:51:45 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 17:07:57 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 17:41:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 17:55:33 2018 Return-Path: Delivered-To: svn-src-all@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 5E50511007D7 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 B9DE089351 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 j18-v6so5624227iog.6 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=GhF2TQx4ksE3x/ClUzs2lA1dB1ZwPh076xEKkpiT4QDAEqhSHQPG6tMoZzUxYwV1md XdBqhNd1pKlT/UjWhgIM/9fFhhkZw0s2qp5qoGmnQYFvbpexGl52UeSn/s9IH5pm5Mks 2MVnAYbRlJ3TJAGpkxs1dYj9EvgkrnQ0zmmp22gcobFgc+6gMMF/FvQx79MOekeB2x5/ LW2fIsa/aVv/Zc47teTlfqUqThoma+/OYOU0llTl4NsuLShH9pFZ6aLmO0SBdJAdUH5/ mSY4+wTM0fmRVJHlegVn+nVkxjp2D7veT4ETEF+WBnUfr3sa6FPCoxIE51qmKmhg5fSg dDiw== X-Gm-Message-State: AGRZ1gKcSZpwH1BP+iFem6GktrAS884geSzrypHVIPys+wjrjc7d6Rbl 0F6gKDWa6XGft5/X++8ppFhv/y972Of5l77W+wSDeA== 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: B9DE089351 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-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 18:04:08 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 18:32:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 18:41:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 19:00:00 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 19:04:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 19:08:54 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 20:09:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 21:27:13 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 21:28:47 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 22:38:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 22:52:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 23:09:17 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 23:10:49 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 23:30:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 23:39:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Nov 16 23:58:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 00:03:05 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 00:07:02 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 02:15:53 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 10:36:01 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 13:00:00 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 16:08:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 16:08:37 -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-all@freebsd.org Sat Nov 17 16:13:10 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 17:21:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 18:27:24 2018 Return-Path: Delivered-To: svn-src-all@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 5E1B1110122F; Sat, 17 Nov 2018 18:27:24 +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 055D67778E; Sat, 17 Nov 2018 18:27:24 +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 D67212FC10; Sat, 17 Nov 2018 18:27: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 wAHIRN0l098777; Sat, 17 Nov 2018 18:27:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHIRNA8098776; Sat, 17 Nov 2018 18:27:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811171827.wAHIRNA8098776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 17 Nov 2018 18:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r340496 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 340496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 055D67778E X-Spamd-Result: default: False [-0.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.07)[-0.071,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 18:27:24 -0000 Author: gjb Date: Sat Nov 17 18:27:23 2018 New Revision: 340496 URL: https://svnweb.freebsd.org/changeset/base/340496 Log: Thaw stable/12 after releng/12.0 has branched. Committers are requested to excercise caution for the duration of the 12.0-RELEASE cycle, especially regarding changes that are eligible (or proposed) for MFC to releng/12.0. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Sat Nov 17 17:21:36 2018 (r340495) +++ svnadmin/conf/approvers Sat Nov 17 18:27:23 2018 (r340496) @@ -17,7 +17,7 @@ # $FreeBSD$ # #^head/ re -^stable/12/ re +#^stable/12/ re #^stable/11/ re ^release/ re ^releng/12.0/ re From owner-svn-src-all@freebsd.org Sat Nov 17 18:39:10 2018 Return-Path: Delivered-To: svn-src-all@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 37713110178E; Sat, 17 Nov 2018 18:39:10 +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 C6C6D78444; Sat, 17 Nov 2018 18:39:09 +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 A7BF12FDAB; Sat, 17 Nov 2018 18:39:09 +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 wAHId998004508; Sat, 17 Nov 2018 18:39:09 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHId9EG004507; Sat, 17 Nov 2018 18:39:09 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811171839.wAHId9EG004507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 17 Nov 2018 18:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340497 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 340497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6C6D78444 X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.044,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 18:39:10 -0000 Author: eugen Date: Sat Nov 17 18:39:09 2018 New Revision: 340497 URL: https://svnweb.freebsd.org/changeset/base/340497 Log: MFC r340249: ipfw.8: fix small syntax error in an example Modified: stable/12/sbin/ipfw/ipfw.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw.8 ============================================================================== --- stable/12/sbin/ipfw/ipfw.8 Sat Nov 17 18:27:23 2018 (r340496) +++ stable/12/sbin/ipfw/ipfw.8 Sat Nov 17 18:39:09 2018 (r340497) @@ -4224,7 +4224,7 @@ In the following example per-interface firewall is cre .Pp The following example illustrate usage of flow tables: .Pp -.Dl "ipfw table fl create type flow:flow:src-ip,proto,dst-ip,dst-port" +.Dl "ipfw table fl create type flow:src-ip,proto,dst-ip,dst-port" .Dl "ipfw table fl add 2a02:6b8:77::88,tcp,2a02:6b8:77::99,80 11" .Dl "ipfw table fl add 10.0.0.1,udp,10.0.0.2,53 12" .Dl ".." From owner-svn-src-all@freebsd.org Sat Nov 17 18:49:53 2018 Return-Path: Delivered-To: svn-src-all@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 C22311101C67; Sat, 17 Nov 2018 18:49:53 +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 645507928C; Sat, 17 Nov 2018 18:49:53 +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 455232FF45; Sat, 17 Nov 2018 18:49:53 +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 wAHInrfu010794; Sat, 17 Nov 2018 18:49:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHInrFl010793; Sat, 17 Nov 2018 18:49:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171849.wAHInrFl010793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 18:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340498 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 340498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 645507928C X-Spamd-Result: default: False [0.04 / 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.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 18:49:53 -0000 Author: markj Date: Sat Nov 17 18:49:52 2018 New Revision: 340498 URL: https://svnweb.freebsd.org/changeset/base/340498 Log: MFC r340438: Hook mac_ntpd.4 up to the build. PR: 232757 Modified: stable/12/share/man/man4/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Sat Nov 17 18:39:09 2018 (r340497) +++ stable/12/share/man/man4/Makefile Sat Nov 17 18:49:52 2018 (r340498) @@ -269,6 +269,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-all@freebsd.org Sat Nov 17 18:51:23 2018 Return-Path: Delivered-To: svn-src-all@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 A48DD1101EA4; Sat, 17 Nov 2018 18:51:23 +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 4D21E79594; Sat, 17 Nov 2018 18:51:23 +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 2E5AD2FF91; Sat, 17 Nov 2018 18:51:23 +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 wAHIpNAk010951; Sat, 17 Nov 2018 18:51:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHIpN37010950; Sat, 17 Nov 2018 18:51:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171851.wAHIpN37010950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 18:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340499 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 340499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D21E79594 X-Spamd-Result: default: False [0.04 / 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.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 18:51:23 -0000 Author: markj Date: Sat Nov 17 18:51:22 2018 New Revision: 340499 URL: https://svnweb.freebsd.org/changeset/base/340499 Log: MFC r340437: Fix the path to malloc_domain.9. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Sat Nov 17 18:49:52 2018 (r340498) +++ stable/12/ObsoleteFiles.inc Sat Nov 17 18:51:22 2018 (r340499) @@ -39,7 +39,7 @@ # done # 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 # 20181025: OpenSSL libraries version bump to avoid conflict with ports OLD_LIBS+=lib/libcrypto.so.9 OLD_LIBS+=usr/lib/libssl.so.9 From owner-svn-src-all@freebsd.org Sat Nov 17 18:53:29 2018 Return-Path: Delivered-To: svn-src-all@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 D00041101F99; Sat, 17 Nov 2018 18:53:29 +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 7292A797F7; Sat, 17 Nov 2018 18:53:29 +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 39A28100; Sat, 17 Nov 2018 18:53:29 +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 wAHIrTiZ015537; Sat, 17 Nov 2018 18:53:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHIrTTD015536; Sat, 17 Nov 2018 18:53:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171853.wAHIrTTD015536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 18:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340500 - stable/12/bin/getfacl X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/bin/getfacl X-SVN-Commit-Revision: 340500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7292A797F7 X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.044,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 18:53:30 -0000 Author: markj Date: Sat Nov 17 18:53:28 2018 New Revision: 340500 URL: https://svnweb.freebsd.org/changeset/base/340500 Log: MFC r340014: Avoid copying a struct stat for acl_from_stat() calls. Modified: stable/12/bin/getfacl/getfacl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/getfacl/getfacl.c ============================================================================== --- stable/12/bin/getfacl/getfacl.c Sat Nov 17 18:51:22 2018 (r340499) +++ stable/12/bin/getfacl/getfacl.c Sat Nov 17 18:53:28 2018 (r340500) @@ -88,7 +88,7 @@ getgname(gid_t gid) * contained in struct stat */ static acl_t -acl_from_stat(struct stat sb) +acl_from_stat(const struct stat *sb) { acl_t acl; acl_entry_t entry; @@ -111,13 +111,13 @@ acl_from_stat(struct stat sb) return NULL; /* calculate user mode */ - if (sb.st_mode & S_IRUSR) + if (sb->st_mode & S_IRUSR) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb.st_mode & S_IWUSR) + if (sb->st_mode & S_IWUSR) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb.st_mode & S_IXUSR) + if (sb->st_mode & S_IXUSR) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -135,13 +135,13 @@ acl_from_stat(struct stat sb) return NULL; /* calculate group mode */ - if (sb.st_mode & S_IRGRP) + if (sb->st_mode & S_IRGRP) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb.st_mode & S_IWGRP) + if (sb->st_mode & S_IWGRP) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb.st_mode & S_IXGRP) + if (sb->st_mode & S_IXGRP) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -159,13 +159,13 @@ acl_from_stat(struct stat sb) return NULL; /* calculate other mode */ - if (sb.st_mode & S_IROTH) + if (sb->st_mode & S_IROTH) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb.st_mode & S_IWOTH) + if (sb->st_mode & S_IWOTH) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb.st_mode & S_IXOTH) + if (sb->st_mode & S_IXOTH) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -229,7 +229,7 @@ print_acl(char *path, acl_type_t type, int hflag, int errno = 0; if (type == ACL_TYPE_DEFAULT) return(0); - acl = acl_from_stat(sb); + acl = acl_from_stat(&sb); if (!acl) { warn("%s: acl_from_stat() failed", path); return(-1); From owner-svn-src-all@freebsd.org Sat Nov 17 18:54:35 2018 Return-Path: Delivered-To: svn-src-all@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 1E6B0110201A; Sat, 17 Nov 2018 18:54:35 +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 B69B67993B; Sat, 17 Nov 2018 18:54:34 +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 9791E101; Sat, 17 Nov 2018 18:54:34 +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 wAHIsYlJ015635; Sat, 17 Nov 2018 18:54:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHIsY0Z015634; Sat, 17 Nov 2018 18:54:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171854.wAHIsY0Z015634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 18:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340501 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B69B67993B X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.044,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 18:54:35 -0000 Author: markj Date: Sat Nov 17 18:54:34 2018 New Revision: 340501 URL: https://svnweb.freebsd.org/changeset/base/340501 Log: MFC r339820: Use M_WAITOK in init_hwpmc(). Modified: stable/12/sys/kern/kern_pmc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_pmc.c ============================================================================== --- stable/12/sys/kern/kern_pmc.c Sat Nov 17 18:53:28 2018 (r340500) +++ stable/12/sys/kern/kern_pmc.c Sat Nov 17 18:54:34 2018 (r340501) @@ -345,9 +345,8 @@ init_hwpmc(void *dummy __unused) "range.\n", pmc_softevents); pmc_softevents = PMC_EV_DYN_COUNT; } - pmc_softs = malloc(pmc_softevents * sizeof(struct pmc_soft *), M_PMCHOOKS, M_NOWAIT|M_ZERO); - KASSERT(pmc_softs != NULL, ("cannot allocate soft events table")); - + pmc_softs = malloc(pmc_softevents * sizeof(*pmc_softs), M_PMCHOOKS, + M_WAITOK | M_ZERO); for (domain = 0; domain < vm_ndomains; domain++) { pmc_dom_hdrs[domain] = malloc_domainset( From owner-svn-src-all@freebsd.org Sat Nov 17 18:55:54 2018 Return-Path: Delivered-To: svn-src-all@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 DC6EF110209D; Sat, 17 Nov 2018 18:55:54 +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 8276E79A81; Sat, 17 Nov 2018 18:55:54 +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 61698103; Sat, 17 Nov 2018 18:55:54 +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 wAHItsvd015772; Sat, 17 Nov 2018 18:55:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHItsta015771; Sat, 17 Nov 2018 18:55:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171855.wAHItsta015771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 18:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340502 - stable/12/lib/libcasper/libcasper X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libcasper/libcasper X-SVN-Commit-Revision: 340502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8276E79A81 X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 18:55:55 -0000 Author: markj Date: Sat Nov 17 18:55:53 2018 New Revision: 340502 URL: https://svnweb.freebsd.org/changeset/base/340502 Log: MFC r340160; Document the fact that cap_limit_set() always frees the input nvlist. Modified: stable/12/lib/libcasper/libcasper/libcasper.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- stable/12/lib/libcasper/libcasper/libcasper.3 Sat Nov 17 18:54:34 2018 (r340501) +++ stable/12/lib/libcasper/libcasper/libcasper.3 Sat Nov 17 18:55:53 2018 (r340502) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 6, 2018 +.Dd November 5, 2018 .Dt LIBCASPER 3 .Os .Sh NAME @@ -161,9 +161,11 @@ it means there are no limits set. The .Fn cap_limit_set function sets limits for the given capability. -The limits are provided as +The limits are provided as a .Xr nvlist 9 . The exact format depends on the service the capability represents. +.Fn cap_limit_set +frees the limits regardless of whether the operation succeeds or fails. .Pp The .Fn cap_send_nvlist From owner-svn-src-all@freebsd.org Sat Nov 17 18:58:07 2018 Return-Path: Delivered-To: svn-src-all@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 864EE110216B; Sat, 17 Nov 2018 18:58:07 +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 2A2A979C16; Sat, 17 Nov 2018 18:58:07 +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 0B05A106; Sat, 17 Nov 2018 18:58:07 +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 wAHIw6WT015920; Sat, 17 Nov 2018 18:58:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHIw6PA015918; Sat, 17 Nov 2018 18:58:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811171858.wAHIw6PA015918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 17 Nov 2018 18:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340503 - stable/12/sys/arm/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12/sys/arm/conf X-SVN-Commit-Revision: 340503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A2A979C16 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.05)[0.048,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 18:58:07 -0000 Author: gjb Date: Sat Nov 17 18:58:06 2018 New Revision: 340503 URL: https://svnweb.freebsd.org/changeset/base/340503 Log: Remove debugging options from arm, armv6, armv7 files included by GENERIC. This should have been turned off when stable/12 branched. This is a direct commit to stable/12. Submitted by: thompsa Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/arm/conf/std.arm stable/12/sys/arm/conf/std.armv6 stable/12/sys/arm/conf/std.armv7 Modified: stable/12/sys/arm/conf/std.arm ============================================================================== --- stable/12/sys/arm/conf/std.arm Sat Nov 17 18:55:53 2018 (r340502) +++ stable/12/sys/arm/conf/std.arm Sat Nov 17 18:58:06 2018 (r340503) @@ -10,17 +10,6 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options USB_DEBUG # Enable usb debug support code - # Optional extras, never enabled by default: #options BOOTVERBOSE #options DEBUG # May result in extreme spewage Modified: stable/12/sys/arm/conf/std.armv6 ============================================================================== --- stable/12/sys/arm/conf/std.armv6 Sat Nov 17 18:55:53 2018 (r340502) +++ stable/12/sys/arm/conf/std.armv6 Sat Nov 17 18:58:06 2018 (r340503) @@ -60,17 +60,6 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options USB_DEBUG # Enable usb debug support code - # Optional extras, never enabled by default: #options BOOTVERBOSE #options DEBUG # May result in extreme spewage Modified: stable/12/sys/arm/conf/std.armv7 ============================================================================== --- stable/12/sys/arm/conf/std.armv7 Sat Nov 17 18:55:53 2018 (r340502) +++ stable/12/sys/arm/conf/std.armv7 Sat Nov 17 18:58:06 2018 (r340503) @@ -60,17 +60,6 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options USB_DEBUG # Enable usb debug support code - # Optional extras, never enabled by default: #options BOOTVERBOSE #options DEBUG # May result in extreme spewage From owner-svn-src-all@freebsd.org Sat Nov 17 19:00:45 2018 Return-Path: Delivered-To: svn-src-all@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 6596F1102471; Sat, 17 Nov 2018 19:00:45 +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 F3A8779E32; Sat, 17 Nov 2018 19:00:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4B7211B; Sat, 17 Nov 2018 19:00:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHJ0inx016196; Sat, 17 Nov 2018 19:00:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHJ0iLV016195; Sat, 17 Nov 2018 19:00:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171900.wAHJ0iLV016195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 19:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340504 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 340504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3A8779E32 X-Spamd-Result: default: False [0.05 / 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.05)[0.048,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 19:00:45 -0000 Author: markj Date: Sat Nov 17 19:00:44 2018 New Revision: 340504 URL: https://svnweb.freebsd.org/changeset/base/340504 Log: MFC r340004: Improve style in in_pcbinslbgrouphash() and related subroutines. Modified: stable/12/sys/netinet/in_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Sat Nov 17 18:58:06 2018 (r340503) +++ stable/12/sys/netinet/in_pcb.c Sat Nov 17 19:00:44 2018 (r340504) @@ -266,7 +266,7 @@ in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, grp = in_pcblbgroup_alloc(hdr, old_grp->il_vflag, old_grp->il_lport, &old_grp->il_dependladdr, size); - if (!grp) + if (grp == NULL) return (NULL); KASSERT(old_grp->il_inpcnt < grp->il_inpsiz, @@ -288,21 +288,20 @@ static void in_pcblbgroup_reorder(struct inpcblbgrouphead *hdr, struct inpcblbgroup **grpp, int i) { - struct inpcblbgroup *grp = *grpp; + struct inpcblbgroup *grp, *new_grp; + grp = *grpp; for (; i + 1 < grp->il_inpcnt; ++i) grp->il_inp[i] = grp->il_inp[i + 1]; grp->il_inpcnt--; if (grp->il_inpsiz > INPCBLBGROUP_SIZMIN && - grp->il_inpcnt <= (grp->il_inpsiz / 4)) { + grp->il_inpcnt <= grp->il_inpsiz / 4) { /* Shrink this group. */ - struct inpcblbgroup *new_grp = - in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2); - if (new_grp) + new_grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2); + if (new_grp != NULL) *grpp = new_grp; } - return; } /* @@ -316,9 +315,7 @@ in_pcbinslbgrouphash(struct inpcb *inp) struct inpcbinfo *pcbinfo; struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; - uint16_t hashmask, lport; - uint32_t group_index; - struct ucred *cred; + uint32_t idx; pcbinfo = inp->inp_pcbinfo; @@ -328,19 +325,10 @@ in_pcbinslbgrouphash(struct inpcb *inp) if (pcbinfo->ipi_lbgrouphashbase == NULL) return (0); - hashmask = pcbinfo->ipi_lbgrouphashmask; - lport = inp->inp_lport; - group_index = INP_PCBLBGROUP_PORTHASH(lport, hashmask); - hdr = &pcbinfo->ipi_lbgrouphashbase[group_index]; - /* * Don't allow jailed socket to join local group. */ - if (inp->inp_socket != NULL) - cred = inp->inp_socket->so_cred; - else - cred = NULL; - if (cred != NULL && jailed(cred)) + if (inp->inp_socket != NULL && jailed(inp->inp_socket->so_cred)) return (0); #ifdef INET6 @@ -354,24 +342,23 @@ in_pcbinslbgrouphash(struct inpcb *inp) } #endif - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(inp->inp_lport, - pcbinfo->ipi_lbgrouphashmask)]; + idx = INP_PCBLBGROUP_PORTHASH(inp->inp_lport, + pcbinfo->ipi_lbgrouphashmask); + hdr = &pcbinfo->ipi_lbgrouphashbase[idx]; CK_LIST_FOREACH(grp, hdr, il_list) { if (grp->il_vflag == inp->inp_vflag && grp->il_lport == inp->inp_lport && memcmp(&grp->il_dependladdr, - &inp->inp_inc.inc_ie.ie_dependladdr, - sizeof(grp->il_dependladdr)) == 0) { + &inp->inp_inc.inc_ie.ie_dependladdr, + sizeof(grp->il_dependladdr)) == 0) break; - } } if (grp == NULL) { /* Create new load balance group. */ grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag, inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, INPCBLBGROUP_SIZMIN); - if (!grp) + if (grp == NULL) return (ENOBUFS); } else if (grp->il_inpcnt == grp->il_inpsiz) { if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { @@ -383,13 +370,13 @@ in_pcbinslbgrouphash(struct inpcb *inp) /* Expand this local group. */ grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); - if (!grp) + if (grp == NULL) return (ENOBUFS); } KASSERT(grp->il_inpcnt < grp->il_inpsiz, - ("invalid local group size %d and count %d", - grp->il_inpsiz, grp->il_inpcnt)); + ("invalid local group size %d and count %d", grp->il_inpsiz, + grp->il_inpcnt)); grp->il_inp[grp->il_inpcnt] = inp; grp->il_inpcnt++; From owner-svn-src-all@freebsd.org Sat Nov 17 19:01:42 2018 Return-Path: Delivered-To: svn-src-all@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 EAC481102529; Sat, 17 Nov 2018 19:01:41 +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 9437E7A028; Sat, 17 Nov 2018 19:01: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 71997170; Sat, 17 Nov 2018 19:01: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 wAHJ1fQI019990; Sat, 17 Nov 2018 19:01:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHJ1fNI019969; Sat, 17 Nov 2018 19:01:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171901.wAHJ1fNI019969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 19:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340505 - in stable/12/sys: netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: netinet netinet6 X-SVN-Commit-Revision: 340505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9437E7A028 X-Spamd-Result: default: False [0.04 / 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.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 19:01:42 -0000 Author: markj Date: Sat Nov 17 19:01:40 2018 New Revision: 340505 URL: https://svnweb.freebsd.org/changeset/base/340505 Log: MFC r340005: Remove redundant checks for a NULL lbgroup table. Modified: stable/12/sys/netinet/in_pcb.c stable/12/sys/netinet6/in6_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Sat Nov 17 19:00:44 2018 (r340504) +++ stable/12/sys/netinet/in_pcb.c Sat Nov 17 19:01:40 2018 (r340505) @@ -322,9 +322,6 @@ in_pcbinslbgrouphash(struct inpcb *inp) INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); - if (pcbinfo->ipi_lbgrouphashbase == NULL) - return (0); - /* * Don't allow jailed socket to join local group. */ @@ -399,9 +396,6 @@ in_pcbremlbgrouphash(struct inpcb *inp) INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); - if (pcbinfo->ipi_lbgrouphashbase == NULL) - return; - hdr = &pcbinfo->ipi_lbgrouphashbase[ INP_PCBLBGROUP_PORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; @@ -2276,13 +2270,11 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st /* * Then look in lb group (for wildcard match). */ - if (pcbinfo->ipi_lbgrouphashbase != NULL && - (lookupflags & INPLOOKUP_WILDCARD)) { + if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { inp = in_pcblookup_lbgroup(pcbinfo, &laddr, lport, &faddr, fport, lookupflags); - if (inp != NULL) { + if (inp != NULL) return (inp); - } } /* Modified: stable/12/sys/netinet6/in6_pcb.c ============================================================================== --- stable/12/sys/netinet6/in6_pcb.c Sat Nov 17 19:00:44 2018 (r340504) +++ stable/12/sys/netinet6/in6_pcb.c Sat Nov 17 19:01:40 2018 (r340505) @@ -1171,13 +1171,11 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, s /* * Then look in lb group (for wildcard match). */ - if (pcbinfo->ipi_lbgrouphashbase != NULL && - (lookupflags & INPLOOKUP_WILDCARD)) { + if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { inp = in6_pcblookup_lbgroup(pcbinfo, laddr, lport, faddr, fport, lookupflags); - if (inp != NULL) { + if (inp != NULL) return (inp); - } } /* From owner-svn-src-all@freebsd.org Sat Nov 17 19:02:51 2018 Return-Path: Delivered-To: svn-src-all@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 9755F1102602; Sat, 17 Nov 2018 19:02:51 +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 3DADF7A35E; Sat, 17 Nov 2018 19:02:51 +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 1C8872DF; Sat, 17 Nov 2018 19:02:51 +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 wAHJ2oZs021026; Sat, 17 Nov 2018 19:02:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHJ2oa9021025; Sat, 17 Nov 2018 19:02:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171902.wAHJ2oa9021025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 19:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340506 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 340506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3DADF7A35E X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.044,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 19:02:51 -0000 Author: markj Date: Sat Nov 17 19:02:50 2018 New Revision: 340506 URL: https://svnweb.freebsd.org/changeset/base/340506 Log: MFC r340174: Initialize last_target in the laundry thread control loop. Modified: stable/12/sys/vm/vm_pageout.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_pageout.c ============================================================================== --- stable/12/sys/vm/vm_pageout.c Sat Nov 17 19:01:40 2018 (r340505) +++ stable/12/sys/vm/vm_pageout.c Sat Nov 17 19:02:50 2018 (r340506) @@ -973,7 +973,7 @@ vm_pageout_laundry_worker(void *arg) shortfall = 0; in_shortfall = false; shortfall_cycle = 0; - target = 0; + last_target = target = 0; nfreed = 0; /* From owner-svn-src-all@freebsd.org Sat Nov 17 19:15:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 19:19:38 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 19:58:36 2018 Return-Path: Delivered-To: svn-src-all@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 5A0311103992; Sat, 17 Nov 2018 19:58:36 +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 0113D7B8F1; Sat, 17 Nov 2018 19:58:36 +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 D61EDB23; Sat, 17 Nov 2018 19:58:35 +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 wAHJwZre046824; Sat, 17 Nov 2018 19:58:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHJwZeW046820; Sat, 17 Nov 2018 19:58:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811171958.wAHJwZeW046820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 19:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340509 - in stable/12: lib/libc/stdio share/man/man4 sys/netinet/netdump X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: lib/libc/stdio share/man/man4 sys/netinet/netdump X-SVN-Commit-Revision: 340509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0113D7B8F1 X-Spamd-Result: default: False [0.05 / 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.05)[0.048,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 19:58:36 -0000 Author: markj Date: Sat Nov 17 19:58:34 2018 New Revision: 340509 URL: https://svnweb.freebsd.org/changeset/base/340509 Log: MFC r339883: Expose some netdump configuration parameters through sysctl. Modified: stable/12/lib/libc/stdio/fopen.3 stable/12/share/man/man4/netdump.4 stable/12/sys/netinet/netdump/netdump_client.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/stdio/fopen.3 ============================================================================== --- stable/12/lib/libc/stdio/fopen.3 Sat Nov 17 19:19:37 2018 (r340508) +++ stable/12/lib/libc/stdio/fopen.3 Sat Nov 17 19:58:34 2018 (r340509) @@ -119,8 +119,8 @@ or the first letter. This is strictly for compatibility with .St -isoC and has effect only for -.Fn fmemopen -; otherwise +.Fn fmemopen ; +otherwise .Dq Li b is ignored. .Pp Modified: stable/12/share/man/man4/netdump.4 ============================================================================== --- stable/12/share/man/man4/netdump.4 Sat Nov 17 19:19:37 2018 (r340508) +++ stable/12/share/man/man4/netdump.4 Sat Nov 17 19:58:34 2018 (r340509) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2018 +.Dd October 29, 2018 .Dt NETDUMP 4 .Os .Sh NAME @@ -130,6 +130,19 @@ a path of will cause the server to attempt to store dumps from the client in .Pa /var/crash/foo . The server will not automatically create the relative directory. +.It Va net.netdump.polls +The client will poll the configured network interface while waiting for +acknowledgements. +This parameter controls the maximum number of poll attempts before giving +up, which typically results in a re-transmit. +Each poll attempt takes 0.5ms. +.It Va net.netdump.retries +The number of times the client will re-transmit a packet before aborting +a dump due to a lack of acknowledgement. +The default may be too small in environments with lots of packet loss. +.It Va net.netdump.arp_retries +The number of times the client will attempt to learn the MAC address of +the configured gateway or server before giving up and aborting the dump. .El .Sh SEE ALSO .Xr decryptcore 8 , Modified: stable/12/sys/netinet/netdump/netdump_client.c ============================================================================== --- stable/12/sys/netinet/netdump/netdump_client.c Sat Nov 17 19:19:37 2018 (r340508) +++ stable/12/sys/netinet/netdump/netdump_client.c Sat Nov 17 19:58:34 2018 (r340509) @@ -117,18 +117,6 @@ static int restore_gw_addr; static uint64_t rcvd_acks; CTASSERT(sizeof(rcvd_acks) * NBBY == NETDUMP_MAX_IN_FLIGHT); -/* - * Times to poll the NIC (0.5ms each poll) before assuming packetloss - * occurred (default to 1s). - */ -static int nd_polls = 2000; - -/* Times to retransmit lost packets. */ -static int nd_retries = 10; - -/* Number of ARP retries. */ -static int nd_arp_retries = 3; - /* Configuration parameters. */ static struct netdump_conf nd_conf; #define nd_server nd_conf.ndc_server @@ -157,6 +145,18 @@ static char nd_path[MAXPATHLEN]; SYSCTL_STRING(_net_netdump, OID_AUTO, path, CTLFLAG_RW, nd_path, sizeof(nd_path), "Server path for output files"); +static int nd_polls = 2000; +SYSCTL_INT(_net_netdump, OID_AUTO, polls, CTLFLAG_RWTUN, + &nd_polls, 0, + "Number of times to poll before assuming packet loss (0.5ms per poll)"); +static int nd_retries = 10; +SYSCTL_INT(_net_netdump, OID_AUTO, retries, CTLFLAG_RWTUN, + &nd_retries, 0, + "Number of retransmit attempts before giving up"); +static int nd_arp_retries = 3; +SYSCTL_INT(_net_netdump, OID_AUTO, arp_retries, CTLFLAG_RWTUN, + &nd_arp_retries, 0, + "Number of ARP attempts before giving up"); /* * Checks for netdump support on a network interface From owner-svn-src-all@freebsd.org Sat Nov 17 20:00:11 2018 Return-Path: Delivered-To: svn-src-all@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 BE5A91103A33; Sat, 17 Nov 2018 20:00:11 +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 64BF77BA3C; Sat, 17 Nov 2018 20:00:11 +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 45C8EB27; Sat, 17 Nov 2018 20:00:11 +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 wAHK0Bvp047000; Sat, 17 Nov 2018 20:00:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHK0BoX046999; Sat, 17 Nov 2018 20:00:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172000.wAHK0BoX046999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340510 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 64BF77BA3C X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.044,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:00:11 -0000 Author: markj Date: Sat Nov 17 20:00:10 2018 New Revision: 340510 URL: https://svnweb.freebsd.org/changeset/base/340510 Log: MFC r339728: Remove a redundant check. Modified: stable/12/sys/kern/subr_vmem.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_vmem.c ============================================================================== --- stable/12/sys/kern/subr_vmem.c Sat Nov 17 19:58:34 2018 (r340509) +++ stable/12/sys/kern/subr_vmem.c Sat Nov 17 20:00:10 2018 (r340510) @@ -283,7 +283,7 @@ bt_fill(vmem_t *vm, int flags) VMEM_UNLOCK(vm); bt = uma_zalloc(vmem_bt_zone, flags); VMEM_LOCK(vm); - if (bt == NULL && (flags & M_NOWAIT) != 0) + if (bt == NULL) break; } LIST_INSERT_HEAD(&vm->vm_freetags, bt, bt_freelist); From owner-svn-src-all@freebsd.org Sat Nov 17 20:01:36 2018 Return-Path: Delivered-To: svn-src-all@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 CC78D1103ADB; Sat, 17 Nov 2018 20:01:36 +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 73BFC7BC4D; Sat, 17 Nov 2018 20:01:36 +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 54AE1C66; Sat, 17 Nov 2018 20:01:36 +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 wAHK1a5A047920; Sat, 17 Nov 2018 20:01:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHK1aR7047919; Sat, 17 Nov 2018 20:01:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172001.wAHK1aR7047919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340511 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73BFC7BC4D X-Spamd-Result: default: False [0.04 / 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.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:01:37 -0000 Author: markj Date: Sat Nov 17 20:01:35 2018 New Revision: 340511 URL: https://svnweb.freebsd.org/changeset/base/340511 Log: MFC r339731: Add FALLTHROUGH comments to appease Coverity. Modified: stable/12/sys/kern/kern_environment.c stable/12/sys/kern/vfs_mount.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_environment.c ============================================================================== --- stable/12/sys/kern/kern_environment.c Sat Nov 17 20:00:10 2018 (r340510) +++ stable/12/sys/kern/kern_environment.c Sat Nov 17 20:01:35 2018 (r340511) @@ -839,10 +839,13 @@ getenv_quad(const char *name, quad_t *data) switch (vtp[0]) { case 't': case 'T': iv *= 1024; + /* FALLTHROUGH */ case 'g': case 'G': iv *= 1024; + /* FALLTHROUGH */ case 'm': case 'M': iv *= 1024; + /* FALLTHROUGH */ case 'k': case 'K': iv *= 1024; case '\0': Modified: stable/12/sys/kern/vfs_mount.c ============================================================================== --- stable/12/sys/kern/vfs_mount.c Sat Nov 17 20:00:10 2018 (r340510) +++ stable/12/sys/kern/vfs_mount.c Sat Nov 17 20:01:35 2018 (r340511) @@ -1643,17 +1643,16 @@ vfs_getopt_size(struct vfsoptlist *opts, const char *n if (iv < 0) return (EINVAL); switch (vtp[0]) { - case 't': - case 'T': + case 't': case 'T': iv *= 1024; - case 'g': - case 'G': + /* FALLTHROUGH */ + case 'g': case 'G': iv *= 1024; - case 'm': - case 'M': + /* FALLTHROUGH */ + case 'm': case 'M': iv *= 1024; - case 'k': - case 'K': + /* FALLTHROUGH */ + case 'k': case 'K': iv *= 1024; case '\0': break; From owner-svn-src-all@freebsd.org Sat Nov 17 20:02:58 2018 Return-Path: Delivered-To: svn-src-all@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 7A1DC1103CB7; Sat, 17 Nov 2018 20:02:58 +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 206077BF62; Sat, 17 Nov 2018 20:02:58 +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 E9A0DCB3; Sat, 17 Nov 2018 20:02:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHK2v9U051858; Sat, 17 Nov 2018 20:02:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHK2vMS051857; Sat, 17 Nov 2018 20:02:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172002.wAHK2vMS051857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340512 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 340512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 206077BF62 X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.044,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:02:58 -0000 Author: markj Date: Sat Nov 17 20:02:57 2018 New Revision: 340512 URL: https://svnweb.freebsd.org/changeset/base/340512 Log: MFC r339598: Fix style bugs in in6_pcblookup_lbgroup(). Modified: stable/12/sys/netinet6/in6_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/in6_pcb.c ============================================================================== --- stable/12/sys/netinet6/in6_pcb.c Sat Nov 17 20:01:35 2018 (r340511) +++ stable/12/sys/netinet6/in6_pcb.c Sat Nov 17 20:02:57 2018 (r340512) @@ -873,10 +873,9 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, const struct in6_addr *laddr, uint16_t lport, const struct in6_addr *faddr, uint16_t fport, int lookupflags) { - struct inpcb *local_wild = NULL; + struct inpcb *local_wild; const struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; - struct inpcblbgroup *grp_local_wild; uint32_t idx; INP_HASH_LOCK_ASSERT(pcbinfo); @@ -893,33 +892,24 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, * - Load balanced group does not contain jailed sockets. * - Load balanced does not contain IPv4 mapped INET6 wild sockets. */ + local_wild = NULL; CK_LIST_FOREACH(grp, hdr, il_list) { #ifdef INET if (!(grp->il_vflag & INP_IPV6)) continue; #endif - if (grp->il_lport == lport) { - idx = 0; - int pkt_hash = INP_PCBLBGROUP_PKTHASH( - INP6_PCBHASHKEY(faddr), lport, fport); + if (grp->il_lport != lport) + continue; - idx = pkt_hash % grp->il_inpcnt; - - if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) { - return (grp->il_inp[idx]); - } else { - if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && - (lookupflags & INPLOOKUP_WILDCARD)) { - local_wild = grp->il_inp[idx]; - grp_local_wild = grp; - } - } - } + idx = INP_PCBLBGROUP_PKTHASH(INP6_PCBHASHKEY(faddr), lport, + fport) % grp->il_inpcnt; + if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) + return (grp->il_inp[idx]); + if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && + (lookupflags & INPLOOKUP_WILDCARD) != 0) + local_wild = grp->il_inp[idx]; } - if (local_wild != NULL) { - return (local_wild); - } - return (NULL); + return (local_wild); } #ifdef PCBGROUP From owner-svn-src-all@freebsd.org Sat Nov 17 20:04:39 2018 Return-Path: Delivered-To: svn-src-all@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 494001103D85; Sat, 17 Nov 2018 20:04:39 +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 E32BC7C0BD; Sat, 17 Nov 2018 20:04:38 +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 BD471CB6; Sat, 17 Nov 2018 20:04:38 +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 wAHK4c0A051996; Sat, 17 Nov 2018 20:04:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHK4ckb051993; Sat, 17 Nov 2018 20:04:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172004.wAHK4ckb051993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340513 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 340513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E32BC7C0BD X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.05)[0.048,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:04:39 -0000 Author: markj Date: Sat Nov 17 20:04:38 2018 New Revision: 340513 URL: https://svnweb.freebsd.org/changeset/base/340513 Log: MFC r339599: Don't import 0 into vmem quantum caches. Modified: stable/12/sys/kern/subr_vmem.c stable/12/sys/sys/vmem.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_vmem.c ============================================================================== --- stable/12/sys/kern/subr_vmem.c Sat Nov 17 20:02:57 2018 (r340512) +++ stable/12/sys/kern/subr_vmem.c Sat Nov 17 20:04:38 2018 (r340513) @@ -504,6 +504,9 @@ bt_insfree(vmem_t *vm, bt_t *bt) /* * Import from the arena into the quantum cache in UMA. + * + * We use VMEM_ADDR_QCACHE_MIN instead of 0: uma_zalloc() returns 0 to indicate + * failure, so UMA can't be used to cache a resource with value 0. */ static int qc_import(void *arg, void **store, int cnt, int domain, int flags) @@ -512,19 +515,16 @@ qc_import(void *arg, void **store, int cnt, int domain vmem_addr_t addr; int i; + KASSERT((flags & M_WAITOK) == 0, ("blocking allocation")); + qc = arg; - if ((flags & VMEM_FITMASK) == 0) - flags |= M_BESTFIT; for (i = 0; i < cnt; i++) { if (vmem_xalloc(qc->qc_vmem, qc->qc_size, 0, 0, 0, - VMEM_ADDR_MIN, VMEM_ADDR_MAX, flags, &addr) != 0) + VMEM_ADDR_QCACHE_MIN, VMEM_ADDR_MAX, flags, &addr) != 0) break; store[i] = (void *)addr; - /* Only guarantee one allocation. */ - flags &= ~M_WAITOK; - flags |= M_NOWAIT; } - return i; + return (i); } /* @@ -1123,15 +1123,20 @@ vmem_alloc(vmem_t *vm, vmem_size_t size, int flags, vm WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "vmem_alloc"); if (size <= vm->vm_qcache_max) { + /* + * Resource 0 cannot be cached, so avoid a blocking allocation + * in qc_import() and give the vmem_xalloc() call below a chance + * to return 0. + */ qc = &vm->vm_qcache[(size - 1) >> vm->vm_quantum_shift]; - *addrp = (vmem_addr_t)uma_zalloc(qc->qc_cache, flags); - if (*addrp == 0) - return (ENOMEM); - return (0); + *addrp = (vmem_addr_t)uma_zalloc(qc->qc_cache, + (flags & ~M_WAITOK) | M_NOWAIT); + if (__predict_true(*addrp != 0)) + return (0); } - return vmem_xalloc(vm, size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, - flags, addrp); + return (vmem_xalloc(vm, size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, + flags, addrp)); } int @@ -1263,7 +1268,8 @@ vmem_free(vmem_t *vm, vmem_addr_t addr, vmem_size_t si qcache_t *qc; MPASS(size > 0); - if (size <= vm->vm_qcache_max) { + if (size <= vm->vm_qcache_max && + __predict_true(addr >= VMEM_ADDR_QCACHE_MIN)) { qc = &vm->vm_qcache[(size - 1) >> vm->vm_quantum_shift]; uma_zfree(qc->qc_cache, (void *)addr); } else Modified: stable/12/sys/sys/vmem.h ============================================================================== --- stable/12/sys/sys/vmem.h Sat Nov 17 20:02:57 2018 (r340512) +++ stable/12/sys/sys/vmem.h Sat Nov 17 20:04:38 2018 (r340513) @@ -41,8 +41,9 @@ typedef struct vmem vmem_t; typedef uintptr_t vmem_addr_t; typedef size_t vmem_size_t; -#define VMEM_ADDR_MIN 0 -#define VMEM_ADDR_MAX (~(vmem_addr_t)0) +#define VMEM_ADDR_MIN 0 +#define VMEM_ADDR_QCACHE_MIN 1 +#define VMEM_ADDR_MAX (~(vmem_addr_t)0) typedef int (vmem_import_t)(void *, vmem_size_t, int, vmem_addr_t *); typedef void (vmem_release_t)(void *, vmem_addr_t, vmem_size_t); From owner-svn-src-all@freebsd.org Sat Nov 17 20:07:38 2018 Return-Path: Delivered-To: svn-src-all@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 F32FF1103E4B; Sat, 17 Nov 2018 20:07: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 990317C230; Sat, 17 Nov 2018 20:07: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 72F83CB9; Sat, 17 Nov 2018 20:07: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 wAHK7bh3052200; Sat, 17 Nov 2018 20:07:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHK7bcl052199; Sat, 17 Nov 2018 20:07:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172007.wAHK7bcl052199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340514 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 990317C230 X-Spamd-Result: default: False [0.04 / 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.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:07:38 -0000 Author: markj Date: Sat Nov 17 20:07:37 2018 New Revision: 340514 URL: https://svnweb.freebsd.org/changeset/base/340514 Log: MFC r339737: Remove a dead store. Modified: stable/12/sys/kern/vfs_mountroot.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_mountroot.c ============================================================================== --- stable/12/sys/kern/vfs_mountroot.c Sat Nov 17 20:04:38 2018 (r340513) +++ stable/12/sys/kern/vfs_mountroot.c Sat Nov 17 20:07:37 2018 (r340514) @@ -579,7 +579,7 @@ parse_dir_md(char **conf) if (root_mount_mddev != -1) { mdio->md_unit = root_mount_mddev; - error = kern_ioctl(td, fd, MDIOCDETACH, (void *)mdio); + (void)kern_ioctl(td, fd, MDIOCDETACH, (void *)mdio); /* Ignore errors. We don't care. */ root_mount_mddev = -1; } From owner-svn-src-all@freebsd.org Sat Nov 17 20:11:22 2018 Return-Path: Delivered-To: svn-src-all@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 6EB801103FD5; Sat, 17 Nov 2018 20:11:22 +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 1799C7C479; Sat, 17 Nov 2018 20:11:22 +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 ECEBED05; Sat, 17 Nov 2018 20:11:21 +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 wAHKBL6u053219; Sat, 17 Nov 2018 20:11:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKBLR3053217; Sat, 17 Nov 2018 20:11:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811172011.wAHKBLR3053217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 17 Nov 2018 20:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340515 - releng/12.0/sys/arm/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/12.0/sys/arm/conf X-SVN-Commit-Revision: 340515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1799C7C479 X-Spamd-Result: default: False [0.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.07)[0.068,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:11:22 -0000 Author: gjb Date: Sat Nov 17 20:11:20 2018 New Revision: 340515 URL: https://svnweb.freebsd.org/changeset/base/340515 Log: MFS12 r340503: Remove debugging options from arm, armv6, armv7 files included by GENERIC. This should have been turned off when stable/12 branched. Submitted by: thompsa Approved by: re (rgrimes) Sponsored by: The FreeBSD Foundation Modified: releng/12.0/sys/arm/conf/std.arm releng/12.0/sys/arm/conf/std.armv6 releng/12.0/sys/arm/conf/std.armv7 Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/arm/conf/std.arm ============================================================================== --- releng/12.0/sys/arm/conf/std.arm Sat Nov 17 20:07:37 2018 (r340514) +++ releng/12.0/sys/arm/conf/std.arm Sat Nov 17 20:11:20 2018 (r340515) @@ -10,17 +10,6 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options USB_DEBUG # Enable usb debug support code - # Optional extras, never enabled by default: #options BOOTVERBOSE #options DEBUG # May result in extreme spewage Modified: releng/12.0/sys/arm/conf/std.armv6 ============================================================================== --- releng/12.0/sys/arm/conf/std.armv6 Sat Nov 17 20:07:37 2018 (r340514) +++ releng/12.0/sys/arm/conf/std.armv6 Sat Nov 17 20:11:20 2018 (r340515) @@ -60,17 +60,6 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options USB_DEBUG # Enable usb debug support code - # Optional extras, never enabled by default: #options BOOTVERBOSE #options DEBUG # May result in extreme spewage Modified: releng/12.0/sys/arm/conf/std.armv7 ============================================================================== --- releng/12.0/sys/arm/conf/std.armv7 Sat Nov 17 20:07:37 2018 (r340514) +++ releng/12.0/sys/arm/conf/std.armv7 Sat Nov 17 20:11:20 2018 (r340515) @@ -60,17 +60,6 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options USB_DEBUG # Enable usb debug support code - # Optional extras, never enabled by default: #options BOOTVERBOSE #options DEBUG # May result in extreme spewage From owner-svn-src-all@freebsd.org Sat Nov 17 20:11:40 2018 Return-Path: Delivered-To: svn-src-all@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 5F2A71104139; Sat, 17 Nov 2018 20:11:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 063AE7C6D6; Sat, 17 Nov 2018 20:11:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB641E21; Sat, 17 Nov 2018 20:11:39 +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 wAHKBd2m055495; Sat, 17 Nov 2018 20:11:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKBdm3055494; Sat, 17 Nov 2018 20:11:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172011.wAHKBdm3055494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340516 - stable/12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libc/sys X-SVN-Commit-Revision: 340516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 063AE7C6D6 X-Spamd-Result: default: False [0.04 / 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.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:11:40 -0000 Author: markj Date: Sat Nov 17 20:11:39 2018 New Revision: 340516 URL: https://svnweb.freebsd.org/changeset/base/340516 Log: MFC r339692: Clarify slightly the interaction between wait*() and pdfork(). Modified: stable/12/lib/libc/sys/wait.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/wait.2 ============================================================================== --- stable/12/lib/libc/sys/wait.2 Sat Nov 17 20:11:20 2018 (r340515) +++ stable/12/lib/libc/sys/wait.2 Sat Nov 17 20:11:39 2018 (r340516) @@ -28,7 +28,7 @@ .\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd October 24, 2018 .Dt WAIT 2 .Os .Sh NAME @@ -597,11 +597,11 @@ fields of .Fa infop must be checked against zero to determine if a process reported status. .Pp +The .Fn wait -called with -1 to wait for any child process will ignore a child that is -referenced by a process descriptor (see -.Xr pdfork 2 ) . -Specific processes can still be waited on by specifying the process ID. +family of functions will not return a child process created with +.Xr pdfork 2 +unless specifically directed to do so by specifying its process ID. .Sh ERRORS The .Fn wait From owner-svn-src-all@freebsd.org Sat Nov 17 20:14:03 2018 Return-Path: Delivered-To: svn-src-all@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 7F5921104268; Sat, 17 Nov 2018 20:14:03 +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 2335B7C925; Sat, 17 Nov 2018 20:14:03 +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 059D0E66; Sat, 17 Nov 2018 20:14:03 +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 wAHKE2mq057127; Sat, 17 Nov 2018 20:14:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKE2gT057126; Sat, 17 Nov 2018 20:14:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172014.wAHKE2gT057126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340517 - stable/12/lib/libcasper/libcasper X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libcasper/libcasper X-SVN-Commit-Revision: 340517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2335B7C925 X-Spamd-Result: default: False [0.04 / 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.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:14:03 -0000 Author: markj Date: Sat Nov 17 20:14:02 2018 New Revision: 340517 URL: https://svnweb.freebsd.org/changeset/base/340517 Log: MFC r339675: Fix comments. Modified: stable/12/lib/libcasper/libcasper/libcasper.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcasper/libcasper/libcasper.c ============================================================================== --- stable/12/lib/libcasper/libcasper/libcasper.c Sat Nov 17 20:11:39 2018 (r340516) +++ stable/12/lib/libcasper/libcasper/libcasper.c Sat Nov 17 20:14:02 2018 (r340517) @@ -100,12 +100,12 @@ cap_init(void) pid = pdfork(&pfd, 0); if (pid == 0) { - /* Parent. */ + /* Child. */ close(sock[0]); casper_main_loop(sock[1]); /* NOTREACHED. */ } else if (pid > 0) { - /* Child. */ + /* Parent. */ close(sock[1]); chan = cap_wrap(sock[0], 0); if (chan == NULL) { From owner-svn-src-all@freebsd.org Sat Nov 17 20:18:17 2018 Return-Path: Delivered-To: svn-src-all@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 7870611043F2; Sat, 17 Nov 2018 20:18:17 +0000 (UTC) (envelope-from wulf@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 1CFE17CC8B; Sat, 17 Nov 2018 20:18:17 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2342E6B; Sat, 17 Nov 2018 20:18:16 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHKIGx0057366; Sat, 17 Nov 2018 20:18:16 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKIFrl057361; Sat, 17 Nov 2018 20:18:15 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201811172018.wAHKIFrl057361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 17 Nov 2018 20:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340518 - in stable/12/sys/dev: atkbdc evdev kbdmux usb/input X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12/sys/dev: atkbdc evdev kbdmux usb/input X-SVN-Commit-Revision: 340518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CFE17CC8B X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.05)[0.048,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:18:17 -0000 Author: wulf Date: Sat Nov 17 20:18:15 2018 New Revision: 340518 URL: https://svnweb.freebsd.org/changeset/base/340518 Log: MFC r339823: evdev: Use console lock as evdev lock for all supported keyboard drivers. Now evdev part of keyboard drivers does not take any locks if corresponding input/eventN device node is not opened by userland consumers. Do not assert console lock inside evdev to handle the cases when keyboard driver is called from some special single-threaded context like shutdown thread. MFC r339824: evdev: disable evdev if it is invoked from KDB or panic context This allow to prevent deadlock on entering KDB if one of evdev locks is already taken by userspace process. Also this change discards all but LED console events produced by KDB as unrelated to userspace. Modified: stable/12/sys/dev/atkbdc/atkbd.c stable/12/sys/dev/evdev/cdev.c stable/12/sys/dev/evdev/evdev.c stable/12/sys/dev/evdev/evdev_private.h stable/12/sys/dev/kbdmux/kbdmux.c stable/12/sys/dev/usb/input/ukbd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/atkbdc/atkbd.c ============================================================================== --- stable/12/sys/dev/atkbdc/atkbd.c Sat Nov 17 20:14:02 2018 (r340517) +++ stable/12/sys/dev/atkbdc/atkbd.c Sat Nov 17 20:18:15 2018 (r340518) @@ -484,7 +484,7 @@ atkbd_init(int unit, keyboard_t **kbdp, void *arg, int evdev_support_led(evdev, LED_CAPSL); evdev_support_led(evdev, LED_SCROLLL); - if (evdev_register(evdev)) + if (evdev_register_mtx(evdev, &Giant)) evdev_free(evdev); else state->ks_evdev = evdev; Modified: stable/12/sys/dev/evdev/cdev.c ============================================================================== --- stable/12/sys/dev/evdev/cdev.c Sat Nov 17 20:14:02 2018 (r340517) +++ stable/12/sys/dev/evdev/cdev.c Sat Nov 17 20:18:15 2018 (r340518) @@ -349,6 +349,19 @@ evdev_ioctl(struct cdev *dev, u_long cmd, caddr_t data if (client->ec_revoked || evdev == NULL) return (ENODEV); + /* + * Fix evdev state corrupted with discarding of kdb events. + * EVIOCGKEY and EVIOCGLED ioctls can suffer from this. + */ + if (evdev->ev_kdb_active) { + EVDEV_LOCK(evdev); + if (evdev->ev_kdb_active) { + evdev->ev_kdb_active = false; + evdev_restore_after_kdb(evdev); + } + EVDEV_UNLOCK(evdev); + } + /* file I/O ioctl handling */ switch (cmd) { case FIOSETOWN: Modified: stable/12/sys/dev/evdev/evdev.c ============================================================================== --- stable/12/sys/dev/evdev/evdev.c Sat Nov 17 20:14:02 2018 (r340517) +++ stable/12/sys/dev/evdev/evdev.c Sat Nov 17 20:18:15 2018 (r340518) @@ -32,9 +32,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -763,6 +765,30 @@ evdev_send_event(struct evdev_dev *evdev, uint16_t typ } } +void +evdev_restore_after_kdb(struct evdev_dev *evdev) +{ + int code; + + EVDEV_LOCK_ASSERT(evdev); + + /* Report postponed leds */ + for (code = 0; code < LED_CNT; code++) + if (bit_test(evdev->ev_kdb_led_states, code)) + evdev_send_event(evdev, EV_LED, code, + !bit_test(evdev->ev_led_states, code)); + bit_nclear(evdev->ev_kdb_led_states, 0, LED_MAX); + + /* Release stuck keys (CTRL + ALT + ESC) */ + evdev_stop_repeat(evdev); + for (code = 0; code < KEY_CNT; code++) { + if (bit_test(evdev->ev_key_states, code)) { + evdev_send_event(evdev, EV_KEY, code, KEY_EVENT_UP); + evdev_send_event(evdev, EV_SYN, SYN_REPORT, 1); + } + } +} + int evdev_push_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, int32_t value) @@ -771,7 +797,25 @@ evdev_push_event(struct evdev_dev *evdev, uint16_t typ if (evdev_check_event(evdev, type, code, value) != 0) return (EINVAL); + /* + * Discard all but LEDs kdb events as unrelated to userspace. + * Aggregate LED updates and postpone reporting until kdb deactivation. + */ + if (kdb_active || SCHEDULER_STOPPED()) { + evdev->ev_kdb_active = true; + if (type == EV_LED) + bit_set(evdev->ev_kdb_led_states, + bit_test(evdev->ev_led_states, code) != value); + return (0); + } + EVDEV_ENTER(evdev); + + /* Fix evdev state corrupted with discarding of kdb events */ + if (evdev->ev_kdb_active) { + evdev->ev_kdb_active = false; + evdev_restore_after_kdb(evdev); + } evdev_modify_event(evdev, type, code, &value); if (type == EV_SYN && code == SYN_REPORT && Modified: stable/12/sys/dev/evdev/evdev_private.h ============================================================================== --- stable/12/sys/dev/evdev/evdev_private.h Sat Nov 17 20:14:02 2018 (r340517) +++ stable/12/sys/dev/evdev/evdev_private.h Sat Nov 17 20:18:15 2018 (r340518) @@ -117,6 +117,10 @@ struct evdev_dev bitstr_t bit_decl(ev_sw_states, SW_CNT); bool ev_report_opened; + /* KDB state: */ + bool ev_kdb_active; + bitstr_t bit_decl(ev_kdb_led_states, LED_CNT); + /* Multitouch protocol type B state: */ struct evdev_mt * ev_mt; @@ -132,9 +136,14 @@ struct evdev_dev LIST_HEAD(, evdev_client) ev_clients; }; +#define SYSTEM_CONSOLE_LOCK &Giant + #define EVDEV_LOCK(evdev) mtx_lock((evdev)->ev_lock) #define EVDEV_UNLOCK(evdev) mtx_unlock((evdev)->ev_lock) -#define EVDEV_LOCK_ASSERT(evdev) mtx_assert((evdev)->ev_lock, MA_OWNED) +#define EVDEV_LOCK_ASSERT(evdev) do { \ + if ((evdev)->ev_lock != SYSTEM_CONSOLE_LOCK) \ + mtx_assert((evdev)->ev_lock, MA_OWNED); \ +} while (0) #define EVDEV_ENTER(evdev) do { \ if ((evdev)->ev_lock_type == EV_LOCK_INTERNAL) \ EVDEV_LOCK(evdev); \ @@ -185,6 +194,7 @@ int evdev_cdev_destroy(struct evdev_dev *); bool evdev_event_supported(struct evdev_dev *, uint16_t); void evdev_set_abs_bit(struct evdev_dev *, uint16_t); void evdev_set_absinfo(struct evdev_dev *, uint16_t, struct input_absinfo *); +void evdev_restore_after_kdb(struct evdev_dev *); /* Client interface: */ int evdev_register_client(struct evdev_dev *, struct evdev_client *); Modified: stable/12/sys/dev/kbdmux/kbdmux.c ============================================================================== --- stable/12/sys/dev/kbdmux/kbdmux.c Sat Nov 17 20:14:02 2018 (r340517) +++ stable/12/sys/dev/kbdmux/kbdmux.c Sat Nov 17 20:18:15 2018 (r340518) @@ -505,7 +505,7 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, in evdev_support_led(evdev, LED_CAPSL); evdev_support_led(evdev, LED_SCROLLL); - if (evdev_register(evdev)) + if (evdev_register_mtx(evdev, &Giant)) evdev_free(evdev); else state->ks_evdev = evdev; Modified: stable/12/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/12/sys/dev/usb/input/ukbd.c Sat Nov 17 20:14:02 2018 (r340517) +++ stable/12/sys/dev/usb/input/ukbd.c Sat Nov 17 20:18:15 2018 (r340518) @@ -1361,7 +1361,7 @@ ukbd_attach(device_t dev) if (sc->sc_flags & UKBD_FLAG_SCROLLLOCK) evdev_support_led(evdev, LED_SCROLLL); - if (evdev_register(evdev)) + if (evdev_register_mtx(evdev, &Giant)) evdev_free(evdev); else sc->sc_evdev = evdev; From owner-svn-src-all@freebsd.org Sat Nov 17 20:27:07 2018 Return-Path: Delivered-To: svn-src-all@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 4C8C811046B6; Sat, 17 Nov 2018 20:27:07 +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 E85157D2D6; Sat, 17 Nov 2018 20:27:06 +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 C94201023; Sat, 17 Nov 2018 20:27:06 +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 wAHKR6Lc062441; Sat, 17 Nov 2018 20:27:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKR6he062440; Sat, 17 Nov 2018 20:27:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811172027.wAHKR6he062440@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 20:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340519 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 340519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E85157D2D6 X-Spamd-Result: default: False [0.04 / 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.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:27:07 -0000 Author: kevans Date: Sat Nov 17 20:27:06 2018 New Revision: 340519 URL: https://svnweb.freebsd.org/changeset/base/340519 Log: MFC r340372: dtb.mk: Fix passing of ECHO to make_dtb{,o}.sh Modified: stable/12/sys/conf/dtb.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/dtb.mk ============================================================================== --- stable/12/sys/conf/dtb.mk Sat Nov 17 20:18:15 2018 (r340518) +++ stable/12/sys/conf/dtb.mk Sat Nov 17 20:27:06 2018 (r340519) @@ -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-all@freebsd.org Sat Nov 17 20:47:42 2018 Return-Path: Delivered-To: svn-src-all@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 0ECFA1105119; Sat, 17 Nov 2018 20:47: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 A7F1E7E381; Sat, 17 Nov 2018 20:47: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 84E001389; Sat, 17 Nov 2018 20:47: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 wAHKlf4I073643; Sat, 17 Nov 2018 20:47:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKlfrM073642; Sat, 17 Nov 2018 20:47:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172047.wAHKlfrM073642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340520 - releng/12.0/share/man/man4 X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: releng/12.0/share/man/man4 X-SVN-Commit-Revision: 340520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7F1E7E381 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.064,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:47:42 -0000 Author: markj Date: Sat Nov 17 20:47:41 2018 New Revision: 340520 URL: https://svnweb.freebsd.org/changeset/base/340520 Log: MFstable/12 r340498: Hook mac_ntpd.4 up to the build. PR: 232757 Approved by: re (gjb) Modified: releng/12.0/share/man/man4/Makefile Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/share/man/man4/Makefile ============================================================================== --- releng/12.0/share/man/man4/Makefile Sat Nov 17 20:27:06 2018 (r340519) +++ releng/12.0/share/man/man4/Makefile Sat Nov 17 20:47:41 2018 (r340520) @@ -269,6 +269,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-all@freebsd.org Sat Nov 17 20:54:26 2018 Return-Path: Delivered-To: svn-src-all@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 AC1BC110543C; Sat, 17 Nov 2018 20:54:26 +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 526E37E881; Sat, 17 Nov 2018 20:54:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3380D1535; Sat, 17 Nov 2018 20:54:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAHKsPsk078470; Sat, 17 Nov 2018 20:54:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKsOV2078465; Sat, 17 Nov 2018 20:54:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172054.wAHKsOV2078465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340521 - stable/12/usr.sbin/rtsold X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/rtsold X-SVN-Commit-Revision: 340521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 526E37E881 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.05)[0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:54:26 -0000 Author: markj Date: Sat Nov 17 20:54:24 2018 New Revision: 340521 URL: https://svnweb.freebsd.org/changeset/base/340521 Log: MFC r339453, r339455, r339456, r339460, r339687, r339745, r339747: Miscellaneous cleanups of rtsol(d). Modified: stable/12/usr.sbin/rtsold/if.c stable/12/usr.sbin/rtsold/rtsock.c stable/12/usr.sbin/rtsold/rtsol.c stable/12/usr.sbin/rtsold/rtsold.8 stable/12/usr.sbin/rtsold/rtsold.c stable/12/usr.sbin/rtsold/rtsold.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/rtsold/if.c ============================================================================== --- stable/12/usr.sbin/rtsold/if.c Sat Nov 17 20:47:41 2018 (r340520) +++ stable/12/usr.sbin/rtsold/if.c Sat Nov 17 20:54:24 2018 (r340521) @@ -332,37 +332,6 @@ if_nametosdl(char *name) return (ret_sdl); } -int -getinet6sysctl(int code) -{ - int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 }; - int value; - size_t size; - - mib[3] = code; - size = sizeof(value); - if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) < 0) - return (-1); - else - return (value); -} - -int -setinet6sysctl(int code, int newval) -{ - int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 }; - int value; - size_t size; - - mib[3] = code; - size = sizeof(value); - if (sysctl(mib, nitems(mib), &value, &size, - &newval, sizeof(newval)) < 0) - return (-1); - else - return (value); -} - /*------------------------------------------------------------*/ /* get ia6_flags for link-local addr on if. returns -1 on error. */ Modified: stable/12/usr.sbin/rtsold/rtsock.c ============================================================================== --- stable/12/usr.sbin/rtsold/rtsock.c Sat Nov 17 20:47:41 2018 (r340520) +++ stable/12/usr.sbin/rtsold/rtsock.c Sat Nov 17 20:54:24 2018 (r340521) @@ -57,27 +57,15 @@ #include #include "rtsold.h" -#define ROUNDUP(a, size) \ - (((a) & ((size)-1)) ? (1 + ((a) | ((size)-1))) : (a)) - -#define NEXT_SA(ap) (ap) = (struct sockaddr *) \ - ((caddr_t)(ap) + \ - ((ap)->sa_len ? ROUNDUP((ap)->sa_len, sizeof(u_long)) \ - : sizeof(u_long))) - -#ifdef RTM_IFANNOUNCE /*NetBSD 1.5 or later*/ static int rtsock_input_ifannounce(int, struct rt_msghdr *, char *); -#endif static struct { u_char type; size_t minlen; int (*func)(int, struct rt_msghdr *, char *); } rtsock_dispatch[] = { -#ifdef RTM_IFANNOUNCE /*NetBSD 1.5 or later*/ { RTM_IFANNOUNCE, sizeof(struct if_announcemsghdr), rtsock_input_ifannounce }, -#endif { 0, 0, NULL }, }; @@ -135,7 +123,6 @@ rtsock_input(int s) return (ret); } -#ifdef RTM_IFANNOUNCE /*NetBSD 1.5 or later*/ static int rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim) { @@ -174,4 +161,3 @@ rtsock_input_ifannounce(int s __unused, struct rt_msgh return (0); } -#endif Modified: stable/12/usr.sbin/rtsold/rtsol.c ============================================================================== --- stable/12/usr.sbin/rtsold/rtsol.c Sat Nov 17 20:47:41 2018 (r340520) +++ stable/12/usr.sbin/rtsold/rtsol.c Sat Nov 17 20:54:24 2018 (r340521) @@ -98,22 +98,20 @@ static char *make_rsid(const char *, const char *, str #define _ARGS_RESADD resolvconf_script, "-a", rsid #define _ARGS_RESDEL resolvconf_script, "-d", rsid -#define CALL_SCRIPT(name, sm_head) \ - do { \ - const char *const sarg[] = { _ARGS_##name, NULL }; \ - call_script(sizeof(sarg), sarg, sm_head); \ - } while(0) +#define CALL_SCRIPT(name, sm_head) do { \ + const char *const sarg[] = { _ARGS_##name, NULL }; \ + call_script(sizeof(sarg), sarg, sm_head); \ +} while (0) -#define ELM_MALLOC(p,error_action) \ - do { \ - p = malloc(sizeof(*p)); \ - if (p == NULL) { \ - warnmsg(LOG_ERR, __func__, "malloc failed: %s", \ - strerror(errno)); \ - error_action; \ - } \ - memset(p, 0, sizeof(*p)); \ - } while(0) +#define ELM_MALLOC(p, error_action) do { \ + p = malloc(sizeof(*p)); \ + if (p == NULL) { \ + warnmsg(LOG_ERR, __func__, "malloc failed: %s", \ + strerror(errno)); \ + error_action; \ + } \ + memset(p, 0, sizeof(*p)); \ +} while (0) int sockopen(void) @@ -616,7 +614,6 @@ ra_opt_handler(struct ifinfo *ifi) TAILQ_INSERT_TAIL(&sm_rdnss_head, smp3, sm_next); ifi->ifi_rdnss = IFI_DNSOPT_STATE_RECEIVED; - break; case ND_OPT_DNSSL: if (TS_CMP(&now, &rao->rao_expire, >)) { @@ -656,10 +653,7 @@ ra_opt_handler(struct ifinfo *ifi) sm_next); dlen += strlen(rao->rao_msg) + strlen(resstr_sp); - break; - ifi->ifi_dnssl = IFI_DNSOPT_STATE_RECEIVED; - default: break; } continue; @@ -701,13 +695,12 @@ make_rsid(const char *ifname, const char *origin, stru } int -ra_opt_rdnss_dispatch(struct ifinfo *ifi, - struct rainfo *rai, +ra_opt_rdnss_dispatch(struct ifinfo *ifi, struct rainfo *rai, struct script_msg_head_t *sm_rdnss_head, struct script_msg_head_t *sm_dnssl_head) { - const char *r; struct script_msg *smp1; + const char *r; int error; error = 0; @@ -719,10 +712,7 @@ ra_opt_rdnss_dispatch(struct ifinfo *ifi, } TAILQ_CONCAT(sm_rdnss_head, sm_dnssl_head, sm_next); - if (rai != NULL && uflag) - r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, rai); - else - r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, NULL); + r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, uflag ? rai : NULL); if (r == NULL) { warnmsg(LOG_ERR, __func__, "make_rsid() failed. " "Script was not invoked."); Modified: stable/12/usr.sbin/rtsold/rtsold.8 ============================================================================== --- stable/12/usr.sbin/rtsold/rtsold.8 Sat Nov 17 20:47:41 2018 (r340520) +++ stable/12/usr.sbin/rtsold/rtsold.8 Sat Nov 17 20:54:24 2018 (r340521) @@ -241,16 +241,16 @@ The .Xr resolvconf 8 script is used by default. .It Fl u -Specifies whether adding the source address of Router Advertisement -messages to the interface name in an argument of the RDNSS and DNSSL -script. +Specifies whether to add the source address of Router Advertisement +messages to the interface name in the parameters of the RDNSS and DNSSL +scripts. .Pp If .Fl u -is specified, the interface name in the script argument will be +is specified, the interface name in the script parameters will be .Ql ifname:slaac:[RA-source-address] . .Pp -If not, it will be +Otherwise it will be .Ql ifname:slaac . .El .Sh FILES Modified: stable/12/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/12/usr.sbin/rtsold/rtsold.c Sat Nov 17 20:47:41 2018 (r340520) +++ stable/12/usr.sbin/rtsold/rtsold.c Sat Nov 17 20:54:24 2018 (r340521) @@ -33,10 +33,9 @@ * $FreeBSD$ */ -#include +#include #include #include -#include #include #include @@ -98,10 +97,8 @@ static int do_dump; static const char *dumpfilename = RTSOL_DUMPFILE; #endif -#if 0 -static int ifreconfig(char *); -#endif - +static char **autoifprobe(void); +static int ifconfig(char *ifname); static int make_packet(struct ifinfo *); static struct timespec *rtsol_check_timer(void); @@ -217,16 +214,6 @@ main(int argc, char **argv) pidfilename); } -#if (__FreeBSD_version < 900000) - if (Fflag) { - setinet6sysctl(IPV6CTL_FORWARDING, 0); - } else { - /* warn if forwarding is up */ - if (getinet6sysctl(IPV6CTL_FORWARDING)) - warnx("kernel is configured as a router, not a host"); - } -#endif - #ifndef SMALL /* initialization to dump internal status to a file */ signal(SIGUSR1, rtsold_set_dump_file); @@ -340,23 +327,23 @@ main(int argc, char **argv) return (0); } -int +static int ifconfig(char *ifname) { struct ifinfo *ifi; struct sockaddr_dl *sdl; int flags; + ifi = NULL; if ((sdl = if_nametosdl(ifname)) == NULL) { warnmsg(LOG_ERR, __func__, "failed to get link layer information for %s", ifname); - return (-1); + goto bad; } if (find_ifinfo(sdl->sdl_index)) { warnmsg(LOG_ERR, __func__, "interface %s was already configured", ifname); - free(sdl); - return (-1); + goto bad; } if (Fflag) { @@ -365,30 +352,29 @@ ifconfig(char *ifname) if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { warnmsg(LOG_ERR, __func__, "socket() failed."); - return (-1); + goto bad; } memset(&nd, 0, sizeof(nd)); strlcpy(nd.ifname, ifname, sizeof(nd.ifname)); if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) { warnmsg(LOG_ERR, __func__, "cannot get accept_rtadv flag"); - close(s); - return (-1); + (void)close(s); + goto bad; } nd.ndi.flags |= ND6_IFF_ACCEPT_RTADV; if (ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&nd) < 0) { warnmsg(LOG_ERR, __func__, "cannot set accept_rtadv flag"); - close(s); - return (-1); + (void)close(s); + goto bad; } - close(s); + (void)close(s); } if ((ifi = malloc(sizeof(*ifi))) == NULL) { warnmsg(LOG_ERR, __func__, "memory allocation failed"); - free(sdl); - return (-1); + goto bad; } memset(ifi, 0, sizeof(*ifi)); ifi->sdl = sdl; @@ -439,53 +425,11 @@ ifconfig(char *ifname) return (0); bad: - free(ifi->sdl); + free(sdl); free(ifi); return (-1); } -void -iflist_init(void) -{ - struct ifinfo *ifi; - - while ((ifi = TAILQ_FIRST(&ifinfo_head)) != NULL) { - TAILQ_REMOVE(&ifinfo_head, ifi, ifi_next); - if (ifi->sdl != NULL) - free(ifi->sdl); - if (ifi->rs_data != NULL) - free(ifi->rs_data); - free(ifi); - } -} - -#if 0 -static int -ifreconfig(char *ifname) -{ - struct ifinfo *ifi, *prev; - int rv; - - prev = NULL; - TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) { - if (strncmp(ifi->ifname, ifname, sizeof(ifi->ifname)) == 0) - break; - prev = ifi; - } - prev->next = ifi->next; - - rv = ifconfig(ifname); - - /* reclaim it after ifconfig() in case ifname is pointer inside ifi */ - if (ifi->rs_data) - free(ifi->rs_data); - free(ifi->sdl); - free(ifi); - - return (rv); -} -#endif - struct rainfo * find_rainfo(struct ifinfo *ifi, struct sockaddr_in6 *sin6) { @@ -767,9 +711,6 @@ rtsol_timer_update(struct ifinfo *ifi) #undef MILLION } -/* timer related utility functions */ -#define MILLION 1000000 - #ifndef SMALL static void rtsold_set_dump_file(int sig __unused) @@ -817,7 +758,7 @@ warnmsg(int priority, const char *func, const char *ms /* * return a list of interfaces which is suitable to sending an RS. */ -char ** +static char ** autoifprobe(void) { static char **argv = NULL; Modified: stable/12/usr.sbin/rtsold/rtsold.h ============================================================================== --- stable/12/usr.sbin/rtsold/rtsold.h Sat Nov 17 20:47:41 2018 (r340520) +++ stable/12/usr.sbin/rtsold/rtsold.h Sat Nov 17 20:54:24 2018 (r340521) @@ -157,14 +157,11 @@ extern int Fflag; extern int uflag; extern const char *otherconf_script; extern const char *resolvconf_script; -extern int ifconfig(char *); -extern void iflist_init(void); struct ifinfo *find_ifinfo(int); struct rainfo *find_rainfo(struct ifinfo *, struct sockaddr_in6 *); void rtsol_timer_update(struct ifinfo *); extern void warnmsg(int, const char *, const char *, ...) __attribute__((__format__(__printf__, 3, 4))); -extern char **autoifprobe(void); extern int ra_opt_handler(struct ifinfo *); /* if.c */ @@ -174,8 +171,6 @@ extern int interface_status(struct ifinfo *); extern int lladdropt_length(struct sockaddr_dl *); extern void lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *); extern struct sockaddr_dl *if_nametosdl(char *); -extern int getinet6sysctl(int); -extern int setinet6sysctl(int, int); /* rtsol.c */ extern int rssock; From owner-svn-src-all@freebsd.org Sat Nov 17 20:55:13 2018 Return-Path: Delivered-To: svn-src-all@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 01D5D11054E9; Sat, 17 Nov 2018 20:55:13 +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 9E5BC7EA67; Sat, 17 Nov 2018 20:55:12 +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 7F7291536; Sat, 17 Nov 2018 20:55:12 +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 wAHKtCC6078589; Sat, 17 Nov 2018 20:55:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKtC5S078587; Sat, 17 Nov 2018 20:55:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172055.wAHKtC5S078587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340522 - in stable/12/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 340522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E5BC7EA67 X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.044,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:55:13 -0000 Author: markj Date: Sat Nov 17 20:55:11 2018 New Revision: 340522 URL: https://svnweb.freebsd.org/changeset/base/340522 Log: MFC r339490: Add an assertion to pmap_enter(). Modified: stable/12/sys/amd64/amd64/pmap.c stable/12/sys/i386/i386/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Sat Nov 17 20:54:24 2018 (r340521) +++ stable/12/sys/amd64/amd64/pmap.c Sat Nov 17 20:55:11 2018 (r340522) @@ -5141,6 +5141,8 @@ retry: vm_page_aflag_set(om, PGA_REFERENCED); CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); pv = pmap_pvh_remove(&om->md, pmap, va); + KASSERT(pv != NULL, + ("pmap_enter: no PV entry for %#lx", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); if ((om->aflags & PGA_WRITEABLE) != 0 && Modified: stable/12/sys/i386/i386/pmap.c ============================================================================== --- stable/12/sys/i386/i386/pmap.c Sat Nov 17 20:54:24 2018 (r340521) +++ stable/12/sys/i386/i386/pmap.c Sat Nov 17 20:55:11 2018 (r340522) @@ -3820,6 +3820,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v if ((origpte & PG_A) != 0) vm_page_aflag_set(om, PGA_REFERENCED); pv = pmap_pvh_remove(&om->md, pmap, va); + KASSERT(pv != NULL, + ("pmap_enter: no PV entry for %#x", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); if ((om->aflags & PGA_WRITEABLE) != 0 && From owner-svn-src-all@freebsd.org Sat Nov 17 20:58:37 2018 Return-Path: Delivered-To: svn-src-all@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 8FFA811057A3; Sat, 17 Nov 2018 20:58: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 398617F2EF; Sat, 17 Nov 2018 20:58: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 1B981153C; Sat, 17 Nov 2018 20:58: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 wAHKwa6A078802; Sat, 17 Nov 2018 20:58:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKwahv078797; Sat, 17 Nov 2018 20:58:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172058.wAHKwahv078797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340523 - in stable/12: bin/setfacl tests/sys/acl X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: bin/setfacl tests/sys/acl X-SVN-Commit-Revision: 340523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 398617F2EF X-Spamd-Result: default: False [0.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.32)[0.323,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:58:37 -0000 Author: markj Date: Sat Nov 17 20:58:35 2018 New Revision: 340523 URL: https://svnweb.freebsd.org/changeset/base/340523 Log: MFC r339781: Don't print pathconf() errors if the target file doesn't exist. MFC r339782: Update and re-enable ACL tests. PR: 229930 Modified: stable/12/bin/setfacl/setfacl.c stable/12/tests/sys/acl/Makefile stable/12/tests/sys/acl/tools-nfs4-psarc.test stable/12/tests/sys/acl/tools-nfs4.test stable/12/tests/sys/acl/tools-posix.test Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/setfacl/setfacl.c ============================================================================== --- stable/12/bin/setfacl/setfacl.c Sat Nov 17 20:55:11 2018 (r340522) +++ stable/12/bin/setfacl/setfacl.c Sat Nov 17 20:58:35 2018 (r340523) @@ -220,8 +220,8 @@ handle_file(FTS *ftsp, FTSENT *file) } else if (ret == 0) { if (acl_type == ACL_TYPE_NFS4) acl_type = ACL_TYPE_ACCESS; - } else if (ret < 0 && errno != EINVAL) { - warn("%s: pathconf(..., _PC_ACL_NFS4) failed", + } else if (ret < 0 && errno != EINVAL && errno != ENOENT) { + warn("%s: pathconf(_PC_ACL_NFS4) failed", file->fts_path); } Modified: stable/12/tests/sys/acl/Makefile ============================================================================== --- stable/12/tests/sys/acl/Makefile Sat Nov 17 20:55:11 2018 (r340522) +++ stable/12/tests/sys/acl/Makefile Sat Nov 17 20:58:35 2018 (r340523) @@ -14,11 +14,9 @@ ${PACKAGE}FILES+= tools-posix.test SCRIPTS+= run -# Disable 00 and 02 until they've been updated for setfacl's new behavior -# PR 229930 tests/sys/acl/00:main fails in CI due to unexpected error message -# TAP_TESTS_SH+= 00 -# TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 00 TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 TAP_TESTS_SH+= 03 TAP_TESTS_SH+= 04 Modified: stable/12/tests/sys/acl/tools-nfs4-psarc.test ============================================================================== --- stable/12/tests/sys/acl/tools-nfs4-psarc.test Sat Nov 17 20:55:11 2018 (r340522) +++ stable/12/tests/sys/acl/tools-nfs4-psarc.test Sat Nov 17 20:58:35 2018 (r340523) @@ -186,7 +186,7 @@ $ ls -l xxx yyy zzz | cut -d' ' -f1 > -rw-r--r-- $ setfacl -m u:42:x:allow,g:43:w:allow nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory @@ -215,7 +215,7 @@ $ getfacl -nq nnn xxx yyy zzz > everyone@:r-----a-R-c--s:-------:allow $ setfacl -b nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory Modified: stable/12/tests/sys/acl/tools-nfs4.test ============================================================================== --- stable/12/tests/sys/acl/tools-nfs4.test Sat Nov 17 20:55:11 2018 (r340522) +++ stable/12/tests/sys/acl/tools-nfs4.test Sat Nov 17 20:58:35 2018 (r340523) @@ -214,7 +214,7 @@ $ ls -l xxx yyy zzz | cut -d' ' -f1 > -rw-r--r-- $ setfacl -m u:42:x:allow,g:43:w:allow nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory @@ -252,7 +252,7 @@ $ getfacl -nq nnn xxx yyy zzz > everyone@:r-----a-R-c--s:-------:allow $ setfacl -b nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory Modified: stable/12/tests/sys/acl/tools-posix.test ============================================================================== --- stable/12/tests/sys/acl/tools-posix.test Sat Nov 17 20:55:11 2018 (r340522) +++ stable/12/tests/sys/acl/tools-posix.test Sat Nov 17 20:58:35 2018 (r340523) @@ -226,7 +226,7 @@ $ ls -l xxx yyy zzz | cut -d' ' -f1 > -rw-r--r-- $ setfacl -m u:42:x,g:43:w nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory @@ -258,7 +258,7 @@ $ getfacl -nq nnn xxx yyy zzz > other::r-- $ setfacl -b nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory @@ -267,7 +267,7 @@ $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > -rw-r--r--+ $ setfacl -bn nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory From owner-svn-src-all@freebsd.org Sat Nov 17 20:59:51 2018 Return-Path: Delivered-To: svn-src-all@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 38738110595A; Sat, 17 Nov 2018 20:59:51 +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 D55887F589; Sat, 17 Nov 2018 20:59:50 +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 B64CA1541; Sat, 17 Nov 2018 20:59:50 +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 wAHKxoaN078920; Sat, 17 Nov 2018 20:59:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHKxoKD078919; Sat, 17 Nov 2018 20:59:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811172059.wAHKxoKD078919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 17 Nov 2018 20:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340524 - stable/12/bin/setfacl X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/bin/setfacl X-SVN-Commit-Revision: 340524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D55887F589 X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.31)[0.315,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 20:59:51 -0000 Author: markj Date: Sat Nov 17 20:59:50 2018 New Revision: 340524 URL: https://svnweb.freebsd.org/changeset/base/340524 Log: MFC r339780: Avoid leaking memory in error paths. Modified: stable/12/bin/setfacl/setfacl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/setfacl/setfacl.c ============================================================================== --- stable/12/bin/setfacl/setfacl.c Sat Nov 17 20:58:35 2018 (r340523) +++ stable/12/bin/setfacl/setfacl.c Sat Nov 17 20:59:50 2018 (r340524) @@ -307,6 +307,8 @@ handle_file(FTS *ftsp, FTSENT *file) break; } + ret = 0; + /* * Don't try to set an empty default ACL; it will always fail. * Use acl_delete_def_file(3) instead. @@ -316,34 +318,33 @@ handle_file(FTS *ftsp, FTSENT *file) if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", file->fts_path); - return (1); + ret = 1; } - return (0); + goto out; } /* Don't bother setting the ACL if something is broken. */ if (local_error) { - return (1); - } - - if (acl_type != ACL_TYPE_NFS4 && need_mask && + ret = 1; + } else if (acl_type != ACL_TYPE_NFS4 && need_mask && set_acl_mask(&acl, file->fts_path) == -1) { warnx("%s: failed to set ACL mask", file->fts_path); - return (1); + ret = 1; } else if (follow_symlink) { if (acl_set_file(file->fts_accpath, acl_type, acl) == -1) { warn("%s: acl_set_file() failed", file->fts_path); - return (1); + ret = 1; } } else { if (acl_set_link_np(file->fts_accpath, acl_type, acl) == -1) { warn("%s: acl_set_link_np() failed", file->fts_path); - return (1); + ret = 1; } } +out: acl_free(acl); - return (0); + return (ret); } int From owner-svn-src-all@freebsd.org Sat Nov 17 21:35:02 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 22:01:26 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Nov 17 22:55:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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 >> From owner-svn-src-all@freebsd.org Sat Nov 17 23:47:20 2018 Return-Path: Delivered-To: svn-src-all@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 0332D110AACA; Sat, 17 Nov 2018 23:47:20 +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 219D585ED7; Sat, 17 Nov 2018 23:47:18 +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 wAHNlGvt053536; Sat, 17 Nov 2018 15:47: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 wAHNlGi6053535; Sat, 17 Nov 2018 15:47:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811172347.wAHNlGi6053535@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340511 - stable/12/sys/kern In-Reply-To: <201811172001.wAHK1aR7047919@repo.freebsd.org> To: Mark Johnston Date: Sat, 17 Nov 2018 15:47:16 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@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: 219D585ED7 X-Spamd-Result: default: False [1.29 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.42)[0.422,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)]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 23:47:20 -0000 > Author: markj > Date: Sat Nov 17 20:01:35 2018 > New Revision: 340511 > URL: https://svnweb.freebsd.org/changeset/base/340511 > > Log: > MFC r339731: > Add FALLTHROUGH comments to appease Coverity. > > Modified: > stable/12/sys/kern/kern_environment.c > stable/12/sys/kern/vfs_mount.c > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sys/kern/kern_environment.c > ============================================================================== > --- stable/12/sys/kern/kern_environment.c Sat Nov 17 20:00:10 2018 (r340510) > +++ stable/12/sys/kern/kern_environment.c Sat Nov 17 20:01:35 2018 (r340511) > @@ -839,10 +839,13 @@ getenv_quad(const char *name, quad_t *data) > switch (vtp[0]) { > case 't': case 'T': > iv *= 1024; > + /* FALLTHROUGH */ > case 'g': case 'G': > iv *= 1024; > + /* FALLTHROUGH */ > case 'm': case 'M': > iv *= 1024; > + /* FALLTHROUGH */ > case 'k': case 'K': > iv *= 1024; Missing /* FALLTHROUGH */ ?? > case '\0': And a refactor: case 't': case 'T': case 'g': case 'G': case 'm': case 'M': case 'k': case 'K': iv *= 1024; /* FALLTHROUGH */ case '\0': Isnt that the same functionality? > > Modified: stable/12/sys/kern/vfs_mount.c > ============================================================================== > --- stable/12/sys/kern/vfs_mount.c Sat Nov 17 20:00:10 2018 (r340510) > +++ stable/12/sys/kern/vfs_mount.c Sat Nov 17 20:01:35 2018 (r340511) > @@ -1643,17 +1643,16 @@ vfs_getopt_size(struct vfsoptlist *opts, const char *n > if (iv < 0) > return (EINVAL); > switch (vtp[0]) { > - case 't': > - case 'T': > + case 't': case 'T': > iv *= 1024; > - case 'g': > - case 'G': > + /* FALLTHROUGH */ > + case 'g': case 'G': > iv *= 1024; > - case 'm': > - case 'M': > + /* FALLTHROUGH */ > + case 'm': case 'M': > iv *= 1024; > - case 'k': > - case 'K': > + /* FALLTHROUGH */ > + case 'k': case 'K': > iv *= 1024; > case '\0': > break; > Similiar here. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Nov 17 23:51:50 2018 Return-Path: Delivered-To: svn-src-all@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 BD149110AC16; Sat, 17 Nov 2018 23:51:50 +0000 (UTC) (envelope-from markjdb@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 237F386140; Sat, 17 Nov 2018 23:51:50 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x133.google.com with SMTP id a205-v6so3239354itd.4; Sat, 17 Nov 2018 15:51:50 -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=rep41SMUOAI//UDfl1N8mWxNnuCFzoAA/4TjfiINLZY=; b=CwZz796DRhP1WBF6YCCBe4JZGiKiCyC4RpW+XMFswN3xwbHkyctcllnKP4x4cAxmFD ZdHC79A2/+gqyGy5xCCCjqxYbdNt0jVYTxgpbFNrgTAWZyB9PzqlUZLZzLABY7ZBDR1G 9zy8TDXyR23bYSfq4VaXOO/KoqMy4KZav/KKv0tB21TeHp0+PyMQaFkg+9jQSM7Y9El0 3e6hf6l8KAUL9efLcei5umjuYTTusk2OllbsfK11zH5KMrCn40/HG2YA/mTKQCI0CbtS M3omPws66HL8seMZqA/UjYVNPdB79We4bQ18QDJqyHtXIaSdZL542T3NsTy0nGxXiMt2 3mSQ== 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=rep41SMUOAI//UDfl1N8mWxNnuCFzoAA/4TjfiINLZY=; b=PBL49aI5U3WHxol5ejFITWrmZbxpIKigzKLqkxhUb+BfNAT5ssJRkBEez9zjDGy/47 5cu6MIlx3eVobtbRvdYI9mbHjPkW/EwDPoBIlI26sKtB0qvIv6GyNU6WI8U1FiLKrcOs DsQqDLb3778CG3ApnJ0tg3OufnL4L9L8cdfKY+E7fm6ZyYyDpsjxbwMn+lDLnL9pGZry iDTlZ8tKPxQugDTwcUVf77/jSWoOxRSN55ZJy5obBrY7/BrtzWO0w4PIbvUS+F2UVuKE XwantKPA0ODsspsitG8JS7EyirkfrEPwp3TvxlGC5AdxuHQdmoBlDpZXBRML2IiJoQ8e dlvw== X-Gm-Message-State: AGRZ1gL5JzdRTIjufnPbUl5z/zEIDeli8ygvWTelnf0Y/ca2CYALV0LQ 9yww53fBAGDCcWhaUgQpzBisEDKaQp8= X-Google-Smtp-Source: AJdET5dBKDzn58XY+N8rZw9OO5JTB005oheh05hel1kG77/jIRTh6x/uusHJMzHYxFsKrbB+E25UzQ== X-Received: by 2002:a02:8a1c:: with SMTP id j28mr5397679jak.49.1542498709279; Sat, 17 Nov 2018 15:51:49 -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 c187-v6sm11769666itc.2.2018.11.17.15.51.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Nov 2018 15:51:48 -0800 (PST) Sender: Mark Johnston Date: Sat, 17 Nov 2018 18:51:44 -0500 From: Mark Johnston To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r340511 - stable/12/sys/kern Message-ID: <20181117235144.GA2799@raichu> References: <201811172001.wAHK1aR7047919@repo.freebsd.org> <201811172347.wAHNlGi6053535@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811172347.wAHNlGi6053535@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 237F386140 X-Spamd-Result: default: False [-3.30 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0: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]; RCPT_COUNT_FIVE(0.00)[5]; 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)[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.94)[-0.935,0]; IP_SCORE(-2.65)[ip: (-8.77), ipnet: 2607:f8b0::/32(-2.61), asn: 15169(-1.77), country: US(-0.10)]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 23:51:51 -0000 On Sat, Nov 17, 2018 at 03:47:16PM -0800, Rodney W. Grimes wrote: > > Author: markj > > Date: Sat Nov 17 20:01:35 2018 > > New Revision: 340511 > > URL: https://svnweb.freebsd.org/changeset/base/340511 > > > > Log: > > MFC r339731: > > Add FALLTHROUGH comments to appease Coverity. > > > > Modified: > > stable/12/sys/kern/kern_environment.c > > stable/12/sys/kern/vfs_mount.c > > Directory Properties: > > stable/12/ (props changed) > > > > Modified: stable/12/sys/kern/kern_environment.c > > ============================================================================== > > --- stable/12/sys/kern/kern_environment.c Sat Nov 17 20:00:10 2018 (r340510) > > +++ stable/12/sys/kern/kern_environment.c Sat Nov 17 20:01:35 2018 (r340511) > > @@ -839,10 +839,13 @@ getenv_quad(const char *name, quad_t *data) > > switch (vtp[0]) { > > case 't': case 'T': > > iv *= 1024; > > + /* FALLTHROUGH */ > > case 'g': case 'G': > > iv *= 1024; > > + /* FALLTHROUGH */ > > case 'm': case 'M': > > iv *= 1024; > > + /* FALLTHROUGH */ > > case 'k': case 'K': > > iv *= 1024; > Missing /* FALLTHROUGH */ ?? The statement following "case '\0':" is a break. > > > case '\0': > > And a refactor: > > case 't': case 'T': > case 'g': case 'G': > case 'm': case 'M': > case 'k': case 'K': > iv *= 1024; > /* FALLTHROUGH */ > case '\0': > > Isnt that the same functionality? No, it isn't. From owner-svn-src-all@freebsd.org Sat Nov 17 23:52:58 2018 Return-Path: Delivered-To: svn-src-all@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 78A01110AE70; Sat, 17 Nov 2018 23:52: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 1DC1386423; Sat, 17 Nov 2018 23:52: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 F2DB3326E; Sat, 17 Nov 2018 23:52: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 wAHNqvr6072147; Sat, 17 Nov 2018 23:52:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHNqujE072141; Sat, 17 Nov 2018 23:52:56 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811172352.wAHNqujE072141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 17 Nov 2018 23:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340526 - in stable/12: sbin/ipfw sys/conf sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: sbin/ipfw sys/conf sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 340526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DC1386423 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.059,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 23:52:58 -0000 Author: ae Date: Sat Nov 17 23:52:56 2018 New Revision: 340526 URL: https://svnweb.freebsd.org/changeset/base/340526 Log: MFC r339542: Retire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability to switch the output method in run-time. Also document some sysctl variables that can by changed for NAT64 module. NAT64 had compile time option IPFIREWALL_NAT64_DIRECT_OUTPUT to use if_output directly from nat64 module. By default is used netisr based output method. Now both methods can be used, but they require different handling by rules. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D16647 Modified: stable/12/sbin/ipfw/ipfw.8 stable/12/sys/conf/options stable/12/sys/modules/ipfw_nat64/Makefile stable/12/sys/netpfil/ipfw/nat64/ip_fw_nat64.c stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c stable/12/sys/netpfil/ipfw/nat64/nat64_translate.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw.8 ============================================================================== --- stable/12/sbin/ipfw/ipfw.8 Sat Nov 17 21:35:01 2018 (r340525) +++ stable/12/sbin/ipfw/ipfw.8 Sat Nov 17 23:52:56 2018 (r340526) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2018 +.Dd October 21, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -3289,9 +3289,14 @@ Make sure that ND6 neighbor solicitation (ICMPv6 type advertisement (ICMPv6 type 136) messages will not be handled by translation rules. .Pp -After translation NAT64 translator sends packets through corresponding netisr -queue. +After translation NAT64 translator by default sends packets through +corresponding netisr queue. Thus translator host should be configured as IPv4 and IPv6 router. +Also this means, that a packet is handled by firewall twice. +First time an original packet is handled and consumed by translator, +and then it is handled again as translated packet. +This behavior can be changed by sysctl variable +.Va net.inet.ip.fw.nat64_direct_output . .Pp The stateful NAT64 configuration command is the following: .Bd -ragged -offset indent @@ -3914,6 +3919,41 @@ Default is no. Controls whether bridged packets are passed to .Nm . Default is no. +.It Va net.inet.ip.fw.nat64_allow_private : No 0 +Defines how +.Nm nat64 +handles private IPv4 addresses: +.Bl -tag -width indent +.It Cm 0 +Packets with private IPv4 will not be handled by translator +.It Cm 1 +Translator will accept and process packets with private IPv4 addresses. +.El +.It Va net.inet.ip.fw.nat64_debug : No 0 +Controls debugging messages produced by +.Nm ipfw_nat64 +module. +.It Va net.inet.ip.fw.nat64_direct_output : No 0 +Controls the output method used by +.Nm ipfw_nat64 +module: +.Bl -tag -width indent +.It Cm 0 +A packet is handled by +.Nm ipfw +twice. +First time an original packet is handled by +.Nm ipfw +and consumed by +.Nm ipfw_nat64 +translator. +Then translated packet is queued via netisr to input processing again. +.It Cm 1 +A packet is handled by +.Nm ipfw +only once, and after translation it will be pushed directly to outgoing +interface. +.El .El .Sh INTERNAL DIAGNOSTICS There are some commands that may be useful to understand current state Modified: stable/12/sys/conf/options ============================================================================== --- stable/12/sys/conf/options Sat Nov 17 21:35:01 2018 (r340525) +++ stable/12/sys/conf/options Sat Nov 17 23:52:56 2018 (r340526) @@ -439,7 +439,6 @@ IPFIREWALL opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h IPFIREWALL_NAT opt_ipfw.h IPFIREWALL_NAT64 opt_ipfw.h -IPFIREWALL_NAT64_DIRECT_OUTPUT opt_ipfw.h IPFIREWALL_NPTV6 opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h Modified: stable/12/sys/modules/ipfw_nat64/Makefile ============================================================================== --- stable/12/sys/modules/ipfw_nat64/Makefile Sat Nov 17 21:35:01 2018 (r340525) +++ stable/12/sys/modules/ipfw_nat64/Makefile Sat Nov 17 23:52:56 2018 (r340526) @@ -6,8 +6,5 @@ KMOD= ipfw_nat64 SRCS= ip_fw_nat64.c nat64_translate.c SRCS+= nat64lsn.c nat64lsn_control.c SRCS+= nat64stl.c nat64stl_control.c -SRCS+= opt_ipfw.h - -#CFLAGS+= -DIPFIREWALL_NAT64_DIRECT_OUTPUT .include Modified: stable/12/sys/netpfil/ipfw/nat64/ip_fw_nat64.c ============================================================================== --- stable/12/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Sat Nov 17 21:35:01 2018 (r340525) +++ stable/12/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Sat Nov 17 23:52:56 2018 (r340526) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include "ip_fw_nat64.h" +#include "nat64_translate.h" VNET_DEFINE(int, nat64_debug) = 0; VNET_DEFINE(int, nat64_allow_private) = 0; @@ -56,8 +57,26 @@ SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_debug, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nat64_debug), 0, "Debug level for NAT64 module"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_allow_private, - CTLFLAG_VNET |CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, "Allow use of non-global IPv4 addresses with NAT64"); + +static int +sysctl_direct_output(SYSCTL_HANDLER_ARGS) +{ + uint32_t value; + int error; + + value = nat64_get_output_method(); + error = sysctl_handle_32(oidp, &value, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + nat64_set_output_method(value); + return (0); +} +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, nat64_direct_output, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_direct_output, "IU", + "Use if_output directly instead of deffered netisr-based processing"); static int vnet_ipfw_nat64_init(const void *arg __unused) Modified: stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c Sat Nov 17 21:35:01 2018 (r340525) +++ stable/12/sys/netpfil/ipfw/nat64/nat64_translate.c Sat Nov 17 23:52:56 2018 (r340526) @@ -25,8 +25,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_ipfw.h" - #include __FBSDID("$FreeBSD$"); @@ -71,6 +69,53 @@ __FBSDID("$FreeBSD$"); #include "ip_fw_nat64.h" #include "nat64_translate.h" + +typedef int (*nat64_output_t)(struct ifnet *, struct mbuf *, + struct sockaddr *, struct nat64_counters *, void *); +typedef int (*nat64_output_one_t)(struct mbuf *, struct nat64_counters *, + void *); + +static int nat64_find_route4(struct nhop4_basic *, struct sockaddr_in *, + struct mbuf *); +static int nat64_find_route6(struct nhop6_basic *, struct sockaddr_in6 *, + struct mbuf *); +static int nat64_output_one(struct mbuf *, struct nat64_counters *, void *); +static int nat64_output(struct ifnet *, struct mbuf *, struct sockaddr *, + struct nat64_counters *, void *); +static int nat64_direct_output_one(struct mbuf *, struct nat64_counters *, + void *); +static int nat64_direct_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct nat64_counters *, void *); + +struct nat64_methods { + nat64_output_t output; + nat64_output_one_t output_one; +}; +static const struct nat64_methods nat64_netisr = { + .output = nat64_output, + .output_one = nat64_output_one +}; +static const struct nat64_methods nat64_direct = { + .output = nat64_direct_output, + .output_one = nat64_direct_output_one +}; +VNET_DEFINE_STATIC(const struct nat64_methods *, nat64out) = &nat64_netisr; +#define V_nat64out VNET(nat64out) + +void +nat64_set_output_method(int direct) +{ + + V_nat64out = direct != 0 ? &nat64_direct: &nat64_netisr; +} + +int +nat64_get_output_method(void) +{ + + return (V_nat64out == &nat64_direct ? 1: 0); +} + static void nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa_family_t family) { @@ -80,14 +125,8 @@ nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa ipfw_bpf_mtap2(logdata, PFLOG_HDRLEN, m); } -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT -static NAT64NOINLINE int nat64_find_route4(struct nhop4_basic *, - struct sockaddr_in *, struct mbuf *); -static NAT64NOINLINE int nat64_find_route6(struct nhop6_basic *, - struct sockaddr_in6 *, struct mbuf *); - -static NAT64NOINLINE int -nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +static int +nat64_direct_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct nat64_counters *stats, void *logdata) { int error; @@ -100,8 +139,9 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct return (error); } -static NAT64NOINLINE int -nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) +static int +nat64_direct_output_one(struct mbuf *m, struct nat64_counters *stats, + void *logdata) { struct nhop6_basic nh6; struct nhop4_basic nh4; @@ -153,8 +193,8 @@ nat64_output_one(struct mbuf *m, struct nat64_counters NAT64STAT_INC(stats, oerrors); return (error); } -#else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ -static NAT64NOINLINE int + +static int nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct nat64_counters *stats, void *logdata) { @@ -185,13 +225,12 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct return (ret); } -static NAT64NOINLINE int +static int nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) { return (nat64_output(NULL, m, NULL, stats, logdata)); } -#endif /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ /* * Check the given IPv6 prefix and length according to RFC6052: @@ -424,12 +463,10 @@ nat64_init_ip4hdr(const struct ip6_hdr *ip6, const str ip->ip_hl = sizeof(*ip) >> 2; ip->ip_tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; ip->ip_len = htons(sizeof(*ip) + plen); -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip->ip_ttl = ip6->ip6_hlim - IPV6_HLIMDEC; -#else - /* Forwarding code will decrement TTL. */ ip->ip_ttl = ip6->ip6_hlim; -#endif + /* Forwarding code will decrement TTL for netisr based output. */ + if (V_nat64out == &nat64_direct) + ip->ip_ttl -= IPV6_HLIMDEC; ip->ip_sum = 0; ip->ip_p = (proto == IPPROTO_ICMPV6) ? IPPROTO_ICMP: proto; ip_fillid(ip); @@ -647,7 +684,7 @@ nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint icmp6->icmp6_cksum = in6_cksum(n, IPPROTO_ICMPV6, sizeof(struct ip6_hdr), plen); m_freem(m); - nat64_output_one(n, stats, logdata); + V_nat64out->output_one(n, stats, logdata); return; freeit: NAT64STAT_INC(stats, dropped); @@ -750,7 +787,7 @@ nat64_icmp_reflect(struct mbuf *m, uint8_t type, icmp->icmp_cksum = in_cksum_skip(n, sizeof(struct ip) + plen, sizeof(struct ip)); m_freem(m); - nat64_output_one(n, stats, logdata); + V_nat64out->output_one(n, stats, logdata); return; freeit: NAT64STAT_INC(stats, dropped); @@ -1167,12 +1204,10 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s ip6.ip6_flow = htonl(ip->ip_tos << 20); ip6.ip6_vfc |= IPV6_VERSION; -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip6.ip6_hlim = ip->ip_ttl - IPTTLDEC; -#else - /* Forwarding code will decrement HLIM. */ ip6.ip6_hlim = ip->ip_ttl; -#endif + /* Forwarding code will decrement TTL for netisr based output. */ + if (V_nat64out == &nat64_direct) + ip6.ip6_hlim -= IPTTLDEC; ip6.ip6_plen = htons(plen); ip6.ip6_nxt = (proto == IPPROTO_ICMP) ? IPPROTO_ICMPV6: proto; /* Convert checksums. */ @@ -1205,7 +1240,7 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s mbufq_init(&mq, 255); nat64_fragment6(&cfg->stats, &ip6, &mq, m, nh.nh_mtu, ip_id, ip_off); while ((m = mbufq_dequeue(&mq)) != NULL) { - if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, + if (V_nat64out->output(nh.nh_ifp, m, (struct sockaddr *)&dst, &cfg->stats, logdata) != 0) break; NAT64STAT_INC(&cfg->stats, opcnt46); @@ -1415,9 +1450,8 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t ip.ip_dst.s_addr = aaddr; ip.ip_src.s_addr = nat64_extract_ip4(cfg, &ip6i->ip6_src); /* XXX: Make fake ulp header */ -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip6i->ip6_hlim += IPV6_HLIMDEC; /* init_ip4hdr will decrement it */ -#endif + if (V_nat64out == &nat64_direct) /* init_ip4hdr will decrement it */ + ip6i->ip6_hlim += IPV6_HLIMDEC; nat64_init_ip4hdr(ip6i, ip6f, plen, proto, &ip); m_adj(m, hlen - sizeof(struct ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); @@ -1587,7 +1621,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui m_adj(m, hlen - sizeof(ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); - if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, + if (V_nat64out->output(nh.nh_ifp, m, (struct sockaddr *)&dst, &cfg->stats, logdata) == 0) NAT64STAT_INC(&cfg->stats, opcnt64); return (NAT64RETURN); Modified: stable/12/sys/netpfil/ipfw/nat64/nat64_translate.h ============================================================================== --- stable/12/sys/netpfil/ipfw/nat64/nat64_translate.h Sat Nov 17 21:35:01 2018 (r340525) +++ stable/12/sys/netpfil/ipfw/nat64/nat64_translate.h Sat Nov 17 23:52:56 2018 (r340526) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2015-2016 Yandex LLC - * Copyright (c) 2015-2016 Andrey V. Elsukov + * Copyright (c) 2015-2018 Yandex LLC + * Copyright (c) 2015-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -141,6 +141,9 @@ void nat64_embed_ip4(const struct nat64_config *cfg, i struct in6_addr *ip6); in_addr_t nat64_extract_ip4(const struct nat64_config *cfg, const struct in6_addr *ip6); + +void nat64_set_output_method(int); +int nat64_get_output_method(void); #endif From owner-svn-src-all@freebsd.org Sat Nov 17 23:54:20 2018 Return-Path: Delivered-To: svn-src-all@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 3A904110AFCF; Sat, 17 Nov 2018 23:54:20 +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 D87E3865B9; Sat, 17 Nov 2018 23:54:19 +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 B98E33274; Sat, 17 Nov 2018 23:54:19 +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 wAHNsJdF072264; Sat, 17 Nov 2018 23:54:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHNsJ3x072263; Sat, 17 Nov 2018 23:54:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811172354.wAHNsJ3x072263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 17 Nov 2018 23:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340527 - stable/12/sys/netipsec X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netipsec X-SVN-Commit-Revision: 340527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D87E3865B9 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.062,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 23:54:20 -0000 Author: ae Date: Sat Nov 17 23:54:19 2018 New Revision: 340527 URL: https://svnweb.freebsd.org/changeset/base/340527 Log: MFC r339533: Add sadb_x_sa2 extension to SADB_ACQUIRE requests. SADB_ACQUIRE requests are send by kernel, when security policy doesn't have corresponding security association for outbound packet. IKE daemon usually registers its handler for such messages and when the kernel asks for SA it can handle this request. Now such requests will contain additional fields that can help IKE daemon to create SA. And IKE now can create SAs using only information from SADB_ACQUIRE request, this is useful when many if_ipsec(4) interfaces are in use and IKE doesn track security policies that was installed by kernel. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/netipsec/key.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netipsec/key.c ============================================================================== --- stable/12/sys/netipsec/key.c Sat Nov 17 23:52:56 2018 (r340526) +++ stable/12/sys/netipsec/key.c Sat Nov 17 23:54:19 2018 (r340527) @@ -6685,7 +6685,9 @@ key_acquire(const struct secasindex *saidx, struct sec /* XXX proxy address (optional) */ - /* set sadb_x_policy */ + /* + * Set sadb_x_policy. This is KAME extension to RFC2367. + */ if (sp != NULL) { m = key_setsadbxpolicy(sp->policy, sp->spidx.dir, sp->id, sp->priority); @@ -6696,6 +6698,18 @@ key_acquire(const struct secasindex *saidx, struct sec m_cat(result, m); } + /* + * Set sadb_x_sa2 extension if saidx->reqid is not zero. + * This is FreeBSD extension to RFC2367. + */ + if (saidx->reqid != 0) { + m = key_setsadbxsa2(saidx->mode, 0, saidx->reqid); + if (m == NULL) { + error = ENOBUFS; + goto fail; + } + m_cat(result, m); + } /* XXX identity (optional) */ #if 0 if (idexttype && fqdn) { From owner-svn-src-all@freebsd.org Sat Nov 17 23:56:27 2018 Return-Path: Delivered-To: svn-src-all@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 F21F9110B12D; Sat, 17 Nov 2018 23:56:26 +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 9712B86745; Sat, 17 Nov 2018 23:56:26 +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 748A83278; Sat, 17 Nov 2018 23:56:26 +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 wAHNuQac072434; Sat, 17 Nov 2018 23:56:26 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHNuQdV072433; Sat, 17 Nov 2018 23:56:26 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811172356.wAHNuQdV072433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 17 Nov 2018 23:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340528 - stable/12/sbin/ifconfig X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sbin/ifconfig X-SVN-Commit-Revision: 340528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9712B86745 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.062,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 23:56:27 -0000 Author: ae Date: Sat Nov 17 23:56:25 2018 New Revision: 340528 URL: https://svnweb.freebsd.org/changeset/base/340528 Log: MFC r339535: Do not allow use `create` keyword as hostname when ifconfig(8) is invoked for already existing interface. It appeared, that ifconfig(8) assumes `create` keyword as hostname and tries to resolve it, when `ifconfig ifname create` invoked for already existing interface. This can produce some unexpected results, when hostname resolving has successfully happened. This patch adds check for such case. When an interface is already exists, and create is only one argument, return error message. But when there are some other arguments, just remove create keyword from the arguments list. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17171 MFC r339536: Fix grammar. Modified: stable/12/sbin/ifconfig/ifconfig.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.c Sat Nov 17 23:54:19 2018 (r340527) +++ stable/12/sbin/ifconfig/ifconfig.c Sat Nov 17 23:56:25 2018 (r340528) @@ -504,6 +504,18 @@ main(int argc, char *argv[]) } #endif errx(1, "interface %s does not exist", ifname); + } else { + /* + * Do not allow use `create` command as hostname if + * address family is not specified. + */ + if (argc > 0 && (strcmp(argv[0], "create") == 0 || + strcmp(argv[0], "plumb") == 0)) { + if (argc == 1) + errx(1, "interface %s already exists", + ifname); + argc--, argv++; + } } } From owner-svn-src-all@freebsd.org Sat Nov 17 23:57:48 2018 Return-Path: Delivered-To: svn-src-all@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 0E613110B3F5; Sat, 17 Nov 2018 23:57:48 +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 A7CCA86891; Sat, 17 Nov 2018 23:57:47 +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 83477327A; Sat, 17 Nov 2018 23:57:47 +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 wAHNvlJW072541; Sat, 17 Nov 2018 23:57:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHNvlGQ072539; Sat, 17 Nov 2018 23:57:47 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811172357.wAHNvlGQ072539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 17 Nov 2018 23:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340529 - in stable/12: sbin/ipfw sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: sbin/ipfw sys/netinet X-SVN-Commit-Revision: 340529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7CCA86891 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.062,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 23:57:48 -0000 Author: ae Date: Sat Nov 17 23:57:46 2018 New Revision: 340529 URL: https://svnweb.freebsd.org/changeset/base/340529 Log: MFC r339539: Add IPFW_RULE_JUSTOPTS flag, that is used by ipfw(8) to mark rule, that was added using "new rule format". And then, when the kernel returns rule with this flag, ipfw(8) can correctly show it. Reported by: lev Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17373 Modified: stable/12/sbin/ipfw/ipfw2.c stable/12/sys/netinet/ip_fw.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw2.c ============================================================================== --- stable/12/sbin/ipfw/ipfw2.c Sat Nov 17 23:56:25 2018 (r340528) +++ stable/12/sbin/ipfw/ipfw2.c Sat Nov 17 23:57:46 2018 (r340529) @@ -2207,6 +2207,12 @@ show_static_rule(struct cmdline_opts *co, struct forma */ if (co->comment_only != 0) goto end; + + if (rule->flags & IPFW_RULE_JUSTOPTS) { + state.flags |= HAVE_PROTO | HAVE_SRCIP | HAVE_DSTIP; + goto justopts; + } + print_proto(bp, fo, &state); /* Print source */ @@ -2219,6 +2225,7 @@ show_static_rule(struct cmdline_opts *co, struct forma print_address(bp, fo, &state, dst_opcodes, nitems(dst_opcodes), O_IP_DSTPORT, HAVE_DSTIP); +justopts: /* Print the rest of options */ while (print_opcode(bp, fo, &state, -1)) ; @@ -4340,8 +4347,10 @@ chkarg: } } else if (first_cmd != cmd) { errx(EX_DATAERR, "invalid protocol ``%s''", *av); - } else + } else { + rule->flags |= IPFW_RULE_JUSTOPTS; goto read_options; + } OR_BLOCK(get_proto); /* Modified: stable/12/sys/netinet/ip_fw.h ============================================================================== --- stable/12/sys/netinet/ip_fw.h Sat Nov 17 23:56:25 2018 (r340528) +++ stable/12/sys/netinet/ip_fw.h Sat Nov 17 23:57:46 2018 (r340529) @@ -615,6 +615,7 @@ struct ip_fw_rule { ipfw_insn cmd[1]; /* storage for commands */ }; #define IPFW_RULE_NOOPT 0x01 /* Has no options in body */ +#define IPFW_RULE_JUSTOPTS 0x02 /* new format of rule body */ /* Unaligned version */ From owner-svn-src-all@freebsd.org Sat Nov 17 23:58:56 2018 Return-Path: Delivered-To: svn-src-all@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 4FC7C110B477; Sat, 17 Nov 2018 23:58:56 +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 E99EA869CD; Sat, 17 Nov 2018 23:58:55 +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 CA619327B; Sat, 17 Nov 2018 23:58:55 +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 wAHNwt8p072644; Sat, 17 Nov 2018 23:58:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAHNwt4Q072643; Sat, 17 Nov 2018 23:58:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811172358.wAHNwt4Q072643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 17 Nov 2018 23:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340530 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 340530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E99EA869CD X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.062,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 23:58:56 -0000 Author: ae Date: Sat Nov 17 23:58:55 2018 New Revision: 340530 URL: https://svnweb.freebsd.org/changeset/base/340530 Log: MFC r339545: Do not decrement RST life time if keep_alive is not turned on. This allows use differen values configured by user for sysctl variable net.inet.ip.fw.dyn_rst_lifetime. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c Sat Nov 17 23:57:46 2018 (r340529) +++ stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c Sat Nov 17 23:58:55 2018 (r340530) @@ -979,7 +979,8 @@ dyn_update_tcp_state(struct dyn_data *data, const stru break; default: - if (V_dyn_rst_lifetime >= V_dyn_keepalive_period) + if (V_dyn_keepalive != 0 && + V_dyn_rst_lifetime >= V_dyn_keepalive_period) V_dyn_rst_lifetime = V_dyn_keepalive_period - 1; expire = time_uptime + V_dyn_rst_lifetime; }