From owner-svn-src-head@freebsd.org Sun Jul 1 01:02:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78C12FE1197; Sun, 1 Jul 2018 01:02:00 +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 2574692BFB; Sun, 1 Jul 2018 01:02:00 +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 0809F179B9; Sun, 1 Jul 2018 01:02:00 +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 w6111x2N099366; Sun, 1 Jul 2018 01:01:59 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6111xpr099365; Sun, 1 Jul 2018 01:01:59 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807010101.w6111xpr099365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 1 Jul 2018 01:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335830 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 335830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 01:02:00 -0000 Author: mmacy Date: Sun Jul 1 01:01:59 2018 New Revision: 335830 URL: https://svnweb.freebsd.org/changeset/base/335830 Log: in6_pcblookup_hash: validate inp for liveness Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Jul 1 00:07:41 2018 (r335829) +++ head/sys/netinet6/in6_pcb.c Sun Jul 1 01:01:59 2018 (r335830) @@ -1259,40 +1259,35 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct i struct ifnet *ifp) { struct inpcb *inp; - bool locked; INP_HASH_RLOCK(pcbinfo); inp = in6_pcblookup_hash_locked(pcbinfo, faddr, fport, laddr, lport, (lookupflags & ~(INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)), ifp); if (inp != NULL) { - if (lookupflags & INPLOOKUP_WLOCKPCB) - locked = INP_TRY_WLOCK(inp); - else if (lookupflags & INPLOOKUP_RLOCKPCB) - locked = INP_TRY_RLOCK(inp); - else - panic("%s: locking bug", __func__); - if (!locked) - in_pcbref(inp); - INP_HASH_RUNLOCK(pcbinfo); - if (!locked) { - if (lookupflags & INPLOOKUP_WLOCKPCB) { - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (NULL); - } else { - INP_RLOCK(inp); - if (in_pcbrele_rlocked(inp)) - return (NULL); + if (lookupflags & INPLOOKUP_WLOCKPCB) { + INP_WLOCK(inp); + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + INP_WUNLOCK(inp); + inp = NULL; } - } + } else if (lookupflags & INPLOOKUP_RLOCKPCB) { + INP_RLOCK(inp); + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + INP_RUNLOCK(inp); + inp = NULL; + } + } else + panic("%s: locking bug", __func__); #ifdef INVARIANTS - if (lookupflags & INPLOOKUP_WLOCKPCB) - INP_WLOCK_ASSERT(inp); - else - INP_RLOCK_ASSERT(inp); + if (inp != NULL) { + if (lookupflags & INPLOOKUP_WLOCKPCB) + INP_WLOCK_ASSERT(inp); + else + INP_RLOCK_ASSERT(inp); + } #endif - } else - INP_HASH_RUNLOCK(pcbinfo); + } + INP_HASH_RUNLOCK(pcbinfo); return (inp); } From owner-svn-src-head@freebsd.org Sun Jul 1 01:09:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5055AFE1398; Sun, 1 Jul 2018 01:09:53 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE00492EC1; Sun, 1 Jul 2018 01:09:52 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B934C179F0; Sun, 1 Jul 2018 01:09:52 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6119qN6003251; Sun, 1 Jul 2018 01:09:52 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6119qj3003250; Sun, 1 Jul 2018 01:09:52 GMT (envelope-from will@FreeBSD.org) Message-Id: <201807010109.w6119qj3003250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sun, 1 Jul 2018 01:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335831 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: will X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 335831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 01:09:53 -0000 Author: will Date: Sun Jul 1 01:09:52 2018 New Revision: 335831 URL: https://svnweb.freebsd.org/changeset/base/335831 Log: beinstall: enable use with git worktrees. Modified: head/tools/build/beinstall.sh Modified: head/tools/build/beinstall.sh ============================================================================== --- head/tools/build/beinstall.sh Sun Jul 1 01:01:59 2018 (r335830) +++ head/tools/build/beinstall.sh Sun Jul 1 01:09:52 2018 (r335831) @@ -101,7 +101,8 @@ trap 'errx "Interrupt caught"' HUP INT TERM objdir=$(make -V .OBJDIR 2>/dev/null) [ ! -d "${objdir}" ] && errx "Must have built FreeBSD from source tree" -if [ -d .git ] ; then +# May be a worktree, in which case .git is a file, not a directory. +if [ -e .git ] ; then commit_time=$(git show --format='%ct' 2>/dev/null | head -1) [ $? -ne 0 ] && errx "Can't lookup git commit timestamp" commit_ts=$(date -r ${commit_time} '+%Y%m%d.%H%M%S') From owner-svn-src-head@freebsd.org Sun Jul 1 01:11:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68F49FE142C; Sun, 1 Jul 2018 01:11:33 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5DF931C9; Sun, 1 Jul 2018 01:11:33 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F26EE17B4B; Sun, 1 Jul 2018 01:11:32 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w611BWnx007907; Sun, 1 Jul 2018 01:11:32 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w611BWTA007906; Sun, 1 Jul 2018 01:11:32 GMT (envelope-from will@FreeBSD.org) Message-Id: <201807010111.w611BWTA007906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sun, 1 Jul 2018 01:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335832 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: will X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 335832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 01:11:33 -0000 Author: will Date: Sun Jul 1 01:11:32 2018 New Revision: 335832 URL: https://svnweb.freebsd.org/changeset/base/335832 Log: Rather belatedly add myself to committers-src.dot. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Jul 1 01:09:52 2018 (r335831) +++ head/share/misc/committers-src.dot Sun Jul 1 01:11:32 2018 (r335832) @@ -349,6 +349,7 @@ versus [label="Konrad Jankowski\nversus@FreeBSD.org\n2 weongyo [label="Weongyo Jeong\nweongyo@FreeBSD.org\n2007/12/21"] wes [label="Wes Peters\nwes@FreeBSD.org\n1998/11/25"] whu [label="Wei Hu\nwhu@FreeBSD.org\n2015/02/11"] +will [label="Will Andrews\nwill@FreeBSD.org\n2000/03/20"] wkoszek [label="Wojciech A. Koszek\nwkoszek@FreeBSD.org\n2006/02/21"] wma [label="Wojciech Macek\nwma@FreeBSD.org\n2016/01/18"] wollman [label="Garrett Wollman\nwollman@FreeBSD.org\n????/??/??"] @@ -419,6 +420,7 @@ billf -> gad billf -> jedgar billf -> jhb billf -> shafeeq +billf -> will bmilekic -> csjp @@ -645,6 +647,7 @@ ken -> asomers ken -> chuck ken -> ram ken -> slm +ken -> will kib -> ae kib -> badger From owner-svn-src-head@freebsd.org Sun Jul 1 01:16:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C177FE1692; Sun, 1 Jul 2018 01:16:04 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3067B93441; Sun, 1 Jul 2018 01:16:04 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DB1117BB0; Sun, 1 Jul 2018 01:16:04 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w611G4C1008187; Sun, 1 Jul 2018 01:16:04 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w611G35w008185; Sun, 1 Jul 2018 01:16:03 GMT (envelope-from will@FreeBSD.org) Message-Id: <201807010116.w611G35w008185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sun, 1 Jul 2018 01:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335833 - in head: share/man/man4 sys/net sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: will X-SVN-Commit-Paths: in head: share/man/man4 sys/net sys/netpfil/pf X-SVN-Commit-Revision: 335833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 01:16:04 -0000 Author: will Date: Sun Jul 1 01:16:03 2018 New Revision: 335833 URL: https://svnweb.freebsd.org/changeset/base/335833 Log: pf: remove unused ioctls. Several ioctls are unused in pf, in the sense that no base utility references them. Additionally, a cursory review of pf-based ports indicates they're not used elsewhere either. Some of them have been unused since the original import. As far as I can tell, they're also unused in OpenBSD. Finally, removing this code removes the need for future pf work to take them into account. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D16076 Modified: head/share/man/man4/pf.4 head/sys/net/pfvar.h head/sys/netpfil/pf/pf_ioctl.c Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Sun Jul 1 01:11:32 2018 (r335832) +++ head/share/man/man4/pf.4 Sun Jul 1 01:16:03 2018 (r335833) @@ -139,9 +139,8 @@ Clear the buffer address pool and get a .Va ticket for subsequent .Dv DIOCADDADDR , -.Dv DIOCADDRULE , and -.Dv DIOCCHANGERULE +.Dv DIOCADDRULE calls. .It Dv DIOCADDADDR Fa "struct pfioc_pooladdr *pp" .Pp @@ -149,8 +148,6 @@ Add the pool address .Va addr to the buffer address pool to be used in the following .Dv DIOCADDRULE -or -.Dv DIOCCHANGERULE call. All other members of the structure are ignored. .It Dv DIOCADDRULE Fa "struct pfioc_rule *pr" @@ -319,21 +316,6 @@ This ioctl returns if the given anchor does not exist or .Er EBUSY if another process is concurrently updating a ruleset. -.It Dv DIOCADDSTATE Fa "struct pfioc_state *ps" -Add a state entry. -.Bd -literal -struct pfioc_state { - struct pfsync_state state; -}; -.Ed -.It Dv DIOCGETSTATE Fa "struct pfioc_state *ps" -Extract the entry identified by the -.Va id -and -.Va creatorid -fields of the -.Va state -structure from the state table. .It Dv DIOCKILLSTATES Fa "struct pfioc_state_kill *psk" Remove matching entries from the state table. This ioctl returns the number of killed states in @@ -439,11 +421,6 @@ On exit, is always set to the total size required to hold all state table entries (i.e., it is set to .Li sizeof(struct pf_state) * nr ) . -.It Dv DIOCCHANGERULE Fa "struct pfioc_rule *pcr" -Add or remove the -.Va rule -in the ruleset specified by -.Va rule.action . .Pp The type of operation to be performed is indicated by .Va action , @@ -475,15 +452,6 @@ indicates the rule number against which or .Dv PF_CHANGE_REMOVE actions are applied. -.\" It Dv DIOCCHANGEALTQ Fa "struct pfioc_altq *pcr" -.It Dv DIOCCHANGEADDR Fa "struct pfioc_pooladdr *pca" -Add or remove the pool address -.Va addr -from the rule specified by -.Va r_action , -.Va r_num , -and -.Va anchor . .It Dv DIOCSETTIMEOUT Fa "struct pfioc_tm *pt" .Bd -literal struct pfioc_tm { @@ -510,8 +478,6 @@ Get the state timeout of The value will be placed into the .Va seconds field. -.It Dv DIOCCLRRULECTRS -Clear per-rule statistics. .It Dv DIOCSETLIMIT Fa "struct pfioc_limit *pl" Set the hard limits on the memory pools used by the packet filter. .Bd -literal Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Jul 1 01:11:32 2018 (r335832) +++ head/sys/net/pfvar.h Sun Jul 1 01:16:03 2018 (r335833) @@ -1385,19 +1385,17 @@ struct pfioc_iface { #define DIOCGETRULE _IOWR('D', 7, struct pfioc_rule) /* XXX cut 8 - 17 */ #define DIOCCLRSTATES _IOWR('D', 18, struct pfioc_state_kill) -#define DIOCGETSTATE _IOWR('D', 19, struct pfioc_state) +/* XXX cut 19 */ #define DIOCSETSTATUSIF _IOWR('D', 20, struct pfioc_if) #define DIOCGETSTATUS _IOWR('D', 21, struct pf_status) #define DIOCCLRSTATUS _IO ('D', 22) #define DIOCNATLOOK _IOWR('D', 23, struct pfioc_natlook) #define DIOCSETDEBUG _IOWR('D', 24, u_int32_t) #define DIOCGETSTATES _IOWR('D', 25, struct pfioc_states) -#define DIOCCHANGERULE _IOWR('D', 26, struct pfioc_rule) /* XXX cut 26 - 28 */ #define DIOCSETTIMEOUT _IOWR('D', 29, struct pfioc_tm) #define DIOCGETTIMEOUT _IOWR('D', 30, struct pfioc_tm) -#define DIOCADDSTATE _IOWR('D', 37, struct pfioc_state) -#define DIOCCLRRULECTRS _IO ('D', 38) +/* XXX cut 31-38 */ #define DIOCGETLIMIT _IOWR('D', 39, struct pfioc_limit) #define DIOCSETLIMIT _IOWR('D', 40, struct pfioc_limit) #define DIOCKILLSTATES _IOWR('D', 41, struct pfioc_state_kill) @@ -1406,13 +1404,12 @@ struct pfioc_iface { #define DIOCADDALTQ _IOWR('D', 45, struct pfioc_altq) #define DIOCGETALTQS _IOWR('D', 47, struct pfioc_altq) #define DIOCGETALTQ _IOWR('D', 48, struct pfioc_altq) -#define DIOCCHANGEALTQ _IOWR('D', 49, struct pfioc_altq) +/* XXX cut 49 */ #define DIOCGETQSTATS _IOWR('D', 50, struct pfioc_qstats) #define DIOCBEGINADDRS _IOWR('D', 51, struct pfioc_pooladdr) #define DIOCADDADDR _IOWR('D', 52, struct pfioc_pooladdr) #define DIOCGETADDRS _IOWR('D', 53, struct pfioc_pooladdr) #define DIOCGETADDR _IOWR('D', 54, struct pfioc_pooladdr) -#define DIOCCHANGEADDR _IOWR('D', 55, struct pfioc_pooladdr) /* XXX cut 55 - 57 */ #define DIOCGETRULESETS _IOWR('D', 58, struct pfioc_ruleset) #define DIOCGETRULESET _IOWR('D', 59, struct pfioc_ruleset) Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sun Jul 1 01:11:32 2018 (r335832) +++ head/sys/netpfil/pf/pf_ioctl.c Sun Jul 1 01:16:03 2018 (r335833) @@ -1003,7 +1003,6 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in case DIOCGETRULE: case DIOCGETADDRS: case DIOCGETADDR: - case DIOCGETSTATE: case DIOCSETSTATUSIF: case DIOCGETSTATUS: case DIOCCLRSTATUS: @@ -1011,7 +1010,6 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in case DIOCSETDEBUG: case DIOCGETSTATES: case DIOCGETTIMEOUT: - case DIOCCLRRULECTRS: case DIOCGETLIMIT: case DIOCGETALTQS: case DIOCGETALTQ: @@ -1054,7 +1052,6 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in case DIOCGETRULES: case DIOCGETADDRS: case DIOCGETADDR: - case DIOCGETSTATE: case DIOCGETSTATUS: case DIOCGETSTATES: case DIOCGETTIMEOUT: @@ -1396,227 +1393,6 @@ DIOCADDRULE_error: break; } - case DIOCCHANGERULE: { - struct pfioc_rule *pcr = (struct pfioc_rule *)addr; - struct pf_ruleset *ruleset; - struct pf_rule *oldrule = NULL, *newrule = NULL; - struct pfi_kif *kif = NULL; - struct pf_pooladdr *pa; - u_int32_t nr = 0; - int rs_num; - - if (pcr->action < PF_CHANGE_ADD_HEAD || - pcr->action > PF_CHANGE_GET_TICKET) { - error = EINVAL; - break; - } - if (pcr->rule.return_icmp >> 8 > ICMP_MAXTYPE) { - error = EINVAL; - break; - } - - if (pcr->action != PF_CHANGE_REMOVE) { -#ifndef INET - if (pcr->rule.af == AF_INET) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET */ -#ifndef INET6 - if (pcr->rule.af == AF_INET6) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET6 */ - newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); - bcopy(&pcr->rule, newrule, sizeof(struct pf_rule)); - if (newrule->ifname[0]) - kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); - newrule->states_cur = counter_u64_alloc(M_WAITOK); - newrule->states_tot = counter_u64_alloc(M_WAITOK); - newrule->src_nodes = counter_u64_alloc(M_WAITOK); - newrule->cuid = td->td_ucred->cr_ruid; - newrule->cpid = td->td_proc ? td->td_proc->p_pid : 0; - TAILQ_INIT(&newrule->rpool.list); - } - -#define ERROUT(x) { error = (x); goto DIOCCHANGERULE_error; } - - PF_RULES_WLOCK(); - if (!(pcr->action == PF_CHANGE_REMOVE || - pcr->action == PF_CHANGE_GET_TICKET) && - pcr->pool_ticket != V_ticket_pabuf) - ERROUT(EBUSY); - - ruleset = pf_find_ruleset(pcr->anchor); - if (ruleset == NULL) - ERROUT(EINVAL); - - rs_num = pf_get_ruleset_number(pcr->rule.action); - if (rs_num >= PF_RULESET_MAX) - ERROUT(EINVAL); - - if (pcr->action == PF_CHANGE_GET_TICKET) { - pcr->ticket = ++ruleset->rules[rs_num].active.ticket; - ERROUT(0); - } else if (pcr->ticket != - ruleset->rules[rs_num].active.ticket) - ERROUT(EINVAL); - - if (pcr->action != PF_CHANGE_REMOVE) { - if (newrule->ifname[0]) { - newrule->kif = pfi_kif_attach(kif, - newrule->ifname); - pfi_kif_ref(newrule->kif); - } else - newrule->kif = NULL; - - if (newrule->rtableid > 0 && - newrule->rtableid >= rt_numfibs) - error = EBUSY; - -#ifdef ALTQ - /* set queue IDs */ - if (newrule->qname[0] != 0) { - if ((newrule->qid = - pf_qname2qid(newrule->qname)) == 0) - error = EBUSY; - else if (newrule->pqname[0] != 0) { - if ((newrule->pqid = - pf_qname2qid(newrule->pqname)) == 0) - error = EBUSY; - } else - newrule->pqid = newrule->qid; - } -#endif /* ALTQ */ - if (newrule->tagname[0]) - if ((newrule->tag = - pf_tagname2tag(newrule->tagname)) == 0) - error = EBUSY; - if (newrule->match_tagname[0]) - if ((newrule->match_tag = pf_tagname2tag( - newrule->match_tagname)) == 0) - error = EBUSY; - if (newrule->rt && !newrule->direction) - error = EINVAL; - if (!newrule->log) - newrule->logif = 0; - if (newrule->logif >= PFLOGIFS_MAX) - error = EINVAL; - if (pf_addr_setup(ruleset, &newrule->src.addr, newrule->af)) - error = ENOMEM; - if (pf_addr_setup(ruleset, &newrule->dst.addr, newrule->af)) - error = ENOMEM; - if (pf_anchor_setup(newrule, ruleset, pcr->anchor_call)) - error = EINVAL; - TAILQ_FOREACH(pa, &V_pf_pabuf, entries) - if (pa->addr.type == PF_ADDR_TABLE) { - pa->addr.p.tbl = - pfr_attach_table(ruleset, - pa->addr.v.tblname); - if (pa->addr.p.tbl == NULL) - error = ENOMEM; - } - - newrule->overload_tbl = NULL; - if (newrule->overload_tblname[0]) { - if ((newrule->overload_tbl = pfr_attach_table( - ruleset, newrule->overload_tblname)) == - NULL) - error = EINVAL; - else - newrule->overload_tbl->pfrkt_flags |= - PFR_TFLAG_ACTIVE; - } - - pf_mv_pool(&V_pf_pabuf, &newrule->rpool.list); - if (((((newrule->action == PF_NAT) || - (newrule->action == PF_RDR) || - (newrule->action == PF_BINAT) || - (newrule->rt > PF_NOPFROUTE)) && - !newrule->anchor)) && - (TAILQ_FIRST(&newrule->rpool.list) == NULL)) - error = EINVAL; - - if (error) { - pf_free_rule(newrule); - PF_RULES_WUNLOCK(); - break; - } - - newrule->rpool.cur = TAILQ_FIRST(&newrule->rpool.list); - newrule->evaluations = 0; - newrule->packets[0] = newrule->packets[1] = 0; - newrule->bytes[0] = newrule->bytes[1] = 0; - } - pf_empty_pool(&V_pf_pabuf); - - if (pcr->action == PF_CHANGE_ADD_HEAD) - oldrule = TAILQ_FIRST( - ruleset->rules[rs_num].active.ptr); - else if (pcr->action == PF_CHANGE_ADD_TAIL) - oldrule = TAILQ_LAST( - ruleset->rules[rs_num].active.ptr, pf_rulequeue); - else { - oldrule = TAILQ_FIRST( - ruleset->rules[rs_num].active.ptr); - while ((oldrule != NULL) && (oldrule->nr != pcr->nr)) - oldrule = TAILQ_NEXT(oldrule, entries); - if (oldrule == NULL) { - if (newrule != NULL) - pf_free_rule(newrule); - PF_RULES_WUNLOCK(); - error = EINVAL; - break; - } - } - - if (pcr->action == PF_CHANGE_REMOVE) { - pf_unlink_rule(ruleset->rules[rs_num].active.ptr, - oldrule); - ruleset->rules[rs_num].active.rcount--; - } else { - if (oldrule == NULL) - TAILQ_INSERT_TAIL( - ruleset->rules[rs_num].active.ptr, - newrule, entries); - else if (pcr->action == PF_CHANGE_ADD_HEAD || - pcr->action == PF_CHANGE_ADD_BEFORE) - TAILQ_INSERT_BEFORE(oldrule, newrule, entries); - else - TAILQ_INSERT_AFTER( - ruleset->rules[rs_num].active.ptr, - oldrule, newrule, entries); - ruleset->rules[rs_num].active.rcount++; - } - - nr = 0; - TAILQ_FOREACH(oldrule, - ruleset->rules[rs_num].active.ptr, entries) - oldrule->nr = nr++; - - ruleset->rules[rs_num].active.ticket++; - - pf_calc_skip_steps(ruleset->rules[rs_num].active.ptr); - pf_remove_if_empty_ruleset(ruleset); - - PF_RULES_WUNLOCK(); - break; - -#undef ERROUT -DIOCCHANGERULE_error: - PF_RULES_WUNLOCK(); - if (newrule != NULL) { - counter_u64_free(newrule->states_cur); - counter_u64_free(newrule->states_tot); - counter_u64_free(newrule->src_nodes); - free(newrule, M_PFRULE); - } - if (kif != NULL) - free(kif, PFI_MTYPE); - break; - } - case DIOCCLRSTATES: { struct pf_state *s; struct pfioc_state_kill *psk = (struct pfioc_state_kill *)addr; @@ -1723,38 +1499,6 @@ relock_DIOCKILLSTATES: break; } - case DIOCADDSTATE: { - struct pfioc_state *ps = (struct pfioc_state *)addr; - struct pfsync_state *sp = &ps->state; - - if (sp->timeout >= PFTM_MAX) { - error = EINVAL; - break; - } - if (pfsync_state_import_ptr != NULL) { - PF_RULES_RLOCK(); - error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); - PF_RULES_RUNLOCK(); - } else - error = EOPNOTSUPP; - break; - } - - case DIOCGETSTATE: { - struct pfioc_state *ps = (struct pfioc_state *)addr; - struct pf_state *s; - - s = pf_find_state_byid(ps->state.id, ps->state.creatorid); - if (s == NULL) { - error = ENOENT; - break; - } - - pfsync_state_export(&ps->state, s); - PF_STATE_UNLOCK(s); - break; - } - case DIOCGETSTATES: { struct pfioc_states *ps = (struct pfioc_states *)addr; struct pf_state *s; @@ -1985,22 +1729,6 @@ DIOCGETSTATES_full: break; } - case DIOCCLRRULECTRS: { - /* obsoleted by DIOCGETRULE with action=PF_GET_CLR_CNTR */ - struct pf_ruleset *ruleset = &pf_main_ruleset; - struct pf_rule *rule; - - PF_RULES_WLOCK(); - TAILQ_FOREACH(rule, - ruleset->rules[PF_RULESET_FILTER].active.ptr, entries) { - rule->evaluations = 0; - rule->packets[0] = rule->packets[1] = 0; - rule->bytes[0] = rule->bytes[1] = 0; - } - PF_RULES_WUNLOCK(); - break; - } - case DIOCGIFSPEED: { struct pf_ifspeed *psp = (struct pf_ifspeed *)addr; struct pf_ifspeed ps; @@ -2155,11 +1883,6 @@ DIOCGETSTATES_full: break; } - case DIOCCHANGEALTQ: - /* CHANGEALTQ not supported yet! */ - error = ENODEV; - break; - case DIOCGETQSTATS: { struct pfioc_qstats *pq = (struct pfioc_qstats *)addr; struct pf_altq *altq; @@ -2311,137 +2034,6 @@ DIOCGETSTATES_full: bcopy(pa, &pp->addr, sizeof(struct pf_pooladdr)); pf_addr_copyout(&pp->addr.addr); PF_RULES_RUNLOCK(); - break; - } - - case DIOCCHANGEADDR: { - struct pfioc_pooladdr *pca = (struct pfioc_pooladdr *)addr; - struct pf_pool *pool; - struct pf_pooladdr *oldpa = NULL, *newpa = NULL; - struct pf_ruleset *ruleset; - struct pfi_kif *kif = NULL; - - if (pca->action < PF_CHANGE_ADD_HEAD || - pca->action > PF_CHANGE_REMOVE) { - error = EINVAL; - break; - } - if (pca->addr.addr.type != PF_ADDR_ADDRMASK && - pca->addr.addr.type != PF_ADDR_DYNIFTL && - pca->addr.addr.type != PF_ADDR_TABLE) { - error = EINVAL; - break; - } - - if (pca->action != PF_CHANGE_REMOVE) { -#ifndef INET - if (pca->af == AF_INET) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET */ -#ifndef INET6 - if (pca->af == AF_INET6) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET6 */ - newpa = malloc(sizeof(*newpa), M_PFRULE, M_WAITOK); - bcopy(&pca->addr, newpa, sizeof(struct pf_pooladdr)); - if (newpa->ifname[0]) - kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); - newpa->kif = NULL; - } - -#define ERROUT(x) { error = (x); goto DIOCCHANGEADDR_error; } - PF_RULES_WLOCK(); - ruleset = pf_find_ruleset(pca->anchor); - if (ruleset == NULL) - ERROUT(EBUSY); - - pool = pf_get_pool(pca->anchor, pca->ticket, pca->r_action, - pca->r_num, pca->r_last, 1, 1); - if (pool == NULL) - ERROUT(EBUSY); - - if (pca->action != PF_CHANGE_REMOVE) { - if (newpa->ifname[0]) { - newpa->kif = pfi_kif_attach(kif, newpa->ifname); - pfi_kif_ref(newpa->kif); - kif = NULL; - } - - switch (newpa->addr.type) { - case PF_ADDR_DYNIFTL: - error = pfi_dynaddr_setup(&newpa->addr, - pca->af); - break; - case PF_ADDR_TABLE: - newpa->addr.p.tbl = pfr_attach_table(ruleset, - newpa->addr.v.tblname); - if (newpa->addr.p.tbl == NULL) - error = ENOMEM; - break; - } - if (error) - goto DIOCCHANGEADDR_error; - } - - switch (pca->action) { - case PF_CHANGE_ADD_HEAD: - oldpa = TAILQ_FIRST(&pool->list); - break; - case PF_CHANGE_ADD_TAIL: - oldpa = TAILQ_LAST(&pool->list, pf_palist); - break; - default: - oldpa = TAILQ_FIRST(&pool->list); - for (int i = 0; oldpa && i < pca->nr; i++) - oldpa = TAILQ_NEXT(oldpa, entries); - - if (oldpa == NULL) - ERROUT(EINVAL); - } - - if (pca->action == PF_CHANGE_REMOVE) { - TAILQ_REMOVE(&pool->list, oldpa, entries); - switch (oldpa->addr.type) { - case PF_ADDR_DYNIFTL: - pfi_dynaddr_remove(oldpa->addr.p.dyn); - break; - case PF_ADDR_TABLE: - pfr_detach_table(oldpa->addr.p.tbl); - break; - } - if (oldpa->kif) - pfi_kif_unref(oldpa->kif); - free(oldpa, M_PFRULE); - } else { - if (oldpa == NULL) - TAILQ_INSERT_TAIL(&pool->list, newpa, entries); - else if (pca->action == PF_CHANGE_ADD_HEAD || - pca->action == PF_CHANGE_ADD_BEFORE) - TAILQ_INSERT_BEFORE(oldpa, newpa, entries); - else - TAILQ_INSERT_AFTER(&pool->list, oldpa, - newpa, entries); - } - - pool->cur = TAILQ_FIRST(&pool->list); - PF_ACPY(&pool->counter, &pool->cur->addr.v.a.addr, pca->af); - PF_RULES_WUNLOCK(); - break; - -#undef ERROUT -DIOCCHANGEADDR_error: - if (newpa != NULL) { - if (newpa->kif) - pfi_kif_unref(newpa->kif); - free(newpa, M_PFRULE); - } - PF_RULES_WUNLOCK(); - if (kif != NULL) - free(kif, PFI_MTYPE); break; } From owner-svn-src-head@freebsd.org Sun Jul 1 01:45:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71ABFFE2349; Sun, 1 Jul 2018 01:45:42 +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 1615F94425; Sun, 1 Jul 2018 01:45:42 +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 E6712180DA; Sun, 1 Jul 2018 01:45:41 +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 w611jfM9024309; Sun, 1 Jul 2018 01:45:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w611jfAc024308; Sun, 1 Jul 2018 01:45:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201807010145.w611jfAc024308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Jul 2018 01:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335834 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 01:45:42 -0000 Author: imp Date: Sun Jul 1 01:45:41 2018 New Revision: 335834 URL: https://svnweb.freebsd.org/changeset/base/335834 Log: Mention, belatedly, the need to run mergemaster. This somehow wasn't committed with the other changes. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jul 1 01:16:03 2018 (r335833) +++ head/UPDATING Sun Jul 1 01:45:41 2018 (r335834) @@ -38,6 +38,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. +20180628: + r335753 introduced a new quoting method. However, etc/devd/devmatch.conf + needed to be changed to work with it. This change was made with r335763 + and requires a mergemaster / etcupdate / etc to update the installed file. + 20180612: r334930 changed the interface between the NFS modules, so they all need to be rebuilt. r335018 did a __FreeBSD_version bump for this. From owner-svn-src-head@freebsd.org Sun Jul 1 01:56:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6900AFE2B92; Sun, 1 Jul 2018 01:56:41 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 195FA94C0D; Sun, 1 Jul 2018 01:56:41 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE9EC182B9; Sun, 1 Jul 2018 01:56:40 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w611ue3d029299; Sun, 1 Jul 2018 01:56:40 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w611ue15029298; Sun, 1 Jul 2018 01:56:40 GMT (envelope-from will@FreeBSD.org) Message-Id: <201807010156.w611ue15029298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sun, 1 Jul 2018 01:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335835 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: will X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 335835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 01:56:41 -0000 Author: will Date: Sun Jul 1 01:56:40 2018 New Revision: 335835 URL: https://svnweb.freebsd.org/changeset/base/335835 Log: pf(4): remove reference to non-existent pflow(4). Modified: head/share/man/man4/pf.4 Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Sun Jul 1 01:45:41 2018 (r335834) +++ head/share/man/man4/pf.4 Sun Jul 1 01:56:40 2018 (r335835) @@ -1135,7 +1135,6 @@ main(int argc, char *argv[]) .Xr altq 4 , .Xr if_bridge 4 , .Xr pflog 4 , -.Xr pflow 4 , .Xr pfsync 4 , .Xr pfctl 8 , .Xr altq 9 From owner-svn-src-head@freebsd.org Sun Jul 1 03:29:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E324FE61D6 for ; Sun, 1 Jul 2018 03:29:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26BC497D97 for ; Sun, 1 Jul 2018 03:29:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x233.google.com with SMTP id w13-v6so5600143ywa.5 for ; Sat, 30 Jun 2018 20:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6qZvdNtCmK7iI5RyrxLLGwfITuWBoLswdfJX+R95ayg=; b=FsnECGfD5UGGBjnKVxyR4Gz6cmrwsxFZBeA/+zfnFmAZT3inRAUMikgSl41/8nke2L CsIcVA26I9Bxs+Cb8r7n0ni3Lph0B+0fJCn+IapJOij9WIWZd3/LxhGCqqCCjpJE3cxa 6dzdpgH9SvJ3fV0UkTYOTY3k5B0xauKKcwSj0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6qZvdNtCmK7iI5RyrxLLGwfITuWBoLswdfJX+R95ayg=; b=bQkCnlWG1Gedzq/+N8Cf9OO7kIBG5P0Q3jP4QG90B5xZBTOzGj6/I5SZqD/eKR3hIt HPrCKsHlTwfCZvhSDqgY7LNXPIaK6bg+zcyjNZ9tyGIhtKTw6oVb/VkRme7Cv7aHAh60 QKZRfBfhVcapsVQyWcDZBIwOFiHq77GlnUtOMsc2WoxMTaWV5EO4KFTR4+/scU9PcwYP lo6wInFnnHooPIXR5sA7WLgFBM2mR5pUBFAAmMIDzEXVwLqSo1ObhL9fW77BrSbFxbho VSpHr66zdmqwkpyFsQ15AZ2vq6i0XqVjglZ9XXFE+2cgd5beA15/3JcqU1Y7XAFoGFBS N/ew== X-Gm-Message-State: APt69E2P4IoNmTYM5CUB6XN7iDfn7ua6YM32mleAvtI3zxbPRvPEpvpP qPLMTP/3qKDSVKZOKVZClCUT75SuelV2zXwTfilPsA== X-Google-Smtp-Source: AAOMgpdvRNY1kfVFaVWmPFgJqTLhwqUWaG1e4yaDkcELQv+US8ENoHoYJaNpNGapj7PqQJzgs/NenAtV8vD/qfOkks0= X-Received: by 2002:a81:af06:: with SMTP id n6-v6mr4820691ywh.113.1530415772365; Sat, 30 Jun 2018 20:29:32 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:870e:0:0:0:0:0 with HTTP; Sat, 30 Jun 2018 20:29:01 -0700 (PDT) In-Reply-To: <201807010109.w6119qj3003250@repo.freebsd.org> References: <201807010109.w6119qj3003250@repo.freebsd.org> From: Eitan Adler Date: Sat, 30 Jun 2018 20:29:01 -0700 Message-ID: Subject: Re: svn commit: r335831 - head/tools/build To: Will Andrews Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 03:29:33 -0000 On 30 June 2018 at 18:09, Will Andrews wrote: > Author: will > Date: Sun Jul 1 01:09:52 2018 > New Revision: 335831 > URL: https://svnweb.freebsd.org/changeset/base/335831 > > Log: > beinstall: enable use with git worktrees. What do you think of https://reviews.freebsd.org/D16081 ? -- Eitan Adler From owner-svn-src-head@freebsd.org Sun Jul 1 05:32:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A09D2102B64C; Sun, 1 Jul 2018 05:32:05 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF5176EE1; Sun, 1 Jul 2018 05:32:05 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3084A1A8E0; Sun, 1 Jul 2018 05:32:05 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w615W55Y042177; Sun, 1 Jul 2018 05:32:05 GMT (envelope-from daichi@FreeBSD.org) Received: (from daichi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w615W44e042172; Sun, 1 Jul 2018 05:32:04 GMT (envelope-from daichi@FreeBSD.org) Message-Id: <201807010532.w615W44e042172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: daichi set sender to daichi@FreeBSD.org using -f From: Daichi GOTO Date: Sun, 1 Jul 2018 05:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335836 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: daichi X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 05:32:06 -0000 Author: daichi Date: Sun Jul 1 05:32:03 2018 New Revision: 335836 URL: https://svnweb.freebsd.org/changeset/base/335836 Log: top(1) - support UTF-8 display Reviewed by: eadler Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16006 Modified: head/usr.bin/top/display.c head/usr.bin/top/machine.c head/usr.bin/top/top.c head/usr.bin/top/top.h head/usr.bin/top/utils.c head/usr.bin/top/utils.h Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Sun Jul 1 01:56:40 2018 (r335835) +++ head/usr.bin/top/display.c Sun Jul 1 05:32:03 2018 (r335836) @@ -1258,19 +1258,43 @@ line_update(char *old, char *new, int start, int line) char * printable(char str[]) { - char *ptr; - char ch; + char *ptr; + char ch; - ptr = str; - while ((ch = *ptr) != '\0') - { - if (!isprint(ch)) - { - *ptr = '?'; + ptr = str; + if (utf8flag) { + while ((ch = *ptr) != '\0') { + if (0x00 == (0x80 & ch)) { + if (!isprint(ch)) { + *ptr = '?'; + } + ++ptr; + } else if (0xC0 == (0xE0 & ch)) { + ++ptr; + if ('\0' != *ptr) ++ptr; + } else if (0xE0 == (0xF0 & ch)) { + ++ptr; + if ('\0' != *ptr) ++ptr; + if ('\0' != *ptr) ++ptr; + } else if (0xF0 == (0xF8 & ch)) { + ++ptr; + if ('\0' != *ptr) ++ptr; + if ('\0' != *ptr) ++ptr; + if ('\0' != *ptr) ++ptr; + } else { + *ptr = '?'; + ++ptr; + } + } + } else { + while ((ch = *ptr) != '\0') { + if (!isprint(ch)) { + *ptr = '?'; + } + ptr++; + } } - ptr++; - } - return(str); + return(str); } void Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Jul 1 01:56:40 2018 (r335835) +++ head/usr.bin/top/machine.c Sun Jul 1 05:32:03 2018 (r335836) @@ -988,9 +988,13 @@ format_next_process(struct handle * xhandle, char *(*g if (*src == '\0') continue; len = (argbuflen - (dst - argbuf) - 1) / 4; - strvisx(dst, src, - MIN(strlen(src), len), - VIS_NL | VIS_CSTYLE); + if (utf8flag) { + utf8strvisx(dst, src, MIN(strlen(src), len)); + } else { + strvisx(dst, src, + MIN(strlen(src), len), + VIS_NL | VIS_CSTYLE); + } while (*dst != '\0') dst++; if ((argbuflen - (dst - argbuf) - 1) / 4 > 0) Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sun Jul 1 01:56:40 2018 (r335835) +++ head/usr.bin/top/top.c Sun Jul 1 05:32:03 2018 (r335836) @@ -69,6 +69,7 @@ static int max_topn; /* maximum displayable processes struct process_select ps; const char * myname = "top"; pid_t mypid; +bool utf8flag = false; /* pointers to display routines */ static void (*d_loadave)(int mpid, double *avenrun) = i_loadave; @@ -605,6 +606,14 @@ main(int argc, char *argv[]) sleep(3 * warnings); fputc('\n', stderr); } + + /* check if you are using UTF-8 */ + char *env_lang; + if (NULL != (env_lang = getenv("LANG")) && + 0 != strcmp(env_lang, "") && + NULL != strstr(env_lang, "UTF-8")) { + utf8flag = true; + } restart: Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Sun Jul 1 01:56:40 2018 (r335835) +++ head/usr.bin/top/top.h Sun Jul 1 05:32:03 2018 (r335836) @@ -8,6 +8,7 @@ #define TOP_H #include +#include /* Number of lines of header information on the standard screen */ extern int Header_lines; @@ -37,6 +38,7 @@ extern enum displaymodes displaymode; extern int pcpu_stats; extern int overstrike; extern pid_t mypid; +extern bool utf8flag; extern const char * myname; Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Sun Jul 1 01:56:40 2018 (r335835) +++ head/usr.bin/top/utils.c Sun Jul 1 05:32:03 2018 (r335836) @@ -2,6 +2,7 @@ * This program may be freely redistributed, * but this entire comment MUST remain intact. * + * Copyright (c) 2018, Daichi Goto * Copyright (c) 2018, Eitan Adler * Copyright (c) 1984, 1989, William LeFebvre, Rice University * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University @@ -327,4 +328,62 @@ find_pid(pid_t pid) done: kvm_close(kd); return ret; +} + +/* + * utf8strvisx(dst,src,src_len) + * strvisx(dst,src,src_len,VIS_NL|VIS_CSTYLE) coresponding to UTF-8. + */ +static const char *vis_encodes[] = { + "\\0", "\\^A", "\\^B", "\\^C", "\\^D", "\\^E", "\\^F", "\\a", + "\\b", "\t", "\\n", "\\v", "\\f", "\\r", "\\^N", "\\^O", "\\^P", + "\\^Q", "\\^R", "\\^S", "\\^T", "\\^U", "\\^V", "\\^W", "\\^X", + "\\^Y", "\\^Z", "\\^[", "\\^\\", "\\^]", "\\^^", "\\^_" +}; + +int +utf8strvisx(char *dst, const char *src, size_t src_len) +{ + const char *src_p; + char *dst_p; + int i, j, olen, len; + + src_p = src; + dst_p = dst; + i = olen = 0; + len = (int)src_len; + while (i < len) { + if (0x00 == (0x80 & *src_p)) { + if (0 <= *src_p && *src_p <= 31) { + j = strlen(vis_encodes[(int)*src_p]); + strcpy(dst_p, vis_encodes[(int)*src_p]); + dst_p += j; + olen += j; + } else if (127 == *src_p) { + strcpy(dst_p, "\\^?"); + olen += 3; + } else { + *dst_p++ = *src_p; + ++olen; + } + ++i; + ++src_p; + } else if (0xC0 == (0xE0 & *src_p)) { + *dst_p++ = *src_p++; ++i; ++olen; + if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } + } else if (0xE0 == (0xF0 & *src_p)) { + *dst_p++ = *src_p++; ++i; ++olen; + if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } + if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } + } else if (0xF0 == (0xF8 & *src_p)) { + *dst_p++ = *src_p++; ++i; ++olen; + if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } + if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } + if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } + } else { + *dst_p++ = '?'; ++i; ++olen; + } + } + + return olen; } Modified: head/usr.bin/top/utils.h ============================================================================== --- head/usr.bin/top/utils.h Sun Jul 1 01:56:40 2018 (r335835) +++ head/usr.bin/top/utils.h Sun Jul 1 05:32:03 2018 (r335836) @@ -22,4 +22,5 @@ const char *format_time(long); char *format_k(int64_t); int string_index(const char *string, const char * const *array); int find_pid(pid_t pid); +int utf8strvisx(char *, const char *, size_t); From owner-svn-src-head@freebsd.org Sun Jul 1 06:50:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 110001031796 for ; Sun, 1 Jul 2018 06:50:56 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-23.consmr.mail.ne1.yahoo.com (sonic312-23.consmr.mail.ne1.yahoo.com [66.163.191.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B265F813A6 for ; Sun, 1 Jul 2018 06:50:55 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: TTmLuVEVM1nq5_lVK68EbYu0aRL3EnQCU_RZXGLdeAgwT8uaIKDk.YuTyHDZjfB QJldtLeMq5m2npIBz1AozdGrWBUVwWqUIyWE6NtUDHX.5F1i6ESijQp7DAM_rFn55UtkKVxiltsy znZbHUVa.Ffic9qJVj1Q1rekNaCG.bReLx7YpW_W811qTP7yHvrdh7tZaz1JTsSh_DJgueaYQEUW QRLkv5BVDHhU2F31IAhZPuG3PuossUcZ5pxKyVxblRFulk7OTtKFkR1Fr3gQ_gojMmIW0Pe7N5Vr mHNYgT.n1Na5vs5HOwQ7d53f_r0b8mvf5vSpWLnobPQCi_mjeqosQBmyTJxveLlE.3oV6V3iNF.g UONNlgtOfqXdGdMnabcGaBvKjmcQeZXF5.d1y3L1_B_wH8GTxkPBcHUyOjRjRU4Zw97J1bxdwY.K HfJhYTyPaJiOcUM1uFJL7es7dHUmzwKh.HnbJlHzIl7v_uCugU7Dqg2M6ap34LxVCs6SDecKOWGL 1Et5lFhzkBS.TpBydcHYZZXQ2YJWfL_LDmot4IfAQ2fLq9B_AbEdsAsY8StWMtxtYuValn6x2lM3 3ugsAviyx2Ly_2QJMuI8d_ovVAO5VjLS943cwhLcX3ILh46DOihZJ0.gK55qsqwcRS76qQP4pIoy 8xOzg694Ts52wuBT4N5OfCIw96RgjSKnSMNlaRohAzU0P4d.4IcpfU3yR.NsZ.JglygsxKKdHzye 4av8v6WGn9Kme7rEAD1mmf.mHrWbqMtUSunZ6kmnpw3Sv1MlqtDrfETXL1Jin.Qp4EAlKfwmO3X4 vl7mAnaulU6DFR2qs.rWqSyCYgNkCUbnV02xLznVtcohj9WGRHlTvPWGj3HRZpnz1tI4ClsVKPD8 h_YIG9CADPT0KSTqazfzmD6gj3bjb4_uwsKAZpy2.vQcB1qXW49HmdugWdwSonToNjW5MccofT41 aOkFF3aayioauvFA4c5YuOdH32g-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sun, 1 Jul 2018 06:50:48 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp428.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID a6e843794107c7e46dd539757f0df3fb; Sun, 01 Jul 2018 06:50:45 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335836 - head/usr.bin/top [broke ci.freebsd.org 's FreeBSD-head-riscv64-build] Message-Id: Date: Sat, 30 Jun 2018 23:50:44 -0700 To: daichi@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 06:50:56 -0000 https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/9229/consoleText --- utils.o --- /usr/local/bin/riscv64-unknown-freebsd11.1-gcc = --sysroot=3D/workspace/obj/workspace/src/riscv.riscv64/tmp = -B/usr/local/riscv64-unknown-freebsd11.1/bin/ -O2 -pipe = -march=3Drv64imafdc -mabi=3Dlp64d -g -MD -MF.depend.utils.o = -MTutils.o -std=3Dgnu99 -fstack-protector-strong -Wsystem-headers = -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type = -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter = -Wcast-align -Wchar-subscripts -Winline -Wnested-externs = -Wredundant-decls -Wold-style-definition -Wno-pointer-sign = -Wno-error=3Daddress -Wno-error=3Darray-bounds -Wno-error=3Dattributes = -Wno-error=3Dbool-compare -Wno-error=3Dcast-align -Wno-error=3Dclobbered = -Wno-error=3Denum-compare -Wno-error=3Dextra -Wno-error=3Dinline = -Wno-error=3Dlogical-not-parentheses -Wno-error=3Dstrict-aliasing = -Wno-error=3Duninitialized -Wno-error=3Dunused-but-set-variable = -Wno-error=3Dunused-function -Wno-error=3Dunused-value = -Wno-error=3Dmisleading-indentation -Wno-error=3Dnonnull-compare = -Wno-error=3Dshift-negative-value -Wno-error=3Dtautological-compare = -Wno-error=3Dunused-const-variable -Wno-error=3Dbool-operation = -Wno-error=3Ddeprecated -Wno-error=3Dexpansion-to-defined = -Wno-error=3Dformat-overflow -Wno-error=3Dformat-truncation = -Wno-error=3Dimplicit-fallthrough -Wno-error=3Dint-in-bool-context = -Wno-error=3Dmemset-elt-size -Wno-error=3Dnonnull = -Wno-error=3Dpointer-compare -Wno-error=3Dstringop-overflow = -Wno-error=3Ddiscarded-qualifiers -Wno-error=3Dincompatible-pointer-types = -c /workspace/src/usr.bin/top/utils.c -o utils.o /workspace/src/usr.bin/top/utils.c: In function 'utf8strvisx': /workspace/src/usr.bin/top/utils.c:357:10: error: comparison is always = true due to limited range of data type [-Werror=3Dtype-limits] if (0 <=3D *src_p && *src_p <=3D 31) { ^~ I'd guess that riscv64 has an unsigned type for *src_p --and that fairly modern gcc complains where system clang and old gcc 4.2.1 do not complain for the issue. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sun Jul 1 07:26:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2299EFD3B8E; Sun, 1 Jul 2018 07:26:43 +0000 (UTC) (envelope-from dim@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 B525383B12; Sun, 1 Jul 2018 07:26:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 27F0B1FBC9; Sun, 1 Jul 2018 07:26:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_CF308ACF-945B-4BEB-A4D7-53EDC056F40C"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335813 [ broke ci.freebsd.org 's FreeBSD-head-{aarch64,amd64,i386}-build ] Date: Sun, 1 Jul 2018 09:26:30 +0200 In-Reply-To: <082D396D-639C-445F-A04E-5C56F219D177@FreeBSD.org> Cc: svn-src-head@freebsd.org, FreeBSD Current To: Mark Millard References: <84175A6B-B159-4320-95FD-C5BC7F3B4C96@yahoo.com> <082D396D-639C-445F-A04E-5C56F219D177@FreeBSD.org> X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 07:26:43 -0000 --Apple-Mail=_CF308ACF-945B-4BEB-A4D7-53EDC056F40C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 30 Jun 2018, at 15:58, Dimitry Andric wrote: >=20 > On 30 Jun 2018, at 15:22, Mark Millard wrote: >>=20 >> = https://ci.freebsd.org/job/FreeBSD-head-aarch64-build/8358/consoleText >>=20 >> --- all_subdir_armv8crypto --- >> /usr/src/sys/crypto/armv8/armv8_crypto_wrap.c:46:10: fatal error: = 'arm_neon.h' file not found >> #include >> ^~~~~~~~~~~~ >> 1 error generated. >> *** [armv8_crypto_wrap.o] Error code 1 >>=20 >>=20 >> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9268/consoleText >>=20 >> --- lib/liblzma__L --- >> In file included from = /usr/src/contrib/xz/src/liblzma/lz/lz_encoder.c:23: >> /usr/src/contrib/xz/src/liblzma/common/memcmplen.h:19:11: fatal = error: 'immintrin.h' file not found >> # include >> ^~~~~~~~~~~~~ >> 1 error generated. >> *** [lz_encoder.o] Error code 1 >=20 > Yeah, sorry about that, working on it now. I'm awaiting a full build = to > see if there are any other issues. This should now be fixed with r335819. -Dimitry --Apple-Mail=_CF308ACF-945B-4BEB-A4D7-53EDC056F40C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWziCJgAKCRCwXqMKLiCW o7tCAKD+UDGlX2lA0CwzDMncYOUuCsqN9QCgoB18GG5y+7oS0CEpBQP5pzTOub4= =FSvs -----END PGP SIGNATURE----- --Apple-Mail=_CF308ACF-945B-4BEB-A4D7-53EDC056F40C-- From owner-svn-src-head@freebsd.org Sun Jul 1 08:06:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28D00FDDCB0; Sun, 1 Jul 2018 08:06:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E62D84C94; Sun, 1 Jul 2018 08:06:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-wr0-x22e.google.com with SMTP id u7-v6so12521292wrn.12; Sun, 01 Jul 2018 01:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6feKQtFYqRqKnZRpZx118iZgs616xB3kd3IgaVhCFFw=; b=pEm11cDXi7IGV/EJ8WT4+dzNmjhFCLOoXDcdG/5Xvmf0Pv0QwYQYl1oY3kipqLXQwi GG1wqPdDPLmydQFYkFk5YSr8B9pxqe2+9uxqEVTc1i82qFHiQ0p7dU2rpD7pTogAlnz+ f+FvohlhP7J8kHyZpMK9CpDP3W4lkiX+LUUQiJH+BWduWdzXzXKAbydfv430QPMXrDRQ S6xm/HF9uqy7LQsQ7rYQgwySS9tYuYZnIOXDUpZvB9kLqyroh7wZUbumKc4za/5OpI+l 8NZTBnzUGyetbdZSdcBTniQnIGsDtvkvADyAaS8g2jULLf2MeMdIWeX9+msP9E++v/Vo vL3w== 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=6feKQtFYqRqKnZRpZx118iZgs616xB3kd3IgaVhCFFw=; b=ONTkQNQtCwtZlO1kXVrDN8WJ0e1/8MB30j4B+1MkbWBgci4yl6Y4TaDeYviUHs/bn0 nGbVAVMaV+UWEU6Mm9nORVazF8xr6Uf/FxYurM871jaYYzioWkesxKMrutZsI2iTQft5 Poh1mfw7H9tJbcWHEFgW/7yCvddg19kyc534q0z21xT9NWYxDIhzehckl0zf2arhHKjh /cq2bH5c5930sFgz6z8Ki/nhrG5FHp9CoDlUrFVomahT3YsGTM1kRpMr/rVRC2uT01d3 eUVUMxkJBbPGIjeG5SFKkIrGfi8Pbvfs9OAy2LKW8YMfby+R1rgPX4G7k53uHy5QTabu 70hQ== X-Gm-Message-State: APt69E337yAQyvL5ESQUfHUfZG2dCcGhMH5niZnh9U5iZ8PFCKeNlFwe hO3kJRvfDXXyneh+a/+psX8Wgg== X-Google-Smtp-Source: AAOMgpfCjO3lN4FBvUD2SNGc12FP48mtvnNPyXJia0xKrNCz3rajYJ1wdWfxYbnLorX/0XPuB0sBlA== X-Received: by 2002:a5d:6981:: with SMTP id g1-v6mr2756340wru.77.1530432411399; Sun, 01 Jul 2018 01:06:51 -0700 (PDT) Received: from pesky.lan (93-34-93-211.ip49.fastwebnet.it. [93.34.93.211]) by smtp.gmail.com with ESMTPSA id j198-v6sm44857wmd.18.2018.07.01.01.06.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 01:06:50 -0700 (PDT) Sender: Mark Johnston Date: Sun, 1 Jul 2018 04:06:46 -0400 From: Mark Johnston To: Will Andrews Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335833 - in head: share/man/man4 sys/net sys/netpfil/pf Message-ID: <20180701080646.GA3926@pesky.lan> References: <201807010116.w611G35w008185@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807010116.w611G35w008185@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 08:06:54 -0000 On Sun, Jul 01, 2018 at 01:16:03AM +0000, Will Andrews wrote: > Author: will > Date: Sun Jul 1 01:16:03 2018 > New Revision: 335833 > URL: https://svnweb.freebsd.org/changeset/base/335833 > > Log: > pf: remove unused ioctls. > > Several ioctls are unused in pf, in the sense that no base utility > references them. Additionally, a cursory review of pf-based ports > indicates they're not used elsewhere either. Some of them have been > unused since the original import. As far as I can tell, they're also > unused in OpenBSD. Finally, removing this code removes the need for > future pf work to take them into account. sshuttle seems to use DIOCCHANGERULE. From owner-svn-src-head@freebsd.org Sun Jul 1 08:37:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25BD1FE4006; Sun, 1 Jul 2018 08:37:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9F3985F17; Sun, 1 Jul 2018 08:37:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9525F1C614; Sun, 1 Jul 2018 08:37:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w618b8O2034332; Sun, 1 Jul 2018 08:37:08 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w618b7Ah034327; Sun, 1 Jul 2018 08:37:07 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201807010837.w618b7Ah034327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 1 Jul 2018 08:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335837 - in head: share/man/man4 sys/netinet X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet X-SVN-Commit-Revision: 335837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 08:37:09 -0000 Author: kp Date: Sun Jul 1 08:37:07 2018 New Revision: 335837 URL: https://svnweb.freebsd.org/changeset/base/335837 Log: carp: Set DSCP value CS7 Update carp to set DSCP value CS7(Network Traffic) in the flowlabel field of packets by default. Currently carp only sets TOS_LOWDELAY in IPv4 which was deprecated in 1998. This also implements sysctl that can revert carp back to it's old behavior if desired. This will allow implementation of QOS on modern network devices to make sure carp packets aren't dropped during interface contention. Submitted by: Nick Wolff Reviewed by: kp, mav (earlier version) Differential Revision: https://reviews.freebsd.org/D14536 Modified: head/share/man/man4/carp.4 head/sys/netinet/ip.h head/sys/netinet/ip6.h head/sys/netinet/ip_carp.c Modified: head/share/man/man4/carp.4 ============================================================================== --- head/share/man/man4/carp.4 Sun Jul 1 05:32:03 2018 (r335836) +++ head/share/man/man4/carp.4 Sun Jul 1 08:37:07 2018 (r335837) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2018 +.Dd July 1, 2018 .Dt CARP 4 .Os .Sh NAME @@ -104,6 +104,12 @@ Allow virtual hosts to preempt each other. When enabled, a vhid in a backup state would preempt a master that is announcing itself with a lower advskew. Disabled by default. +.It Va net.inet.carp.dscp +DSCP value in carp packet. +Valid Values are 0 to 63. +A value of 4 is equivalent to the old standard of TOS LOW_DELAY. +TOS values were deprecated and replaced by DSCP in 1998. +The default value is 56 (CS7/Network Control). .It Va net.inet.carp.log Determines what events relating to .Nm Modified: head/sys/netinet/ip.h ============================================================================== --- head/sys/netinet/ip.h Sun Jul 1 05:32:03 2018 (r335836) +++ head/sys/netinet/ip.h Sun Jul 1 08:37:07 2018 (r335837) @@ -94,6 +94,11 @@ struct ip { #define IPTOS_PREC_ROUTINE IPTOS_DSCP_CS0 /* + * Offset of Diffserv decimal value to convert it to tos value . + */ +#define IPTOS_DSCP_OFFSET 2 + +/* * Definitions for DiffServ Codepoints as per RFC2474 and RFC5865. */ #define IPTOS_DSCP_CS0 0x00 Modified: head/sys/netinet/ip6.h ============================================================================== --- head/sys/netinet/ip6.h Sun Jul 1 05:32:03 2018 (r335836) +++ head/sys/netinet/ip6.h Sun Jul 1 08:37:07 2018 (r335837) @@ -104,6 +104,7 @@ struct ip6_hdr { #define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */ #endif /* LITTLE_ENDIAN */ #endif +#define IPV6_FLOWLABEL_LEN 20 #if 1 /* ECN bits proposed by Sally Floyd */ #define IP6TOS_CE 0x01 /* congestion experienced */ Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Sun Jul 1 05:32:03 2018 (r335836) +++ head/sys/netinet/ip_carp.c Sun Jul 1 08:37:07 2018 (r335837) @@ -190,6 +190,10 @@ static int proto_reg[] = {-1, -1}; static VNET_DEFINE(int, carp_allow) = 1; #define V_carp_allow VNET(carp_allow) +/* Set DSCP in outgoing CARP packets. */ +static VNET_DEFINE(int, carp_dscp) = 56; +#define V_carp_dscp VNET(carp_dscp) + /* Preempt slower nodes. */ static VNET_DEFINE(int, carp_preempt) = 0; #define V_carp_preempt VNET(carp_preempt) @@ -211,12 +215,16 @@ static VNET_DEFINE(int, carp_ifdown_adj) = CARP_MAXSKE #define V_carp_ifdown_adj VNET(carp_ifdown_adj) static int carp_allow_sysctl(SYSCTL_HANDLER_ARGS); +static int carp_dscp_sysctl(SYSCTL_HANDLER_ARGS); static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW, 0, "CARP"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, allow, CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, 0, 0, carp_allow_sysctl, "I", "Accept incoming CARP packets"); +SYSCTL_PROC(_net_inet_carp, OID_AUTO, dscp, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, 0, 0, carp_dscp_sysctl, "I", + "DSCP value for carp packets"); SYSCTL_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_preempt), 0, "High-priority backup preemption mode"); SYSCTL_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_VNET | CTLFLAG_RW, @@ -933,7 +941,7 @@ carp_send_ad_locked(struct carp_softc *sc) ip = mtod(m, struct ip *); ip->ip_v = IPVERSION; ip->ip_hl = sizeof(*ip) >> 2; - ip->ip_tos = IPTOS_LOWDELAY; + ip->ip_tos = V_carp_dscp << IPTOS_DSCP_OFFSET; ip->ip_len = htons(len); ip->ip_off = htons(IP_DF); ip->ip_ttl = CARP_DFLTTL; @@ -983,6 +991,10 @@ carp_send_ad_locked(struct carp_softc *sc) ip6 = mtod(m, struct ip6_hdr *); bzero(ip6, sizeof(*ip6)); ip6->ip6_vfc |= IPV6_VERSION; + /* Traffic class isn't defined in ip6 struct instead + * it gets offset into flowid field */ + ip6->ip6_flow |= htonl(V_carp_dscp << (IPV6_FLOWLABEL_LEN + + IPTOS_DSCP_OFFSET)); ip6->ip6_hlim = CARP_DFLTTL; ip6->ip6_nxt = IPPROTO_CARP; @@ -2097,6 +2109,24 @@ carp_allow_sysctl(SYSCTL_HANDLER_ARGS) } mtx_unlock(&carp_mtx); } + + return (0); +} + +static int +carp_dscp_sysctl(SYSCTL_HANDLER_ARGS) +{ + int new, error; + + new = V_carp_dscp; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error || !req->newptr) + return (error); + + if (new < 0 || new > 63) + return (EINVAL); + + V_carp_dscp = new; return (0); } From owner-svn-src-head@freebsd.org Sun Jul 1 10:05:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1664FEE190; Sun, 1 Jul 2018 10:05:46 +0000 (UTC) (envelope-from wosch@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 514F789571; Sun, 1 Jul 2018 10:05:46 +0000 (UTC) (envelope-from wosch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CB091D4C6; Sun, 1 Jul 2018 10:05:46 +0000 (UTC) (envelope-from wosch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61A5kwa080489; Sun, 1 Jul 2018 10:05:46 GMT (envelope-from wosch@FreeBSD.org) Received: (from wosch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61A5kj8080488; Sun, 1 Jul 2018 10:05:46 GMT (envelope-from wosch@FreeBSD.org) Message-Id: <201807011005.w61A5kj8080488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wosch set sender to wosch@FreeBSD.org using -f From: Wolfram Schneider Date: Sun, 1 Jul 2018 10:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335838 - head X-SVN-Group: head X-SVN-Commit-Author: wosch X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 10:05:46 -0000 Author: wosch Date: Sun Jul 1 10:05:45 2018 New Revision: 335838 URL: https://svnweb.freebsd.org/changeset/base/335838 Log: `make installworld' should display "completed" message if done PR: 225159 Reviewed by: bdrewery Approved by: cem (mentor) Differential Revision: https://reviews.freebsd.org/D14057 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jul 1 08:37:07 2018 (r335837) +++ head/Makefile.inc1 Sun Jul 1 10:05:45 2018 (r335838) @@ -1145,7 +1145,13 @@ kernel-toolchain: ${KERNEL_TOOLCHAIN_TGTS} .PHONY # installcheck: _installcheck_world _installcheck_kernel .PHONY _installcheck_world: .PHONY + @echo "--------------------------------------------------------------" + @echo ">>> Install check world" + @echo "--------------------------------------------------------------" _installcheck_kernel: .PHONY + @echo "--------------------------------------------------------------" + @echo ">>> Install check kernel" + @echo "--------------------------------------------------------------" # # Require DESTDIR to be set if installing for a different architecture or @@ -1412,12 +1418,15 @@ restage reinstall: .MAKE .PHONY .endif @echo @echo "--------------------------------------------------------------" - @echo ">>> Installing everything" + @echo ">>> Installing everything started on `LC_ALL=C date`" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install .if defined(LIBCOMPAT) ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat} .endif + @echo "--------------------------------------------------------------" + @echo ">>> Installing everything completed on `LC_ALL=C date`" + @echo "--------------------------------------------------------------" redistribute: .MAKE .PHONY @echo "--------------------------------------------------------------" From owner-svn-src-head@freebsd.org Sun Jul 1 13:35:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2054FF74E2 for ; Sun, 1 Jul 2018 13:35:10 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-3.consmr.mail.bf2.yahoo.com (sonic305-3.consmr.mail.bf2.yahoo.com [74.6.133.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5B47016A for ; Sun, 1 Jul 2018 13:35:10 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 5.8ukBAVM1k4RbT1NUdQg2hcIoj820.ewO1I0Ploto6Yo8v7yLDQWQUGZVZPlTV WiuWZCStiXtGvjvdFVjRSKvsV4pxZ6K6ZxPOn5aIjNg.oFAMyB9gPm2.C0Zy4Xc9ynALpEt6eaT3 kGCtk4uAS2vVib7WpVcKT7BTZQ.8raLJ3HSfj8BKguMngpQzjAftO3Z4ktcb9qpndRfNYt.WW5zh aNGj9VKRrFycD7abqeZ4leze0iKvZdLErWzfXGp349Q98MkVTFFfyY9KMeYW1481aAwVie_1n4sK tNCBEVJrgGaa1w6D5Ev0tgaxmt._.6Dx2o7qT.iIZC7OJNZc68sUlyHB9i4e3lXLQgmdP64KJWA6 ywzNGb4Psa6FXp_pC91qofhSsD4nQZhiI1u4Pln42eMoqSu0xj8R29NonAELoHS8a6TTsJ.Sqh0m YLpi9ENZLIb5I6S.IlqlK7zo7Zn6luFOpXSB2HCndkkX_ZEhLBdnVtBXLjxNfAWhjyb_y2iFV1B. r_u04I0XgFY8YnpYNIZNUrq9Tpqed4E17KU9m.OWfxym67a1sdbihnR0Uu4cFhUy6.k2YjJ3F4Ms dJLFFYGmfvI7iwhyfa9JNSydmYjoRGgZ.CMC3ytQR_4y1MSpGr4oCDhv_PL5.6sa9ekdbXM4Qy9m jzJmLFlckoOQvuqoVcKbcSBtlsTwZI8rjpcK1tUkRearknML6yTCtUjkqSrKUlOmfByjcEBdot3m XCDe2zCAjhT2SCWI3dxQpEjSJjbTXBo0r4TgyKaEdSsQG6SWa6ToiQhTvhOccl9XllUOZ7Njlfkx CY_94W8ZaEmxi0mAI3TA.KO5FgkcuDQAzlbIA4fvC1KnzWn1qj2R2XO3tZmwHd3mXGz.CWhFCSZv L589MnkR8Mm6cge6jC22zMJ00BaCfVY3FUbR8S6WqMg_78Iye1H36QuT97Wl2E1uS2.lc1Bf1FGx tQylOAEsrHqSupwSXSw0blBIwW6e414JaLA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.bf2.yahoo.com with HTTP; Sun, 1 Jul 2018 13:35:04 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp418.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 837bf48a2c504dcc024e050c984c14d9; Sun, 01 Jul 2018 13:35:01 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: head -r335782 (?) broke ci.freebsd.org's FreeBSD-head-amd64-gcc build (lib32 part of build) From: Mark Millard In-Reply-To: Date: Sun, 1 Jul 2018 06:34:58 -0700 Cc: Bryan Drewery , svn-src-head@freebsd.org, FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: <00D1127A-1F0E-4E0E-B86C-1C5AA5B2E085@yahoo.com> <7A845F2C-C994-4828-823D-33A97B7B6EB0@yahoo.com> <72081b02-cf23-82ec-32df-7f5793c35f57@FreeBSD.org> <003509F0-F2F4-4A43-82FE-3F6FC23D19D4@yahoo.com> <65b19cc4-eaf0-13ed-43e6-9f04a1f7f196@FreeBSD.org> <49BF6569-96A9-4104-BDE6-8BB94C0D9626@yahoo.com> To: John Baldwin , Dimitry Andric X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 13:35:11 -0000 My brain finally engaged for showing exactly what files are included for the gcc builds: the .meta files include that information explicitly (along with other files that are opened during the operation). amd64 is as I reported, just one header file from gcc: float.h . powerpc64 builds Lex/Lexer.cpp without defining __ALTIVEC__ and so is not including . Building without __ALTIVEC__ might be an error itself but would be a workaround for the altivec.h file name aliasing vs. search-path problem. The details from the .meta files for the amd64 float.h failure and the powerpc64 altivec.h issue follow. For the -r335782+ amd64 context: E 73559 /bin/sh R 73559 /etc/libmap.conf R 73559 /var/run/ld-elf.so.hints R 73559 /lib/libedit.so.7 R 73559 /lib/libc.so.7 R 73559 /lib/libncursesw.so.8 F 73559 73560 E 73560 /usr/local/bin/x86_64-unknown-freebsd12.0-gcc R 73560 /etc/libmap.conf R 73560 /var/run/ld-elf.so.hints R 73560 /usr/lib/libc++.so.1 R 73560 /lib/libcxxrt.so.1 R 73560 /lib/libm.so.5 R 73560 /lib/libc.so.7 R 73560 /lib/libgcc_s.so.1 F 73560 73561 E 73561 /usr/local/libexec/gcc/x86_64-unknown-freebsd12.0/6.4.0/cc1 R 73561 /etc/libmap.conf R 73561 /var/run/ld-elf.so.hints R 73561 /usr/local/lib/libmpc.so.3 R 73561 /usr/local/lib/libmpfr.so.6 R 73561 /usr/local/lib/libgmp.so.10 R 73561 /lib/libz.so.6 R 73561 /usr/lib/libc++.so.1 R 73561 /lib/libcxxrt.so.1 R 73561 /lib/libm.so.5 R 73561 /lib/libc.so.7 R 73561 /lib/libgcc_s.so.1 R 73561 /dev/urandom R 73561 /usr/src/lib/msun/src/catrigl.c F 73560 73562 E 73562 /usr/local/bin/x86_64-unknown-freebsd12.0-as R 73562 /etc/libmap.conf R 73562 /var/run/ld-elf.so.hints R 73562 /lib/libc.so.7 R 73562 catrigl.o W 73562 catrigl.o R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/cdefs.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/complex.h R 73561 = /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/float.h R 73561 /usr/src/lib/msun/ld80/invtrig.h R 73561 /usr/src/lib/libc/include/fpmath.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/endian.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/_types.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/machine/_types.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/x86/_types.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/machine/_limits.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/x86/_limits.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/machine/endian.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/x86/endian.h R 73561 /usr/src/lib/libc/i386/_fpmath.h R 73561 /usr/src/lib/msun/src/math.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/machine/_limits.h R 73561 /usr/src/lib/msun/src/math_private.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/types.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/machine/endian.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/_pthreadtypes.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/_stdint.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/select.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/_sigset.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/_timeval.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/timespec.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/sys/_timespec.h R 73561 = /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/obj-lib32/tm= p/usr/include/machine/endian.h R 73561 /usr/src/lib/msun/src/catrigl.c X 73562 0 0 X 73561 1 0 D 73560 catrigl.o X 73560 1 0 X 73559 1 0 Note that only one one file (float.h) comes from gcc. It would have to not be a file of a related set of files (very independent) for such to be coherent. As for my pre-existing powerpc64 build under -r335782+: It did not include altivec.h at all according to its Lex_Lexer.o.meta file. Apparently __ALTIVEC__ is not defined, as the code for the #include in Lex/Lexer.cpp is: #ifdef __SSE2__ #include #elif __ALTIVEC__ #include #undef bool #endif It did open the 3 files with /gcc/ in the path (2 being headers): /usr/local/libexec/gcc/powerpc64-unknown-freebsd12.0/6.4.0/cc1plus /usr/local/lib/gcc/powerpc64-unknown-freebsd12.0/6.4.0/include/stddef.h /usr/local/lib/gcc/powerpc64-unknown-freebsd12.0/6.4.0/include/stdint.h but no others that I noticed. For the amd64 -> powerpc64 cross build context: E 74651 /bin/sh R 74651 /etc/libmap.conf R 74651 /var/run/ld-elf.so.hints R 74651 /lib/libedit.so.7 R 74651 /lib/libc.so.7 R 74651 /lib/libncursesw.so.8 F 74651 74652 E 74652 /usr/local/bin/powerpc64-unknown-freebsd12.0-g++ R 74652 /etc/libmap.conf R 74652 /var/run/ld-elf.so.hints R 74652 /usr/lib/libc++.so.1 R 74652 /lib/libcxxrt.so.1 R 74652 /lib/libm.so.5 R 74652 /lib/libc.so.7 R 74652 /lib/libgcc_s.so.1 F 74652 74653 E 74653 = /usr/local/libexec/gcc/powerpc64-unknown-freebsd12.0/6.4.0/cc1plus F 74652 74654 R 74653 /etc/libmap.conf R 74653 /var/run/ld-elf.so.hints R 74653 /usr/local/lib/libmpc.so.3 R 74653 /usr/local/lib/libmpfr.so.6 R 74653 /usr/local/lib/libgmp.so.10 R 74653 /lib/libz.so.6 R 74653 /usr/lib/libc++.so.1 R 74653 /lib/libcxxrt.so.1 R 74653 /lib/libm.so.5 R 74653 /lib/libc.so.7 R 74653 /lib/libgcc_s.so.1 R 74653 /dev/urandom R 74653 /usr/src/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp E 74654 /usr/local/bin/powerpc64-unknown-freebsd12.0-as R 74654 /etc/libmap.conf R 74654 /var/run/ld-elf.so.hints R 74654 /lib/libc.so.7 D 74654 Lex/Lexer.o R 74654 Lex/Lexer.o W 74654 Lex/Lexer.o R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/CommentOptions.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/string R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__config R 74653 /usr/src/sys/sys/endian.h R 74653 /usr/src/sys/sys/cdefs.h R 74653 /usr/src/sys/sys/_types.h R 74653 /usr/src/sys/powerpc/include/_types.h R 74653 /usr/src/sys/powerpc/include/endian.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/pthread.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/string_view R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__string R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/algorithm R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/initializer_list R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cstddef R 74653 = /usr/local/lib/gcc/powerpc64-unknown-freebsd12.0/6.4.0/include/stddef.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__nullptr R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/type_traits R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cstring R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/string.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/string.h R 74653 /usr/src/sys/sys/_null.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/strings.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/xlocale/_strings.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/xlocale/_string.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/utility R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__tuple R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cstdint R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/stdint.h R 74653 = /usr/local/lib/gcc/powerpc64-unknown-freebsd12.0/6.4.0/include/stdint.h R 74653 /usr/src/sys/sys/stdint.h R 74653 /usr/src/sys/powerpc/include/_stdint.h R 74653 /usr/src/sys/sys/_stdint.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__debug R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/memory R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/typeinfo R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/exception R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cstdlib R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/stdlib.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/stdlib.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/new R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/limits R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/iterator R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/iosfwd R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/wchar.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/wchar.h R 74653 /usr/src/sys/powerpc/include/_limits.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/_ctype.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/runetype.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/xlocale/_wchar.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__functional_base R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/tuple R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/stdexcept R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/atomic R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cstdio R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/stdio.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/stdio.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cwchar R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cwctype R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cctype R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/ctype.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/ctype.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/xlocale/_ctype.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/wctype.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/wctype.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/xlocale/_ctype.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/wchar.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/vector R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__bit_reference R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/climits R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/limits.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/limits.h R 74653 /usr/src/sys/sys/limits.h R 74653 /usr/src/sys/sys/syslimits.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__split_buffer R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Basic/LLVM.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Casting.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Compiler.h R 74653 /usr/src/lib/clang/include/llvm/Config/llvm-config.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/type_traits.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/None.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/VersionTuple.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/Optional.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/AlignOf.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/Triple.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/Twine.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/SmallVector.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/iterator_range.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/MathExtras.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/SwapByteOrder.h R 74653 /usr/src/lib/clang/include/llvm/Support/DataTypes.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cmath R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/math.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/math.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cinttypes R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/inttypes.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/inttypes.h R 74653 /usr/src/sys/powerpc/include/_inttypes.h R 74653 /usr/src/sys/sys/stdint.h R 74653 /usr/src/sys/sys/types.h R 74653 /usr/src/sys/sys/_pthreadtypes.h R 74653 /usr/src/sys/sys/select.h R 74653 /usr/src/sys/sys/_sigset.h R 74653 /usr/src/sys/sys/_timeval.h R 74653 /usr/src/sys/sys/timespec.h R 74653 /usr/src/sys/sys/_timespec.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/ErrorHandling.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/StringRef.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/STLExtras.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/iterator.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/functional R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Visibility.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Linkage.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h R 74653 = /usr/src/contrib/llvm/include/llvm/Support/PointerLikeTypeTraits.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/OpenCLImageTypes.def= R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/OpenCLImageTypes.def= R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/OpenCLImageTypes.def= R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/OpenCLImageTypes.def= R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorLexer.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Lex/MultipleIncludeOpt.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Lex/Token.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/ArrayRef.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/Hashing.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Host.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/StringMap.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Allocator.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/array R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/tools/clang/lib/Lex/UnicodeCharSets.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/UnicodeCharRanges.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/SmallPtrSet.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/EpochTracker.h R 74653 /usr/src/lib/clang/include/llvm/Config/abi-breaking.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/ReverseIteration.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Debug.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Mutex.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Threading.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/ciso646 R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/mutex R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__mutex_base R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/chrono R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/ctime R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/time.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/xlocale/_time.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/ratio R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/system_error R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cerrno R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/errno.h R 74653 /usr/src/sys/sys/errno.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__threading_support R 74653 /usr/src/sys/sys/sched.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/MutexGuard.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/raw_ostream.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Basic/CharInfo.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/DenseMapInfo.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/SmallString.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/OperatorKinds.def R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/FileSystemOptions.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/VirtualFileSystem.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Chrono.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/FormatProviders.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/StringSwitch.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/include/llvm/Support/FormatVariadicDetails.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/NativeFormatting.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/ErrorOr.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/FileSystem.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Error.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/StringExtras.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/MD5.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Endian.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/stack R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/deque R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 /usr/src/contrib/llvm/include/llvm/Support/SourceMgr.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/MemoryBuffer.h R 74653 /usr/src/contrib/llvm/include/llvm-c/Types.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/CBindingWrapping.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/SMLoc.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/DenseMap.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/map R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__tree R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 /usr/src/contrib/llvm/include/llvm/ADT/BitVector.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/DenseSet.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/PointerIntPair.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Lex/LexDiagnostic.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/lib/clang/libclang/clang/Basic/DiagnosticCommonKinds.inc R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.de= f R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.de= f R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.de= f R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.de= f R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/OpenCLImageTypes.def= R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/list R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/__undef_macros R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/lib/clang/libclang/clang/Basic/DiagnosticLexKinds.inc R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/APFloat.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/APInt.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Basic/Module.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/PointerUnion.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/SetVector.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/FoldingSet.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Lex/ModuleLoader.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/TinyPtrVector.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Lex/Pragma.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Lex/PTHLexer.h R 74653 /usr/src/contrib/llvm/tools/clang/include/clang/Lex/TokenLexer.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/Registry.h R 74653 /usr/src/contrib/llvm/include/llvm/Support/DynamicLibrary.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/src/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorOptions.h R 74653 /usr/src/contrib/llvm/include/llvm/ADT/StringSet.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/set R 74653 /usr/src/contrib/llvm/include/llvm/Support/ConvertUTF.h R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/c++/v1/cassert R 74653 = /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.po= werpc64/tmp/usr/include/assert.h X 74653 0 0 X 74654 0 0 X 74652 0 0 X 74651 0 0 # Stop 1530379489.086422 # Bye bye =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sun Jul 1 13:50:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C692EFF7A39; Sun, 1 Jul 2018 13:50:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D7377084E; Sun, 1 Jul 2018 13:50:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44FBA1F8AE; Sun, 1 Jul 2018 13:50:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61Do7FH094018; Sun, 1 Jul 2018 13:50:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61Do7LE094017; Sun, 1 Jul 2018 13:50:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807011350.w61Do7LE094017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 1 Jul 2018 13:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335839 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 13:50:08 -0000 Author: bdrewery Date: Sun Jul 1 13:50:06 2018 New Revision: 335839 URL: https://svnweb.freebsd.org/changeset/base/335839 Log: Ignore _.universe-toolchain file. MFC after: 3 weeks X-MFC-with: r335711 Modified: Directory Properties: head/ (props changed) From owner-svn-src-head@freebsd.org Sun Jul 1 13:50:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D070FF7BC7; Sun, 1 Jul 2018 13:50:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3BB970998; Sun, 1 Jul 2018 13:50:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5C2F1F8AF; Sun, 1 Jul 2018 13:50:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61DobFa094077; Sun, 1 Jul 2018 13:50:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61Dob9Y094076; Sun, 1 Jul 2018 13:50:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807011350.w61Dob9Y094076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 1 Jul 2018 13:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335840 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 13:50:38 -0000 Author: bdrewery Date: Sun Jul 1 13:50:37 2018 New Revision: 335840 URL: https://svnweb.freebsd.org/changeset/base/335840 Log: Ignore _.universe-toolchain file. MFC after: 3 weeks X-MFC-with: r335711 Modified: head/.gitignore Modified: head/.gitignore ============================================================================== --- head/.gitignore Sun Jul 1 13:50:06 2018 (r335839) +++ head/.gitignore Sun Jul 1 13:50:37 2018 (r335840) @@ -1,4 +1,5 @@ _.tinderbox.* +_.universe-toolchain _.amd64.* _.arm.* _.arm64.* From owner-svn-src-head@freebsd.org Sun Jul 1 15:17:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D648BFF94F0; Sun, 1 Jul 2018 15:17:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8356572DC3; Sun, 1 Jul 2018 15:17:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63B4C20709; Sun, 1 Jul 2018 15:17:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61FHsi1039676; Sun, 1 Jul 2018 15:17:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61FHsmn039675; Sun, 1 Jul 2018 15:17:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201807011517.w61FHsmn039675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 1 Jul 2018 15:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335841 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 335841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 15:17:55 -0000 Author: kp Date: Sun Jul 1 15:17:53 2018 New Revision: 335841 URL: https://svnweb.freebsd.org/changeset/base/335841 Log: carp: Minor language improvements in the man page Submitted by: Massimiliano Stucchi Modified: head/share/man/man4/carp.4 Modified: head/share/man/man4/carp.4 ============================================================================== --- head/share/man/man4/carp.4 Sun Jul 1 13:50:37 2018 (r335840) +++ head/share/man/man4/carp.4 Sun Jul 1 15:17:53 2018 (r335841) @@ -84,7 +84,7 @@ An arbitrary number of virtual host IDs can be configu An arbitrary number of IPv4 or IPv6 addresses can be attached to a particular vhid. It is important that all hosts participating in a vhid have the same list -of prefixes configured on the vhid, since all prefixes are included in the +of prefixes configured on the vhid, since all the prefixes are included in the cryptographic checksum supplied in each advertisement. Multiple vhids running on one interface participate in master/backup elections independently. @@ -123,10 +123,10 @@ Values above 1 enable logging of bad packets. The default value is 1. .It Va net.inet.carp.demotion -This value shows current level of CARP demotion. +This value shows the current level of CARP demotion. The value is added to the actual advskew sent in announcements for all vhids. -At normal system operation the demotion factor is zero. +During normal system operation the demotion factor is zero. However, problematic conditions raise its level: when .Nm experiences problem with sending announcements, when an interface @@ -300,11 +300,11 @@ To see .Nm packets decoded in .Xr tcpdump 1 -output, one needs to specify +output, one needs to specify the .Fl T Ar carp option, otherwise .Xr tcpdump 1 -tries to interpret them as VRRP packets: +will interpret them as VRRP packets: .Bd -literal -offset indent tcpdump -npi vlan0 -T carp .Ed From owner-svn-src-head@freebsd.org Sun Jul 1 16:05:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1027FFA1DF; Sun, 1 Jul 2018 16:05:51 +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 65C1A742EA; Sun, 1 Jul 2018 16:05:51 +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 4159620EED; Sun, 1 Jul 2018 16:05:51 +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 w61G5pE8064787; Sun, 1 Jul 2018 16:05:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61G5psG064786; Sun, 1 Jul 2018 16:05:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201807011605.w61G5psG064786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 1 Jul 2018 16:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335842 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 16:05:52 -0000 Author: asomers Date: Sun Jul 1 16:05:50 2018 New Revision: 335842 URL: https://svnweb.freebsd.org/changeset/base/335842 Log: audit(4): add tests for procctl(2) Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16086 Modified: head/tests/sys/audit/process-control.c Modified: head/tests/sys/audit/process-control.c ============================================================================== --- head/tests/sys/audit/process-control.c Sun Jul 1 15:17:53 2018 (r335841) +++ head/tests/sys/audit/process-control.c Sun Jul 1 16:05:50 2018 (r335842) @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1423,6 +1424,54 @@ ATF_TC_CLEANUP(ktrace_failure, tc) } +ATF_TC_WITH_CLEANUP(procctl_success); +ATF_TC_HEAD(procctl_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "procctl(2) call"); +} + +ATF_TC_BODY(procctl_success, tc) +{ + pid = getpid(); + snprintf(pcregex, sizeof(pcregex), "procctl.*%d.*return,success", pid); + + struct procctl_reaper_status reapstat; + FILE *pipefd = setup(fds, auclass); + /* Retrieve information about the reaper of current process (pid) */ + ATF_REQUIRE_EQ(0, procctl(P_PID, pid, PROC_REAP_STATUS, &reapstat)); + check_audit(fds, pcregex, pipefd); +} + +ATF_TC_CLEANUP(procctl_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(procctl_failure); +ATF_TC_HEAD(procctl_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "procctl(2) call"); +} + +ATF_TC_BODY(procctl_failure, tc) +{ + pid = getpid(); + snprintf(pcregex, sizeof(pcregex), "procctl.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, procctl(-1, -1, -1, NULL)); + check_audit(fds, pcregex, pipefd); +} + +ATF_TC_CLEANUP(procctl_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, fork_success); @@ -1488,6 +1537,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace_failure); ATF_TP_ADD_TC(tp, ktrace_success); ATF_TP_ADD_TC(tp, ktrace_failure); + ATF_TP_ADD_TC(tp, procctl_success); + ATF_TP_ADD_TC(tp, procctl_failure); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Sun Jul 1 16:18:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D8DBFFA57F; Sun, 1 Jul 2018 16:18:39 +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 E3512748C7; Sun, 1 Jul 2018 16:18:38 +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 C070C21082; Sun, 1 Jul 2018 16:18:38 +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 w61GIciK069956; Sun, 1 Jul 2018 16:18:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61GIcV0069955; Sun, 1 Jul 2018 16:18:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807011618.w61GIcV0069955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 1 Jul 2018 16:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335843 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/portsnap/portsnap X-SVN-Commit-Revision: 335843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 16:18:39 -0000 Author: trasz Date: Sun Jul 1 16:18:38 2018 New Revision: 335843 URL: https://svnweb.freebsd.org/changeset/base/335843 Log: Add basic examples to portsnap(8). MFC after: 2 weeks Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.8 Sun Jul 1 16:05:50 2018 (r335842) +++ head/usr.sbin/portsnap/portsnap/portsnap.8 Sun Jul 1 16:18:38 2018 (r335843) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2016 +.Dd July 1, 2018 .Dt PORTSNAP 8 .Os FreeBSD .Sh NAME @@ -268,6 +268,15 @@ Default location where compressed snapshots are stored .It Pa /usr/ports Default location where the ports tree is extracted. .El +.Sh EXAMPLES +Fetch the snapshots and create the +.Xr ports 7 +tree under +.Pa /usr/ports : +.Dl Nm Ar fetch Ar extract +.Pp +Update the ports tree: +.Dl Nm Ar fetch Ar update .Sh SEE ALSO .Xr fetch 1 , .Xr sha256 1 , From owner-svn-src-head@freebsd.org Sun Jul 1 17:08:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27345FD00EB; Sun, 1 Jul 2018 17:08:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A83475F50; Sun, 1 Jul 2018 17:08:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f52.google.com with SMTP id o5-v6so8134511itc.1; Sun, 01 Jul 2018 10:08:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=B+WwLYvxiX8E0QyhilqYrnZ2XXmy9po9CTH3KlcJxFI=; b=RhiVcaxkXQrzy8gWbLG96tGhuM+jAycrXTaOmZq/59IslQHndcSTJamIgXIsn69Q3r WGis6ozh4wL5172BSBoEb7iXz9bfYe2GFzS319IgFzTetpRzBW2GfmhSNvLYDIPeC/21 7rVM0HBtn4VBTquAwxxNR5MBoRtlkPkyxa/A4qwsfMM7IYTpo7i54f4G/RQmKcpl7IP3 ULVpteUOeDqp8G4KXRcvVdE2uz7dXkPQM4cjZ+ZKwEc/INOFDUF/n3HdtigCjfpsHFIs rR7g5bFjdYqmuRHJi7uHpQ/QKcjLGCy0ZJwTi1NhV+22tOOW81lrYv/facE2epD9kJzZ OA4g== X-Gm-Message-State: APt69E2Mgb1C6pQqBg1cOfX3l15Y7F8W5HxXgzcuR4HTyqTRuIGFOqOd 6IeKREwviYOyE++VpDmkZj37Sjvt X-Google-Smtp-Source: AAOMgpdPaKzwzMEAnNM8G318VidYMOx3eZHtj56o1px9aGk04jQ8xk38JD9oOCKOmQ7v1XS4BtsG8w== X-Received: by 2002:a24:2495:: with SMTP id f143-v6mr7642654ita.37.1530464900777; Sun, 01 Jul 2018 10:08:20 -0700 (PDT) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com. [209.85.223.169]) by smtp.gmail.com with ESMTPSA id w4-v6sm1326199itb.31.2018.07.01.10.08.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 10:08:20 -0700 (PDT) Received: by mail-io0-f169.google.com with SMTP id t135-v6so12740838iof.7; Sun, 01 Jul 2018 10:08:19 -0700 (PDT) X-Received: by 2002:a6b:b0c5:: with SMTP id z188-v6mr8595982ioe.220.1530464899440; Sun, 01 Jul 2018 10:08:19 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:7e0a:0:0:0:0:0 with HTTP; Sun, 1 Jul 2018 10:08:18 -0700 (PDT) In-Reply-To: <201807010532.w615W44e042172@repo.freebsd.org> References: <201807010532.w615W44e042172@repo.freebsd.org> From: Conrad Meyer Date: Sun, 1 Jul 2018 10:08:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335836 - head/usr.bin/top To: Daichi GOTO Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 17:08:28 -0000 Hi Daichi, On Sat, Jun 30, 2018 at 10:32 PM, Daichi GOTO wrote: > Author: daichi > Date: Sun Jul 1 05:32:03 2018 > New Revision: 335836 > URL: https://svnweb.freebsd.org/changeset/base/335836 > > Log: > top(1) - support UTF-8 display > > ... > ============================================================================== > --- head/usr.bin/top/display.c Sun Jul 1 01:56:40 2018 (r335835) > +++ head/usr.bin/top/display.c Sun Jul 1 05:32:03 2018 (r335836) > @@ -1258,19 +1258,43 @@ line_update(char *old, char *new, int start, int line) > char * > printable(char str[]) > { > - char *ptr; > - char ch; > + char *ptr; > + char ch; > > - ptr = str; > - while ((ch = *ptr) != '\0') > - { > - if (!isprint(ch)) > - { > - *ptr = '?'; > + ptr = str; > + if (utf8flag) { > + while ((ch = *ptr) != '\0') { > + if (0x00 == (0x80 & ch)) { > + if (!isprint(ch)) { > + *ptr = '?'; > + } > + ++ptr; > + } else if (0xC0 == (0xE0 & ch)) { > + ++ptr; > + if ('\0' != *ptr) ++ptr; > + } else if (0xE0 == (0xF0 & ch)) { > + ++ptr; > + if ('\0' != *ptr) ++ptr; > + if ('\0' != *ptr) ++ptr; > + } else if (0xF0 == (0xF8 & ch)) { > + ++ptr; > + if ('\0' != *ptr) ++ptr; > + if ('\0' != *ptr) ++ptr; > + if ('\0' != *ptr) ++ptr; > + } else { > + *ptr = '?'; > + ++ptr; > + } > + } > + } else { > + while ((ch = *ptr) != '\0') { > + if (!isprint(ch)) { > + *ptr = '?'; > + } > + ptr++; > + } > } I don't think code to decode UTF-8 belongs in top(1). I don't know what the goal of this routine is, but I doubt this is the right way to accomplish it. For the strvisx portion it seems like support should be rolled into libc instead. (Also, the patch in phabricator does not seem to match what was committed.) Best, Conrad From owner-svn-src-head@freebsd.org Sun Jul 1 17:28:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8169BFD09D3; Sun, 1 Jul 2018 17:28: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 3407276A37; Sun, 1 Jul 2018 17:28: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 11CD621B9A; Sun, 1 Jul 2018 17:28: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 w61HSkbS006034; Sun, 1 Jul 2018 17:28:46 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61HSksA006032; Sun, 1 Jul 2018 17:28:46 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201807011728.w61HSksA006032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 1 Jul 2018 17:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335844 - in head: . sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: . sys/kern X-SVN-Commit-Revision: 335844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 17:28:47 -0000 Author: oshogbo Date: Sun Jul 1 17:28:46 2018 New Revision: 335844 URL: https://svnweb.freebsd.org/changeset/base/335844 Log: core(5): overwrite the oldest core dump The '%I' format in the kern.corefile sysctl limits the number of core files that a process can generate to the number stored in the debug.ncores sysctl. The '%I' format is replaced by the single digit index. Previously, if all indexes were taken the kernel would overwrite only a core file with the highest index in a filename. Currently the system will create a new core file if there is a free index or if all slots are taken it will overwrite the oldest one. Reviewed by: kib(code), bcr (updating) Differential Revision: https://reviews.freebsd.org/D15991 Differential Revision: https://reviews.freebsd.org/D16084 Modified: head/UPDATING head/sys/kern/kern_sig.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jul 1 16:18:38 2018 (r335843) +++ head/UPDATING Sun Jul 1 17:28:46 2018 (r335844) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180701: + The '%I' format in the kern.corefile sysctl limits the number of + core files that a process can generate to the number stored in the + debug.ncores sysctl. The '%I' format is replaced by the single digit + index. Previously, if all indexes were taken the kernel would overwrite + only a core file with the highest index in a filename. + Currently the system will create a new core file if there is a free + index or if all slots are taken it will overwrite the oldest one. 20180630: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Jul 1 16:18:38 2018 (r335843) +++ head/sys/kern/kern_sig.c Sun Jul 1 17:28:46 2018 (r335844) @@ -3299,7 +3299,89 @@ SYSCTL_PROC(_kern, OID_AUTO, corefile, CTLTYPE_STRING CTLFLAG_MPSAFE, 0, 0, sysctl_kern_corefile, "A", "Process corefile name format string"); +static void +vnode_close_locked(struct thread *td, struct vnode *vp) +{ + + VOP_UNLOCK(vp, 0); + vn_close(vp, FWRITE, td->td_ucred, td); +} + /* + * If the core format has a %I in it, then we need to check + * for existing corefiles before defining a name. + * To do this we iterate over 0..num_cores to find a + * non-existing core file name to use. If all core files are + * already used we choose the oldest one. + */ +static int +corefile_open_last(struct thread *td, char *name, int indexpos, + struct vnode **vpp) +{ + struct vnode *oldvp, *nextvp, *vp; + struct vattr vattr; + struct nameidata nd; + int error, i, flags, oflags, cmode; + struct timespec lasttime; + + nextvp = oldvp = NULL; + cmode = S_IRUSR | S_IWUSR; + oflags = VN_OPEN_NOAUDIT | VN_OPEN_NAMECACHE | + (capmode_coredump ? VN_OPEN_NOCAPCHECK : 0); + + for (i = 0; i < num_cores; i++) { + flags = O_CREAT | FWRITE | O_NOFOLLOW; + name[indexpos] = '0' + i; + + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); + error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, + NULL); + if (error != 0) + break; + + vp = nd.ni_vp; + NDFREE(&nd, NDF_ONLY_PNBUF); + if ((flags & O_CREAT) == O_CREAT) { + nextvp = vp; + break; + } + + error = VOP_GETATTR(vp, &vattr, td->td_ucred); + if (error != 0) { + vnode_close_locked(td, vp); + break; + } + + if (oldvp == NULL || + lasttime.tv_sec > vattr.va_mtime.tv_sec || + (lasttime.tv_sec == vattr.va_mtime.tv_sec && + lasttime.tv_nsec >= vattr.va_mtime.tv_nsec)) { + if (oldvp != NULL) + vnode_close_locked(td, oldvp); + oldvp = vp; + lasttime = vattr.va_mtime; + } else { + vnode_close_locked(td, vp); + } + } + + if (oldvp != NULL) { + if (nextvp == NULL) + nextvp = oldvp; + else + vnode_close_locked(td, oldvp); + } + if (error != 0) { + if (nextvp != NULL) + vnode_close_locked(td, oldvp); + } else { + *vpp = nextvp; + } + + return (error); +} + +/* * corefile_open(comm, uid, pid, td, compress, vpp, namep) * Expand the name described in corefilename, using name, uid, and pid * and open/create core file. @@ -3315,11 +3397,11 @@ static int corefile_open(const char *comm, uid_t uid, pid_t pid, struct thread *td, int compress, struct vnode **vpp, char **namep) { - struct nameidata nd; struct sbuf sb; + struct nameidata nd; const char *format; char *hostname, *name; - int indexpos, i, error, cmode, flags, oflags; + int cmode, error, flags, i, indexpos, oflags; hostname = NULL; format = corefilename; @@ -3385,48 +3467,36 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, sbuf_finish(&sb); sbuf_delete(&sb); - cmode = S_IRUSR | S_IWUSR; - oflags = VN_OPEN_NOAUDIT | VN_OPEN_NAMECACHE | - (capmode_coredump ? VN_OPEN_NOCAPCHECK : 0); - - /* - * If the core format has a %I in it, then we need to check - * for existing corefiles before returning a name. - * To do this we iterate over 0..num_cores to find a - * non-existing core file name to use. - */ if (indexpos != -1) { - for (i = 0; i < num_cores; i++) { - flags = O_CREAT | O_EXCL | FWRITE | O_NOFOLLOW; - name[indexpos] = '0' + i; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); - error = vn_open_cred(&nd, &flags, cmode, oflags, - td->td_ucred, NULL); - if (error) { - if (error == EEXIST) - continue; - log(LOG_ERR, - "pid %d (%s), uid (%u): Path `%s' failed " - "on initial open test, error = %d\n", - pid, comm, uid, name, error); - } - goto out; + error = corefile_open_last(td, name, indexpos, vpp); + if (error != 0) { + log(LOG_ERR, + "pid %d (%s), uid (%u): Path `%s' failed " + "on initial open test, error = %d\n", + pid, comm, uid, name, error); } + } else { + cmode = S_IRUSR | S_IWUSR; + oflags = VN_OPEN_NOAUDIT | VN_OPEN_NAMECACHE | + (capmode_coredump ? VN_OPEN_NOCAPCHECK : 0); + flags = O_CREAT | FWRITE | O_NOFOLLOW; + + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); + error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, + NULL); + if (error == 0) { + *vpp = nd.ni_vp; + NDFREE(&nd, NDF_ONLY_PNBUF); + } } - flags = O_CREAT | FWRITE | O_NOFOLLOW; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); - error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, NULL); -out: - if (error) { + if (error != 0) { #ifdef AUDIT audit_proc_coredump(td, name, error); #endif free(name, M_TEMP); return (error); } - NDFREE(&nd, NDF_ONLY_PNBUF); - *vpp = nd.ni_vp; *namep = name; return (0); } From owner-svn-src-head@freebsd.org Sun Jul 1 17:49:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6DC1FD0FBA; Sun, 1 Jul 2018 17:49:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56784772D5; Sun, 1 Jul 2018 17:49:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12DA721EEB; Sun, 1 Jul 2018 17:49:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61Hn23g016235; Sun, 1 Jul 2018 17:49:02 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61Hn2ZR016234; Sun, 1 Jul 2018 17:49:02 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807011749.w61Hn2ZR016234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 1 Jul 2018 17:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335845 - head/usr.sbin/pnfsdsfile X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/pnfsdsfile X-SVN-Commit-Revision: 335845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 17:49:04 -0000 Author: rmacklem Date: Sun Jul 1 17:49:02 2018 New Revision: 335845 URL: https://svnweb.freebsd.org/changeset/base/335845 Log: Add a new "-m" option to pnfsdsfile(8) to prepare a file for mirroring. When pnfsdscopymr(8) is used to create a mirror of a file on a mirrored pNFS service, it expects to find an entry in the extended attribute for IP address 0.0.0.0. This patch adds a "-m" option which can be used to create these entrie(s). It also tightens up the checks for use of incompatible command line options. Modified: head/usr.sbin/pnfsdsfile/pnfsdsfile.c Modified: head/usr.sbin/pnfsdsfile/pnfsdsfile.c ============================================================================== --- head/usr.sbin/pnfsdsfile/pnfsdsfile.c Sun Jul 1 17:28:46 2018 (r335844) +++ head/usr.sbin/pnfsdsfile/pnfsdsfile.c Sun Jul 1 17:49:02 2018 (r335845) @@ -50,6 +50,7 @@ static void usage(void); static struct option longopts[] = { { "changeds", required_argument, NULL, 'c' }, + { "mirror", required_argument, NULL, 'm' }, { "quiet", no_argument, NULL, 'q' }, { "zerods", required_argument, NULL, 'r' }, { "ds", required_argument, NULL, 's' }, @@ -71,27 +72,27 @@ main(int argc, char *argv[]) struct sockaddr_in6 *sin6, adsin6; char hostn[2 * NI_MAXHOST + 2], *cp; struct pnfsdsfile dsfile[NFSDEV_MAXMIRRORS]; - int ch, dosetxattr, i, mirrorcnt, quiet, zerods, zerofh; + int ch, dosetxattr, i, mirrorcnt, mirrorit, quiet, zerods, zerofh; in_port_t tport; ssize_t xattrsize, xattrsize2; zerods = 0; zerofh = 0; + mirrorit = 0; quiet = 0; dosetxattr = 0; res = NULL; newres = NULL; cp = NULL; - while ((ch = getopt_long(argc, argv, "c:qr:s:z", longopts, NULL)) != -1) - { + while ((ch = getopt_long(argc, argv, "c:m:qr:s:z", longopts, NULL)) != + -1) { switch (ch) { case 'c': /* Replace the first DS server with the second one. */ - if (zerofh != 0 || zerods != 0) - errx(1, "-c, -r and -z are mutually " - "exclusive"); - if (res != NULL) - errx(1, "-c and -s are mutually exclusive"); + if (zerofh != 0 || zerods != 0 || mirrorit != 0 || + newres != NULL || res != NULL) + errx(1, "-c, -m, -r, -s and -z are mutually " + "exclusive and only can be used once"); strlcpy(hostn, optarg, 2 * NI_MAXHOST + 2); cp = strchr(hostn, ','); if (cp == NULL) @@ -103,31 +104,44 @@ main(int argc, char *argv[]) if (getaddrinfo(cp, NULL, NULL, &newres) != 0) errx(1, "Can't get IP# for %s", cp); break; + case 'm': + /* Add 0.0.0.0 entries up to mirror level. */ + if (zerofh != 0 || zerods != 0 || mirrorit != 0 || + newres != NULL || res != NULL) + errx(1, "-c, -m, -r, -s and -z are mutually " + "exclusive and only can be used once"); + mirrorit = atoi(optarg); + if (mirrorit < 2 || mirrorit > NFSDEV_MAXMIRRORS) + errx(1, "-m %d out of range", mirrorit); + break; case 'q': quiet = 1; break; case 'r': /* Reset the DS server in a mirror with 0.0.0.0. */ - if (zerofh != 0 || res != NULL || newres != NULL) - errx(1, "-r and -s, -z or -c are mutually " - "exclusive"); + if (zerofh != 0 || zerods != 0 || mirrorit != 0 || + newres != NULL || res != NULL) + errx(1, "-c, -m, -r, -s and -z are mutually " + "exclusive and only can be used once"); zerods = 1; /* Translate the server name to an IP address. */ if (getaddrinfo(optarg, NULL, NULL, &res) != 0) errx(1, "Can't get IP# for %s", optarg); break; case 's': - if (res != NULL) - errx(1, "-s, -c and -r are mutually " - "exclusive"); /* Translate the server name to an IP address. */ + if (zerods != 0 || mirrorit != 0 || newres != NULL || + res != NULL) + errx(1, "-c, -m and -r are mutually exclusive " + "from use with -s and -z"); if (getaddrinfo(optarg, NULL, NULL, &res) != 0) errx(1, "Can't get IP# for %s", optarg); break; case 'z': - if (newres != NULL || zerods != 0) - errx(1, "-c, -r and -z are mutually " - "exclusive"); + if (zerofh != 0 || zerods != 0 || mirrorit != 0 || + newres != NULL) + errx(1, "-c, -m and -r are mutually exclusive " + "from use with -s and -z"); zerofh = 1; break; default: @@ -309,8 +323,26 @@ main(int argc, char *argv[]) dsfile[i].dsf_filename); } } + /* Add entrie(s) with IP address set to 0.0.0.0, as required. */ + for (i = mirrorcnt; i < mirrorit; i++) { + dsfile[i] = dsfile[0]; + dsfile[i].dsf_sin.sin_family = AF_INET; + dsfile[i].dsf_sin.sin_len = sizeof(struct sockaddr_in); + dsfile[i].dsf_sin.sin_addr.s_addr = 0; + dsfile[i].dsf_sin.sin_port = 0; + if (quiet == 0) { + /* Print out the 0.0.0.0 entry. */ + printf("\t0.0.0.0\tds%d/%s", dsfile[i].dsf_dir, + dsfile[i].dsf_filename); + } + } + if (mirrorit > mirrorcnt) { + xattrsize = mirrorit * sizeof(struct pnfsdsfile); + dosetxattr = 1; + } if (quiet == 0) printf("\n"); + if (dosetxattr != 0 && extattr_set_file(*argv, EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsfile", dsfile, xattrsize) != xattrsize) err(1, "Can't set pnfsd.dsfile"); From owner-svn-src-head@freebsd.org Sun Jul 1 17:51:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA626FD3230; Sun, 1 Jul 2018 17:51:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C0247753E; Sun, 1 Jul 2018 17:51:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D32021F5A; Sun, 1 Jul 2018 17:51:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61HprkR020093; Sun, 1 Jul 2018 17:51:53 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61HprBc020092; Sun, 1 Jul 2018 17:51:53 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807011751.w61HprBc020092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 1 Jul 2018 17:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335846 - head/usr.sbin/pnfsdsfile X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/pnfsdsfile X-SVN-Commit-Revision: 335846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 17:51:54 -0000 Author: rmacklem Date: Sun Jul 1 17:51:52 2018 New Revision: 335846 URL: https://svnweb.freebsd.org/changeset/base/335846 Log: Document the new "-m" command line option for pnfsdsfile(8). This is a content change. Modified: head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Modified: head/usr.sbin/pnfsdsfile/pnfsdsfile.8 ============================================================================== --- head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Sun Jul 1 17:49:02 2018 (r335845) +++ head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Sun Jul 1 17:51:52 2018 (r335846) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2018 +.Dd June 30, 2018 .Dt PNFSDSFILE 8 .Os .Sh NAME @@ -37,6 +37,7 @@ extended attribute for them .Op Fl qz .Op Fl s Ar dshostname .Op Fl c Ar old-dshostname,new-dshostname +.Op Fl m Ar mirror_level .Op Fl r Ar dshostname .Ar mdsfile .Sh DESCRIPTION @@ -91,6 +92,16 @@ or AF_INET6 address that returns for the new-dshostname. Changing a DS server's host IP# should be avoided, but this option will allow it to be changed, if the change is unavoidable. +.It Fl m Ar mirror_level +This option adds entrie(s) to the extended attributes with IP address set +to 0.0.0.0 to bring the number of entries up to +.Dq mirror_level . +It can be used by a system administrator to prepare a file for mirroring +via the +.Xr pnfsdscopymr +command with +.Fl r +option. .It Fl r Ar dshostname This option sets the IP address of the extended attribute entry for the .Ar dshostname From owner-svn-src-head@freebsd.org Sun Jul 1 18:09:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2784FD359E; Sun, 1 Jul 2018 18:09:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A16F577C1F; Sun, 1 Jul 2018 18:09:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EB0F2220F; Sun, 1 Jul 2018 18:09:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61I9HSX026187; Sun, 1 Jul 2018 18:09:17 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61I9HqX026185; Sun, 1 Jul 2018 18:09:17 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201807011809.w61I9HqX026185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 1 Jul 2018 18:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335847 - in head/sys/modules: pflog pfsync X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys/modules: pflog pfsync X-SVN-Commit-Revision: 335847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 18:09:18 -0000 Author: kp Date: Sun Jul 1 18:09:16 2018 New Revision: 335847 URL: https://svnweb.freebsd.org/changeset/base/335847 Log: pflog/pfsync: Fix module build with VIMAGE=yes pflog and pfsync's module Makefile fails to include opt_global.h to SRCS leading to build error for VIMAGE case. Reproduced with: cd /usr/src/sys/modules/pflog && make VIMAGE=yes PR: 229404 Submitted by: eugen@ MFC after: 1 week Modified: head/sys/modules/pflog/Makefile head/sys/modules/pfsync/Makefile Modified: head/sys/modules/pflog/Makefile ============================================================================== --- head/sys/modules/pflog/Makefile Sun Jul 1 17:51:52 2018 (r335846) +++ head/sys/modules/pflog/Makefile Sun Jul 1 18:09:16 2018 (r335847) @@ -4,7 +4,7 @@ KMOD= pflog SRCS= if_pflog.c \ - opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h + opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_global.h SRCS+= bus_if.h device_if.h .if !defined(KERNBUILDDIR) Modified: head/sys/modules/pfsync/Makefile ============================================================================== --- head/sys/modules/pfsync/Makefile Sun Jul 1 17:51:52 2018 (r335846) +++ head/sys/modules/pfsync/Makefile Sun Jul 1 18:09:16 2018 (r335847) @@ -4,7 +4,7 @@ KMOD= pfsync SRCS= if_pfsync.c \ - opt_pf.h opt_inet.h opt_inet6.h + opt_pf.h opt_inet.h opt_inet6.h opt_global.h SRCS+= bus_if.h device_if.h .if !defined(KERNBUILDDIR) From owner-svn-src-head@freebsd.org Sun Jul 1 18:10:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C8E7FD36C8; Sun, 1 Jul 2018 18:10:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E78E77E97; Sun, 1 Jul 2018 18:10:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f169.google.com with SMTP id l25-v6so12784379ioh.12; Sun, 01 Jul 2018 11:10:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=LJIWCcJJdsZpVeI3RpqSPaFqHB104bM9NHo+8ENFkfk=; b=RP57gYTNNWRgm6aG3nMX6/eVwE2rcryL20U31Sl259s4eTweajp9K2eMqkx648nUym jBntMKFXOwdRLq63U+Pwtj5XlqaeFcFyfhLBQcaE4gX40tMMUqKr2R8ISeFYWgAvhuUA aQcBWB0jJpFzCZfKWh2bXPvTr2g0UAs8AZcMFEhQn3rPAxNLCZ+UAxmOisgvn/gKtCty 5FF+4lp3Km1dz60dDA2HX/ya1ky3EQPt9bU8vP7ZksWZM25+l9lXtUQb7CqcXctyyTNz xASFm0lV9lP6/8xEnOdHebcGv0SlsJBeeCke2hIf1VCuO/6OVyTslOP5PppclkxE61xs zExg== X-Gm-Message-State: APt69E3HTlyn5hkXD+6firNMNgfB6KIX9lRJD7KQbtwMzNvp58TnvcyH 8ZSxlsh1vIPhFP+y7OB0d3FDQQtc X-Google-Smtp-Source: AAOMgpfjGftzkUXv9jpJMs4vPsoAzS0pcSdgiCZKpllUoE7JuaSGGVnYyuznKj+E8+ScGvl6rof1QA== X-Received: by 2002:a6b:6d14:: with SMTP id a20-v6mr3983938iod.27.1530465056071; Sun, 01 Jul 2018 10:10:56 -0700 (PDT) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com. [209.85.214.43]) by smtp.gmail.com with ESMTPSA id q11-v6sm3560340ita.15.2018.07.01.10.10.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 10:10:56 -0700 (PDT) Received: by mail-it0-f43.google.com with SMTP id o5-v6so8139300itc.1; Sun, 01 Jul 2018 10:10:55 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr3797753ith.53.1530465055820; Sun, 01 Jul 2018 10:10:55 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:7e0a:0:0:0:0:0 with HTTP; Sun, 1 Jul 2018 10:10:55 -0700 (PDT) In-Reply-To: References: <201807010532.w615W44e042172@repo.freebsd.org> From: Conrad Meyer Date: Sun, 1 Jul 2018 10:10:55 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335836 - head/usr.bin/top To: Daichi GOTO Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 18:10:28 -0000 On Sun, Jul 1, 2018 at 10:08 AM, Conrad Meyer wrote: > (Also, the patch in phabricator does not seem to match what was committed.) It seems the right phabricator URL is https://reviews.freebsd.org/D16058 . Best, Conrad From owner-svn-src-head@freebsd.org Sun Jul 1 18:58:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1125CFD45AB; Sun, 1 Jul 2018 18:58:55 +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 A4AB07987A; Sun, 1 Jul 2018 18:58:54 +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 808AC22A03; Sun, 1 Jul 2018 18:58:54 +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 w61Iwsd3051657; Sun, 1 Jul 2018 18:58:54 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61IwsmG051656; Sun, 1 Jul 2018 18:58:54 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201807011858.w61IwsmG051656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 1 Jul 2018 18:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335848 - in head/lib: libcapsicum libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/lib: libcapsicum libcasper/libcasper X-SVN-Commit-Revision: 335848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 18:58:55 -0000 Author: oshogbo Date: Sun Jul 1 18:58:53 2018 New Revision: 335848 URL: https://svnweb.freebsd.org/changeset/base/335848 Log: With r335636 C++ program use libcasper.h and capsicum_helpers.h. Add __BEGIN_DECLS and __END_DECLS to those headers. Modified: head/lib/libcapsicum/capsicum_helpers.h head/lib/libcasper/libcasper/libcasper.h Modified: head/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.h Sun Jul 1 18:09:16 2018 (r335847) +++ head/lib/libcapsicum/capsicum_helpers.h Sun Jul 1 18:58:53 2018 (r335848) @@ -46,6 +46,8 @@ #define CAPH_WRITE 0x0004 #define CAPH_LOOKUP 0x0008 +__BEGIN_DECLS + static __inline int caph_limit_stream(int fd, int flags) { @@ -141,5 +143,7 @@ caph_enter_casper(void) return (CASPER_SUPPORT == 0 ? 0 : caph_enter()); } + +__END_DECLS #endif /* _CAPSICUM_HELPERS_H_ */ Modified: head/lib/libcasper/libcasper/libcasper.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper.h Sun Jul 1 18:09:16 2018 (r335847) +++ head/lib/libcasper/libcasper/libcasper.h Sun Jul 1 18:58:53 2018 (r335848) @@ -71,6 +71,8 @@ typedef struct cap_channel cap_channel_t; #endif /* ! WITH_CASPER */ #endif /* ! _CAP_CHANNEL_T_DECLARED */ +__BEGIN_DECLS + #ifdef WITH_CASPER int cap_channel_flags(const cap_channel_t *chan); #else @@ -278,5 +280,7 @@ cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *n return (nvlist_create(channel_nvlist_flags(chan))); } #endif + +__END_DECLS #endif /* !_LIBCASPER_H_ */ From owner-svn-src-head@freebsd.org Sun Jul 1 19:44:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBB34FD5547; Sun, 1 Jul 2018 19:44:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98A9B7AD7C; Sun, 1 Jul 2018 19:44:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79F2323200; Sun, 1 Jul 2018 19:44:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61JiTp9076846; Sun, 1 Jul 2018 19:44:29 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61JiTqb076845; Sun, 1 Jul 2018 19:44:29 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201807011944.w61JiTqb076845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 1 Jul 2018 19:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335850 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 19:44:30 -0000 Author: eadler Date: Sun Jul 1 19:44:29 2018 New Revision: 335850 URL: https://svnweb.freebsd.org/changeset/base/335850 Log: top(1): permit infinite length for command There isn't any need to limit the size of the screen. Utilities like 'less -S' don't have a (meaningful) limit anyways. This also makes the way to dynamically changing the column widths based on the screen width. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Jul 1 19:44:26 2018 (r335849) +++ head/usr.bin/top/machine.c Sun Jul 1 19:44:29 2018 (r335850) @@ -59,7 +59,6 @@ static const int namelength = 10; /* TOP_JID_LEN based on max of 999999 */ #define TOP_JID_LEN 6 #define TOP_SWAP_LEN 5 -static int cmdlengthdelta; /* get_process_info passes back a handle. This is what it looks like: */ @@ -415,7 +414,6 @@ format_header(const char *uname_field) assert("displaymode must not be set to DISP_MAX"); } - cmdlengthdelta = sbuf_len(header) - 7; return sbuf_data(header); } @@ -1091,10 +1089,7 @@ format_next_process(struct handle * xhandle, char *(*g sbuf_printf(procbuf, "%6s ", format_time(cputime)); sbuf_printf(procbuf, "%6.2f%% ", ps.wcpu ? 100.0 * weighted_cpu(PCTCPU(pp), pp) : 100.0 * PCTCPU(pp)); } - sbuf_printf(procbuf, "%.*s", - screen_width > cmdlengthdelta ? - screen_width - cmdlengthdelta : 0, - printable(cmdbuf)); + sbuf_printf(procbuf, "%s", printable(cmdbuf)); free(cmdbuf); return (sbuf_data(procbuf)); } From owner-svn-src-head@freebsd.org Sun Jul 1 19:44:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA8F7FD5531; Sun, 1 Jul 2018 19:44:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1ED7AD79; Sun, 1 Jul 2018 19:44:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33131231FF; Sun, 1 Jul 2018 19:44:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61JiQcM076803; Sun, 1 Jul 2018 19:44:26 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61JiQA0076802; Sun, 1 Jul 2018 19:44:26 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201807011944.w61JiQA0076802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 1 Jul 2018 19:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335849 - head/usr.bin/find X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/find X-SVN-Commit-Revision: 335849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 19:44:27 -0000 Author: eadler Date: Sun Jul 1 19:44:26 2018 New Revision: 335849 URL: https://svnweb.freebsd.org/changeset/base/335849 Log: find(1): remove portability ifdefs This code isn't designed to be particularly portable outside of FreeBSD. To be more specific it doesn't make much sense to support compiling find(1) on VMS. Modified: head/usr.bin/find/getdate.y Modified: head/usr.bin/find/getdate.y ============================================================================== --- head/usr.bin/find/getdate.y Sun Jul 1 18:58:53 2018 (r335848) +++ head/usr.bin/find/getdate.y Sun Jul 1 19:44:26 2018 (r335849) @@ -23,22 +23,11 @@ __FBSDID("$FreeBSD$"); tricks are need, but defaults to using the gettimeofday system call. Include if that will be used. */ -#if defined(vms) -# include -#else /* defined(vms) */ # include # include -#endif /* !defined(vms) */ #if defined (__STDC__) || defined (USG) #include -#endif - -/* Some old versions of bison generate parsers that use bcopy. - That loses on systems that don't provide the function, so we have - to redefine it here. */ -#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy) -#define bcopy(from, to, len) memcpy ((to), (from), (len)) #endif #if defined (__STDC__) From owner-svn-src-head@freebsd.org Sun Jul 1 19:47:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C89D5FD5732 for ; Sun, 1 Jul 2018 19:47:21 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6437F7B0BD for ; Sun, 1 Jul 2018 19:47:21 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22c.google.com with SMTP id g123-v6so5980480ywf.13 for ; Sun, 01 Jul 2018 12:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=l1T7lhu9bqcnHtRuyPXVIUIh0TtiHxFzWTqQQ38KPvE=; b=mvgNxEVrCyt2OtHEcl6NUxA/bQapA7OSTqGPTv6lCQp+G6xlAf9ZmiYrRFney94Edy DqcMGtna+sO8o3SjcqpbmhjnEemF579FzDOoUXklZktLQ1Ip1V20GZg25/GC4EYnMrQM Sn/2Scup2A3yBiVWWaz8JO8FNPQ5//RyADxiQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=l1T7lhu9bqcnHtRuyPXVIUIh0TtiHxFzWTqQQ38KPvE=; b=U7E43hFzKUPyc+R9vZgvLsf8+bfUtwmK2DsU+B+L2vScJVcT401CXmR1SePvOZiGSG Yf1NRtKRu28UTUdrG/3qJD1BW4zDOx5tADatL4zF5Q6VIX0QHDBZr+uPAlOYYv5OnWx+ 1gHwvyuhCGUI3s/m8pVTzK0Kysf4unjf0eZLYNSqpN/xbfgU7/a5bua1lEjmoeVbFKKC 2nBP+BCEYIwRKlj7VbVwd8qyI6lWoHwIKZ2hj50xw56qtXhvH4ESugOhFnbxOztS/s4k 0iqFdYM7hT6amJIsCTLgfZ7oBpyEwRet0VJ6n1lBbf+Go1Vb2QeLnBmHiyqRd8Hv4mCJ R8Rg== X-Gm-Message-State: APt69E21cuEOyRCu0bF1s5EcGthM/ZAgZv9T/2BDLhuE3rnOdrh3kKNL YKe87nCmRiqOHdmV7HGCmheRAvxWxXIYkTB6+FmhyNzj X-Google-Smtp-Source: AAOMgpd7uQ9/+R0z0I2SdaDMbNM3T9pPu46tXzjL+qXsvbi0qZ4Z3sSWQ4s2xYRSyrEyMRrLCpVsJsKjw/tX+Q5O+Yw= X-Received: by 2002:a81:2c56:: with SMTP id s83-v6mr11252572yws.387.1530474440438; Sun, 01 Jul 2018 12:47:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:870e:0:0:0:0:0 with HTTP; Sun, 1 Jul 2018 12:46:49 -0700 (PDT) In-Reply-To: References: <201807010532.w615W44e042172@repo.freebsd.org> From: Eitan Adler Date: Sun, 1 Jul 2018 12:46:49 -0700 Message-ID: Subject: Re: svn commit: r335836 - head/usr.bin/top To: "Conrad E. Meyer" Cc: Daichi GOTO , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 19:47:22 -0000 On 1 July 2018 at 10:08, Conrad Meyer wrote: > Hi Daichi, > > > > I don't think code to decode UTF-8 belongs in top(1). I don't know > what the goal of this routine is, but I doubt this is the right way to > accomplish it. For the record, I agree. This is why I didn't click "accept" on the revision. I don't fully oppose leaving it in top(1) for now as we work out the API, but long term its the wrong place. https://reviews.freebsd.org/D16058 is the review. -- Eitan Adler From owner-svn-src-head@freebsd.org Sun Jul 1 20:09:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E57CFDA503; Sun, 1 Jul 2018 20:09:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3EBE7BDB2; Sun, 1 Jul 2018 20:09:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0FE823547; Sun, 1 Jul 2018 20:09:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61K9sfh087395; Sun, 1 Jul 2018 20:09:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61K9riY087388; Sun, 1 Jul 2018 20:09:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201807012009.w61K9riY087388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 1 Jul 2018 20:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335851 - head/usr.bin/find X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/find X-SVN-Commit-Revision: 335851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 20:09:55 -0000 Author: eadler Date: Sun Jul 1 20:09:52 2018 New Revision: 335851 URL: https://svnweb.freebsd.org/changeset/base/335851 Log: find(1): deLINTify Modified: head/usr.bin/find/find.c head/usr.bin/find/function.c head/usr.bin/find/ls.c head/usr.bin/find/main.c head/usr.bin/find/misc.c head/usr.bin/find/operator.c head/usr.bin/find/option.c Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Sun Jul 1 19:44:29 2018 (r335850) +++ head/usr.bin/find/find.c Sun Jul 1 20:09:52 2018 (r335851) @@ -32,12 +32,10 @@ * SUCH DAMAGE. */ -#ifndef lint #if 0 static char sccsid[] = "@(#)find.c 8.5 (Berkeley) 8/5/94"; #else #endif -#endif /* not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sun Jul 1 19:44:29 2018 (r335850) +++ head/usr.bin/find/function.c Sun Jul 1 20:09:52 2018 (r335851) @@ -32,11 +32,9 @@ * SUCH DAMAGE. */ -#ifndef lint #if 0 static const char sccsid[] = "@(#)function.c 8.10 (Berkeley) 5/4/95"; #endif -#endif /* not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Sun Jul 1 19:44:29 2018 (r335850) +++ head/usr.bin/find/ls.c Sun Jul 1 20:09:52 2018 (r335851) @@ -29,11 +29,9 @@ * SUCH DAMAGE. */ -#ifndef lint #if 0 static char sccsid[] = "@(#)ls.c 8.1 (Berkeley) 6/6/93"; #endif -#endif /* not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/usr.bin/find/main.c ============================================================================== --- head/usr.bin/find/main.c Sun Jul 1 19:44:29 2018 (r335850) +++ head/usr.bin/find/main.c Sun Jul 1 20:09:52 2018 (r335851) @@ -32,17 +32,13 @@ * SUCH DAMAGE. */ -#ifndef lint static const char copyright[] = "@(#) Copyright (c) 1990, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ -#ifndef lint #if 0 static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95"; #endif -#endif /* not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/usr.bin/find/misc.c ============================================================================== --- head/usr.bin/find/misc.c Sun Jul 1 19:44:29 2018 (r335850) +++ head/usr.bin/find/misc.c Sun Jul 1 20:09:52 2018 (r335851) @@ -32,12 +32,10 @@ * SUCH DAMAGE. */ -#ifndef lint #if 0 static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/1/94"; #else #endif -#endif /* not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/usr.bin/find/operator.c ============================================================================== --- head/usr.bin/find/operator.c Sun Jul 1 19:44:29 2018 (r335850) +++ head/usr.bin/find/operator.c Sun Jul 1 20:09:52 2018 (r335851) @@ -32,11 +32,9 @@ * SUCH DAMAGE. */ -#ifndef lint #if 0 static char sccsid[] = "@(#)operator.c 8.1 (Berkeley) 6/6/93"; #endif -#endif /* not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Sun Jul 1 19:44:29 2018 (r335850) +++ head/usr.bin/find/option.c Sun Jul 1 20:09:52 2018 (r335851) @@ -32,11 +32,9 @@ * SUCH DAMAGE. */ -#ifndef lint /* static char sccsid[] = "@(#)option.c 8.2 (Berkeley) 4/16/94"; */ -#endif /* not lint */ #include __FBSDID("$FreeBSD$"); From owner-svn-src-head@freebsd.org Sun Jul 1 20:09:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C349BFDA525; Sun, 1 Jul 2018 20:09:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7042E7BDB6; Sun, 1 Jul 2018 20:09:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5173623548; Sun, 1 Jul 2018 20:09:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61K9vVr087441; Sun, 1 Jul 2018 20:09:57 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61K9vQd087440; Sun, 1 Jul 2018 20:09:57 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201807012009.w61K9vQd087440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 1 Jul 2018 20:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335852 - head/usr.bin/find X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/find X-SVN-Commit-Revision: 335852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 20:09:57 -0000 Author: eadler Date: Sun Jul 1 20:09:56 2018 New Revision: 335852 URL: https://svnweb.freebsd.org/changeset/base/335852 Log: find(1): use correct type for readlink Modified: head/usr.bin/find/ls.c Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Sun Jul 1 20:09:52 2018 (r335851) +++ head/usr.bin/find/ls.c Sun Jul 1 20:09:56 2018 (r335852) @@ -110,7 +110,7 @@ printtime(time_t ftime) static void printlink(char *name) { - int lnklen; + ssize_t lnklen; char path[MAXPATHLEN]; if ((lnklen = readlink(name, path, MAXPATHLEN - 1)) == -1) { From owner-svn-src-head@freebsd.org Sun Jul 1 22:48:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66DB5FE401D; Sun, 1 Jul 2018 22:48:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF67A820BA; Sun, 1 Jul 2018 22:48:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC7C124F29; Sun, 1 Jul 2018 22:48:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61Mm0eB068741; Sun, 1 Jul 2018 22:48:00 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61Mm0a4068740; Sun, 1 Jul 2018 22:48:00 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201807012248.w61Mm0a4068740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 1 Jul 2018 22:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335854 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 335854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 22:48:01 -0000 Author: gonzo Date: Sun Jul 1 22:48:00 2018 New Revision: 335854 URL: https://svnweb.freebsd.org/changeset/base/335854 Log: [man] Get uhid(4) man page in sync with current API API documented in previous version of uhid(4) man page has been obsolete since May 2009 when old USB stack was replaced with USB2 implentation. Current API has the same set of ioctl calls but uses usb_gen_descriptor structure to pass data to/from kernel. MFC after: 1 week Modified: head/share/man/man4/uhid.4 Modified: head/share/man/man4/uhid.4 ============================================================================== --- head/share/man/man4/uhid.4 Sun Jul 1 20:52:50 2018 (r335853) +++ head/share/man/man4/uhid.4 Sun Jul 1 22:48:00 2018 (r335854) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd July 1, 2018 .Dt UHID 4 .Os .Sh NAME @@ -61,17 +61,28 @@ calls: .Bl -tag -width indent .It Dv USB_GET_REPORT_ID Pq Vt int Get the report identifier used by this HID report. -.It Dv USB_GET_REPORT_DESC Pq Vt "struct usb_ctl_report_desc" +.It Dv USB_GET_REPORT_DESC Pq Vt "struct usb_gen_descriptor" Get the HID report descriptor. +Copies a maximum of +.Va ugd_maxlen +bytes of the report descriptor data into the memory +specified by +.Va ugd_data . +Upon return +.Va ugd_actlen +is set to the number of bytes copied. Using this descriptor the exact layout and meaning of data to/from the device can be found. The report descriptor is delivered without any processing. .Bd -literal -struct usb_ctl_report_desc { - int ucrd_size; - u_char ucrd_data[1024]; /* filled data size will vary */ +struct usb_gen_descriptor { + void *ugd_data; + uint16_t ugd_maxlen; + uint16_t ugd_actlen; + uint8_t ugd_report_type; + ... }; .Ed .It Dv USB_SET_IMMED Pq Vt int @@ -85,11 +96,18 @@ will only return the data that the device reports on i interrupt pipe. This call may fail if the device does not support this feature. -.It Dv USB_GET_REPORT Pq Vt "struct usb_ctl_report" +.It Dv USB_GET_REPORT Pq Vt "struct usb_gen_descriptor" Get a report from the device without waiting for data on the interrupt pipe. +Copies a maximum of +.Va ugd_maxlen +bytes of the report data into the memory specified by +.Va ugd_data . +Upon return +.Va ugd_actlen +is set to the number of bytes copied. The -.Va report +.Va ugd_report_type field indicates which report is requested. It should be .Dv UHID_INPUT_REPORT , @@ -97,22 +115,21 @@ It should be or .Dv UHID_FEATURE_REPORT . This call may fail if the device does not support this feature. -.Bd -literal -struct usb_ctl_report { - int ucr_report; - u_char ucr_data[1024]; /* used data size will vary */ -}; -.Ed -.It Dv USB_SET_REPORT Pq Vt "struct usb_ctl_report" +.It Dv USB_SET_REPORT Pq Vt "struct usb_gen_descriptor" Set a report in the device. The -.Va report +.Va ugd_report_type field indicates which report is to be set. It should be .Dv UHID_INPUT_REPORT , .Dv UHID_OUTPUT_REPORT , or .Dv UHID_FEATURE_REPORT . +The value of the report is specified by the +.Va ugd_data +and the +.Va ugd_maxlen +fields. This call may fail if the device does not support this feature. .El .Pp From owner-svn-src-head@freebsd.org Mon Jul 2 01:30:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BFB0FFAC10; Mon, 2 Jul 2018 01:30:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE92E89082; Mon, 2 Jul 2018 01:30:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFD0F268A8; Mon, 2 Jul 2018 01:30:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w621UX1t050538; Mon, 2 Jul 2018 01:30:33 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w621UXNw050537; Mon, 2 Jul 2018 01:30:33 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201807020130.w621UXNw050537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Jul 2018 01:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335855 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 335855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 01:30:34 -0000 Author: gonzo Date: Mon Jul 2 01:30:33 2018 New Revision: 335855 URL: https://svnweb.freebsd.org/changeset/base/335855 Log: [rpi] Add support for the second PWM channel Add support for the second channel to bcm2835_pwm driver. Configurable parameters like mode, period, ratio are exposed as sysctls with postfix '2', e.g.: dev.pwm.N.mode2, dev.pwm.N.period2, dev.pwm.N.ratio2 Second channel can be enabled in DTB by configuring pwn-2chan overlay instead of pwm in config.txt. See [1] [1] https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README Submitted by: Bob Frazier Differential Revision: https://reviews.freebsd.org/D15769 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sun Jul 1 22:48:00 2018 (r335854) +++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Mon Jul 2 01:30:33 2018 (r335855) @@ -63,11 +63,13 @@ struct bcm_pwm_softc { device_t clkman; - uint32_t freq; - uint32_t period; + uint32_t freq; /* shared between channels 1 and 2 */ + uint32_t period; /* channel 1 */ uint32_t ratio; uint32_t mode; - + uint32_t period2; /* channel 2 */ + uint32_t ratio2; + uint32_t mode2; }; #define BCM_PWM_MEM_WRITE(_sc, _off, _val) \ @@ -87,11 +89,15 @@ struct bcm_pwm_softc { #define R_RNG(_sc) BCM_PWM_MEM_READ(_sc, 0x10) #define W_DAT(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x14, _val) #define R_DAT(_sc) BCM_PWM_MEM_READ(_sc, 0x14) +#define W_RNG2(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x20, _val) +#define R_RNG2(_sc) BCM_PWM_MEM_READ(_sc, 0x20) +#define W_DAT2(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x24, _val) +#define R_DAT2(_sc) BCM_PWM_MEM_READ(_sc, 0x24) static int bcm_pwm_reconf(struct bcm_pwm_softc *sc) { - uint32_t u; + uint32_t u, ctlr; /* Disable PWM */ W_CTL(sc, 0); @@ -99,26 +105,78 @@ bcm_pwm_reconf(struct bcm_pwm_softc *sc) /* Stop PWM clock */ (void)bcm2835_clkman_set_frequency(sc->clkman, BCM_PWM_CLKSRC, 0); - if (sc->mode == 0) - return (0); + ctlr = 0; /* pre-assign zero, enable bits, write to CTL at end */ + if (sc->mode == 0 && sc->mode2 == 0) /* both modes are zero */ + return 0; /* device is now off - return */ + + /* set the PWM clock frequency */ + /* TODO: should I only do this if it changes and not stop it first? */ u = bcm2835_clkman_set_frequency(sc->clkman, BCM_PWM_CLKSRC, sc->freq); if (u == 0) return (EINVAL); sc->freq = u; - /* Config PWM */ - W_RNG(sc, sc->period); - if (sc->ratio > sc->period) - sc->ratio = sc->period; - W_DAT(sc, sc->ratio); + /* control register CTL bits: + * (from BCM2835 ARM Peripherals manual, section 9.6) + * + * 15 MSEN2 chan 2 M/S enable; 0 for PWM algo, 1 for M/S transmission + * 14 unused; always reads as 0 + * 13 USEF2 chan 2 use FIFO (0 uses data; 1 uses FIFO) + * 12 POLA2 chan 2 invert polarity (0 normal, 1 inverted polarity) + * 11 SBIT2 chan 2 'Silence' bit (when not transmitting data) + * 10 RPTL2 chan 2 FIFO repeat last data (1 repeats, 0 interrupts) + * 9 MODE2 chan 2 PWM/Serializer mode (0 PWM, 1 Serializer) + * 8 PWEN2 chan 2 enable (0 disable, 1 enable) + * 7 MSEN1 chan 1 M/S enable; 0 for PWM algo, 1 for M/S transmission + * 6 CLRF1 chan 1 clear FIFO (set 1 to clear; always reads as 0) + * 5 USEF1 chan 1 use FIFO (0 uses data; 1 uses FIFO) + * 4 POLA1 chan 1 invert polarity (0 normal, 1 inverted polarity) + * 3 SBIT1 chan 1 'Silence' bit (when not transmitting data) + * 2 RTPL1 chan 1 FIFO repeat last data (1 repeats, 0 interrupts) + * 1 MODE1 chan 1 PWM/Serializer mode (0 PWM, 1 Serializer) + * 0 PWMEN1 chan 1 enable (0 disable, 1 enable) + * + * Notes on M/S enable: when this bit is '1', a simple M/S ratio is used. In short, + * the value of 'ratio' is the number of 'on' bits, and the total length of the data is + * defined by 'period'. So if 'ratio' is 2500 and 'period' is 10000, then the output + * remains 'on' for 2500 clocks, and goes 'off' for the remaining 7500 clocks. + * When the M/S enable is '0', a more complicated algorithm effectively 'dithers' the + * pulses in order to obtain the desired ratio. For details, see section 9.3 of the + * BCM2835 ARM Peripherals manual. + */ - /* Start PWM */ - if (sc->mode == 1) - W_CTL(sc, 0x81); - else - W_CTL(sc, 0x1); + if (sc->mode != 0) { + /* Config PWM Channel 1 */ + W_RNG(sc, sc->period); + if (sc->ratio > sc->period) + sc->ratio = sc->period; + W_DAT(sc, sc->ratio); + /* Start PWM Channel 1 */ + if (sc->mode == 1) + ctlr |= 0x81; /* chan 1 enable + chan 1 M/S enable */ + else + ctlr |= 0x1; /* chan 1 enable */ + } + + if (sc->mode2 != 0) { + /* Config PWM Channel 2 */ + W_RNG2(sc, sc->period2); + if (sc->ratio2 > sc->period2) + sc->ratio2 = sc->period2; + W_DAT2(sc, sc->ratio2); + + /* Start PWM Channel 2 */ + if (sc->mode2 == 1) + ctlr |= 0x8100; /* chan 2 enable + chan 2 M/S enable */ + else + ctlr |= 0x100; /* chan 2 enable */ + } + + /* write CTL register with updated value */ + W_CTL(sc, ctlr); + return (0); } @@ -138,7 +196,6 @@ bcm_pwm_pwm_freq_proc(SYSCTL_HANDLER_ARGS) return (error); } - static int bcm_pwm_mode_proc(SYSCTL_HANDLER_ARGS) { @@ -203,11 +260,77 @@ bcm_pwm_ratio_proc(SYSCTL_HANDLER_ARGS) if (r > sc->period) // XXX >= ? return (EINVAL); sc->ratio = r; - BCM_PWM_MEM_WRITE(sc, 0x14, sc->ratio); + W_DAT(sc, sc->ratio); return (0); } static int +bcm_pwm_pwm_freq2_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + uint32_t r; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + if (sc->mode2 == 1) + r = sc->freq / sc->period2; + else + r = 0; + error = sysctl_handle_int(oidp, &r, sizeof(r), req); + return (error); +} + +static int +bcm_pwm_mode2_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + uint32_t r; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + r = sc->mode2; + error = sysctl_handle_int(oidp, &r, sizeof(r), req); + if (error != 0 || req->newptr == NULL) + return (error); + if (r > 2) + return (EINVAL); + sc->mode2 = r; + return (bcm_pwm_reconf(sc)); +} + +static int +bcm_pwm_period2_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + error = sysctl_handle_int(oidp, &sc->period2, sizeof(sc->period2), req); + if (error != 0 || req->newptr == NULL) + return (error); + return (bcm_pwm_reconf(sc)); +} + +static int +bcm_pwm_ratio2_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + uint32_t r; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + r = sc->ratio2; + error = sysctl_handle_int(oidp, &r, sizeof(r), req); + if (error != 0 || req->newptr == NULL) + return (error); + if (r > sc->period2) // XXX >= ? + return (EINVAL); + sc->ratio2 = r; + W_DAT(sc, sc->ratio2); + return (0); +} + +static int bcm_pwm_reg_proc(SYSCTL_HANDLER_ARGS) { struct bcm_pwm_softc *sc; @@ -257,19 +380,31 @@ bcm_pwm_sysctl_init(struct bcm_pwm_softc *sc) SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "pwm_freq", CTLFLAG_RD | CTLTYPE_UINT, sc, 0, - bcm_pwm_pwm_freq_proc, "IU", "PWM frequency (Hz)"); + bcm_pwm_pwm_freq_proc, "IU", "PWM frequency ch 1 (Hz)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "period", CTLFLAG_RW | CTLTYPE_UINT, sc, 0, - bcm_pwm_period_proc, "IU", "PWM period (#clocks)"); + bcm_pwm_period_proc, "IU", "PWM period ch 1 (#clocks)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "ratio", CTLFLAG_RW | CTLTYPE_UINT, sc, 0, - bcm_pwm_ratio_proc, "IU", "PWM ratio (0...period)"); + bcm_pwm_ratio_proc, "IU", "PWM ratio ch 1 (0...period)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "freq", CTLFLAG_RW | CTLTYPE_UINT, sc, 0, bcm_pwm_freq_proc, "IU", "PWM clock (Hz)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "mode", CTLFLAG_RW | CTLTYPE_UINT, sc, 0, - bcm_pwm_mode_proc, "IU", "PWM mode (0=off, 1=pwm, 2=dither)"); + bcm_pwm_mode_proc, "IU", "PWM mode ch 1 (0=off, 1=pwm, 2=dither)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "pwm_freq2", + CTLFLAG_RD | CTLTYPE_UINT, sc, 0, + bcm_pwm_pwm_freq2_proc, "IU", "PWM frequency ch 2 (Hz)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "period2", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + bcm_pwm_period2_proc, "IU", "PWM period ch 2 (#clocks)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "ratio2", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + bcm_pwm_ratio2_proc, "IU", "PWM ratio ch 2 (0...period)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "mode2", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + bcm_pwm_mode2_proc, "IU", "PWM mode ch 2 (0=off, 1=pwm, 2=dither)"); } static int @@ -321,11 +456,12 @@ bcm_pwm_attach(device_t dev) /* Add sysctl nodes. */ bcm_pwm_sysctl_init(sc); - sc->freq = 125000000; - sc->period = 10000; - sc->ratio = 2500; + sc->freq = 125000000; /* 125 Mhz */ + sc->period = 10000; /* 12.5 khz */ + sc->ratio = 2500; /* 25% */ + sc->period2 = 10000; /* 12.5 khz */ + sc->ratio2 = 2500; /* 25% */ - return (bus_generic_attach(dev)); } @@ -338,6 +474,7 @@ bcm_pwm_detach(device_t dev) sc = device_get_softc(dev); sc->mode = 0; + sc->mode2 = 0; (void)bcm_pwm_reconf(sc); if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); From owner-svn-src-head@freebsd.org Mon Jul 2 05:19:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2809C1035922; Mon, 2 Jul 2018 05:19:46 +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 C93B5722F9; Mon, 2 Jul 2018 05:19:45 +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 A7867EC2; Mon, 2 Jul 2018 05:19:45 +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 w625JjpC069142; Mon, 2 Jul 2018 05:19:45 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w625JinG069138; Mon, 2 Jul 2018 05:19:44 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807020519.w625JinG069138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 2 Jul 2018 05:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335856 - in head/sys: netinet sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: netinet sys X-SVN-Commit-Revision: 335856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 05:19:46 -0000 Author: mmacy Date: Mon Jul 2 05:19:44 2018 New Revision: 335856 URL: https://svnweb.freebsd.org/changeset/base/335856 Log: inpcb: don't gratuitously defer frees Don't defer frees in sysctl handlers. It isn't necessary and it just confuses things. revert: r333911, r334104, and r334125 Requested by: jtl Modified: head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/sys/malloc.h Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Mon Jul 2 01:30:33 2018 (r335855) +++ head/sys/netinet/ip_divert.c Mon Jul 2 05:19:44 2018 (r335856) @@ -552,7 +552,6 @@ div_detach(struct socket *so) KASSERT(inp != NULL, ("div_detach: inp == NULL")); INP_INFO_WLOCK(&V_divcbinfo); INP_WLOCK(inp); - /* XXX defer destruction to epoch_call */ in_pcbdetach(inp); in_pcbfree(inp); INP_INFO_WUNLOCK(&V_divcbinfo); @@ -632,7 +631,6 @@ static int div_pcblist(SYSCTL_HANDLER_ARGS) { int error, i, n; - struct in_pcblist *il; struct inpcb *inp, **inp_list; inp_gen_t gencnt; struct xinpgen xig; @@ -672,8 +670,9 @@ div_pcblist(SYSCTL_HANDLER_ARGS) if (error) return error; - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); - inp_list = il->il_inp_list; + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); + if (inp_list == NULL) + return ENOMEM; INP_INFO_RLOCK(&V_divcbinfo); for (inp = CK_LIST_FIRST(V_divcbinfo.ipi_listhead), i = 0; inp && i < n; @@ -702,9 +701,14 @@ div_pcblist(SYSCTL_HANDLER_ARGS) } else INP_RUNLOCK(inp); } - il->il_count = n; - il->il_pcbinfo = &V_divcbinfo; - epoch_call(net_epoch_preempt, &il->il_epoch_ctx, in_pcblist_rele_rlocked); + INP_INFO_WLOCK(&V_divcbinfo); + for (i = 0; i < n; i++) { + inp = inp_list[i]; + INP_RLOCK(inp); + if (!in_pcbrele_rlocked(inp)) + INP_RUNLOCK(inp); + } + INP_INFO_WUNLOCK(&V_divcbinfo); if (!error) { /* @@ -721,6 +725,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) INP_INFO_RUNLOCK(&V_divcbinfo); error = SYSCTL_OUT(req, &xig, sizeof xig); } + free(inp_list, M_TEMP); return error; } @@ -800,7 +805,6 @@ div_modevent(module_t mod, int type, void *unused) break; } ip_divert_ptr = NULL; - /* XXX defer to epoch_call ? */ err = pf_proto_unregister(PF_INET, IPPROTO_DIVERT, SOCK_RAW); INP_INFO_WUNLOCK(&V_divcbinfo); #ifndef VIMAGE Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Mon Jul 2 01:30:33 2018 (r335855) +++ head/sys/netinet/raw_ip.c Mon Jul 2 05:19:44 2018 (r335856) @@ -863,7 +863,6 @@ rip_detach(struct socket *so) ip_rsvp_force_done(so); if (so == V_ip_rsvpd) ip_rsvp_done(); - /* XXX defer to epoch_call */ in_pcbdetach(inp); in_pcbfree(inp); INP_INFO_WUNLOCK(&V_ripcbinfo); @@ -1033,7 +1032,6 @@ static int rip_pcblist(SYSCTL_HANDLER_ARGS) { int error, i, n; - struct in_pcblist *il; struct inpcb *inp, **inp_list; inp_gen_t gencnt; struct xinpgen xig; @@ -1068,8 +1066,9 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) if (error) return (error); - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); - inp_list = il->il_inp_list; + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); + if (inp_list == NULL) + return (ENOMEM); INP_INFO_RLOCK(&V_ripcbinfo); for (inp = CK_LIST_FIRST(V_ripcbinfo.ipi_listhead), i = 0; inp && i < n; @@ -1098,9 +1097,14 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) } else INP_RUNLOCK(inp); } - il->il_count = n; - il->il_pcbinfo = &V_ripcbinfo; - epoch_call(net_epoch_preempt, &il->il_epoch_ctx, in_pcblist_rele_rlocked); + INP_INFO_WLOCK(&V_ripcbinfo); + for (i = 0; i < n; i++) { + inp = inp_list[i]; + INP_RLOCK(inp); + if (!in_pcbrele_rlocked(inp)) + INP_RUNLOCK(inp); + } + INP_INFO_WUNLOCK(&V_ripcbinfo); if (!error) { /* @@ -1116,6 +1120,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) INP_INFO_RUNLOCK(&V_ripcbinfo); error = SYSCTL_OUT(req, &xig, sizeof xig); } + free(inp_list, M_TEMP); return (error); } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Jul 2 01:30:33 2018 (r335855) +++ head/sys/netinet/tcp_subr.c Mon Jul 2 05:19:44 2018 (r335856) @@ -943,7 +943,6 @@ deregister_tcp_functions(struct tcp_function_block *bl rw_wunlock(&tcp_function_lock); VNET_LIST_RLOCK(); - /* XXX handle */ VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); INP_INFO_WLOCK(&V_tcbinfo); @@ -1733,7 +1732,6 @@ tcp_ccalgounload(struct cc_algo *unload_algo) tmpalgo = CC_ALGO(tp); /* NewReno does not require any init. */ CC_ALGO(tp) = &newreno_cc_algo; - /* XXX defer to epoch_call */ if (tmpalgo->cb_destroy != NULL) tmpalgo->cb_destroy(tp->ccv); } @@ -2106,7 +2104,6 @@ static int tcp_pcblist(SYSCTL_HANDLER_ARGS) { int error, i, m, n, pcb_count; - struct in_pcblist *il; struct inpcb *inp, **inp_list; inp_gen_t gencnt; struct xinpgen xig; @@ -2153,8 +2150,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error) return (error); - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); - inp_list = il->il_inp_list; + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); INP_INFO_WLOCK(&V_tcbinfo); for (inp = CK_LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; @@ -2197,11 +2193,15 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) } else INP_RUNLOCK(inp); } + INP_INFO_RLOCK(&V_tcbinfo); + for (i = 0; i < n; i++) { + inp = inp_list[i]; + INP_RLOCK(inp); + if (!in_pcbrele_rlocked(inp)) + INP_RUNLOCK(inp); + } + INP_INFO_RUNLOCK(&V_tcbinfo); - il->il_count = n; - il->il_pcbinfo = &V_tcbinfo; - epoch_call(net_epoch_preempt, &il->il_epoch_ctx, in_pcblist_rele_rlocked); - if (!error) { /* * Give the user an updated idea of our state. @@ -2217,6 +2217,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) INP_LIST_RUNLOCK(&V_tcbinfo); error = SYSCTL_OUT(req, &xig, sizeof xig); } + free(inp_list, M_TEMP); return (error); } Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Jul 2 01:30:33 2018 (r335855) +++ head/sys/netinet/udp_usrreq.c Mon Jul 2 05:19:44 2018 (r335856) @@ -837,7 +837,6 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) { int error, i, n; struct inpcb *inp, **inp_list; - struct in_pcblist *il; inp_gen_t gencnt; struct xinpgen xig; @@ -875,9 +874,11 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) error = SYSCTL_OUT(req, &xig, sizeof xig); if (error) return (error); - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); - inp_list = il->il_inp_list; + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); + if (inp_list == NULL) + return (ENOMEM); + INP_INFO_RLOCK(&V_udbinfo); for (inp = CK_LIST_FIRST(V_udbinfo.ipi_listhead), i = 0; inp && i < n; inp = CK_LIST_NEXT(inp, inp_list)) { @@ -905,9 +906,14 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) } else INP_RUNLOCK(inp); } - il->il_count = n; - il->il_pcbinfo = &V_udbinfo; - epoch_call(net_epoch_preempt, &il->il_epoch_ctx, in_pcblist_rele_rlocked); + INP_INFO_WLOCK(&V_udbinfo); + for (i = 0; i < n; i++) { + inp = inp_list[i]; + INP_RLOCK(inp); + if (!in_pcbrele_rlocked(inp)) + INP_RUNLOCK(inp); + } + INP_INFO_WUNLOCK(&V_udbinfo); if (!error) { /* @@ -923,6 +929,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) INP_INFO_RUNLOCK(&V_udbinfo); error = SYSCTL_OUT(req, &xig, sizeof xig); } + free(inp_list, M_TEMP); return (error); } @@ -1714,7 +1721,6 @@ udp_detach(struct socket *so) INP_WLOCK(inp); up = intoudpcb(inp); KASSERT(up != NULL, ("%s: up == NULL", __func__)); - /* XXX defer to epoch_call */ inp->inp_ppcb = NULL; in_pcbdetach(inp); in_pcbfree(inp); Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Mon Jul 2 01:30:33 2018 (r335855) +++ head/sys/sys/malloc.h Mon Jul 2 05:19:44 2018 (r335856) @@ -63,13 +63,6 @@ #define M_MAGIC 877983977 /* time when first defined :-) */ -#ifdef INVARIANTS -#define M_ZERO_INVARIANTS M_ZERO -#else -#define M_ZERO_INVARIANTS 0 -#endif - - /* * Two malloc type structures are present: malloc_type, which is used by a * type owner to declare the type, and malloc_type_internal, which holds From owner-svn-src-head@freebsd.org Mon Jul 2 06:19:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9908FD221D for ; Mon, 2 Jul 2018 06:19:47 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x22b.google.com (mail-yb0-x22b.google.com [IPv6:2607:f8b0:4002:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72A0A74BE2 for ; Mon, 2 Jul 2018 06:19:47 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x22b.google.com with SMTP id s8-v6so1087379ybe.8 for ; Sun, 01 Jul 2018 23:19:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=m3nz0kxyaiL59ZGjv2nG2B1sqcTwUcpvQTWA6rX7VbU=; b=dHg/Mxx0RmzgPpl0dNcR8kj+ywLuEzLePkWquXOHI+FwPwpOHTfZmXO5vU47GdjORq q1B273B5GyrSpo6AhYcoVSQMO85X/ZQihBf/TIS/EYQa0ccWYMoPvi38YRl5M2fIMekJ 6tz7QtxYPzIzYCtn6MK2pk9mXYK4KapY+jEm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=m3nz0kxyaiL59ZGjv2nG2B1sqcTwUcpvQTWA6rX7VbU=; b=mmLS/9r7VRTMpwASL3Kd2pKMmYswmooS42QfTsC4ibMXrwMYjweFAFzplSGIKikWwV GN0tGdghKuqbXoN9N1orH3l1hwaiOWMg+nMHdC5Yr0VpmAC3Obc7Z01C8wJ4hheRUJ8B BABLes17Xz0PSnEyOVIUCF5F+W1q55YD1Mzx99Xq0ouFYwCpi1BI94gXAezubRC5XorB CS4/UP5hkHjzdrWPjXoGHfLLYmrmUgEZdvWjjEwFROLhu9g3Xqtwxgq5uXF0aTQTbVvm l84xjONVBsB6HMqE+uLf9qSoopdj5PSEt8DodZpv1N4jYJm7LfNVDM9lwXNAOzumLMao UMQw== X-Gm-Message-State: APt69E3ySOuBbKdbohla0fO/zKmtay0JLB3mQHB13dPedabPVQz6TtOp yZkLR9wRWmRM+jObTttLOvO0t9HD1hnMT0Fh4Hdtuw== X-Google-Smtp-Source: ADUXVKKOAJLV2rEaxUHxdnPFKFvyGsgCuHtPejaUV7QqTms8un7NJra7GRpETSEhtXF4xZNo2v3cCt2ZFBlNT74IAbA= X-Received: by 2002:a25:8542:: with SMTP id f2-v6mr12950795ybn.87.1530512386474; Sun, 01 Jul 2018 23:19:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:870e:0:0:0:0:0 with HTTP; Sun, 1 Jul 2018 23:19:16 -0700 (PDT) In-Reply-To: <201807011005.w61A5kj8080488@repo.freebsd.org> References: <201807011005.w61A5kj8080488@repo.freebsd.org> From: Eitan Adler Date: Sun, 1 Jul 2018 23:19:16 -0700 Message-ID: Subject: Re: svn commit: r335838 - head To: Wolfram Schneider Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 06:19:48 -0000 On 1 July 2018 at 03:05, Wolfram Schneider wrote: > # > # Require DESTDIR to be set if installing for a different architecture or > @@ -1412,12 +1418,15 @@ restage reinstall: .MAKE .PHONY > .endif > @echo > @echo "--------------------------------------------------------------" > - @echo ">>> Installing everything" > + @echo ">>> Installing everything started on `LC_ALL=C date`" Shouldn't we respect the user preference for locale? Are we using the date for anything automated? -- Eitan Adler From owner-svn-src-head@freebsd.org Mon Jul 2 06:56:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C54FDB1EA; Mon, 2 Jul 2018 06:56:46 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (mx-int.allbsd.org [IPv6:2001:2f0:104:e002::7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gatekeeper.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43E0176469; Mon, 2 Jul 2018 06:56:46 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:c00:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id w626uMJA029334 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) (Client CN "/OU=GT07882699/OU=See+20www.rapidssl.com/resources/cps+20+28c+2915/OU=Domain+20Control+20Validated+20-+20RapidSSL+28R+29/CN=*.allbsd.org", Issuer "/C=US/O=GeoTrust+20Inc./CN=RapidSSL+20SHA256+20CA+20-+20G3"); Mon, 2 Jul 2018 15:56:34 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:c00:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id w626uHP6031168 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 2 Jul 2018 15:56:17 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:0:0:0:0:0:0:0:1]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id w626uFMM031165; Mon, 2 Jul 2018 15:56:17 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 02 Jul 2018 15:55:29 +0900 (JST) Message-Id: <20180702.155529.1102410939281120947.hrs@allbsd.org> To: lists@eitanadler.com, daichi@freebsd.org, gnn@FreeBSD.org Cc: cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335836 - head/usr.bin/top From: Hiroki Sato In-Reply-To: References: <201807010532.w615W44e042172@repo.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Jul__2_15_55_29_2018_512)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Mon, 02 Jul 2018 06:56:34 +0000 (UTC) X-Spam-Status: No, score=-94.9 required=13.0 tests=CONTENT_TYPE_PRESENT, QENCPTR1,RCVD_IN_AHBL,RCVD_IN_AHBL_PROXY,RCVD_IN_AHBL_SPAM,RDNS_NONE, SPF_SOFTFAIL,URIBL_SC2_SURBL,URIBL_XS_SURBL,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mx.allbsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 06:56:47 -0000 ----Security_Multipart(Mon_Jul__2_15_55_29_2018_512)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eitan Adler wrote in : li> On 1 July 2018 at 10:08, Conrad Meyer wrote: li> > Hi Daichi, li> > li> > li> > li> > I don't think code to decode UTF-8 belongs in top(1). I don't know li> > what the goal of this routine is, but I doubt this is the right way to li> > accomplish it. li> li> For the record, I agree. This is why I didn't click "accept" on the li> revision. I don't fully oppose leaving it in top(1) for now as we work li> out the API, but long term its the wrong place. li> li> https://reviews.freebsd.org/D16058 is the review. I strongly object this kind of encoding-specific routine. Please back out it. The problem is that top(1) does not support multibyte encoding in functions for printing, and using C99 wide/multibyte character manipulation API such as iswprint(3) is the way to solve it. Doing getenv("LANG") and assuming an encoding based on it is a very bad practice to internationalize software. -- Hiroki ----Security_Multipart(Mon_Jul__2_15_55_29_2018_512)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAls5zGEACgkQTyzT2CeTzy3ahACgmEoFqKTMw8dNmwXpvxmVe6wU floAniQbYbMXyE9yAEB2qkOAA8Dfwje6 =33jb -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Jul__2_15_55_29_2018_512)---- From owner-svn-src-head@freebsd.org Mon Jul 2 08:36:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33B66FEA962; Mon, 2 Jul 2018 08:36:44 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from mr22p34im-asmtp002.me.com (mr22p34im-asmtp002.me.com [17.111.211.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C53177B063; Mon, 2 Jul 2018 08:36:43 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from process-dkim-sign-daemon.mr22p34im-asmtp002.me.com by mr22p34im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0PB800200D3WEI00@mr22p34im-asmtp002.me.com>; Mon, 02 Jul 2018 08:36:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1530520602; bh=39koAgMzcxcVwpuGiM9RfKeQJhgK9wuWnjy+cXTqOxg=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=ZYCEw4TaQqDNL1b5hy/cOjPedcmwrcljK/lD3+M0IRxQ+k9mfmNjzUArFZ/WrqvA2 avnRo1U6d9uXNwj3TkZKLNl1avbO+6nQ7O+ZWtZMQKHHRFiUVyrQj1+s1bvGqny/NY BcYCSxcmq9efsz7+JmSILi6G33gpXGH1kPDD2533J0TyN4XS6NK1+/aAraM05TT4im /0VOxJ2FxGOsg1TJaAeaCgTS0IvyEX0fQtWI0JEuKv5wENKhr1R7QZSW+YMa0LbKou Tg9gk9fJ/aEuvEwlRlhwOlZNsNNfvtopVb65m6G2TCjAV9Ditu/weacIA94rDMKaMN fNo6ROcD19XTA== Received: from icloud.com ([127.0.0.1]) by mr22p34im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0PB800IVID90Z120@mr22p34im-asmtp002.me.com>; Mon, 02 Jul 2018 08:36:42 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-07-02_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1807020101 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r335836 - head/usr.bin/top From: =?utf-8?B?5b6M6Jek5aSn5Zyw?= In-reply-to: <20180702.155529.1102410939281120947.hrs@allbsd.org> Date: Mon, 02 Jul 2018 17:36:36 +0900 Cc: lists@eitanadler.com, daichi@freebsd.org, gnn@FreeBSD.org, cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <459BD898-8072-426E-A968-96C1382AC616@icloud.com> References: <201807010532.w615W44e042172@repo.freebsd.org> <20180702.155529.1102410939281120947.hrs@allbsd.org> To: Hiroki Sato X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 08:36:44 -0000 > 2018/07/02 15:55=E3=80=81Hiroki Sato =E3=81=AE=E3=83=A1= =E3=83=BC=E3=83=AB: >=20 > Eitan Adler wrote > in = : >=20 > li> On 1 July 2018 at 10:08, Conrad Meyer wrote: > li> > Hi Daichi, > li> > > li> > > li> > > li> > I don't think code to decode UTF-8 belongs in top(1). I don't = know > li> > what the goal of this routine is, but I doubt this is the right = way to > li> > accomplish it. > li> > li> For the record, I agree. This is why I didn't click "accept" on = the > li> revision. I don't fully oppose leaving it in top(1) for now as we = work > li> out the API, but long term its the wrong place. > li> > li> https://reviews.freebsd.org/D16058 is the review. >=20 > I strongly object this kind of encoding-specific routine. Please > back out it. The problem is that top(1) does not support multibyte > encoding in functions for printing, and using C99 wide/multibyte > character manipulation API such as iswprint(3) is the way to solve > it. Doing getenv("LANG") and assuming an encoding based on it is a > very bad practice to internationalize software. >=20 > -- Hiroki I respect what you mean. Once I back out, I will begin implementing it in a different way. Please advise which function should be used for implementation (iswprint (3) and what other functions should be used?) Best regards, Daichi= From owner-svn-src-head@freebsd.org Mon Jul 2 09:09:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 578E6FEEA28; Mon, 2 Jul 2018 09:09:08 +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 0556E7C6ED; Mon, 2 Jul 2018 09:09:08 +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 DBAAE33AF; Mon, 2 Jul 2018 09:09:07 +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 w62997OU087079; Mon, 2 Jul 2018 09:09:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62997Nn087078; Mon, 2 Jul 2018 09:09:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201807020909.w62997Nn087078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 2 Jul 2018 09:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335858 - head/sbin/kldstat X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sbin/kldstat X-SVN-Commit-Revision: 335858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 09:09:08 -0000 Author: tuexen Date: Mon Jul 2 09:09:07 2018 New Revision: 335858 URL: https://svnweb.freebsd.org/changeset/base/335858 Log: Improve consistency of indentation. Whitespace change only. Modified: head/sbin/kldstat/kldstat.c Modified: head/sbin/kldstat/kldstat.c ============================================================================== --- head/sbin/kldstat/kldstat.c Mon Jul 2 07:58:57 2018 (r335857) +++ head/sbin/kldstat/kldstat.c Mon Jul 2 09:09:07 2018 (r335858) @@ -74,11 +74,11 @@ printfile(int fileid, int verbose, int humanized) err(1, "can't stat file id %d", fileid); } else { if (humanized) { - humanize_number(buf, sizeof(buf), stat.size, - "", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE); + humanize_number(buf, sizeof(buf), stat.size, + "", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE); - printf("%2d %4d %p %5s %s", - stat.id, stat.refs, stat.address, buf, stat.name); + printf("%2d %4d %p %5s %s", + stat.id, stat.refs, stat.address, buf, stat.name); } else { printf("%2d %4d %p %8zx %s", stat.id, stat.refs, stat.address, stat.size, stat.name); From owner-svn-src-head@freebsd.org Mon Jul 2 09:11:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 542EEFEEE4B; Mon, 2 Jul 2018 09:11:31 +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 057157CA90; Mon, 2 Jul 2018 09:11:31 +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 DC35133FD; Mon, 2 Jul 2018 09:11:30 +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 w629BU5t087280; Mon, 2 Jul 2018 09:11:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w629BU8Z087279; Mon, 2 Jul 2018 09:11:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201807020911.w629BU8Z087279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 2 Jul 2018 09:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335859 - head/sbin/kldstat X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sbin/kldstat X-SVN-Commit-Revision: 335859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 09:11:31 -0000 Author: tuexen Date: Mon Jul 2 09:11:30 2018 New Revision: 335859 URL: https://svnweb.freebsd.org/changeset/base/335859 Log: Keep table aligned when address pointer is not of max length. Modified: head/sbin/kldstat/kldstat.c Modified: head/sbin/kldstat/kldstat.c ============================================================================== --- head/sbin/kldstat/kldstat.c Mon Jul 2 09:09:07 2018 (r335858) +++ head/sbin/kldstat/kldstat.c Mon Jul 2 09:11:30 2018 (r335859) @@ -77,11 +77,13 @@ printfile(int fileid, int verbose, int humanized) humanize_number(buf, sizeof(buf), stat.size, "", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE); - printf("%2d %4d %p %5s %s", - stat.id, stat.refs, stat.address, buf, stat.name); + printf("%2d %4d %*p %5s %s", + stat.id, stat.refs, POINTER_WIDTH, stat.address, buf, + stat.name); } else { - printf("%2d %4d %p %8zx %s", - stat.id, stat.refs, stat.address, stat.size, stat.name); + printf("%2d %4d %*p %8zx %s", + stat.id, stat.refs, POINTER_WIDTH, stat.address, stat.size, + stat.name); } } From owner-svn-src-head@freebsd.org Mon Jul 2 09:14:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9CCFEF3D6; Mon, 2 Jul 2018 09:14:01 +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 04F437CD64; Mon, 2 Jul 2018 09:14:01 +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 DA50A38A3; Mon, 2 Jul 2018 09:14:00 +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 w629E09v092349; Mon, 2 Jul 2018 09:14:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w629E0hG092348; Mon, 2 Jul 2018 09:14:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201807020914.w629E0hG092348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 2 Jul 2018 09:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335860 - head/sbin/kldstat X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sbin/kldstat X-SVN-Commit-Revision: 335860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 09:14:01 -0000 Author: tuexen Date: Mon Jul 2 09:14:00 2018 New Revision: 335860 URL: https://svnweb.freebsd.org/changeset/base/335860 Log: Allow three digits of module id without breaking table alignment. Modified: head/sbin/kldstat/kldstat.c Modified: head/sbin/kldstat/kldstat.c ============================================================================== --- head/sbin/kldstat/kldstat.c Mon Jul 2 09:11:30 2018 (r335859) +++ head/sbin/kldstat/kldstat.c Mon Jul 2 09:14:00 2018 (r335860) @@ -55,10 +55,10 @@ printmod(int modid) warn("can't stat module id %d", modid); else if (showdata) { - printf("\t\t%2d %s (%d, %u, 0x%lx)\n", stat.id, stat.name, + printf("\t\t%3d %s (%d, %u, 0x%lx)\n", stat.id, stat.name, stat.data.intval, stat.data.uintval, stat.data.ulongval); } else { - printf("\t\t%2d %s\n", stat.id, stat.name); + printf("\t\t%3d %s\n", stat.id, stat.name); } } @@ -90,7 +90,7 @@ printfile(int fileid, int verbose, int humanized) if (verbose) { printf(" (%s)\n", stat.pathname); printf("\tContains modules:\n"); - printf("\t\tId Name\n"); + printf("\t\t Id Name\n"); for (modid = kldfirstmod(fileid); modid > 0; modid = modfnext(modid)) printmod(modid); From owner-svn-src-head@freebsd.org Mon Jul 2 09:30:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87BDEFF1371; Mon, 2 Jul 2018 09:30:39 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from mr22p34im-asmtp002.me.com (mr22p34im-asmtp002.me.com [17.111.211.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29A417D9EE; Mon, 2 Jul 2018 09:30:39 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from process-dkim-sign-daemon.mr22p34im-asmtp002.me.com by mr22p34im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0PB800L00CN5NQ00@mr22p34im-asmtp002.me.com>; Mon, 02 Jul 2018 08:30:32 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1530520232; bh=6EqxRwMfSRmlmojGmdOcdX0QDLx4wi1OJ38FpQc46YY=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=snGRhKxulsqIAwwdZGK+j9oo9yZ8PsUlZgTA++5wiWt4VOnPQGYT8I/Ono5ll8EGi a68MVsVUEQRzROUhLNIjasSi5v8HV7ATwx4uq2MIpPDV+TJf+ssDVGtW06E8OMl+8X myJCigJtt9lRuUqyUzQoWlNjLc/5w18M3WyZF0dsJJ9PzyKvPNhwF9XEhNrX5SV6Cm Xv4XlvbF4T/x8aGxINKUeq29i4xDksbCDsFi4RacUNRh5kzNxNn7uQ/cmnxDhVGYkg G9ydDMGX86/O2HvXfO8UPj0yE3aUxz6nFb8MShoDe7Z5SZ462FSjwFT1ts3D1/x7IF Ikj8d1CUyW6+g== Received: from icloud.com ([127.0.0.1]) by mr22p34im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0PB800IHJCYPNE20@mr22p34im-asmtp002.me.com>; Mon, 02 Jul 2018 08:30:31 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-07-02_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1807020100 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r335836 - head/usr.bin/top From: =?utf-8?B?5b6M6Jek5aSn5Zyw?= In-reply-to: Date: Mon, 02 Jul 2018 17:30:24 +0900 Cc: Daichi GOTO , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: References: <201807010532.w615W44e042172@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 09:30:39 -0000 > 2018/07/02 2:08=E3=80=81Conrad Meyer =E3=81=AE=E3=83=A1= =E3=83=BC=E3=83=AB: >=20 > Hi Daichi, >=20 > On Sat, Jun 30, 2018 at 10:32 PM, Daichi GOTO = wrote: >> Author: daichi >> Date: Sun Jul 1 05:32:03 2018 >> New Revision: 335836 >> URL: https://svnweb.freebsd.org/changeset/base/335836 >>=20 >> Log: >> top(1) - support UTF-8 display >>=20 >> ... >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.bin/top/display.c Sun Jul 1 01:56:40 2018 = (r335835) >> +++ head/usr.bin/top/display.c Sun Jul 1 05:32:03 2018 = (r335836) >> @@ -1258,19 +1258,43 @@ line_update(char *old, char *new, int start, = int line) >> char * >> printable(char str[]) >> { >> - char *ptr; >> - char ch; >> + char *ptr; >> + char ch; >>=20 >> - ptr =3D str; >> - while ((ch =3D *ptr) !=3D '\0') >> - { >> - if (!isprint(ch)) >> - { >> - *ptr =3D '?'; >> + ptr =3D str; >> + if (utf8flag) { >> + while ((ch =3D *ptr) !=3D '\0') { >> + if (0x00 =3D=3D (0x80 & ch)) { >> + if (!isprint(ch)) { >> + *ptr =3D '?'; >> + } >> + ++ptr; >> + } else if (0xC0 =3D=3D (0xE0 & ch)) { >> + ++ptr; >> + if ('\0' !=3D *ptr) ++ptr; >> + } else if (0xE0 =3D=3D (0xF0 & ch)) { >> + ++ptr; >> + if ('\0' !=3D *ptr) ++ptr; >> + if ('\0' !=3D *ptr) ++ptr; >> + } else if (0xF0 =3D=3D (0xF8 & ch)) { >> + ++ptr; >> + if ('\0' !=3D *ptr) ++ptr; >> + if ('\0' !=3D *ptr) ++ptr; >> + if ('\0' !=3D *ptr) ++ptr; >> + } else { >> + *ptr =3D '?'; >> + ++ptr; >> + } >> + } >> + } else { >> + while ((ch =3D *ptr) !=3D '\0') { >> + if (!isprint(ch)) { >> + *ptr =3D '?'; >> + } >> + ptr++; >> + } >> } >=20 >=20 > I don't think code to decode UTF-8 belongs in top(1). I don't know > what the goal of this routine is, but I doubt this is the right way to > accomplish it. >=20 > For the strvisx portion it seems like support should be rolled into > libc instead. Hi Conrad, The purpose is to display UTF-8 string. Certainly, you are right.=20 In the end I think I should support it with libc. However, I think that=20= it is a problem that UTF-8 can not be used with the top command for a = long=20 period of time. Although it may be transient, I think that keeping it to=20= work is not that bad idea. Best regards, Daichi > (Also, the patch in phabricator does not seem to match what was = committed.) >=20 > Best, > Conrad >=20 From owner-svn-src-head@freebsd.org Mon Jul 2 10:57:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3A1A1000578; Mon, 2 Jul 2018 10:57:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6578181B22; Mon, 2 Jul 2018 10:57:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4212B49B2; Mon, 2 Jul 2018 10:57:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62AvNW5044194; Mon, 2 Jul 2018 10:57:23 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62AvNnO044193; Mon, 2 Jul 2018 10:57:23 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201807021057.w62AvNnO044193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 2 Jul 2018 10:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335861 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 335861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 10:57:23 -0000 Author: ed Date: Mon Jul 2 10:57:22 2018 New Revision: 335861 URL: https://svnweb.freebsd.org/changeset/base/335861 Log: Restore the order in which RFC 3164 messages with fac/pri are formatted. The refactoring of the syslogd code to format messages using iovecs slightly altered the output of syslogd by placing the facility/priority after the hostname, as opposed to printing it right before. This change reverts the behaviour to be consistent with how it was before. PR: 229457 Reported by: Andre Albsmeier MFC after: 1 week Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Mon Jul 2 09:14:00 2018 (r335860) +++ head/usr.sbin/syslogd/syslogd.c Mon Jul 2 10:57:22 2018 (r335861) @@ -1873,8 +1873,6 @@ fprintlog_rfc3164(struct filed *f, const char *hostnam /* Message written to files. */ iovlist_append(&il, timebuf); iovlist_append(&il, " "); - iovlist_append(&il, hostname); - iovlist_append(&il, " "); if (LogFacPri) { iovlist_append(&il, "<"); @@ -1918,6 +1916,9 @@ fprintlog_rfc3164(struct filed *f, const char *hostnam iovlist_append(&il, "> "); } + + iovlist_append(&il, hostname); + iovlist_append(&il, " "); break; } From owner-svn-src-head@freebsd.org Mon Jul 2 11:02:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAA0B1012039; Mon, 2 Jul 2018 11:02:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97EE882106; Mon, 2 Jul 2018 11:02:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79CC74B3C; Mon, 2 Jul 2018 11:02:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62B2RsS049460; Mon, 2 Jul 2018 11:02:27 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62B2RlQ049459; Mon, 2 Jul 2018 11:02:27 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201807021102.w62B2RlQ049459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 2 Jul 2018 11:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335862 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 335862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 11:02:28 -0000 Author: ed Date: Mon Jul 2 11:02:27 2018 New Revision: 335862 URL: https://svnweb.freebsd.org/changeset/base/335862 Log: Document that syslogd -v has no effect when RFC 5424 mode is enabled. The variable it sets, LogFacPri, is only used in the RFC 3164 formatting codepath. PR: 229457 Reported by: Andre Albsmeier MFC after: 1 week Modified: head/usr.sbin/syslogd/syslogd.8 Modified: head/usr.sbin/syslogd/syslogd.8 ============================================================================== --- head/usr.sbin/syslogd/syslogd.8 Mon Jul 2 10:57:22 2018 (r335861) +++ head/usr.sbin/syslogd/syslogd.8 Mon Jul 2 11:02:27 2018 (r335862) @@ -28,7 +28,7 @@ .\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 15, 2018 +.Dd July 2, 2018 .Dt SYSLOGD 8 .Os .Sh NAME @@ -348,6 +348,10 @@ logged with each locally-written message. If specified more than once, the names of the facility and priority are logged with each locally-written message. +.Pp +This option only affects the formatting of RFC 3164 messages. +Messages formatted according to RFC 5424 always include a +facility/priority number. .El .Pp The From owner-svn-src-head@freebsd.org Mon Jul 2 14:15:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89CE0102AD6E; Mon, 2 Jul 2018 14:15:31 +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 3DEF08AA2B; Mon, 2 Jul 2018 14:15:31 +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 1B0686967; Mon, 2 Jul 2018 14:15:31 +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 w62EFUIm048538; Mon, 2 Jul 2018 14:15:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62EFUm8048537; Mon, 2 Jul 2018 14:15:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807021415.w62EFUm8048537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 2 Jul 2018 14:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335864 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 335864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 14:15:31 -0000 Author: trasz Date: Mon Jul 2 14:15:30 2018 New Revision: 335864 URL: https://svnweb.freebsd.org/changeset/base/335864 Log: Change the group and the permissions on /dev/acpi, to make "acpiconf" work when called by members of the 'operator' group. They are already allowed to eg power off the system (via suid shutdown(8)), so they might as well be permitted to suspend it. Tested by: xmj@ Reviewed by: delphij@ MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16062 Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Jul 2 13:08:27 2018 (r335863) +++ head/sys/dev/acpica/acpi.c Mon Jul 2 14:15:30 2018 (r335864) @@ -667,7 +667,7 @@ acpi_attach(device_t dev) sc->acpi_sleep_disabled = TRUE; /* Create the control device */ - sc->acpi_dev_t = make_dev(&acpi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0644, + sc->acpi_dev_t = make_dev(&acpi_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0664, "acpi"); sc->acpi_dev_t->si_drv1 = sc; From owner-svn-src-head@freebsd.org Mon Jul 2 14:44:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5977C102BBD3 for ; Mon, 2 Jul 2018 14:44:33 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 950F58BF05 for ; Mon, 2 Jul 2018 14:44:32 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-lj1-x235.google.com with SMTP id t21-v6so12751264lji.0 for ; Mon, 02 Jul 2018 07:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=crP/EXzB1XA2rkFHBrhIX2317urz0Eh3JsxrOSiXUvI=; b=TJb6C+FbFl9IkjCMYiWu65YU3vimk3O/kXh3HtCI2kQYBRI/NZDm5iHK9QEWAKTzIA r31fqS82g89wDpZyTI05F6h3h+SDh+pxor4g4Ws7g2UzBfJULj1dSy3cStZNoLtodBay v44FidbUEymP790Mz7UMW7ua8lgUmcNnTMcApOra6WJPJgSXPcbO6vQPtsyjfF8iS5En w3NzKHzu/GnG1/ahxon/Ed4JxBgaGV+5xZQpQM3y1iXDnuyaiy1mkPHLoCWUYhY+DPFS H1DZYei6leNzd6QF2zEZfyo7BXqCfy7R1sp2dqKPAKkXGwszBtvTVlt9fAT+AH+XFoIC wROg== 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=crP/EXzB1XA2rkFHBrhIX2317urz0Eh3JsxrOSiXUvI=; b=gzMCby/Cg/91lkUWeU2VYywss45JiYOPalm3l77EkOf/EJ2lqLAwfF/c3Govhbxoo3 aQyp1U6cZkTeB6QkFJo0dxvgtucK2UvCjR02rPW3Lq3Zag+zfSFy3Szghct0t+nhXHMH lEr02PVNnbegpnP8GoykMEoSpADK6H1WnSCptehB+Q4T7n97JXiviSGCzm8cWz/r1Y5f nx/2cSGqmHI1UX3XuE9ugcH6HesrLv3zcRHzo9T05ExAu6yLYb1L34mAXKX6LmVicZ/c NPJ2MAhNIm0be4P/zCm7iOXwdjUDlFWq0qHjXFWjAnmofu48kAl/X/N7CndGEEfNbk/m S2eQ== X-Gm-Message-State: APt69E0hYJFKDjahWx0T2vNBTcA737Qb2jAepaz9ZCMRFcO6rZwbo3Dx 4wNekQvE4heJO/KOogR+4+J7/B2QfdVN+kEyyr6LS0GJ X-Google-Smtp-Source: AAOMgpdWkhIpKV3vBIP6WbVyIqyH7wjBXYS389keVB3IdzN4XCP1b9hwXqlZcCvp+2LUwk3rSbarNeM+OXynPRKkKOI= X-Received: by 2002:a2e:869a:: with SMTP id l26-v6mr6450631lji.48.1530542670836; Mon, 02 Jul 2018 07:44:30 -0700 (PDT) MIME-Version: 1.0 References: <201807020519.w625JinG069138@repo.freebsd.org> In-Reply-To: <201807020519.w625JinG069138@repo.freebsd.org> From: Steven Hartland Date: Mon, 2 Jul 2018 15:44:19 +0100 Message-ID: Subject: Re: svn commit: r335856 - in head/sys: netinet sys To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 14:44:33 -0000 You have M_WAITOK and a null check in this change On Mon, 2 Jul 2018 at 06:20, Matt Macy wrote: > Author: mmacy > Date: Mon Jul 2 05:19:44 2018 > New Revision: 335856 > URL: https://svnweb.freebsd.org/changeset/base/335856 > > Log: > inpcb: don't gratuitously defer frees > > Don't defer frees in sysctl handlers. It isn't necessary > and it just confuses things. > revert: r333911, r334104, and r334125 > > Requested by: jtl > > Modified: > head/sys/netinet/ip_divert.c > head/sys/netinet/raw_ip.c > head/sys/netinet/tcp_subr.c > head/sys/netinet/udp_usrreq.c > head/sys/sys/malloc.h > > Modified: head/sys/netinet/ip_divert.c > > ============================================================================== > --- head/sys/netinet/ip_divert.c Mon Jul 2 01:30:33 2018 > (r335855) > +++ head/sys/netinet/ip_divert.c Mon Jul 2 05:19:44 2018 > (r335856) > @@ -552,7 +552,6 @@ div_detach(struct socket *so) > KASSERT(inp != NULL, ("div_detach: inp == NULL")); > INP_INFO_WLOCK(&V_divcbinfo); > INP_WLOCK(inp); > - /* XXX defer destruction to epoch_call */ > in_pcbdetach(inp); > in_pcbfree(inp); > INP_INFO_WUNLOCK(&V_divcbinfo); > @@ -632,7 +631,6 @@ static int > div_pcblist(SYSCTL_HANDLER_ARGS) > { > int error, i, n; > - struct in_pcblist *il; > struct inpcb *inp, **inp_list; > inp_gen_t gencnt; > struct xinpgen xig; > @@ -672,8 +670,9 @@ div_pcblist(SYSCTL_HANDLER_ARGS) > if (error) > return error; > > - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb > *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); > - inp_list = il->il_inp_list; > + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); > + if (inp_list == NULL) > + return ENOMEM; > > INP_INFO_RLOCK(&V_divcbinfo); > for (inp = CK_LIST_FIRST(V_divcbinfo.ipi_listhead), i = 0; inp && > i < n; > @@ -702,9 +701,14 @@ div_pcblist(SYSCTL_HANDLER_ARGS) > } else > INP_RUNLOCK(inp); > } > - il->il_count = n; > - il->il_pcbinfo = &V_divcbinfo; > - epoch_call(net_epoch_preempt, &il->il_epoch_ctx, > in_pcblist_rele_rlocked); > + INP_INFO_WLOCK(&V_divcbinfo); > + for (i = 0; i < n; i++) { > + inp = inp_list[i]; > + INP_RLOCK(inp); > + if (!in_pcbrele_rlocked(inp)) > + INP_RUNLOCK(inp); > + } > + INP_INFO_WUNLOCK(&V_divcbinfo); > > if (!error) { > /* > @@ -721,6 +725,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) > INP_INFO_RUNLOCK(&V_divcbinfo); > error = SYSCTL_OUT(req, &xig, sizeof xig); > } > + free(inp_list, M_TEMP); > return error; > } > > @@ -800,7 +805,6 @@ div_modevent(module_t mod, int type, void *unused) > break; > } > ip_divert_ptr = NULL; > - /* XXX defer to epoch_call ? */ > err = pf_proto_unregister(PF_INET, IPPROTO_DIVERT, > SOCK_RAW); > INP_INFO_WUNLOCK(&V_divcbinfo); > #ifndef VIMAGE > > Modified: head/sys/netinet/raw_ip.c > > ============================================================================== > --- head/sys/netinet/raw_ip.c Mon Jul 2 01:30:33 2018 (r335855) > +++ head/sys/netinet/raw_ip.c Mon Jul 2 05:19:44 2018 (r335856) > @@ -863,7 +863,6 @@ rip_detach(struct socket *so) > ip_rsvp_force_done(so); > if (so == V_ip_rsvpd) > ip_rsvp_done(); > - /* XXX defer to epoch_call */ > in_pcbdetach(inp); > in_pcbfree(inp); > INP_INFO_WUNLOCK(&V_ripcbinfo); > @@ -1033,7 +1032,6 @@ static int > rip_pcblist(SYSCTL_HANDLER_ARGS) > { > int error, i, n; > - struct in_pcblist *il; > struct inpcb *inp, **inp_list; > inp_gen_t gencnt; > struct xinpgen xig; > @@ -1068,8 +1066,9 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) > if (error) > return (error); > > - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb > *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); > - inp_list = il->il_inp_list; > + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); > + if (inp_list == NULL) > + return (ENOMEM); > > INP_INFO_RLOCK(&V_ripcbinfo); > for (inp = CK_LIST_FIRST(V_ripcbinfo.ipi_listhead), i = 0; inp && > i < n; > @@ -1098,9 +1097,14 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) > } else > INP_RUNLOCK(inp); > } > - il->il_count = n; > - il->il_pcbinfo = &V_ripcbinfo; > - epoch_call(net_epoch_preempt, &il->il_epoch_ctx, > in_pcblist_rele_rlocked); > + INP_INFO_WLOCK(&V_ripcbinfo); > + for (i = 0; i < n; i++) { > + inp = inp_list[i]; > + INP_RLOCK(inp); > + if (!in_pcbrele_rlocked(inp)) > + INP_RUNLOCK(inp); > + } > + INP_INFO_WUNLOCK(&V_ripcbinfo); > > if (!error) { > /* > @@ -1116,6 +1120,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) > INP_INFO_RUNLOCK(&V_ripcbinfo); > error = SYSCTL_OUT(req, &xig, sizeof xig); > } > + free(inp_list, M_TEMP); > return (error); > } > > > Modified: head/sys/netinet/tcp_subr.c > > ============================================================================== > --- head/sys/netinet/tcp_subr.c Mon Jul 2 01:30:33 2018 (r335855) > +++ head/sys/netinet/tcp_subr.c Mon Jul 2 05:19:44 2018 (r335856) > @@ -943,7 +943,6 @@ deregister_tcp_functions(struct tcp_function_block *bl > rw_wunlock(&tcp_function_lock); > > VNET_LIST_RLOCK(); > - /* XXX handle */ > VNET_FOREACH(vnet_iter) { > CURVNET_SET(vnet_iter); > INP_INFO_WLOCK(&V_tcbinfo); > @@ -1733,7 +1732,6 @@ tcp_ccalgounload(struct cc_algo *unload_algo) > tmpalgo = CC_ALGO(tp); > /* NewReno does not require any > init. */ > CC_ALGO(tp) = &newreno_cc_algo; > - /* XXX defer to epoch_call */ > if (tmpalgo->cb_destroy != NULL) > > tmpalgo->cb_destroy(tp->ccv); > } > @@ -2106,7 +2104,6 @@ static int > tcp_pcblist(SYSCTL_HANDLER_ARGS) > { > int error, i, m, n, pcb_count; > - struct in_pcblist *il; > struct inpcb *inp, **inp_list; > inp_gen_t gencnt; > struct xinpgen xig; > @@ -2153,8 +2150,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) > if (error) > return (error); > > - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb > *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); > - inp_list = il->il_inp_list; > + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); > > INP_INFO_WLOCK(&V_tcbinfo); > for (inp = CK_LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; > @@ -2197,11 +2193,15 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) > } else > INP_RUNLOCK(inp); > } > + INP_INFO_RLOCK(&V_tcbinfo); > + for (i = 0; i < n; i++) { > + inp = inp_list[i]; > + INP_RLOCK(inp); > + if (!in_pcbrele_rlocked(inp)) > + INP_RUNLOCK(inp); > + } > + INP_INFO_RUNLOCK(&V_tcbinfo); > > - il->il_count = n; > - il->il_pcbinfo = &V_tcbinfo; > - epoch_call(net_epoch_preempt, &il->il_epoch_ctx, > in_pcblist_rele_rlocked); > - > if (!error) { > /* > * Give the user an updated idea of our state. > @@ -2217,6 +2217,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) > INP_LIST_RUNLOCK(&V_tcbinfo); > error = SYSCTL_OUT(req, &xig, sizeof xig); > } > + free(inp_list, M_TEMP); > return (error); > } > > > Modified: head/sys/netinet/udp_usrreq.c > > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Mon Jul 2 01:30:33 2018 > (r335855) > +++ head/sys/netinet/udp_usrreq.c Mon Jul 2 05:19:44 2018 > (r335856) > @@ -837,7 +837,6 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) > { > int error, i, n; > struct inpcb *inp, **inp_list; > - struct in_pcblist *il; > inp_gen_t gencnt; > struct xinpgen xig; > > @@ -875,9 +874,11 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) > error = SYSCTL_OUT(req, &xig, sizeof xig); > if (error) > return (error); > - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb > *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); > - inp_list = il->il_inp_list; > > + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); > + if (inp_list == NULL) > + return (ENOMEM); > + > INP_INFO_RLOCK(&V_udbinfo); > for (inp = CK_LIST_FIRST(V_udbinfo.ipi_listhead), i = 0; inp && i > < n; > inp = CK_LIST_NEXT(inp, inp_list)) { > @@ -905,9 +906,14 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) > } else > INP_RUNLOCK(inp); > } > - il->il_count = n; > - il->il_pcbinfo = &V_udbinfo; > - epoch_call(net_epoch_preempt, &il->il_epoch_ctx, > in_pcblist_rele_rlocked); > + INP_INFO_WLOCK(&V_udbinfo); > + for (i = 0; i < n; i++) { > + inp = inp_list[i]; > + INP_RLOCK(inp); > + if (!in_pcbrele_rlocked(inp)) > + INP_RUNLOCK(inp); > + } > + INP_INFO_WUNLOCK(&V_udbinfo); > > if (!error) { > /* > @@ -923,6 +929,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) > INP_INFO_RUNLOCK(&V_udbinfo); > error = SYSCTL_OUT(req, &xig, sizeof xig); > } > + free(inp_list, M_TEMP); > return (error); > } > > @@ -1714,7 +1721,6 @@ udp_detach(struct socket *so) > INP_WLOCK(inp); > up = intoudpcb(inp); > KASSERT(up != NULL, ("%s: up == NULL", __func__)); > - /* XXX defer to epoch_call */ > inp->inp_ppcb = NULL; > in_pcbdetach(inp); > in_pcbfree(inp); > > Modified: head/sys/sys/malloc.h > > ============================================================================== > --- head/sys/sys/malloc.h Mon Jul 2 01:30:33 2018 (r335855) > +++ head/sys/sys/malloc.h Mon Jul 2 05:19:44 2018 (r335856) > @@ -63,13 +63,6 @@ > > #define M_MAGIC 877983977 /* time when first defined > :-) */ > > -#ifdef INVARIANTS > -#define M_ZERO_INVARIANTS M_ZERO > -#else > -#define M_ZERO_INVARIANTS 0 > -#endif > - > - > /* > * Two malloc type structures are present: malloc_type, which is used by a > * type owner to declare the type, and malloc_type_internal, which holds > > From owner-svn-src-head@freebsd.org Mon Jul 2 14:56:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BDA5102C14D; Mon, 2 Jul 2018 14:56:30 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E6168C636; Mon, 2 Jul 2018 14:56:29 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-ed1-f44.google.com with SMTP id u11-v6so2887961eds.10; Mon, 02 Jul 2018 07:56:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=svxX5zzjxTIxZVVlhCTaG6hDgFDBqfSCsSw6Cm3tHMM=; b=Fb0fGG4lLZJbi2K92f+igE4QroRMSKy1PgzQt7+xoIwZzLD78xFqyJi7LWBzQybluu ZwyCOD466106NpEFFtMjIyU/TOMrvC5025PyKP+3WAKv92UBh0awZM/cPN3Vy1fqSopL mnUmemkyU84jQGODjkRzYLGFg4kOxoxrx9kcFHX/5S1zpJoj1GOPf2UmcPdPNxkO3QPS 6CDMTgJedWHSJDsRx3K0GajqHONrSSkU0GiFKeZPCfPjWcYshIaRPqln+IpOmgXL8l17 GokhkyPv5GbV9i+Z1tlAU8EakA4AUBJczsD0Ks1e038sdZpfMd6XTxEVeXroi/PmQspF hxWg== X-Gm-Message-State: APt69E2DcPE9mh1Sqc8DBzqVtRE5Y1yg0h7QSS3L5nrlmpMEkh42ArOT RZ2GJw657ejyQO/bqLpLZS9CWu/G X-Google-Smtp-Source: AAOMgpeJLMpEBaBh++/u7Kq00eTBPQa1Q9cjvw4w2TY4ag6CIybOj26j8/vUWLOo4w1msCLPMLWYOQ== X-Received: by 2002:aa7:d717:: with SMTP id t23-v6mr25076398edq.102.1530543383204; Mon, 02 Jul 2018 07:56:23 -0700 (PDT) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com. [74.125.82.42]) by smtp.gmail.com with ESMTPSA id b3-v6sm7171996edi.60.2018.07.02.07.56.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 07:56:22 -0700 (PDT) Received: by mail-wm0-f42.google.com with SMTP id n17-v6so9076157wmh.2; Mon, 02 Jul 2018 07:56:22 -0700 (PDT) X-Received: by 2002:a1c:7a06:: with SMTP id v6-v6mr8500683wmc.90.1530543382391; Mon, 02 Jul 2018 07:56:22 -0700 (PDT) MIME-Version: 1.0 References: <201807020519.w625JinG069138@repo.freebsd.org> In-Reply-To: From: "Jonathan T. Looney" Date: Mon, 2 Jul 2018 10:56:10 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335856 - in head/sys: netinet sys To: steven.hartland@multiplay.co.uk Cc: Matt Macy , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 14:56:30 -0000 On Mon, Jul 2, 2018 at 10:44 AM Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > > You have M_WAITOK and a null check in this change And, that's the same as the way it was before his commits. So, he did exactly what he said he was doing and reverted his commits. I don't think it is good practice to mix reverts with other changes. Since you've noticed this, I think you should feel free to make the change. Jonathan From owner-svn-src-head@freebsd.org Mon Jul 2 15:43:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7575102D5CB; Mon, 2 Jul 2018 15:43:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A5418E2A2; Mon, 2 Jul 2018 15:43:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id a0zNfEfslbP3Ia0zPfILG8; Mon, 02 Jul 2018 09:43:45 -0600 X-Authority-Analysis: v=2.3 cv=P64UeBIu c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=R9QF1RCXAYgA:10 a=xfDLHkLGAAAA:8 a=ASrO2z8EAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=1oSP4-2u0spcIPnZQbEA:9 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=hMlqHZxbFqNCaWTKXPQf: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 B86332232; Mon, 2 Jul 2018 08:43:40 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w62Fhckf060374; Mon, 2 Jul 2018 08:43:38 -0700 (PDT) (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 w62FhcBE060360; Mon, 2 Jul 2018 08:43:38 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807021543.w62FhcBE060360@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: "Jonathan T. Looney" cc: steven.hartland@multiplay.co.uk, Matt Macy , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335856 - in head/sys: netinet sys In-Reply-To: Message from "Jonathan T. Looney" of "Mon, 02 Jul 2018 10:56:10 -0400." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 02 Jul 2018 08:43:38 -0700 X-CMAE-Envelope: MS4wfP3blfBjuIPFuVfYpjz3z+sp8sIXAukA6L/Rl89XpO1RzL9hDI5xmw7g6CyUjAt7FGOGvRSDwY8kBCBMhjMhHHmxCyuK8kwYnVltPejsNQR3K7eBrckr Ti6dUgoksz5Aphnh8yDHuCZh65TIGrZF7OU2U4/C1rx+MuLiAiTj2QmOSAGA/8bXf2WSa/gEe+B6EtMqt3syv+bsD14Ct4Z3AUPQ2Jy461sNwKXROR+5cv4h bMuEoM0v16UBVJF8F+hGo2+VDmg05ooBf6KlVVhFCNzSpnxfiJnCTnt8DRX2weC+fn6gN3XH88pXXm9WrtBwpG02St6XwQCmVa15hT3S0Y412XaQU+JR692O lyDyeMfhH83MkMIhFTKHvQ0Yx+yDr68awJWciV+am7i05qIgUoBip6O3ukhtobrey3Is/K95 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 15:43:47 -0000 In message , "Jonathan T. Looney" writes: > On Mon, Jul 2, 2018 at 10:44 AM Steven Hartland < > steven.hartland@multiplay.co.uk> wrote: > > > > You have M_WAITOK and a null check in this change > > And, that's the same as the way it was before his commits. So, he did > exactly what he said he was doing and reverted his commits. I don't think > it is good practice to mix reverts with other changes. Yes, mixing reverts with other changes or batching changes together in one commit confuses history. This is my main criticism of Linux commit logs, IMO the worst example of commit log content. There they itemize a shopping list of changes or simply say, pull fixes for X from so-and-so, the patch passes our tests. Five years from now or even a year from now, will anyone remember? > > Since you've noticed this, I think you should feel free to make the change. > > Jonathan -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Jul 2 16:30:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F11E102E95A; Mon, 2 Jul 2018 16:30:36 +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 D30358FB66; Mon, 2 Jul 2018 16:30:35 +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 w62GUV8J034522; Mon, 2 Jul 2018 09:30:31 -0700 (PDT) (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 w62GUVEQ034521; Mon, 2 Jul 2018 09:30:31 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807021630.w62GUVEQ034521@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335856 - in head/sys: netinet sys In-Reply-To: To: "Jonathan T. Looney" Date: Mon, 2 Jul 2018 09:30:31 -0700 (PDT) CC: steven.hartland@multiplay.co.uk, Matt Macy , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 16:30:36 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Jul 2, 2018 at 10:44 AM Steven Hartland < > steven.hartland@multiplay.co.uk> wrote: > > > > You have M_WAITOK and a null check in this change > > And, that's the same as the way it was before his commits. So, he did > exactly what he said he was doing and reverted his commits. I don't think > it is good practice to mix reverts with other changes. It is a very bad practive to mix a revert with anything. > Since you've noticed this, I think you should feel free to make the change. > Jonathan -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jul 2 17:13:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B127710301A5; Mon, 2 Jul 2018 17:13:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (mx-int.allbsd.org [IPv6:2001:2f0:104:e002::7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gatekeeper.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11249714C3; Mon, 2 Jul 2018 17:13:38 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:c00:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id w62HDF4N043826 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) (Client CN "/OU=GT07882699/OU=See+20www.rapidssl.com/resources/cps+20+28c+2915/OU=Domain+20Control+20Validated+20-+20RapidSSL+28R+29/CN=*.allbsd.org", Issuer "/C=US/O=GeoTrust+20Inc./CN=RapidSSL+20SHA256+20CA+20-+20G3"); Tue, 3 Jul 2018 02:13:27 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:c00:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id w62HD9bm037633 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Jul 2018 02:13:09 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:0:0:0:0:0:0:0:1]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id w62HD7fV037630; Tue, 3 Jul 2018 02:13:09 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 03 Jul 2018 02:09:56 +0900 (JST) Message-Id: <20180703.020956.859981414196673670.hrs@allbsd.org> To: daichigoto@icloud.com Cc: lists@eitanadler.com, daichi@freebsd.org, gnn@FreeBSD.org, cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335836 - head/usr.bin/top From: Hiroki Sato In-Reply-To: <459BD898-8072-426E-A968-96C1382AC616@icloud.com> References: <20180702.155529.1102410939281120947.hrs@allbsd.org> <459BD898-8072-426E-A968-96C1382AC616@icloud.com> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Jul__3_02_09_56_2018_607)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Mon, 02 Jul 2018 17:13:27 +0000 (UTC) X-Spam-Status: No, score=-94.8 required=13.0 tests=CONTENT_TYPE_PRESENT, ISO2022JP_BODY,QENCPTR1,QENCPTR2,RCVD_IN_AHBL,RCVD_IN_AHBL_PROXY, RCVD_IN_AHBL_SPAM,RDNS_NONE,SPF_SOFTFAIL,URIBL_SC2_SURBL,URIBL_XS_SURBL, USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mx.allbsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 17:13:40 -0000 ----Security_Multipart(Tue_Jul__3_02_09_56_2018_607)-- Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit $B8eF#BgCO(B wrote in <459BD898-8072-426E-A968-96C1382AC616@icloud.com>: da> da> da> > 2018/07/02 15:55$B!"(BHiroki Sato $B$N%a!<%k(B: da> > da> > Eitan Adler wrote da> > in : da> > da> > li> On 1 July 2018 at 10:08, Conrad Meyer wrote: da> > li> > Hi Daichi, da> > li> > da> > li> > da> > li> > da> > li> > I don't think code to decode UTF-8 belongs in top(1). I don't know da> > li> > what the goal of this routine is, but I doubt this is the right way to da> > li> > accomplish it. da> > li> da> > li> For the record, I agree. This is why I didn't click "accept" on the da> > li> revision. I don't fully oppose leaving it in top(1) for now as we work da> > li> out the API, but long term its the wrong place. da> > li> da> > li> https://reviews.freebsd.org/D16058 is the review. da> > da> > I strongly object this kind of encoding-specific routine. Please da> > back out it. The problem is that top(1) does not support multibyte da> > encoding in functions for printing, and using C99 wide/multibyte da> > character manipulation API such as iswprint(3) is the way to solve da> > it. Doing getenv("LANG") and assuming an encoding based on it is a da> > very bad practice to internationalize software. da> > da> > -- Hiroki da> da> I respect what you mean. da> da> Once I back out, I will begin implementing it in a different way. da> Please advise which function should be used for implementation da> (iswprint (3) and what other functions should be used?) Roughly speaking, POSIX/XPG/C99 I18N model requires the following steps: 1. Call setlocale(LC_ALL, "") first. 2. Use mbs<->wcs and/or mb<->wc conversion functions in C95/C99 to manipulate characters and strings depending on what you want to do. The printable() function should use mbtowc(3) and iswprint(3), for example. And wcslen(3) should be used to determine the length of characters to be printed instead of strlen(). Note that if mbs->wcs or mb->wc conversion fails with EILSEQ at some point, some of the character(s) are invalid for printing. This can happen because command-line parameters in top(1) are not always encoded in one specified in LC_CTYPE or LANG. It should also be handled as non-printable. However, to make matters worse, each process does not always use a single, same locale as top(1). A process invoked with LANG=ja_JP.eucJP may have EUC-JP characters in its ARGV array even if top(1) runs by another user whose LANG is en_US.UTF-8. You have to determine which locale should be used before doing mb->wc conversion. It is not so simple. 3. Print the multibyte characters by using strvisx(3) family, which supports multibyte character, or swprintf(3) family if you want to format wide characters directly. Note that buffer length for strvisx(3) must be calculated by using MB_LEN_MAX. I recommend you to learn about I18N by reading the following documents since this involves an I18N programming model, not just a matter of which function should be used. While they are quite old and contain system-specific topics, they are still useful to understand general overview of how XPG4 and the relevant C95/C99 APIs work: [1] Developer's Guide to Internationalization (801-6660) https://docs.oracle.com/cd/E19457-01/801-6660/801-6660.pdf [2] Software Internationalization Guide (526225-002) https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c02131936 [3] ISO/IEC 9899:TC2 draft (p.204, Sec. 7.11 Localization) http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf [4] Internationalization Guide, Version 2 ISBN: 978-0133535419 -- Hiroki ----Security_Multipart(Tue_Jul__3_02_09_56_2018_607)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEUEABECAAYFAls6XGQACgkQTyzT2CeTzy0S1gCYqZxIks21KRt8aXhWQFAbZc32 ZACcCe/wIH4C05HgRdJso+ALuG43WNk= =UBXt -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Jul__3_02_09_56_2018_607)---- From owner-svn-src-head@freebsd.org Mon Jul 2 17:18:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1C361030513; Mon, 2 Jul 2018 17:18:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90F6971814; Mon, 2 Jul 2018 17:18:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D15610668; Mon, 2 Jul 2018 17:18:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62HIl9L041893; Mon, 2 Jul 2018 17:18:47 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62HIlOt041892; Mon, 2 Jul 2018 17:18:47 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201807021718.w62HIlOt041892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 2 Jul 2018 17:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335865 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 335865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 17:18:48 -0000 Author: alc Date: Mon Jul 2 17:18:46 2018 New Revision: 335865 URL: https://svnweb.freebsd.org/changeset/base/335865 Log: Introduce vm_phys_enq_range(), and call it in vm_phys_alloc_npages() and vm_phys_alloc_seg_contig() instead of vm_phys_free_contig(). In short, vm_phys_enq_range() is simpler and faster than the more general vm_phys_free_contig(), and in the case of vm_phys_alloc_seg_contig(), vm_phys_free_contig() was placing the excess physical pages at the wrong end of the queues. In collaboration with: Doug Moore Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Mon Jul 2 14:15:30 2018 (r335864) +++ head/sys/vm/vm_phys.c Mon Jul 2 17:18:46 2018 (r335865) @@ -605,6 +605,43 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_f } /* + * Add the physical pages [m, m + npages) at the end of a power-of-two aligned + * and sized set to the specified free list. + * + * When this function is called by a page allocation function, the caller + * should request insertion at the head unless the lower-order queues are + * known to be empty. The objective being to reduce the likelihood of long- + * term fragmentation by promoting contemporaneous allocation and (hopefully) + * deallocation. + * + * The physical page m's buddy must not be free. + */ +static void +vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) +{ + u_int n; + int order; + + KASSERT(npages > 0, ("vm_phys_enq_range: npages is 0")); + KASSERT(((VM_PAGE_TO_PHYS(m) + npages * PAGE_SIZE) & + ((PAGE_SIZE << (fls(npages) - 1)) - 1)) == 0, + ("vm_phys_enq_range: page %p and npages %u are misaligned", + m, npages)); + do { + KASSERT(m->order == VM_NFREEORDER, + ("vm_phys_enq_range: page %p has unexpected order %d", + m, m->order)); + order = ffs(npages) - 1; + KASSERT(order < VM_NFREEORDER, + ("vm_phys_enq_range: order %d is out of range", order)); + vm_freelist_add(fl, m, order, tail); + n = 1 << order; + m += n; + npages -= n; + } while (npages > 0); +} + +/* * Tries to allocate the specified number of pages from the specified pool * within the specified domain. Returns the actual number of allocated pages * and a pointer to each page through the array ma[]. @@ -644,7 +681,12 @@ vm_phys_alloc_npages(int domain, int pool, int npages, for (end = i + need; i < end;) ma[i++] = m++; if (need < avail) { - vm_phys_free_contig(m, avail - need); + /* + * Return excess pages to fl. Its + * order [0, oind) queues are empty. + */ + vm_phys_enq_range(m, avail - need, fl, + 1); return (npages); } else if (i == npages) return (npages); @@ -662,8 +704,13 @@ vm_phys_alloc_npages(int domain, int pool, int npages, for (end = i + need; i < end;) ma[i++] = m++; if (need < avail) { - vm_phys_free_contig(m, avail - - need); + /* + * Return excess pages to fl. + * Its order [0, oind) queues + * are empty. + */ + vm_phys_enq_range(m, avail - + need, fl, 1); return (npages); } else if (i == npages) return (npages); @@ -1303,8 +1350,10 @@ done: } /* Return excess pages to the free lists. */ npages_end = roundup2(npages, 1 << oind); - if (npages < npages_end) - vm_phys_free_contig(&m_ret[npages], npages_end - npages); + if (npages < npages_end) { + fl = (*seg->free_queues)[VM_FREEPOOL_DEFAULT]; + vm_phys_enq_range(&m_ret[npages], npages_end - npages, fl, 0); + } return (m_ret); } From owner-svn-src-head@freebsd.org Mon Jul 2 17:50:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E695010321B9; Mon, 2 Jul 2018 17:50:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 980E872D32; Mon, 2 Jul 2018 17:50:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7943910B55; Mon, 2 Jul 2018 17:50:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62Holqn057526; Mon, 2 Jul 2018 17:50:47 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62HolqB057525; Mon, 2 Jul 2018 17:50:47 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807021750.w62HolqB057525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 2 Jul 2018 17:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335866 - head/sys/rpc X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/rpc X-SVN-Commit-Revision: 335866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 17:50:48 -0000 Author: rmacklem Date: Mon Jul 2 17:50:46 2018 New Revision: 335866 URL: https://svnweb.freebsd.org/changeset/base/335866 Log: Fix the server side krpc so that the kernel nfsd threads terminate. Occationally the kernel nfsd threads would not terminate when a SIGKILL was posted for the kernel process (called nfsd (slave)). When this occurred, the thread associated with the process (called "ismaster") had returned from svc_run_internal() and was sleeping waiting for the other threads to terminate. The other threads (created by kthread_start()) were still in svc_run_internal() handling NFS RPCs. The only way this could occur is for the "ismaster" thread to return from svc_run_internal() without having called svc_exit(). There was only one place in the code where this could happen and this patch stops that from happening. Since the problem is intermittent, I cannot be sure if this has fixed the problem, but I have not seen an occurrence of the problem with this patch applied. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16087 Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Mon Jul 2 17:18:46 2018 (r335865) +++ head/sys/rpc/svc.c Mon Jul 2 17:50:46 2018 (r335866) @@ -1185,7 +1185,8 @@ svc_run_internal(SVCGROUP *grp, bool_t ismaster) /* * Enforce maxthreads count. */ - if (grp->sg_threadcount > grp->sg_maxthreads) + if (!ismaster && grp->sg_threadcount > + grp->sg_maxthreads) break; /* From owner-svn-src-head@freebsd.org Mon Jul 2 18:19:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B581033531; Mon, 2 Jul 2018 18:19:09 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3189473ECC; Mon, 2 Jul 2018 18:19:09 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EA9C11068; Mon, 2 Jul 2018 18:19:09 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62IJ8Ue072882; Mon, 2 Jul 2018 18:19:08 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62IJ8Zt072881; Mon, 2 Jul 2018 18:19:08 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201807021819.w62IJ8Zt072881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 2 Jul 2018 18:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335868 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 335868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 18:19:09 -0000 Author: allanjude Date: Mon Jul 2 18:19:08 2018 New Revision: 335868 URL: https://svnweb.freebsd.org/changeset/base/335868 Log: stand/common/disk.c: Read partition table relative to the start of the disk If a disk is of an oddball size, like the 200mb + 512b used in rootgen.sh, when disk_open() is called on a GELI encrypted partition, attempts to read the partition table fail, as they pass through the decryption process which turns the already plaintext data into jibberish. When reading the partition table, always pass a slice and partition setting of -1, and an offset of 0. Setting the slice to -1 prevents a false positive when checking the slice against the cache of GELI encrypted slices. Reviewed by: imp, ian Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D15847 Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Mon Jul 2 17:54:33 2018 (r335867) +++ head/stand/common/disk.c Mon Jul 2 18:19:08 2018 (r335868) @@ -219,20 +219,13 @@ disk_ioctl(struct disk_devdesc *dev, u_long cmd, void int disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize) { + struct disk_devdesc partdev; struct open_disk *od; struct ptable *table; struct ptable_entry part; int rc, slice, partition; rc = 0; - /* - * While we are reading disk metadata, make sure we do it relative - * to the start of the disk - */ - dev->d_offset = 0; - table = NULL; - slice = dev->d_slice; - partition = dev->d_partition; od = (struct open_disk *)malloc(sizeof(struct open_disk)); if (od == NULL) { DEBUG("no memory"); @@ -242,11 +235,24 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize od->entrysize = 0; od->mediasize = mediasize; od->sectorsize = sectorsize; + /* + * While we are reading disk metadata, make sure we do it relative + * to the start of the disk + */ + memcpy(&partdev, dev, sizeof(partdev)); + partdev.d_offset = 0; + partdev.d_slice = -1; + partdev.d_partition = -1; + + table = NULL; + slice = dev->d_slice; + partition = dev->d_partition; + DEBUG("%s unit %d, slice %d, partition %d => %p", disk_fmtdev(dev), dev->dd.d_unit, dev->d_slice, dev->d_partition, od); /* Determine disk layout. */ - od->table = ptable_open(dev, mediasize / sectorsize, sectorsize, + od->table = ptable_open(&partdev, mediasize / sectorsize, sectorsize, ptblread); if (od->table == NULL) { DEBUG("Can't read partition table"); From owner-svn-src-head@freebsd.org Mon Jul 2 18:23:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D46C31033931; Mon, 2 Jul 2018 18:23:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 729C974353; Mon, 2 Jul 2018 18:23:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F8041121C; Mon, 2 Jul 2018 18:23:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62INiQK077751; Mon, 2 Jul 2018 18:23:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62INi8d077750; Mon, 2 Jul 2018 18:23:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201807021823.w62INi8d077750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 2 Jul 2018 18:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335869 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 335869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 18:23:45 -0000 Author: manu Date: Mon Jul 2 18:23:43 2018 New Revision: 335869 URL: https://svnweb.freebsd.org/changeset/base/335869 Log: stand: uboot: Do not panic if we can't find a boot device It is really anoying to panic when there is no boot device as you cannot see the availables ones. Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Jul 2 18:19:08 2018 (r335868) +++ head/stand/uboot/common/main.c Mon Jul 2 18:23:43 2018 (r335869) @@ -444,8 +444,10 @@ main(int argc, char **argv) /* * Enumerate U-Boot devices */ - if ((devs_no = ub_dev_enum()) == 0) - panic("no U-Boot devices found"); + if ((devs_no = ub_dev_enum()) == 0) { + printf("no U-Boot devices found"); + goto do_interact; + } printf("Number of U-Boot devices: %d\n", devs_no); get_load_device(&load_type, &load_unit, &load_slice, &load_partition); @@ -492,6 +494,7 @@ main(int argc, char **argv) env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset); printf("Booting from %s\n", ldev); +do_interact: setenv("LINES", "24", 1); /* optional */ setenv("prompt", "loader>", 1); From owner-svn-src-head@freebsd.org Mon Jul 2 19:03:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA9DF1035691 for ; Mon, 2 Jul 2018 19:03:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64EB7759FE for ; Mon, 2 Jul 2018 19:03:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id 188-v6so13353916ita.5 for ; Mon, 02 Jul 2018 12:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L7z9QgcOY31tmarM2jj8g02ZtLkzkytVhi+FrEPkd4Q=; b=bvLJCPEMlyTto3Q5RzAjuSJMblPt5e/mnp3W/g+vRcFHx5UzJOZnxjnpFm00GS5vqV XsXh45u+MlNfgrhRIy0y7b0hb/jCUWYO9Ax+QCFPgxjJ+pM8ZeTRIXP8XBFvaVv+C9WX tZ0hXYyXwE80k3ZNEqANVhG2E3ZnlI4octy5+NvD1PoAiDgqNwwvJvga20wi9RuuZ+6Z Z+D/jZXS0hyx11DGwJaBXV/9K5U9nfleT9rQ5gWWaxb6dnj7sIVP7EIoTUTJFcjnOSS5 a3zdXL1DJcPUKqA+VenyNM4oEy26pTQSCg5NMsbZfhlXL5rvI6ptntPeHnciOuyUCY3V EgRg== 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=L7z9QgcOY31tmarM2jj8g02ZtLkzkytVhi+FrEPkd4Q=; b=lcL2+28zRxLlMrimWz8CWlXa4UJEIjCTP/ZUF/hiT7dgRyRjx6aeZfO+hed3gri2DV aBQlrKpYDlY/tjljE7kDK3cqwUwPzHIPAZBh772Gu1n3U4ulQ1hzOV8LR9JrqcTJtfHS ZQwNpHF2XjcMmLE/EMiYMKriQTIkPvrzlqMy62NVqzu89Gems3Yy7cj/DGrLK1EJWk0Z Dtj0qGck5esp6WF1rVEazPTo/1c/ofXgZLgra3ZgzyPKy+F5xhtK4k0FnNPgsr4tSI6V bVQj5OQPRGGVWM9qZaY8Xz6y3L0lkEexH2Hha6mZgo0mAcuZxnoJIl/H+2Ibro6RXVmV aZpQ== X-Gm-Message-State: APt69E1Qn91wAa/rZ7JOPNAwTlgXvu4O/BpiFli9BB9051zs3yosza52 NNDcLahOOfBeJUjnWhwg9wcHMyaJtOtauEdvnjwHPA== X-Google-Smtp-Source: AAOMgpe+9+wrsDSrG4+sLs1a4/OwHOnbJa2M8+igEwgTeuOosmhdQCvB2tUJPEvlsaVwmx8+vJsouZyxoSImzmhwvWU= X-Received: by 2002:a24:d0d7:: with SMTP id m206-v6mr5981576itg.1.1530558225584; Mon, 02 Jul 2018 12:03:45 -0700 (PDT) MIME-Version: 1.0 References: <20180702.155529.1102410939281120947.hrs@allbsd.org> <459BD898-8072-426E-A968-96C1382AC616@icloud.com> <20180703.020956.859981414196673670.hrs@allbsd.org> In-Reply-To: <20180703.020956.859981414196673670.hrs@allbsd.org> From: Warner Losh Date: Mon, 2 Jul 2018 13:03:33 -0600 Message-ID: Subject: Re: svn commit: r335836 - head/usr.bin/top To: Hiroki Sato Cc: daichigoto@icloud.com, Eitan Adler , daichi@freebsd.org, gnn@freebsd.org, cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 19:03:47 -0000 Sato-san Sorry for the top post, but your message would make an excellent intro to i18n in one of our developer guides. Warner On Mon, Jul 2, 2018, 11:13 AM Hiroki Sato wrote: > =E5=BE=8C=E8=97=A4=E5=A4=A7=E5=9C=B0 wrote > in <459BD898-8072-426E-A968-96C1382AC616@icloud.com>: > > da> > da> > da> > 2018/07/02 15:55=E3=80=81Hiroki Sato =E3=81=AE=E3= =83=A1=E3=83=BC=E3=83=AB: > da> > > da> > Eitan Adler wrote > da> > in n9ZJweJH+Di800kJ3w@mail.gmail.com>: > da> > > da> > li> On 1 July 2018 at 10:08, Conrad Meyer wrote: > da> > li> > Hi Daichi, > da> > li> > > da> > li> > > da> > li> > > da> > li> > I don't think code to decode UTF-8 belongs in top(1). I don'= t > know > da> > li> > what the goal of this routine is, but I doubt this is the > right way to > da> > li> > accomplish it. > da> > li> > da> > li> For the record, I agree. This is why I didn't click "accept" on > the > da> > li> revision. I don't fully oppose leaving it in top(1) for now as > we work > da> > li> out the API, but long term its the wrong place. > da> > li> > da> > li> https://reviews.freebsd.org/D16058 is the review. > da> > > da> > I strongly object this kind of encoding-specific routine. Please > da> > back out it. The problem is that top(1) does not support multibyte > da> > encoding in functions for printing, and using C99 wide/multibyte > da> > character manipulation API such as iswprint(3) is the way to solve > da> > it. Doing getenv("LANG") and assuming an encoding based on it is a > da> > very bad practice to internationalize software. > da> > > da> > -- Hiroki > da> > da> I respect what you mean. > da> > da> Once I back out, I will begin implementing it in a different way. > da> Please advise which function should be used for implementation > da> (iswprint (3) and what other functions should be used?) > > Roughly speaking, POSIX/XPG/C99 I18N model requires the following > steps: > > 1. Call setlocale(LC_ALL, "") first. > > 2. Use mbs<->wcs and/or mb<->wc conversion functions in C95/C99 to > manipulate characters and strings depending on what you want to > do. The printable() function should use mbtowc(3) and > iswprint(3), for example. And wcslen(3) should be used to > determine the length of characters to be printed instead of > strlen(). > > Note that if mbs->wcs or mb->wc conversion fails with EILSEQ at > some point, some of the character(s) are invalid for printing. > This can happen because command-line parameters in top(1) are not > always encoded in one specified in LC_CTYPE or LANG. It should > also be handled as non-printable. However, to make matters worse, > each process does not always use a single, same locale as top(1). > A process invoked with LANG=3Dja_JP.eucJP may have EUC-JP characters > in its ARGV array even if top(1) runs by another user whose LANG > is en_US.UTF-8. You have to determine which locale should be used > before doing mb->wc conversion. It is not so simple. > > 3. Print the multibyte characters by using strvisx(3) family, which > supports multibyte character, or swprintf(3) family if you want to > format wide characters directly. Note that buffer length for > strvisx(3) must be calculated by using MB_LEN_MAX. > > I recommend you to learn about I18N by reading the following > documents since this involves an I18N programming model, not just a > matter of which function should be used. While they are quite old > and contain system-specific topics, they are still useful to > understand general overview of how XPG4 and the relevant C95/C99 APIs > work: > > [1] Developer's Guide to Internationalization (801-6660) > https://docs.oracle.com/cd/E19457-01/801-6660/801-6660.pdf > > [2] Software Internationalization Guide (526225-002) > > https://support.hpe.com/hpsc/doc/public/display?docId=3Demr_na-c02131936 > > [3] ISO/IEC 9899:TC2 draft (p.204, Sec. 7.11 Localization) > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf > > [4] Internationalization Guide, Version 2 > ISBN: 978-0133535419 > > -- Hiroki > From owner-svn-src-head@freebsd.org Mon Jul 2 19:21:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 848CF10374F0; Mon, 2 Jul 2018 19:21:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3243F7640E; Mon, 2 Jul 2018 19:21:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14CF611B7C; Mon, 2 Jul 2018 19:21:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62JLZCj006884; Mon, 2 Jul 2018 19:21:35 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62JLYcf006879; Mon, 2 Jul 2018 19:21:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807021921.w62JLYcf006879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 2 Jul 2018 19:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335870 - in head/sys/fs: nfs nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 335870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 19:21:36 -0000 Author: rmacklem Date: Mon Jul 2 19:21:33 2018 New Revision: 335870 URL: https://svnweb.freebsd.org/changeset/base/335870 Log: Add an optional feature to the pNFS server. Without this patch, the pNFS server distributes the data storage files across all of the specified DSs. A tester noted that it would be nice if a system administrator could control which DSs are used to store the file data for a given exported MDS file system. This patch adds the kernel support to do this. It also makes a slight semantic change to nfsv4_findmirror(), since some uses of it no longer require that the DS being searched for have a current mirror. A patch that will be committed in a few minutes will modify the nfsd daemon to support this feature. The patch should only affect sites using the pNFS server (specified via the "-p" command line option for nfsd. Suggested by: james.rose@framestore.com Modified: head/sys/fs/nfs/nfs.h head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfsrvstate.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Mon Jul 2 18:23:43 2018 (r335869) +++ head/sys/fs/nfs/nfs.h Mon Jul 2 19:21:33 2018 (r335870) @@ -185,6 +185,8 @@ struct nfsd_nfsd_args { int dnshostlen; /* Length of DNS names */ char *dspath; /* DS Mount path on MDS */ int dspathlen; /* Length of DS Mount path on MDS */ + char *mdspath; /* MDS mount for DS path on MDS */ + int mdspathlen; /* Length of MDS mount for DS path on MDS */ int mirrorcnt; /* Number of mirrors to create on DSs */ }; Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Mon Jul 2 18:23:43 2018 (r335869) +++ head/sys/fs/nfs/nfs_commonsubs.c Mon Jul 2 19:21:33 2018 (r335870) @@ -4692,37 +4692,26 @@ nfsv4_freeslot(struct nfsclsession *sep, int slot) } /* - * Search for a matching pnfsd mirror device structure, base on the nmp arg. + * Search for a matching pnfsd DS, based on the nmp arg. * Return one if found, NULL otherwise. */ struct nfsdevice * nfsv4_findmirror(struct nfsmount *nmp) { - struct nfsdevice *ds, *fndds; - int fndmirror; + struct nfsdevice *ds; mtx_assert(NFSDDSMUTEXPTR, MA_OWNED); /* * Search the DS server list for a match with nmp. - * Remove the DS entry if found and there is a mirror. */ - fndds = NULL; - fndmirror = 0; if (nfsrv_devidcnt == 0) - return (fndds); + return (NULL); TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds->nfsdev_nmp == nmp) { - NFSCL_DEBUG(4, "fnd main ds\n"); - fndds = ds; - } else if (ds->nfsdev_nmp != NULL) - fndmirror = 1; - if (fndds != NULL && fndmirror != 0) + NFSCL_DEBUG(4, "nfsv4_findmirror: fnd main ds\n"); break; + } } - if (fndmirror == 0) { - NFSCL_DEBUG(4, "no mirror for DS\n"); - return (NULL); - } - return (fndds); + return (ds); } Modified: head/sys/fs/nfs/nfsrvstate.h ============================================================================== --- head/sys/fs/nfs/nfsrvstate.h Mon Jul 2 18:23:43 2018 (r335869) +++ head/sys/fs/nfs/nfsrvstate.h Mon Jul 2 19:21:33 2018 (r335870) @@ -345,9 +345,11 @@ struct nfsdevice { uint16_t nfsdev_hostnamelen; uint16_t nfsdev_fileaddrlen; uint16_t nfsdev_flexaddrlen; + uint16_t nfsdev_mdsisset; char *nfsdev_fileaddr; char *nfsdev_flexaddr; char *nfsdev_host; + fsid_t nfsdev_mdsfsid; uint32_t nfsdev_nextdir; vnode_t nfsdev_dsdir[0]; }; Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jul 2 18:23:43 2018 (r335869) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jul 2 19:21:33 2018 (r335870) @@ -3355,6 +3355,10 @@ nfssvc_nfsd(struct thread *td, struct nfssvc_args *uap nfsdarg.addrlen = 0; nfsdarg.dnshost = NULL; nfsdarg.dnshostlen = 0; + nfsdarg.dspath = NULL; + nfsdarg.dspathlen = 0; + nfsdarg.mdspath = NULL; + nfsdarg.mdspathlen = 0; nfsdarg.mirrorcnt = 1; } } else @@ -3364,14 +3368,15 @@ nfssvc_nfsd(struct thread *td, struct nfssvc_args *uap if (nfsdarg.addrlen > 0 && nfsdarg.addrlen < 10000 && nfsdarg.dnshostlen > 0 && nfsdarg.dnshostlen < 10000 && nfsdarg.dspathlen > 0 && nfsdarg.dspathlen < 10000 && + nfsdarg.mdspathlen > 0 && nfsdarg.mdspathlen < 10000 && nfsdarg.mirrorcnt >= 1 && nfsdarg.mirrorcnt <= NFSDEV_MAXMIRRORS && nfsdarg.addr != NULL && nfsdarg.dnshost != NULL && - nfsdarg.dspath != NULL) { + nfsdarg.dspath != NULL && nfsdarg.mdspath != NULL) { NFSD_DEBUG(1, "addrlen=%d dspathlen=%d dnslen=%d" - " mirrorcnt=%d\n", nfsdarg.addrlen, + " mdspathlen=%d mirrorcnt=%d\n", nfsdarg.addrlen, nfsdarg.dspathlen, nfsdarg.dnshostlen, - nfsdarg.mirrorcnt); + nfsdarg.mdspathlen, nfsdarg.mirrorcnt); cp = malloc(nfsdarg.addrlen + 1, M_TEMP, M_WAITOK); error = copyin(nfsdarg.addr, cp, nfsdarg.addrlen); if (error != 0) { @@ -3399,6 +3404,17 @@ nfssvc_nfsd(struct thread *td, struct nfssvc_args *uap } cp[nfsdarg.dspathlen] = '\0'; /* Ensure nul term. */ nfsdarg.dspath = cp; + cp = malloc(nfsdarg.mdspathlen + 1, M_TEMP, M_WAITOK); + error = copyin(nfsdarg.mdspath, cp, nfsdarg.mdspathlen); + if (error != 0) { + free(nfsdarg.addr, M_TEMP); + free(nfsdarg.dnshost, M_TEMP); + free(nfsdarg.dspath, M_TEMP); + free(cp, M_TEMP); + goto out; + } + cp[nfsdarg.mdspathlen] = '\0'; /* Ensure nul term. */ + nfsdarg.mdspath = cp; } else { nfsdarg.addr = NULL; nfsdarg.addrlen = 0; @@ -3406,12 +3422,15 @@ nfssvc_nfsd(struct thread *td, struct nfssvc_args *uap nfsdarg.dnshostlen = 0; nfsdarg.dspath = NULL; nfsdarg.dspathlen = 0; + nfsdarg.mdspath = NULL; + nfsdarg.mdspathlen = 0; nfsdarg.mirrorcnt = 1; } error = nfsrvd_nfsd(td, &nfsdarg); free(nfsdarg.addr, M_TEMP); free(nfsdarg.dnshost, M_TEMP); free(nfsdarg.dspath, M_TEMP); + free(nfsdarg.mdspath, M_TEMP); } else if (uap->flag & NFSSVC_PNFSDS) { error = copyin(uap->argp, &pnfsdarg, sizeof(pnfsdarg)); if (error == 0 && pnfsdarg.op == PNFSDOP_DELDSSERVER) { @@ -3846,9 +3865,12 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, /* Get a DS server directory in a round-robin order. */ mirrorcnt = 1; + mp = vp->v_mount; NFSDDSLOCK(); TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { - if (ds->nfsdev_nmp != NULL) + if (ds->nfsdev_nmp != NULL && (ds->nfsdev_mdsisset == 0 || + (mp->mnt_stat.f_fsid.val[0] == ds->nfsdev_mdsfsid.val[0] && + mp->mnt_stat.f_fsid.val[1] == ds->nfsdev_mdsfsid.val[1]))) break; } if (ds == NULL) { @@ -3862,7 +3884,12 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, mds = TAILQ_NEXT(ds, nfsdev_list); if (nfsrv_maxpnfsmirror > 1 && mds != NULL) { TAILQ_FOREACH_FROM(mds, &nfsrv_devidhead, nfsdev_list) { - if (mds->nfsdev_nmp != NULL) { + if (mds->nfsdev_nmp != NULL && + (mds->nfsdev_mdsisset == 0 || + (mp->mnt_stat.f_fsid.val[0] == + mds->nfsdev_mdsfsid.val[0] && + mp->mnt_stat.f_fsid.val[1] == + mds->nfsdev_mdsfsid.val[1]))) { dsdir[mirrorcnt] = i; dvp[mirrorcnt] = mds->nfsdev_dsdir[i]; mirrorcnt++; @@ -4464,6 +4491,7 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char struct nfsmount *curnmp, int *ippos, int *dsdirp) { struct vnode *dvp, *nvp, **tdvpp; + struct mount *mp; struct nfsmount *nmp, *newnmp; struct sockaddr *sad; struct sockaddr_in *sin; @@ -4485,6 +4513,7 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char newnmp = *newnmpp; else newnmp = NULL; + mp = vp->v_mount; error = vn_extattr_get(vp, IO_NODELOCKED, EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsfile", buflenp, buf, p); mirrorcnt = *buflenp / sizeof(*pf); @@ -4545,7 +4574,13 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char fndds = ds; else if (newnmpp != NULL && newnmp == NULL && - (*newnmpp == NULL || fndds == NULL)) + (*newnmpp == NULL || + fndds == NULL) && + (ds->nfsdev_mdsisset == 0 || + (ds->nfsdev_mdsfsid.val[0] == + mp->mnt_stat.f_fsid.val[0] && + ds->nfsdev_mdsfsid.val[1] == + mp->mnt_stat.f_fsid.val[1]))) /* * Return a destination for the * copy in newnmpp. Choose the Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Mon Jul 2 18:23:43 2018 (r335869) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Mon Jul 2 19:21:33 2018 (r335870) @@ -210,7 +210,7 @@ static void nfsrv_freelayouts(nfsquad_t *clid, fsid_t int iomode); static void nfsrv_freealllayouts(void); static void nfsrv_freedevid(struct nfsdevice *ds); -static int nfsrv_setdsserver(char *dspathp, NFSPROC_T *p, +static int nfsrv_setdsserver(char *dspathp, char *mdspathp, NFSPROC_T *p, struct nfsdevice **dsp); static int nfsrv_delds(char *devid, NFSPROC_T *p); static void nfsrv_deleteds(struct nfsdevice *fndds); @@ -232,6 +232,7 @@ static int nfsrv_dontlayout(fhandle_t *fhp); static int nfsrv_createdsfile(vnode_t vp, fhandle_t *fhp, struct pnfsdsfile *pf, vnode_t dvp, struct nfsdevice *ds, struct ucred *cred, NFSPROC_T *p, vnode_t *tvpp); +static struct nfsdevice *nfsrv_findmirroredds(struct nfsmount *nmp); /* * Scan the client list for a match and either return the current one, @@ -7369,10 +7370,12 @@ nfsrv_freealllayouts(void) * Look up the mount path for the DS server. */ static int -nfsrv_setdsserver(char *dspathp, NFSPROC_T *p, struct nfsdevice **dsp) +nfsrv_setdsserver(char *dspathp, char *mdspathp, NFSPROC_T *p, + struct nfsdevice **dsp) { struct nameidata nd; struct nfsdevice *ds; + struct mount *mp; int error, i; char *dsdirpath; size_t dsdirsize; @@ -7400,6 +7403,9 @@ nfsrv_setdsserver(char *dspathp, NFSPROC_T *p, struct * Allocate a DS server structure with the NFS mounted directory * vnode reference counted, so that a non-forced dismount will * fail with EBUSY. + * This structure is always linked into the list, even if an error + * is being returned. The caller will free the entire list upon + * an error return. */ *dsp = ds = malloc(sizeof(*ds) + nfsrv_dsdirsize * sizeof(vnode_t), M_NFSDSTATE, M_WAITOK | M_ZERO); @@ -7435,6 +7441,36 @@ nfsrv_setdsserver(char *dspathp, NFSPROC_T *p, struct } free(dsdirpath, M_TEMP); + if (strlen(mdspathp) > 0) { + /* + * This DS stores file for a specific MDS exported file + * system. + */ + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, + UIO_SYSSPACE, mdspathp, p); + error = namei(&nd); + NFSD_DEBUG(4, "mds lookup=%d\n", error); + if (error != 0) + goto out; + if (nd.ni_vp->v_type != VDIR) { + vput(nd.ni_vp); + error = ENOTDIR; + NFSD_DEBUG(4, "mdspath not dir\n"); + goto out; + } + mp = nd.ni_vp->v_mount; + if ((mp->mnt_flag & MNT_EXPORTED) == 0) { + vput(nd.ni_vp); + error = ENXIO; + NFSD_DEBUG(4, "mdspath not an exported fs\n"); + goto out; + } + ds->nfsdev_mdsfsid = mp->mnt_stat.f_fsid; + ds->nfsdev_mdsisset = 1; + vput(nd.ni_vp); + } + +out: TAILQ_INSERT_TAIL(&nfsrv_devidhead, ds, nfsdev_list); atomic_add_int(&nfsrv_devidcnt, 1); return (error); @@ -7514,11 +7550,7 @@ nfsrv_deldsnmp(struct nfsmount *nmp, NFSPROC_T *p) NFSD_DEBUG(4, "deldsdvp\n"); NFSDDSLOCK(); - if (nfsrv_faildscnt <= 0) { - NFSDDSUNLOCK(); - return (NULL); - } - fndds = nfsv4_findmirror(nmp); + fndds = nfsrv_findmirroredds(nmp); if (fndds != NULL) nfsrv_deleteds(fndds); NFSDDSUNLOCK(); @@ -7551,21 +7583,35 @@ nfsrv_delds(char *devid, NFSPROC_T *p) nmp = NULL; fndmirror = 0; NFSDDSLOCK(); - if (nfsrv_faildscnt <= 0) { - NFSDDSUNLOCK(); - return (ENXIO); - } TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (NFSBCMP(ds->nfsdev_deviceid, devid, NFSX_V4DEVICEID) == 0 && ds->nfsdev_nmp != NULL) { NFSD_DEBUG(4, "fnd main ds\n"); fndds = ds; - } else if (ds->nfsdev_nmp != NULL) - fndmirror = 1; - if (fndds != NULL && fndmirror != 0) break; + } } - if (fndds != NULL && fndmirror != 0) { + if (fndds == NULL) { + NFSDDSUNLOCK(); + return (ENXIO); + } + if (fndds->nfsdev_mdsisset == 0 && nfsrv_faildscnt > 0) + fndmirror = 1; + else { + /* For the fsid is set case, search for a mirror. */ + TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { + if (ds != fndds && ds->nfsdev_nmp != NULL && + ds->nfsdev_mdsisset != 0 && + ds->nfsdev_mdsfsid.val[0] == + fndds->nfsdev_mdsfsid.val[0] && + ds->nfsdev_mdsfsid.val[1] == + fndds->nfsdev_mdsfsid.val[1]) { + fndmirror = 1; + break; + } + } + } + if (fndmirror != 0) { nmp = fndds->nfsdev_nmp; NFSLOCKMNT(nmp); if ((nmp->nm_privflag & (NFSMNTP_FORCEDISM | @@ -7579,7 +7625,7 @@ nfsrv_delds(char *devid, NFSPROC_T *p) } } NFSDDSUNLOCK(); - if (fndds != NULL && nmp != NULL) { + if (nmp != NULL) { nfsrv_flexmirrordel(fndds->nfsdev_deviceid, p); printf("pNFS server: mirror %s failed\n", fndds->nfsdev_host); nfsrv_killrpcs(nmp); @@ -7601,7 +7647,8 @@ nfsrv_deleteds(struct nfsdevice *fndds) NFSD_DEBUG(4, "deleteds: deleting a mirror\n"); fndds->nfsdev_nmp = NULL; - nfsrv_faildscnt--; + if (fndds->nfsdev_mdsisset == 0) + nfsrv_faildscnt--; } /* @@ -7687,24 +7734,27 @@ int nfsrv_createdevids(struct nfsd_nfsd_args *args, NFSPROC_T *p) { struct nfsdevice *ds; - char *addrp, *dnshostp, *dspathp; + char *addrp, *dnshostp, *dspathp, *mdspathp; int error, i; addrp = args->addr; dnshostp = args->dnshost; dspathp = args->dspath; + mdspathp = args->mdspath; nfsrv_maxpnfsmirror = args->mirrorcnt; - if (addrp == NULL || dnshostp == NULL || dspathp == NULL) + if (addrp == NULL || dnshostp == NULL || dspathp == NULL || + mdspathp == NULL) return (0); /* * Loop around for each nul-terminated string in args->addr, - * args->dnshost and args->dnspath. + * args->dnshost, args->dnspath and args->mdspath. */ while (addrp < (args->addr + args->addrlen) && dnshostp < (args->dnshost + args->dnshostlen) && - dspathp < (args->dspath + args->dspathlen)) { - error = nfsrv_setdsserver(dspathp, p, &ds); + dspathp < (args->dspath + args->dspathlen) && + mdspathp < (args->mdspath + args->mdspathlen)) { + error = nfsrv_setdsserver(dspathp, mdspathp, p, &ds); if (error != 0) { /* Free all DS servers. */ nfsrv_freealldevids(); @@ -7715,6 +7765,7 @@ nfsrv_createdevids(struct nfsd_nfsd_args *args, NFSPRO addrp += (strlen(addrp) + 1); dnshostp += (strlen(dnshostp) + 1); dspathp += (strlen(dspathp) + 1); + mdspathp += (strlen(mdspathp) + 1); } if (nfsrv_devidcnt < nfsrv_maxpnfsmirror) { /* Free all DS servers. */ @@ -8299,9 +8350,15 @@ nfsrv_mdscopymr(char *mdspathp, char *dspathp, char *c } nmp = VFSTONFS(nd.ni_vp->v_mount); - /* Search the nfsdev list for a match. */ + /* + * Search the nfsdevice list for a match. If curnmp == NULL, + * this is a recovery and there must be a mirror. + */ NFSDDSLOCK(); - *dsp = nfsv4_findmirror(nmp); + if (curnmp == NULL) + *dsp = nfsrv_findmirroredds(nmp); + else + *dsp = nfsv4_findmirror(nmp); NFSDDSUNLOCK(); if (*dsp == NULL) { vput(nd.ni_vp); @@ -8331,7 +8388,7 @@ nfsrv_mdscopymr(char *mdspathp, char *dspathp, char *c if (error == 0 && nmp != NULL) { /* Search the nfsdev list for a match. */ NFSDDSLOCK(); - *dsp = nfsv4_findmirror(nmp); + *dsp = nfsrv_findmirroredds(nmp); NFSDDSUNLOCK(); } if (error == 0 && (nmp == NULL || *dsp == NULL)) { @@ -8374,5 +8431,56 @@ nfsrv_mdscopymr(char *mdspathp, char *dspathp, char *c } else vput(vp); return (error); +} + +/* + * Search for a matching pnfsd mirror device structure, base on the nmp arg. + * Return one if found, NULL otherwise. + */ +static struct nfsdevice * +nfsrv_findmirroredds(struct nfsmount *nmp) +{ + struct nfsdevice *ds, *fndds; + int fndmirror; + + mtx_assert(NFSDDSMUTEXPTR, MA_OWNED); + /* + * Search the DS server list for a match with nmp. + * Remove the DS entry if found and there is a mirror. + */ + fndds = NULL; + fndmirror = 0; + if (nfsrv_devidcnt == 0) + return (fndds); + TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { + if (ds->nfsdev_nmp == nmp) { + NFSD_DEBUG(4, "nfsrv_findmirroredds: fnd main ds\n"); + fndds = ds; + break; + } + } + if (fndds == NULL) + return (fndds); + if (fndds->nfsdev_mdsisset == 0 && nfsrv_faildscnt > 0) + fndmirror = 1; + else { + /* For the fsid is set case, search for a mirror. */ + TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { + if (ds != fndds && ds->nfsdev_nmp != NULL && + ds->nfsdev_mdsisset != 0 && + ds->nfsdev_mdsfsid.val[0] == + fndds->nfsdev_mdsfsid.val[0] && + ds->nfsdev_mdsfsid.val[1] == + fndds->nfsdev_mdsfsid.val[1]) { + fndmirror = 1; + break; + } + } + } + if (fndmirror == 0) { + NFSD_DEBUG(4, "nfsrv_findmirroredds: no mirror for DS\n"); + return (NULL); + } + return (fndds); } From owner-svn-src-head@freebsd.org Mon Jul 2 19:26:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CDB51037956; Mon, 2 Jul 2018 19:26:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2963476807; Mon, 2 Jul 2018 19:26:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0625211BCE; Mon, 2 Jul 2018 19:26:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62JQVac008951; Mon, 2 Jul 2018 19:26:31 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62JQVHD008950; Mon, 2 Jul 2018 19:26:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807021926.w62JQVHD008950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 2 Jul 2018 19:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335871 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 335871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 19:26:32 -0000 Author: rmacklem Date: Mon Jul 2 19:26:31 2018 New Revision: 335871 URL: https://svnweb.freebsd.org/changeset/base/335871 Log: Add an optional feature to the pNFS server. Without this patch, the pNFS server distributes the data storage files across all of the specified DSs. A tester noted that it would be nice if a system administrator could control which DSs are used to store the file data for a given exported MDS file system. This patch adds an optional suffix for each entry in the "-p" option argument that specifies "store file data for this MDS file system" in this DS. The patch should only affect sites using the pNFS server (specified via the "-p" command line option for nfsd. The interface between the nfsd and the kernel has changed with this patch, so anyone using the "-p" option needs to rebuild their nfsd from sources with this patch applied to them. Discussed with: james.rose@framestore.com Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Mon Jul 2 19:21:33 2018 (r335870) +++ head/usr.sbin/nfsd/nfsd.c Mon Jul 2 19:26:31 2018 (r335871) @@ -1180,9 +1180,11 @@ static void parse_dsserver(const char *optionarg, struct nfsd_nfsd_args *nfsdargp) { char *ad, *cp, *cp2, *dsaddr, *dshost, *dspath, *dsvol, nfsprt[9]; + char *mdspath, *mdsp; int ecode; u_int adsiz, dsaddrcnt, dshostcnt, dspathcnt, hostsiz, pathsiz; - size_t dsaddrsiz, dshostsiz, dspathsiz, nfsprtsiz; + u_int mdspathcnt; + size_t dsaddrsiz, dshostsiz, dspathsiz, nfsprtsiz, mdspathsiz; struct addrinfo hints, *ai_tcp; struct sockaddr_in sin; @@ -1206,6 +1208,11 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd dsaddr = malloc(dsaddrsiz); if (dsaddr == NULL) errx(1, "Out of memory"); + mdspathsiz = 1024; + mdspathcnt = 0; + mdspath = malloc(mdspathsiz); + if (mdspath == NULL) + errx(1, "Out of memory"); /* Put the NFS port# in "." form. */ snprintf(nfsprt, 9, ".%d.%d", 2049 >> 8, 2049 & 0xff); @@ -1227,6 +1234,14 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd usage(); *dsvol++ = '\0'; + /* Optional path for MDS file system to be stored on DS. */ + mdsp = strchr(dsvol, '#'); + if (mdsp != NULL) { + if (*(mdsp + 1) == '\0' || mdsp <= dsvol) + usage(); + *mdsp++ = '\0'; + } + /* Append this pathname to dspath. */ pathsiz = strlen(dsvol); if (dspathcnt + pathsiz + 1 > dspathsiz) { @@ -1238,6 +1253,23 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd strcpy(&dspath[dspathcnt], dsvol); dspathcnt += pathsiz + 1; + /* Append this pathname to mdspath. */ + if (mdsp != NULL) + pathsiz = strlen(mdsp); + else + pathsiz = 0; + if (mdspathcnt + pathsiz + 1 > mdspathsiz) { + mdspathsiz *= 2; + mdspath = realloc(mdspath, mdspathsiz); + if (mdspath == NULL) + errx(1, "Out of memory"); + } + if (mdsp != NULL) + strcpy(&mdspath[mdspathcnt], mdsp); + else + mdspath[mdspathcnt] = '\0'; + mdspathcnt += pathsiz + 1; + if (ai_tcp != NULL) freeaddrinfo(ai_tcp); @@ -1290,6 +1322,8 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd nfsdargp->dnshostlen = dshostcnt; nfsdargp->dspath = dspath; nfsdargp->dspathlen = dspathcnt; + nfsdargp->mdspath = mdspath; + nfsdargp->mdspathlen = mdspathcnt; freeaddrinfo(ai_tcp); } From owner-svn-src-head@freebsd.org Mon Jul 2 19:33:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25F901038031; Mon, 2 Jul 2018 19:33:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C297576D7B; Mon, 2 Jul 2018 19:33:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 879F411D78; Mon, 2 Jul 2018 19:33:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62JXQLG013803; Mon, 2 Jul 2018 19:33:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62JXQji013802; Mon, 2 Jul 2018 19:33:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807021933.w62JXQji013802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 2 Jul 2018 19:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335872 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 335872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 19:33:27 -0000 Author: rmacklem Date: Mon Jul 2 19:33:26 2018 New Revision: 335872 URL: https://svnweb.freebsd.org/changeset/base/335872 Log: Document the "#mds_path" suffix for the "-p" command line option. r335871 added support for an optional suffix of "#mds_path" that can be applied to each entry in the "-p" option argument. This specifies that the DS should be used to store files for the file system on the MDS at "mds_path". This patch documents this optional suffix. This is a content change. Modified: head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Mon Jul 2 19:26:31 2018 (r335871) +++ head/usr.sbin/nfsd/nfsd.8 Mon Jul 2 19:33:26 2018 (r335872) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd May 31, 2018 +.Dd June 30, 2018 .Dt NFSD 8 .Os .Sh NAME @@ -126,21 +126,40 @@ so the .Dq server hostname must resolve to an IPv4 address and support mounts on that address. This needs to be extended to support IPv6 addresses in the near future. +This can optionally be followed by a '#' and the mds_path, which is the +directory path for an exported file system on this MDS. +If this is specified, it means that this DS is to be used to store data +files for this mds_path file system only. +If this optional component does not exist, the DS will be used to store data +files for all exported MDS file systems. The DS storage file systems must be mounted on this system before the .Nm is started with this option specified. +.br For example: .sp nfsv4-data0:/data0,nfsv4-data1:/data1 .sp -Would specify two DS servers called nfsv4-data0 and nfsv4-data1 that comprise +would specify two DS servers called nfsv4-data0 and nfsv4-data1 that comprise the data storage component of the pNFS service. +These two DSs would be used to store data files for all exported file systems +on this MDS. The directories .Dq /data0 and .Dq /data1 are where the data storage servers exported storage directories are mounted on this system (which will act as the MDS). +.br +Whereas, for the example: +.sp +nfsv4-data0:/data0#/export1,nfsv4-data1:/data1#/export2 +.sp +would specify two DSs as above, however nfsv4-data0 will be used to store +data files for +.Dq /export1 +and nfsv4-data1 will be used to store data files for +.Dq /export2 . .El .It Fl m Ar mirror_level This option is only meaningful when used with the @@ -155,6 +174,17 @@ The .Dq mirror_level would normally be set to 2 to enable mirroring, but can be as high as NFSDEV_MAXMIRRORS. +There must be at least +.Dq mirror_level +DSs for each exported file system on the MDS, as specified in the +.Fl p +option. +This implies that, for the above example using "#/export1" and "#/export2", +mirroring cannot be done. +There would need to be two DS entries for each of "#/export1" and "#/export2" +in order to support a +.Dq mirror_level +of two. .Pp If mirroring is enabled, the server must use the Flexible File layout. From owner-svn-src-head@freebsd.org Mon Jul 2 19:48:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96CAB1038B5F; Mon, 2 Jul 2018 19:48:41 +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 42BFD775F1; Mon, 2 Jul 2018 19:48:41 +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 1F56F11F17; Mon, 2 Jul 2018 19:48:41 +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 w62Jmexj019390; Mon, 2 Jul 2018 19:48:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62JmcV6019378; Mon, 2 Jul 2018 19:48:38 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807021948.w62JmcV6019378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 2 Jul 2018 19:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335873 - in head: . sys/amd64/amd64 sys/amd64/include sys/conf sys/i386/i386 sys/i386/include sys/sys sys/vm X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: . sys/amd64/amd64 sys/amd64/include sys/conf sys/i386/i386 sys/i386/include sys/sys sys/vm X-SVN-Commit-Revision: 335873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 19:48:41 -0000 Author: mmacy Date: Mon Jul 2 19:48:38 2018 New Revision: 335873 URL: https://svnweb.freebsd.org/changeset/base/335873 Log: inline atomics and allow tied modules to inline locks - inline atomics in modules on i386 and amd64 (they were always inline on other arches) - allow modules to opt in to inlining locks by specifying MODULE_TIED=1 in the makefile Reviewed by: kib Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D16079 Deleted: head/sys/amd64/amd64/atomic.c head/sys/i386/i386/atomic.c Modified: head/UPDATING head/sys/amd64/include/atomic.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/kmod.mk head/sys/i386/include/atomic.h head/sys/sys/lock.h head/sys/sys/module.h head/sys/sys/mutex.h head/sys/sys/param.h head/sys/vm/vm_map.h head/sys/vm/vm_page.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jul 2 19:33:26 2018 (r335872) +++ head/UPDATING Mon Jul 2 19:48:38 2018 (r335873) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180702: + On i386 and amd64 atomics are now inlined. Out of tree modules using + atomics will need to be rebuilt. + 20180701: The '%I' format in the kern.corefile sysctl limits the number of core files that a process can generate to the number stored in the Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/amd64/include/atomic.h Mon Jul 2 19:48:38 2018 (r335873) @@ -96,7 +96,7 @@ * Kernel modules call real functions which are built into the kernel. * This allows kernel modules to be portable between UP and SMP systems. */ -#if defined(KLD_MODULE) || !defined(__GNUCLIKE_ASM) +#if !defined(__GNUCLIKE_ASM) #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \ void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/conf/files.amd64 Mon Jul 2 19:48:38 2018 (r335873) @@ -126,7 +126,6 @@ acpi_wakedata.h optional acpi \ clean "acpi_wakedata.h" # #amd64/amd64/apic_vector.S standard -amd64/amd64/atomic.c standard amd64/amd64/bios.c standard amd64/amd64/bpf_jit_machdep.c optional bpf_jitter amd64/amd64/cpu_switch.S standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/conf/files.i386 Mon Jul 2 19:48:38 2018 (r335873) @@ -474,8 +474,6 @@ i386/bios/smapi.c optional smapi i386/bios/smapi_bios.S optional smapi i386/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 #i386/i386/apic_vector.s optional apic -i386/i386/atomic.c standard \ - compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}" i386/i386/bios.c standard i386/i386/bioscall.s standard i386/i386/bpf_jit_machdep.c optional bpf_jitter Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/conf/kmod.mk Mon Jul 2 19:48:38 2018 (r335873) @@ -111,6 +111,9 @@ WERROR?= -Werror CFLAGS+= ${WERROR} CFLAGS+= -D_KERNEL CFLAGS+= -DKLD_MODULE +.if defined(MODULE_TIED) +CFLAGS+= -DKLD_TIED +.endif # Don't use any standard or source-relative include directories. NOSTDINC= -nostdinc Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/i386/include/atomic.h Mon Jul 2 19:48:38 2018 (r335873) @@ -104,7 +104,7 @@ __mbu(void) * Kernel modules call real functions which are built into the kernel. * This allows kernel modules to be portable between UP and SMP systems. */ -#if defined(KLD_MODULE) || !defined(__GNUCLIKE_ASM) +#if !defined(__GNUCLIKE_ASM) #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \ void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/sys/lock.h Mon Jul 2 19:48:38 2018 (r335873) @@ -127,7 +127,7 @@ struct lock_class { * calling conventions for this debugging code in modules so that modules can * work with both debug and non-debug kernels. */ -#if defined(KLD_MODULE) || defined(WITNESS) || defined(INVARIANTS) || \ +#if (defined(KLD_MODULE) && !defined(KLD_TIED)) || defined(WITNESS) || defined(INVARIANTS) || \ defined(LOCK_PROFILING) || defined(KTR) #define LOCK_DEBUG 1 #else Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/sys/module.h Mon Jul 2 19:48:38 2018 (r335873) @@ -146,8 +146,13 @@ struct mod_pnp_match_info SYSINIT(name##module, sub, order, module_register_init, &data); \ struct __hack +#ifdef KLD_TIED #define DECLARE_MODULE(name, data, sub, order) \ + DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version) +#else +#define DECLARE_MODULE(name, data, sub, order) \ DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, MODULE_KERNEL_MAXVER) +#endif /* * The module declared with DECLARE_MODULE_TIED can only be loaded Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/sys/mutex.h Mon Jul 2 19:48:38 2018 (r335873) @@ -138,7 +138,7 @@ void _thread_lock(struct thread *td, int opts, const c void _thread_lock(struct thread *); #endif -#if defined(LOCK_PROFILING) || defined(KLD_MODULE) +#if defined(LOCK_PROFILING) || (defined(KLD_MODULE) && !defined(KLD_TIED)) #define thread_lock(tdp) \ thread_lock_flags_((tdp), 0, __FILE__, __LINE__) #elif LOCK_DEBUG > 0 Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/sys/param.h Mon Jul 2 19:48:38 2018 (r335873) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200069 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200070 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/vm/vm_map.h Mon Jul 2 19:48:38 2018 (r335873) @@ -206,7 +206,7 @@ struct vm_map { #define MAP_BUSY_WAKEUP 0x02 #ifdef _KERNEL -#ifdef KLD_MODULE +#if defined(KLD_MODULE) && !defined(KLD_TIED) #define vm_map_max(map) vm_map_max_KBI((map)) #define vm_map_min(map) vm_map_min_KBI((map)) #define vm_map_pmap(map) vm_map_pmap_KBI((map)) Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Jul 2 19:33:26 2018 (r335872) +++ head/sys/vm/vm_page.h Mon Jul 2 19:48:38 2018 (r335873) @@ -304,7 +304,7 @@ extern struct mtx_padalign pa_lock[]; #define PA_LOCK_ASSERT(pa, a) mtx_assert(PA_LOCKPTR(pa), (a)) -#ifdef KLD_MODULE +#if defined(KLD_MODULE) && !defined(KLD_TIED) #define vm_page_lock(m) vm_page_lock_KBI((m), LOCK_FILE, LOCK_LINE) #define vm_page_unlock(m) vm_page_unlock_KBI((m), LOCK_FILE, LOCK_LINE) #define vm_page_trylock(m) vm_page_trylock_KBI((m), LOCK_FILE, LOCK_LINE) @@ -734,7 +734,7 @@ vm_page_dirty(vm_page_t m) { /* Use vm_page_dirty_KBI() under INVARIANTS to save memory. */ -#if defined(KLD_MODULE) || defined(INVARIANTS) +#if (defined(KLD_MODULE) && !defined(KLD_TIED)) || defined(INVARIANTS) vm_page_dirty_KBI(m); #else m->dirty = VM_PAGE_BITS_ALL; From owner-svn-src-head@freebsd.org Mon Jul 2 20:56:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6F0D103C99E; Mon, 2 Jul 2018 20:56:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 547E379B69; Mon, 2 Jul 2018 20:56:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 318F712A4E; Mon, 2 Jul 2018 20:56:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62KuHjs054773; Mon, 2 Jul 2018 20:56:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62KuHrE054772; Mon, 2 Jul 2018 20:56:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201807022056.w62KuHrE054772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 2 Jul 2018 20:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335874 - head/stand/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/stand/zfs X-SVN-Commit-Revision: 335874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 20:56:18 -0000 Author: mav Date: Mon Jul 2 20:56:17 2018 New Revision: 335874 URL: https://svnweb.freebsd.org/changeset/base/335874 Log: Cut currdev dev and path fields for ZFS on the last colon. Previously the code cut those fields on second colon, that prevented boot from boot environments with colon in their names. This change moves the limitation from dev field to path, which is empty by default. Reviewed by: allanjude, tsoome MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D16068 Modified: head/stand/zfs/zfs.c Modified: head/stand/zfs/zfs.c ============================================================================== --- head/stand/zfs/zfs.c Mon Jul 2 19:48:38 2018 (r335873) +++ head/stand/zfs/zfs.c Mon Jul 2 20:56:17 2018 (r335874) @@ -662,7 +662,7 @@ zfs_parsedev(struct zfs_devdesc *dev, const char *devs if (*np != ':') return (EINVAL); np++; - end = strchr(np, ':'); + end = strrchr(np, ':'); if (end == NULL) return (EINVAL); sep = strchr(np, '/'); From owner-svn-src-head@freebsd.org Mon Jul 2 22:51:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 855C0FE0E48; Mon, 2 Jul 2018 22:51:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 314487DEC9; Mon, 2 Jul 2018 22:51:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC5C613D19; Mon, 2 Jul 2018 22:51:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62MpmK5015048; Mon, 2 Jul 2018 22:51:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62MpmlW015047; Mon, 2 Jul 2018 22:51:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807022251.w62MpmlW015047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Jul 2018 22:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335876 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 22:51:49 -0000 Author: ian Date: Mon Jul 2 22:51:48 2018 New Revision: 335876 URL: https://svnweb.freebsd.org/changeset/base/335876 Log: Allow making just one flavor of boot-test image based on cmdline args. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Jul 2 21:20:36 2018 (r335875) +++ head/tools/boot/rootgen.sh Mon Jul 2 22:51:48 2018 (r335876) @@ -740,6 +740,25 @@ qemu_i386_both() echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" >> $sh } +make_one_image() +{ + local arch=${1?} + local geli=${2?} + local scheme=${3?} + local fs=${4?} + local bios=${5?} + + # Create sparse file and mount newly created filesystem(s) on it + img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img + sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh + echo "vvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvv" + rm -f ${img}* + eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} + eval qemu_${arch}_${bios} ${img} ${sh} + [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* + echo "^^^^^^^^^^^^^^ Created $img ^^^^^^^^^^^^^^^" +} + # mips # qemu-system-mips -kernel /path/to/rootfs/boot/kernel/kernel -nographic -hda /path/to/disk.img -m 2048 @@ -791,6 +810,13 @@ echo "RC COMMAND RUNNING -- SUCCESS!!!!!" halt -p EOF +# If we were given exactly 5 args, go make that one image. + +if [ $# -eq 5 ]; then + make_one_image $* + exit +fi + # OK. Let the games begin for arch in amd64; do @@ -798,15 +824,7 @@ for arch in amd64; do for scheme in gpt mbr; do for fs in ufs zfs; do for bios in legacy uefi both; do - # Create sparse file and mount newly created filesystem(s) on it - img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img - sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh - echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done @@ -824,15 +842,7 @@ for arch in i386; do for scheme in gpt mbr; do for fs in ufs zfs; do for bios in legacy; do - # Create sparse file and mount newly created filesystem(s) on it - img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img - sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh - echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done @@ -843,15 +853,7 @@ for arch in arm aarch64; do for scheme in gpt mbr; do fs=ufs for bios in uboot efi; do - # Create sparse file and mount newly created filesystem(s) on it - img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img - sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh - echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done @@ -860,15 +862,7 @@ for arch in powerpc powerpc64; do for scheme in ppc-wtf; do fs=ufs for bios in ofw uboot chrp; do - # Create sparse file and mount newly created filesystem(s) on it - img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img - sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh - echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done @@ -878,15 +872,7 @@ for arch in sparc64; do for scheme in vtoc8; do for fs in ufs; do for bios in ofw; do - # Create sparse file and mount newly created filesystem(s) on it - img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img - sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh - echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${arch}_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done From owner-svn-src-head@freebsd.org Mon Jul 2 22:58:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73956FE1757; Mon, 2 Jul 2018 22:58:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48E0E7E49D; Mon, 2 Jul 2018 22:58:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2571F13D4C; Mon, 2 Jul 2018 22:58:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62Mw4q0016281; Mon, 2 Jul 2018 22:58:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62Mw42s016280; Mon, 2 Jul 2018 22:58:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807022258.w62Mw42s016280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Jul 2018 22:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335877 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 22:58:05 -0000 Author: ian Date: Mon Jul 2 22:58:04 2018 New Revision: 335877 URL: https://svnweb.freebsd.org/changeset/base/335877 Log: Move the passphrase and iteration count into variables. This is purely to make it easier to tweak them locally; the machine I have for testing takes forever to do 50,000 pw strengthening iterations, and we're not testing the strength of geli's anti-pw-guessing logic here (especially given that our test passphrase is "passphrase", except that I tend to tweak that also, to 'x', because typing is hard). Some day these should be settable as cmdline args. But then, some day this whole script should probably get a rewrite. :) Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Jul 2 22:51:48 2018 (r335876) +++ head/tools/boot/rootgen.sh Mon Jul 2 22:58:04 2018 (r335877) @@ -2,6 +2,9 @@ # $FreeBSD$ +passphrase=x +iterations=5000 + do_boot1_efi=0 # @@ -394,8 +397,8 @@ mk_geli_gpt_ufs_legacy() { gpart add -t freebsd-boot -s 400k -a 4k ${md} # <= ~540k gpart add -t freebsd-ufs -l root $md # install-boot will make this bootable - echo passphrase | geli init -bg -e AES-XTS -i 50000 -J - -l 256 -s 4096 ${md}p2 - echo passphrase | geli attach -j - ${md}p2 + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2 + echo ${passphrase} | geli attach -j - ${md}p2 newfs /dev/${md}p2.eli mount /dev/${md}p2.eli ${mntpt} cpsys ${src} ${mntpt} @@ -430,8 +433,8 @@ mk_geli_gpt_ufs_uefi() { gpart add -t efi -s 800k -a 4k ${md} gpart add -t freebsd-ufs -l root $md # install-boot will make this bootable - echo passphrase | geli init -bg -e AES-XTS -i 50000 -J - -l 256 -s 4096 ${md}p2 - echo passphrase | geli attach -j - ${md}p2 + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2 + echo ${passphrase} | geli attach -j - ${md}p2 newfs /dev/${md}p2.eli mount /dev/${md}p2.eli ${mntpt} cpsys ${src} ${mntpt} @@ -467,8 +470,8 @@ mk_geli_gpt_ufs_both() { gpart add -t freebsd-boot -s 400k -a 4k ${md} # <= ~540k gpart add -t freebsd-ufs -l root $md # install-boot will make this bootable - echo passphrase | geli init -bg -e AES-XTS -i 50000 -J - -l 256 -s 4096 ${md}p3 - echo passphrase | geli attach -j - ${md}p3 + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p3 + echo ${passphrase} | geli attach -j - ${md}p3 newfs /dev/${md}p3.eli mount /dev/${md}p3.eli ${mntpt} cpsys ${src} ${mntpt} @@ -504,8 +507,8 @@ mk_geli_gpt_zfs_legacy() { gpart add -t freebsd-boot -s 400k -a 4k ${md} # <= ~540k gpart add -t freebsd-zfs -l root $md # install-boot will make this bootable - echo passphrase | geli init -bg -e AES-XTS -i 50000 -J - -l 256 -s 4096 ${md}p2 - echo passphrase | geli attach -j - ${md}p2 + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2 + echo ${passphrase} | geli attach -j - ${md}p2 zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli zpool set bootfs=${pool} ${pool} zfs create -po mountpoint=/ ${pool}/ROOT/default @@ -547,8 +550,8 @@ mk_geli_gpt_zfs_uefi() { gpart add -t efi -s 800k -a 4k ${md} gpart add -t freebsd-zfs -l root $md # install-boot will make this bootable - echo passphrase | geli init -bg -e AES-XTS -i 50000 -J - -l 256 -s 4096 ${md}p2 - echo passphrase | geli attach -j - ${md}p2 + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2 + echo ${passphrase} | geli attach -j - ${md}p2 zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli zpool set bootfs=${pool} ${pool} zfs create -po mountpoint=/ ${pool}/ROOT/default @@ -591,8 +594,8 @@ mk_geli_gpt_zfs_both() { gpart add -t freebsd-boot -s 400k -a 4k ${md} # <= ~540k gpart add -t freebsd-zfs -l root $md # install-boot will make this bootable - echo passphrase | geli init -bg -e AES-XTS -i 50000 -J - -l 256 -s 4096 ${md}p3 - echo passphrase | geli attach -j - ${md}p3 + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p3 + echo ${passphrase} | geli attach -j - ${md}p3 zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p3.eli zpool set bootfs=${pool} ${pool} zfs create -po mountpoint=/ ${pool}/ROOT/default From owner-svn-src-head@freebsd.org Mon Jul 2 22:59:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DE1FE19B1; Mon, 2 Jul 2018 22:59:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71A447E6BC; Mon, 2 Jul 2018 22:59:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5465413D4E; Mon, 2 Jul 2018 22:59:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62MxUu5016423; Mon, 2 Jul 2018 22:59:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62MxUVb016422; Mon, 2 Jul 2018 22:59:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807022259.w62MxUVb016422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Jul 2018 22:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335878 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 22:59:30 -0000 Author: ian Date: Mon Jul 2 22:59:29 2018 New Revision: 335878 URL: https://svnweb.freebsd.org/changeset/base/335878 Log: Doh! Commit the proper default values, not my local tweaks. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Jul 2 22:58:04 2018 (r335877) +++ head/tools/boot/rootgen.sh Mon Jul 2 22:59:29 2018 (r335878) @@ -2,8 +2,8 @@ # $FreeBSD$ -passphrase=x -iterations=5000 +passphrase=passphrase +iterations=50000 do_boot1_efi=0 From owner-svn-src-head@freebsd.org Tue Jul 3 01:55:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 397E9FEDBFC; Tue, 3 Jul 2018 01:55:12 +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 D894B84D98; Tue, 3 Jul 2018 01:55:11 +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 B9D1915A38; Tue, 3 Jul 2018 01:55:11 +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 w631tBI9009478; Tue, 3 Jul 2018 01:55:11 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w631tARo009470; Tue, 3 Jul 2018 01:55:10 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807030155.w631tARo009470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 01:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335879 - in head/sys: conf kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: conf kern sys X-SVN-Commit-Revision: 335879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 01:55:12 -0000 Author: mmacy Date: Tue Jul 3 01:55:09 2018 New Revision: 335879 URL: https://svnweb.freebsd.org/changeset/base/335879 Log: make critical_{enter, exit} inline Avoid pulling in all of the dependencies by automatically generating a stripped down thread_lite exporting only the fields of interest. The field declarations are type checked against the original and the offsets of the generated result is automatically checked. kib has expressed disagreement and would have preferred to simply use genassym style offsets (which loses type check enforcement). jhb has expressed dislike of it due to header pollution and a duplicate structure. He would have preferred to just have defined thread in _thread.h. Nonetheless, he admits that this is the only viable solution at the moment. The impetus for this came from mjg's D15331: "Inline critical_enter/exit for amd64" Reviewed by: jeff Differential Revision: https://reviews.freebsd.org/D16078 Added: head/sys/kern/genoffset.c (contents, props changed) head/sys/kern/genoffset.sh (contents, props changed) head/sys/sys/kpilite.h (contents, props changed) Modified: head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/kern/kern_switch.c head/sys/sys/assym.h head/sys/sys/systm.h Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Mon Jul 2 22:59:29 2018 (r335878) +++ head/sys/conf/kern.post.mk Tue Jul 3 01:55:09 2018 (r335879) @@ -185,13 +185,25 @@ hack.pico: Makefile ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.pico rm -f hack.c -assym.inc: $S/kern/genassym.sh genassym.o +offset.inc: $S/kern/genoffset.sh genoffset.o + NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > ${.TARGET} + +genoffset.o: $S/kern/genoffset.c + ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c + +genoffset_test.c: $S/kern/genoffset.c + cp $S/kern/genoffset.c genoffset_test.c + +genoffset_test.o: genoffset_test.c offset.inc + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.c + +assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} -genassym.o: $S/$M/$M/genassym.c +genassym.o: $S/$M/$M/genassym.c offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c -${SYSTEM_OBJS} genassym.o vers.o: opt_global.h +${SYSTEM_OBJS} genoffset.o genassym.o vers.o: opt_global.h .if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon) _meta_filemon= 1 @@ -213,10 +225,10 @@ _SKIP_DEPEND= 1 .endif kernel-depend: .depend -SRCS= assym.inc vnode_if.h ${BEFORE_DEPEND} ${CFILES} \ +SRCS= assym.inc offset.inc vnode_if.h ${BEFORE_DEPEND} ${CFILES} \ ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} -DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o +DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o genoffset.o DEPENDFILES= ${DEPENDOBJS:O:u:C/^/.depend./} .if ${MAKE_VERSION} < 20160220 DEPEND_MP?= -MP Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Mon Jul 2 22:59:29 2018 (r335878) +++ head/sys/conf/kern.pre.mk Tue Jul 3 01:55:09 2018 (r335879) @@ -195,7 +195,7 @@ OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_ME OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} -GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} +GEN_CFILES= $S/$M/$M/genassym.c $S/kern/genoffset.c ${MFILES:T:S/.m$/.c/} SYSTEM_CFILES= config.c env.c hints.c vnode_if.c SYSTEM_DEP= Makefile ${SYSTEM_OBJS} SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} Added: head/sys/kern/genoffset.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/genoffset.c Tue Jul 3 01:55:09 2018 (r335879) @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef OFFSET_TEST +#define GENOFFSET +#endif +#include +__FBSDID("$FreeBSD$"); +#include +#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); +OFFSYM(td_pinned, thread, int); +OFFSYM(td_owepreempt, thread, u_char); Added: head/sys/kern/genoffset.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/genoffset.sh Tue Jul 3 01:55:09 2018 (r335879) @@ -0,0 +1,141 @@ +#!/bin/sh + +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2000, Bruce Evans +# Copyright (c) 2018, Jeff Roberson +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +usage() +{ + echo "usage: genoffset [-o outfile] objfile" + exit 1 +} + + +work() +{ + echo "#ifndef _OFFSET_INC_" + echo "#define _OFFSET_INC_" + echo "#if !defined(GENOFFSET) && !defined(KLD_MODULE)" + ${NM:='nm'} ${NMFLAGS} "$1" | ${AWK:='awk'} ' + / C .*_datatype_*/ { + type = substr($3, match($3, "_datatype_") + length("_datatype_")) + } + / C .*_parenttype_*/ { + parent = substr($3, match($3, "_parenttype_") + length("_parenttype_")) + } + / C .*sign$/ { + sign = substr($1, length($1) - 3, 4) + sub("^0*", "", sign) + if (sign != "") + sign = "-" + } + / C .*w0$/ { + w0 = substr($1, length($1) - 3, 4) + } + / C .*w1$/ { + w1 = substr($1, length($1) - 3, 4) + } + / C .*w2$/ { + w2 = substr($1, length($1) - 3, 4) + } + / C .*w3$/ { + w3 = substr($1, length($1) - 3, 4) + w = w3 w2 w1 w0 + sub("^0*", "", w) + if (w == "") + w = "0" + hex = "" + if (w != "0") + hex = "0x" + sub("w3$", "", $3) + member = tolower($3) + # This still has minor problems representing INT_MIN, etc. + # E.g., + # with 32-bit 2''s complement ints, this prints -0x80000000, + # which has the wrong type (unsigned int). + offset = sprintf("%s%s%s", sign, hex, w) + + structures[parent] = sprintf("%s%s %s %s\n", + structures[parent], offset, type, member) + } + END { + for (struct in structures) { + printf("struct %s_lite {\n", struct); + n = split(structures[struct], members, "\n") + for (i = 1; i < n; i++) { + for (j = i + 1; j < n; j++) { + split(members[i], ivar, " ") + split(members[j], jvar, " ") + if (jvar[1] < ivar[1]) { + tmp = members[i] + members[i] = members[j] + members[j] = tmp + } + } + } + off = "0" + for (i = 1; i < n; i++) { + split(members[i], m, " ") + printf "\tu_char\tpad_%s[%s - %s];\n", m[3], m[1], off + printf "\t%s\t%s;\n", m[2], m[3] + off = sprintf("(%s + sizeof(%s))", m[1], m[2]) + } + printf("};\n"); + } + } + ' + + echo "#endif" + echo "#endif" +} + + +# +#MAIN PROGGRAM +# +use_outfile="no" +while getopts "o:" option +do + case "$option" in + o) outfile="$OPTARG" + use_outfile="yes";; + *) usage;; + esac +done +shift $(($OPTIND - 1)) +case $# in +1) ;; +*) usage;; +esac + +if [ "$use_outfile" = "yes" ] +then + work $1 3>"$outfile" >&3 3>&- +else + work $1 +fi + Modified: head/sys/kern/kern_switch.c ============================================================================== --- head/sys/kern/kern_switch.c Mon Jul 2 22:59:29 2018 (r335878) +++ head/sys/kern/kern_switch.c Tue Jul 3 01:55:09 2018 (r335879) @@ -199,17 +199,17 @@ choosethread(void) * the function call itself, for most cases. */ void -critical_enter(void) +critical_enter_KBI(void) { - struct thread *td; - - td = curthread; - td->td_critnest++; +#ifdef KTR + struct thread *td = curthread; +#endif + critical_enter(); CTR4(KTR_CRITICAL, "critical_enter by thread %p (%ld, %s) to %d", td, (long)td->td_proc->p_pid, td->td_name, td->td_critnest); } -static void __noinline +void __noinline critical_exit_preempt(void) { struct thread *td; @@ -245,17 +245,12 @@ critical_exit_preempt(void) } void -critical_exit(void) +critical_exit_KBI(void) { - struct thread *td; - - td = curthread; - KASSERT(td->td_critnest != 0, - ("critical_exit: td_critnest == 0")); - td->td_critnest--; - __compiler_membar(); - if (__predict_false(td->td_owepreempt)) - critical_exit_preempt(); +#ifdef KTR + struct thread *td = curthread; +#endif + critical_exit(); CTR4(KTR_CRITICAL, "critical_exit by thread %p (%ld, %s) to %d", td, (long)td->td_proc->p_pid, td->td_name, td->td_critnest); } Modified: head/sys/sys/assym.h ============================================================================== --- head/sys/sys/assym.h Mon Jul 2 22:59:29 2018 (r335878) +++ head/sys/sys/assym.h Tue Jul 3 01:55:09 2018 (r335879) @@ -43,4 +43,19 @@ char name ## w1[((ASSYM_ABS(value) & 0xFFFF0000UL) >> char name ## w2[((ASSYM_ABS(value) & 0xFFFF00000000ULL) >> 32) + ASSYM_BIAS]; \ char name ## w3[((ASSYM_ABS(value) & 0xFFFF000000000000ULL) >> 48) + ASSYM_BIAS] + +/* char name ## _datatype_ ## STRINGIFY(typeof(((struct parenttype *)(0x0))-> name)) [1]; */ +#ifdef OFFSET_TEST +#define OFFSET_CTASSERT CTASSERT +#else +#define OFFSET_CTASSERT(...) +#endif + +#define OFFSYM(name, parenttype, datatype) \ +ASSYM(name, offsetof(struct parenttype, name)); \ +char name ## _datatype_ ## datatype [1]; \ +char name ## _parenttype_ ## parenttype [1]; \ +CTASSERT(__builtin_types_compatible_p(__typeof(((struct parenttype *)(0x0))-> name), datatype)); \ +OFFSET_CTASSERT(offsetof(struct parenttype, name) == offsetof(struct parenttype ## _lite, name)) + #endif /* !_SYS_ASSYM_H_ */ Added: head/sys/sys/kpilite.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/kpilite.h Tue Jul 3 01:55:09 2018 (r335879) @@ -0,0 +1,55 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_KPILITE_H_ +#define _SYS_KPILITE_H_ +#if !defined(GENOFFSET) && !defined(KLD_MODULE) && defined(_KERNEL) +#include "offset.inc" + +static __inline void +sched_pin_lite(struct thread_lite *td) +{ + + KASSERT((struct thread *)td == curthread, ("sched_pin called on non curthread")); + td->td_pinned++; + __compiler_membar(); +} + +static __inline void +sched_unpin_lite(struct thread_lite *td) +{ + + KASSERT((struct thread *)td == curthread, ("sched_unpin called on non curthread")); + KASSERT(td->td_pinned > 0, ("sched_unpin called on non pinned thread")); + __compiler_membar(); + td->td_pinned--; + __compiler_membar(); +} +#endif +#endif Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon Jul 2 22:59:29 2018 (r335878) +++ head/sys/sys/systm.h Tue Jul 3 01:55:09 2018 (r335879) @@ -107,6 +107,12 @@ void kassert_panic(const char *fmt, ...) __printflike #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") #endif +#if defined(_KERNEL) +#include /* MAXCPU */ +#include /* curthread */ +#include +#endif + /* * Assert that a pointer can be loaded from memory atomically. * @@ -214,12 +220,44 @@ void vpanic(const char *, __va_list) __dead2 __printfl void cpu_boot(int); void cpu_flush_dcache(void *, size_t); void cpu_rootconf(void); -void critical_enter(void); -void critical_exit(void); +void critical_enter_KBI(void); +void critical_exit_KBI(void); +void critical_exit_preempt(void); void init_param1(void); void init_param2(long physpages); void init_static_kenv(char *, size_t); void tablefull(const char *); + +#if defined(KLD_MODULE) || defined(KTR_CRITICAL) || !defined(_KERNEL) || defined(GENOFFSET) +#define critical_enter() critical_enter_KBI() +#define critical_exit() critical_exit_KBI() +#else +static __inline void +critical_enter(void) +{ + struct thread_lite *td; + + td = (struct thread_lite *)curthread; + td->td_critnest++; +} + +static __inline void +critical_exit(void) +{ + struct thread_lite *td; + + td = (struct thread_lite *)curthread; + KASSERT(td->td_critnest != 0, + ("critical_exit: td_critnest == 0")); + td->td_critnest--; + __compiler_membar(); + if (__predict_false(td->td_owepreempt)) + critical_exit_preempt(); + +} +#endif + + #ifdef EARLY_PRINTF typedef void early_putc_t(int ch); extern early_putc_t *early_putc; From owner-svn-src-head@freebsd.org Tue Jul 3 02:50:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 524B0FF116F; Tue, 3 Jul 2018 02:50:08 +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 03BC786722; Tue, 3 Jul 2018 02:50:08 +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 D38C61624E; Tue, 3 Jul 2018 02:50:07 +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 w632o7cZ035012; Tue, 3 Jul 2018 02:50:07 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w632o7Oa035010; Tue, 3 Jul 2018 02:50:07 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807030250.w632o7Oa035010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 02:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335880 - in head/sys: conf kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: conf kern X-SVN-Commit-Revision: 335880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 02:50:08 -0000 Author: mmacy Date: Tue Jul 3 02:50:07 2018 New Revision: 335880 URL: https://svnweb.freebsd.org/changeset/base/335880 Log: expose thread_lite definition to tied modules Modified: head/sys/conf/kmod.mk head/sys/kern/genoffset.sh Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Jul 3 01:55:09 2018 (r335879) +++ head/sys/conf/kmod.mk Tue Jul 3 02:50:07 2018 (r335880) @@ -463,9 +463,10 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYS .endif .if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc) -CLEANFILES+= assym.inc genassym.o -DEPENDOBJS+= genassym.o +CLEANFILES+= assym.inc genassym.o genoffset.o +DEPENDOBJS+= genassym.o genoffset.o assym.inc: genassym.o +offset.inc: genoffset.o .if defined(KERNBUILDDIR) genassym.o: opt_global.h .endif @@ -475,6 +476,12 @@ genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c genassym.o: ${SRCS:Mopt_*.h} ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c +offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o + sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET} +genoffset.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c +genoffset.o: ${SRCS:Mopt_*.h} + ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ + ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c .endif .if defined(KERNBUILDDIR) Modified: head/sys/kern/genoffset.sh ============================================================================== --- head/sys/kern/genoffset.sh Tue Jul 3 01:55:09 2018 (r335879) +++ head/sys/kern/genoffset.sh Tue Jul 3 02:50:07 2018 (r335880) @@ -39,7 +39,7 @@ work() { echo "#ifndef _OFFSET_INC_" echo "#define _OFFSET_INC_" - echo "#if !defined(GENOFFSET) && !defined(KLD_MODULE)" + echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED))" ${NM:='nm'} ${NMFLAGS} "$1" | ${AWK:='awk'} ' / C .*_datatype_*/ { type = substr($3, match($3, "_datatype_") + length("_datatype_")) From owner-svn-src-head@freebsd.org Tue Jul 3 02:54:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12376FF1963; Tue, 3 Jul 2018 02:54:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC5B086C8A; Tue, 3 Jul 2018 02:54:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E48A163D9; Tue, 3 Jul 2018 02:54:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w632sWEx039798; Tue, 3 Jul 2018 02:54:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w632sWAs039797; Tue, 3 Jul 2018 02:54:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201807030254.w632sWAs039797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Jul 2018 02:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335881 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 02:54:33 -0000 Author: cy Date: Tue Jul 3 02:54:32 2018 New Revision: 335881 URL: https://svnweb.freebsd.org/changeset/base/335881 Log: When toggling the display using the "m" command to toggle from 'cpu' mode to 'io' mode, an artifact remains because the buffer is not "finished" with a NULL terminator using sbuf_finish(). An example of this is, when the "m" command is entered, the title line will contain COMMANDND instead of COMMAND. This commit fixes this. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Tue Jul 3 02:50:07 2018 (r335880) +++ head/usr.bin/top/machine.c Tue Jul 3 02:54:32 2018 (r335881) @@ -408,6 +408,7 @@ format_header(const char *uname_field) ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : "", namelength, namelength, uname_field); sbuf_cat(header, " VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"); + sbuf_finish(header); break; } case DISP_MAX: From owner-svn-src-head@freebsd.org Tue Jul 3 04:02:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C7CEFF6242; Tue, 3 Jul 2018 04:02:41 +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 1ACD289C95; Tue, 3 Jul 2018 04:02:41 +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 F05A016FAE; Tue, 3 Jul 2018 04:02:40 +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 w6342eLU076993; Tue, 3 Jul 2018 04:02:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6342eb8076992; Tue, 3 Jul 2018 04:02:40 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807030402.w6342eb8076992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 04:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335882 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 335882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 04:02:41 -0000 Author: mmacy Date: Tue Jul 3 04:02:40 2018 New Revision: 335882 URL: https://svnweb.freebsd.org/changeset/base/335882 Log: expose sched_{pin,unpin}_lite to tied modules Modified: head/sys/sys/kpilite.h Modified: head/sys/sys/kpilite.h ============================================================================== --- head/sys/sys/kpilite.h Tue Jul 3 02:54:32 2018 (r335881) +++ head/sys/sys/kpilite.h Tue Jul 3 04:02:40 2018 (r335882) @@ -29,7 +29,7 @@ #ifndef _SYS_KPILITE_H_ #define _SYS_KPILITE_H_ -#if !defined(GENOFFSET) && !defined(KLD_MODULE) && defined(_KERNEL) +#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED)) && defined(_KERNEL) #include "offset.inc" static __inline void From owner-svn-src-head@freebsd.org Tue Jul 3 05:38:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05DF1000994; Tue, 3 Jul 2018 05:38:45 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8717F8D59F; Tue, 3 Jul 2018 05:38:45 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it0-x22f.google.com with SMTP id o5-v6so1473769itc.1; Mon, 02 Jul 2018 22:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ugb9FfroEuwl31mMCMIcmCqTDy+d+NN0Eps074Bl/WE=; b=Pgjhout2QPveDDSar9vw2NqF/c+rbg+nsdxG0siRV+rpvy1qQ4PJ9zmNlQKsOxvr3v CwFG8891OIk0vYAcvbdl0jCch49oWBWYSAizYbr7w0sTwaQoEVcxKMFrziElOU+ceMm2 CUS9HwoBxEyuQ2Fu5M7kG+2Jj2utcp5wLj9k3Jwg7OEh9H8dVsjxl2yWvq3xjVvlX4Ka WDvbSXdRbfnsm1FlMJyEymzme5YJ8pKyOU3M0Wwpg4aFSONXFyFQXLbIYLu77aCcdjoh 8GayWIOxbJ57DvFEaLxYx3dJqXRzcrlUI3QaG5rU4ZcRZ93IFhT5Xs273Ft4UQpF+n2R hDyw== 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:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Ugb9FfroEuwl31mMCMIcmCqTDy+d+NN0Eps074Bl/WE=; b=COuYkAv61YsBNsiQYMHcAB8Js48EgG4s6lbzR/8J0NDmBwDNXIczYhnU53o7BG460x ex4sNF0BDdMaub+S5F1oQTg2OrXrNEC2tsCgTygU6IBHN5kGzLCXoY0usUlVwQ1m9R7l DpSVpqZGrZQUdiovofTJEPH/QvjNtPW2OXhvWaEqHPH3xzTuMkmZn7sonkaUlwXd3vVW HicEXD5krd1q75fZUlHIPK7H+0D8ZKJg3uh/vx63N2xWsFCxsV9x/93Gvv5haMoc/m0F ggQyWpo60nbCwmlmquo/6HTJ4co0X1Xfh74cwrMjTGwm3V2D1SgkhCHzW0ed8x1qNLSn 9nWg== X-Gm-Message-State: APt69E1IF8GNscCOfquCzFb5ykEVNTEldxpNDF7jUcaAHTbWho9HZysP yjehtibedrzXerbHRbnC2gwFHLZauvUf4c2SnR04Dg== X-Google-Smtp-Source: AAOMgpcnleOs8JHcnaPGbmbap8+p3/0iaCidBhM/5wAJk5u2HSTrw+odz1n1p2vvg9oOB4IW1lrZjq4ArzIBhOFYfXw= X-Received: by 2002:a24:3d0b:: with SMTP id n11-v6mr11267246itn.29.1530596324697; Mon, 02 Jul 2018 22:38:44 -0700 (PDT) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 2002:a02:a495:0:0:0:0:0 with HTTP; Mon, 2 Jul 2018 22:38:43 -0700 (PDT) In-Reply-To: <201807010116.w611G35w008185@repo.freebsd.org> References: <201807010116.w611G35w008185@repo.freebsd.org> From: Antoine Brodin Date: Tue, 3 Jul 2018 07:38:43 +0200 X-Google-Sender-Auth: mEzTUA3bQmghoMYDRNPl9_lO4PU Message-ID: Subject: Re: svn commit: r335833 - in head: share/man/man4 sys/net sys/netpfil/pf To: Will Andrews Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 05:38:46 -0000 On Sun, Jul 1, 2018 at 3:16 AM, Will Andrews wrote: > Author: will > Date: Sun Jul 1 01:16:03 2018 > New Revision: 335833 > URL: https://svnweb.freebsd.org/changeset/base/335833 > > Log: > pf: remove unused ioctls. > > Several ioctls are unused in pf, in the sense that no base utility > references them. Additionally, a cursory review of pf-based ports > indicates they're not used elsewhere either. Some of them have been > unused since the original import. As far as I can tell, they're also > unused in OpenBSD. Finally, removing this code removes the need for > future pf work to take them into account. > > Reviewed by: kp > Differential Revision: https://reviews.freebsd.org/D16076 > > Modified: > head/share/man/man4/pf.4 > head/sys/net/pfvar.h > head/sys/netpfil/pf/pf_ioctl.c Hi, This breaks some ports like net/libdnet, please revert or fix the ports fallout. Antoine (with hat: portmgr) From owner-svn-src-head@freebsd.org Tue Jul 3 05:46:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A8D010045E1 for ; Tue, 3 Jul 2018 05:46:08 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-12.consmr.mail.ne1.yahoo.com (sonic307-12.consmr.mail.ne1.yahoo.com [66.163.190.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 028918DCD1 for ; Tue, 3 Jul 2018 05:46:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: Ez1uUhwVM1kFBm0FWGpg6hT9ojzGF4tyFW9Xty3eSsnav29omkrMKeaj6TuyXjM Q9zPibqHHO9CHLJl_G_sITbclXR28A1hhYZZoN_BjMnMQjfHkSCsYJDb.s.rX7sKMJoYsKfmbZ1X 1ff6wBAQ8w_cPhGMZWVm95YFt63ebCpJdLwhGkqc9y9VhjfsmMht5x7AotyVrvY8R1_NSMW6rUOg 7wXqp8HDlMfl539MVgntaGWFrx1MNgEqHKQGji0EPoEtnBua.3BsYBON4zy9Jo.ImOpwk7_t.RIj Z0pcalcz9LlCts.uPq3JFYbnIZEO0IUHPSvZn2XKJ8rGB8gqJ0GLNcUF1Rpzl2yqnjy4sSQF8gBz h2X2T4UcTMO_MEHYVlEiO_JszufHYWmbN_Ne8EKDBimYOW4.0wiENPUbdN3hNfFFaZIePZnR.yN7 T3FwrlNqcJ7cAATF1V_JEiK5u0T5f6ZBqBK22LDpFms8Dxm6fa0LSyzYMejUvxLtARskVzoUc66N os97FXUvyhhkZJmLTXPXm5dzViFqQagw.AjRvgix8_xTXgNnq4QKlYWxrDPFZhoRVNF8y_84..yq VnJzf8lo2a5WxYbi3XlTdPKhSz_4fGbW_.3ofFVVZWovNDx0kFyUmw3NMznTTHzJM0x5xsdbedAd NGsdRTCYq556_DcslGjT_CYP5M4jCzhu6sJ64szV0rFiWYpBCPuc00tj9UrQgzFTdcx3qMX17i09 pO.qIgsEEap95MiqSEYBlGW20LLL1fDcIoy5e0YB3wOXkgTu1yn0pLcLMerkbXfe7kOF1eLhRbHC XL_cYOsKzA6QNkwtApX7EvmTa8VMSP.fK9Ci4vDUJi8tjbo38gurs.DJOHPqvDMmN8_wzuV87mae gVK11vCRqF9tpM6ZJXyDJrYwAYAlIFUKRmlmeZuCd59isJZs613ffl6Fniq_vZoTpW20CzWglUSJ Bix2Uhdcdplxf0oSpsp_NGTU- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Tue, 3 Jul 2018 05:46:07 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp403.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 06ea8978396b8d9e54373cd8cc077982; Tue, 03 Jul 2018 05:46:02 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335879 - in head/sys: conf kern sys [ broke ci.freebsd.org's FreeBSD-head-amd64-build ] Message-Id: <5399C6EA-2904-4A1B-BF07-43A5D854A710@yahoo.com> Date: Mon, 2 Jul 2018 22:46:00 -0700 To: mmacy@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 05:46:08 -0000 -r335879 broke ci.freebsd.org's FreeBSD-head-amd64-build : https://ci.freebsd.org/job/FreeBSD-head-amd64-build/ shows: --- ia32_genassym.o --- In file included from /usr/src/sys/compat/ia32/ia32_genassym.c:6: In file included from /usr/src/sys/sys/systm.h:113: /usr/src/sys/sys/kpilite.h:33:10: fatal error: 'offset.inc' file not found #include "offset.inc" ^~~~~~~~~~~~ 1 error generated. *** [ia32_genassym.o] Error code 1 Later builds ( -r335880 , -r335881 , -r335882 ) get the same. FreeBSD-head-i386-LINT also fails for such reasons. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Jul 3 05:53:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D0D810163C9; Tue, 3 Jul 2018 05:53:28 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E012D8E2F6; Tue, 3 Jul 2018 05:53:27 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF87B181F5; Tue, 3 Jul 2018 05:53:27 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w635rR4f033581; Tue, 3 Jul 2018 05:53:27 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w635rRYj033580; Tue, 3 Jul 2018 05:53:27 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201807030553.w635rRYj033580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 3 Jul 2018 05:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335883 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 335883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 05:53:28 -0000 Author: allanjude Date: Tue Jul 3 05:53:27 2018 New Revision: 335883 URL: https://svnweb.freebsd.org/changeset/base/335883 Log: stand/common/disk.c: dev->d_offset still needs to be set to 0 With r335868, I thought this was no longer necessary. I was wrong. Reported by: ian Sponsored by: Klara Systems Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Tue Jul 3 04:02:40 2018 (r335882) +++ head/stand/common/disk.c Tue Jul 3 05:53:27 2018 (r335883) @@ -244,6 +244,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize partdev.d_slice = -1; partdev.d_partition = -1; + dev->d_offset = 0; table = NULL; slice = dev->d_slice; partition = dev->d_partition; From owner-svn-src-head@freebsd.org Tue Jul 3 05:56:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 502FC1016786; Tue, 3 Jul 2018 05:56:24 +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 041BE8E4C7; Tue, 3 Jul 2018 05:56:24 +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 D598E181F6; Tue, 3 Jul 2018 05:56:23 +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 w635uNo7033769; Tue, 3 Jul 2018 05:56:23 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w635uNhx033768; Tue, 3 Jul 2018 05:56:23 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807030556.w635uNhx033768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 05:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335884 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 05:56:24 -0000 Author: mmacy Date: Tue Jul 3 05:56:23 2018 New Revision: 335884 URL: https://svnweb.freebsd.org/changeset/base/335884 Log: ensure that offset.inc is generated before ia32_genassym.c is compiled Modified: head/sys/conf/files.amd64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jul 3 05:53:27 2018 (r335883) +++ head/sys/conf/files.amd64 Tue Jul 3 05:56:23 2018 (r335884) @@ -57,7 +57,7 @@ linux32_vdso.so optional compat_linux32 \ clean "linux32_vdso.so" # ia32_genassym.o standard \ - dependency "$S/compat/ia32/ia32_genassym.c" \ + dependency "$S/compat/ia32/ia32_genassym.c offset.inc" \ compile-with "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "ia32_genassym.o" From owner-svn-src-head@freebsd.org Tue Jul 3 07:42:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D82111025BD9; Tue, 3 Jul 2018 07:42:31 +0000 (UTC) (envelope-from srs0=9+kd=jt=sigsegv.be=kristof@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63BAB721E0; Tue, 3 Jul 2018 07:42:30 +0000 (UTC) (envelope-from srs0=9+kd=jt=sigsegv.be=kristof@codepro.be) Received: from [172.28.128.1] (ptr-8rgnodue7w5oh6td6sg.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:240b:b802:419f:977e:cccb:88a0]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 4A3535A8C6; Tue, 3 Jul 2018 09:42:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sigsegv.be; s=mail; t=1530603748; bh=1qIDW5er7bdsIZogBIWCLMfwCeu18ksT+WXeIp5DTM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W161Z1zO+m7CN8KDaojF9PB0QTHS8dg2igw6GmKjTzq+hDxFyvl9TikG+TISCyBNe GncPSvWRgf0XC6i08pgu54AT3bMddC/4+ms5UMNK0VjRsEPX8TLXgQ1kkBNzm8+W67 bwa/BszVGpkCSuS5PA6UrPoL3yGukgeUlCDItnsQ= From: "Kristof Provost" To: "Antoine Brodin" Cc: "Will Andrews" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335833 - in head: share/man/man4 sys/net sys/netpfil/pf Date: Tue, 03 Jul 2018 09:42:27 +0200 X-Mailer: MailMate (2.0BETAr6113) Message-ID: <081170FC-D433-4FE6-87E1-D5470480B971@sigsegv.be> In-Reply-To: References: <201807010116.w611G35w008185@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 07:42:32 -0000 On 3 Jul 2018, at 7:38, Antoine Brodin wrote: > On Sun, Jul 1, 2018 at 3:16 AM, Will Andrews wrote: >> Author: will >> Date: Sun Jul 1 01:16:03 2018 >> New Revision: 335833 >> URL: https://svnweb.freebsd.org/changeset/base/335833 >> >> Log: >> pf: remove unused ioctls. >> >> Several ioctls are unused in pf, in the sense that no base utility >> references them. Additionally, a cursory review of pf-based ports >> indicates they're not used elsewhere either. Some of them have >> been >> unused since the original import. As far as I can tell, they're >> also >> unused in OpenBSD. Finally, removing this code removes the need >> for >> future pf work to take them into account. >> >> Reviewed by: kp >> Differential Revision: https://reviews.freebsd.org/D16076 >> >> Modified: >> head/share/man/man4/pf.4 >> head/sys/net/pfvar.h >> head/sys/netpfil/pf/pf_ioctl.c > > Hi, > > This breaks some ports like net/libdnet, please revert or fix the > ports fallout. > It also uses DIOCCHANGERULE (like sshuttle). Do you know of any other failures? It’d be good to know if reverting just the DIOCCHANGERULE removal would be enough to fix all failures, or if there are others that are used as well. Regards, Kristof From owner-svn-src-head@freebsd.org Tue Jul 3 08:44:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D431102A9B9; Tue, 3 Jul 2018 08:44:46 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5E06746ED; Tue, 3 Jul 2018 08:44:45 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6DE519D4C; Tue, 3 Jul 2018 08:44:45 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w638ijZo020334; Tue, 3 Jul 2018 08:44:45 GMT (envelope-from harti@FreeBSD.org) Received: (from harti@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w638ierp020305; Tue, 3 Jul 2018 08:44:40 GMT (envelope-from harti@FreeBSD.org) Message-Id: <201807030844.w638ierp020305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: harti set sender to harti@FreeBSD.org using -f From: Hartmut Brandt Date: Tue, 3 Jul 2018 08:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335885 - in head: contrib/bsnmp contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmp_mibII contrib/bsnmp/snmp_ntp contrib/bsnmp/snmp_target contrib/bsnmp/snmp_usm contrib/bsn... X-SVN-Group: head X-SVN-Commit-Author: harti X-SVN-Commit-Paths: in head: contrib/bsnmp contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmp_mibII contrib/bsnmp/snmp_ntp contrib/bsnmp/snmp_target contrib/bsnmp/snmp_usm contrib/bsnmp/snmp_vacm contrib/bsnm... X-SVN-Commit-Revision: 335885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 08:44:46 -0000 Author: harti Date: Tue Jul 3 08:44:40 2018 New Revision: 335885 URL: https://svnweb.freebsd.org/changeset/base/335885 Log: Update bsnmp to version 1.13. This does not bring user-visible changes. For developers gensnmptree can now generate functions for enums to convert between enums and strings and to check the validity of a value. The sources in FreeBSD are now in sync with the upstream which allows to bring in IPv6 modifications. Modified: head/contrib/bsnmp/VERSION head/contrib/bsnmp/gensnmptree/gensnmptree.1 head/contrib/bsnmp/gensnmptree/gensnmptree.c head/contrib/bsnmp/lib/snmp.h head/contrib/bsnmp/lib/tc.def head/contrib/bsnmp/snmp_mibII/mibII.c head/contrib/bsnmp/snmp_mibII/mibII_route.c head/contrib/bsnmp/snmp_ntp/snmp_ntp.c head/contrib/bsnmp/snmp_target/target_snmp.c head/contrib/bsnmp/snmp_target/target_tree.def head/contrib/bsnmp/snmp_usm/usm_snmp.c head/contrib/bsnmp/snmp_usm/usm_tree.def head/contrib/bsnmp/snmp_vacm/vacm_snmp.c head/contrib/bsnmp/snmp_vacm/vacm_tree.def head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/trans_udp.c head/contrib/bsnmp/snmpd/trap.c head/contrib/bsnmp/snmpd/tree.def head/contrib/libbegemot/rpoll.c head/contrib/libbegemot/rpoll.h head/lib/libbsnmp/libbsnmp/Makefile head/share/mk/bsd.snmpmod.mk head/usr.sbin/bsnmpd/bsnmpd/Makefile head/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_pf.c head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_snmp.c head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile head/usr.sbin/bsnmpd/modules/snmp_pf/Makefile head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c head/usr.sbin/bsnmpd/modules/snmp_target/Makefile head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile head/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c Modified: head/contrib/bsnmp/VERSION ============================================================================== --- head/contrib/bsnmp/VERSION Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/VERSION Tue Jul 3 08:44:40 2018 (r335885) @@ -1 +1 @@ -1.12 +1.13 Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- head/contrib/bsnmp/gensnmptree/gensnmptree.1 Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/gensnmptree/gensnmptree.1 Tue Jul 3 08:44:40 2018 (r335885) @@ -2,7 +2,7 @@ .\" Copyright (c) 2001-2005 .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. -.\" Copyright (c) 2006 +.\" Copyright (c) 2006,2018 .\" Hartmut Brandt .\" All rights reserved. .\" @@ -31,7 +31,7 @@ .\" .\" $Begemot: gensnmptree.1 383 2006-05-30 07:40:49Z brandt_h $ .\" -.Dd May 26, 2006 +.Dd June 29, 2018 .Dt GENSNMPTREE 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nd "generate C and header files from a MIB description file" .Sh SYNOPSIS .Nm -.Op Fl dEehlt +.Op Fl dEeFfhlt .Op Fl I Ar directory .Op Fl i Ar infile .Op Fl p Ar prefix @@ -99,6 +99,26 @@ is the length of the OID. .It Va OID_ Ns Ar name is the last component of the OID. .El +.It Fl F +Together with +.Fl E +causes +.Nm +instead of the generation of enum definitions the generation of +functions for checking a value to be one of the enumeration variants and +for conversion between strings and the enum. The file is sent to standard +output and is meant to be included into a C-file for compilation. +.It Fl f +This flag can be used together with +.Fl E +or when generating the tree files. It causes +.Nm +to emit static inline functions for checking a value to be one of the +enumeration values and for conversion between strings and the enum. +If used when generating the tree files, the preprocessor symbol +.Ar SNMPTREE_TYPES +must be defined when including the tree header file for these definitions +to become visible. .It Fl h Print a short help page. .It Fl I Ar directory @@ -116,6 +136,36 @@ Instead of normal output print the resulting tree. Prefix the file names and the table name with .Ar prefix . .El +.Pp +The following functions are generated by +.Fl f +or +.Fl F : +.Pp +.Ft static inline int +.Fn isok_EnumName "enum EnumName" ; +.Pp +.Ft static inline const char * +.Fn tostr_EnumName "enum EnumName" ; +.Pp +.Ft static inline int +.Fn fromstr_EnumName "const char *" "enum EnumName *" ; +.Pp +The +.Fa EnumName +is replaced with the enumeration name. +.Fn isok_EnumName +returns 1 if the argument is one of the valid enum values and 0 otherwise. +.Fn tostr_EnumName +returns a string representation of the enumeration value. +If the values is not one of the legal values +.Ar EnumName??? +is returned. +.Fn fromstr_EnumName +returns 1 if the string represents one of the legal enumeration values and +0 otherwise. +If 1 is return the variable pointed to by the second argument is set to +the enumeration value. .Sh MIBS The syntax of the MIB description file can formally be specified as follows: .Bd -unfilled -offset indent Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- head/contrib/bsnmp/gensnmptree/gensnmptree.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/gensnmptree/gensnmptree.c Tue Jul 3 08:44:40 2018 (r335885) @@ -3,7 +3,7 @@ * Fraunhofer Institute for Open Communication Systems (FhG Fokus). * All rights reserved. * - * Copyright (c) 2004-2006 + * Copyright (c) 2004-2006,2018 * Hartmut Brandt. * All rights reserved. * @@ -110,18 +110,21 @@ static int debug; static const char usgtxt[] = "\ Generate SNMP tables.\n\ -usage: gensnmptree [-dEehlt] [-I directory] [-i infile] [-p prefix]\n\ +$Id$\n\ +usage: gensnmptree [-dEeFfhlt] [-I directory] [-i infile] [-p prefix]\n\ [name]...\n\ options:\n\ -d debug mode\n\ - -E extract the named enums and bits only\n\ + -E extract the named or all enums and bits only\n\ -e extract the named oids or enums\n\ + -F generate functions for -E into a .c file\n\ + -f generate functions for -E into the header\n\ -h print this info\n\ -I directory add directory to include path\n\ -i ifile read from the named file instead of stdin\n\ -l generate local include directives\n\ -p prefix prepend prefix to file and variable names\n\ - -t generated a .def file\n\ + -t generate a .def file\n\ "; /* @@ -420,10 +423,9 @@ static const struct { /* arbitrary upper limit on node names and function names */ #define MAXSTR 1000 -char str[MAXSTR]; -u_long val; /* integer values */ -int all_cond; /* all conditions are true */ -int saved_token = -1; +static char str[MAXSTR]; +static u_long val; /* integer values */ +static int saved_token = -1; /* * Report an error and exit. @@ -1065,6 +1067,7 @@ gen_table(FILE *fp, struct node *node) #ifdef HAVE_STDINT_H fprintf(fp, "#include \n"); #endif + fprintf(fp, "#include \n"); if (localincs) { fprintf(fp, "#include \"asn1.h\"\n"); fprintf(fp, "#include \"snmp.h\"\n"); @@ -1191,6 +1194,15 @@ extract(FILE *fp, const struct node *np, struct asn_oi return (1); } +/** + * Extract the named OID. + * + * \param fp file to extract to + * \param root root of the tree + * \param object name of the object to extract + * + * \return 0 on success, -1 if the object was not found + */ static int gen_extract(FILE *fp, const struct node *root, char *object) { @@ -1378,6 +1390,13 @@ unminus(FILE *fp, const char *s) } } +/** + * Generate a definition for the enum packed into a guard against multiple + * definitions. + * + * \param fp file to write definition to + * \param t type + */ static void gen_enum(FILE *fp, const struct type *t) { @@ -1402,7 +1421,7 @@ gen_enum(FILE *fp, const struct type *t) fprintf(fp, "#define STROFF_%s %ld\n", t->name, min); fprintf(fp, "#define STRING_%s \\\n", t->name); TAILQ_FOREACH(e, &t->enums, link) { - fprintf(fp, "\t[%ld] \"%s_", e->value - min, t->name); + fprintf(fp, "\t[%ld] = \"%s_", e->value - min, t->name); unminus(fp, e->name); fprintf(fp, "\",\\\n"); } @@ -1410,35 +1429,189 @@ gen_enum(FILE *fp, const struct type *t) fprintf(fp, "#endif /* %s_defined__ */\n", t->name); } +/** + * Generate helper functions for an enum. + * + * We always generate a switch statement for the isok function. The compiler + * optimizes this into range checks if possible. + * + * \param fp file to write to + * \param t type + * \param ccode generate externally visible non-inline functions + */ static void -gen_enums(FILE *fp) +gen_enum_funcs(FILE *fp, const struct type *t, int ccode) { + fprintf(fp, "\n"); + + if (!ccode) + fprintf(fp, "static inline "); + fprintf(fp, "int\n"); + fprintf(fp, "isok_%s(enum %s s)\n", t->name, t->name); + fprintf(fp, "{\n"); + fprintf(fp, " switch (s) {\n"); + + const struct enums *e; + TAILQ_FOREACH(e, &t->enums, link) { + fprintf(fp, "\t case %s_", t->name); + unminus(fp, e->name); + fprintf(fp, ":\n"); + } + + fprintf(fp, " return (1);\n"); + fprintf(fp, " }\n"); + fprintf(fp, " return (0);\n"); + fprintf(fp, "}\n\n"); + + if (!ccode) + fprintf(fp, "static inline "); + fprintf(fp, "const char *\n"); + fprintf(fp, "tostr_%s(enum %s s)\n", t->name, t->name); + fprintf(fp, "{\n"); + fprintf(fp, " static const char *vals[] = { STRING_%s };\n", t->name); + fprintf(fp, "\n"); + fprintf(fp, " if (isok_%s(s))\n", t->name); + fprintf(fp, " return (vals[(int)s - STROFF_%s]);\n", t->name); + fprintf(fp, " return (\"%s???\");\n", t->name); + fprintf(fp, "}\n\n"); + + if (!ccode) + fprintf(fp, "static inline "); + fprintf(fp, "int\n"); + fprintf(fp, "fromstr_%s(const char *str, enum %s *s)\n", + t->name, t->name); + fprintf(fp, "{\n"); + fprintf(fp, " static const char *vals[] = { STRING_%s };\n", t->name); + fprintf(fp, "\n"); + fprintf(fp, " for (size_t i = 0; i < sizeof(vals)/sizeof(vals[0]); i++) {\n"); + fprintf(fp, " if (vals[i] != NULL && strcmp(vals[i], str) == 0) {\n"); + fprintf(fp, " *s = i + STROFF_%s;\n", t->name); + fprintf(fp, " return (1);\n"); + fprintf(fp, " }\n"); + fprintf(fp, " }\n"); + fprintf(fp, " return (0);\n"); + fprintf(fp, "}\n"); +} + +/** + * Generate helper functions for an enum. This generates code for a c file. + * + * \param fp file to write to + * \param name enum name + */ +static int +gen_enum_funcs_str(FILE *fp, const char *name) +{ const struct type *t; LIST_FOREACH(t, &types, link) + if ((t->is_enum || t->is_bits) && strcmp(t->name, name) == 0) { + gen_enum_funcs(fp, t, 1); + return (0); + } + + return (-1); +} + +/** + * Generate helper functions for all enums. + * + * \param fp file to write to + * \param ccode generate externally visible non-inline functions + */ +static void +gen_all_enum_funcs(FILE *fp, int ccode) +{ + const struct type *t; + + LIST_FOREACH(t, &types, link) if (t->is_enum || t->is_bits) - gen_enum(fp, t); + gen_enum_funcs(fp, t, ccode); } +/** + * Extract a given enum to the specified file and optionally generate static + * inline helper functions for them. + * + * \param fp file to print on + * \param name name of the enum + * \param gen_funcs generate the functions too + * + * \return 0 if found, -1 otherwise + */ static int -extract_enum(FILE *fp, const char *name) +extract_enum(FILE *fp, const char *name, int gen_funcs) { const struct type *t; LIST_FOREACH(t, &types, link) if ((t->is_enum || t->is_bits) && strcmp(t->name, name) == 0) { gen_enum(fp, t); + if (gen_funcs) + gen_enum_funcs(fp, t, 0); return (0); } return (-1); } +/** + * Extract all enums to the given file and optionally generate static inline + * helper functions for them. + * + * \param fp file to print on + * \param gen_funcs generate the functions too + */ +static void +extract_all_enums(FILE *fp, int gen_funcs) +{ + const struct type *t; + + LIST_FOREACH(t, &types, link) + if (t->is_enum || t->is_bits) { + gen_enum(fp, t); + if (gen_funcs) + gen_enum_funcs(fp, t, 0); + } +} + +/** + * Extract enums and optionally generate some helper functions for them. + * + * \param argc number of arguments + * \param argv arguments (enum names) + * \param gen_funcs_h generate functions into the header file + * \param gen_funcs_c generate a .c file with functions + */ +static void +make_enums(int argc, char *argv[], int gen_funcs_h, int gen_funcs_c) +{ + if (gen_funcs_c) { + if (argc == 0) + gen_all_enum_funcs(stdout, 1); + else { + for (int i = 0; i < argc; i++) + if (gen_enum_funcs_str(stdout, argv[i])) + errx(1, "enum not found: %s", argv[i]); + } + } else { + if (argc == 0) + extract_all_enums(stdout, gen_funcs_h); + else { + for (int i = 0; i < argc; i++) + if (extract_enum(stdout, argv[i], gen_funcs_h)) + errx(1, "enum not found: %s", argv[i]); + } + } +} + int main(int argc, char *argv[]) { int do_extract = 0; int do_tree = 0; int do_enums = 0; + int gen_funcs_h = 0; + int gen_funcs_c = 0; int opt; struct node *root; char fname[MAXPATHLEN + 1]; @@ -1446,17 +1619,13 @@ main(int argc, char *argv[]) FILE *fp; char *infile = NULL; - while ((opt = getopt(argc, argv, "dEehI:i:lp:t")) != EOF) + while ((opt = getopt(argc, argv, "dEeFfhI:i:lp:t")) != EOF) switch (opt) { case 'd': debug = 1; break; - case 'h': - fprintf(stderr, "%s", usgtxt); - exit(0); - case 'E': do_enums = 1; break; @@ -1465,6 +1634,18 @@ main(int argc, char *argv[]) do_extract = 1; break; + case 'F': + gen_funcs_c = 1; + break; + + case 'f': + gen_funcs_h = 1; + break; + + case 'h': + fprintf(stderr, "%s", usgtxt); + exit(0); + case 'I': path_new(optarg); break; @@ -1493,9 +1674,16 @@ main(int argc, char *argv[]) errx(1, "conflicting options -e/-t/-E"); if (!do_extract && !do_enums && argc != optind) errx(1, "no arguments allowed"); - if ((do_extract || do_enums) && argc == optind) + if (do_extract && argc == optind) errx(1, "no objects specified"); + if ((gen_funcs_h || gen_funcs_c) && (do_extract || do_tree)) + errx(1, "-f and -F not allowed with -e or -t"); + if (gen_funcs_c && !do_enums) + errx(1, "-F requires -E"); + if (gen_funcs_h && gen_funcs_c) + errx(1, "-f and -F are mutually exclusive"); + if (infile == NULL) { input_new(stdin, NULL, ""); } else { @@ -1508,7 +1696,8 @@ main(int argc, char *argv[]) while ((tok = gettoken()) != TOK_EOF) merge(&root, parse_top(tok)); - check_tree(root); + if (root) + check_tree(root); if (do_extract) { while (optind < argc) { @@ -1519,11 +1708,8 @@ main(int argc, char *argv[]) return (0); } if (do_enums) { - while (optind < argc) { - if (extract_enum(stdout, argv[optind])) - errx(1, "enum not found: %s", argv[optind]); - optind++; - } + make_enums(argc - optind, argv + optind, + gen_funcs_h, gen_funcs_c); return (0); } if (do_tree) { @@ -1536,7 +1722,7 @@ main(int argc, char *argv[]) gen_header(fp, root, PREFIX_LEN, NULL); fprintf(fp, "\n#ifdef SNMPTREE_TYPES\n"); - gen_enums(fp); + extract_all_enums(fp, gen_funcs_h); fprintf(fp, "\n#endif /* SNMPTREE_TYPES */\n\n"); fprintf(fp, "#define %sCTREE_SIZE %u\n", file_prefix, tree_size); Modified: head/contrib/bsnmp/lib/snmp.h ============================================================================== --- head/contrib/bsnmp/lib/snmp.h Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/lib/snmp.h Tue Jul 3 08:44:40 2018 (r335885) @@ -42,6 +42,9 @@ #include +#define BSNMP_MAJOR 1 +#define BSNMP_MINOR 13 + #define SNMP_COMMUNITY_MAXLEN 128 #define SNMP_MAX_BINDINGS 100 #define SNMP_CONTEXT_NAME_SIZ (32 + 1) Modified: head/contrib/bsnmp/lib/tc.def ============================================================================== --- head/contrib/bsnmp/lib/tc.def Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/lib/tc.def Tue Jul 3 08:44:40 2018 (r335885) @@ -38,3 +38,11 @@ typedef RowStatus ENUM ( 6 destroy ) +typedef StorageType ENUM ( + 1 other + 2 volatile + 3 nonVolatile + 4 permanent + 5 readOnly +) + Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Tue Jul 3 08:44:40 2018 (r335885) @@ -1772,6 +1772,7 @@ mibII_loading(const struct lmodule *mod, int loaded) mib_unregister_newif(mod); } +extern const struct snmp_module config; const struct snmp_module config = { "This module implements the interface and ip groups.", mibII_init, Modified: head/contrib/bsnmp/snmp_mibII/mibII_route.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_route.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_mibII/mibII_route.c Tue Jul 3 08:44:40 2018 (r335885) @@ -47,7 +47,7 @@ struct sroute { uint8_t type; uint8_t proto; }; -RB_HEAD(sroutes, sroute) sroutes = RB_INITIALIZER(&sroutes); +static RB_HEAD(sroutes, sroute) sroutes = RB_INITIALIZER(&sroutes); RB_PROTOTYPE(sroutes, sroute, link, sroute_compare); Modified: head/contrib/bsnmp/snmp_ntp/snmp_ntp.c ============================================================================== --- head/contrib/bsnmp/snmp_ntp/snmp_ntp.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_ntp/snmp_ntp.c Tue Jul 3 08:44:40 2018 (r335885) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 + * Copyright (c) 2005,2018 * Hartmut Brandt. * All rights reserved. * @@ -53,6 +53,8 @@ #include "support.h" #include "snmpmod.h" + +#define SNMPTREE_TYPES #include "ntp_tree.h" #include "ntp_oid.h" Modified: head/contrib/bsnmp/snmp_target/target_snmp.c ============================================================================== --- head/contrib/bsnmp/snmp_target/target_snmp.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_target/target_snmp.c Tue Jul 3 08:44:40 2018 (r335885) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 The FreeBSD Foundation + * Copyright (c) 2010,2018 The FreeBSD Foundation * All rights reserved. * * This software was developed by Shteryana Sotirova Shopova under @@ -43,6 +43,7 @@ #include "snmp.h" #include "snmpmod.h" +#define SNMPTREE_TYPES #include "target_tree.h" #include "target_oid.h" @@ -826,9 +827,10 @@ target_dump(void) /* XXX: dump the module stats & list of mgmt targets */ } -const char target_comment[] = \ +static const char target_comment[] = \ "This module implements SNMP Management Target MIB Module defined in RFC 3413."; +extern const struct snmp_module config; const struct snmp_module config = { .comment = target_comment, .init = target_init, Modified: head/contrib/bsnmp/snmp_target/target_tree.def ============================================================================== --- head/contrib/bsnmp/snmp_target/target_tree.def Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_target/target_tree.def Tue Jul 3 08:44:40 2018 (r335885) @@ -29,24 +29,7 @@ # $FreeBSD$ # -#include "tc.def" - -typedef RowStatus ENUM ( - 1 active - 2 notInService - 3 notReady - 4 createAndGo - 5 createAndWait - 6 destroy -) - -typedef StorageType ENUM ( - 1 other - 2 volatile - 3 nonVolatile - 4 permanent - 5 readOnly -) +include "tc.def" (1 internet (6 snmpV2 Modified: head/contrib/bsnmp/snmp_usm/usm_snmp.c ============================================================================== --- head/contrib/bsnmp/snmp_usm/usm_snmp.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_usm/usm_snmp.c Tue Jul 3 08:44:40 2018 (r335885) @@ -43,6 +43,7 @@ #include "snmp.h" #include "snmpmod.h" +#define SNMPTREE_TYPES #include "usm_tree.h" #include "usm_oid.h" @@ -604,9 +605,10 @@ usm_dump(void) privstr[uuser->suser.priv_proto]); } -const char usm_comment[] = \ +static const char usm_comment[] = \ "This module implements SNMP User-based Security Model defined in RFC 3414."; +extern const struct snmp_module config; const struct snmp_module config = { .comment = usm_comment, .init = usm_init, Modified: head/contrib/bsnmp/snmp_usm/usm_tree.def ============================================================================== --- head/contrib/bsnmp/snmp_usm/usm_tree.def Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_usm/usm_tree.def Tue Jul 3 08:44:40 2018 (r335885) @@ -29,24 +29,7 @@ # $FreeBSD$ # -#include "tc.def" - -typedef RowStatus ENUM ( - 1 active - 2 notInService - 3 notReady - 4 createAndGo - 5 createAndWait - 6 destroy -) - -typedef StorageType ENUM ( - 1 other - 2 volatile - 3 nonVolatile - 4 permanent - 5 readOnly -) +include "tc.def" (1 internet (6 snmpV2 Modified: head/contrib/bsnmp/snmp_vacm/vacm_snmp.c ============================================================================== --- head/contrib/bsnmp/snmp_vacm/vacm_snmp.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_vacm/vacm_snmp.c Tue Jul 3 08:44:40 2018 (r335885) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 The FreeBSD Foundation + * Copyright (c) 2010,2018 The FreeBSD Foundation * All rights reserved. * * This software was developed by Shteryana Sotirova Shopova under @@ -43,6 +43,7 @@ #include "snmp.h" #include "snmpmod.h" +#define SNMPTREE_TYPES #include "vacm_tree.h" #include "vacm_oid.h" @@ -1012,9 +1013,10 @@ vacm_dump(void) "excluded":"included"); } -const char vacm_comment[] = \ +static const char vacm_comment[] = \ "This module implements SNMP View-based Access Control Model defined in RFC 3415."; +extern const struct snmp_module config; const struct snmp_module config = { .comment = vacm_comment, .init = vacm_init, Modified: head/contrib/bsnmp/snmp_vacm/vacm_tree.def ============================================================================== --- head/contrib/bsnmp/snmp_vacm/vacm_tree.def Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmp_vacm/vacm_tree.def Tue Jul 3 08:44:40 2018 (r335885) @@ -29,24 +29,7 @@ # $FreeBSD$ # -#include "tc.def" - -typedef RowStatus ENUM ( - 1 active - 2 notInService - 3 notReady - 4 createAndGo - 5 createAndWait - 6 destroy -) - -typedef StorageType ENUM ( - 1 other - 2 volatile - 3 nonVolatile - 4 permanent - 5 readOnly -) +include "tc.def" (1 internet (6 snmpV2 Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmpd/main.c Tue Jul 3 08:44:40 2018 (r335885) @@ -927,7 +927,7 @@ fd_resume(void *p) #ifdef USE_LIBBEGEMOT if (f->id >= 0) return (0); - if ((f->id = poll_register(f->fd, input, f, POLL_IN)) < 0) { + if ((f->id = poll_register(f->fd, input, f, RPOLL_IN)) < 0) { err = errno; syslog(LOG_ERR, "select fd %d: %m", f->fd); errno = err; Modified: head/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmpd/trans_udp.c Tue Jul 3 08:44:40 2018 (r335885) @@ -328,7 +328,7 @@ udp_recv(struct tport *tp, struct port_input *pi) sizeof(struct in_addr)); if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) - cred = (struct sockcred *)CMSG_DATA(cmsg); + cred = (struct sockcred *)(void *)CMSG_DATA(cmsg); } if (pi->cred) Modified: head/contrib/bsnmp/snmpd/trap.c ============================================================================== --- head/contrib/bsnmp/snmpd/trap.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmpd/trap.c Tue Jul 3 08:44:40 2018 (r335885) @@ -54,6 +54,8 @@ #include "snmpmod.h" #include "snmpd.h" + +#define SNMPTREE_TYPES #include "tree.h" #include "oid.h" Modified: head/contrib/bsnmp/snmpd/tree.def ============================================================================== --- head/contrib/bsnmp/snmpd/tree.def Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/bsnmp/snmpd/tree.def Tue Jul 3 08:44:40 2018 (r335885) @@ -31,16 +31,7 @@ # System group and private Begemot SNMPd MIB. # -#include "tc.def" - -typedef RowStatus ENUM ( - 1 active - 2 notInService - 3 notReady - 4 createAndGo - 5 createAndWait - 6 destroy -) +include "tc.def" (1 internet (2 mgmt Modified: head/contrib/libbegemot/rpoll.c ============================================================================== --- head/contrib/libbegemot/rpoll.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/libbegemot/rpoll.c Tue Jul 3 08:44:40 2018 (r335885) @@ -44,17 +44,6 @@ # include # include -/* - * There happens to be linuxes which read siginfo.h when including - * signal.h, which, for no appearent reason, defines these symbols. - */ -# ifdef POLL_IN -# undef POLL_IN -# endif -# ifdef POLL_OUT -# undef POLL_OUT -# endif - # include "rpoll.h" /* @@ -339,11 +328,11 @@ poll_build(void) if(p->fd >= 0) { f->fd = p->fd; f->events = 0; - if(p->mask & POLL_IN) + if(p->mask & RPOLL_IN) f->events |= poll_in; - if(p->mask & POLL_OUT) + if(p->mask & RPOLL_OUT) f->events |= poll_out; - if(p->mask & POLL_EXCEPT) + if(p->mask & RPOLL_EXCEPT) f->events |= poll_except; f->revents = 0; p->pfd = f++; @@ -360,11 +349,11 @@ poll_build(void) if(p->fd >= 0) { if(p->fd > maxfd) maxfd = p->fd; - if(p->mask & POLL_IN) + if(p->mask & RPOLL_IN) FD_SET(p->fd, &rset); - if(p->mask & POLL_OUT) + if(p->mask & RPOLL_OUT) FD_SET(p->fd, &wset); - if(p->mask & POLL_EXCEPT) + if(p->mask & RPOLL_EXCEPT) FD_SET(p->fd, &xset); } # endif @@ -582,27 +571,27 @@ poll_dispatch(int wait) # ifdef USE_POLL if(regs[idx].pfd) { - if ((regs[idx].mask & POLL_IN) && + if ((regs[idx].mask & RPOLL_IN) && (regs[idx].pfd->revents & poll_in)) - mask |= POLL_IN; - if ((regs[idx].mask & POLL_OUT) && + mask |= RPOLL_IN; + if ((regs[idx].mask & RPOLL_OUT) && (regs[idx].pfd->revents & poll_out)) - mask |= POLL_OUT; - if((regs[idx].mask & POLL_EXCEPT) && + mask |= RPOLL_OUT; + if((regs[idx].mask & RPOLL_EXCEPT) && (regs[idx].pfd->revents & poll_except)) - mask |= POLL_EXCEPT; + mask |= RPOLL_EXCEPT; } # endif # ifdef USE_SELECT - if ((regs[idx].mask & POLL_IN) && + if ((regs[idx].mask & RPOLL_IN) && FD_ISSET(regs[idx].fd, &nrset)) - mask |= POLL_IN; - if ((regs[idx].mask & POLL_OUT) && + mask |= RPOLL_IN; + if ((regs[idx].mask & RPOLL_OUT) && FD_ISSET(regs[idx].fd, &nwset)) - mask |= POLL_OUT; - if ((regs[idx].mask & POLL_EXCEPT) && + mask |= RPOLL_OUT; + if ((regs[idx].mask & RPOLL_EXCEPT) && FD_ISSET(regs[idx].fd, &nxset)) - mask |= POLL_EXCEPT; + mask |= RPOLL_EXCEPT; # endif assert(idx < regs_alloc); @@ -723,7 +712,7 @@ main(int argc, char *argv[]) { argv = argv; gettimeofday(&start, NULL); - poll_register(0, infunc, NULL, POLL_IN); + poll_register(0, infunc, NULL, RPOLL_IN); if (argc < 2) { t0 = poll_start_timer(1000, 1, tfunc0, "1 second"); Modified: head/contrib/libbegemot/rpoll.h ============================================================================== --- head/contrib/libbegemot/rpoll.h Tue Jul 3 05:56:23 2018 (r335884) +++ head/contrib/libbegemot/rpoll.h Tue Jul 3 08:44:40 2018 (r335885) @@ -47,16 +47,11 @@ int poll_start_utimer(unsigned long long usecs, int re void *arg); void poll_stop_timer(int); -# if defined(POLL_IN) -# undef POLL_IN -# endif -# if defined(POLL_OUT) -# undef POLL_OUT -# endif - -# define POLL_IN 1 -# define POLL_OUT 2 -# define POLL_EXCEPT 4 +enum { + RPOLL_IN = 1, + RPOLL_OUT = 2, + RPOLL_EXCEPT = 4, +}; extern int rpoll_policy; extern int rpoll_trace; Modified: head/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- head/lib/libbsnmp/libbsnmp/Makefile Tue Jul 3 05:56:23 2018 (r335884) +++ head/lib/libbsnmp/libbsnmp/Makefile Tue Jul 3 08:44:40 2018 (r335885) @@ -20,8 +20,22 @@ LIBADD= crypto .endif SRCS= asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c +SRCS+= snmptc.h INCS= asn1.h snmp.h snmpagent.h snmpclient.h MAN= asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3 + +snmptc.h : tc.def + (\ + echo -n "/* autogenerated from tc.def; ";\ + ls -l -D "%F %T" ${.ALLSRC} | awk '{printf("%s %s", $$6, $$7)}';\ + echo "*/";\ + echo "#ifndef snmptc_h_1529923773";\ + echo "#define snmptc_h_1529923773";\ + gensnmptree -E -f <${.ALLSRC};\ + echo "#endif" ; \ + ) >${.TARGET} + +CLEANFILES+= snmptc.h MLINKS+= asn1.3 asn_append_oid.3 MLINKS+= asn1.3 asn_commit_header.3 Modified: head/share/mk/bsd.snmpmod.mk ============================================================================== --- head/share/mk/bsd.snmpmod.mk Tue Jul 3 05:56:23 2018 (r335884) +++ head/share/mk/bsd.snmpmod.mk Tue Jul 3 08:44:40 2018 (r335885) @@ -6,14 +6,16 @@ SHLIB_NAME= snmp_${MOD}.so.${SHLIB_MAJOR} SRCS+= ${MOD}_oid.h ${MOD}_tree.c ${MOD}_tree.h CLEANFILES+= ${MOD}_oid.h ${MOD}_tree.c ${MOD}_tree.h CFLAGS+= -I. +GENSNMPTREEFLAGS+= -I${SHAREDIR}/snmpdefs + ${MOD}_oid.h: ${MOD}_tree.def ${EXTRAMIBDEFS} ${EXTRAMIBSYMS} - cat ${.ALLSRC} | gensnmptree -e ${XSYM} > ${.TARGET} + cat ${.ALLSRC} | gensnmptree ${GENSNMPTREEFLAGS} -e ${XSYM} > ${.TARGET} .ORDER: ${MOD}_tree.c ${MOD}_tree.h ${MOD}_tree.h: .NOMETA ${MOD}_tree.c ${MOD}_tree.h: ${MOD}_tree.def ${EXTRAMIBDEFS} - cat ${.ALLSRC} | gensnmptree -p ${MOD}_ + cat ${.ALLSRC} | gensnmptree -f ${GENSNMPTREEFLAGS} -p ${MOD}_ .if defined(DEFS) FILESGROUPS+= DEFS Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Tue Jul 3 05:56:23 2018 (r335884) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Tue Jul 3 08:44:40 2018 (r335885) @@ -123,7 +123,6 @@ BMIBSDIR= ${SHAREDIR}/snmp/mibs DEFS= tree.def DEFSDIR= ${SHAREDIR}/snmp/defs -CFLAGS+= -DSNMPTREE_TYPES CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I. -DUSE_LIBBEGEMOT CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_ERR_H -DHAVE_STRLCPY LIBADD= begemot bsnmp @@ -140,18 +139,15 @@ LIBADD+= wrap .endif oid.h: tree.def Makefile - gensnmptree -e ${XSYM} < ${.ALLSRC:M*.def} > ${.TARGET} + gensnmptree -I${CONTRIB}/lib -e ${XSYM} < ${.ALLSRC:M*.def} > ${.TARGET} .ORDER: tree.c tree.h tree.h: .NOMETA tree.c tree.h: tree.def - gensnmptree -l < ${.ALLSRC} + gensnmptree -I${CONTRIB}/lib -l -f < ${.ALLSRC} MANFILTER= sed -e 's%@MODPATH@%${LIBDIR}/%g' \ -e 's%@DEFPATH@%${DEFSDIR}/%g' \ -e 's%@MIBSPATH@%${BMIBSDIR}/%g' - -NO_WCAST_ALIGN= yes -WARNS?= 6 .include Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile Tue Jul 3 05:56:23 2018 (r335884) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile Tue Jul 3 08:44:40 2018 (r335885) @@ -5,7 +5,6 @@ MOD= bridge SRCS= bridge_snmp.c bridge_if.c bridge_port.c bridge_addrs.c \ bridge_pf.c bridge_sys.c -CFLAGS+= -DSNMPTREE_TYPES XSYM= dot1dBridge newRoot topologyChange begemotBridgeNewRoot \ begemotBridgeTopologyChange begemotBridgeBaseName Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c Tue Jul 3 08:44:40 2018 (r335885) @@ -49,6 +49,7 @@ #include #include +#define SNMPTREE_TYPES #include "bridge_tree.h" #include "bridge_snmp.h" Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c Tue Jul 3 08:44:40 2018 (r335885) @@ -50,6 +50,7 @@ #include #include +#define SNMPTREE_TYPES #include "bridge_tree.h" #include "bridge_snmp.h" #include "bridge_oid.h" Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_pf.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_pf.c Tue Jul 3 05:56:23 2018 (r335884) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_pf.c Tue Jul 3 08:44:40 2018 (r335885) @@ -48,6 +48,7 @@ #include #include +#define SNMPTREE_TYPES #include "bridge_tree.h" #include "bridge_snmp.h" Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Tue Jul 3 05:56:23 2018 (r335884) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jul 3 08:50:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0778102B0B0; Tue, 3 Jul 2018 08:50:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7507F74A1A; Tue, 3 Jul 2018 08:50:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5636719D6C; Tue, 3 Jul 2018 08:50:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w638ooF5020649; Tue, 3 Jul 2018 08:50:50 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w638ooDb020648; Tue, 3 Jul 2018 08:50:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201807030850.w638ooDb020648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 3 Jul 2018 08:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335886 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 335886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 08:50:50 -0000 Author: kp Date: Tue Jul 3 08:50:49 2018 New Revision: 335886 URL: https://svnweb.freebsd.org/changeset/base/335886 Log: pfctl: Don't retrieve interface list if '-n' is set If '-n' is set we don't use the list of skip interfaces, so don't retrieve it. This fixes issues if 'pfctl -n' is used before the pf module is loaded. This was broken by r333181. Reported by: Jakub Chromy MFC after: 1 week Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Tue Jul 3 08:44:40 2018 (r335885) +++ head/sbin/pfctl/pfctl.c Tue Jul 3 08:50:49 2018 (r335886) @@ -2409,7 +2409,7 @@ main(int argc, char *argv[]) } if ((rulesopt != NULL) && (loadopt & PFCTL_FLAG_OPTION) && - !anchorname[0]) + !anchorname[0] && !(opts & PF_OPT_NOACTION)) if (pfctl_get_skip_ifaces()) error = 1; From owner-svn-src-head@freebsd.org Tue Jul 3 09:01:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49B67102C1C5; Tue, 3 Jul 2018 09:01:17 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A21F8751FE; Tue, 3 Jul 2018 09:01:16 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.182.14.97]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LguAU-1fwugs2ZHS-00oFW1; Tue, 03 Jul 2018 11:01:08 +0200 Date: Tue, 3 Jul 2018 11:00:34 +0200 From: "O. Hartmann" To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335873 - in head: . sys/amd64/amd64 sys/amd64/include sys/conf sys/i386/i386 sys/i386/include sys/sys sys/vm Message-ID: <20180703110101.3b8f7d0b@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201807021948.w62JmcV6019378@repo.freebsd.org> References: <201807021948.w62JmcV6019378@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:f+sUV0wapTHXgWl45ZBCddOArr4A+0fkfVfyBIa3JTfsnblGXGf EyAtj3v0fj4lTuMdIvc3V+JuufzXxPRmtCEwB4WzPdKLKXkSDhU9Mv0bixjfFd8idR6ebI5 r67DJrYIDTNU0u2kC4dAEo1RYbl8HlRn8Vsw9Ekd/yGdujM0j8D3hbExXUelTAcQbmOYVZR U0h+CGDFOXn/abFSNHAmA== X-UI-Out-Filterresults: notjunk:1;V01:K0:4OjGRvWK8hw=:t6sHRiKfS6Yj3IDfeI/qru dbIPDxqiZXcnK3c85rjPeh/2brFIth+2qJyIepKTrYYyprB1W8gC42NHf7K1QS13qmq9d9pF2 +DFJTxuW1k/qBb6fymy5qGVH/2FkFqheotJUQVBsPxnfZHaKOjl2meLCOae30WS2867Rrb1Yq HSbEx6StTtup3DvaEED4krMOYahmRKAA6HVU4ARJJTRIkA8090lPRlMC+5JUdOh61QsBa/Btw 1kaWcXjZUmXFy7gMHq+vDBevaI7H1McmG8pvj6fdlzexkrdtEMJpH9vXeaKeRyE29jzzkRUQp nlO9gQc1kiUVDCHzbWuO1goYfnm1v/PIPWL+iunhtDy0V8UPE0dhkiWAYYDImurPtOHnr8GKl R7/KOFg5cfyRADdgP171rPWuwGCHMtrSNTgeuwBAFyc5GGMAkEoL9c8aLbegG/WRYZN7HBkHT sVnc3yU8Tz6o8qzp1YEoWchNLRBbngHGNnlMdgotpS8/K9dBPB4uc96hCP77bUS7AGBJDatcC ylMFRS9ZY7LYqY6KffD04hgVUdJ3SMmgLn7NqzVd4uWMiqg10+PaOIlwCZKXY2tUn0dMoVgEn u1XLp6BqBjP5UgVRzdiXp8XTue+RZJJLNsoekQnz8CLWApNZJMClahvAcJkczRNYqwMs6jDM8 Aw8IFwxIpHJbDtex8Q/U5FP2UnBoyypzhxFPxnHcAl2EFKACg0jSLMTRiea8rvJlQXHtv+hy6 o/d/ZFGATWDfvSgRNnJ2JtuI/fP1iqZp+ngONQskUEaFo+DcW6Mw3mb6MjnPfiX8rGTCnDBjc 3+leHZB X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 09:01:17 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIE1v biwgMiBKdWwgMjAxOCAxOTo0ODozOCArMDAwMCAoVVRDKQ0KTWF0dCBNYWN5IDxtbWFjeUBGcmVl QlNELm9yZz4gc2NocmllYjoNCg0KPiBBdXRob3I6IG1tYWN5DQo+IERhdGU6IE1vbiBKdWwgIDIg MTk6NDg6MzggMjAxOA0KPiBOZXcgUmV2aXNpb246IDMzNTg3Mw0KPiBVUkw6IGh0dHBzOi8vc3Zu d2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzMzNTg3Mw0KPiANCj4gTG9nOg0KPiAgIGlu bGluZSBhdG9taWNzIGFuZCBhbGxvdyB0aWVkIG1vZHVsZXMgdG8gaW5saW5lIGxvY2tzDQo+ICAg DQo+ICAgLSBpbmxpbmUgYXRvbWljcyBpbiBtb2R1bGVzIG9uIGkzODYgYW5kIGFtZDY0ICh0aGV5 IHdlcmUgYWx3YXlzDQo+ICAgICBpbmxpbmUgb24gb3RoZXIgYXJjaGVzKQ0KPiAgIC0gYWxsb3cg bW9kdWxlcyB0byBvcHQgaW4gdG8gaW5saW5pbmcgbG9ja3MgYnkgc3BlY2lmeWluZw0KPiAgICAg TU9EVUxFX1RJRUQ9MSBpbiB0aGUgbWFrZWZpbGUNCj4gICANCj4gICBSZXZpZXdlZCBieToga2li DQo+ICAgU3BvbnNvcmVkIGJ5OiBMaW1lbGlnaHQgTmV0d29ya3MNCj4gICBEaWZmZXJlbnRpYWwg UmV2aXNpb246IGh0dHBzOi8vcmV2aWV3cy5mcmVlYnNkLm9yZy9EMTYwNzkNCj4gDQo+IERlbGV0 ZWQ6DQo+ICAgaGVhZC9zeXMvYW1kNjQvYW1kNjQvYXRvbWljLmMNCj4gICBoZWFkL3N5cy9pMzg2 L2kzODYvYXRvbWljLmMNCj4gTW9kaWZpZWQ6DQo+ICAgaGVhZC9VUERBVElORw0KPiAgIGhlYWQv c3lzL2FtZDY0L2luY2x1ZGUvYXRvbWljLmgNCj4gICBoZWFkL3N5cy9jb25mL2ZpbGVzLmFtZDY0 DQo+ICAgaGVhZC9zeXMvY29uZi9maWxlcy5pMzg2DQo+ICAgaGVhZC9zeXMvY29uZi9rbW9kLm1r DQo+ICAgaGVhZC9zeXMvaTM4Ni9pbmNsdWRlL2F0b21pYy5oDQo+ICAgaGVhZC9zeXMvc3lzL2xv Y2suaA0KPiAgIGhlYWQvc3lzL3N5cy9tb2R1bGUuaA0KPiAgIGhlYWQvc3lzL3N5cy9tdXRleC5o DQo+ICAgaGVhZC9zeXMvc3lzL3BhcmFtLmgNCj4gICBoZWFkL3N5cy92bS92bV9tYXAuaA0KPiAg IGhlYWQvc3lzL3ZtL3ZtX3BhZ2UuaA0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvVVBEQVRJTkcNCj4g PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL1VQREFUSU5HCU1vbiBKdWwgIDIgMTk6 MzM6MjYgMjAxOAkocjMzNTg3MikNCj4gKysrIGhlYWQvVVBEQVRJTkcJTW9uIEp1bCAgMiAxOTo0 ODozOCAyMDE4CShyMzM1ODczKQ0KPiBAQCAtMzEsNiArMzEsMTAgQEAgTk9URSBUTyBQRU9QTEUg V0hPIFRISU5LIFRIQVQgRnJlZUJTRCAxMi54IElTIFNMT1c6DQo+ICAJZGlzYWJsZSB0aGUgbW9z dCBleHBlbnNpdmUgZGVidWdnaW5nIGZ1bmN0aW9uYWxpdHkgcnVuDQo+ICAJImxuIC1zICdhYm9y dDpmYWxzZSxqdW5rOmZhbHNlJyAvZXRjL21hbGxvYy5jb25mIi4pDQo+ICANCj4gKzIwMTgwNzAy Og0KPiArCU9uIGkzODYgYW5kIGFtZDY0IGF0b21pY3MgYXJlIG5vdyBpbmxpbmVkLiBPdXQgb2Yg dHJlZSBtb2R1bGVzIHVzaW5nDQo+ICsJYXRvbWljcyB3aWxsIG5lZWQgdG8gYmUgcmVidWlsdC4N Cj4gKw0KPiAgMjAxODA3MDE6DQo+ICAJVGhlICclSScgZm9ybWF0IGluIHRoZSBrZXJuLmNvcmVm aWxlIHN5c2N0bCBsaW1pdHMgdGhlIG51bWJlciBvZg0KPiAgCWNvcmUgZmlsZXMgdGhhdCBhIHBy b2Nlc3MgY2FuIGdlbmVyYXRlIHRvIHRoZSBudW1iZXIgc3RvcmVkIGluIHRoZQ0KPiANCj4gTW9k aWZpZWQ6IGhlYWQvc3lzL2FtZDY0L2luY2x1ZGUvYXRvbWljLmgNCj4gPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09DQo+IC0tLSBoZWFkL3N5cy9hbWQ2NC9pbmNsdWRlL2F0b21pYy5oCU1vbiBKdWwgIDIg MTk6MzM6MjYgMjAxOAkocjMzNTg3MikNCj4gKysrIGhlYWQvc3lzL2FtZDY0L2luY2x1ZGUvYXRv bWljLmgJTW9uIEp1bCAgMiAxOTo0ODozOCAyMDE4CShyMzM1ODczKQ0KPiBAQCAtOTYsNyArOTYs NyBAQA0KPiAgICogS2VybmVsIG1vZHVsZXMgY2FsbCByZWFsIGZ1bmN0aW9ucyB3aGljaCBhcmUg YnVpbHQgaW50byB0aGUga2VybmVsLg0KPiAgICogVGhpcyBhbGxvd3Mga2VybmVsIG1vZHVsZXMg dG8gYmUgcG9ydGFibGUgYmV0d2VlbiBVUCBhbmQgU01QIHN5c3RlbXMuDQo+ICAgKi8NCj4gLSNp ZiBkZWZpbmVkKEtMRF9NT0RVTEUpIHx8ICFkZWZpbmVkKF9fR05VQ0xJS0VfQVNNKQ0KPiArI2lm ICFkZWZpbmVkKF9fR05VQ0xJS0VfQVNNKQ0KPiAgI2RlZmluZQlBVE9NSUNfQVNNKE5BTUUsIFRZ UEUsIE9QLCBDT05TLCBWKQkJCVwNCj4gIHZvaWQgYXRvbWljXyMjTkFNRSMjXyMjVFlQRSh2b2xh dGlsZSB1XyMjVFlQRSAqcCwgdV8jI1RZUEUgdik7CVwNCj4gIHZvaWQgYXRvbWljXyMjTkFNRSMj X2JhcnJfIyNUWVBFKHZvbGF0aWxlIHVfIyNUWVBFICpwLCB1XyMjVFlQRSB2KQ0KPiANCj4gTW9k aWZpZWQ6IGhlYWQvc3lzL2NvbmYvZmlsZXMuYW1kNjQNCj4gPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 DQo+IC0tLSBoZWFkL3N5cy9jb25mL2ZpbGVzLmFtZDY0CU1vbiBKdWwgIDIgMTk6MzM6MjYgMjAx OAkocjMzNTg3MikNCj4gKysrIGhlYWQvc3lzL2NvbmYvZmlsZXMuYW1kNjQJTW9uIEp1bCAgMiAx OTo0ODozOCAyMDE4CShyMzM1ODczKQ0KPiBAQCAtMTI2LDcgKzEyNiw2IEBAIGFjcGlfd2FrZWRh dGEuaAkJCW9wdGlvbmFsDQo+IGFjcGkJCQlcIGNsZWFuCQkiYWNwaV93YWtlZGF0YS5oIg0KPiAg Iw0KPiAgI2FtZDY0L2FtZDY0L2FwaWNfdmVjdG9yLlMJc3RhbmRhcmQNCj4gLWFtZDY0L2FtZDY0 L2F0b21pYy5jCQlzdGFuZGFyZA0KPiAgYW1kNjQvYW1kNjQvYmlvcy5jCQlzdGFuZGFyZA0KPiAg YW1kNjQvYW1kNjQvYnBmX2ppdF9tYWNoZGVwLmMJb3B0aW9uYWwJYnBmX2ppdHRlcg0KPiAgYW1k NjQvYW1kNjQvY3B1X3N3aXRjaC5TCXN0YW5kYXJkDQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMv Y29uZi9maWxlcy5pMzg2DQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMv Y29uZi9maWxlcy5pMzg2CU1vbiBKdWwgIDIgMTk6MzM6MjYgMjAxOAkocjMzNTg3MikNCj4gKysr IGhlYWQvc3lzL2NvbmYvZmlsZXMuaTM4NglNb24gSnVsICAyIDE5OjQ4OjM4IDIwMTgJKHIzMzU4 NzMpDQo+IEBAIC00NzQsOCArNDc0LDYgQEAgaTM4Ni9iaW9zL3NtYXBpLmMJCW9wdGlvbmFsIHNt YXBpDQo+ICBpMzg2L2Jpb3Mvc21hcGlfYmlvcy5TCQlvcHRpb25hbCBzbWFwaQ0KPiAgaTM4Ni9j bG91ZGFiaTMyL2Nsb3VkYWJpMzJfc3lzdmVjLmMJb3B0aW9uYWwgY29tcGF0X2Nsb3VkYWJpMzIN Cj4gICNpMzg2L2kzODYvYXBpY192ZWN0b3IucwkJb3B0aW9uYWwgYXBpYw0KPiAtaTM4Ni9pMzg2 L2F0b21pYy5jCQlzdGFuZGFyZAkJXA0KPiAtCWNvbXBpbGUtd2l0aAkiJHtDQ30gLWMgJHtDRkxB R1N9DQo+ICR7REVGSU5FRF9QUk9GOlMvXiQvLWZvbWl0LWZyYW1lLXBvaW50ZXIvfSAkey5JTVBT UkN9IiBpMzg2L2kzODYvYmlvcy5jDQo+IHN0YW5kYXJkIGkzODYvaTM4Ni9iaW9zY2FsbC5zCQlz dGFuZGFyZA0KPiAgaTM4Ni9pMzg2L2JwZl9qaXRfbWFjaGRlcC5jCW9wdGlvbmFsIGJwZl9qaXR0 ZXINCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy9jb25mL2ttb2QubWsNCj4gPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy9jb25mL2ttb2QubWsJTW9uIEp1bCAgMiAxOTozMzoy NiAyMDE4CShyMzM1ODcyKQ0KPiArKysgaGVhZC9zeXMvY29uZi9rbW9kLm1rCU1vbiBKdWwgIDIg MTk6NDg6MzggMjAxOAkocjMzNTg3MykNCj4gQEAgLTExMSw2ICsxMTEsOSBAQCBXRVJST1I/PQkt V2Vycm9yDQo+ICBDRkxBR1MrPQkke1dFUlJPUn0NCj4gIENGTEFHUys9CS1EX0tFUk5FTA0KPiAg Q0ZMQUdTKz0JLURLTERfTU9EVUxFDQo+ICsuaWYgZGVmaW5lZChNT0RVTEVfVElFRCkNCj4gK0NG TEFHUys9CS1ES0xEX1RJRUQNCj4gKy5lbmRpZg0KPiAgDQo+ICAjIERvbid0IHVzZSBhbnkgc3Rh bmRhcmQgb3Igc291cmNlLXJlbGF0aXZlIGluY2x1ZGUgZGlyZWN0b3JpZXMuDQo+ICBOT1NURElO Qz0JLW5vc3RkaW5jDQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMvaTM4Ni9pbmNsdWRlL2F0b21p Yy5oDQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvaTM4Ni9pbmNsdWRl L2F0b21pYy5oCU1vbiBKdWwgIDIgMTk6MzM6MjYgMjAxOAkocjMzNTg3MikNCj4gKysrIGhlYWQv c3lzL2kzODYvaW5jbHVkZS9hdG9taWMuaAlNb24gSnVsICAyIDE5OjQ4OjM4IDIwMTgJKHIzMzU4 NzMpDQo+IEBAIC0xMDQsNyArMTA0LDcgQEAgX19tYnUodm9pZCkNCj4gICAqIEtlcm5lbCBtb2R1 bGVzIGNhbGwgcmVhbCBmdW5jdGlvbnMgd2hpY2ggYXJlIGJ1aWx0IGludG8gdGhlIGtlcm5lbC4N Cj4gICAqIFRoaXMgYWxsb3dzIGtlcm5lbCBtb2R1bGVzIHRvIGJlIHBvcnRhYmxlIGJldHdlZW4g VVAgYW5kIFNNUCBzeXN0ZW1zLg0KPiAgICovDQo+IC0jaWYgZGVmaW5lZChLTERfTU9EVUxFKSB8 fCAhZGVmaW5lZChfX0dOVUNMSUtFX0FTTSkNCj4gKyNpZiAhZGVmaW5lZChfX0dOVUNMSUtFX0FT TSkNCj4gICNkZWZpbmUJQVRPTUlDX0FTTShOQU1FLCBUWVBFLCBPUCwgQ09OUywgVikJCQlcDQo+ ICB2b2lkIGF0b21pY18jI05BTUUjI18jI1RZUEUodm9sYXRpbGUgdV8jI1RZUEUgKnAsIHVfIyNU WVBFIHYpOwlcDQo+ICB2b2lkIGF0b21pY18jI05BTUUjI19iYXJyXyMjVFlQRSh2b2xhdGlsZSB1 XyMjVFlQRSAqcCwgdV8jI1RZUEUgdikNCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy9zeXMvbG9j ay5oDQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvc3lzL2xvY2suaAlN b24gSnVsICAyIDE5OjMzOjI2IDIwMTgJKHIzMzU4NzIpDQo+ICsrKyBoZWFkL3N5cy9zeXMvbG9j ay5oCU1vbiBKdWwgIDIgMTk6NDg6MzggMjAxOAkocjMzNTg3MykNCj4gQEAgLTEyNyw3ICsxMjcs NyBAQCBzdHJ1Y3QgbG9ja19jbGFzcyB7DQo+ICAgKiBjYWxsaW5nIGNvbnZlbnRpb25zIGZvciB0 aGlzIGRlYnVnZ2luZyBjb2RlIGluIG1vZHVsZXMgc28gdGhhdCBtb2R1bGVzIGNhbg0KPiAgICog d29yayB3aXRoIGJvdGggZGVidWcgYW5kIG5vbi1kZWJ1ZyBrZXJuZWxzLg0KPiAgICovDQo+IC0j aWYgZGVmaW5lZChLTERfTU9EVUxFKSB8fCBkZWZpbmVkKFdJVE5FU1MpIHx8IGRlZmluZWQoSU5W QVJJQU5UUykgfHwgXA0KPiArI2lmIChkZWZpbmVkKEtMRF9NT0RVTEUpICYmICFkZWZpbmVkKEtM RF9USUVEKSkgfHwgZGVmaW5lZChXSVRORVNTKSB8fA0KPiBkZWZpbmVkKElOVkFSSUFOVFMpIHx8 IFwgZGVmaW5lZChMT0NLX1BST0ZJTElORykgfHwgZGVmaW5lZChLVFIpDQo+ICAjZGVmaW5lCUxP Q0tfREVCVUcJMQ0KPiAgI2Vsc2UNCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy9zeXMvbW9kdWxl LmgNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy9zeXMvbW9kdWxlLmgJ TW9uIEp1bCAgMiAxOTozMzoyNiAyMDE4CShyMzM1ODcyKQ0KPiArKysgaGVhZC9zeXMvc3lzL21v ZHVsZS5oCU1vbiBKdWwgIDIgMTk6NDg6MzggMjAxOAkocjMzNTg3MykNCj4gQEAgLTE0Niw4ICsx NDYsMTMgQEAgc3RydWN0IG1vZF9wbnBfbWF0Y2hfaW5mbyANCj4gIAlTWVNJTklUKG5hbWUjI21v ZHVsZSwgc3ViLCBvcmRlciwgbW9kdWxlX3JlZ2lzdGVyX2luaXQsICZkYXRhKTsJXA0KPiAgCXN0 cnVjdCBfX2hhY2sNCj4gIA0KPiArI2lmZGVmIEtMRF9USUVEDQo+ICAjZGVmaW5lCURFQ0xBUkVf TU9EVUxFKG5hbWUsIGRhdGEsIHN1Yiwgb3JkZXIpCQkJCVwNCj4gKwlERUNMQVJFX01PRFVMRV9X SVRIX01BWFZFUihuYW1lLCBkYXRhLCBzdWIsIG9yZGVyLCBfX0ZyZWVCU0RfdmVyc2lvbikNCj4g KyNlbHNlDQo+ICsjZGVmaW5lCURFQ0xBUkVfTU9EVUxFKG5hbWUsIGRhdGEsIHN1YiwNCj4gb3Jk ZXIpCQkJCQkJCVwNCj4gREVDTEFSRV9NT0RVTEVfV0lUSF9NQVhWRVIobmFtZSwgZGF0YSwgc3Vi LCBvcmRlciwgTU9EVUxFX0tFUk5FTF9NQVhWRVIpICsjZW5kaWYNCj4gIA0KPiAgLyoNCj4gICAq IFRoZSBtb2R1bGUgZGVjbGFyZWQgd2l0aCBERUNMQVJFX01PRFVMRV9USUVEIGNhbiBvbmx5IGJl IGxvYWRlZA0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvc3lzL3N5cy9tdXRleC5oDQo+ID09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvc3lzL211dGV4LmgJTW9uIEp1bCAgMiAxOToz MzoyNiAyMDE4CShyMzM1ODcyKQ0KPiArKysgaGVhZC9zeXMvc3lzL211dGV4LmgJTW9uIEp1bCAg MiAxOTo0ODozOCAyMDE4CShyMzM1ODczKQ0KPiBAQCAtMTM4LDcgKzEzOCw3IEBAIHZvaWQJX3Ro cmVhZF9sb2NrKHN0cnVjdCB0aHJlYWQgKnRkLCBpbnQgb3B0cywgY29uc3QgYw0KPiAgdm9pZAlf dGhyZWFkX2xvY2soc3RydWN0IHRocmVhZCAqKTsNCj4gICNlbmRpZg0KPiAgDQo+IC0jaWYgZGVm aW5lZChMT0NLX1BST0ZJTElORykgfHwgZGVmaW5lZChLTERfTU9EVUxFKQ0KPiArI2lmIGRlZmlu ZWQoTE9DS19QUk9GSUxJTkcpIHx8IChkZWZpbmVkKEtMRF9NT0RVTEUpICYmICFkZWZpbmVkKEtM RF9USUVEKSkNCj4gICNkZWZpbmUJdGhyZWFkX2xvY2sodGRwKQkJCQkJCVwNCj4gIAl0aHJlYWRf bG9ja19mbGFnc18oKHRkcCksIDAsIF9fRklMRV9fLCBfX0xJTkVfXykNCj4gICNlbGlmIExPQ0tf REVCVUcgPiAwDQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMvc3lzL3BhcmFtLmgNCj4gPT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy9zeXMvcGFyYW0uaAlNb24gSnVsICAyIDE5 OjMzOjI2IDIwMTgJKHIzMzU4NzIpDQo+ICsrKyBoZWFkL3N5cy9zeXMvcGFyYW0uaAlNb24gSnVs ICAyIDE5OjQ4OjM4IDIwMTgJKHIzMzU4NzMpDQo+IEBAIC02MCw3ICs2MCw3IEBADQo+ICAgKgkJ aW4gdGhlIHJhbmdlIDUgdG8gOS4NCj4gICAqLw0KPiAgI3VuZGVmIF9fRnJlZUJTRF92ZXJzaW9u DQo+IC0jZGVmaW5lIF9fRnJlZUJTRF92ZXJzaW9uIDEyMDAwNjkJLyogTWFzdGVyLCBwcm9wYWdh dGVkIHRvIG5ld3ZlcnMgKi8NCj4gKyNkZWZpbmUgX19GcmVlQlNEX3ZlcnNpb24gMTIwMDA3MAkv KiBNYXN0ZXIsIHByb3BhZ2F0ZWQgdG8gbmV3dmVycyAqLw0KPiAgDQo+ICAvKg0KPiAgICogX19G cmVlQlNEX2tlcm5lbF9fIGluZGljYXRlcyB0aGF0IHRoaXMgc3lzdGVtIHVzZXMgdGhlIGtlcm5l bCBvZiBGcmVlQlNELA0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvc3lzL3ZtL3ZtX21hcC5oDQo+ID09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvdm0vdm1fbWFwLmgJTW9uIEp1bCAg MiAxOTozMzoyNiAyMDE4CShyMzM1ODcyKQ0KPiArKysgaGVhZC9zeXMvdm0vdm1fbWFwLmgJTW9u IEp1bCAgMiAxOTo0ODozOCAyMDE4CShyMzM1ODczKQ0KPiBAQCAtMjA2LDcgKzIwNiw3IEBAIHN0 cnVjdCB2bV9tYXAgew0KPiAgI2RlZmluZQlNQVBfQlVTWV9XQUtFVVAJCTB4MDINCj4gIA0KPiAg I2lmZGVmCV9LRVJORUwNCj4gLSNpZmRlZiBLTERfTU9EVUxFDQo+ICsjaWYgZGVmaW5lZChLTERf TU9EVUxFKSAmJiAhZGVmaW5lZChLTERfVElFRCkNCj4gICNkZWZpbmUJdm1fbWFwX21heChtYXAp CQl2bV9tYXBfbWF4X0tCSSgobWFwKSkNCj4gICNkZWZpbmUJdm1fbWFwX21pbihtYXApCQl2bV9t YXBfbWluX0tCSSgobWFwKSkNCj4gICNkZWZpbmUJdm1fbWFwX3BtYXAobWFwKQl2bV9tYXBfcG1h cF9LQkkoKG1hcCkpDQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMvdm0vdm1fcGFnZS5oDQo+ID09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvdm0vdm1fcGFnZS5oCU1vbiBKdWwg IDIgMTk6MzM6MjYgMjAxOAkocjMzNTg3MikNCj4gKysrIGhlYWQvc3lzL3ZtL3ZtX3BhZ2UuaAlN b24gSnVsICAyIDE5OjQ4OjM4IDIwMTgJKHIzMzU4NzMpDQo+IEBAIC0zMDQsNyArMzA0LDcgQEAg ZXh0ZXJuIHN0cnVjdCBtdHhfcGFkYWxpZ24gcGFfbG9ja1tdOw0KPiAgDQo+ICAjZGVmaW5lCVBB X0xPQ0tfQVNTRVJUKHBhLCBhKQltdHhfYXNzZXJ0KFBBX0xPQ0tQVFIocGEpLCAoYSkpDQo+ICAN Cj4gLSNpZmRlZiBLTERfTU9EVUxFDQo+ICsjaWYgZGVmaW5lZChLTERfTU9EVUxFKSAmJiAhZGVm aW5lZChLTERfVElFRCkNCj4gICNkZWZpbmUJdm1fcGFnZV9sb2NrKG0pCQl2bV9wYWdlX2xvY2tf S0JJKChtKSwgTE9DS19GSUxFLA0KPiBMT0NLX0xJTkUpICNkZWZpbmUJdm1fcGFnZV91bmxvY2so bSkJdm1fcGFnZV91bmxvY2tfS0JJKChtKSwgTE9DS19GSUxFLA0KPiBMT0NLX0xJTkUpICNkZWZp bmUJdm1fcGFnZV90cnlsb2NrKG0pCXZtX3BhZ2VfdHJ5bG9ja19LQkkoKG0pLCBMT0NLX0ZJTEUs DQo+IExPQ0tfTElORSkgQEAgLTczNCw3ICs3MzQsNyBAQCB2bV9wYWdlX2RpcnR5KHZtX3BhZ2Vf dCBtKQ0KPiAgew0KPiAgDQo+ICAJLyogVXNlIHZtX3BhZ2VfZGlydHlfS0JJKCkgdW5kZXIgSU5W QVJJQU5UUyB0byBzYXZlIG1lbW9yeS4gKi8NCj4gLSNpZiBkZWZpbmVkKEtMRF9NT0RVTEUpIHx8 IGRlZmluZWQoSU5WQVJJQU5UUykNCj4gKyNpZiAoZGVmaW5lZChLTERfTU9EVUxFKSAmJiAhZGVm aW5lZChLTERfVElFRCkpIHx8IGRlZmluZWQoSU5WQVJJQU5UUykNCj4gIAl2bV9wYWdlX2RpcnR5 X0tCSShtKTsNCj4gICNlbHNlDQo+ICAJbS0+ZGlydHkgPSBWTV9QQUdFX0JJVFNfQUxMOw0KPiBf X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXw0KPiBzdm4tc3Jj LWhlYWRAZnJlZWJzZC5vcmcgbWFpbGluZyBsaXN0DQo+IGh0dHBzOi8vbGlzdHMuZnJlZWJzZC5v cmcvbWFpbG1hbi9saXN0aW5mby9zdm4tc3JjLWhlYWQNCj4gVG8gdW5zdWJzY3JpYmUsIHNlbmQg YW55IG1haWwgdG8gInN2bi1zcmMtaGVhZC11bnN1YnNjcmliZUBmcmVlYnNkLm9yZyINCg0KVGhp cyBwYXRjaCBicmVha3MgYnVpbGRpbmcgb2YgcG9ydHMNCg0KZW11bGF0b3JzL3ZpcnR1YWxib3gt b3NlLWttb2QNCmdyYXBoaWNzL2RybS1zdGFibGUta21vZA0KDQp3aGljaCB3ZSBidWlsZCB2aWEg L2V0Yy9zcmMuY29uZiBhbmQgUE9SVFNfTU9EVUxFUz0gLg0KDQpSZXZlcnRpbmcgQ1VSUkVOVCBz b3VyY2VzIHRvIHByZS1yMzM1ODczIG1ha2VzIGNvbXBpbGluZyBlbXVsYXRvcnMvdmlydHVhbGJv eC1vc2Uta21vZA0Kc3VjY2Vzc2luZywgYnV0IGxlYXZlcyBncmFwaGljcy9kcm0tc3RhYmxlLWtt b2Qgd2l0aCBzb21lIHdlaXJkIGNvbXBpbGVyIGVycm9ycyAodXNpbmcNCk1FVEFfTU9ERSkuDQoN ClRoZSBlcnJvciBzaG93biByZXZpc2lvbiAzMzU4ODQgd2hlbiBjb21waWxpbmcgdGhlIG1vZHVs ZQ0KZ3JhcGhpY3MvZHJtLXN0YWJsZS1rbW9kIGlzOg0KDQpbLi4uXQ0KSW4gZmlsZSBpbmNsdWRl ZCBmcm9tIGk5MTVfZHJ2LmM6MzA6DQpJbiBmaWxlIGluY2x1ZGVkDQpmcm9tIC91c3Ivb2JqL3Vz ci9zcmMvYW1kNjQuYW1kNjQvc3lzL1dBTEhBTEwvdXNyL3BvcnRzL2dyYXBoaWNzL2RybS1zdGFi bGUta21vZC93b3JrL2ttcy1kcm0tYTc1MzIxNS9saW51eGtwaS9ncGx2Mi9pbmNsdWRlL2xpbnV4 L2FjcGkuaDoyNjoNCkluIGZpbGUgaW5jbHVkZWQNCmZyb20gL3Vzci9vYmovdXNyL3NyYy9hbWQ2 NC5hbWQ2NC9zeXMvV0FMSEFMTC91c3IvcG9ydHMvZ3JhcGhpY3MvZHJtLXN0YWJsZS1rbW9kL3dv cmsva21zLWRybS1hNzUzMjE1L2xpbnV4a3BpL2dwbHYyL2luY2x1ZGUvbGludXgvZGV2aWNlLmg6 NDoNCkluIGZpbGUgaW5jbHVkZWQgZnJvbSAvdXNyL3NyYy9zeXMvY29tcGF0L2xpbnV4a3BpL2Nv bW1vbi9pbmNsdWRlL2xpbnV4L2RldmljZS5oOjM1OiBJbg0KZmlsZSBpbmNsdWRlZCBmcm9tIC91 c3Ivc3JjL3N5cy9jb21wYXQvbGludXhrcGkvY29tbW9uL2luY2x1ZGUvbGludXgvdHlwZXMuaDoz NzogSW4gZmlsZQ0KaW5jbHVkZWQgZnJvbSAvdXNyL3NyYy9zeXMvc3lzL3N5c3RtLmg6NDQ6IC4v bWFjaGluZS9hdG9taWMuaDo0NTA6Mjk6IGVycm9yOiBpbnZhbGlkDQpvcGVyYW5kIGZvciBpbnN0 cnVjdGlvbiBBVE9NSUNfQVNNKGNsZWFyLCAgICBsb25nLCAgImFuZHEgJTEsJTAiLCAgImlyIiwg fnYpOyBeDQo8aW5saW5lIGFzbT46MTo3OiBub3RlOiBpbnN0YW50aWF0ZWQgaW50byBhc3NlbWJs eSBoZXJlDQogICAgICAgIGFuZHEgJDkyMjMzNzIwMzY4NTQ3NzU4MDcsNDA2NzIoJXIxNCkNCiAg ICAgICAgICAgICBefn5+fn5+fn5+fn5+fn5+fn5+fn4NCjEgZXJyb3IgZ2VuZXJhdGVkLg0KKioq IEVycm9yIGNvZGUgMQ0KWy4uLl0NCg0KYW5kICBmb3IgZW11bGF0b3JzL3ZpcnR1YWxib3gtb3Nl LWttb2QNCg0KWy4uLl0NCkluIGZpbGUgaW5jbHVkZWQgZnJvbSBTVVBEcnYuYzozMzoNCi4vU1VQ RHJ2SW50ZXJuYWwuaDo0OTU6NTogZXJyb3I6IHR5cGUgbmFtZSByZXF1aXJlcyBhIHNwZWNpZmll ciBvciBxdWFsaWZpZXINCiAgICBQVk0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNz aW9uVk07DQogICAgXg0KL3Vzci9zcmMvc3lzL3N5cy9wcmlvcml0eS5oOjEwNDoxNTogbm90ZTog ZXhwYW5kZWQgZnJvbSBtYWNybyAnUFZNJw0KI2RlZmluZSBQVk0gICAgICAgICAgICAgICAgICAg ICAoUFJJX01JTl9LRVJOICsgNCkNCg0KWy4uLl0NCg0KLSAtLSANCk8uIEhhcnRtYW5uDQoNCklj aCB3aWRlcnNwcmVjaGUgZGVyIE51dHp1bmcgb2RlciDDnGJlcm1pdHRsdW5nIG1laW5lciBEYXRl biBmw7xyDQpXZXJiZXp3ZWNrZSBvZGVyIGbDvHIgZGllIE1hcmt0LSBvZGVyIE1laW51bmdzZm9y c2NodW5nICjCpyAyOCBBYnMuIDQgQkRTRykuDQotLS0tLUJFR0lOIFBHUCBTSUdOQVRVUkUtLS0t LQ0KDQppTFVFQVJNS0FCMFdJUVFaVlpNekF0d0MyVC84NlRyUzUyOGZ5RmhZbEFVQ1d6czdUUUFL Q1JEUzUyOGZ5RmhZDQpsT0N6QWY5bEJGV204Mm5KTDZSaXk2ak5NblFyQSswTTlDRnY2SjZVUUdq ak45dVdtTDVpYVQ0Q1pGcjZVeFhRDQppU2lKdjkzd1dhMGRxRlQwaVFRaThYSWcrN2d1QWYwYlgy ZFphMU43KytXR2NCVnRvVVVQUEFUOWlxRXpYWVlsDQpuaWhHelJCQXZWYXZzN2tjRmZ5ejZWWnMv SDJ6a0R5eXJjOFo2d0oxbXY2M0VCdXhhMmxHDQo9TTBTUw0KLS0tLS1FTkQgUEdQIFNJR05BVFVS RS0tLS0tDQo= From owner-svn-src-head@freebsd.org Tue Jul 3 10:52:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F9F610350CA; Tue, 3 Jul 2018 10:52:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 527347A510; Tue, 3 Jul 2018 10:52:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 343031B244; Tue, 3 Jul 2018 10:52:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63ApxNe087146; Tue, 3 Jul 2018 10:51:59 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63ApxxC087145; Tue, 3 Jul 2018 10:51:59 GMT (envelope-from br@FreeBSD.org) Message-Id: <201807031051.w63ApxxC087145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 3 Jul 2018 10:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335887 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 335887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 10:52:00 -0000 Author: br Date: Tue Jul 3 10:51:59 2018 New Revision: 335887 URL: https://svnweb.freebsd.org/changeset/base/335887 Log: Add GCC 8.1.0 compiler warning flags. Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Jul 3 08:50:49 2018 (r335886) +++ head/share/mk/bsd.sys.mk Tue Jul 3 10:51:59 2018 (r335887) @@ -154,6 +154,16 @@ CWARNFLAGS+= -Wno-error=bool-operation \ -Wno-error=stringop-overflow .endif +# GCC 8.1.0 +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100 +CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations \ + -Wno-error=cast-function-type \ + -Wno-error=multistatement-macros \ + -Wno-error=restrict \ + -Wno-error=sizeof-pointer-memaccess \ + -Wno-error=stringop-truncation +.endif + # How to handle FreeBSD custom printf format specifiers. .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ From owner-svn-src-head@freebsd.org Tue Jul 3 10:56:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F18BE1035575; Tue, 3 Jul 2018 10:56:56 +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 75ABE7A7FA; Tue, 3 Jul 2018 10:56:56 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id BAC3E24937; Tue, 3 Jul 2018 10:56:49 +0000 (UTC) Date: Tue, 3 Jul 2018 10:56:48 +0000 From: Mark Linimon To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335887 - head/share/mk Message-ID: <20180703105648.GA25479@lonesome.com> References: <201807031051.w63ApxxC087145@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807031051.w63ApxxC087145@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 10:56:57 -0000 On Tue, Jul 03, 2018 at 10:51:59AM +0000, Ruslan Bukin wrote: > Add GCC 8.1.0 compiler warning flags. I'm sorry, but that is a "what" not a "why". As someone who tries to fix ports on tier-2, I really need to understand the "why". mcl From owner-svn-src-head@freebsd.org Tue Jul 3 13:53:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C76511022440; Tue, 3 Jul 2018 13:53:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C40382378; Tue, 3 Jul 2018 13:53:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F0081CF69; Tue, 3 Jul 2018 13:53:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63DrtwR079943; Tue, 3 Jul 2018 13:53:55 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63DrsAa079940; Tue, 3 Jul 2018 13:53:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <201807031353.w63DrsAa079940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 3 Jul 2018 13:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd X-SVN-Commit-Revision: 335888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 13:53:56 -0000 Author: br Date: Tue Jul 3 13:53:54 2018 New Revision: 335888 URL: https://svnweb.freebsd.org/changeset/base/335888 Log: o Ensure va_list is declared by including stdarg.h. o Also move printf.h to go after it since it does require declaration of va_list. This fixes build with latest RISC-V GNU Toolchain with GCC 8.1 Sponsored by: DARPA, AFRL Modified: head/contrib/blacklist/bin/blacklistctl.c head/lib/libpjdlog/pjdlog.c head/sbin/hastd/pjdlog.c Modified: head/contrib/blacklist/bin/blacklistctl.c ============================================================================== --- head/contrib/blacklist/bin/blacklistctl.c Tue Jul 3 10:51:59 2018 (r335887) +++ head/contrib/blacklist/bin/blacklistctl.c Tue Jul 3 13:53:54 2018 (r335888) @@ -35,6 +35,7 @@ #include __RCSID("$NetBSD: blacklistctl.c,v 1.21 2016/11/02 03:15:07 jnemeth Exp $"); +#include #include #include #ifdef HAVE_LIBUTIL_H Modified: head/lib/libpjdlog/pjdlog.c ============================================================================== --- head/lib/libpjdlog/pjdlog.c Tue Jul 3 10:51:59 2018 (r335887) +++ head/lib/libpjdlog/pjdlog.c Tue Jul 3 13:53:54 2018 (r335888) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Tue Jul 3 10:51:59 2018 (r335887) +++ head/sbin/hastd/pjdlog.c Tue Jul 3 13:53:54 2018 (r335888) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Tue Jul 3 13:59:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94D3610229FC; Tue, 3 Jul 2018 13:59:03 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-32.csi.cam.ac.uk (ppsw-32.csi.cam.ac.uk [131.111.8.132]) (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 2CCE6825F2; Tue, 3 Jul 2018 13:59:03 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:46397) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1faLpd-00061Y-26 (Exim 4.91) (return-path ); Tue, 03 Jul 2018 14:59:01 +0100 Date: Tue, 3 Jul 2018 14:48:16 +0100 From: Ruslan Bukin To: Mark Linimon Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335887 - head/share/mk Message-ID: <20180703134816.GA32736@bsdpad.com> References: <201807031051.w63ApxxC087145@repo.freebsd.org> <20180703105648.GA25479@lonesome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180703105648.GA25479@lonesome.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 13:59:03 -0000 On Tue, Jul 03, 2018 at 10:56:48AM +0000, Mark Linimon wrote: > On Tue, Jul 03, 2018 at 10:51:59AM +0000, Ruslan Bukin wrote: > > Add GCC 8.1.0 compiler warning flags. > > I'm sorry, but that is a "what" not a "why". > > As someone who tries to fix ports on tier-2, I really need to > understand the "why". > There are plenty of issues (see warning flags for earlier versions of GCC listed in the same file which are required for GCC 8.1 as well). I think enumeration of all the issues may take some time. You just comment some warning flags and try build world. Ruslan From owner-svn-src-head@freebsd.org Tue Jul 3 14:32:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56210102527B; Tue, 3 Jul 2018 14:32:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0845583B09; Tue, 3 Jul 2018 14:32:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD94B1D4C1; Tue, 3 Jul 2018 14:32:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63EWFWC000290; Tue, 3 Jul 2018 14:32:15 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63EWFmt000289; Tue, 3 Jul 2018 14:32:15 GMT (envelope-from br@FreeBSD.org) Message-Id: <201807031432.w63EWFmt000289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 3 Jul 2018 14:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335889 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 14:32:16 -0000 Author: br Date: Tue Jul 3 14:32:15 2018 New Revision: 335889 URL: https://svnweb.freebsd.org/changeset/base/335889 Log: Fix build: utf8strvisx() does signed data comparisons, but 'char' type is unsigned in riscv GCC, so use guaranted signed char type. Sponsored by: DARPA, AFRL Modified: head/usr.bin/top/utils.c Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Tue Jul 3 13:53:54 2018 (r335888) +++ head/usr.bin/top/utils.c Tue Jul 3 14:32:15 2018 (r335889) @@ -344,7 +344,7 @@ static const char *vis_encodes[] = { int utf8strvisx(char *dst, const char *src, size_t src_len) { - const char *src_p; + const signed char *src_p; char *dst_p; int i, j, olen, len; From owner-svn-src-head@freebsd.org Tue Jul 3 14:57:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 678311027663; Tue, 3 Jul 2018 14:57:03 +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 D02958513C; Tue, 3 Jul 2018 14:57:02 +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 CCFD710AFD4; Tue, 3 Jul 2018 10:57:01 -0400 (EDT) Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd To: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807031353.w63DrsAa079940@repo.freebsd.org> From: John Baldwin Message-ID: <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> Date: Tue, 3 Jul 2018 07:57:00 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807031353.w63DrsAa079940@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 03 Jul 2018 10:57:02 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 14:57:03 -0000 On 7/3/18 6:53 AM, Ruslan Bukin wrote: > Author: br > Date: Tue Jul 3 13:53:54 2018 > New Revision: 335888 > URL: https://svnweb.freebsd.org/changeset/base/335888 > > Log: > o Ensure va_list is declared by including stdarg.h. > o Also move printf.h to go after it since it does require declaration > of va_list. > > This fixes build with latest RISC-V GNU Toolchain with GCC 8.1 Normal style(9) is to sort headers. Also, includes already so should already have va_list defined. I think there is some other build problem you are running into with GCC 8.1. Did you ensure you stripped all of the 'include-fixed' headers when you updated riscv64-gcc? This seems to be an issue of busted headers in the compiler and these changes should probably be reverted. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jul 3 15:12:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B43041028E70; Tue, 3 Jul 2018 15:12:50 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-33.csi.cam.ac.uk (ppsw-33.csi.cam.ac.uk [131.111.8.133]) (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 47169862EE; Tue, 3 Jul 2018 15:12:50 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:26364) by ppsw-33.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1faMz3-000rsf-g8 (Exim 4.91) (return-path ); Tue, 03 Jul 2018 16:12:49 +0100 Date: Tue, 3 Jul 2018 16:02:03 +0100 From: Ruslan Bukin To: John Baldwin Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd Message-ID: <20180703150203.GA34086@bsdpad.com> References: <201807031353.w63DrsAa079940@repo.freebsd.org> <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 15:12:50 -0000 On Tue, Jul 03, 2018 at 07:57:00AM -0700, John Baldwin wrote: > On 7/3/18 6:53 AM, Ruslan Bukin wrote: > > Author: br > > Date: Tue Jul 3 13:53:54 2018 > > New Revision: 335888 > > URL: https://svnweb.freebsd.org/changeset/base/335888 > > > > Log: > > o Ensure va_list is declared by including stdarg.h. > > o Also move printf.h to go after it since it does require declaration > > of va_list. > > > > This fixes build with latest RISC-V GNU Toolchain with GCC 8.1 > > Normal style(9) is to sort headers. Also, includes already > so should already have va_list defined. I think there is some other build problem > you are running into with GCC 8.1. Did you ensure you stripped all of the > 'include-fixed' headers when you updated riscv64-gcc? This seems to be an issue > of busted headers in the compiler and these changes should probably be reverted. > What do you mean stripped? Should I do something with this directory 0 pie:/home/br/riscv20180702 >find ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/ ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/ ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/syslimits.h ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/limits.h ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/README ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/sys ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/sys/types.h ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/stddef.h ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/stdio.h ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/stdlib.h ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/unistd.h ./lib/gcc/riscv64-unknown-freebsd11.2/8.1.0/include-fixed/wchar.h Ruslan From owner-svn-src-head@freebsd.org Tue Jul 3 15:22:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E8E910299CE; Tue, 3 Jul 2018 15:22:06 +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 4A02E869C1; Tue, 3 Jul 2018 15:22:06 +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 8526910A87D; Tue, 3 Jul 2018 11:21:59 -0400 (EDT) Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd To: Ruslan Bukin References: <201807031353.w63DrsAa079940@repo.freebsd.org> <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> <20180703150203.GA34086@bsdpad.com> Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: Date: Tue, 3 Jul 2018 08:21:58 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180703150203.GA34086@bsdpad.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 03 Jul 2018 11:22:00 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 15:22:06 -0000 On 7/3/18 8:02 AM, Ruslan Bukin wrote: > On Tue, Jul 03, 2018 at 07:57:00AM -0700, John Baldwin wrote: >> On 7/3/18 6:53 AM, Ruslan Bukin wrote: >>> Author: br >>> Date: Tue Jul 3 13:53:54 2018 >>> New Revision: 335888 >>> URL: https://svnweb.freebsd.org/changeset/base/335888 >>> >>> Log: >>> o Ensure va_list is declared by including stdarg.h. >>> o Also move printf.h to go after it since it does require declaration >>> of va_list. >>> >>> This fixes build with latest RISC-V GNU Toolchain with GCC 8.1 >> >> Normal style(9) is to sort headers. Also, includes already >> so should already have va_list defined. I think there is some other build problem >> you are running into with GCC 8.1. Did you ensure you stripped all of the >> 'include-fixed' headers when you updated riscv64-gcc? This seems to be an issue >> of busted headers in the compiler and these changes should probably be reverted. >> > > What do you mean stripped? Should I do something with this directory The xtoolchain ports and base/gcc remove these entirely since GCC usually breaks them. You can just remove that directory if you are building by hand. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jul 3 15:24:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B0E61029C5D; Tue, 3 Jul 2018 15:24:10 +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 EB6BE86BD1; Tue, 3 Jul 2018 15:24:09 +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 CC9D21DE3D; Tue, 3 Jul 2018 15:24:09 +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 w63FO9cJ027595; Tue, 3 Jul 2018 15:24:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63FO9R0027594; Tue, 3 Jul 2018 15:24:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201807031524.w63FO9R0027594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 Jul 2018 15:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335892 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 335892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 15:24:10 -0000 Author: jhb Date: Tue Jul 3 15:24:09 2018 New Revision: 335892 URL: https://svnweb.freebsd.org/changeset/base/335892 Log: Don't specify the desired march/mabi for RISC-V in ACFLAGS. ACFLAGS is only used in addition to CFLAGS, so setting the options in both was redundant. However, ACFLAGS is added to the command line after CFLAGS, so the settings from ACFLAGS were applied for assembly files in kernel modules after the kernel-specific march/abi in CFLAGS. As a result, the hard-float ACFLAGS in bsd.cpu.mk was overriding the soft-float CFLAGS.gcc in sys/conf/kern.mk. In particular, dtrace_asm.o was compiled as hard-float and the linker refused to link dtrace.ko since its object files contained a mix of hard and soft float. Reviewed by: br Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D16054 Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Tue Jul 3 14:57:11 2018 (r335891) +++ head/share/mk/bsd.cpu.mk Tue Jul 3 15:24:09 2018 (r335892) @@ -368,10 +368,8 @@ CFLAGS += -mcpu=8540 -Wa,-me500 -mspe=yes -mabi=spe -m .if ${MACHINE_CPUARCH} == "riscv" .if ${MACHINE_ARCH:Mriscv*sf} CFLAGS += -march=rv64imac -mabi=lp64 -ACFLAGS += -march=rv64imac -mabi=lp64 .else CFLAGS += -march=rv64imafdc -mabi=lp64d -ACFLAGS += -march=rv64imafdc -mabi=lp64d .endif .endif From owner-svn-src-head@freebsd.org Tue Jul 3 15:48:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E0E102B8C7; Tue, 3 Jul 2018 15:48:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8284988451; Tue, 3 Jul 2018 15:48:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63BC11E16E; Tue, 3 Jul 2018 15:48:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63FmZiQ037713; Tue, 3 Jul 2018 15:48:35 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63FmYJl037710; Tue, 3 Jul 2018 15:48:34 GMT (envelope-from br@FreeBSD.org) Message-Id: <201807031548.w63FmYJl037710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 3 Jul 2018 15:48:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335893 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd X-SVN-Commit-Revision: 335893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 15:48:36 -0000 Author: br Date: Tue Jul 3 15:48:34 2018 New Revision: 335893 URL: https://svnweb.freebsd.org/changeset/base/335893 Log: Revert 335888 ("Ensure va_list is declared by including stdarg.h.") The issue was caused by header pollution brought by GCC 8.1. We now have to remove include-fixed headers in the GCC installation directory. Sponsored by: DARPA, AFRL Pointed out by: jhb Modified: head/contrib/blacklist/bin/blacklistctl.c head/lib/libpjdlog/pjdlog.c head/sbin/hastd/pjdlog.c Modified: head/contrib/blacklist/bin/blacklistctl.c ============================================================================== --- head/contrib/blacklist/bin/blacklistctl.c Tue Jul 3 15:24:09 2018 (r335892) +++ head/contrib/blacklist/bin/blacklistctl.c Tue Jul 3 15:48:34 2018 (r335893) @@ -35,7 +35,6 @@ #include __RCSID("$NetBSD: blacklistctl.c,v 1.21 2016/11/02 03:15:07 jnemeth Exp $"); -#include #include #include #ifdef HAVE_LIBUTIL_H Modified: head/lib/libpjdlog/pjdlog.c ============================================================================== --- head/lib/libpjdlog/pjdlog.c Tue Jul 3 15:24:09 2018 (r335892) +++ head/lib/libpjdlog/pjdlog.c Tue Jul 3 15:48:34 2018 (r335893) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Tue Jul 3 15:24:09 2018 (r335892) +++ head/sbin/hastd/pjdlog.c Tue Jul 3 15:48:34 2018 (r335893) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Tue Jul 3 15:49:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27AEB102B99A; Tue, 3 Jul 2018 15:49:09 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-33.csi.cam.ac.uk (ppsw-33.csi.cam.ac.uk [131.111.8.133]) (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 BC48A885A2; Tue, 3 Jul 2018 15:49:08 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:56129) by ppsw-33.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1faNYB-000HbI-gR (Exim 4.91) (return-path ); Tue, 03 Jul 2018 16:49:07 +0100 Date: Tue, 3 Jul 2018 16:38:21 +0100 From: Ruslan Bukin To: John Baldwin Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd Message-ID: <20180703153821.GA34674@bsdpad.com> References: <201807031353.w63DrsAa079940@repo.freebsd.org> <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> <20180703150203.GA34086@bsdpad.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 15:49:09 -0000 On Tue, Jul 03, 2018 at 08:21:58AM -0700, John Baldwin wrote: > On 7/3/18 8:02 AM, Ruslan Bukin wrote: > > On Tue, Jul 03, 2018 at 07:57:00AM -0700, John Baldwin wrote: > >> On 7/3/18 6:53 AM, Ruslan Bukin wrote: > >>> Author: br > >>> Date: Tue Jul 3 13:53:54 2018 > >>> New Revision: 335888 > >>> URL: https://svnweb.freebsd.org/changeset/base/335888 > >>> > >>> Log: > >>> o Ensure va_list is declared by including stdarg.h. > >>> o Also move printf.h to go after it since it does require declaration > >>> of va_list. > >>> > >>> This fixes build with latest RISC-V GNU Toolchain with GCC 8.1 > >> > >> Normal style(9) is to sort headers. Also, includes already > >> so should already have va_list defined. I think there is some other build problem > >> you are running into with GCC 8.1. Did you ensure you stripped all of the > >> 'include-fixed' headers when you updated riscv64-gcc? This seems to be an issue > >> of busted headers in the compiler and these changes should probably be reverted. > >> > > > > What do you mean stripped? Should I do something with this directory > > The xtoolchain ports and base/gcc remove these entirely since GCC usually breaks > them. You can just remove that directory if you are building by hand. > It works. Thanks! Ruslan From owner-svn-src-head@freebsd.org Tue Jul 3 15:56:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70DE4102C56B; Tue, 3 Jul 2018 15:56:23 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D5F888CAF; Tue, 3 Jul 2018 15:56:23 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA3AE1E329; Tue, 3 Jul 2018 15:56:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63FuM2T042729; Tue, 3 Jul 2018 15:56:22 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63FuMHl042728; Tue, 3 Jul 2018 15:56:22 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807031556.w63FuMHl042728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 3 Jul 2018 15:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335894 - head/sys/dev/ata/chipsets X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/ata/chipsets X-SVN-Commit-Revision: 335894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 15:56:23 -0000 Author: sbruno Date: Tue Jul 3 15:56:22 2018 New Revision: 335894 URL: https://svnweb.freebsd.org/changeset/base/335894 Log: Reset indentation of this flag. No functional change intended. Found with gcc. sys/dev/ata/chipsets/ata-siliconimage.c: In function 'ata_cmd_ch_attach': sys/dev/ata/chipsets/ata-siliconimage.c:187:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (ctlr->chip->cfg2 & SII_INTR) ^~ sys/dev/ata/chipsets/ata-siliconimage.c:190:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' ch->flags |= ATA_NO_ATAPI_DMA; Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Tue Jul 3 15:48:34 2018 (r335893) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Tue Jul 3 15:56:22 2018 (r335894) @@ -187,7 +187,7 @@ ata_cmd_ch_attach(device_t dev) if (ctlr->chip->cfg2 & SII_INTR) ch->hw.status = ata_cmd_status; - ch->flags |= ATA_NO_ATAPI_DMA; + ch->flags |= ATA_NO_ATAPI_DMA; return 0; } From owner-svn-src-head@freebsd.org Tue Jul 3 16:07:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B99102D350; Tue, 3 Jul 2018 16:07:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C29A894C7; Tue, 3 Jul 2018 16:07:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D5931E4C4; Tue, 3 Jul 2018 16:07:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63G75ln048065; Tue, 3 Jul 2018 16:07:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63G75gh048064; Tue, 3 Jul 2018 16:07:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807031607.w63G75gh048064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 3 Jul 2018 16:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335895 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 16:07:05 -0000 Author: ian Date: Tue Jul 3 16:07:04 2018 New Revision: 335895 URL: https://svnweb.freebsd.org/changeset/base/335895 Log: Fix the fstab entries for tests that have an efi partition in slice 1 and put the rootfs on s2. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Tue Jul 3 15:56:22 2018 (r335894) +++ head/tools/boot/rootgen.sh Tue Jul 3 16:07:04 2018 (r335895) @@ -237,7 +237,7 @@ mk_nogeli_mbr_ufs_uefi() { img=$2 cat > ${src}/etc/fstab < ${src}/etc/fstab < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26707102E06E; Tue, 3 Jul 2018 16:18:00 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAF3F89B5B; Tue, 3 Jul 2018 16:17:59 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5AEC1E661; Tue, 3 Jul 2018 16:17:59 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63GHxpM053133; Tue, 3 Jul 2018 16:17:59 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63GHxBd053132; Tue, 3 Jul 2018 16:17:59 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807031617.w63GHxBd053132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 3 Jul 2018 16:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335896 - head/sys/dev/ata X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/ata X-SVN-Commit-Revision: 335896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 16:18:00 -0000 Author: sbruno Date: Tue Jul 3 16:17:59 2018 New Revision: 335896 URL: https://svnweb.freebsd.org/changeset/base/335896 Log: Reset indentiation of ata_suspend() such that its clear we fall through this function and that we aren't supposed to be controlled by the first if() conditional. Found with gcc. No functional change is intended with this commit. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Tue Jul 3 16:07:04 2018 (r335895) +++ head/sys/dev/ata/ata-all.c Tue Jul 3 16:17:59 2018 (r335896) @@ -316,13 +316,13 @@ ata_suspend(device_t dev) if (!dev || !(ch = device_get_softc(dev))) return ENXIO; - if (ch->flags & ATA_PERIODIC_POLL) - callout_drain(&ch->poll_callout); - mtx_lock(&ch->state_mtx); - xpt_freeze_simq(ch->sim, 1); - while (ch->state != ATA_IDLE) - msleep(ch, &ch->state_mtx, PRIBIO, "atasusp", hz/100); - mtx_unlock(&ch->state_mtx); + if (ch->flags & ATA_PERIODIC_POLL) + callout_drain(&ch->poll_callout); + mtx_lock(&ch->state_mtx); + xpt_freeze_simq(ch->sim, 1); + while (ch->state != ATA_IDLE) + msleep(ch, &ch->state_mtx, PRIBIO, "atasusp", hz/100); + mtx_unlock(&ch->state_mtx); return(0); } From owner-svn-src-head@freebsd.org Tue Jul 3 16:28:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2140B102EDD9; Tue, 3 Jul 2018 16:28:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 B3A878A1C0; Tue, 3 Jul 2018 16:28:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 9567A9333; Tue, 3 Jul 2018 16:28:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3AB4C261; Tue, 3 Jul 2018 16:28:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id DuwMg7z7H6qb; Tue, 3 Jul 2018 16:28:29 +0000 (UTC) Subject: Re: svn commit: r335879 - in head/sys: conf kern sys [ broke ci.freebsd.org's FreeBSD-head-amd64-build ] DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com AE8A025A To: Mark Millard , mmacy@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current References: <5399C6EA-2904-4A1B-BF07-43A5D854A710@yahoo.com> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: <57f1f29f-220b-ebac-4318-b1db4ce25c6e@FreeBSD.org> Date: Tue, 3 Jul 2018 09:28:30 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <5399C6EA-2904-4A1B-BF07-43A5D854A710@yahoo.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fvGdMn5G2EVC8xiqabGR2q9F1QhUfhy7K" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 16:28:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fvGdMn5G2EVC8xiqabGR2q9F1QhUfhy7K Content-Type: multipart/mixed; boundary="flUbMHRCnqvrCstbmszmZqLCD0geZHy5p"; protected-headers="v1" From: Bryan Drewery To: Mark Millard , mmacy@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current Message-ID: <57f1f29f-220b-ebac-4318-b1db4ce25c6e@FreeBSD.org> Subject: Re: svn commit: r335879 - in head/sys: conf kern sys [ broke ci.freebsd.org's FreeBSD-head-amd64-build ] References: <5399C6EA-2904-4A1B-BF07-43A5D854A710@yahoo.com> In-Reply-To: <5399C6EA-2904-4A1B-BF07-43A5D854A710@yahoo.com> --flUbMHRCnqvrCstbmszmZqLCD0geZHy5p Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/2/2018 10:46 PM, Mark Millard wrote: > -r335879 broke ci.freebsd.org's FreeBSD-head-amd64-build : >=20 > https://ci.freebsd.org/job/FreeBSD-head-amd64-build/ >=20 > shows: >=20 > --- ia32_genassym.o --- > In file included from /usr/src/sys/compat/ia32/ia32_genassym.c:6: > In file included from /usr/src/sys/sys/systm.h:113: > /usr/src/sys/sys/kpilite.h:33:10: fatal error: 'offset.inc' file not fo= und > #include "offset.inc" > ^~~~~~~~~~~~ > 1 error generated. > *** [ia32_genassym.o] Error code 1 >=20 > Later builds ( -r335880 , -r335881 , -r335882 ) get the same. >=20 > FreeBSD-head-i386-LINT also fails for such reasons. >=20 r335884 should fix this. --=20 Regards, Bryan Drewery --flUbMHRCnqvrCstbmszmZqLCD0geZHy5p-- --fvGdMn5G2EVC8xiqabGR2q9F1QhUfhy7K Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbO6QuAAoJEDXXcbtuRpfPc9IIAMOEcFeHhbllFu+1WtpRlrQ7 z/++BSIfjgU3/xlCGE1YQ3613Zmm33J9iZiyWSuxImQUon1g5HFB5cFsps6+tGbW cpUyUAhNvSNsxmE/KP62fqgT+i7UP8DF73bgx/zO+HyHe3/Do521kaf+Fx8gPo5T fqmY8HUInvKKhjdgsAR31rlrvT8aqjjYKCHS/O25TYFsYTECyF8szp/sjwrbfl/L ezMjchsrt7pB7SZcUl+pJs9cXX9wgjECH2UMqTdqxKGoi/PXdFRqCOBDTxRsZ/ez GLRrpdGeJno8adVcvDRFdNP6bURYMe7euIU8uzyhbAUVuZYwmPlNVr0i+xnf1ps= =u2lT -----END PGP SIGNATURE----- --fvGdMn5G2EVC8xiqabGR2q9F1QhUfhy7K-- From owner-svn-src-head@freebsd.org Tue Jul 3 16:45:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BC521030A13; Tue, 3 Jul 2018 16:45:50 +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 4E6C08B49D; Tue, 3 Jul 2018 16:45:50 +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 2B3C21EB37; Tue, 3 Jul 2018 16:45:50 +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 w63GjoSp069109; Tue, 3 Jul 2018 16:45:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63Gjoo5069108; Tue, 3 Jul 2018 16:45:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201807031645.w63Gjoo5069108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 Jul 2018 16:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335897 - head/lib/libc X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libc X-SVN-Commit-Revision: 335897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 16:45:50 -0000 Author: jhb Date: Tue Jul 3 16:45:49 2018 New Revision: 335897 URL: https://svnweb.freebsd.org/changeset/base/335897 Log: Strip __RCSID() and __SCCSID() strings by default when building libc. This is in preparation for changes to update the various ID strings in libc's source. CSRG ID strings will use __SCCSID() and there are some existing uses of __RCSID() for NetBSD ID strings already. These are generally under either an explicit #if 0 or an #ifdef LIBC_SCCS so are off by default and this change preserves that existing behavior. Differential Revision: https://reviews.freebsd.org/D15830 Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue Jul 3 16:17:59 2018 (r335896) +++ head/lib/libc/Makefile Tue Jul 3 16:45:49 2018 (r335897) @@ -25,8 +25,10 @@ LIBC_ARCH=${MACHINE_CPUARCH} # excluded as a space-saving measure. To produce a library that does # not contain these strings, add -DSTRIP_FBSDID (see ) to CFLAGS # below. Note: there are no IDs for syscall stubs whose sources are generated. -# To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS -# to CFLAGS below. -DSYSLIBC_SCCS affects just the system call stubs. +# To include legacy CSRG SCCS ID strings, remove -DNO__SCCSID from CFLAGS. +# To include RCS ID strings from other BSD projects, remove -DNO__RCSID from CFLAGS. +CFLAGS+=-DNO__SCCSID -DNO__RCSID + LIB=c SHLIB_MAJOR= 7 .if ${MK_SSP} != "no" From owner-svn-src-head@freebsd.org Tue Jul 3 17:06:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C69010327F5; Tue, 3 Jul 2018 17:06:35 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 082878C314; Tue, 3 Jul 2018 17:06:34 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-wr0-f195.google.com with SMTP id q10-v6so2704178wrd.4; Tue, 03 Jul 2018 10:06:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jO0p9F7fL1hAnMKLrSIvAPH9F1dWixWxpFXaxKbPkh8=; b=bL2moN3sPWnINGrzR/6xhu7rqJ4hpC3ypBOkvfHbbNf7R13aHiKjKO4sycjtfS5CLw pDihSU+CW4clQ01ae9KBKrGtXAvWDtiFYGAsqGdmaJUJa/4soWmJGP3CNwSIFmI8HdRD veeWfNWJLCny/8986EuU48WdrxgjWAiGSQy7FWar9WpV38cJJAjwBWZ6s8sdRzFpbxp7 fnAWpgliunieWGEJi3RVLJe20s6czWnE01S8uXoreyXBCpicaPcAm9dfQw+cEWMJaFb7 XD9DjN6fi1tcj57GcNglS4mMVrQIKGMxs2ilHDNJUr5FROueFRgyaclkmRVpq+l1ZeUP ujiw== X-Gm-Message-State: APt69E0WXzhxYTxVrW/s9YSbavRB4wK9krwvDOB9J9ZvXpu7o5jKFgJM 6IeRL+5iMxmgX3PUxXbYSJ5wFfiM18ErGihyGmRiBA== X-Google-Smtp-Source: AAOMgpfagJB3NSEXi+hPi4RKTNozkVNuSZi/k3AqiBcUgTVRERDVwbfceAke5WTFBnN27PykOHoD30ZPagkwi3zdyxI= X-Received: by 2002:adf:f74d:: with SMTP id z13-v6mr9924345wrp.85.1530637587853; Tue, 03 Jul 2018 10:06:27 -0700 (PDT) MIME-Version: 1.0 References: <5399C6EA-2904-4A1B-BF07-43A5D854A710@yahoo.com> <57f1f29f-220b-ebac-4318-b1db4ce25c6e@FreeBSD.org> In-Reply-To: <57f1f29f-220b-ebac-4318-b1db4ce25c6e@FreeBSD.org> From: Li-Wen Hsu Date: Tue, 3 Jul 2018 18:06:16 +0100 Message-ID: Subject: Re: svn commit: r335879 - in head/sys: conf kern sys [ broke ci.freebsd.org's FreeBSD-head-amd64-build ] To: Bryan Drewery Cc: Mark Millard , mmacy@freebsd.org, svn-src-head@freebsd.org, FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 17:06:35 -0000 On Tue, Jul 3, 2018 at 5:30 PM Bryan Drewery wrote: > > On 7/2/2018 10:46 PM, Mark Millard wrote: > > -r335879 broke ci.freebsd.org's FreeBSD-head-amd64-build : > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-build/ > > > > shows: > > > > --- ia32_genassym.o --- > > In file included from /usr/src/sys/compat/ia32/ia32_genassym.c:6: > > In file included from /usr/src/sys/sys/systm.h:113: > > /usr/src/sys/sys/kpilite.h:33:10: fatal error: 'offset.inc' file not found > > #include "offset.inc" > > ^~~~~~~~~~~~ > > 1 error generated. > > *** [ia32_genassym.o] Error code 1 > > > > Later builds ( -r335880 , -r335881 , -r335882 ) get the same. > > > > FreeBSD-head-i386-LINT also fails for such reasons. > > > > r335884 should fix this. It seems that amd64 and i386 LINT are still failing. -- Li-Wen Hsu https://lwhsu.org From owner-svn-src-head@freebsd.org Tue Jul 3 17:32:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 062611034C70; Tue, 3 Jul 2018 17:32:01 +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 ACE5D8D826; Tue, 3 Jul 2018 17:32:00 +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 8DB051F370; Tue, 3 Jul 2018 17:32:00 +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 w63HW0qQ094107; Tue, 3 Jul 2018 17:32:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63HVjVO094025; Tue, 3 Jul 2018 17:31:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201807031731.w63HVjVO094025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 Jul 2018 17:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335898 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 335898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 17:32:01 -0000 Author: jhb Date: Tue Jul 3 17:31:45 2018 New Revision: 335898 URL: https://svnweb.freebsd.org/changeset/base/335898 Log: Clean up the vcs ID strings in libc's gen/ directory. - Move CSRG IDs into __SCCSID(). - When a file has been copied, consistently use 'From: ' for strings referencing the version of the source file copied from in the license block comment. - Some of the 'From:' tags were using $FreeBSD$ that was being expanded on each checkout. Fix those to hardcode the FreeBSD tag from the file that was copied at the time of the copy. - When multiple strings are present list them in "chronological" order, so CSRG (__SCCSID) before FreeBSD (__FBSDID). If a file came from OtherBSD and contains a CSRG ID from the OtherBSD file, use the order CSRG -> OtherBSD -> FreeBSD. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15831 Modified: head/lib/libc/gen/__xuname.c head/lib/libc/gen/alarm.c head/lib/libc/gen/assert.c head/lib/libc/gen/clock.c head/lib/libc/gen/closedir.c head/lib/libc/gen/confstr.c head/lib/libc/gen/crypt.c head/lib/libc/gen/daemon.c head/lib/libc/gen/devname.c head/lib/libc/gen/disklabel.c head/lib/libc/gen/err.c head/lib/libc/gen/errlst.c head/lib/libc/gen/exec.c head/lib/libc/gen/fnmatch.c head/lib/libc/gen/fstab.c head/lib/libc/gen/fts-compat.c head/lib/libc/gen/fts-compat11.c head/lib/libc/gen/fts.c head/lib/libc/gen/ftw-compat11.c head/lib/libc/gen/getbootfile.c head/lib/libc/gen/getbsize.c head/lib/libc/gen/getcap.c head/lib/libc/gen/getcwd.c head/lib/libc/gen/getdomainname.c head/lib/libc/gen/getgrouplist.c head/lib/libc/gen/gethostname.c head/lib/libc/gen/getloadavg.c head/lib/libc/gen/getlogin.c head/lib/libc/gen/getmntinfo-compat11.c head/lib/libc/gen/getmntinfo.c head/lib/libc/gen/getnetgrent.c head/lib/libc/gen/getosreldate.c head/lib/libc/gen/getpagesize.c head/lib/libc/gen/getttyent.c head/lib/libc/gen/getusershell.c head/lib/libc/gen/getvfsbyname.c head/lib/libc/gen/glob-compat11.c head/lib/libc/gen/glob.c head/lib/libc/gen/initgroups.c head/lib/libc/gen/isatty.c head/lib/libc/gen/nftw-compat11.c head/lib/libc/gen/nice.c head/lib/libc/gen/nlist.c head/lib/libc/gen/opendir.c head/lib/libc/gen/pause.c head/lib/libc/gen/popen.c head/lib/libc/gen/psignal.c head/lib/libc/gen/pw_scan.c head/lib/libc/gen/raise.c head/lib/libc/gen/readdir-compat11.c head/lib/libc/gen/readdir.c head/lib/libc/gen/rewinddir.c head/lib/libc/gen/scandir-compat11.c head/lib/libc/gen/scandir.c head/lib/libc/gen/seekdir.c head/lib/libc/gen/setdomainname.c head/lib/libc/gen/sethostname.c head/lib/libc/gen/setjmperr.c head/lib/libc/gen/setmode.c head/lib/libc/gen/siginterrupt.c head/lib/libc/gen/siglist.c head/lib/libc/gen/signal.c head/lib/libc/gen/sigsetops.c head/lib/libc/gen/sleep.c head/lib/libc/gen/stringlist.c head/lib/libc/gen/strtofflags.c head/lib/libc/gen/sysconf.c head/lib/libc/gen/sysctl.c head/lib/libc/gen/syslog.c head/lib/libc/gen/telldir.c head/lib/libc/gen/termios.c head/lib/libc/gen/time.c head/lib/libc/gen/times.c head/lib/libc/gen/timezone.c head/lib/libc/gen/ttyname.c head/lib/libc/gen/ttyslot.c head/lib/libc/gen/ualarm.c head/lib/libc/gen/uname.c head/lib/libc/gen/usleep.c head/lib/libc/gen/utime.c head/lib/libc/gen/valloc.c head/lib/libc/gen/wait.c head/lib/libc/gen/wait3.c head/lib/libc/gen/waitpid.c Modified: head/lib/libc/gen/__xuname.c ============================================================================== --- head/lib/libc/gen/__xuname.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/__xuname.c Tue Jul 3 17:31:45 2018 (r335898) @@ -27,11 +27,10 @@ * 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. + * + * From: @(#)uname.c 8.1 (Berkeley) 1/4/94 */ -#if defined(LIBC_SCCS) && !defined(lint) -/*static char sccsid[] = "From: @(#)uname.c 8.1 (Berkeley) 1/4/94";*/ -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/gen/alarm.c ============================================================================== --- head/lib/libc/gen/alarm.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/alarm.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)alarm.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)alarm.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/assert.c ============================================================================== --- head/lib/libc/gen/assert.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/assert.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)assert.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)assert.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/clock.c ============================================================================== --- head/lib/libc/gen/clock.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/clock.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)clock.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)clock.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/closedir.c ============================================================================== --- head/lib/libc/gen/closedir.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/closedir.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)closedir.c 8.1 (Berkeley) 6/10/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)closedir.c 8.1 (Berkeley) 6/10/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/confstr.c ============================================================================== --- head/lib/libc/gen/confstr.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/confstr.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)confstr.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)confstr.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/crypt.c ============================================================================== --- head/lib/libc/gen/crypt.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/crypt.c Tue Jul 3 17:31:45 2018 (r335898) @@ -32,11 +32,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -/* from static char sccsid[] = "@(#)crypt.c 5.11 (Berkeley) 6/25/91"; */ -#endif /* LIBC_SCCS and not lint */ - #include +__SCCSID("@(#)crypt.c 5.11 (Berkeley) 6/25/91"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/daemon.c ============================================================================== --- head/lib/libc/gen/daemon.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/daemon.c Tue Jul 3 17:31:45 2018 (r335898) @@ -30,10 +30,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)daemon.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)daemon.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/devname.c ============================================================================== --- head/lib/libc/gen/devname.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/devname.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)devname.c 8.2 (Berkeley) 4/29/95"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)devname.c 8.2 (Berkeley) 4/29/95"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/disklabel.c ============================================================================== --- head/lib/libc/gen/disklabel.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/disklabel.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 5/3/95"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)disklabel.c 8.2 (Berkeley) 5/3/95"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/err.c ============================================================================== --- head/lib/libc/gen/err.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/err.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)err.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/errlst.c ============================================================================== --- head/lib/libc/gen/errlst.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/errlst.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)errlst.c 8.2 (Berkeley) 11/16/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)errlst.c 8.2 (Berkeley) 11/16/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/exec.c ============================================================================== --- head/lib/libc/gen/exec.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/exec.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)exec.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/fnmatch.c ============================================================================== --- head/lib/libc/gen/fnmatch.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/fnmatch.c Tue Jul 3 17:31:45 2018 (r335898) @@ -37,10 +37,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/fstab.c ============================================================================== --- head/lib/libc/gen/fstab.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/fstab.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)fstab.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/fts-compat.c ============================================================================== --- head/lib/libc/gen/fts-compat.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/fts-compat.c Tue Jul 3 17:31:45 2018 (r335898) @@ -28,14 +28,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $ + * From: @(#)fts.c 8.6 (Berkeley) 8/14/94 + * From: $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $ */ - -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; -#endif /* LIBC_SCCS and not lint */ -#endif #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/gen/fts-compat11.c ============================================================================== --- head/lib/libc/gen/fts-compat11.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/fts-compat11.c Tue Jul 3 17:31:45 2018 (r335898) @@ -26,14 +26,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $ + * From: @(#)fts.c 8.6 (Berkeley) 8/14/94 + * From: $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $ */ - -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; -#endif /* LIBC_SCCS and not lint */ -#endif #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/gen/fts.c ============================================================================== --- head/lib/libc/gen/fts.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/fts.c Tue Jul 3 17:31:45 2018 (r335898) @@ -31,13 +31,8 @@ * $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $ */ -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; -#endif /* LIBC_SCCS and not lint */ -#endif - #include +__SCCSID("@(#)fts.c 8.6 (Berkeley) 8/14/94"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/ftw-compat11.c ============================================================================== --- head/lib/libc/gen/ftw-compat11.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/ftw-compat11.c Tue Jul 3 17:31:45 2018 (r335898) @@ -19,7 +19,7 @@ * Agency (DARPA) and Air Force Research Laboratory, Air Force * Materiel Command, USAF, under agreement number F39502-99-1-0512. * - * from: $FreeBSD$ + * From: FreeBSD: head/lib/libc/gen/ftw.c 239151 2012-08-09 15:11:38Z jilles */ #include Modified: head/lib/libc/gen/getbootfile.c ============================================================================== --- head/lib/libc/gen/getbootfile.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getbootfile.c Tue Jul 3 17:31:45 2018 (r335898) @@ -27,11 +27,10 @@ * 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. + * + * From: @(#)gethostname.c 8.1 (Berkeley) 6/4/93 */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "From: @(#)gethostname.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/gen/getbsize.c ============================================================================== --- head/lib/libc/gen/getbsize.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getbsize.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getbsize.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getbsize.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getcap.c ============================================================================== --- head/lib/libc/gen/getcap.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getcap.c Tue Jul 3 17:31:45 2018 (r335898) @@ -32,10 +32,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getcap.c 8.3 (Berkeley) 3/25/94"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/getcwd.c ============================================================================== --- head/lib/libc/gen/getcwd.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getcwd.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getcwd.c 8.5 (Berkeley) 2/7/95"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getcwd.c 8.5 (Berkeley) 2/7/95"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/getdomainname.c ============================================================================== --- head/lib/libc/gen/getdomainname.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getdomainname.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)gethostname.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)gethostname.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getgrouplist.c ============================================================================== --- head/lib/libc/gen/getgrouplist.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getgrouplist.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getgrouplist.c 8.2 (Berkeley) 12/8/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getgrouplist.c 8.2 (Berkeley) 12/8/94"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/gethostname.c ============================================================================== --- head/lib/libc/gen/gethostname.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/gethostname.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)gethostname.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)gethostname.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getloadavg.c ============================================================================== --- head/lib/libc/gen/getloadavg.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getloadavg.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getloadavg.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getloadavg.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getlogin.c ============================================================================== --- head/lib/libc/gen/getlogin.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getlogin.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getlogin.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getlogin.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getmntinfo-compat11.c ============================================================================== --- head/lib/libc/gen/getmntinfo-compat11.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getmntinfo-compat11.c Tue Jul 3 17:31:45 2018 (r335898) @@ -25,11 +25,10 @@ * 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. + * + * From: @(#)getmntinfo.c 8.1 (Berkeley) 6/4/93 */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getmntinfo.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/gen/getmntinfo.c ============================================================================== --- head/lib/libc/gen/getmntinfo.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getmntinfo.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getmntinfo.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getmntinfo.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getnetgrent.c Tue Jul 3 17:31:45 2018 (r335898) @@ -32,10 +32,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getnetgrent.c 8.2 (Berkeley) 4/27/95"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getnetgrent.c 8.2 (Berkeley) 4/27/95"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/getosreldate.c ============================================================================== --- head/lib/libc/gen/getosreldate.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getosreldate.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)gethostid.c 8.1 (Berkeley) 6/2/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)gethostid.c 8.1 (Berkeley) 6/2/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getpagesize.c ============================================================================== --- head/lib/libc/gen/getpagesize.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getpagesize.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getpagesize.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getpagesize.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getttyent.c ============================================================================== --- head/lib/libc/gen/getttyent.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getttyent.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)getttyent.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/getusershell.c ============================================================================== --- head/lib/libc/gen/getusershell.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getusershell.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,11 +29,9 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -/* $NetBSD: getusershell.c,v 1.17 1999/01/25 01:09:34 lukem Exp $ */ #include +__SCCSID("@(#)getusershell.c 8.1 (Berkeley) 6/4/93"); +__RCSID("$NetBSD: getusershell.c,v 1.17 1999/01/25 01:09:34 lukem Exp $"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/getvfsbyname.c ============================================================================== --- head/lib/libc/gen/getvfsbyname.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/getvfsbyname.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)kvm_getvfsbyname.c 8.1 (Berkeley) 4/3/95"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)kvm_getvfsbyname.c 8.1 (Berkeley) 4/3/95"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/glob-compat11.c ============================================================================== --- head/lib/libc/gen/glob-compat11.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/glob-compat11.c Tue Jul 3 17:31:45 2018 (r335898) @@ -34,12 +34,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: $FreeBSD$ + * From: @(#)glob.c 8.3 (Berkeley) 10/13/93 + * From: FreeBSD: head/lib/libc/gen/glob.c 317913 2017-05-07 19:52:56Z jilles */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/glob.c Tue Jul 3 17:31:45 2018 (r335898) @@ -37,10 +37,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)glob.c 8.3 (Berkeley) 10/13/93"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/initgroups.c ============================================================================== --- head/lib/libc/gen/initgroups.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/initgroups.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)initgroups.c 8.1 (Berkeley) 6/4/93"; -#endif #include +__SCCSID("@(#)initgroups.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/isatty.c ============================================================================== --- head/lib/libc/gen/isatty.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/isatty.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)isatty.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)isatty.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/nftw-compat11.c ============================================================================== --- head/lib/libc/gen/nftw-compat11.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/nftw-compat11.c Tue Jul 3 17:31:45 2018 (r335898) @@ -17,8 +17,8 @@ * Agency (DARPA) and Air Force Research Laboratory, Air Force * Materiel Command, USAF, under agreement number F39502-99-1-0512. * - * from: $OpenBSD: nftw.c,v 1.7 2006/03/31 19:41:44 millert Exp $ - * from: $FreeBSD$ + * From: $OpenBSD: nftw.c,v 1.7 2006/03/31 19:41:44 millert Exp $ + * From: FreeBSD: head/lib/libc/gen/nftw.c 239160 2012-08-09 22:05:40Z jilles */ #include Modified: head/lib/libc/gen/nice.c ============================================================================== --- head/lib/libc/gen/nice.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/nice.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)nice.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)nice.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/nlist.c ============================================================================== --- head/lib/libc/gen/nlist.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/nlist.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)nlist.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/opendir.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)opendir.c 8.8 (Berkeley) 5/1/95"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)opendir.c 8.8 (Berkeley) 5/1/95"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/pause.c ============================================================================== --- head/lib/libc/gen/pause.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/pause.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)pause.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)pause.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/popen.c ============================================================================== --- head/lib/libc/gen/popen.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/popen.c Tue Jul 3 17:31:45 2018 (r335898) @@ -32,10 +32,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)popen.c 8.3 (Berkeley) 5/3/95"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)popen.c 8.3 (Berkeley) 5/3/95"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/psignal.c ============================================================================== --- head/lib/libc/gen/psignal.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/psignal.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)psignal.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)psignal.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/pw_scan.c ============================================================================== --- head/lib/libc/gen/pw_scan.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/pw_scan.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)pw_scan.c 8.3 (Berkeley) 4/2/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)pw_scan.c 8.3 (Berkeley) 4/2/94"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/raise.c ============================================================================== --- head/lib/libc/gen/raise.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/raise.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)raise.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)raise.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/readdir-compat11.c ============================================================================== --- head/lib/libc/gen/readdir-compat11.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/readdir-compat11.c Tue Jul 3 17:31:45 2018 (r335898) @@ -26,13 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: - * $FreeBSD$ + * From: @(#)readdir.c 8.3 (Berkeley) 9/29/94 + * From: FreeBSD: head/lib/libc/gen/readdir.c 314436 2017-02-28 23:42:47Z imp */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)readdir.c 8.3 (Berkeley) 9/29/94"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/gen/readdir.c ============================================================================== --- head/lib/libc/gen/readdir.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/readdir.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)readdir.c 8.3 (Berkeley) 9/29/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)readdir.c 8.3 (Berkeley) 9/29/94"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/rewinddir.c ============================================================================== --- head/lib/libc/gen/rewinddir.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/rewinddir.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)rewinddir.c 8.1 (Berkeley) 6/8/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)rewinddir.c 8.1 (Berkeley) 6/8/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/scandir-compat11.c ============================================================================== --- head/lib/libc/gen/scandir-compat11.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/scandir-compat11.c Tue Jul 3 17:31:45 2018 (r335898) @@ -26,13 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: - * $FreeBSD$ + * From: @(#)scandir.c 8.3 (Berkeley) 1/2/94 + * From: FreeBSD: head/lib/libc/gen/scandir.c 317372 2017-04-24 14:56:41Z pfg */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)scandir.c 8.3 (Berkeley) 1/2/94"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/gen/scandir.c ============================================================================== --- head/lib/libc/gen/scandir.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/scandir.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)scandir.c 8.3 (Berkeley) 1/2/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)scandir.c 8.3 (Berkeley) 1/2/94"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/seekdir.c ============================================================================== --- head/lib/libc/gen/seekdir.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/seekdir.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)seekdir.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)seekdir.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/setdomainname.c ============================================================================== --- head/lib/libc/gen/setdomainname.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/setdomainname.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)sethostname.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)sethostname.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/sethostname.c ============================================================================== --- head/lib/libc/gen/sethostname.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/sethostname.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)sethostname.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)sethostname.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/setjmperr.c ============================================================================== --- head/lib/libc/gen/setjmperr.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/setjmperr.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)setjmperr.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)setjmperr.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/setmode.c ============================================================================== --- head/lib/libc/gen/setmode.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/setmode.c Tue Jul 3 17:31:45 2018 (r335898) @@ -32,10 +32,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)setmode.c 8.2 (Berkeley) 3/25/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)setmode.c 8.2 (Berkeley) 3/25/94"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/siginterrupt.c ============================================================================== --- head/lib/libc/gen/siginterrupt.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/siginterrupt.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)siginterrupt.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)siginterrupt.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/siglist.c ============================================================================== --- head/lib/libc/gen/siglist.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/siglist.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)siglist.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)siglist.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/signal.c ============================================================================== --- head/lib/libc/gen/signal.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/signal.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)signal.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)signal.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); /* Modified: head/lib/libc/gen/sigsetops.c ============================================================================== --- head/lib/libc/gen/sigsetops.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/sigsetops.c Tue Jul 3 17:31:45 2018 (r335898) @@ -27,14 +27,10 @@ * 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. - * - * @(#)sigsetops.c 8.1 (Berkeley) 6/4/93 */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)sigsetops.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)sigsetops.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/sleep.c ============================================================================== --- head/lib/libc/gen/sleep.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/sleep.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)sleep.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)sleep.c 8.1 (Berkeley) 6/4/93"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/stringlist.c ============================================================================== --- head/lib/libc/gen/stringlist.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/stringlist.c Tue Jul 3 17:31:45 2018 (r335898) @@ -26,10 +26,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $"; -#endif /* LIBC_SCCS and not lint */ #include +__RCSID("$NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/strtofflags.c ============================================================================== --- head/lib/libc/gen/strtofflags.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/strtofflags.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)stat_flags.c 8.1 (Berkeley) 5/31/93"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)stat_flags.c 8.1 (Berkeley) 5/31/93"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/sysconf.c Tue Jul 3 17:31:45 2018 (r335898) @@ -32,10 +32,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)sysconf.c 8.2 (Berkeley) 3/20/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)sysconf.c 8.2 (Berkeley) 3/20/94"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/sysctl.c ============================================================================== --- head/lib/libc/gen/sysctl.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/sysctl.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)sysctl.c 8.2 (Berkeley) 1/4/94"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)sysctl.c 8.2 (Berkeley) 1/4/94"); __FBSDID("$FreeBSD$"); #include Modified: head/lib/libc/gen/syslog.c ============================================================================== --- head/lib/libc/gen/syslog.c Tue Jul 3 16:45:49 2018 (r335897) +++ head/lib/libc/gen/syslog.c Tue Jul 3 17:31:45 2018 (r335898) @@ -29,10 +29,8 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/29/95"; -#endif /* LIBC_SCCS and not lint */ #include +__SCCSID("@(#)syslog.c 8.5 (Berkeley) 4/29/95"); __FBSDID("$FreeBSD$"); #include "namespace.h" Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Tue Jul 3 16:45:49 2018 (r335897) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jul 3 17:37:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC8B103533A; Tue, 3 Jul 2018 17:37:17 +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 8D8548DB6D; Tue, 3 Jul 2018 17:37:17 +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 533701F39B; Tue, 3 Jul 2018 17:37:17 +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 w63HbHrH095121; Tue, 3 Jul 2018 17:37:17 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63HbHZl095120; Tue, 3 Jul 2018 17:37:17 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201807031737.w63HbHZl095120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 3 Jul 2018 17:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335899 - head/contrib/openbsm/bin/auditd X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/contrib/openbsm/bin/auditd X-SVN-Commit-Revision: 335899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 17:37:18 -0000 Author: asomers Date: Tue Jul 3 17:37:16 2018 New Revision: 335899 URL: https://svnweb.freebsd.org/changeset/base/335899 Log: auditd(8): register signal handlers interrutibly auditd_wait_for_events() relies on read(2) being interrupted by signals, but it registers signal handlers with signal(3), which sets SA_RESTART. That breaks asynchronous signal handling. It means that signals don't actually get handled until after an audit(8) trigger is received. Symptoms include: * Sending SIGTERM to auditd doesn't kill it right away; you must send SIGTERM and then send a trigger with auditon(2). * Same with SIGHUP * Zombie child processes don't get reaped until auditd receives a trigger sent by auditon. This includes children created by expiring audit trails at auditd startup. Fix by using sigaction(2) instead of signal(3). Cherry pick https://github.com/openbsm/openbsm/commit/d060887 PR: 229381 Reviewed by: cem Obtained from: OpenBSM MFC after: 2 weeks Differential Revision: https://github.com/openbsm/openbsm/pull/36 Modified: head/contrib/openbsm/bin/auditd/auditd.c Modified: head/contrib/openbsm/bin/auditd/auditd.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd.c Tue Jul 3 17:31:45 2018 (r335898) +++ head/contrib/openbsm/bin/auditd/auditd.c Tue Jul 3 17:37:16 2018 (r335899) @@ -415,27 +415,35 @@ close_all(void) static int register_daemon(void) { + struct sigaction action; FILE * pidfile; int fd; pid_t pid; /* Set up the signal hander. */ - if (signal(SIGTERM, auditd_relay_signal) == SIG_ERR) { + action.sa_handler = auditd_relay_signal; + /* + * sa_flags must not include SA_RESTART, so that read(2) will be + * interruptible in auditd_wait_for_events + */ + action.sa_flags = 0; + sigemptyset(&action.sa_mask); + if (sigaction(SIGTERM, &action, NULL) != 0) { auditd_log_err( "Could not set signal handler for SIGTERM"); fail_exit(); } - if (signal(SIGCHLD, auditd_relay_signal) == SIG_ERR) { + if (sigaction(SIGCHLD, &action, NULL) != 0) { auditd_log_err( "Could not set signal handler for SIGCHLD"); fail_exit(); } - if (signal(SIGHUP, auditd_relay_signal) == SIG_ERR) { + if (sigaction(SIGHUP, &action, NULL) != 0) { auditd_log_err( "Could not set signal handler for SIGHUP"); fail_exit(); } - if (signal(SIGALRM, auditd_relay_signal) == SIG_ERR) { + if (sigaction(SIGALRM, &action, NULL) != 0) { auditd_log_err( "Could not set signal handler for SIGALRM"); fail_exit(); From owner-svn-src-head@freebsd.org Tue Jul 3 17:39:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FEB010356B4; Tue, 3 Jul 2018 17:39:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 C46358DD97; Tue, 3 Jul 2018 17:39:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 8C971AA6D; Tue, 3 Jul 2018 17:39:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 57543365; Tue, 3 Jul 2018 17:39:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id cnJ9pOHCN-E4; Tue, 3 Jul 2018 17:39:30 +0000 (UTC) Subject: Re: svn commit: r335880 - in head/sys: conf kern DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 097E4360 To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807030250.w632o7Oa035010@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: Date: Tue, 3 Jul 2018 10:39:32 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807030250.w632o7Oa035010@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SguC03ueCBfxYmpKFHyGnL20YPm99urhi" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 17:39:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SguC03ueCBfxYmpKFHyGnL20YPm99urhi Content-Type: multipart/mixed; boundary="PzCDN6Kk2tgnsfOYX9aQ2VsrO0UDpRSOs"; protected-headers="v1" From: Bryan Drewery To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r335880 - in head/sys: conf kern References: <201807030250.w632o7Oa035010@repo.freebsd.org> In-Reply-To: <201807030250.w632o7Oa035010@repo.freebsd.org> --PzCDN6Kk2tgnsfOYX9aQ2VsrO0UDpRSOs Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/2/2018 7:50 PM, Matt Macy wrote: > Author: mmacy > Date: Tue Jul 3 02:50:07 2018 > New Revision: 335880 > URL: https://svnweb.freebsd.org/changeset/base/335880 >=20 > Log: > expose thread_lite definition to tied modules >=20 > Modified: > head/sys/conf/kmod.mk > head/sys/kern/genoffset.sh >=20 > Modified: head/sys/conf/kmod.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/kmod.mk Tue Jul 3 01:55:09 2018 (r335879) > +++ head/sys/conf/kmod.mk Tue Jul 3 02:50:07 2018 (r335880) > @@ -463,9 +463,10 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk $= {SYS > .endif > =20 > .if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc) > -CLEANFILES+=3D assym.inc genassym.o > -DEPENDOBJS+=3D genassym.o > +CLEANFILES+=3D assym.inc genassym.o genoffset.o > +DEPENDOBJS+=3D genassym.o genoffset.o > assym.inc: genassym.o > +offset.inc: genoffset.o > .if defined(KERNBUILDDIR) > genassym.o: opt_global.h > .endif > @@ -475,6 +476,12 @@ genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genass= ym.c > genassym.o: ${SRCS:Mopt_*.h} > ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ > ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c > +offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o > + sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET} > +genoffset.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c > +genoffset.o: ${SRCS:Mopt_*.h} > + ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ > + ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c Why is this using machine-specific genoffset.c but kern.post.mk uses the global genoffset.c? And what even generates the machine-specific genoffset.c file? I see no rule for it anywhere. > .endif > =20 > .if defined(KERNBUILDDIR) >=20 > Modified: head/sys/kern/genoffset.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/kern/genoffset.sh Tue Jul 3 01:55:09 2018 (r335879) > +++ head/sys/kern/genoffset.sh Tue Jul 3 02:50:07 2018 (r335880) > @@ -39,7 +39,7 @@ work() > { > echo "#ifndef _OFFSET_INC_" > echo "#define _OFFSET_INC_" > - echo "#if !defined(GENOFFSET) && !defined(KLD_MODULE)" > + echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD= _TIED))" > ${NM:=3D'nm'} ${NMFLAGS} "$1" | ${AWK:=3D'awk'} ' > / C .*_datatype_*/ { > type =3D substr($3, match($3, "_datatype_") + length("_datatype_")) >=20 --=20 Regards, Bryan Drewery --PzCDN6Kk2tgnsfOYX9aQ2VsrO0UDpRSOs-- --SguC03ueCBfxYmpKFHyGnL20YPm99urhi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbO7TUAAoJEDXXcbtuRpfPqIAH/idYSW2ZdZZMJt6ZdPvGfgyh AG/lNYVte2VF1H9LJi2ryKosfWoBMtZLfzE9GMfZ3G4qap72TYv9cnaHmshYGh8k gGXX/wVAswikDlPlwdkSB8Yq/elS87ak7qm7/sWLcCUZQ2O7/rYAf7YpaIexPqXz QIrQhuXpqRnO3oNSRVNLY7/tPwoGDEYqGMiuvyEhv7GV1xBeIj2QDXaTJasI6XLx 1uHRcUuWM7h4nOYVP4P02SO2/l5Nj8V1wyaOkOgC/u6VnF0ZXWF1HZTZWf+sFXTI mupmw0KEsG6bNLlEQzKQBGi6ECYi2CN9HRRKCWATuxGfp1hLOMPt/ax0tanKDDU= =v0/J -----END PGP SIGNATURE----- --SguC03ueCBfxYmpKFHyGnL20YPm99urhi-- From owner-svn-src-head@freebsd.org Tue Jul 3 17:48:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AD9910373FB for ; Tue, 3 Jul 2018 17:48:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-14.consmr.mail.bf2.yahoo.com (sonic311-14.consmr.mail.bf2.yahoo.com [74.6.131.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C57318E466 for ; Tue, 3 Jul 2018 17:48:26 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: fyPQ6_UVM1lhBOJVucDPerdz_HLmpFd4iBRC8RJ8mCZYNErXRmsgwO0SB7serh8 LFLClNKwyLT7OKDwnjsCTHPjPMju4RrxplF99llmd47yC0Q8WbLovABCr7BryTnUlP30LOgXGkZ8 908cMo4jf.JHWkr0uhsGxHVVFKgKBdlBo0whvZQkQ_GWQPYXrcAmu3ajacFwMUGgKZigkpai.Q0D 8KSrJSYQmk5ERFGAn216JhdQFsyfl87OTzm8S9v5X76eSGUEeMK4gOSOSsZBO.I0yrZeudiq2Yxc fgOiXwtTRSXkyrnq6DnwZprs4HCMX_p0fLRT2myitA1C.XQWnY3yq0_3cP3Jnhfe2I1laewh84hH cNkwlR7clwcbCP4MDC.ZDMQNZz9CnCOuEIeIwHUFs_HcK_EM03mTB_R0TF2WB8iVAxsE38O6_haF c21FUaeV0Fioes.KN0EewP7pgLjZgTwKoGawLNivmOT4AK8mQBZ2B5.PxC_hzZakvI57UUELftz4 obSLKiv6sPvrRqAoDvsLJU2NoNjwwCeeUw1du6oWxHLq6_Vmo148m9NmN02p4hIteOMOD9AwbPWR 348Jwp3K9qftmMq.pobJRcxNQ4_OaI2lfJ06MGFysaQNOL_.n5yLtR5LcRU6Pg_J64WX.VEJMTZG l3LeAfDWwViJYpXpCMIRxHoRFFIr3CFIHhGQenFkfbqxlqlZl.QeTUKlEj5ypaDgRjpv0t7qo6Hl 7zEHF9z.Wd0ZzYAUs.1KdgOffikd8JV_85MMbxVuckKaHF5ZzQlIdY5Jx4GNBlGwoL.ijxbXiJSe jy7mP.61uwY3d9wdZKyaYU5ylZJMSWRV.8seTzbJHv5yxrvFUpOVGxqORM.h.QCfDPnfsYMJnS40 MYkh1r1vJ7KpF79h.H5qctrXEwFvRwXkESQ8HmeknotnmNo5tLaUpdAKtE.YOr46MIGbC8pYRLzT nMn5j0XGoJx7zTTULzBgVCFo1zvWiqy2GumJz3eSz Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.bf2.yahoo.com with HTTP; Tue, 3 Jul 2018 17:48:20 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp426.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 9346017e38399593649c07fc438a9e5f; Tue, 03 Jul 2018 17:48:17 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335879 - in head/sys: conf kern sys [ broke ci.freebsd.org's FreeBSD-head-amd64-build ] From: Mark Millard In-Reply-To: Date: Tue, 3 Jul 2018 10:48:14 -0700 Cc: mmacy@freebsd.org, svn-src-head@freebsd.org, FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: <5399C6EA-2904-4A1B-BF07-43A5D854A710@yahoo.com> <57f1f29f-220b-ebac-4318-b1db4ce25c6e@FreeBSD.org> To: Li-Wen Hsu , Bryan Drewery X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 17:48:27 -0000 On 2018-Jul-3, at 10:06 AM, Li-Wen Hsu wrote: > On Tue, Jul 3, 2018 at 5:30 PM Bryan Drewery = wrote: >>=20 >> On 7/2/2018 10:46 PM, Mark Millard wrote: >>> -r335879 broke ci.freebsd.org's FreeBSD-head-amd64-build : >>>=20 >>> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/ >>>=20 >>> shows: >>>=20 >>> --- ia32_genassym.o --- >>> In file included from /usr/src/sys/compat/ia32/ia32_genassym.c:6: >>> In file included from /usr/src/sys/sys/systm.h:113: >>> /usr/src/sys/sys/kpilite.h:33:10: fatal error: 'offset.inc' file not = found >>> #include "offset.inc" >>> ^~~~~~~~~~~~ >>> 1 error generated. >>> *** [ia32_genassym.o] Error code 1 >>>=20 >>> Later builds ( -r335880 , -r335881 , -r335882 ) get the same. >>>=20 >>> FreeBSD-head-i386-LINT also fails for such reasons. >>>=20 >>=20 >> r335884 should fix this. >=20 > It seems that amd64 and i386 LINT are still failing. https://ci.freebsd.org/job/FreeBSD-head-amd64-build/ shows that #9303 (-r335884) and later for amd64 are building successfully. But https://ci.freebsd.org/job/FreeBSD-head-i386-LINT/ shows that -r335884 (#6934) and later ( -r335892 so far ) for i386's LINT are still failing with: --- linux_genassym.o --- In file included from /workspace/src/sys/i386/linux/linux_genassym.c:6: In file included from /workspace/src/sys/sys/systm.h:113: /workspace/src/sys/sys/kpilite.h:33:10: fatal error: 'offset.inc' file = not found #include "offset.inc" ^~~~~~~~~~~~ 1 error generated. *** [linux_genassym.o] Error code 1 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Jul 3 18:02:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D39F1038799; Tue, 3 Jul 2018 18:02:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 C46D78F046; Tue, 3 Jul 2018 18:02:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 8A376B085; Tue, 3 Jul 2018 18:02:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B26C43B4; Tue, 3 Jul 2018 18:02:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id jJJOA0g4A4vy; Tue, 3 Jul 2018 18:02:04 +0000 (UTC) Subject: Re: svn commit: r335879 - in head/sys: conf kern sys DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 807E53AF To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807030155.w631tARo009470@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: Date: Tue, 3 Jul 2018 11:02:06 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807030155.w631tARo009470@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qZEWcDA7eghFgBt6Qdfww1zpUx2AfipFd" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:02:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qZEWcDA7eghFgBt6Qdfww1zpUx2AfipFd Content-Type: multipart/mixed; boundary="mqVc29nT1NLGjktFNs0IMbo6ULtTzQ98i"; protected-headers="v1" From: Bryan Drewery To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r335879 - in head/sys: conf kern sys References: <201807030155.w631tARo009470@repo.freebsd.org> In-Reply-To: <201807030155.w631tARo009470@repo.freebsd.org> --mqVc29nT1NLGjktFNs0IMbo6ULtTzQ98i Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/2/2018 6:55 PM, Matt Macy wrote: > Author: mmacy > Date: Tue Jul 3 01:55:09 2018 > New Revision: 335879 > URL: https://svnweb.freebsd.org/changeset/base/335879 >=20 > Log: > make critical_{enter, exit} inline > =20 > Avoid pulling in all of the dependencies by > automatically generating a stripped down thread_lite exporting > only the fields of interest. The field declarations are type checked > against the original and the offsets of the generated result is > automatically checked. > =20 > kib has expressed disagreement and would have preferred to simply > use genassym style offsets (which loses type check enforcement). > jhb has expressed dislike of it due to header pollution and a > duplicate structure. He would have preferred to just have defined > thread in _thread.h. Nonetheless, he admits that this is the only > viable solution at the moment. > =20 > The impetus for this came from mjg's D15331: > "Inline critical_enter/exit for amd64" > =20 > Reviewed by: jeff > Differential Revision: https://reviews.freebsd.org/D16078 >=20 > Added: > head/sys/kern/genoffset.c (contents, props changed) > head/sys/kern/genoffset.sh (contents, props changed) > head/sys/sys/kpilite.h (contents, props changed) > Modified: > head/sys/conf/kern.post.mk > head/sys/conf/kern.pre.mk > head/sys/kern/kern_switch.c > head/sys/sys/assym.h > head/sys/sys/systm.h >=20 > Modified: head/sys/conf/kern.post.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/kern.post.mk Mon Jul 2 22:59:29 2018 (r335878) > +++ head/sys/conf/kern.post.mk Tue Jul 3 01:55:09 2018 (r335879) > @@ -185,13 +185,25 @@ hack.pico: Makefile > ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.pico > rm -f hack.c > =20 > -assym.inc: $S/kern/genassym.sh genassym.o > +offset.inc: $S/kern/genoffset.sh genoffset.o > + NM=3D'${NM}' NMFLAGS=3D'${NMFLAGS}' sh $S/kern/genoffset.sh genoffset= =2Eo > ${.TARGET} > + > +genoffset.o: $S/kern/genoffset.c > + ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c > + > +genoffset_test.c: $S/kern/genoffset.c > + cp $S/kern/genoffset.c genoffset_test.c > + > +genoffset_test.o: genoffset_test.c offset.inc > + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.c= > + > +assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o > NM=3D'${NM}' NMFLAGS=3D'${NMFLAGS}' sh $S/kern/genassym.sh genassym.o= > ${.TARGET} What's genoffset_test? Nothing seems to use it. --=20 Regards, Bryan Drewery --mqVc29nT1NLGjktFNs0IMbo6ULtTzQ98i-- --qZEWcDA7eghFgBt6Qdfww1zpUx2AfipFd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbO7ofAAoJEDXXcbtuRpfPktoIAMZ7a+CYLcFoTzJBaMKGmDVd +JXI6aRvXjDfZeD8qWqqnqgXTA3dB6EYl2l/LgeDXcyqoLCKULIparvwiaMvvfmN DiA74JydeI9kmXf1QSoemlgVK6UMelyvg7hE4WSUscRPYQci/20cFz4DTJ4+jCVT jES5LkCwjAqWh7AwTeff0wouD0l+SrkrTMBC09MPzrlYE4s2wvp/trQ8Eal5Q48P TZbKGjNBO/Zmj48dmpEbKCeRG9GHHlbntH8uyHvcQPV15hL4WZmVUz2N+ZH8590O HboqlO+srE1QmUwYNfuROSYysembGGebJJ84vAq44PyQ1zKh727ckKF/NDnXz8M= =a7ek -----END PGP SIGNATURE----- --qZEWcDA7eghFgBt6Qdfww1zpUx2AfipFd-- From owner-svn-src-head@freebsd.org Tue Jul 3 18:17:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EAC7103A28C; Tue, 3 Jul 2018 18:17:20 +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 C7F1A8F97D; Tue, 3 Jul 2018 18:17:19 +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 A48851FA32; Tue, 3 Jul 2018 18:17:19 +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 w63IHJOY016042; Tue, 3 Jul 2018 18:17:19 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63IHJwQ016041; Tue, 3 Jul 2018 18:17:19 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201807031817.w63IHJwQ016041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 3 Jul 2018 18:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335900 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 335900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:17:20 -0000 Author: oshogbo Date: Tue Jul 3 18:17:19 2018 New Revision: 335900 URL: https://svnweb.freebsd.org/changeset/base/335900 Log: capsicum: add getdirentries to the freebsd32 compact There is a getdirentries syscall in freebsd32 and it's capability ready so allow calling it in the capability mode. PR: 228671 Modified: head/sys/compat/freebsd32/capabilities.conf Modified: head/sys/compat/freebsd32/capabilities.conf ============================================================================== --- head/sys/compat/freebsd32/capabilities.conf Tue Jul 3 17:37:16 2018 (r335899) +++ head/sys/compat/freebsd32/capabilities.conf Tue Jul 3 18:17:19 2018 (r335900) @@ -116,6 +116,7 @@ getauid freebsd32_getcontext getdents freebsd32_getdirentries +getdirentries getdomainname getdtablesize getegid From owner-svn-src-head@freebsd.org Tue Jul 3 18:18:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 961CC103A437; Tue, 3 Jul 2018 18:18:30 +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 493568FCAB; Tue, 3 Jul 2018 18:18:30 +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 2AEC91FA34; Tue, 3 Jul 2018 18:18:30 +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 w63IIUkx016154; Tue, 3 Jul 2018 18:18:30 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63IIUj5016153; Tue, 3 Jul 2018 18:18:30 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201807031818.w63IIUj5016153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 3 Jul 2018 18:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335901 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 335901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:18:30 -0000 Author: oshogbo Date: Tue Jul 3 18:18:29 2018 New Revision: 335901 URL: https://svnweb.freebsd.org/changeset/base/335901 Log: Regen after 335900. PR: 228671 Modified: head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Tue Jul 3 18:17:19 2018 (r335900) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Tue Jul 3 18:18:29 2018 (r335901) @@ -633,7 +633,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = freebsd32_fstat */ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = freebsd32_fstatat */ { AS(freebsd32_fhstat_args), (sy_call_t *)freebsd32_fhstat, AUE_FHSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 553 = freebsd32_fhstat */ - { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 554 = getdirentries */ + { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 554 = getdirentries */ { AS(statfs_args), (sy_call_t *)sys_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 555 = statfs */ { 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 */ From owner-svn-src-head@freebsd.org Tue Jul 3 18:19:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86588103A566; Tue, 3 Jul 2018 18:19:14 +0000 (UTC) (envelope-from mmacy@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 32D188FE0B; Tue, 3 Jul 2018 18:19:14 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com [209.85.214.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id EAC8A161E2; Tue, 3 Jul 2018 18:19:13 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f48.google.com with SMTP id p17-v6so4495600itc.2; Tue, 03 Jul 2018 11:19:13 -0700 (PDT) X-Gm-Message-State: APt69E08ByKPkWoz9x9tizrLa8QPdaz2zKgDT5tRlhc63TCqPcsMlCLM D1mOw4UoLIKznGODc4lvrQigFeVFsGq8bBRqbuE= X-Google-Smtp-Source: AAOMgpek94CbAu6gd2Kh6mu0YXTv6Fck4dJAcMNcRoatgFwgvthzrvCHDqN+7C2rQI4CYuItAWVy4oMsDk6QAQJSDkA= X-Received: by 2002:a24:8ac1:: with SMTP id v184-v6mr10144483itd.7.1530641953258; Tue, 03 Jul 2018 11:19:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8d2:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 11:19:12 -0700 (PDT) In-Reply-To: References: <201807030155.w631tARo009470@repo.freebsd.org> From: Matthew Macy Date: Tue, 3 Jul 2018 11:19:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335879 - in head/sys: conf kern sys To: Bryan Drewery Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:19:14 -0000 genoffset_test tests that the offsets match up On Tue, Jul 3, 2018 at 11:02 AM, Bryan Drewery wrote: > On 7/2/2018 6:55 PM, Matt Macy wrote: >> Author: mmacy >> Date: Tue Jul 3 01:55:09 2018 >> New Revision: 335879 >> URL: https://svnweb.freebsd.org/changeset/base/335879 >> >> Log: >> make critical_{enter, exit} inline >> >> Avoid pulling in all of the dependencies by >> automatically generating a stripped down thread_lite exporting >> only the fields of interest. The field declarations are type checked >> against the original and the offsets of the generated result is >> automatically checked. >> >> kib has expressed disagreement and would have preferred to simply >> use genassym style offsets (which loses type check enforcement). >> jhb has expressed dislike of it due to header pollution and a >> duplicate structure. He would have preferred to just have defined >> thread in _thread.h. Nonetheless, he admits that this is the only >> viable solution at the moment. >> >> The impetus for this came from mjg's D15331: >> "Inline critical_enter/exit for amd64" >> >> Reviewed by: jeff >> Differential Revision: https://reviews.freebsd.org/D16078 >> >> Added: >> head/sys/kern/genoffset.c (contents, props changed) >> head/sys/kern/genoffset.sh (contents, props changed) >> head/sys/sys/kpilite.h (contents, props changed) >> Modified: >> head/sys/conf/kern.post.mk >> head/sys/conf/kern.pre.mk >> head/sys/kern/kern_switch.c >> head/sys/sys/assym.h >> head/sys/sys/systm.h >> >> Modified: head/sys/conf/kern.post.mk >> ============================================================================== >> --- head/sys/conf/kern.post.mk Mon Jul 2 22:59:29 2018 (r335878) >> +++ head/sys/conf/kern.post.mk Tue Jul 3 01:55:09 2018 (r335879) >> @@ -185,13 +185,25 @@ hack.pico: Makefile >> ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.pico >> rm -f hack.c >> >> -assym.inc: $S/kern/genassym.sh genassym.o >> +offset.inc: $S/kern/genoffset.sh genoffset.o >> + NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > ${.TARGET} >> + >> +genoffset.o: $S/kern/genoffset.c >> + ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c >> + >> +genoffset_test.c: $S/kern/genoffset.c >> + cp $S/kern/genoffset.c genoffset_test.c >> + >> +genoffset_test.o: genoffset_test.c offset.inc >> + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.c >> + >> +assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o >> NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} > > What's genoffset_test? Nothing seems to use it. > > -- > Regards, > Bryan Drewery > From owner-svn-src-head@freebsd.org Tue Jul 3 18:20:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A0AF103A7A0; Tue, 3 Jul 2018 18:20:43 +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 E9D388FFFA; Tue, 3 Jul 2018 18:20:42 +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 CB2131FA45; Tue, 3 Jul 2018 18:20:42 +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 w63IKgS6016329; Tue, 3 Jul 2018 18:20:42 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63IKgji016328; Tue, 3 Jul 2018 18:20:42 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807031820.w63IKgji016328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 18:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335902 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:20:43 -0000 Author: mmacy Date: Tue Jul 3 18:20:42 2018 New Revision: 335902 URL: https://svnweb.freebsd.org/changeset/base/335902 Log: ensure that offset.inc is generated first Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 18:18:29 2018 (r335901) +++ head/sys/conf/kern.post.mk Tue Jul 3 18:20:42 2018 (r335902) @@ -156,7 +156,7 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o .endif ${SYSTEM_LD_TAIL} -OBJS_DEPEND_GUESS+= assym.inc vnode_if.h ${BEFORE_DEPEND:M*.h} \ +OBJS_DEPEND_GUESS+= offset.inc assym.inc vnode_if.h ${BEFORE_DEPEND:M*.h} \ ${MFILES:T:S/.m$/.h/} .for mfile in ${MFILES} From owner-svn-src-head@freebsd.org Tue Jul 3 18:21:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F24D103A87C; Tue, 3 Jul 2018 18:21:21 +0000 (UTC) (envelope-from mmacy@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 C4482902E2; Tue, 3 Jul 2018 18:21:20 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com [209.85.214.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 8C28E162DF; Tue, 3 Jul 2018 18:21:20 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f47.google.com with SMTP id j185-v6so4215857ite.1; Tue, 03 Jul 2018 11:21:20 -0700 (PDT) X-Gm-Message-State: APt69E3VF0NOGEoiK/VADCoiWsqLCbugeVYZ8DNOD2TyK76YoIKIzorD URAY2NFYrwKAJVqg2PnPP+RSn4yGMq09i216AMw= X-Google-Smtp-Source: AAOMgpeXW/IKulJ3RKBlnd4oSQXCgo6I7ha7jDO7w6WSQBOfDrsh476ZSnmpMeHCZCsxd8GS54nAT0/pCG528A0ewl0= X-Received: by 2002:a24:6c8a:: with SMTP id w132-v6mr13829495itb.4.1530642080109; Tue, 03 Jul 2018 11:21:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8d2:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 11:21:19 -0700 (PDT) In-Reply-To: References: <201807030250.w632o7Oa035010@repo.freebsd.org> From: Matthew Macy Date: Tue, 3 Jul 2018 11:21:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335880 - in head/sys: conf kern To: Bryan Drewery Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:21:21 -0000 What is the "correct" way to make sure that offset.inc is visible to modules? On Tue, Jul 3, 2018 at 10:39 AM, Bryan Drewery wrote: > On 7/2/2018 7:50 PM, Matt Macy wrote: >> Author: mmacy >> Date: Tue Jul 3 02:50:07 2018 >> New Revision: 335880 >> URL: https://svnweb.freebsd.org/changeset/base/335880 >> >> Log: >> expose thread_lite definition to tied modules >> >> Modified: >> head/sys/conf/kmod.mk >> head/sys/kern/genoffset.sh >> >> Modified: head/sys/conf/kmod.mk >> ============================================================================== >> --- head/sys/conf/kmod.mk Tue Jul 3 01:55:09 2018 (r335879) >> +++ head/sys/conf/kmod.mk Tue Jul 3 02:50:07 2018 (r335880) >> @@ -463,9 +463,10 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYS >> .endif >> >> .if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc) >> -CLEANFILES+= assym.inc genassym.o >> -DEPENDOBJS+= genassym.o >> +CLEANFILES+= assym.inc genassym.o genoffset.o >> +DEPENDOBJS+= genassym.o genoffset.o >> assym.inc: genassym.o >> +offset.inc: genoffset.o >> .if defined(KERNBUILDDIR) >> genassym.o: opt_global.h >> .endif >> @@ -475,6 +476,12 @@ genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c >> genassym.o: ${SRCS:Mopt_*.h} >> ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ >> ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c >> +offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o >> + sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET} >> +genoffset.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c >> +genoffset.o: ${SRCS:Mopt_*.h} >> + ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ >> + ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c > > Why is this using machine-specific genoffset.c but kern.post.mk uses the > global genoffset.c? > > And what even generates the machine-specific genoffset.c file? I see no > rule for it anywhere. > >> .endif >> >> .if defined(KERNBUILDDIR) >> >> Modified: head/sys/kern/genoffset.sh >> ============================================================================== >> --- head/sys/kern/genoffset.sh Tue Jul 3 01:55:09 2018 (r335879) >> +++ head/sys/kern/genoffset.sh Tue Jul 3 02:50:07 2018 (r335880) >> @@ -39,7 +39,7 @@ work() >> { >> echo "#ifndef _OFFSET_INC_" >> echo "#define _OFFSET_INC_" >> - echo "#if !defined(GENOFFSET) && !defined(KLD_MODULE)" >> + echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED))" >> ${NM:='nm'} ${NMFLAGS} "$1" | ${AWK:='awk'} ' >> / C .*_datatype_*/ { >> type = substr($3, match($3, "_datatype_") + length("_datatype_")) >> > > > -- > Regards, > Bryan Drewery > From owner-svn-src-head@freebsd.org Tue Jul 3 18:23:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C61103AC41; Tue, 3 Jul 2018 18:23:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 33106905EF; Tue, 3 Jul 2018 18:23:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 053C5BC01; Tue, 3 Jul 2018 18:23:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3E10643A; Tue, 3 Jul 2018 18:23:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 0wYCD42_XmKC; Tue, 3 Jul 2018 18:23:03 +0000 (UTC) Subject: Re: svn commit: r335880 - in head/sys: conf kern DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 510BB434 To: Matthew Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807030250.w632o7Oa035010@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: Date: Tue, 3 Jul 2018 11:23:06 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dl5ntuEYTRZMCxYqHv0kh9xLYaGrPUpnr" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:23:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Dl5ntuEYTRZMCxYqHv0kh9xLYaGrPUpnr Content-Type: multipart/mixed; boundary="QUUvG7jiS2rWm1NegIdQNnMDYhkixX3db"; protected-headers="v1" From: Bryan Drewery To: Matthew Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r335880 - in head/sys: conf kern References: <201807030250.w632o7Oa035010@repo.freebsd.org> In-Reply-To: --QUUvG7jiS2rWm1NegIdQNnMDYhkixX3db Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/3/2018 11:21 AM, Matthew Macy wrote: > What is the "correct" way to make sure that offset.inc is visible to mo= dules? >=20 Can you answer my question though? Was it a mistake or are you intending there to be a machine-specific genoffset.c? > On Tue, Jul 3, 2018 at 10:39 AM, Bryan Drewery w= rote: >> On 7/2/2018 7:50 PM, Matt Macy wrote: >>> Author: mmacy >>> Date: Tue Jul 3 02:50:07 2018 >>> New Revision: 335880 >>> URL: https://svnweb.freebsd.org/changeset/base/335880 >>> >>> Log: >>> expose thread_lite definition to tied modules >>> >>> Modified: >>> head/sys/conf/kmod.mk >>> head/sys/kern/genoffset.sh >>> >>> Modified: head/sys/conf/kmod.mk >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/conf/kmod.mk Tue Jul 3 01:55:09 2018 (r33587= 9) >>> +++ head/sys/conf/kmod.mk Tue Jul 3 02:50:07 2018 (r33588= 0) >>> @@ -463,9 +463,10 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk= ${SYS >>> .endif >>> >>> .if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc) >>> -CLEANFILES+=3D assym.inc genassym.o >>> -DEPENDOBJS+=3D genassym.o >>> +CLEANFILES+=3D assym.inc genassym.o genoffset.o >>> +DEPENDOBJS+=3D genassym.o genoffset.o >>> assym.inc: genassym.o >>> +offset.inc: genoffset.o >>> .if defined(KERNBUILDDIR) >>> genassym.o: opt_global.h >>> .endif >>> @@ -475,6 +476,12 @@ genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/gena= ssym.c >>> genassym.o: ${SRCS:Mopt_*.h} >>> ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ >>> ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c >>> +offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o >>> + sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET} >>> +genoffset.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c >>> +genoffset.o: ${SRCS:Mopt_*.h} >>> + ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ >>> + ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c >> >> Why is this using machine-specific genoffset.c but kern.post.mk uses t= he >> global genoffset.c? >> >> And what even generates the machine-specific genoffset.c file? I see n= o >> rule for it anywhere. >> >>> .endif >>> >>> .if defined(KERNBUILDDIR) >>> >>> Modified: head/sys/kern/genoffset.sh >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/kern/genoffset.sh Tue Jul 3 01:55:09 2018 = (r335879) >>> +++ head/sys/kern/genoffset.sh Tue Jul 3 02:50:07 2018 = (r335880) >>> @@ -39,7 +39,7 @@ work() >>> { >>> echo "#ifndef _OFFSET_INC_" >>> echo "#define _OFFSET_INC_" >>> - echo "#if !defined(GENOFFSET) && !defined(KLD_MODULE)" >>> + echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defin= ed(KLD_TIED))" >>> ${NM:=3D'nm'} ${NMFLAGS} "$1" | ${AWK:=3D'awk'} ' >>> / C .*_datatype_*/ { >>> type =3D substr($3, match($3, "_datatype_") + length("_= datatype_")) >>> >> >> >> -- >> Regards, >> Bryan Drewery >> --=20 Regards, Bryan Drewery --QUUvG7jiS2rWm1NegIdQNnMDYhkixX3db-- --Dl5ntuEYTRZMCxYqHv0kh9xLYaGrPUpnr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbO78KAAoJEDXXcbtuRpfPU+gH+QGQDh3bzfuRc1MOEsKymhOD T3nXjdDT9cVXw6/x2qqxhW612lcuiUkBjYdknPx63KQOk34nOnNK6sxhcwIXb5Uz +mZesEiHQfmVSC9pDpFDoeisXcSCySAs6pFffUF2fQQB3qR644GKoGaYGMh6Tdmy y4MvfHZrRwNfwb8PZr5c609IqJRBlK3oXqr5TLTR+F47Cf+DqoDbMWvn08QcybUZ cREF8DZbmMmHKWNCRAQegtI7fjHyCFgGgZgECn1gS8HqoLnXcquL2bf4GlDHsIuk s4Jru3XabjGOhx3ZaiXom19OAFOvej8/A8OGKbOYk5Zruw6mU3dxB6Zn1OJgJ9k= =KkfP -----END PGP SIGNATURE----- --Dl5ntuEYTRZMCxYqHv0kh9xLYaGrPUpnr-- From owner-svn-src-head@freebsd.org Tue Jul 3 18:39:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC2FE103C3BF; Tue, 3 Jul 2018 18:39:44 +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 7233391344; Tue, 3 Jul 2018 18:39:44 +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 4FF741FE0C; Tue, 3 Jul 2018 18:39:44 +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 w63IdiHu026406; Tue, 3 Jul 2018 18:39:44 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63Idi1m026405; Tue, 3 Jul 2018 18:39:44 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807031839.w63Idi1m026405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 18:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335903 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:39:44 -0000 Author: mmacy Date: Tue Jul 3 18:39:43 2018 New Revision: 335903 URL: https://svnweb.freebsd.org/changeset/base/335903 Log: explain the purpose of genoffset_test Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 18:20:42 2018 (r335902) +++ head/sys/conf/kern.post.mk Tue Jul 3 18:39:43 2018 (r335903) @@ -194,6 +194,9 @@ genoffset.o: $S/kern/genoffset.c genoffset_test.c: $S/kern/genoffset.c cp $S/kern/genoffset.c genoffset_test.c +# genoffset_test.o is not actually used for anything - the point of compiling it +# is to exercise the CTASSERT that checks that the offsets in the offset.inc +# _lite struct(s) match those in the original(s). genoffset_test.o: genoffset_test.c offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.c From owner-svn-src-head@freebsd.org Tue Jul 3 18:45:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBEF8103CBF0; Tue, 3 Jul 2018 18:45:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E1F5919DD; Tue, 3 Jul 2018 18:45:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A9541FFC6; Tue, 3 Jul 2018 18:45:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63Ij4iK031389; Tue, 3 Jul 2018 18:45:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63Ij4tb031388; Tue, 3 Jul 2018 18:45:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807031845.w63Ij4tb031388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 3 Jul 2018 18:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335904 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 18:45:05 -0000 Author: bdrewery Date: Tue Jul 3 18:45:04 2018 New Revision: 335904 URL: https://svnweb.freebsd.org/changeset/base/335904 Log: Fix module build when MODULE_TIED=1 is set. Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Jul 3 18:39:43 2018 (r335903) +++ head/sys/conf/kmod.mk Tue Jul 3 18:45:04 2018 (r335904) @@ -472,16 +472,16 @@ genassym.o: opt_global.h .endif assym.inc: ${SYSDIR}/kern/genassym.sh sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET} -genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c +genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c offset.inc genassym.o: ${SRCS:Mopt_*.h} ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET} -genoffset.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c +genoffset.o: ${SYSDIR}/kern/genoffset.c genoffset.o: ${SRCS:Mopt_*.h} ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ - ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c + ${SYSDIR}/kern/genoffset.c .endif .if defined(KERNBUILDDIR) From owner-svn-src-head@freebsd.org Tue Jul 3 19:09:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E031103E9C2; Tue, 3 Jul 2018 19:09:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45989929B8; Tue, 3 Jul 2018 19:09:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 266152031C; Tue, 3 Jul 2018 19:09:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63J9lGH041709; Tue, 3 Jul 2018 19:09:47 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63J9krp041707; Tue, 3 Jul 2018 19:09:46 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201807031909.w63J9krp041707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 3 Jul 2018 19:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335905 - head/usr.bin/rup X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/usr.bin/rup X-SVN-Commit-Revision: 335905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 19:09:47 -0000 Author: jilles Date: Tue Jul 3 19:09:46 2018 New Revision: 335905 URL: https://svnweb.freebsd.org/changeset/base/335905 Log: rup: Fix -Wcast-align warnings Fix possible strict aliasing issue (if time_t is the same size as int but not int but for example long) which also resulted in a false positive warning on systems with 64-bit time_t. Pointer casts are bad; we can just copy the time_t. Elsewhere, avoid casting char * to int * by using memcpy(). Reviewed by: eadler Differential Revision: https://reviews.freebsd.org/D16075 Modified: head/usr.bin/rup/Makefile head/usr.bin/rup/rup.c Modified: head/usr.bin/rup/Makefile ============================================================================== --- head/usr.bin/rup/Makefile Tue Jul 3 18:45:04 2018 (r335904) +++ head/usr.bin/rup/Makefile Tue Jul 3 19:09:46 2018 (r335905) @@ -4,6 +4,4 @@ PROG= rup LIBADD= rpcsvc -NO_WCAST_ALIGN= # Size is explicitly handled - .include Modified: head/usr.bin/rup/rup.c ============================================================================== --- head/usr.bin/rup/rup.c Tue Jul 3 18:45:04 2018 (r335904) +++ head/usr.bin/rup/rup.c Tue Jul 3 19:09:46 2018 (r335905) @@ -120,27 +120,16 @@ rstat_reply(statstime *host_stat, struct sockaddr_in * printf("%-*s\t", HOST_WIDTH, host); - if (sizeof(time_t) == sizeof(host_stat->curtime.tv_sec)) { - tmp_time = localtime((time_t *)&host_stat->curtime.tv_sec); - host_time = *tmp_time; + tmp_time_t = host_stat->curtime.tv_sec; + tmp_time = localtime(&tmp_time_t); + host_time = *tmp_time; - host_stat->curtime.tv_sec -= host_stat->boottime.tv_sec; + host_stat->curtime.tv_sec -= host_stat->boottime.tv_sec; - tmp_time = gmtime((time_t *)&host_stat->curtime.tv_sec); - host_uptime = *tmp_time; - } - else { /* non-32-bit time_t */ - tmp_time_t = host_stat->curtime.tv_sec; - tmp_time = localtime(&tmp_time_t); - host_time = *tmp_time; + tmp_time_t = host_stat->curtime.tv_sec; + tmp_time = gmtime(&tmp_time_t); + host_uptime = *tmp_time; - host_stat->curtime.tv_sec -= host_stat->boottime.tv_sec; - - tmp_time_t = host_stat->curtime.tv_sec; - tmp_time = gmtime(&tmp_time_t); - host_uptime = *tmp_time; - } - #define updays (host_stat->curtime.tv_sec / 86400) if (host_uptime.tm_yday != 0) sprintf(days_buf, "%3d day%s, ", updays, @@ -205,7 +194,7 @@ onehost(char *host) return(-1); } - addr.sin_addr.s_addr = *(int *)hp->h_addr; + memcpy(&addr.sin_addr.s_addr, hp->h_addr, sizeof(int)); rstat_reply(&host_stat, &addr); clnt_destroy(rstat_clnt); return (0); From owner-svn-src-head@freebsd.org Tue Jul 3 19:24:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E12411040172; Tue, 3 Jul 2018 19:24:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7BE993A84; Tue, 3 Jul 2018 19:24:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 892742066D; Tue, 3 Jul 2018 19:24:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63JOi2r051615; Tue, 3 Jul 2018 19:24:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63JOi5W051614; Tue, 3 Jul 2018 19:24:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807031924.w63JOi5W051614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 3 Jul 2018 19:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335906 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 19:24:45 -0000 Author: bdrewery Date: Tue Jul 3 19:24:44 2018 New Revision: 335906 URL: https://svnweb.freebsd.org/changeset/base/335906 Log: No need to make a copy to build genoffset_test.o Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 19:09:46 2018 (r335905) +++ head/sys/conf/kern.post.mk Tue Jul 3 19:24:44 2018 (r335906) @@ -191,14 +191,12 @@ offset.inc: $S/kern/genoffset.sh genoffset.o genoffset.o: $S/kern/genoffset.c ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c -genoffset_test.c: $S/kern/genoffset.c - cp $S/kern/genoffset.c genoffset_test.c - # genoffset_test.o is not actually used for anything - the point of compiling it # is to exercise the CTASSERT that checks that the offsets in the offset.inc # _lite struct(s) match those in the original(s). -genoffset_test.o: genoffset_test.c offset.inc - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.c +genoffset_test.o: $S/kern/genoffset.c offset.inc + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST ${.ALLSRC:M*.c} \ + -o ${.TARGET} assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} From owner-svn-src-head@freebsd.org Tue Jul 3 19:24:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C245610401F1; Tue, 3 Jul 2018 19:24:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 800F493BA6; Tue, 3 Jul 2018 19:24:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45F222066E; Tue, 3 Jul 2018 19:24:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63JOrol051664; Tue, 3 Jul 2018 19:24:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63JOrem051663; Tue, 3 Jul 2018 19:24:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807031924.w63JOrem051663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 3 Jul 2018 19:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335907 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 19:24:55 -0000 Author: bdrewery Date: Tue Jul 3 19:24:52 2018 New Revision: 335907 URL: https://svnweb.freebsd.org/changeset/base/335907 Log: Handle .depend for genoffset_test.o Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 19:24:44 2018 (r335906) +++ head/sys/conf/kern.post.mk Tue Jul 3 19:24:52 2018 (r335907) @@ -229,7 +229,7 @@ kernel-depend: .depend SRCS= assym.inc offset.inc vnode_if.h ${BEFORE_DEPEND} ${CFILES} \ ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} -DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o genoffset.o +DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o genoffset.o genoffset_test.o DEPENDFILES= ${DEPENDOBJS:O:u:C/^/.depend./} .if ${MAKE_VERSION} < 20160220 DEPEND_MP?= -MP From owner-svn-src-head@freebsd.org Tue Jul 3 20:02:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B467C102122C; Tue, 3 Jul 2018 20:02:23 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E293957B4; Tue, 3 Jul 2018 20:02:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id aRShfMF72bP3IaRSifMCbd; Tue, 03 Jul 2018 13:59:46 -0600 X-Authority-Analysis: v=2.3 cv=P64UeBIu c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=R9QF1RCXAYgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=yN6hIjXqmFj_shh0iqYA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 287EE742; Tue, 3 Jul 2018 12:59:42 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w63JxPm9069047; Tue, 3 Jul 2018 12:59:25 -0700 (PDT) (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 w63JxPA2069044; Tue, 3 Jul 2018 12:59:25 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807031959.w63JxPA2069044@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: Bryan Drewery cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335906 - head/sys/conf In-Reply-To: Message from Bryan Drewery of "Tue, 03 Jul 2018 19:24:44 -0000." <201807031924.w63JOi5W051614@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Jul 2018 12:59:25 -0700 X-CMAE-Envelope: MS4wfFM2J1VTWJaGPCu8LvQSnnPKyh2RnlfpnV/FisMqvlK+6mLsRXW3TW26s5fWfZhVvmwKhECVzUWtxVSPN+A8gtzl6Lat1VhGrLCEQVNh0ELuy9CP+Bc2 orMQROeeJMrxf3MO2YQMvUcWRZuMfiXHO8m+NLQMHxeFj1kcazRBVJvGrdzxHzWAd4XDyso33Bw4SP4VSU1NvgXN+fHRPvZzgJGQdAWipGNEftLqTBXGtblR hl9VqWAoshptn1oNiUNgKRxpJB9Z2dLAUI+Z9NUzzCGjBOwXRuuSZZ1luHaq8LrA X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 20:02:23 -0000 In message <201807031924.w63JOi5W051614@repo.freebsd.org>, Bryan Drewery writes : > Author: bdrewery > Date: Tue Jul 3 19:24:44 2018 > New Revision: 335906 > URL: https://svnweb.freebsd.org/changeset/base/335906 > > Log: > No need to make a copy to build genoffset_test.o > > Modified: > head/sys/conf/kern.post.mk > > Modified: head/sys/conf/kern.post.mk > ============================================================================= > = > --- head/sys/conf/kern.post.mk Tue Jul 3 19:09:46 2018 (r33590 > 5) > +++ head/sys/conf/kern.post.mk Tue Jul 3 19:24:44 2018 (r33590 > 6) > @@ -191,14 +191,12 @@ offset.inc: $S/kern/genoffset.sh genoffset.o > genoffset.o: $S/kern/genoffset.c > ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c > > -genoffset_test.c: $S/kern/genoffset.c > - cp $S/kern/genoffset.c genoffset_test.c > - > # genoffset_test.o is not actually used for anything - the point of compilin > g it > # is to exercise the CTASSERT that checks that the offsets in the offset.inc > # _lite struct(s) match those in the original(s). > -genoffset_test.o: genoffset_test.c offset.inc > - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.c > +genoffset_test.o: $S/kern/genoffset.c offset.inc > + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST ${.ALLSRC:M*.c} \ > + -o ${.TARGET} -o with -c in the previous line will cause an error. > > assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o > NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${. > TARGET} > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Jul 3 20:03:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D545C1021468; Tue, 3 Jul 2018 20:03:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B44A95962; Tue, 3 Jul 2018 20:03:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C6B520CD1; Tue, 3 Jul 2018 20:03:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63K3J58071765; Tue, 3 Jul 2018 20:03:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63K3JD3071764; Tue, 3 Jul 2018 20:03:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807032003.w63K3JD3071764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 3 Jul 2018 20:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335908 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 20:03:20 -0000 Author: bdrewery Date: Tue Jul 3 20:03:19 2018 New Revision: 335908 URL: https://svnweb.freebsd.org/changeset/base/335908 Log: Fix r335906+r335907 to not pass multiple source files to genoffset_test.o target. This is working around a bug with the FAST_DEPEND logic with custom targets that use .ALLSRC. Reported by: mmacy Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 19:24:52 2018 (r335907) +++ head/sys/conf/kern.post.mk Tue Jul 3 20:03:19 2018 (r335908) @@ -195,8 +195,8 @@ genoffset.o: $S/kern/genoffset.c # is to exercise the CTASSERT that checks that the offsets in the offset.inc # _lite struct(s) match those in the original(s). genoffset_test.o: $S/kern/genoffset.c offset.inc - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST ${.ALLSRC:M*.c} \ - -o ${.TARGET} + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST \ + $S/kern/genoffset.c -o ${.TARGET} assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} From owner-svn-src-head@freebsd.org Tue Jul 3 20:06:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BD4D102197A; Tue, 3 Jul 2018 20:06:58 +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 98E0195B8B; Tue, 3 Jul 2018 20:06:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id aRZefMHjwbP3IaRZgfMENx; Tue, 03 Jul 2018 14:06:56 -0600 X-Authority-Analysis: v=2.3 cv=P64UeBIu c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=R9QF1RCXAYgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=SylrBjB-f8JqxCxX1zgA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 7B16276C; Tue, 3 Jul 2018 13:06:54 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w63K6c1C069214; Tue, 3 Jul 2018 13:06:38 -0700 (PDT) (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 w63K6c3E069211; Tue, 3 Jul 2018 13:06:38 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807032006.w63K6c3E069211@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: Bryan Drewery cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335908 - head/sys/conf In-Reply-To: Message from Bryan Drewery of "Tue, 03 Jul 2018 20:03:19 -0000." <201807032003.w63K3JD3071764@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Jul 2018 13:06:38 -0700 X-CMAE-Envelope: MS4wfCBoXa+tTB5ZIY9YQ1MrLo7nPswL9dhAe1nwYRcndVwtrnUOjGH5nhlt7/Ly9vwIfkDIZtCBQaQ/ZkMktjzHimi1wxOpOpoa9S6SCuEurndK9lP+9dzC vhXe33KOWwmK7HBa6huaVA1xX4V3YRsP/34XQYG+xkDuLAoNyPgpokcECdvjNo51DRiP3XSHN9irGqc8D4hFtvQhM9A/nVnCppwPB+90WTMYpp/+yToTih+p 3as/fwgtp7dQnymdgT1jOZ2jBWY9yjEIpqK47ly4ZTBpNUVA5svGXhDAXXZNvxUq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 20:06:58 -0000 In message <201807032003.w63K3JD3071764@repo.freebsd.org>, Bryan Drewery writes : > Author: bdrewery > Date: Tue Jul 3 20:03:19 2018 > New Revision: 335908 > URL: https://svnweb.freebsd.org/changeset/base/335908 > > Log: > Fix r335906+r335907 to not pass multiple source files to genoffset_test.o t > arget. > > This is working around a bug with the FAST_DEPEND logic with custom targets > that use .ALLSRC. > > Reported by: mmacy > > Modified: > head/sys/conf/kern.post.mk > > Modified: head/sys/conf/kern.post.mk > ============================================================================= > = > --- head/sys/conf/kern.post.mk Tue Jul 3 19:24:52 2018 (r33590 > 7) > +++ head/sys/conf/kern.post.mk Tue Jul 3 20:03:19 2018 (r33590 > 8) > @@ -195,8 +195,8 @@ genoffset.o: $S/kern/genoffset.c > # is to exercise the CTASSERT that checks that the offsets in the offset.inc > # _lite struct(s) match those in the original(s). > genoffset_test.o: $S/kern/genoffset.c offset.inc > - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST ${.ALLSRC:M*.c} \ > - -o ${.TARGET} > + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST \ > + $S/kern/genoffset.c -o ${.TARGET} This still won't build because of -c and -o. > > assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o > NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${. > TARGET} > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Jul 3 20:07:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A2E610219D1; Tue, 3 Jul 2018 20:07:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 390C695C8F; Tue, 3 Jul 2018 20:07:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 0B804DC42; Tue, 3 Jul 2018 20:07:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CC2385C2; Tue, 3 Jul 2018 20:07:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id t-IDMwoolavd; Tue, 3 Jul 2018 20:07:07 +0000 (UTC) Subject: Re: svn commit: r335906 - head/sys/conf DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com A288D5BC To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807031959.w63JxPA2069044@slippy.cwsent.com> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: <6d02404f-a7bb-01c7-3775-7a0349e306be@FreeBSD.org> Date: Tue, 3 Jul 2018 13:07:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807031959.w63JxPA2069044@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nrEq6SIfsbZGYTgfSZ5R3mSN64FvoLCIQ" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 20:07:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nrEq6SIfsbZGYTgfSZ5R3mSN64FvoLCIQ Content-Type: multipart/mixed; boundary="N66uQifSC1aSf1iMifRJdrqNP6RkoOJg1"; protected-headers="v1" From: Bryan Drewery To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <6d02404f-a7bb-01c7-3775-7a0349e306be@FreeBSD.org> Subject: Re: svn commit: r335906 - head/sys/conf References: <201807031959.w63JxPA2069044@slippy.cwsent.com> In-Reply-To: <201807031959.w63JxPA2069044@slippy.cwsent.com> --N66uQifSC1aSf1iMifRJdrqNP6RkoOJg1 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/3/2018 12:59 PM, Cy Schubert wrote: > In message <201807031924.w63JOi5W051614@repo.freebsd.org>, Bryan=20 > Drewery writes > : >> Author: bdrewery >> Date: Tue Jul 3 19:24:44 2018 >> New Revision: 335906 >> URL: https://svnweb.freebsd.org/changeset/base/335906 >> >> Log: >> No need to make a copy to build genoffset_test.o >> >> Modified: >> head/sys/conf/kern.post.mk >> >> Modified: head/sys/conf/kern.post.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/kern.post.mk Tue Jul 3 19:09:46 2018 (r33590 >> 5) >> +++ head/sys/conf/kern.post.mk Tue Jul 3 19:24:44 2018 (r33590 >> 6) >> @@ -191,14 +191,12 @@ offset.inc: $S/kern/genoffset.sh genoffset.o >> genoffset.o: $S/kern/genoffset.c >> ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c >> =20 >> -genoffset_test.c: $S/kern/genoffset.c >> - cp $S/kern/genoffset.c genoffset_test.c >> - >> # genoffset_test.o is not actually used for anything - the point of c= ompilin >> g it >> # is to exercise the CTASSERT that checks that the offsets in the off= set.inc >> # _lite struct(s) match those in the original(s).=20 >> -genoffset_test.o: genoffset_test.c offset.inc >> - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.= c >> +genoffset_test.o: $S/kern/genoffset.c offset.inc >> + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST ${.ALLSRC:M*.c}= \ >> + -o ${.TARGET} >=20 > -o with -c in the previous line will cause an error. -o and -c are fine together. The problem is .ALLSRC duplicating sources from the dependencies read from .depend.genoffset_test.o file. Workaround in r335908. >=20 >> =20 >> assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o >> NM=3D'${NM}' NMFLAGS=3D'${NMFLAGS}' sh $S/kern/genassym.sh genassym.= o > ${. >> TARGET} >> >=20 >=20 --=20 Regards, Bryan Drewery --N66uQifSC1aSf1iMifRJdrqNP6RkoOJg1-- --nrEq6SIfsbZGYTgfSZ5R3mSN64FvoLCIQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEbBAEBAgAGBQJbO9doAAoJEDXXcbtuRpfPquUH92aRqCMwTG0ax2Hu06Fql/lX Kn3iDz/KaCDnuXmnHJ5sgzbGSgevoqgZQnDJp9lrEvroNbsqsXNfFKw2f19ZOf1f g00nafksrxXCIsbK3IF/uwXiseuEaq7yH4TAXg7Yohy2TtnVgh2bxi2tNrkYgnPO lDCTMlbe2DfnsF0ygu6EcaZ1IgQGEbWMS5J4Jue6GoKr8pWZEZgT6kOuUiUVra8D wRWADypq+jw4ADJmgF8u1YVjrdK9q6Yxx3FphnnGi21Rz+RQoSimuEyQ/vUBsCyI DMa0hWxsNbNLx84T60pPHpfV3BJfCYWZHyxMdwLxX5BOEbQphBAzdxYT9Ia9nQ== =ZtE0 -----END PGP SIGNATURE----- --nrEq6SIfsbZGYTgfSZ5R3mSN64FvoLCIQ-- From owner-svn-src-head@freebsd.org Tue Jul 3 20:09:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC8831021DE3; Tue, 3 Jul 2018 20:09:20 +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 066E595ED4; Tue, 3 Jul 2018 20:09:19 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id aRbqfAFyeogHjaRbrfvtmL; Tue, 03 Jul 2018 14:09:13 -0600 X-Authority-Analysis: v=2.3 cv=Sre+FsG0 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=R9QF1RCXAYgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VxmjJ2MpAAAA:8 a=S37ZGIog4CWuUdbTelAA:9 a=CjuIK1q_8ugA:10 a=e3Rxr8EYQ5QA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id D371A78C; Tue, 3 Jul 2018 13:09:09 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w63K8rUe069337; Tue, 3 Jul 2018 13:08:53 -0700 (PDT) (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 w63K8rMr069334; Tue, 3 Jul 2018 13:08:53 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807032008.w63K8rMr069334@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: Bryan Drewery cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335906 - head/sys/conf In-Reply-To: Message from Bryan Drewery of "Tue, 03 Jul 2018 13:07:04 -0700." <6d02404f-a7bb-01c7-3775-7a0349e306be@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Jul 2018 13:08:53 -0700 X-CMAE-Envelope: MS4wfMPgadQ2JGI65NVYuearGDQrsdQtO4Ch7DSQdtvNykldUa0usW+1bW2PgPxfdhFEKsLFn/iHGJori1U/Te6/h8+VvDEN7kfvhvgh86gePUKI55maKIEy FR42k7H16feK9eLBrnAruLsPdhBE+GtJIEbytrkrQO7TmKWDbq1mjHuCEAu6uixqyAnS1yvMArM4pLYT3pENQbR42dRYX9/o2kfsAmB5lQijVzqTdyE++dMj KS2KASr7nagJtupyGg9PQdBVwXZn0h3XVDPc2Hm3ScZeO2AiGctaxdDB96wLSMKz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 20:09:20 -0000 In message <6d02404f-a7bb-01c7-3775-7a0349e306be@FreeBSD.org>, Bryan Drewery wr ites: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --nrEq6SIfsbZGYTgfSZ5R3mSN64FvoLCIQ > Content-Type: multipart/mixed; boundary="N66uQifSC1aSf1iMifRJdrqNP6RkoOJg1"; > protected-headers="v1" > From: Bryan Drewery > To: Cy Schubert > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Message-ID: <6d02404f-a7bb-01c7-3775-7a0349e306be@FreeBSD.org> > Subject: Re: svn commit: r335906 - head/sys/conf > References: <201807031959.w63JxPA2069044@slippy.cwsent.com> > In-Reply-To: <201807031959.w63JxPA2069044@slippy.cwsent.com> > > --N66uQifSC1aSf1iMifRJdrqNP6RkoOJg1 > Content-Type: text/plain; charset=utf-8 > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > On 7/3/2018 12:59 PM, Cy Schubert wrote: > > In message <201807031924.w63JOi5W051614@repo.freebsd.org>, Bryan=20 > > Drewery writes > > : > >> Author: bdrewery > >> Date: Tue Jul 3 19:24:44 2018 > >> New Revision: 335906 > >> URL: https://svnweb.freebsd.org/changeset/base/335906 > >> > >> Log: > >> No need to make a copy to build genoffset_test.o > >> > >> Modified: > >> head/sys/conf/kern.post.mk > >> > >> Modified: head/sys/conf/kern.post.mk > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=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/conf/kern.post.mk Tue Jul 3 19:09:46 2018 (r33590 > >> 5) > >> +++ head/sys/conf/kern.post.mk Tue Jul 3 19:24:44 2018 (r33590 > >> 6) > >> @@ -191,14 +191,12 @@ offset.inc: $S/kern/genoffset.sh genoffset.o > >> genoffset.o: $S/kern/genoffset.c > >> ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c > >> =20 > >> -genoffset_test.c: $S/kern/genoffset.c > >> - cp $S/kern/genoffset.c genoffset_test.c > >> - > >> # genoffset_test.o is not actually used for anything - the point of c= > ompilin > >> g it > >> # is to exercise the CTASSERT that checks that the offsets in the off= > set.inc > >> # _lite struct(s) match those in the original(s).=20 > >> -genoffset_test.o: genoffset_test.c offset.inc > >> - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.= > c > >> +genoffset_test.o: $S/kern/genoffset.c offset.inc > >> + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST ${.ALLSRC:M*.c}= > \ > >> + -o ${.TARGET} > >=20 > > -o with -c in the previous line will cause an error. > > -o and -c are fine together. The problem is .ALLSRC duplicating sources > from the dependencies read from .depend.genoffset_test.o file. > Workaround in r335908. gotcha. Sorry for the second spam. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Jul 3 20:09:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE3B1021EB3; Tue, 3 Jul 2018 20:09:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 3200495FF7; Tue, 3 Jul 2018 20:09:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 01CD3DED8; Tue, 3 Jul 2018 20:09:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3B6F65E2; Tue, 3 Jul 2018 20:09:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id CqaBWTZhFMLY; Tue, 3 Jul 2018 20:09:35 +0000 (UTC) Subject: Re: svn commit: r335908 - head/sys/conf DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 3CFE45DB To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807032006.w63K6c3E069211@slippy.cwsent.com> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: Date: Tue, 3 Jul 2018 13:09:34 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807032006.w63K6c3E069211@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5LBlvAHx6wd2MBY6ZJGLCKfNccUC2f3P7" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 20:09:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5LBlvAHx6wd2MBY6ZJGLCKfNccUC2f3P7 Content-Type: multipart/mixed; boundary="FxkUanNxVoyIpem522qWwd6g1GQCAsxqA"; protected-headers="v1" From: Bryan Drewery To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r335908 - head/sys/conf References: <201807032006.w63K6c3E069211@slippy.cwsent.com> In-Reply-To: <201807032006.w63K6c3E069211@slippy.cwsent.com> --FxkUanNxVoyIpem522qWwd6g1GQCAsxqA Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/3/2018 1:06 PM, Cy Schubert wrote: > In message <201807032003.w63K3JD3071764@repo.freebsd.org>, Bryan=20 > Drewery writes > : >> Author: bdrewery >> Date: Tue Jul 3 20:03:19 2018 >> New Revision: 335908 >> URL: https://svnweb.freebsd.org/changeset/base/335908 >> >> Log: >> Fix r335906+r335907 to not pass multiple source files to genoffset_t= est.o t >> arget. >> =20 >> This is working around a bug with the FAST_DEPEND logic with custom = targets >> that use .ALLSRC. >> =20 >> Reported by: mmacy >> >> Modified: >> head/sys/conf/kern.post.mk >> >> Modified: head/sys/conf/kern.post.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/kern.post.mk Tue Jul 3 19:24:52 2018 (r33590 >> 7) >> +++ head/sys/conf/kern.post.mk Tue Jul 3 20:03:19 2018 (r33590 >> 8) >> @@ -195,8 +195,8 @@ genoffset.o: $S/kern/genoffset.c >> # is to exercise the CTASSERT that checks that the offsets in the off= set.inc >> # _lite struct(s) match those in the original(s).=20 >> genoffset_test.o: $S/kern/genoffset.c offset.inc >> - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST ${.ALLSRC:M*.c}= \ >> - -o ${.TARGET} >> + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST \ >> + $S/kern/genoffset.c -o ${.TARGET} >=20 > This still won't build because of -c and -o. -c is just a hint to the compiler to not run the linker. It's fine. We even have this pattern used in share/mk/bsd.suffixes.mk. >=20 >> =20 >> assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o >> NM=3D'${NM}' NMFLAGS=3D'${NMFLAGS}' sh $S/kern/genassym.sh genassym.= o > ${. >> TARGET} >> >=20 >=20 --=20 Regards, Bryan Drewery --FxkUanNxVoyIpem522qWwd6g1GQCAsxqA-- --5LBlvAHx6wd2MBY6ZJGLCKfNccUC2f3P7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbO9f+AAoJEDXXcbtuRpfPLfMH/RGntxsu4DA4HCIHUB0CvC3g P6Bg0v1Acx0IVKF8TN+x4Bue+q8JGckWj67g8CVkhi4w9YcpZUQk+yq+pzRL/lU3 qSF64+EPf77QV+gKgIfZWUTr1JASeIEbJ0D2XAafp4/DcjeSiTHUHWnebn9MyP/J 8p55s6OJb4aYY/dQxSTiakZ91I2+uIk28f3zo7SiFUOgxzugnFHrMnYIRqcikMyB ir6aBYVKq4UqDusRb0cVgmm+hsI1yurao8sHz+kcrFt8awkiMw1y/FgVKRBdqbyh XXP4R29pysHW7wy0OJU0rQC81EYIdXmrWpyGNdN1kwXxsRWwa++weR0zx+EtqEs= =Vx2i -----END PGP SIGNATURE----- --5LBlvAHx6wd2MBY6ZJGLCKfNccUC2f3P7-- From owner-svn-src-head@freebsd.org Tue Jul 3 20:12:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B18F1022481; Tue, 3 Jul 2018 20:12:58 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DA3DE96483; Tue, 3 Jul 2018 20:12:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id aRfOfAH92ogHjaRfPfvuka; Tue, 03 Jul 2018 14:12:51 -0600 X-Authority-Analysis: v=2.3 cv=Sre+FsG0 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=R9QF1RCXAYgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VxmjJ2MpAAAA:8 a=FmRi0MEEDUOsP-fuaEAA:9 a=CjuIK1q_8ugA:10 a=TLyZHkqU5i0A:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id EF0837B2; Tue, 3 Jul 2018 13:12:49 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w63KCX6F019885; Tue, 3 Jul 2018 13:12:33 -0700 (PDT) (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 w63KCXHg019870; Tue, 3 Jul 2018 13:12:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807032012.w63KCXHg019870@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: Bryan Drewery cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335908 - head/sys/conf In-Reply-To: Message from Bryan Drewery of "Tue, 03 Jul 2018 13:09:34 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Jul 2018 13:12:33 -0700 X-CMAE-Envelope: MS4wfPT4zq4GpaHZ5Ar0hetQcD6FlYOUsR/6bULC6t27n4rj+IncY1wklgluQoOzQHgjcFMvV4TcsNOxTa9UqY35/M+hJ/pKUhVT/LiFoBBnPB/eRRP9LAJv 98DP6tk6NRrE78psfEaUTHGS3qI6exVcMFqAUQpksKo37Yw1f/93SpHqU5dCpijUkUxfQtIMOqf8j5gQ+JW63Ketn6890c479PnijynPxkTfE1agCYnxS+ex J6T9NsR4YA4JFAPmiYoGRVidrLM+eV6bBaf/X4RJPaKiMXSkuyyMV5rNT4x99qyO X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 20:12:58 -0000 In message , Bryan Drewery wr ites: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --5LBlvAHx6wd2MBY6ZJGLCKfNccUC2f3P7 > Content-Type: multipart/mixed; boundary="FxkUanNxVoyIpem522qWwd6g1GQCAsxqA"; > protected-headers="v1" > From: Bryan Drewery > To: Cy Schubert > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Message-ID: > Subject: Re: svn commit: r335908 - head/sys/conf > References: <201807032006.w63K6c3E069211@slippy.cwsent.com> > In-Reply-To: <201807032006.w63K6c3E069211@slippy.cwsent.com> > > --FxkUanNxVoyIpem522qWwd6g1GQCAsxqA > Content-Type: text/plain; charset=utf-8 > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > On 7/3/2018 1:06 PM, Cy Schubert wrote: > > In message <201807032003.w63K3JD3071764@repo.freebsd.org>, Bryan=20 > > Drewery writes > > : > >> Author: bdrewery > >> Date: Tue Jul 3 20:03:19 2018 > >> New Revision: 335908 > >> URL: https://svnweb.freebsd.org/changeset/base/335908 > >> > >> Log: > >> Fix r335906+r335907 to not pass multiple source files to genoffset_t= > est.o t > >> arget. > >> =20 > >> This is working around a bug with the FAST_DEPEND logic with custom = > targets > >> that use .ALLSRC. > >> =20 > >> Reported by: mmacy > >> > >> Modified: > >> head/sys/conf/kern.post.mk > >> > >> Modified: head/sys/conf/kern.post.mk > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=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/conf/kern.post.mk Tue Jul 3 19:24:52 2018 (r33590 > >> 7) > >> +++ head/sys/conf/kern.post.mk Tue Jul 3 20:03:19 2018 (r33590 > >> 8) > >> @@ -195,8 +195,8 @@ genoffset.o: $S/kern/genoffset.c > >> # is to exercise the CTASSERT that checks that the offsets in the off= > set.inc > >> # _lite struct(s) match those in the original(s).=20 > >> genoffset_test.o: $S/kern/genoffset.c offset.inc > >> - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST ${.ALLSRC:M*.c}= > \ > >> - -o ${.TARGET} > >> + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST \ > >> + $S/kern/genoffset.c -o ${.TARGET} > >=20 > > This still won't build because of -c and -o. > > -c is just a hint to the compiler to not run the linker. It's fine. We > even have this pattern used in share/mk/bsd.suffixes.mk. I sent my second reply to you before you sent your first one to me. We're good now. Sorry for the spam. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Jul 3 21:02:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EBA51027267; Tue, 3 Jul 2018 21:02:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E634A7047A; Tue, 3 Jul 2018 21:02:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8D7C21659; Tue, 3 Jul 2018 21:02:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63L2LBF002278; Tue, 3 Jul 2018 21:02:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63L2LAa002277; Tue, 3 Jul 2018 21:02:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807032102.w63L2LAa002277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 3 Jul 2018 21:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335909 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 21:02:22 -0000 Author: bdrewery Date: Tue Jul 3 21:02:21 2018 New Revision: 335909 URL: https://svnweb.freebsd.org/changeset/base/335909 Log: genoffset.c is not generated Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Jul 3 20:03:19 2018 (r335908) +++ head/sys/conf/kern.pre.mk Tue Jul 3 21:02:21 2018 (r335909) @@ -195,7 +195,7 @@ OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_ME OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} -GEN_CFILES= $S/$M/$M/genassym.c $S/kern/genoffset.c ${MFILES:T:S/.m$/.c/} +GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} SYSTEM_CFILES= config.c env.c hints.c vnode_if.c SYSTEM_DEP= Makefile ${SYSTEM_OBJS} SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} From owner-svn-src-head@freebsd.org Tue Jul 3 21:02:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F1BF10272BE; Tue, 3 Jul 2018 21:02:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA9A2704F1; Tue, 3 Jul 2018 21:02:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3888321664; Tue, 3 Jul 2018 21:02:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63L2QJt002331; Tue, 3 Jul 2018 21:02:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63L2PB8002325; Tue, 3 Jul 2018 21:02:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807032102.w63L2PB8002325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 3 Jul 2018 21:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335910 - in head/sys: conf modules/linux modules/linux64 modules/vmm X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head/sys: conf modules/linux modules/linux64 modules/vmm X-SVN-Commit-Revision: 335910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 21:02:30 -0000 Author: bdrewery Date: Tue Jul 3 21:02:25 2018 New Revision: 335910 URL: https://svnweb.freebsd.org/changeset/base/335910 Log: All genassym.sh usage need offset.inc Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/kmod.mk head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile head/sys/modules/vmm/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jul 3 21:02:21 2018 (r335909) +++ head/sys/conf/files.amd64 Tue Jul 3 21:02:25 2018 (r335910) @@ -33,7 +33,7 @@ cloudabi64_vdso_blob.o optional compat_cloudabi64 \ clean "cloudabi64_vdso_blob.o" # linux32_genassym.o optional compat_linux32 \ - dependency "$S/amd64/linux32/linux32_genassym.c" \ + dependency "$S/amd64/linux32/linux32_genassym.c offset.inc" \ compile-with "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "linux32_genassym.o" Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Jul 3 21:02:21 2018 (r335909) +++ head/sys/conf/files.i386 Tue Jul 3 21:02:25 2018 (r335910) @@ -20,7 +20,7 @@ cloudabi32_vdso_blob.o optional compat_cloudabi32 \ clean "cloudabi32_vdso_blob.o" # linux_genassym.o optional compat_linux \ - dependency "$S/i386/linux/linux_genassym.c" \ + dependency "$S/i386/linux/linux_genassym.c offset.inc" \ compile-with "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "linux_genassym.o" Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Jul 3 21:02:21 2018 (r335909) +++ head/sys/conf/kmod.mk Tue Jul 3 21:02:25 2018 (r335910) @@ -463,8 +463,14 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYS .endif .if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc) -CLEANFILES+= assym.inc genassym.o genoffset.o -DEPENDOBJS+= genassym.o genoffset.o +CLEANFILES+= assym.inc +DEPENDOBJS+= genassym.o +DPSRCS+= offset.inc +.endif +.if !empty(SRCS:Moffset.inc) || !empty(DPSRCS:Moffset.inc) +CLEANFILES+= offset.inc genoffset.o +DEPENDOBJS+= genoffset.o +.endif assym.inc: genassym.o offset.inc: genoffset.o .if defined(KERNBUILDDIR) @@ -482,7 +488,6 @@ genoffset.o: ${SYSDIR}/kern/genoffset.c genoffset.o: ${SRCS:Mopt_*.h} ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ ${SYSDIR}/kern/genoffset.c -.endif .if defined(KERNBUILDDIR) ${OBJS}: opt_global.h Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Tue Jul 3 21:02:21 2018 (r335909) +++ head/sys/modules/linux/Makefile Tue Jul 3 21:02:25 2018 (r335910) @@ -76,7 +76,7 @@ ${VDSO}.so: linux${SFX}_locore.o strip -N _binary_linux_locore_o_size ${.TARGET} .endif -linux${SFX}_genassym.o: +linux${SFX}_genassym.o: offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC} .if !defined(KERNBUILDDIR) Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Tue Jul 3 21:02:21 2018 (r335909) +++ head/sys/modules/linux64/Makefile Tue Jul 3 21:02:25 2018 (r335910) @@ -51,7 +51,7 @@ linux_support.o: assym.inc linux_assym.h ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} -linux_genassym.o: +linux_genassym.o: offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC} .if !defined(KERNBUILDDIR) Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Tue Jul 3 21:02:21 2018 (r335909) +++ head/sys/modules/vmm/Makefile Tue Jul 3 21:02:25 2018 (r335910) @@ -4,7 +4,7 @@ KMOD= vmm SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h pcib_if.h acpi_if.h DPSRCS+= vmx_assym.h svm_assym.h -DPSRCS+= vmx_genassym.c svm_genassym.c +DPSRCS+= vmx_genassym.c svm_genassym.c offset.inc CFLAGS+= -DVMM_KEEP_STATS -DSMP CFLAGS+= -I${SRCTOP}/sys/amd64/vmm @@ -74,10 +74,10 @@ svm_support.o: ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} -vmx_genassym.o: +vmx_genassym.o: offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC} -svm_genassym.o: +svm_genassym.o: offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC} .include From owner-svn-src-head@freebsd.org Tue Jul 3 21:10:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59F2B1027DB1; Tue, 3 Jul 2018 21:10:12 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.stack.nl", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC9007095F; Tue, 3 Jul 2018 21:10:11 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161]) by mailout.stack.nl (Postfix) with ESMTP id 447D011C; Tue, 3 Jul 2018 23:10:02 +0200 (CEST) Received: by toad2.stack.nl (Postfix, from userid 1677) id 3C7418934A; Tue, 3 Jul 2018 23:10:02 +0200 (CEST) Date: Tue, 3 Jul 2018 23:10:02 +0200 From: Jilles Tjoelker To: Hiroki Sato Cc: daichigoto@icloud.com, lists@eitanadler.com, daichi@freebsd.org, gnn@FreeBSD.org, cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335836 - head/usr.bin/top Message-ID: <20180703211002.GA11832@stack.nl> References: <20180702.155529.1102410939281120947.hrs@allbsd.org> <459BD898-8072-426E-A968-96C1382AC616@icloud.com> <20180703.020956.859981414196673670.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180703.020956.859981414196673670.hrs@allbsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 21:10:12 -0000 On Tue, Jul 03, 2018 at 02:09:56AM +0900, Hiroki Sato wrote: > 後藤大地 wrote > in <459BD898-8072-426E-A968-96C1382AC616@icloud.com>: > da> > 2018/07/02 15:55、Hiroki Sato のメール: > da> > Eitan Adler wrote > da> > in : > da> > li> On 1 July 2018 at 10:08, Conrad Meyer wrote: > da> > li> > I don't think code to decode UTF-8 belongs in top(1). I don't know > da> > li> > what the goal of this routine is, but I doubt this is the right way to > da> > li> > accomplish it. > da> > li> > da> > li> For the record, I agree. This is why I didn't click "accept" on the > da> > li> revision. I don't fully oppose leaving it in top(1) for now as we work > da> > li> out the API, but long term its the wrong place. > da> > li> > da> > li> https://reviews.freebsd.org/D16058 is the review. > da> > I strongly object this kind of encoding-specific routine. Please > da> > back out it. The problem is that top(1) does not support multibyte > da> > encoding in functions for printing, and using C99 wide/multibyte > da> > character manipulation API such as iswprint(3) is the way to solve > da> > it. Doing getenv("LANG") and assuming an encoding based on it is a > da> > very bad practice to internationalize software. > da> I respect what you mean. > da> Once I back out, I will begin implementing it in a different way. > da> Please advise which function should be used for implementation > da> (iswprint (3) and what other functions should be used?) > Roughly speaking, POSIX/XPG/C99 I18N model requires the following > steps: > 1. Call setlocale(LC_ALL, "") first. > 2. Use mbs<->wcs and/or mb<->wc conversion functions in C95/C99 to > manipulate characters and strings depending on what you want to > do. The printable() function should use mbtowc(3) and > iswprint(3), for example. And wcslen(3) should be used to > determine the length of characters to be printed instead of > strlen(). > Note that if mbs->wcs or mb->wc conversion fails with EILSEQ at > some point, some of the character(s) are invalid for printing. > This can happen because command-line parameters in top(1) are not > always encoded in one specified in LC_CTYPE or LANG. It should > also be handled as non-printable. However, to make matters worse, > each process does not always use a single, same locale as top(1). > A process invoked with LANG=ja_JP.eucJP may have EUC-JP characters > in its ARGV array even if top(1) runs by another user whose LANG > is en_US.UTF-8. You have to determine which locale should be used > before doing mb->wc conversion. It is not so simple. > 3. Print the multibyte characters by using strvisx(3) family, which > supports multibyte character, or swprintf(3) family if you want to > format wide characters directly. Note that buffer length for > strvisx(3) must be calculated by using MB_LEN_MAX. In this case, calling setlocale() and then using strvisx() seems the right solution. If locales differ across processes this may result in mojibake but that cannot really be helped. Even analyzing other processes' locale variables is not fully reliable, since strings may be incorrectly encoded even in the process's real locale, environment variables cannot be read across users and the environment block may be overwritten by a program. In general, although using conversion to wide characters allows users a lot of flexibility, I don't think it is the best in all situations: * The result of mbstowcs() is a UTF-32 string which consumes a lot of memory. A loop with mbrtowc() may also be slow. Many operations can be done directly on UTF-8 strings with no or little additional complexity compared to byte strings. * If there is an invalid multibyte character, there is little flexibility to handle this usefully and securely, since so little is known about the encoding. The best handling may depend on the context. Therefore, in /bin/sh, I have only implemented multibyte support for UTF-8. All other encodings have bytes treated as characters. However, I do agree that getenv("LANG") is bad. Instead, setlocale() should be used. After that, nl_langinfo(CODESET) can be called and the result compared to "UTF-8". -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Tue Jul 3 21:15:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8151F10285EB; Tue, 3 Jul 2018 21:15:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3420D70ED8; Tue, 3 Jul 2018 21:15:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14A3B217FF; Tue, 3 Jul 2018 21:15:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63LFldL007530; Tue, 3 Jul 2018 21:15:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63LFlG5007529; Tue, 3 Jul 2018 21:15:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807032115.w63LFlG5007529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 3 Jul 2018 21:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335911 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 21:15:48 -0000 Author: bdrewery Date: Tue Jul 3 21:15:47 2018 New Revision: 335911 URL: https://svnweb.freebsd.org/changeset/base/335911 Log: Need offset.inc generated early if MODULE_TIED is defined. Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Jul 3 21:02:25 2018 (r335910) +++ head/sys/conf/kmod.mk Tue Jul 3 21:15:47 2018 (r335911) @@ -467,6 +467,9 @@ CLEANFILES+= assym.inc DEPENDOBJS+= genassym.o DPSRCS+= offset.inc .endif +.if defined(MODULE_TIED) +DPSRCS+= offset.inc +.endif .if !empty(SRCS:Moffset.inc) || !empty(DPSRCS:Moffset.inc) CLEANFILES+= offset.inc genoffset.o DEPENDOBJS+= genoffset.o From owner-svn-src-head@freebsd.org Tue Jul 3 21:29:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB01102986B; Tue, 3 Jul 2018 21:29:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81A40717D8; Tue, 3 Jul 2018 21:29:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62C4A2199C; Tue, 3 Jul 2018 21:29:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63LT5k8012850; Tue, 3 Jul 2018 21:29:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63LT5rc012849; Tue, 3 Jul 2018 21:29:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807032129.w63LT5rc012849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 3 Jul 2018 21:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335912 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 21:29:06 -0000 Author: bdrewery Date: Tue Jul 3 21:29:04 2018 New Revision: 335912 URL: https://svnweb.freebsd.org/changeset/base/335912 Log: Fix .depend.foo.o tracking for sys/conf/files defined compilations. Some example files: ia32_genassym.o acpi_wakecode.o The old mkdep method also lacked tracking these files. Objects defined in sys/conf/files with no-obj and no-implicit-rule get their own targets defined in the kernel Makefile but lack having their objects added to DEPENDOBJS so never get a .depend file generated. Normally if an object is in OBJS it will get a .depend file. Fix this by looking for .o files in CLEAN and ensuring they are part of the -MD filtering and .depend loading. This is a hack. Other solutions could exist involving sys/conf/files or config(8) to auto add these to DEPENDFILES/DEPENDOBJS but this method seems reliable enough without being intrusive or error-prone for new files. Reported by: bde MFC after: 3 weeks Sponsored by: Dell EMC Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 21:15:47 2018 (r335911) +++ head/sys/conf/kern.post.mk Tue Jul 3 21:29:04 2018 (r335912) @@ -230,6 +230,7 @@ SRCS= assym.inc offset.inc vnode_if.h ${BEFORE_DEPEND} ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o genoffset.o genoffset_test.o +DEPENDOBJS+= ${CLEAN:M*.o} DEPENDFILES= ${DEPENDOBJS:O:u:C/^/.depend./} .if ${MAKE_VERSION} < 20160220 DEPEND_MP?= -MP From owner-svn-src-head@freebsd.org Tue Jul 3 22:03:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0D53102C950; Tue, 3 Jul 2018 22:03:29 +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 64202732B0; Tue, 3 Jul 2018 22:03:29 +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 4557B2200E; Tue, 3 Jul 2018 22:03:29 +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 w63M3TWc033075; Tue, 3 Jul 2018 22:03:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63M3T47033074; Tue, 3 Jul 2018 22:03:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201807032203.w63M3T47033074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 Jul 2018 22:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335913 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 335913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 22:03:29 -0000 Author: jhb Date: Tue Jul 3 22:03:28 2018 New Revision: 335913 URL: https://svnweb.freebsd.org/changeset/base/335913 Log: Use 'e' instead of 'i' constraints with 64-bit atomic operations on amd64. The ADD, AND, OR, and SUB instructions take at most a 32-bit sign-extended immediate operand. 64-bit constants that do not fit into that constraint need to be loaded into a register. The 'i' constraint tells the compiler it can pass any integer constant to the assembler, whereas the 'e' constrain only permits constants that fit into a 32-bit sign-extended value. This fixes using atomic_add/clear/set/subtract_long/64 with constants that do not fit into a 32-bit sign-extended immediate. Reported by: several folks Tested by: Pete Wright MFC after: 2 weeks Modified: head/sys/amd64/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Tue Jul 3 21:29:04 2018 (r335912) +++ head/sys/amd64/include/atomic.h Tue Jul 3 22:03:28 2018 (r335913) @@ -446,10 +446,10 @@ ATOMIC_ASM(clear, int, "andl %1,%0", "ir", ~v); ATOMIC_ASM(add, int, "addl %1,%0", "ir", v); ATOMIC_ASM(subtract, int, "subl %1,%0", "ir", v); -ATOMIC_ASM(set, long, "orq %1,%0", "ir", v); -ATOMIC_ASM(clear, long, "andq %1,%0", "ir", ~v); -ATOMIC_ASM(add, long, "addq %1,%0", "ir", v); -ATOMIC_ASM(subtract, long, "subq %1,%0", "ir", v); +ATOMIC_ASM(set, long, "orq %1,%0", "er", v); +ATOMIC_ASM(clear, long, "andq %1,%0", "er", ~v); +ATOMIC_ASM(add, long, "addq %1,%0", "er", v); +ATOMIC_ASM(subtract, long, "subq %1,%0", "er", v); #define ATOMIC_LOADSTORE(TYPE) \ ATOMIC_LOAD(TYPE); \ From owner-svn-src-head@freebsd.org Tue Jul 3 23:05:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22BB41032650; Tue, 3 Jul 2018 23:05:43 +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 C8932762EB; Tue, 3 Jul 2018 23:05:42 +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 A5194229CD; Tue, 3 Jul 2018 23:05:42 +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 w63N5gM8063294; Tue, 3 Jul 2018 23:05:42 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63N5guY063293; Tue, 3 Jul 2018 23:05:42 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807032305.w63N5guY063293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 23:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335916 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 23:05:43 -0000 Author: mmacy Date: Tue Jul 3 23:05:42 2018 New Revision: 335916 URL: https://svnweb.freebsd.org/changeset/base/335916 Log: Enable MODULE_TIED by default for modules compiled with the kernel Requested by: jhb Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 22:54:46 2018 (r335915) +++ head/sys/conf/kern.post.mk Tue Jul 3 23:05:42 2018 (r335916) @@ -14,6 +14,7 @@ MKMODULESENV+= DESTDIR="${DESTDIR}" .endif SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;:tA} MKMODULESENV+= KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}" +MKMODULESENV+= MODULE_TIED=yes .if defined(CONF_CFLAGS) MKMODULESENV+= CONF_CFLAGS="${CONF_CFLAGS}" From owner-svn-src-head@freebsd.org Tue Jul 3 23:09:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B50141032CC6; Tue, 3 Jul 2018 23:09:10 +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 5A4D276623; Tue, 3 Jul 2018 23:09:10 +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 3B48D229D1; Tue, 3 Jul 2018 23:09:10 +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 w63N9AQI063472; Tue, 3 Jul 2018 23:09:10 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63N9AdL063471; Tue, 3 Jul 2018 23:09:10 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807032309.w63N9AdL063471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 23:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335917 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 23:09:10 -0000 Author: mmacy Date: Tue Jul 3 23:09:09 2018 New Revision: 335917 URL: https://svnweb.freebsd.org/changeset/base/335917 Log: document MODULE_TIED behavior change Modified: head/share/man/man9/DECLARE_MODULE.9 Modified: head/share/man/man9/DECLARE_MODULE.9 ============================================================================== --- head/share/man/man9/DECLARE_MODULE.9 Tue Jul 3 23:05:42 2018 (r335916) +++ head/share/man/man9/DECLARE_MODULE.9 Tue Jul 3 23:09:09 2018 (r335917) @@ -65,6 +65,11 @@ is identical to that on which it was built. This declaration should be used by modules which depend on interfaces beyond the stable kernel KBI (such as ABI emulators or hypervisors that rely on internal kernel structures). +.Fn DECLARE_MODULE +will behave like +.Fn DECLARE_MODULE_TIED +when compiled with modules built with the kernel. This allows locks and +other synchronization primitives to be inlined safely. .Pp The arguments are: .Bl -tag -width indent From owner-svn-src-head@freebsd.org Tue Jul 3 23:30:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF7F41034A83; Tue, 3 Jul 2018 23:30:53 +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 9314D775D4; Tue, 3 Jul 2018 23:30:53 +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 7447722D3A; Tue, 3 Jul 2018 23:30:53 +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 w63NUrpD074116; Tue, 3 Jul 2018 23:30:53 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63NUr6P074115; Tue, 3 Jul 2018 23:30:53 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807032330.w63NUr6P074115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 23:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335919 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 335919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 23:30:54 -0000 Author: mmacy Date: Tue Jul 3 23:30:53 2018 New Revision: 335919 URL: https://svnweb.freebsd.org/changeset/base/335919 Log: udp6_input: validate inpcb before use When traversing pcbinfo lists (rather than calling lookup) we need to explicitly validate an inpcb before use. Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Jul 3 23:29:18 2018 (r335918) +++ head/sys/netinet6/udp6_usrreq.c Tue Jul 3 23:30:53 2018 (r335919) @@ -355,6 +355,10 @@ udp6_input(struct mbuf **mp, int *offp, int proto) int blocked; INP_RLOCK(inp); + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + INP_RUNLOCK(inp); + continue; + } bzero(&mcaddr, sizeof(struct sockaddr_in6)); mcaddr.sin6_len = sizeof(struct sockaddr_in6); @@ -382,10 +386,12 @@ udp6_input(struct mbuf **mp, int *offp, int proto) if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { INP_RLOCK(last); - UDP_PROBE(receive, NULL, last, ip6, - last, uh); - if (udp6_append(last, n, off, fromsa)) - goto inp_lost; + if (__predict_true(inp->inp_flags2 & INP_FREED) == 0) { + UDP_PROBE(receive, NULL, last, ip6, + last, uh); + if (udp6_append(last, n, off, fromsa)) + goto inp_lost; + } INP_RUNLOCK(last); } } @@ -414,10 +420,13 @@ udp6_input(struct mbuf **mp, int *offp, int proto) goto badheadlocked; } INP_RLOCK(last); - INP_INFO_RUNLOCK(pcbinfo); - UDP_PROBE(receive, NULL, last, ip6, last, uh); - if (udp6_append(last, m, off, fromsa) == 0) + if (__predict_true(inp->inp_flags2 & INP_FREED) == 0) { + UDP_PROBE(receive, NULL, last, ip6, last, uh); + if (udp6_append(last, m, off, fromsa) == 0) + INP_RUNLOCK(last); + } else INP_RUNLOCK(last); + INP_INFO_RUNLOCK(pcbinfo); inp_lost: return (IPPROTO_DONE); } From owner-svn-src-head@freebsd.org Tue Jul 3 23:45:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 415E81035F9B; Tue, 3 Jul 2018 23:45:03 +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 E264178193; Tue, 3 Jul 2018 23:45:02 +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 BCB632303C; Tue, 3 Jul 2018 23:45:02 +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 w63Nj2kp083976; Tue, 3 Jul 2018 23:45:02 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63Nj2x3083975; Tue, 3 Jul 2018 23:45:02 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807032345.w63Nj2x3083975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 3 Jul 2018 23:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335920 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/sys X-SVN-Commit-Revision: 335920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 23:45:03 -0000 Author: mmacy Date: Tue Jul 3 23:45:02 2018 New Revision: 335920 URL: https://svnweb.freebsd.org/changeset/base/335920 Log: opensolaris compat: fix compile error when opensolaris/sys/types.h is included before stddef.h ptrdiff_t would be typedef'd twice Modified: head/sys/cddl/compat/opensolaris/sys/types.h Modified: head/sys/cddl/compat/opensolaris/sys/types.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/types.h Tue Jul 3 23:30:53 2018 (r335919) +++ head/sys/cddl/compat/opensolaris/sys/types.h Tue Jul 3 23:45:02 2018 (r335920) @@ -72,7 +72,10 @@ typedef u_int minor_t; typedef short index_t; typedef off_t offset_t; -typedef long ptrdiff_t; /* pointer difference */ +#ifndef _PTRDIFF_T_DECLARED +typedef __ptrdiff_t ptrdiff_t; /* pointer difference */ +#define _PTRDIFF_T_DECLARED +#endif typedef int64_t rlim64_t; typedef int major_t; From owner-svn-src-head@freebsd.org Tue Jul 3 23:47:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C55481037436; Tue, 3 Jul 2018 23:47:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72F5378376; Tue, 3 Jul 2018 23:47:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 513C62303E; Tue, 3 Jul 2018 23:47:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w63NlNuS084118; Tue, 3 Jul 2018 23:47:23 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w63NlK01084107; Tue, 3 Jul 2018 23:47:20 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201807032347.w63NlK01084107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Tue, 3 Jul 2018 23:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335921 - in head: lib/libugidfw sbin/ipfw usr.bin/cpuset usr.bin/sockstat X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: in head: lib/libugidfw sbin/ipfw usr.bin/cpuset usr.bin/sockstat X-SVN-Commit-Revision: 335921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 23:47:24 -0000 Author: jamie Date: Tue Jul 3 23:47:20 2018 New Revision: 335921 URL: https://svnweb.freebsd.org/changeset/base/335921 Log: Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8), sockstat(1), ugidfw(8) These are the last of the jail-aware userland utilities that didn't work with names. PR: 229266 MFC after: 3 days Differential Revision: D16047 Modified: head/lib/libugidfw/ugidfw.c head/sbin/ipfw/Makefile head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/usr.bin/cpuset/Makefile head/usr.bin/cpuset/cpuset.1 head/usr.bin/cpuset/cpuset.c head/usr.bin/sockstat/Makefile head/usr.bin/sockstat/sockstat.1 head/usr.bin/sockstat/sockstat.c Modified: head/lib/libugidfw/ugidfw.c ============================================================================== --- head/lib/libugidfw/ugidfw.c Tue Jul 3 23:45:02 2018 (r335920) +++ head/lib/libugidfw/ugidfw.c Tue Jul 3 23:47:20 2018 (r335921) @@ -34,9 +34,11 @@ */ #include #include +#include #include #include #include +#include #include #include @@ -600,16 +602,45 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max } static int +bsde_get_jailid(const char *name, size_t buflen, char *errstr) +{ + char *ep; + int jid; + struct iovec jiov[4]; + + /* Copy jail_getid(3) instead of messing with library dependancies */ + jid = strtoul(name, &ep, 10); + if (*name && !*ep) + return jid; + jiov[0].iov_base = __DECONST(char *, "name"); + jiov[0].iov_len = sizeof("name"); + jiov[1].iov_len = strlen(name) + 1; + jiov[1].iov_base = alloca(jiov[1].iov_len); + strcpy(jiov[1].iov_base, name); + if (errstr && buflen) { + jiov[2].iov_base = __DECONST(char *, "errmsg"); + jiov[2].iov_len = sizeof("errmsg"); + jiov[3].iov_base = errstr; + jiov[3].iov_len = buflen; + errstr[0] = 0; + jid = jail_get(jiov, 4, 0); + if (jid < 0 && !errstr[0]) + snprintf(errstr, buflen, "jail_get: %s", + strerror(errno)); + } else + jid = jail_get(jiov, 2, 0); + return jid; +} + +static int bsde_parse_subject(int argc, char *argv[], struct mac_bsdextended_subject *subject, size_t buflen, char *errstr) { int not_seen, flags; int current, neg, nextnot; - char *endp; uid_t uid_min, uid_max; gid_t gid_min, gid_max; int jid = 0; - long value; current = 0; flags = 0; @@ -668,13 +699,9 @@ bsde_parse_subject(int argc, char *argv[], snprintf(errstr, buflen, "one jail only"); return (-1); } - value = strtol(argv[current+1], &endp, 10); - if (*endp != '\0') { - snprintf(errstr, buflen, "invalid jid: '%s'", - argv[current+1]); + jid = bsde_get_jailid(argv[current+1], buflen, errstr); + if (jid < 0) return (-1); - } - jid = value; flags |= MBS_PRISON_DEFINED; if (nextnot) { neg ^= MBS_PRISON_DEFINED; Modified: head/sbin/ipfw/Makefile ============================================================================== --- head/sbin/ipfw/Makefile Tue Jul 3 23:45:02 2018 (r335920) +++ head/sbin/ipfw/Makefile Tue Jul 3 23:47:20 2018 (r335921) @@ -13,7 +13,7 @@ SRCS+= altq.c CFLAGS+=-DPF .endif -LIBADD= util +LIBADD= jail util MAN= ipfw.8 .include Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Jul 3 23:45:02 2018 (r335920) +++ head/sbin/ipfw/ipfw.8 Tue Jul 3 23:47:20 2018 (r335921) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 28, 2018 +.Dd July 3, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -1535,10 +1535,10 @@ Matches all TCP or UDP packets sent by or received for A .Ar group may be specified by name or number. -.It Cm jail Ar prisonID +.It Cm jail Ar jail Matches all TCP or UDP packets sent by or received for the -jail whos prison ID is -.Ar prisonID . +jail whose ID or name is +.Ar jail . .It Cm icmptypes Ar types Matches ICMP packets whose ICMP type is in the list .Ar types . Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Jul 3 23:45:02 2018 (r335920) +++ head/sbin/ipfw/ipfw2.c Tue Jul 3 23:47:20 2018 (r335921) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -4581,13 +4582,12 @@ read_options: case TOK_JAIL: NEED1("jail requires argument"); { - char *end; int jid; cmd->opcode = O_JAIL; - jid = (int)strtol(*av, &end, 0); - if (jid < 0 || *end != '\0') - errx(EX_DATAERR, "jail requires prison ID"); + jid = jail_getid(*av); + if (jid < 0) + errx(EX_DATAERR, "%s", jail_errmsg); cmd32->d[0] = (uint32_t)jid; cmd->len |= F_INSN_SIZE(ipfw_insn_u32); av++; Modified: head/usr.bin/cpuset/Makefile ============================================================================== --- head/usr.bin/cpuset/Makefile Tue Jul 3 23:45:02 2018 (r335920) +++ head/usr.bin/cpuset/Makefile Tue Jul 3 23:47:20 2018 (r335921) @@ -2,4 +2,6 @@ PROG= cpuset +LIBADD= jail + .include Modified: head/usr.bin/cpuset/cpuset.1 ============================================================================== --- head/usr.bin/cpuset/cpuset.1 Tue Jul 3 23:45:02 2018 (r335920) +++ head/usr.bin/cpuset/cpuset.1 Tue Jul 3 23:47:20 2018 (r335921) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2018 +.Dd July 3, 2018 .Dt CPUSET 1 .Os .Sh NAME @@ -56,7 +56,7 @@ .Nm .Fl g .Op Fl cir -.Op Fl d Ar domain | Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq +.Op Fl d Ar domain | Fl j Ar jail | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq .Sh DESCRIPTION The .Nm @@ -68,7 +68,7 @@ available processors and memory domains in the system. .Nm requires a target to modify or query. The target may be specified as a command, process id, thread id, a -cpuset id, an irq, a jail id, or a NUMA domain. +cpuset id, an irq, a jail, or a NUMA domain. Using .Fl g the target's set id or mask may be queried. @@ -136,8 +136,8 @@ the id of the target. When used with the .Fl g option print the id rather than the valid mask of the target. -.It Fl j Ar jailid -Specifies a jail id as the target of the operation. +.It Fl j Ar jail +Specifies a jail id or name as the target of the operation. .It Fl l Ar cpu-list Specifies a list of CPUs to apply to a target. Specification may include Modified: head/usr.bin/cpuset/cpuset.c ============================================================================== --- head/usr.bin/cpuset/cpuset.c Tue Jul 3 23:45:02 2018 (r335920) +++ head/usr.bin/cpuset/cpuset.c Tue Jul 3 23:47:20 2018 (r335921) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -320,7 +321,9 @@ main(int argc, char *argv[]) case 'j': jflag = 1; which = CPU_WHICH_JAIL; - id = atoi(optarg); + id = jail_getid(optarg); + if (id < 0) + errx(EXIT_FAILURE, "%s", jail_errmsg); break; case 'l': lflag = 1; Modified: head/usr.bin/sockstat/Makefile ============================================================================== --- head/usr.bin/sockstat/Makefile Tue Jul 3 23:45:02 2018 (r335920) +++ head/usr.bin/sockstat/Makefile Tue Jul 3 23:47:20 2018 (r335921) @@ -2,4 +2,6 @@ PROG= sockstat +LIBADD= jail + .include Modified: head/usr.bin/sockstat/sockstat.1 ============================================================================== --- head/usr.bin/sockstat/sockstat.1 Tue Jul 3 23:45:02 2018 (r335920) +++ head/usr.bin/sockstat/sockstat.1 Tue Jul 3 23:47:20 2018 (r335921) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2018 +.Dd July 3, 2018 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -58,8 +58,8 @@ Show (IPv6) sockets. .It Fl c Show connected sockets. -.It Fl j Ar jid -Show only sockets belonging to the specified jail ID. +.It Fl j Ar jail +Show only sockets belonging to the specified jail ID or name. .It Fl L Only show Internet sockets if the local and foreign addresses are not in the loopback network prefix Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Tue Jul 3 23:45:02 2018 (r335920) +++ head/usr.bin/sockstat/sockstat.c Tue Jul 3 23:47:20 2018 (r335921) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1263,7 +1264,9 @@ main(int argc, char *argv[]) opt_c = 1; break; case 'j': - opt_j = atoi(optarg); + opt_j = jail_getid(optarg); + if (opt_j < 0) + errx(1, "%s", jail_errmsg); break; case 'L': opt_L = 1; From owner-svn-src-head@freebsd.org Wed Jul 4 00:18:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4381103A9F7; Wed, 4 Jul 2018 00:18:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95FAB79A36; Wed, 4 Jul 2018 00:18:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7318123553; Wed, 4 Jul 2018 00:18:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w640IbtE099516; Wed, 4 Jul 2018 00:18:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w640Ib7l099515; Wed, 4 Jul 2018 00:18:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807040018.w640Ib7l099515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 4 Jul 2018 00:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335922 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 00:18:38 -0000 Author: bdrewery Date: Wed Jul 4 00:18:36 2018 New Revision: 335922 URL: https://svnweb.freebsd.org/changeset/base/335922 Log: Use OBJS_DEPEND_GUESS for forced opt_global.h dependency. MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 23:47:20 2018 (r335921) +++ head/sys/conf/kern.post.mk Wed Jul 4 00:18:36 2018 (r335922) @@ -205,7 +205,8 @@ assym.inc: $S/kern/genassym.sh genassym.o genoffset_te genassym.o: $S/$M/$M/genassym.c offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c -${SYSTEM_OBJS} genoffset.o genassym.o vers.o: opt_global.h +OBJS_DEPEND_GUESS+= opt_global.h +genoffset.o genassym.o vers.o: opt_global.h .if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon) _meta_filemon= 1 Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Jul 3 23:47:20 2018 (r335921) +++ head/sys/conf/kmod.mk Wed Jul 4 00:18:36 2018 (r335922) @@ -476,9 +476,6 @@ DEPENDOBJS+= genoffset.o .endif assym.inc: genassym.o offset.inc: genoffset.o -.if defined(KERNBUILDDIR) -genassym.o: opt_global.h -.endif assym.inc: ${SYSDIR}/kern/genassym.sh sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET} genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c offset.inc @@ -492,16 +489,15 @@ genoffset.o: ${SRCS:Mopt_*.h} ${CC} -c ${CFLAGS:N-flto:N-fno-common} \ ${SYSDIR}/kern/genoffset.c -.if defined(KERNBUILDDIR) -${OBJS}: opt_global.h -.endif - CLEANDEPENDFILES+= ${_ILINKS} # .depend needs include links so we remove them only together. cleanilinks: rm -f ${_ILINKS} OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.if defined(KERNBUILDDIR) +OBJS_DEPEND_GUESS+= opt_global.h +.endif .include .include From owner-svn-src-head@freebsd.org Wed Jul 4 00:18:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 969D0103AA2F; Wed, 4 Jul 2018 00:18:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6207679A68; Wed, 4 Jul 2018 00:18:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BA7023554; Wed, 4 Jul 2018 00:18:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w640IeWm099564; Wed, 4 Jul 2018 00:18:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w640IeJE099563; Wed, 4 Jul 2018 00:18:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201807040018.w640IeJE099563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 4 Jul 2018 00:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335923 - head/sys/modules/aic7xxx/ahc X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/modules/aic7xxx/ahc X-SVN-Commit-Revision: 335923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 00:18:42 -0000 Author: bdrewery Date: Wed Jul 4 00:18:40 2018 New Revision: 335923 URL: https://svnweb.freebsd.org/changeset/base/335923 Log: META_MODE: Fix wanting a meta file in source tree. MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/sys/modules/aic7xxx/ahc/Makefile Modified: head/sys/modules/aic7xxx/ahc/Makefile ============================================================================== --- head/sys/modules/aic7xxx/ahc/Makefile Wed Jul 4 00:18:36 2018 (r335922) +++ head/sys/modules/aic7xxx/ahc/Makefile Wed Jul 4 00:18:40 2018 (r335923) @@ -37,7 +37,7 @@ ${GENSRCS}: \ # to appear when building the tree from 8.x worlds where fmake is the # default. fmake doens't define .MAKE.LEVEL so key off that to omit it, # while still allowing more-modern makes to theoretically update things. -${GENSRCS}: +${GENSRCS}: .NOMETA @echo "Error: ${.TARGET} is missing. Run 'make ahcfirmware'" .endif From owner-svn-src-head@freebsd.org Wed Jul 4 00:32:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C75C103BF44 for ; Wed, 4 Jul 2018 00:32:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C65827A72C for ; Wed, 4 Jul 2018 00:32:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id p185-v6so5681397itp.4 for ; Tue, 03 Jul 2018 17:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tKei4pHI+u0o0/BqQhStzwZgGDUiDa9rD6mN9kCrB2w=; b=u1wwkKIFTt88wX1VpcqDXQZQ1/ACE2/UR+m9auRiGkEBJfN50ZF2gVfsuKzNFeTErV eAUxrJjAuORqb9NRWAMRci+zKuhIsYAKNLyfE803ph4rSpbh0D0zGS2DobuMnJUxC3R6 aDF9viUNba86JioP9xnxgyMYnbkahVV4UHzVrF/pXWSZyy3AY/NLml9ZYH4/qi0mitgr gxB3LIeSnCS2kwVjAgyZdj2vKs+YbMTlUU0QTR4HdD3QiyHbpt8hvKSvXEFfN0DEn6ol MGiX9hWUk6dW4I2JUn5tB1lpHv26bP6+Mt27WmGDUJK+NRtKMEvI8TxLsU7/3twNm6dS R/Nw== 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=tKei4pHI+u0o0/BqQhStzwZgGDUiDa9rD6mN9kCrB2w=; b=a6KStHFAkCiZFJAKjZ0Ycp/qlHpWtitt5usaNSxdh9uPc6R+qYzLN/BQMeqNmAswY4 kDmIgKEItdxd27IGFiG/fNFOdfHzzlpK9Az+G+O8OYVmHi8ML/p/r1KNcD3R8oYF6xVK j2GwCOwl16tMzWTv5ZgwFrCq9hUEba4cGDrX25l+Jm77sE5ulRiNl8K4LGvSztUygjPK ex6WVJWVioCv7EaH38mEG75j55Sqa5+a7mUprvejpyLNmpViXOhuaniFHaSaKq25Qi1M UWI7nAo14ejF6JRyEY9lbnbeNo3ncSbQe9J8Hrqe4RdzbYb2c3kGP350vsqWDWILMf5i t1Fw== X-Gm-Message-State: APt69E1gt+oVatngmZ2R1xF4wkQkQW36yxQms/dpx40THpGj+htBcI+1 WANy34gWQxqtT1yR2x78SdgNXU+4mgNYUuV8olLlmA== X-Google-Smtp-Source: AAOMgpd/sqQVx9AKBBO0Jf2oiANpXPCaVYZ5FSG7I0XmhN94XAFpQAYL12OQKjCKC76NFcYIe52PHfC7V36ucw5FWuw= X-Received: by 2002:a24:d0d7:: with SMTP id m206-v6mr209232itg.1.1530664342836; Tue, 03 Jul 2018 17:32:22 -0700 (PDT) MIME-Version: 1.0 References: <201807032305.w63N5guY063293@repo.freebsd.org> In-Reply-To: <201807032305.w63N5guY063293@repo.freebsd.org> From: Warner Losh Date: Tue, 3 Jul 2018 18:32:11 -0600 Message-ID: Subject: Re: svn commit: r335916 - head/sys/conf To: Matt Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 00:32:24 -0000 And this is why I wanted it to conform to the current build paradigm in my review... I'll mop it up once Bryan is done... Warner On Tue, Jul 3, 2018, 6:05 PM Matt Macy wrote: > Author: mmacy > Date: Tue Jul 3 23:05:42 2018 > New Revision: 335916 > URL: https://svnweb.freebsd.org/changeset/base/335916 > > Log: > Enable MODULE_TIED by default for modules compiled with the kernel > > Requested by: jhb > > Modified: > head/sys/conf/kern.post.mk > > Modified: head/sys/conf/kern.post.mk > > ============================================================================== > --- head/sys/conf/kern.post.mk Tue Jul 3 22:54:46 2018 (r335915) > +++ head/sys/conf/kern.post.mk Tue Jul 3 23:05:42 2018 (r335916) > @@ -14,6 +14,7 @@ MKMODULESENV+= DESTDIR="${DESTDIR}" > .endif > SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;:tA} > MKMODULESENV+= KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}" > +MKMODULESENV+= MODULE_TIED=yes > > .if defined(CONF_CFLAGS) > MKMODULESENV+= CONF_CFLAGS="${CONF_CFLAGS}" > > From owner-svn-src-head@freebsd.org Wed Jul 4 01:44:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7609A1041444; Wed, 4 Jul 2018 01:44:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (mx-int.allbsd.org [IPv6:2001:2f0:104:e002::7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gatekeeper.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D434C7D1E3; Wed, 4 Jul 2018 01:44:46 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:c00:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id w641hfbJ090629 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) (Client CN "/OU=GT07882699/OU=See+20www.rapidssl.com/resources/cps+20+28c+2915/OU=Domain+20Control+20Validated+20-+20RapidSSL+28R+29/CN=*.allbsd.org", Issuer "/C=US/O=GeoTrust+20Inc./CN=RapidSSL+20SHA256+20CA+20-+20G3"); Wed, 4 Jul 2018 10:43:54 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:c00:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id w641ha9f057784 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 4 Jul 2018 10:43:36 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:0:0:0:0:0:0:0:1]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id w641hWcB057781; Wed, 4 Jul 2018 10:43:34 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 04 Jul 2018 10:42:52 +0900 (JST) Message-Id: <20180704.104252.1616889858955681927.hrs@allbsd.org> To: jilles@stack.nl Cc: daichigoto@icloud.com, lists@eitanadler.com, daichi@freebsd.org, gnn@FreeBSD.org, cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335836 - head/usr.bin/top From: Hiroki Sato In-Reply-To: <20180703211002.GA11832@stack.nl> References: <459BD898-8072-426E-A968-96C1382AC616@icloud.com> <20180703.020956.859981414196673670.hrs@allbsd.org> <20180703211002.GA11832@stack.nl> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jul__4_10_42_52_2018_164)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Wed, 04 Jul 2018 01:43:55 +0000 (UTC) X-Spam-Status: No, score=-94.9 required=13.0 tests=CONTENT_TYPE_PRESENT, QENCPTR1,RCVD_IN_AHBL,RCVD_IN_AHBL_PROXY,RCVD_IN_AHBL_SPAM,RDNS_NONE, SPF_SOFTFAIL,URIBL_SC2_SURBL,URIBL_XS_SURBL,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mx.allbsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 01:44:47 -0000 ----Security_Multipart(Wed_Jul__4_10_42_52_2018_164)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jilles Tjoelker wrote in <20180703211002.GA11832@stack.nl>: ji> > 3. Print the multibyte characters by using strvisx(3) family, which ji> > supports multibyte character, or swprintf(3) family if you want to ji> > format wide characters directly. Note that buffer length for ji> > strvisx(3) must be calculated by using MB_LEN_MAX. ji> ji> In this case, calling setlocale() and then using strvisx() seems the ji> right solution. If locales differ across processes this may result in ji> mojibake but that cannot really be helped. Even analyzing other ji> processes' locale variables is not fully reliable, since strings may be ji> incorrectly encoded even in the process's real locale, environment ji> variables cannot be read across users and the environment block may be ji> overwritten by a program. ji> ji> In general, although using conversion to wide characters allows users a ji> lot of flexibility, I don't think it is the best in all situations: ji> ji> * The result of mbstowcs() is a UTF-32 string which consumes a lot of ji> memory. A loop with mbrtowc() may also be slow. Many operations can be ji> done directly on UTF-8 strings with no or little additional complexity ji> compared to byte strings. ji> ji> * If there is an invalid multibyte character, there is little ji> flexibility to handle this usefully and securely, since so little is ji> known about the encoding. The best handling may depend on the context. ji> ji> Therefore, in /bin/sh, I have only implemented multibyte support for ji> UTF-8. All other encodings have bytes treated as characters. ji> ji> However, I do agree that getenv("LANG") is bad. Instead, setlocale() ji> should be used. After that, nl_langinfo(CODESET) can be called and the ji> result compared to "UTF-8". Yes, I agree that using mb->wc conversion is not always the best and using strvisx() for cmdbuf, not only for argv, is enough in this case. I thought it was difficult to avoid iswprint() because I was not sure of the goal of r335836 and it looked to me that it aimed to keep the original printable() function. And as you mentioned it may not be worth to try to correctly detect/support locales in different processes, either. Probably one of the simplest ways would be that relying on LC_CTYPE+strvisx() and documenting how top(1) handles multibyte characters in the manual page. -- Hiroki ----Security_Multipart(Wed_Jul__4_10_42_52_2018_164)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAls8JhwACgkQTyzT2CeTzy1IeQCaAodTCzM9gOB5rqO81+Gy24Q1 O60AnRmFR2/cYK0ov6a3d5Tma6vk/zff =MhXt -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jul__4_10_42_52_2018_164)---- From owner-svn-src-head@freebsd.org Wed Jul 4 02:14:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F08210166E1; Wed, 4 Jul 2018 02:14:59 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4D2417E2EE; Wed, 4 Jul 2018 02:14:59 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 10AE31925E; Wed, 4 Jul 2018 02:14:59 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f51.google.com with SMTP id o5-v6so5806530itc.1; Tue, 03 Jul 2018 19:14:59 -0700 (PDT) X-Gm-Message-State: APt69E07KyFbaoGAWz9dYqb4SUsmEbzyWyoEMIa07za6Z4UDLPwgz8/7 kt98K1zmM8HZppvFB1XsH7zNUquDA/BYnIqKOeA= X-Google-Smtp-Source: AAOMgpdT/gW7QnjN9sjQ4gwRqtnMf6ciYqs/pkndYQPL5zT+Pwtu93SARF91Q/NZ2W+vO1/8oYGUCC+MYkZy8B+34Gw= X-Received: by 2002:a24:8ac1:: with SMTP id v184-v6mr382033itd.7.1530670498550; Tue, 03 Jul 2018 19:14:58 -0700 (PDT) MIME-Version: 1.0 References: <201807032305.w63N5guY063293@repo.freebsd.org> In-Reply-To: From: Matthew Macy Date: Tue, 3 Jul 2018 19:14:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335916 - head/sys/conf To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 02:14:59 -0000 I didn't want it to be global. Note that I did _exactly_ what John told me to. I don't believe the tone or word choice is justified. -M On Tue, Jul 3, 2018 at 17:32 Warner Losh wrote: > And this is why I wanted it to conform to the current build paradigm in my > review... I'll mop it up once Bryan is done... > > Warner > > On Tue, Jul 3, 2018, 6:05 PM Matt Macy wrote: > >> Author: mmacy >> Date: Tue Jul 3 23:05:42 2018 >> New Revision: 335916 >> URL: https://svnweb.freebsd.org/changeset/base/335916 >> >> Log: >> Enable MODULE_TIED by default for modules compiled with the kernel >> >> Requested by: jhb >> >> Modified: >> head/sys/conf/kern.post.mk >> >> Modified: head/sys/conf/kern.post.mk >> >> ============================================================================== >> --- head/sys/conf/kern.post.mk Tue Jul 3 22:54:46 2018 (r335915) >> +++ head/sys/conf/kern.post.mk Tue Jul 3 23:05:42 2018 (r335916) >> @@ -14,6 +14,7 @@ MKMODULESENV+= DESTDIR="${DESTDIR}" >> .endif >> SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;:tA} >> MKMODULESENV+= KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}" >> +MKMODULESENV+= MODULE_TIED=yes >> >> .if defined(CONF_CFLAGS) >> MKMODULESENV+= CONF_CFLAGS="${CONF_CFLAGS}" >> >> From owner-svn-src-head@freebsd.org Wed Jul 4 02:47:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98D5C10232C0; Wed, 4 Jul 2018 02:47:19 +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 452007FA66; Wed, 4 Jul 2018 02:47:19 +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 0B49A24DAE; Wed, 4 Jul 2018 02:47:19 +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 w642lJKZ075662; Wed, 4 Jul 2018 02:47:19 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w642lGfs075649; Wed, 4 Jul 2018 02:47:16 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807040247.w642lGfs075649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 4 Jul 2018 02:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335924 - in head/sys: dev/cxgbe/cxgbei dev/cxgbe/tom dev/hwpmc kern net netinet netinet/tcp_stacks netinet6 sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: dev/cxgbe/cxgbei dev/cxgbe/tom dev/hwpmc kern net netinet netinet/tcp_stacks netinet6 sys X-SVN-Commit-Revision: 335924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 02:47:20 -0000 Author: mmacy Date: Wed Jul 4 02:47:16 2018 New Revision: 335924 URL: https://svnweb.freebsd.org/changeset/base/335924 Log: epoch(9): allow preemptible epochs to compose - Add tracker argument to preemptible epochs - Inline epoch read path in kernel and tied modules - Change in_epoch to take an epoch as argument - Simplify tfb_tcp_do_segment to not take a ti_locked argument, there's no longer any benefit to dropping the pcbinfo lock and trying to do so just adds an error prone branchfest to these functions - Remove cases of same function recursion on the epoch as recursing is no longer free. - Remove the the TAILQ_ENTRY and epoch_section from struct thread as the tracker field is now stack or heap allocated as appropriate. Tested by: pho and Limelight Networks Reviewed by: kbowling at llnw dot com Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D16066 Added: head/sys/sys/epoch_private.h (contents, props changed) Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/subr_epoch.c head/sys/net/if.c head/sys/net/if_gif.h head/sys/net/if_gre.h head/sys/net/if_lagg.c head/sys/net/if_me.c head/sys/net/if_var.h head/sys/net/route.c head/sys/net/rtsock.c head/sys/netinet/in_gif.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_divert.c head/sys/netinet/ip_encap.c head/sys/netinet/ip_gre.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_hpts.c head/sys/netinet/tcp_hpts.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/tcp_rack.h head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/netinet/udp_usrreq.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_gif.c head/sys/netinet6/ip6_gre.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c head/sys/sys/epoch.h head/sys/sys/pmckern.h head/sys/sys/proc.h Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Wed Jul 4 02:47:16 2018 (r335924) @@ -343,6 +343,7 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_he struct icl_cxgbei_pdu *icp = toep->ulpcb2; struct icl_pdu *ip; u_int pdu_len, val; + struct epoch_tracker et; MPASS(m == NULL); @@ -411,12 +412,12 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_he SOCKBUF_UNLOCK(sb); INP_WUNLOCK(inp); - INP_INFO_RLOCK(&V_tcbinfo); + INP_INFO_RLOCK_ET(&V_tcbinfo, et); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); icl_cxgbei_conn_pdu_free(NULL, ip); #ifdef INVARIANTS Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/dev/cxgbe/tom/t4_connect.c Wed Jul 4 02:47:16 2018 (r335924) @@ -115,18 +115,19 @@ act_open_failure_cleanup(struct adapter *sc, u_int ati struct toepcb *toep = lookup_atid(sc, atid); struct inpcb *inp = toep->inp; struct toedev *tod = &toep->td->tod; + struct epoch_tracker et; free_atid(sc, atid); toep->tid = -1; CURVNET_SET(toep->vnet); if (status != EAGAIN) - INP_INFO_RLOCK(&V_tcbinfo); + INP_INFO_RLOCK_ET(&V_tcbinfo, et); INP_WLOCK(inp); toe_connect_failed(tod, inp, status); final_cpl_received(toep); /* unlocks inp */ if (status != EAGAIN) - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jul 4 02:47:16 2018 (r335924) @@ -1235,6 +1235,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head struct inpcb *inp = toep->inp; struct tcpcb *tp = NULL; struct socket *so; + struct epoch_tracker et; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1268,7 +1269,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); CURVNET_SET(toep->vnet); - INP_INFO_RLOCK(&V_tcbinfo); + INP_INFO_RLOCK_ET(&V_tcbinfo, et); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1312,7 +1313,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head case TCPS_FIN_WAIT_2: tcp_twstart(tp); INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); INP_WLOCK(inp); @@ -1325,7 +1326,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head } done: INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); return (0); } @@ -1344,6 +1345,7 @@ do_close_con_rpl(struct sge_iq *iq, const struct rss_h struct inpcb *inp = toep->inp; struct tcpcb *tp = NULL; struct socket *so = NULL; + struct epoch_tracker et; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1354,7 +1356,7 @@ do_close_con_rpl(struct sge_iq *iq, const struct rss_h KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); CURVNET_SET(toep->vnet); - INP_INFO_RLOCK(&V_tcbinfo); + INP_INFO_RLOCK_ET(&V_tcbinfo, et); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1372,7 +1374,7 @@ do_close_con_rpl(struct sge_iq *iq, const struct rss_h tcp_twstart(tp); release: INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); INP_WLOCK(inp); @@ -1397,7 +1399,7 @@ release: } done: INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); return (0); } @@ -1452,6 +1454,7 @@ do_abort_req(struct sge_iq *iq, const struct rss_heade struct sge_wrq *ofld_txq = toep->ofld_txq; struct inpcb *inp; struct tcpcb *tp; + struct epoch_tracker et; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1473,7 +1476,7 @@ do_abort_req(struct sge_iq *iq, const struct rss_heade inp = toep->inp; CURVNET_SET(toep->vnet); - INP_INFO_RLOCK(&V_tcbinfo); /* for tcp_close */ + INP_INFO_RLOCK_ET(&V_tcbinfo, et); /* for tcp_close */ INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1507,7 +1510,7 @@ do_abort_req(struct sge_iq *iq, const struct rss_heade final_cpl_received(toep); done: - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); send_abort_rpl(sc, ofld_txq, tid, CPL_ABORT_NO_RST); return (0); @@ -1560,6 +1563,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header struct tcpcb *tp; struct socket *so; struct sockbuf *sb; + struct epoch_tracker et; int len; uint32_t ddp_placed = 0; @@ -1631,12 +1635,12 @@ do_rx_data(struct sge_iq *iq, const struct rss_header INP_WUNLOCK(inp); CURVNET_SET(toep->vnet); - INP_INFO_RLOCK(&V_tcbinfo); + INP_INFO_RLOCK_ET(&V_tcbinfo, et); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); return (0); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Jul 4 02:47:16 2018 (r335924) @@ -1255,6 +1255,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss int reject_reason, v, ntids; uint16_t vid; u_int wnd; + struct epoch_tracker et; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1369,15 +1370,15 @@ found: REJECT_PASS_ACCEPT(); rpl = wrtod(wr); - INP_INFO_RLOCK(&V_tcbinfo); /* for 4-tuple check */ + INP_INFO_RLOCK_ET(&V_tcbinfo, et); /* for 4-tuple check */ /* Don't offload if the 4-tuple is already in use */ if (toe_4tuple_check(&inc, &th, ifp) != 0) { - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); free(wr, M_CXGBE); REJECT_PASS_ACCEPT(); } - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); inp = lctx->inp; /* listening socket, not owned by TOE */ INP_WLOCK(inp); @@ -1574,6 +1575,7 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ struct tcpopt to; struct in_conninfo inc; struct toepcb *toep; + struct epoch_tracker et; u_int txqid, rxqid; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); @@ -1587,7 +1589,7 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); CURVNET_SET(lctx->vnet); - INP_INFO_RLOCK(&V_tcbinfo); /* for syncache_expand */ + INP_INFO_RLOCK_ET(&V_tcbinfo, et); /* for syncache_expand */ INP_WLOCK(inp); CTR6(KTR_CXGBE, @@ -1603,7 +1605,7 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ } INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); return (0); } @@ -1629,7 +1631,7 @@ reset: */ send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); return (0); } @@ -1695,7 +1697,7 @@ reset: inp = release_lctx(sc, lctx); if (inp != NULL) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); release_synqe(synqe); Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/dev/cxgbe/tom/t4_tls.c Wed Jul 4 02:47:16 2018 (r335924) @@ -1559,6 +1559,8 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head SOCKBUF_LOCK(sb); if (__predict_false(sb->sb_state & SBS_CANTRCVMORE)) { + struct epoch_tracker et; + CTR3(KTR_CXGBE, "%s: tid %u, excess rx (%d bytes)", __func__, tid, pdu_length); m_freem(m); @@ -1566,12 +1568,12 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head INP_WUNLOCK(inp); CURVNET_SET(toep->vnet); - INP_INFO_RLOCK(&V_tcbinfo); + INP_INFO_RLOCK_ET(&V_tcbinfo, et); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); return (0); Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/dev/hwpmc/hwpmc_mod.c Wed Jul 4 02:47:16 2018 (r335924) @@ -85,6 +85,9 @@ __FBSDID("$FreeBSD$"); #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) + /* * Types */ @@ -1752,12 +1755,12 @@ pmc_process_mmap(struct thread *td, struct pmckern_map const struct pmc_process *pp; freepath = fullpath = NULL; - MPASS(!in_epoch()); + MPASS(!in_epoch(global_epoch_preempt)); pmc_getfilename((struct vnode *) pkm->pm_file, &fullpath, &freepath); pid = td->td_proc->p_pid; - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); /* Inform owners of all system-wide sampling PMCs. */ CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) @@ -1778,7 +1781,7 @@ pmc_process_mmap(struct thread *td, struct pmckern_map done: if (freepath) free(freepath, M_TEMP); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); } @@ -1797,12 +1800,12 @@ pmc_process_munmap(struct thread *td, struct pmckern_m pid = td->td_proc->p_pid; - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_out(po, pid, pkm->pm_address, pkm->pm_address + pkm->pm_size); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); if ((pp = pmc_find_process_descriptor(td->td_proc, 0)) == NULL) return; @@ -1824,7 +1827,7 @@ pmc_log_kernel_mappings(struct pmc *pm) struct pmc_owner *po; struct pmckern_map_in *km, *kmbase; - MPASS(in_epoch() || sx_xlocked(&pmc_sx)); + MPASS(in_epoch(global_epoch_preempt) || sx_xlocked(&pmc_sx)); KASSERT(PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)), ("[pmc,%d] non-sampling PMC (%p) desires mapping information", __LINE__, (void *) pm)); @@ -2106,13 +2109,13 @@ pmc_hook_handler(struct thread *td, int function, void pk = (struct pmckern_procexec *) arg; - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); /* Inform owners of SS mode PMCs of the exec event. */ CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_procexec(po, PMC_ID_INVALID, p->p_pid, pk->pm_entryaddr, fullpath); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); PROC_LOCK(p); is_using_hwpmcs = p->p_flag & P_HWPMC; @@ -2242,7 +2245,7 @@ pmc_hook_handler(struct thread *td, int function, void break; case PMC_FN_MUNMAP: - MPASS(in_epoch() || sx_xlocked(&pmc_sx)); + MPASS(in_epoch(global_epoch_preempt) || sx_xlocked(&pmc_sx)); pmc_process_munmap(td, (struct pmckern_map_out *) arg); break; @@ -2479,7 +2482,7 @@ pmc_find_thread_descriptor(struct pmc_process *pp, str if (mode & PMC_FLAG_ALLOCATE) { if ((ptnew = pmc_thread_descriptor_pool_alloc()) == NULL) { wait_flag = M_WAITOK; - if ((mode & PMC_FLAG_NOWAIT) || in_epoch()) + if ((mode & PMC_FLAG_NOWAIT) || in_epoch(global_epoch_preempt)) wait_flag = M_NOWAIT; ptnew = malloc(THREADENTRY_SIZE, M_PMC, @@ -5070,11 +5073,11 @@ pmc_process_exit(void *arg __unused, struct proc *p) /* * Log a sysexit event to all SS PMC owners. */ - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_sysexit(po, p->p_pid); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); if (!is_using_hwpmcs) return; @@ -5255,13 +5258,13 @@ pmc_process_fork(void *arg __unused, struct proc *p1, * If there are system-wide sampling PMCs active, we need to * log all fork events to their owner's logs. */ - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) { pmclog_process_procfork(po, p1->p_pid, newproc->p_pid); pmclog_process_proccreate(po, newproc, 1); } - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); if (!is_using_hwpmcs) return; @@ -5327,11 +5330,11 @@ pmc_process_threadcreate(struct thread *td) { struct pmc_owner *po; - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_threadcreate(po, td, 1); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); } static void @@ -5339,11 +5342,11 @@ pmc_process_threadexit(struct thread *td) { struct pmc_owner *po; - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_threadexit(po, td); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); } static void @@ -5351,11 +5354,11 @@ pmc_process_proccreate(struct proc *p) { struct pmc_owner *po; - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_proccreate(po, p, 1 /* sync */); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); } static void @@ -5388,12 +5391,12 @@ pmc_kld_load(void *arg __unused, linker_file_t lf) /* * Notify owners of system sampling PMCs about KLD operations. */ - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_in(po, (pid_t) -1, (uintfptr_t) lf->address, lf->filename); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); /* * TODO: Notify owners of (all) process-sampling PMCs too. @@ -5406,12 +5409,12 @@ pmc_kld_unload(void *arg __unused, const char *filenam { struct pmc_owner *po; - epoch_enter_preempt(global_epoch_preempt); + PMC_EPOCH_ENTER(); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_out(po, (pid_t) -1, (uintfptr_t) address, (uintfptr_t) address + size); - epoch_exit_preempt(global_epoch_preempt); + PMC_EPOCH_EXIT(); /* * TODO: Notify owners of process-sampling PMCs. Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/kern/subr_epoch.c Wed Jul 4 02:47:16 2018 (r335924) @@ -58,18 +58,10 @@ static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based re #define MAX_ADAPTIVE_SPIN 1000 #define MAX_EPOCHS 64 -#ifdef __amd64__ -#define EPOCH_ALIGN CACHE_LINE_SIZE*2 -#else -#define EPOCH_ALIGN CACHE_LINE_SIZE -#endif - -CTASSERT(sizeof(epoch_section_t) == sizeof(ck_epoch_section_t)); CTASSERT(sizeof(ck_epoch_entry_t) == sizeof(struct epoch_context)); SYSCTL_NODE(_kern, OID_AUTO, epoch, CTLFLAG_RW, 0, "epoch information"); SYSCTL_NODE(_kern_epoch, OID_AUTO, stats, CTLFLAG_RW, 0, "epoch stats"); - /* Stats. */ static counter_u64_t block_count; @@ -100,27 +92,9 @@ TAILQ_HEAD (threadlist, thread); CK_STACK_CONTAINER(struct ck_epoch_entry, stack_entry, ck_epoch_entry_container) -typedef struct epoch_record { - ck_epoch_record_t er_record; - volatile struct threadlist er_tdlist; - volatile uint32_t er_gen; - uint32_t er_cpuid; -} *epoch_record_t; -struct epoch_pcpu_state { - struct epoch_record eps_record; -} __aligned(EPOCH_ALIGN); + epoch_t allepochs[MAX_EPOCHS]; -struct epoch { - struct ck_epoch e_epoch __aligned(EPOCH_ALIGN); - struct epoch_pcpu_state *e_pcpu_dom[MAXMEMDOM] __aligned(EPOCH_ALIGN); - int e_idx; - int e_flags; - struct epoch_pcpu_state *e_pcpu[0]; -}; - -epoch_t allepochs[MAX_EPOCHS]; - DPCPU_DEFINE(struct grouptask, epoch_cb_task); DPCPU_DEFINE(int, epoch_cb_count); @@ -192,17 +166,15 @@ static void epoch_init_numa(epoch_t epoch) { int domain, cpu_offset; - struct epoch_pcpu_state *eps; epoch_record_t er; for (domain = 0; domain < vm_ndomains; domain++) { - eps = malloc_domain(sizeof(*eps) * domcount[domain], M_EPOCH, + er = malloc_domain(sizeof(*er) * domcount[domain], M_EPOCH, domain, M_ZERO | M_WAITOK); - epoch->e_pcpu_dom[domain] = eps; + epoch->e_pcpu_dom[domain] = er; cpu_offset = domoffsets[domain]; - for (int i = 0; i < domcount[domain]; i++, eps++) { - epoch->e_pcpu[cpu_offset + i] = eps; - er = &eps->eps_record; + for (int i = 0; i < domcount[domain]; i++, er++) { + epoch->e_pcpu[cpu_offset + i] = er; ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); er->er_cpuid = cpu_offset + i; @@ -213,14 +185,12 @@ epoch_init_numa(epoch_t epoch) static void epoch_init_legacy(epoch_t epoch) { - struct epoch_pcpu_state *eps; epoch_record_t er; - eps = malloc(sizeof(*eps) * mp_ncpus, M_EPOCH, M_ZERO | M_WAITOK); - epoch->e_pcpu_dom[0] = eps; - for (int i = 0; i < mp_ncpus; i++, eps++) { - epoch->e_pcpu[i] = eps; - er = &eps->eps_record; + er = malloc(sizeof(*er) * mp_ncpus, M_EPOCH, M_ZERO | M_WAITOK); + epoch->e_pcpu_dom[0] = er; + for (int i = 0; i < mp_ncpus; i++, er++) { + epoch->e_pcpu[i] = er; ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); er->er_cpuid = i; @@ -253,12 +223,12 @@ epoch_free(epoch_t epoch) { int domain; #ifdef INVARIANTS - struct epoch_pcpu_state *eps; + struct epoch_record *er; int cpu; CPU_FOREACH(cpu) { - eps = epoch->e_pcpu[cpu]; - MPASS(TAILQ_EMPTY(&eps->eps_record.er_tdlist)); + er = epoch->e_pcpu[cpu]; + MPASS(TAILQ_EMPTY(&er->er_tdlist)); } #endif allepochs[epoch->e_idx] = NULL; @@ -271,95 +241,32 @@ epoch_free(epoch_t epoch) free(epoch, M_EPOCH); } -#define INIT_CHECK(epoch) \ - do { \ - if (__predict_false((epoch) == NULL)) \ - return; \ - } while (0) - void -epoch_enter_preempt_internal(epoch_t epoch, struct thread *td) +epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et) { - struct epoch_pcpu_state *eps; - MPASS(cold || epoch != NULL); - INIT_CHECK(epoch); - MPASS(epoch->e_flags & EPOCH_PREEMPT); - critical_enter(); - td->td_pre_epoch_prio = td->td_priority; - eps = epoch->e_pcpu[curcpu]; -#ifdef INVARIANTS - MPASS(td->td_epochnest < UCHAR_MAX - 2); - if (td->td_epochnest > 1) { - struct thread *curtd; - int found = 0; - - TAILQ_FOREACH(curtd, &eps->eps_record.er_tdlist, td_epochq) - if (curtd == td) - found = 1; - KASSERT(found, ("recursing on a second epoch")); - critical_exit(); - return; - } -#endif - TAILQ_INSERT_TAIL(&eps->eps_record.er_tdlist, td, td_epochq); - sched_pin(); - ck_epoch_begin(&eps->eps_record.er_record, (ck_epoch_section_t *)&td->td_epoch_section); - critical_exit(); + epoch_enter_preempt(epoch, et); } - void -epoch_enter(epoch_t epoch) +epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et) { - ck_epoch_record_t *record; - struct thread *td; - MPASS(cold || epoch != NULL); - INIT_CHECK(epoch); - td = curthread; - - critical_enter(); - td->td_epochnest++; - record = &epoch->e_pcpu[curcpu]->eps_record.er_record; - ck_epoch_begin(record, NULL); + epoch_exit_preempt(epoch, et); } void -epoch_exit_preempt_internal(epoch_t epoch, struct thread *td) +epoch_enter_KBI(epoch_t epoch) { - struct epoch_pcpu_state *eps; - MPASS(td->td_epochnest == 0); - INIT_CHECK(epoch); - critical_enter(); - eps = epoch->e_pcpu[curcpu]; - - MPASS(epoch->e_flags & EPOCH_PREEMPT); - ck_epoch_end(&eps->eps_record.er_record, (ck_epoch_section_t *)&td->td_epoch_section); - TAILQ_REMOVE(&eps->eps_record.er_tdlist, td, td_epochq); - eps->eps_record.er_gen++; - sched_unpin(); - if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) { - thread_lock(td); - sched_prio(td, td->td_pre_epoch_prio); - thread_unlock(td); - } - critical_exit(); + epoch_enter(epoch); } void -epoch_exit(epoch_t epoch) +epoch_exit_KBI(epoch_t epoch) { - ck_epoch_record_t *record; - struct thread *td; - INIT_CHECK(epoch); - td = curthread; - td->td_epochnest--; - record = &epoch->e_pcpu[curcpu]->eps_record.er_record; - ck_epoch_end(record, NULL); - critical_exit(); + epoch_exit(epoch); } /* @@ -371,7 +278,8 @@ epoch_block_handler_preempt(struct ck_epoch *global __ void *arg __unused) { epoch_record_t record; - struct thread *td, *tdwait, *owner; + struct thread *td, *owner, *curwaittd; + struct epoch_thread *tdwait; struct turnstile *ts; struct lock_object *lock; int spincount, gen; @@ -389,13 +297,13 @@ epoch_block_handler_preempt(struct ck_epoch *global __ * overhead of a migration */ if ((tdwait = TAILQ_FIRST(&record->er_tdlist)) != NULL && - TD_IS_RUNNING(tdwait)) { + TD_IS_RUNNING(tdwait->et_td)) { gen = record->er_gen; thread_unlock(td); do { cpu_spinwait(); } while (tdwait == TAILQ_FIRST(&record->er_tdlist) && - gen == record->er_gen && TD_IS_RUNNING(tdwait) && + gen == record->er_gen && TD_IS_RUNNING(tdwait->et_td) && spincount++ < MAX_ADAPTIVE_SPIN); thread_lock(td); return; @@ -426,28 +334,29 @@ epoch_block_handler_preempt(struct ck_epoch *global __ * priority thread (highest prio value) and drop our priority * to match to allow it to run. */ - TAILQ_FOREACH(tdwait, &record->er_tdlist, td_epochq) { + TAILQ_FOREACH(tdwait, &record->er_tdlist, et_link) { /* * Propagate our priority to any other waiters to prevent us * from starving them. They will have their original priority * restore on exit from epoch_wait(). */ - if (!TD_IS_INHIBITED(tdwait) && tdwait->td_priority > td->td_priority) { + curwaittd = tdwait->et_td; + if (!TD_IS_INHIBITED(curwaittd) && curwaittd->td_priority > td->td_priority) { critical_enter(); thread_unlock(td); - thread_lock(tdwait); - sched_prio(tdwait, td->td_priority); - thread_unlock(tdwait); + thread_lock(curwaittd); + sched_prio(curwaittd, td->td_priority); + thread_unlock(curwaittd); thread_lock(td); critical_exit(); } - if (TD_IS_INHIBITED(tdwait) && TD_ON_LOCK(tdwait) && - ((ts = tdwait->td_blocked) != NULL)) { + 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 tdwait + * by dropping the thread lock in order to prevent curwaittd * from getting to run. */ critical_enter(); @@ -456,15 +365,15 @@ epoch_block_handler_preempt(struct ck_epoch *global __ /* * 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 tdwait is blocked on can we continue. Otherwise + * 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 tdwait, + * us, as in the case where the lock holder has signalled curwaittd, * and we need to continue. */ - if (owner != NULL && ts == tdwait->td_blocked) { - MPASS(TD_IS_INHIBITED(tdwait) && TD_ON_LOCK(tdwait)); + if (owner != NULL && ts == curwaittd->td_blocked) { + MPASS(TD_IS_INHIBITED(curwaittd) && TD_ON_LOCK(curwaittd)); critical_exit(); - turnstile_wait(ts, owner, tdwait->td_tsqueue); + turnstile_wait(ts, owner, curwaittd->td_tsqueue); counter_u64_add(turnstile_count, 1); thread_lock(td); return; @@ -569,7 +478,7 @@ epoch_wait(epoch_t epoch) void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)) { - struct epoch_pcpu_state *eps; + epoch_record_t er; ck_epoch_entry_t *cb; cb = (void *)ctx; @@ -585,8 +494,8 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* critical_enter(); *DPCPU_PTR(epoch_cb_count) += 1; - eps = epoch->e_pcpu[curcpu]; - ck_epoch_call(&eps->eps_record.er_record, cb, (ck_epoch_cb_t *)callback); + er = epoch->e_pcpu[curcpu]; + ck_epoch_call(&er->er_record, cb, (ck_epoch_cb_t *)callback); critical_exit(); return; boottime: @@ -608,7 +517,7 @@ epoch_call_task(void *arg __unused) for (total = i = 0; i < epoch_count; i++) { if (__predict_false((epoch = allepochs[i]) == NULL)) continue; - record = &epoch->e_pcpu[curcpu]->eps_record.er_record; + record = &epoch->e_pcpu[curcpu]->er_record; if ((npending = record->n_pending) == 0) continue; ck_epoch_poll_deferred(record, &cb_stack); @@ -632,7 +541,47 @@ epoch_call_task(void *arg __unused) } int -in_epoch(void) +in_epoch_verbose(epoch_t epoch, int dump_onfail) { - return (curthread->td_epochnest != 0); + struct epoch_thread *tdwait; + struct thread *td; + epoch_record_t er; + + td = curthread; + if (td->td_epochnest == 0) + return (0); + if (__predict_false((epoch) == NULL)) + return (0); + critical_enter(); + er = epoch->e_pcpu[curcpu]; + TAILQ_FOREACH(tdwait, &er->er_tdlist, et_link) + if (tdwait->et_td == td) { + critical_exit(); + return (1); + } +#ifdef INVARIANTS + if (dump_onfail) { + MPASS(td->td_pinned); + printf("cpu: %d id: %d\n", curcpu, td->td_tid); + TAILQ_FOREACH(tdwait, &er->er_tdlist, et_link) + printf("td_tid: %d ", tdwait->et_td->td_tid); + printf("\n"); + } +#endif + critical_exit(); + return (0); +} + +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/net/if.c ============================================================================== --- head/sys/net/if.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/net/if.c Wed Jul 4 02:47:16 2018 (r335924) @@ -1760,29 +1760,35 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd) void if_addr_rlock(struct ifnet *ifp) { - - IF_ADDR_RLOCK(ifp); + MPASS(*(uint64_t *)&ifp->if_addr_et == 0); + epoch_enter_preempt(net_epoch_preempt, &ifp->if_addr_et); } void if_addr_runlock(struct ifnet *ifp) { - - IF_ADDR_RUNLOCK(ifp); + epoch_exit_preempt(net_epoch_preempt, &ifp->if_addr_et); +#ifdef INVARIANTS + bzero(&ifp->if_addr_et, sizeof(struct epoch_tracker)); +#endif } void if_maddr_rlock(if_t ifp) { - IF_ADDR_RLOCK((struct ifnet *)ifp); + MPASS(*(uint64_t *)&ifp->if_maddr_et == 0); + epoch_enter_preempt(net_epoch_preempt, &ifp->if_maddr_et); } void if_maddr_runlock(if_t ifp) { - IF_ADDR_RUNLOCK((struct ifnet *)ifp); + epoch_exit_preempt(net_epoch_preempt, &ifp->if_maddr_et); +#ifdef INVARIANTS + bzero(&ifp->if_maddr_et, sizeof(struct epoch_tracker)); +#endif } /* @@ -1926,7 +1932,7 @@ ifa_ifwithaddr(const struct sockaddr *addr) struct ifnet *ifp; struct ifaddr *ifa; - MPASS(in_epoch()); + MPASS(in_epoch(net_epoch_preempt)); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) @@ -1969,7 +1975,7 @@ ifa_ifwithbroadaddr(const struct sockaddr *addr, int f struct ifnet *ifp; struct ifaddr *ifa; - MPASS(in_epoch()); + MPASS(in_epoch(net_epoch_preempt)); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) continue; @@ -1999,7 +2005,7 @@ ifa_ifwithdstaddr(const struct sockaddr *addr, int fib struct ifnet *ifp; struct ifaddr *ifa; - MPASS(in_epoch()); + MPASS(in_epoch(net_epoch_preempt)); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; @@ -2032,7 +2038,7 @@ ifa_ifwithnet(const struct sockaddr *addr, int ignore_ u_int af = addr->sa_family; const char *addr_data = addr->sa_data, *cplim; - MPASS(in_epoch()); + MPASS(in_epoch(net_epoch_preempt)); /* * AF_LINK addresses can be looked up directly by their index number, * so do that if we can. @@ -2069,7 +2075,6 @@ next: continue; */ if (ifa->ifa_dstaddr != NULL && sa_equal(addr, ifa->ifa_dstaddr)) { - IF_ADDR_RUNLOCK(ifp); goto done; } } else { @@ -2128,7 +2133,8 @@ ifaof_ifpforaddr(const struct sockaddr *addr, struct i if (af >= AF_MAX) return (NULL); - MPASS(in_epoch()); + + MPASS(in_epoch(net_epoch_preempt)); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != af) continue; Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/net/if_gif.h Wed Jul 4 02:47:16 2018 (r335924) @@ -96,8 +96,8 @@ struct etherip_header { /* mbuf adjust factor to force 32-bit alignment of IP header */ #define ETHERIP_ALIGN 2 -#define GIF_RLOCK() epoch_enter_preempt(net_epoch_preempt) -#define GIF_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) +#define GIF_RLOCK() struct epoch_tracker gif_et; epoch_enter_preempt(net_epoch_preempt, &gif_et) +#define GIF_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &gif_et) #define GIF_WAIT() epoch_wait_preempt(net_epoch_preempt) /* Prototypes */ Modified: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/net/if_gre.h Wed Jul 4 02:47:16 2018 (r335924) @@ -91,8 +91,8 @@ MALLOC_DECLARE(M_GRE); #endif #define GRE2IFP(sc) ((sc)->gre_ifp) -#define GRE_RLOCK() epoch_enter_preempt(net_epoch_preempt) -#define GRE_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) +#define GRE_RLOCK() struct epoch_tracker gre_et; epoch_enter_preempt(net_epoch_preempt, &gre_et) +#define GRE_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &gre_et) #define GRE_WAIT() epoch_wait_preempt(net_epoch_preempt) #define gre_hdr gre_uhdr.hdr Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Jul 4 00:18:40 2018 (r335923) +++ head/sys/net/if_lagg.c Wed Jul 4 02:47:16 2018 (r335924) @@ -73,10 +73,10 @@ __FBSDID("$FreeBSD$"); #include #include -#define LAGG_RLOCK() epoch_enter_preempt(net_epoch_preempt) -#define LAGG_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) -#define LAGG_RLOCK_ASSERT() MPASS(in_epoch()) -#define LAGG_UNLOCK_ASSERT() MPASS(!in_epoch()) +#define LAGG_RLOCK() struct epoch_tracker lagg_et; epoch_enter_preempt(net_epoch_preempt, &lagg_et) +#define LAGG_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &lagg_et) +#define LAGG_RLOCK_ASSERT() MPASS(in_epoch(net_epoch_preempt)) +#define LAGG_UNLOCK_ASSERT() MPASS(!in_epoch(net_epoch_preempt)) #define LAGG_SX_INIT(_sc) sx_init(&(_sc)->sc_sx, "if_lagg sx") #define LAGG_SX_DESTROY(_sc) sx_destroy(&(_sc)->sc_sx) @@ -1791,6 +1791,7 @@ struct lagg_port * lagg_link_active(struct lagg_softc *sc, struct lagg_port *lp) { struct lagg_port *lp_next, *rval = NULL; + struct epoch_tracker net_et; /* * Search a port which reports an active link state. @@ -1809,15 +1810,14 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po } search: - LAGG_RLOCK(); + epoch_enter_preempt(net_epoch_preempt, &net_et); CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (LAGG_PORTACTIVE(lp_next)) { - LAGG_RUNLOCK(); - rval = lp_next; - goto found; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jul 4 03:02:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7B451024DC2; Wed, 4 Jul 2018 03:02:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F95D80888; Wed, 4 Jul 2018 03:02:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72340250F6; Wed, 4 Jul 2018 03:02:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6432seQ086772; Wed, 4 Jul 2018 03:02:54 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6432s4M086771; Wed, 4 Jul 2018 03:02:54 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201807040302.w6432s4M086771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 4 Jul 2018 03:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335925 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 335925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 03:02:55 -0000 Author: gonzo Date: Wed Jul 4 03:02:53 2018 New Revision: 335925 URL: https://svnweb.freebsd.org/changeset/base/335925 Log: muge(4): add DTB blob as one more possible source of MAC address On FDT-enabled platforms check if DTB blob has MAC address configured by a boot loader. This information passed as a "local-mac-address" or "mac-address" property of the device node. For USB NICs node can be found by looking for compatibility string "usbVVV,PPP" where VVV - vendor id (hex) and PPP - product id (hex) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D16117 Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Wed Jul 4 02:47:16 2018 (r335924) +++ head/sys/dev/usb/net/if_muge.c Wed Jul 4 03:02:53 2018 (r335925) @@ -95,6 +95,12 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" +#ifdef FDT +#include +#include +#include +#endif + #include #include #include @@ -1427,30 +1433,117 @@ tr_setup: } } +#ifdef FDT /** - * muge_attach_post - Called after the driver attached to the USB interface - * @ue: the USB ethernet device + * muge_fdt_find_eth_node - find descendant node with required compatibility + * @start: start node + * @compatible: compatible string used to identify the node * - * This is where the chip is intialised for the first time. This is - * different from the muge_init() function in that that one is designed to - * setup the H/W to match the UE settings and can be called after a reset. + * Loop through all descendant nodes and return first match with required + * compatibility. * + * RETURNS: + * Returns node's phandle on success -1 otherwise */ +static phandle_t +muge_fdt_find_eth_node(phandle_t start, const char *compatible) +{ + phandle_t child, node; + + /* Traverse through entire tree to find usb ethernet nodes. */ + for (node = OF_child(start); node != 0; node = OF_peer(node)) { + if (ofw_bus_node_is_compatible(node, compatible)) + return (node); + child = muge_fdt_find_eth_node(node, compatible); + if (child != -1) + return (child); + } + + return (-1); +} + +/** + * muge_fdt_read_mac_property - read MAC address from node + * @node: USB device node + * @mac: memory to store MAC address to + * + * Check for common properties that might contain MAC address + * passed by boot loader. + * + * RETURNS: + * Returns 0 on success, error code otherwise + */ +static int +muge_fdt_read_mac_property(phandle_t node, unsigned char *mac) +{ + int len; + + /* Check if there is property */ + if ((len = OF_getproplen(node, "local-mac-address")) > 0) { + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(node, "local-mac-address", mac, + ETHER_ADDR_LEN); + return (0); + } + + if ((len = OF_getproplen(node, "mac-address")) > 0) { + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(node, "mac-address", mac, + ETHER_ADDR_LEN); + return (0); + } + + return (ENXIO); +} + +/** + * muge_fdt_find_mac - read MAC address from node + * @compatible: compatible string for DTB node in the form "usb[N]NNN,[M]MMM" + * where NNN is vendor id and MMM is product id + * @mac: memory to store MAC address to + * + * Tries to find matching node in DTS and obtain MAC address info from it + * + * RETURNS: + * Returns 0 on success, error code otherwise + */ +static int +muge_fdt_find_mac(const char *compatible, unsigned char *mac) +{ + phandle_t node, root; + + root = OF_finddevice("/"); + node = muge_fdt_find_eth_node(root, compatible); + if (node != -1) { + if (muge_fdt_read_mac_property(node, mac) == 0) + return (0); + } + + return (ENXIO); +} +#endif + +/** + * muge_set_mac_addr - Initiailizes NIC MAC address + * @ue: the USB ethernet device + * + * Tries to obtain MAC address from number of sources: registers, + * EEPROM, DTB blob. If all sources fail - generates random MAC. + */ static void -muge_attach_post(struct usb_ether *ue) +muge_set_mac_addr(struct usb_ether *ue) { struct muge_softc *sc = uether_getsc(ue); uint32_t mac_h, mac_l; - muge_dbg_printf(sc, "Calling muge_attach_post.\n"); +#ifdef FDT + char compatible[16]; + struct usb_attach_arg *uaa = device_get_ivars(ue->ue_dev); +#endif - /* Setup some of the basics */ - sc->sc_phyno = 1; - - /* - * Attempt to get the mac address, if an EEPROM is not attached this - * will just return FF:FF:FF:FF:FF:FF, so in such cases we invent a MAC - * address based on urandom. - */ memset(sc->sc_ue.ue_eaddr, 0xff, ETHER_ADDR_LEN); uint32_t val; @@ -1468,29 +1561,57 @@ muge_attach_post(struct usb_ether *ue) } /* If RX_ADDRx did not provide a valid MAC address, try EEPROM. */ - if (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { - if ((lan78xx_eeprom_present(sc) && - lan78xx_eeprom_read_raw(sc, ETH_E2P_MAC_OFFSET, - sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0) || - (lan78xx_otp_read(sc, OTP_MAC_OFFSET, - sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0)) { - if (ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { - muge_dbg_printf(sc, "MAC read from EEPROM\n"); - } else { - muge_dbg_printf(sc, "MAC assigned randomly\n"); - read_random(sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN); - sc->sc_ue.ue_eaddr[0] &= ~0x01; /* unicast */ - sc->sc_ue.ue_eaddr[0] |= 0x02;/* locally administered */ - } - } else { - muge_dbg_printf(sc, "MAC assigned randomly\n"); - arc4rand(sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN, 0); - sc->sc_ue.ue_eaddr[0] &= ~0x01; /* unicast */ - sc->sc_ue.ue_eaddr[0] |= 0x02; /* locally administered */ - } - } else { + if (ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { muge_dbg_printf(sc, "MAC assigned from registers\n"); + return; } + + if ((lan78xx_eeprom_present(sc) && + lan78xx_eeprom_read_raw(sc, ETH_E2P_MAC_OFFSET, + sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0) || + (lan78xx_otp_read(sc, OTP_MAC_OFFSET, + sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0)) { + if (ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { + muge_dbg_printf(sc, "MAC read from EEPROM\n"); + return; + } + } + +#ifdef FDT + snprintf(compatible, sizeof(compatible), "usb%x,%x", + uaa->info.idVendor, uaa->info.idProduct); + if (muge_fdt_find_mac(compatible, sc->sc_ue.ue_eaddr) == 0) { + muge_dbg_printf(sc, "MAC assigned from FDT blob\n"); + return; + } +#endif + + muge_dbg_printf(sc, "MAC assigned randomly\n"); + arc4rand(sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN, 0); + sc->sc_ue.ue_eaddr[0] &= ~0x01; /* unicast */ + sc->sc_ue.ue_eaddr[0] |= 0x02; /* locally administered */ +} + +/** + * muge_attach_post - Called after the driver attached to the USB interface + * @ue: the USB ethernet device + * + * This is where the chip is intialised for the first time. This is + * different from the muge_init() function in that that one is designed to + * setup the H/W to match the UE settings and can be called after a reset. + * + */ +static void +muge_attach_post(struct usb_ether *ue) +{ + struct muge_softc *sc = uether_getsc(ue); + + muge_dbg_printf(sc, "Calling muge_attach_post.\n"); + + /* Setup some of the basics */ + sc->sc_phyno = 1; + + muge_set_mac_addr(ue); /* Initialise the chip for the first time */ lan78xx_chip_init(sc); From owner-svn-src-head@freebsd.org Wed Jul 4 03:36:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1CF0102836D; Wed, 4 Jul 2018 03:36:47 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 819678253F; Wed, 4 Jul 2018 03:36:47 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4997325675; Wed, 4 Jul 2018 03:36:47 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w643alWs002303; Wed, 4 Jul 2018 03:36:47 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w643akPK002300; Wed, 4 Jul 2018 03:36:46 GMT (envelope-from will@FreeBSD.org) Message-Id: <201807040336.w643akPK002300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 4 Jul 2018 03:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335928 - in head: share/man/man4 sys/net sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: will X-SVN-Commit-Paths: in head: share/man/man4 sys/net sys/netpfil/pf X-SVN-Commit-Revision: 335928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 03:36:48 -0000 Author: will Date: Wed Jul 4 03:36:46 2018 New Revision: 335928 URL: https://svnweb.freebsd.org/changeset/base/335928 Log: Revert r335833. Several third-parties use at least some of these ioctls. While it would be better for regression testing if they were used in base (or at least in the test suite), it's currently not worth the trouble to push through removal. Submitted by: antoine, markj Modified: head/share/man/man4/pf.4 head/sys/net/pfvar.h head/sys/netpfil/pf/pf_ioctl.c Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Wed Jul 4 03:24:11 2018 (r335927) +++ head/share/man/man4/pf.4 Wed Jul 4 03:36:46 2018 (r335928) @@ -139,8 +139,9 @@ Clear the buffer address pool and get a .Va ticket for subsequent .Dv DIOCADDADDR , +.Dv DIOCADDRULE , and -.Dv DIOCADDRULE +.Dv DIOCCHANGERULE calls. .It Dv DIOCADDADDR Fa "struct pfioc_pooladdr *pp" .Pp @@ -148,6 +149,8 @@ Add the pool address .Va addr to the buffer address pool to be used in the following .Dv DIOCADDRULE +or +.Dv DIOCCHANGERULE call. All other members of the structure are ignored. .It Dv DIOCADDRULE Fa "struct pfioc_rule *pr" @@ -316,6 +319,21 @@ This ioctl returns if the given anchor does not exist or .Er EBUSY if another process is concurrently updating a ruleset. +.It Dv DIOCADDSTATE Fa "struct pfioc_state *ps" +Add a state entry. +.Bd -literal +struct pfioc_state { + struct pfsync_state state; +}; +.Ed +.It Dv DIOCGETSTATE Fa "struct pfioc_state *ps" +Extract the entry identified by the +.Va id +and +.Va creatorid +fields of the +.Va state +structure from the state table. .It Dv DIOCKILLSTATES Fa "struct pfioc_state_kill *psk" Remove matching entries from the state table. This ioctl returns the number of killed states in @@ -421,6 +439,11 @@ On exit, is always set to the total size required to hold all state table entries (i.e., it is set to .Li sizeof(struct pf_state) * nr ) . +.It Dv DIOCCHANGERULE Fa "struct pfioc_rule *pcr" +Add or remove the +.Va rule +in the ruleset specified by +.Va rule.action . .Pp The type of operation to be performed is indicated by .Va action , @@ -452,6 +475,15 @@ indicates the rule number against which or .Dv PF_CHANGE_REMOVE actions are applied. +.\" It Dv DIOCCHANGEALTQ Fa "struct pfioc_altq *pcr" +.It Dv DIOCCHANGEADDR Fa "struct pfioc_pooladdr *pca" +Add or remove the pool address +.Va addr +from the rule specified by +.Va r_action , +.Va r_num , +and +.Va anchor . .It Dv DIOCSETTIMEOUT Fa "struct pfioc_tm *pt" .Bd -literal struct pfioc_tm { @@ -478,6 +510,8 @@ Get the state timeout of The value will be placed into the .Va seconds field. +.It Dv DIOCCLRRULECTRS +Clear per-rule statistics. .It Dv DIOCSETLIMIT Fa "struct pfioc_limit *pl" Set the hard limits on the memory pools used by the packet filter. .Bd -literal Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Wed Jul 4 03:24:11 2018 (r335927) +++ head/sys/net/pfvar.h Wed Jul 4 03:36:46 2018 (r335928) @@ -1385,17 +1385,19 @@ struct pfioc_iface { #define DIOCGETRULE _IOWR('D', 7, struct pfioc_rule) /* XXX cut 8 - 17 */ #define DIOCCLRSTATES _IOWR('D', 18, struct pfioc_state_kill) -/* XXX cut 19 */ +#define DIOCGETSTATE _IOWR('D', 19, struct pfioc_state) #define DIOCSETSTATUSIF _IOWR('D', 20, struct pfioc_if) #define DIOCGETSTATUS _IOWR('D', 21, struct pf_status) #define DIOCCLRSTATUS _IO ('D', 22) #define DIOCNATLOOK _IOWR('D', 23, struct pfioc_natlook) #define DIOCSETDEBUG _IOWR('D', 24, u_int32_t) #define DIOCGETSTATES _IOWR('D', 25, struct pfioc_states) +#define DIOCCHANGERULE _IOWR('D', 26, struct pfioc_rule) /* XXX cut 26 - 28 */ #define DIOCSETTIMEOUT _IOWR('D', 29, struct pfioc_tm) #define DIOCGETTIMEOUT _IOWR('D', 30, struct pfioc_tm) -/* XXX cut 31-38 */ +#define DIOCADDSTATE _IOWR('D', 37, struct pfioc_state) +#define DIOCCLRRULECTRS _IO ('D', 38) #define DIOCGETLIMIT _IOWR('D', 39, struct pfioc_limit) #define DIOCSETLIMIT _IOWR('D', 40, struct pfioc_limit) #define DIOCKILLSTATES _IOWR('D', 41, struct pfioc_state_kill) @@ -1404,12 +1406,13 @@ struct pfioc_iface { #define DIOCADDALTQ _IOWR('D', 45, struct pfioc_altq) #define DIOCGETALTQS _IOWR('D', 47, struct pfioc_altq) #define DIOCGETALTQ _IOWR('D', 48, struct pfioc_altq) -/* XXX cut 49 */ +#define DIOCCHANGEALTQ _IOWR('D', 49, struct pfioc_altq) #define DIOCGETQSTATS _IOWR('D', 50, struct pfioc_qstats) #define DIOCBEGINADDRS _IOWR('D', 51, struct pfioc_pooladdr) #define DIOCADDADDR _IOWR('D', 52, struct pfioc_pooladdr) #define DIOCGETADDRS _IOWR('D', 53, struct pfioc_pooladdr) #define DIOCGETADDR _IOWR('D', 54, struct pfioc_pooladdr) +#define DIOCCHANGEADDR _IOWR('D', 55, struct pfioc_pooladdr) /* XXX cut 55 - 57 */ #define DIOCGETRULESETS _IOWR('D', 58, struct pfioc_ruleset) #define DIOCGETRULESET _IOWR('D', 59, struct pfioc_ruleset) Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Wed Jul 4 03:24:11 2018 (r335927) +++ head/sys/netpfil/pf/pf_ioctl.c Wed Jul 4 03:36:46 2018 (r335928) @@ -1003,6 +1003,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in case DIOCGETRULE: case DIOCGETADDRS: case DIOCGETADDR: + case DIOCGETSTATE: case DIOCSETSTATUSIF: case DIOCGETSTATUS: case DIOCCLRSTATUS: @@ -1010,6 +1011,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in case DIOCSETDEBUG: case DIOCGETSTATES: case DIOCGETTIMEOUT: + case DIOCCLRRULECTRS: case DIOCGETLIMIT: case DIOCGETALTQS: case DIOCGETALTQ: @@ -1052,6 +1054,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in case DIOCGETRULES: case DIOCGETADDRS: case DIOCGETADDR: + case DIOCGETSTATE: case DIOCGETSTATUS: case DIOCGETSTATES: case DIOCGETTIMEOUT: @@ -1393,6 +1396,227 @@ DIOCADDRULE_error: break; } + case DIOCCHANGERULE: { + struct pfioc_rule *pcr = (struct pfioc_rule *)addr; + struct pf_ruleset *ruleset; + struct pf_rule *oldrule = NULL, *newrule = NULL; + struct pfi_kif *kif = NULL; + struct pf_pooladdr *pa; + u_int32_t nr = 0; + int rs_num; + + if (pcr->action < PF_CHANGE_ADD_HEAD || + pcr->action > PF_CHANGE_GET_TICKET) { + error = EINVAL; + break; + } + if (pcr->rule.return_icmp >> 8 > ICMP_MAXTYPE) { + error = EINVAL; + break; + } + + if (pcr->action != PF_CHANGE_REMOVE) { +#ifndef INET + if (pcr->rule.af == AF_INET) { + error = EAFNOSUPPORT; + break; + } +#endif /* INET */ +#ifndef INET6 + if (pcr->rule.af == AF_INET6) { + error = EAFNOSUPPORT; + break; + } +#endif /* INET6 */ + newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); + bcopy(&pcr->rule, newrule, sizeof(struct pf_rule)); + if (newrule->ifname[0]) + kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); + newrule->states_cur = counter_u64_alloc(M_WAITOK); + newrule->states_tot = counter_u64_alloc(M_WAITOK); + newrule->src_nodes = counter_u64_alloc(M_WAITOK); + newrule->cuid = td->td_ucred->cr_ruid; + newrule->cpid = td->td_proc ? td->td_proc->p_pid : 0; + TAILQ_INIT(&newrule->rpool.list); + } + +#define ERROUT(x) { error = (x); goto DIOCCHANGERULE_error; } + + PF_RULES_WLOCK(); + if (!(pcr->action == PF_CHANGE_REMOVE || + pcr->action == PF_CHANGE_GET_TICKET) && + pcr->pool_ticket != V_ticket_pabuf) + ERROUT(EBUSY); + + ruleset = pf_find_ruleset(pcr->anchor); + if (ruleset == NULL) + ERROUT(EINVAL); + + rs_num = pf_get_ruleset_number(pcr->rule.action); + if (rs_num >= PF_RULESET_MAX) + ERROUT(EINVAL); + + if (pcr->action == PF_CHANGE_GET_TICKET) { + pcr->ticket = ++ruleset->rules[rs_num].active.ticket; + ERROUT(0); + } else if (pcr->ticket != + ruleset->rules[rs_num].active.ticket) + ERROUT(EINVAL); + + if (pcr->action != PF_CHANGE_REMOVE) { + if (newrule->ifname[0]) { + newrule->kif = pfi_kif_attach(kif, + newrule->ifname); + pfi_kif_ref(newrule->kif); + } else + newrule->kif = NULL; + + if (newrule->rtableid > 0 && + newrule->rtableid >= rt_numfibs) + error = EBUSY; + +#ifdef ALTQ + /* set queue IDs */ + if (newrule->qname[0] != 0) { + if ((newrule->qid = + pf_qname2qid(newrule->qname)) == 0) + error = EBUSY; + else if (newrule->pqname[0] != 0) { + if ((newrule->pqid = + pf_qname2qid(newrule->pqname)) == 0) + error = EBUSY; + } else + newrule->pqid = newrule->qid; + } +#endif /* ALTQ */ + if (newrule->tagname[0]) + if ((newrule->tag = + pf_tagname2tag(newrule->tagname)) == 0) + error = EBUSY; + if (newrule->match_tagname[0]) + if ((newrule->match_tag = pf_tagname2tag( + newrule->match_tagname)) == 0) + error = EBUSY; + if (newrule->rt && !newrule->direction) + error = EINVAL; + if (!newrule->log) + newrule->logif = 0; + if (newrule->logif >= PFLOGIFS_MAX) + error = EINVAL; + if (pf_addr_setup(ruleset, &newrule->src.addr, newrule->af)) + error = ENOMEM; + if (pf_addr_setup(ruleset, &newrule->dst.addr, newrule->af)) + error = ENOMEM; + if (pf_anchor_setup(newrule, ruleset, pcr->anchor_call)) + error = EINVAL; + TAILQ_FOREACH(pa, &V_pf_pabuf, entries) + if (pa->addr.type == PF_ADDR_TABLE) { + pa->addr.p.tbl = + pfr_attach_table(ruleset, + pa->addr.v.tblname); + if (pa->addr.p.tbl == NULL) + error = ENOMEM; + } + + newrule->overload_tbl = NULL; + if (newrule->overload_tblname[0]) { + if ((newrule->overload_tbl = pfr_attach_table( + ruleset, newrule->overload_tblname)) == + NULL) + error = EINVAL; + else + newrule->overload_tbl->pfrkt_flags |= + PFR_TFLAG_ACTIVE; + } + + pf_mv_pool(&V_pf_pabuf, &newrule->rpool.list); + if (((((newrule->action == PF_NAT) || + (newrule->action == PF_RDR) || + (newrule->action == PF_BINAT) || + (newrule->rt > PF_NOPFROUTE)) && + !newrule->anchor)) && + (TAILQ_FIRST(&newrule->rpool.list) == NULL)) + error = EINVAL; + + if (error) { + pf_free_rule(newrule); + PF_RULES_WUNLOCK(); + break; + } + + newrule->rpool.cur = TAILQ_FIRST(&newrule->rpool.list); + newrule->evaluations = 0; + newrule->packets[0] = newrule->packets[1] = 0; + newrule->bytes[0] = newrule->bytes[1] = 0; + } + pf_empty_pool(&V_pf_pabuf); + + if (pcr->action == PF_CHANGE_ADD_HEAD) + oldrule = TAILQ_FIRST( + ruleset->rules[rs_num].active.ptr); + else if (pcr->action == PF_CHANGE_ADD_TAIL) + oldrule = TAILQ_LAST( + ruleset->rules[rs_num].active.ptr, pf_rulequeue); + else { + oldrule = TAILQ_FIRST( + ruleset->rules[rs_num].active.ptr); + while ((oldrule != NULL) && (oldrule->nr != pcr->nr)) + oldrule = TAILQ_NEXT(oldrule, entries); + if (oldrule == NULL) { + if (newrule != NULL) + pf_free_rule(newrule); + PF_RULES_WUNLOCK(); + error = EINVAL; + break; + } + } + + if (pcr->action == PF_CHANGE_REMOVE) { + pf_unlink_rule(ruleset->rules[rs_num].active.ptr, + oldrule); + ruleset->rules[rs_num].active.rcount--; + } else { + if (oldrule == NULL) + TAILQ_INSERT_TAIL( + ruleset->rules[rs_num].active.ptr, + newrule, entries); + else if (pcr->action == PF_CHANGE_ADD_HEAD || + pcr->action == PF_CHANGE_ADD_BEFORE) + TAILQ_INSERT_BEFORE(oldrule, newrule, entries); + else + TAILQ_INSERT_AFTER( + ruleset->rules[rs_num].active.ptr, + oldrule, newrule, entries); + ruleset->rules[rs_num].active.rcount++; + } + + nr = 0; + TAILQ_FOREACH(oldrule, + ruleset->rules[rs_num].active.ptr, entries) + oldrule->nr = nr++; + + ruleset->rules[rs_num].active.ticket++; + + pf_calc_skip_steps(ruleset->rules[rs_num].active.ptr); + pf_remove_if_empty_ruleset(ruleset); + + PF_RULES_WUNLOCK(); + break; + +#undef ERROUT +DIOCCHANGERULE_error: + PF_RULES_WUNLOCK(); + if (newrule != NULL) { + counter_u64_free(newrule->states_cur); + counter_u64_free(newrule->states_tot); + counter_u64_free(newrule->src_nodes); + free(newrule, M_PFRULE); + } + if (kif != NULL) + free(kif, PFI_MTYPE); + break; + } + case DIOCCLRSTATES: { struct pf_state *s; struct pfioc_state_kill *psk = (struct pfioc_state_kill *)addr; @@ -1499,6 +1723,38 @@ relock_DIOCKILLSTATES: break; } + case DIOCADDSTATE: { + struct pfioc_state *ps = (struct pfioc_state *)addr; + struct pfsync_state *sp = &ps->state; + + if (sp->timeout >= PFTM_MAX) { + error = EINVAL; + break; + } + if (pfsync_state_import_ptr != NULL) { + PF_RULES_RLOCK(); + error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); + PF_RULES_RUNLOCK(); + } else + error = EOPNOTSUPP; + break; + } + + case DIOCGETSTATE: { + struct pfioc_state *ps = (struct pfioc_state *)addr; + struct pf_state *s; + + s = pf_find_state_byid(ps->state.id, ps->state.creatorid); + if (s == NULL) { + error = ENOENT; + break; + } + + pfsync_state_export(&ps->state, s); + PF_STATE_UNLOCK(s); + break; + } + case DIOCGETSTATES: { struct pfioc_states *ps = (struct pfioc_states *)addr; struct pf_state *s; @@ -1729,6 +1985,22 @@ DIOCGETSTATES_full: break; } + case DIOCCLRRULECTRS: { + /* obsoleted by DIOCGETRULE with action=PF_GET_CLR_CNTR */ + struct pf_ruleset *ruleset = &pf_main_ruleset; + struct pf_rule *rule; + + PF_RULES_WLOCK(); + TAILQ_FOREACH(rule, + ruleset->rules[PF_RULESET_FILTER].active.ptr, entries) { + rule->evaluations = 0; + rule->packets[0] = rule->packets[1] = 0; + rule->bytes[0] = rule->bytes[1] = 0; + } + PF_RULES_WUNLOCK(); + break; + } + case DIOCGIFSPEED: { struct pf_ifspeed *psp = (struct pf_ifspeed *)addr; struct pf_ifspeed ps; @@ -1883,6 +2155,11 @@ DIOCGETSTATES_full: break; } + case DIOCCHANGEALTQ: + /* CHANGEALTQ not supported yet! */ + error = ENODEV; + break; + case DIOCGETQSTATS: { struct pfioc_qstats *pq = (struct pfioc_qstats *)addr; struct pf_altq *altq; @@ -2034,6 +2311,137 @@ DIOCGETSTATES_full: bcopy(pa, &pp->addr, sizeof(struct pf_pooladdr)); pf_addr_copyout(&pp->addr.addr); PF_RULES_RUNLOCK(); + break; + } + + case DIOCCHANGEADDR: { + struct pfioc_pooladdr *pca = (struct pfioc_pooladdr *)addr; + struct pf_pool *pool; + struct pf_pooladdr *oldpa = NULL, *newpa = NULL; + struct pf_ruleset *ruleset; + struct pfi_kif *kif = NULL; + + if (pca->action < PF_CHANGE_ADD_HEAD || + pca->action > PF_CHANGE_REMOVE) { + error = EINVAL; + break; + } + if (pca->addr.addr.type != PF_ADDR_ADDRMASK && + pca->addr.addr.type != PF_ADDR_DYNIFTL && + pca->addr.addr.type != PF_ADDR_TABLE) { + error = EINVAL; + break; + } + + if (pca->action != PF_CHANGE_REMOVE) { +#ifndef INET + if (pca->af == AF_INET) { + error = EAFNOSUPPORT; + break; + } +#endif /* INET */ +#ifndef INET6 + if (pca->af == AF_INET6) { + error = EAFNOSUPPORT; + break; + } +#endif /* INET6 */ + newpa = malloc(sizeof(*newpa), M_PFRULE, M_WAITOK); + bcopy(&pca->addr, newpa, sizeof(struct pf_pooladdr)); + if (newpa->ifname[0]) + kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); + newpa->kif = NULL; + } + +#define ERROUT(x) { error = (x); goto DIOCCHANGEADDR_error; } + PF_RULES_WLOCK(); + ruleset = pf_find_ruleset(pca->anchor); + if (ruleset == NULL) + ERROUT(EBUSY); + + pool = pf_get_pool(pca->anchor, pca->ticket, pca->r_action, + pca->r_num, pca->r_last, 1, 1); + if (pool == NULL) + ERROUT(EBUSY); + + if (pca->action != PF_CHANGE_REMOVE) { + if (newpa->ifname[0]) { + newpa->kif = pfi_kif_attach(kif, newpa->ifname); + pfi_kif_ref(newpa->kif); + kif = NULL; + } + + switch (newpa->addr.type) { + case PF_ADDR_DYNIFTL: + error = pfi_dynaddr_setup(&newpa->addr, + pca->af); + break; + case PF_ADDR_TABLE: + newpa->addr.p.tbl = pfr_attach_table(ruleset, + newpa->addr.v.tblname); + if (newpa->addr.p.tbl == NULL) + error = ENOMEM; + break; + } + if (error) + goto DIOCCHANGEADDR_error; + } + + switch (pca->action) { + case PF_CHANGE_ADD_HEAD: + oldpa = TAILQ_FIRST(&pool->list); + break; + case PF_CHANGE_ADD_TAIL: + oldpa = TAILQ_LAST(&pool->list, pf_palist); + break; + default: + oldpa = TAILQ_FIRST(&pool->list); + for (int i = 0; oldpa && i < pca->nr; i++) + oldpa = TAILQ_NEXT(oldpa, entries); + + if (oldpa == NULL) + ERROUT(EINVAL); + } + + if (pca->action == PF_CHANGE_REMOVE) { + TAILQ_REMOVE(&pool->list, oldpa, entries); + switch (oldpa->addr.type) { + case PF_ADDR_DYNIFTL: + pfi_dynaddr_remove(oldpa->addr.p.dyn); + break; + case PF_ADDR_TABLE: + pfr_detach_table(oldpa->addr.p.tbl); + break; + } + if (oldpa->kif) + pfi_kif_unref(oldpa->kif); + free(oldpa, M_PFRULE); + } else { + if (oldpa == NULL) + TAILQ_INSERT_TAIL(&pool->list, newpa, entries); + else if (pca->action == PF_CHANGE_ADD_HEAD || + pca->action == PF_CHANGE_ADD_BEFORE) + TAILQ_INSERT_BEFORE(oldpa, newpa, entries); + else + TAILQ_INSERT_AFTER(&pool->list, oldpa, + newpa, entries); + } + + pool->cur = TAILQ_FIRST(&pool->list); + PF_ACPY(&pool->counter, &pool->cur->addr.v.a.addr, pca->af); + PF_RULES_WUNLOCK(); + break; + +#undef ERROUT +DIOCCHANGEADDR_error: + if (newpa != NULL) { + if (newpa->kif) + pfi_kif_unref(newpa->kif); + free(newpa, M_PFRULE); + } + PF_RULES_WUNLOCK(); + if (kif != NULL) + free(kif, PFI_MTYPE); break; } From owner-svn-src-head@freebsd.org Wed Jul 4 03:44:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A67F1028CDF; Wed, 4 Jul 2018 03:44:37 +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 0A9E682B0E; Wed, 4 Jul 2018 03:44:37 +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 DD72E25819; Wed, 4 Jul 2018 03:44:36 +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 w643iadr007524; Wed, 4 Jul 2018 03:44:36 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w643iacq007523; Wed, 4 Jul 2018 03:44:36 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807040344.w643iacq007523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 4 Jul 2018 03:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335929 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 03:44:37 -0000 Author: mmacy Date: Wed Jul 4 03:44:36 2018 New Revision: 335929 URL: https://svnweb.freebsd.org/changeset/base/335929 Log: epoch(9): update man page for r335924 Modified: head/share/man/man9/epoch.9 Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Wed Jul 4 03:36:46 2018 (r335928) +++ head/share/man/man9/epoch.9 Wed Jul 4 03:44:36 2018 (r335929) @@ -49,11 +49,11 @@ .Ft void .Fn epoch_enter "epoch_t epoch" .Ft void -.Fn epoch_enter_preempt "epoch_t epoch" +.Fn epoch_enter_preempt "epoch_t epoch" "epoch_tracker_t et" .Ft void .Fn epoch_exit "epoch_t epoch" .Ft void -.Fn epoch_exit_preempt "epoch_t epoch" +.Fn epoch_exit_preempt "epoch_t epoch" "epoch_tracker_t et" .Ft void .Fn epoch_wait "epoch_t epoch" .Ft void @@ -104,12 +104,16 @@ INVARIANTS can assert that a thread is in an epoch by .Fn in_epoch . .Pp The epoch API currently does not support sleeping in epoch_preempt sections. -A caller cannot do epoch_enter recursively on different preemptible epochs. A caller should never call .Fn epoch_wait -in the middle of an epoch section as this will lead to a deadlock. +in the middle of an epoch section for the same epoch as this will lead to a deadlock. .Pp -Note that epochs are not a straight replacement for read locks. +Be default mutexes cannot be held across +.Fn epoch_wait_preempt . +To permit this the epoch must be allocated with +.Fn EPOCH_LOCKED . +When doing this one must be cautious of creating a situation where a deadlock is +possible. Note that epochs are not a straight replacement for read locks. Callers must use safe list and tailq traversal routines in an epoch (see ck_queue). When modifying a list referenced from an epoch section safe removal routines must be used and the caller can no longer modify a list entry From owner-svn-src-head@freebsd.org Wed Jul 4 03:46:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38BD31028F09; Wed, 4 Jul 2018 03:46:24 +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 DACF582CBD; Wed, 4 Jul 2018 03:46:23 +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 BCCF92581C; Wed, 4 Jul 2018 03:46:23 +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 w643kNxk007647; Wed, 4 Jul 2018 03:46:23 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w643kNV3007646; Wed, 4 Jul 2018 03:46:23 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807040346.w643kNV3007646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 4 Jul 2018 03:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335930 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 335930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 03:46:24 -0000 Author: mmacy Date: Wed Jul 4 03:46:23 2018 New Revision: 335930 URL: https://svnweb.freebsd.org/changeset/base/335930 Log: FreeBSD_version: update for epoch(9) r335924 KPI change Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Jul 4 03:44:36 2018 (r335929) +++ head/sys/sys/param.h Wed Jul 4 03:46:23 2018 (r335930) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200070 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200071 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Jul 4 03:54:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93341029BD2; Wed, 4 Jul 2018 03:54:40 +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 57D8083316; Wed, 4 Jul 2018 03:54:40 +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 39E5D259BF; Wed, 4 Jul 2018 03:54:40 +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 w643seI0012624; Wed, 4 Jul 2018 03:54:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w643se1q012623; Wed, 4 Jul 2018 03:54:40 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807040354.w643se1q012623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 4 Jul 2018 03:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335931 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 03:54:40 -0000 Author: mmacy Date: Wed Jul 4 03:54:39 2018 New Revision: 335931 URL: https://svnweb.freebsd.org/changeset/base/335931 Log: epoch(9): update in_epoch() description as well Modified: head/share/man/man9/epoch.9 Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Wed Jul 4 03:46:23 2018 (r335930) +++ head/share/man/man9/epoch.9 Wed Jul 4 03:54:39 2018 (r335931) @@ -61,7 +61,7 @@ .Ft void .Fn epoch_call "epoch_t epoch" "epoch_context_t ctx" "void (*callback) (epoch_context_t)" .Ft int -.Fn in_epoch "void" +.Fn in_epoch "epoch_t epoch" .Sh DESCRIPTION Epochs are used to guarantee liveness and immutability of data by deferring reclamation and mutation until a grace period has elapsed. @@ -111,7 +111,7 @@ in the middle of an epoch section for the same epoch a Be default mutexes cannot be held across .Fn epoch_wait_preempt . To permit this the epoch must be allocated with -.Fn EPOCH_LOCKED . +EPOCH_LOCKED. When doing this one must be cautious of creating a situation where a deadlock is possible. Note that epochs are not a straight replacement for read locks. Callers must use safe list and tailq traversal routines in an epoch (see ck_queue). @@ -121,8 +121,8 @@ in place. An item to be modified must be handled with copy on write and frees must be deferred until after a grace period has elapsed. .Sh RETURN VALUES -.Fn in_epoch -will return 1 if curthread is in an epoch, 0 otherwise. +.Fn in_epoch curepoch +will return 1 if curthread is in curepoch, 0 otherwise. .Sh CAVEATS One must be cautious when using .Fn epoch_wait_preempt From owner-svn-src-head@freebsd.org Wed Jul 4 06:11:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E3F71034C8F for ; Wed, 4 Jul 2018 06:11:03 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-22.consmr.mail.gq1.yahoo.com (sonic317-22.consmr.mail.gq1.yahoo.com [98.137.66.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBB4F88F60 for ; Wed, 4 Jul 2018 06:11:02 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: GQsU2wIVM1kW0ZG8oKNCEIZJuCB8Mv29t4Csht01wrspXZxCX.kKtsofyuyX.zI kKa38SJubbk9T2lIHtQwmLHtnJ6EKwz52eQT0Gg2F0qMqhln3_R_gxuphfGf_NpV1AfPmSESUJMd ji_olEPfwOF6CLOGSJ.VCo3pA2hXDgI2SY3dyVMm7dFENoN5xbyUcNwWFJTD3J.vjErfj0E7WMnf xxFfbmbRtTlTWl.XN5R0qKH75DtCzS2ym5I0fqzeZfKCAljcrYh7XluxEAGQjBG7XX.7xTc9bQHS 675CdFOpa_H1QUXC7EvBd2N0D_4m9BJ69hz.5mE9bofS_.X1FgNMkZrP3oEyArOLwEchhykyL4rL U8zGAdRYg4DknmfQRb5IdYuagVgGnXcMEiQUNAFEHiEauJzFnpWZOq.NDefH8h21ri0yXICLBAz_ yl7iEE_V2.HCyRIjm_ATOc5DsKA8NMb_NKNqFDXsa6ApSdafUrW.TbZYwW95SQbUCqNz6qWdVj2U GgL5GYnzJbKJjf9ki5gBSGcIC9A_X6EH71T87polEzU893ihb8az.guIY3McUC9QlP82PcfkfgA3 QhvN3sm72j_xrMJGvbV4wfb1BXr98MUoVz6mg8w2QsPpPBgRfJZAaKciPsJ5qvmCcKW8z2hT8Kyz WQ1xtag0laH8kioZ4SfkTIknMc3yeNJZ_KqZw7yBSnEFY8MhWInzKANu9ZGIiJZafjYVTNB45iUZ UFQF2h4VdJvWCcuPEjxVb37xjcFs15bexH9L9qR0kDLdQdlW3irSn2mmblA_i5MtJ.VMYiXHa3DO w3Q9xaNKeqzpFKG3sJiVV7.iyRqw6j6SgbCDXsP6fy7dgc.CbJ6_kz16woQDL5H1e81nDLk5ujqk SemdWpOST1bzB2UlphUMPdZ.UQqiDn2Z4A9mI7I7T59JNb8AqvzVnbl_Aqp8Z.hky.pRSxSXngxx JkaC52BApVFFNLXfeiSlhFWMg0kkivuTByzyxSQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Wed, 4 Jul 2018 06:10:56 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp413.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 677c7ae71687fc47e644122ff02f5896; Wed, 04 Jul 2018 06:10:56 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Something broke ci.freebsd.org 's FreeBSD-head-{amd64,i386,riscv64}-{images,testvm} : fetch authentication errors Message-Id: <290972A4-3188-4158-AFCA-DC856A7DB0E2@yahoo.com> Date: Tue, 3 Jul 2018 23:10:55 -0700 To: Bryan Drewery , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 06:11:03 -0000 [Note: around -r33590{4,6,7,8} these build attempts broke in some cases but FreeBSD-head-{amd64,i386,riscv64}-{images,testvm} just was never built for such. FreeBSD-head-amd64-testvm first fails at -r335904 but FreeBSD-head-amd64-images built -r335904 and failed for -r335908. Both i386's jumped from -r335902 (built) to -r335907 (failed). riscv64's: from -r335905 (built) to -r335907 (failed).] Example: = https://ci.freebsd.org/job/FreeBSD-head-amd64-testvm/8651/console shows: . . . 20:23:29 setup jail FreeBSD-head-amd64-testvm using following = parameters: . . . 20:23:29 Certificate verification failed for /CN=3Dartifact.ci.freebsd.org= 20:23:29 34364199992:error:14090086:SSL = routines:ssl3_get_server_certificate:certificate verify = failed:/usr/src/crypto/openssl/ssl/s3_clnt.c:1269: 20:23:29 fetch: = https://artifact.ci.FreeBSD.org/snapshot/head/r329172/amd64/amd64/base.txz= : Authentication error . . . 20:24:04 + DIST_PACKAGES=3D'base kernel doc tests base-dbg kernel-dbg = lib32 lib32-dbg' 20:24:04 + mkdir -p ufs 20:24:04 + fetch = https://artifact.ci.freebsd.org/snapshot/head/r335904/amd64/amd64/base.txz= 20:24:04 Certificate verification failed for /CN=3Dartifact.ci.freebsd.org= 20:24:04 34364183608:error:14090086:SSL = routines:ssl3_get_server_certificate:certificate verify = failed:/usr/src/crypto/openssl/ssl/s3_clnt.c:1269: 20:24:04 fetch: = https://artifact.ci.freebsd.org/snapshot/head/r335904/amd64/amd64/base.txz= : Authentication error 20:24:04 Build step 'Execute shell' marked build as failure 20:24:04 FTP: Current build result is [FAILURE], not going to run. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed Jul 4 06:47:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21EB81038589; Wed, 4 Jul 2018 06:47:35 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD84C8A2F0; Wed, 4 Jul 2018 06:47:34 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FFFB275BD; Wed, 4 Jul 2018 06:47:34 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w646lYqn098640; Wed, 4 Jul 2018 06:47:34 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w646lYpW098639; Wed, 4 Jul 2018 06:47:34 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201807040647.w646lYpW098639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 4 Jul 2018 06:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335932 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 06:47:35 -0000 Author: hrs Date: Wed Jul 4 06:47:34 2018 New Revision: 335932 URL: https://svnweb.freebsd.org/changeset/base/335932 Log: - Fix a double unlock in inp_block_unblock_source() and lock leakage in inp_leave_group() which caused a panic. - Make order of CTR1() and IN_MULTI_LIST_LOCK() consistent around inm_merge(). Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Wed Jul 4 03:54:39 2018 (r335931) +++ head/sys/netinet/in_mcast.c Wed Jul 4 06:47:34 2018 (r335932) @@ -1579,23 +1579,24 @@ inp_block_unblock_source(struct inpcb *inp, struct soc * Begin state merge transaction at IGMP layer. */ IN_MULTI_LOCK(); - IN_MULTI_LIST_LOCK(); CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); + IN_MULTI_LIST_LOCK(); error = inm_merge(inm, imf); if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); + IN_MULTI_LIST_UNLOCK(); goto out_in_multi_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); error = igmp_change_state(inm); + IN_MULTI_LIST_UNLOCK(); if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); out_in_multi_locked: IN_MULTI_UNLOCK(); - IN_MULTI_UNLOCK(); out_imf_rollback: if (error) imf_rollback(imf); @@ -2492,6 +2493,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); + IN_MULTI_LIST_UNLOCK(); goto out_in_multi_locked; } @@ -2736,12 +2738,12 @@ inp_set_source_filters(struct inpcb *inp, struct socko INP_WLOCK_ASSERT(inp); IN_MULTI_LOCK(); - IN_MULTI_LIST_LOCK(); /* * Begin state merge transaction at IGMP layer. */ CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); + IN_MULTI_LIST_LOCK(); error = inm_merge(inm, imf); if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); From owner-svn-src-head@freebsd.org Wed Jul 4 07:35:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE47103CCA8; Wed, 4 Jul 2018 07:35:47 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.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 A8D648BF30; Wed, 4 Jul 2018 07:35:46 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 0EB4121E09; Wed, 4 Jul 2018 03:35:46 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute3.internal (MEProxy); Wed, 04 Jul 2018 03:35:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=C+XbPH AnqMmNTpY5aCXYZ/2iKxeTbaH1RM2/nJmiSaA=; b=KIzeHo2wOqnmBepRWxTfV8 0eI/VPevWmd8ulQntN9l1Qm5bMv+qGs3ny+onbzvg1HUiwFluGji0LLsY0Lob2cF vSjiodC9B8xZSP8aBttG3uvjHHcYwcPW2VQ6xx4+b+5v5Q7tC+Zky79q8P98jKbV 6j4nrAU45QurT8LwtBVavrNgf10YKHBE3fQ5HEIYXmvLFBiPyYC08tzvWsEPAxyD I3pUgQbX7XzVKLMZy7ChrsVfsZEs/DXwwrNieS6+3SGoqtYHioomZVhNfckWrXAX m4IT2L6r53Vk98LpNCroeqh+wkznQu0Qtw0Z9DKA+I6/xeBqww/bCrLgnPiF0wUw == X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id AD937BA4CF; Wed, 4 Jul 2018 03:35:45 -0400 (EDT) Message-Id: <1530689745.3452914.1429513640.05686FFD@webmail.messagingengine.com> From: Mark Felder To: Don Lewis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-0d8ea36c References: <201605262140.u4QLeDsn032206@repo.freebsd.org> In-Reply-To: <201605262140.u4QLeDsn032206@repo.freebsd.org> Subject: Re: svn commit: r300779 - in head: sbin/ipfw sys/modules/dummynet sys/netinet sys/netpfil/ipfw Date: Wed, 04 Jul 2018 02:35:45 -0500 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 07:35:47 -0000 On Thu, May 26, 2016, at 16:40, Don Lewis wrote: > Author: truckman > Date: Thu May 26 21:40:13 2016 > New Revision: 300779 > URL: https://svnweb.freebsd.org/changeset/base/300779 > > Log: > Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). > > Centre for Advanced Internet Architectures > > Implementing AQM in FreeBSD > > * Overview > > * Articles, Papers and Presentations > > > * Patches and Tools > None of these changes made it into the IPFW man page. Can we get this rectified? -- Mark Felder ports-secteam & portmgr member feld@FreeBSD.org From owner-svn-src-head@freebsd.org Wed Jul 4 07:37:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29095103CEDB; Wed, 4 Jul 2018 07:37:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCE7B8C0F0; Wed, 4 Jul 2018 07:37:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD17027DD2; Wed, 4 Jul 2018 07:37:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w647bjPc024196; Wed, 4 Jul 2018 07:37:45 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w647bjRf024195; Wed, 4 Jul 2018 07:37:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201807040737.w647bjRf024195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 4 Jul 2018 07:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335933 - head/stand/uboot/fdt X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/stand/uboot/fdt X-SVN-Commit-Revision: 335933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 07:37:46 -0000 Author: manu Date: Wed Jul 4 07:37:45 2018 New Revision: 335933 URL: https://svnweb.freebsd.org/changeset/base/335933 Log: loader: fdt: Try to load every possible DTB from u-boot U-Boot setup a few variables : - fdt_addr which is the board static dtb (most of the time loaded before u-boot or coming from some hardware like a ROM) - fdt_addr_r which is a location in RAM that holds the DTB loaded by u-boot or before u-boot In the case of u-boot + rpi firmware the DTB is loaded in RAM but the location still end up in the fdt_addr variable and the fdt_addr_r variable exist. Change the behavior so we test that a DTB exists for every possible variable : - fdt_addr_r is checked first as if u-boot needed to modify it the correct DTB will live there. - fdt_addr is checked second as if we run on a hardware with DTB in ROM it means that we what/need to run that - fdtaddr looks like a FreeBSD-ism but since I'm not sure leave it. Reviewed by: gonzo Differential Revision: https://reviews.freebsd.org/D16101 Modified: head/stand/uboot/fdt/uboot_fdt.c Modified: head/stand/uboot/fdt/uboot_fdt.c ============================================================================== --- head/stand/uboot/fdt/uboot_fdt.c Wed Jul 4 06:47:34 2018 (r335932) +++ head/stand/uboot/fdt/uboot_fdt.c Wed Jul 4 07:37:45 2018 (r335933) @@ -39,6 +39,30 @@ __FBSDID("$FreeBSD$"); #define STR(number) #number #define STRINGIFY(number) STR(number) +static int +fdt_platform_load_from_ubenv(const char *var) +{ + struct fdt_header *hdr; + const char *s; + char *p; + + s = ub_env_get(var); + if (s == NULL || *s == '\0') + return (1); + + hdr = (struct fdt_header *)strtoul(s, &p, 16); + if (*p != '\0') + return (1); + + if (fdt_load_dtb_addr(hdr) == 0) { + printf("Using DTB provided by U-Boot at " + "address %p.\n", hdr); + return (0); + } + + return (1); +} + int fdt_platform_load_dtb(void) { @@ -53,22 +77,12 @@ fdt_platform_load_dtb(void) * variable for fdt data loaded into ram is fdt_addr_r, so try that * first. Board vendors also use both fdtaddr and fdt_addr names. */ - s = ub_env_get("fdt_addr_r"); - if (s == NULL) - s = ub_env_get("fdtaddr"); - if (s == NULL) - s = ub_env_get("fdt_addr"); - if (s != NULL && *s != '\0') { - hdr = (struct fdt_header *)strtoul(s, &p, 16); - if (*p == '\0') { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by U-Boot at " - "address %p.\n", hdr); - rv = 0; - goto exit; - } - } - } + if ((rv = fdt_platform_load_from_ubenv("fdt_addr_r")) == 0) + goto exit; + if ((rv = fdt_platform_load_from_ubenv("fdt_addr")) == 0) + goto exit; + if ((rv = fdt_platform_load_from_ubenv("fdtaddr")) == 0) + goto exit; rv = 1; From owner-svn-src-head@freebsd.org Wed Jul 4 09:07:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65C401043B1E; Wed, 4 Jul 2018 09:07:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16BF88F5DD; Wed, 4 Jul 2018 09:07:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7F86CC5; Wed, 4 Jul 2018 09:07:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6497J5E069626; Wed, 4 Jul 2018 09:07:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6497I8G069619; Wed, 4 Jul 2018 09:07:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201807040907.w6497I8G069619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 4 Jul 2018 09:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335934 - in head/sys: cam cam/ata cam/nvme cam/scsi dev/acpica/Osd dev/pccbb kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: cam cam/ata cam/nvme cam/scsi dev/acpica/Osd dev/pccbb kern X-SVN-Commit-Revision: 335934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 09:07:20 -0000 Author: avg Date: Wed Jul 4 09:07:18 2018 New Revision: 335934 URL: https://svnweb.freebsd.org/changeset/base/335934 Log: remove unneeded inclusion of sys/interrupt.h from several files It's likely that the header was needed in the past for swi(9). But now that code does not use swi(9) or any other interfaces defined in sys/interrupt.h. MFC after: 1 week Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_xpt.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_xpt.c head/sys/dev/acpica/Osd/OsdSchedule.c head/sys/dev/pccbb/pccbb.c head/sys/kern/subr_bus.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Jul 4 07:37:45 2018 (r335933) +++ head/sys/cam/ata/ata_xpt.c Wed Jul 4 09:07:18 2018 (r335934) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Jul 4 07:37:45 2018 (r335933) +++ head/sys/cam/cam_xpt.c Wed Jul 4 09:07:18 2018 (r335934) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Wed Jul 4 07:37:45 2018 (r335933) +++ head/sys/cam/nvme/nvme_xpt.c Wed Jul 4 09:07:18 2018 (r335934) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Wed Jul 4 07:37:45 2018 (r335933) +++ head/sys/cam/scsi/scsi_xpt.c Wed Jul 4 09:07:18 2018 (r335934) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Wed Jul 4 07:37:45 2018 (r335933) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Wed Jul 4 09:07:18 2018 (r335934) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Wed Jul 4 07:37:45 2018 (r335933) +++ head/sys/dev/pccbb/pccbb.c Wed Jul 4 09:07:18 2018 (r335934) @@ -86,7 +86,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Jul 4 07:37:45 2018 (r335933) +++ head/sys/kern/subr_bus.c Wed Jul 4 09:07:18 2018 (r335934) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-head@freebsd.org Wed Jul 4 13:06:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D44251033B92; Wed, 4 Jul 2018 13:06:18 +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 33739792D5; Wed, 4 Jul 2018 13:06:17 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id ahU0fDlnGogHjahU1fy0dC; Wed, 04 Jul 2018 07:06:10 -0600 X-Authority-Analysis: v=2.3 cv=Sre+FsG0 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=R9QF1RCXAYgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=iXAkNv0ciYNlLkYxK1UA:9 a=ChqJunv8OnGla_vU:21 a=pGA5anpYcGnJs9qN: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 285FC189; Wed, 4 Jul 2018 06:06:08 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w64D5qeA002901; Wed, 4 Jul 2018 06:05:52 -0700 (PDT) (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 w64D5qiK002898; Wed, 4 Jul 2018 06:05:52 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807041305.w64D5qiK002898@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: Matt Macy cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335919 - head/sys/netinet6 In-Reply-To: Message from Matt Macy of "Tue, 03 Jul 2018 23:30:53 -0000." <201807032330.w63NUr6P074115@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Jul 2018 06:05:52 -0700 X-CMAE-Envelope: MS4wfOMOXp+lO13NcxrgxREzHyjubvfMM6nynrWf0ECwHZoVC5wIcJ6nMMlRxvcDJFVTWrvCcMsqEVJ65pkTGeIH704V8n+IuxzBUTonEwqN8KYfPYcPxhrL v0lSbhCXPasX6UIElieniNl/edO3YZSyO6iC6c6rJlLEQNKNUyOXEjHnsRK95EWgG+KgwrAfNHmshnbOSi/Mks5HoYB0kOVFTcRVfpAOzumj35Y0dtPIX5MA OPFSUIa2XFogXWGcRIxYcTYyYJ0hL9kX5E98876QT2c0ijufx9QLARgE4u04PyjH X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:06:19 -0000 Hi Matt, This is causing a panic of my gateway machine. Likely due to router solicitations. Disabling anything IPv6 in rc.conf avoids the panic. cwfw# grep '^# TEMP' /etc/rc.conf # TEMP ifconfig_sk0_ipv6="inet6 fc00:1:1:1::fffe prefixlen 64 -accept_rtadv" # TEMP ifconfig_nfe0_ipv6="inet6 fc00:1:1:2::fffe prefixlen 64 -accept_rtadv" # TEMP rtadvd_enable="YES" # Set to YES to enable an IPv6 router # TEMP rtadvd_interfaces="sk0 nfe0" # Interfaces rtadvd sends RA packets. # TEMP ipv6_gateway_enable="YES" # Set to YES if this host will be a gateway. # TEMP route6d_enable="YES" # Set to YES to enable an IPv6 routing daemon. cwfw# In message <201807032330.w63NUr6P074115@repo.freebsd.org>, Matt Macy writes: > Author: mmacy > Date: Tue Jul 3 23:30:53 2018 > New Revision: 335919 > URL: https://svnweb.freebsd.org/changeset/base/335919 > > Log: > udp6_input: validate inpcb before use > > When traversing pcbinfo lists (rather than calling lookup) we need to > explicitly validate an inpcb before use. > > Modified: > head/sys/netinet6/udp6_usrreq.c > > Modified: head/sys/netinet6/udp6_usrreq.c > ============================================================================= > = > --- head/sys/netinet6/udp6_usrreq.c Tue Jul 3 23:29:18 2018 (r33591 > 8) > +++ head/sys/netinet6/udp6_usrreq.c Tue Jul 3 23:30:53 2018 (r33591 > 9) > @@ -355,6 +355,10 @@ udp6_input(struct mbuf **mp, int *offp, int proto) > int blocked; > > INP_RLOCK(inp); > + if (__predict_false(inp->inp_flags2 & INP_FREED > )) { > + INP_RUNLOCK(inp); > + continue; > + } > > bzero(&mcaddr, sizeof(struct sockaddr_in6)); > mcaddr.sin6_len = sizeof(struct sockaddr_in6); > @@ -382,10 +386,12 @@ udp6_input(struct mbuf **mp, int *offp, int proto) > if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != > NULL) { > INP_RLOCK(last); > - UDP_PROBE(receive, NULL, last, ip6, > - last, uh); > - if (udp6_append(last, n, off, fromsa)) > - goto inp_lost; > + if (__predict_true(inp->inp_flags2 & IN > P_FREED) == 0) { > + UDP_PROBE(receive, NULL, last, > ip6, > + last, uh); > + if (udp6_append(last, n, off, f > romsa)) > + goto inp_lost; > + } > INP_RUNLOCK(last); > } > } > @@ -414,10 +420,13 @@ udp6_input(struct mbuf **mp, int *offp, int proto) > goto badheadlocked; > } > INP_RLOCK(last); > - INP_INFO_RUNLOCK(pcbinfo); > - UDP_PROBE(receive, NULL, last, ip6, last, uh); > - if (udp6_append(last, m, off, fromsa) == 0) > + if (__predict_true(inp->inp_flags2 & INP_FREED) == 0) { > + UDP_PROBE(receive, NULL, last, ip6, last, uh); > + if (udp6_append(last, m, off, fromsa) == 0) > + INP_RUNLOCK(last); > + } else > INP_RUNLOCK(last); > + INP_INFO_RUNLOCK(pcbinfo); > inp_lost: > return (IPPROTO_DONE); > } Here: Unread portion of the kernel message buffer: Fatal trap 12: page fault while in kernel mode cpuid = 1; apic id = 01 fault virtual address = 0x60 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff808312cf stack pointer = 0x28:0xfffffe00004b6700 frame pointer = 0x28:0xfffffe00004b6810 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq16: skc0) trap number = 12 panic: page fault cpuid = 1 time = 1530707882 KDB: stack backtrace: #0 0xffffffff80655217 at kdb_backtrace+0x67 #1 0xffffffff8060a803 at vpanic+0x1a3 #2 0xffffffff8060a653 at panic+0x43 #3 0xffffffff8094621f at trap_fatal+0x35f #4 0xffffffff80946279 at trap_pfault+0x49 #5 0xffffffff8094589e at trap+0x29e #6 0xffffffff80926afc at calltrap+0x8 #7 0xffffffff808123e8 at ip6_input+0xdd8 #8 0xffffffff80721756 at netisr_dispatch_src+0xd6 #9 0xffffffff8070e1c3 at ether_demux+0x163 #10 0xffffffff8070f326 at ether_nh_input+0x346 #11 0xffffffff80721756 at netisr_dispatch_src+0xd6 #12 0xffffffff8070e5c4 at ether_input+0x54 #13 0xffffffff813fdb81 at sk_rxeof+0x261 #14 0xffffffff813fd168 at sk_intr+0x118 #15 0xffffffff805ce299 at intr_event_execute_handlers+0xe9 #16 0xffffffff805ce5a7 at ithread_loop+0xe7 #17 0xffffffff805cb553 at fork_exit+0x83 Uptime: 1m35s Dumping 448 out of 4070 MB:..4%..11%..22%..33%..43%..54%..61%..72%..83%. .93% __curthread () at ./machine/pcpu.h:231 231 __asm("movq %%gs:%1,%0" : "=r" (td) (kgdb) bt #0 __curthread () at ./machine/pcpu.h:231 #1 doadump (textdump=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:366 #2 0xffffffff8060a3eb in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:446 #3 0xffffffff8060a863 in vpanic (fmt=, ap=0xfffffe00004b6450) at /opt/src/svn-current/sys/kern/kern_shutdown.c:863 #4 0xffffffff8060a653 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:790 #5 0xffffffff8094621f in trap_fatal (frame=0xfffffe00004b6640, eva=96) at /opt/src/svn-current/sys/amd64/amd64/trap.c:892 #6 0xffffffff80946279 in trap_pfault (frame=0xfffffe00004b6640, usermode=0) at /opt/src/svn-current/sys/amd64/amd64/trap.c:728 #7 0xffffffff8094589e in trap (frame=0xfffffe00004b6640) at /opt/src/svn-current/sys/amd64/amd64/trap.c:427 #8 #9 udp6_input (mp=, offp=, proto=) at /opt/src/svn-current/sys/netinet6/udp6_usrreq.c:424 #10 0xffffffff808123e8 in ip6_input (m=0xfffff80005044400) at /opt/src/svn-current/sys/netinet6/ip6_input.c:962 #11 0xffffffff80721756 in netisr_dispatch_src (proto=6, source=, m=0x1) ---Type to continue, or q to quit--- at /opt/src/svn-current/sys/net/netisr.c:1122 #12 0xffffffff8070e1c3 in ether_demux (ifp=0xfffff80003222800, m=0xfffff8000309a580) at /opt/src/svn-current/sys/net/if_ethersubr.c :873 #13 0xffffffff8070f326 in ether_input_internal (ifp=0xfffff80003222800, m=0xfffff8000309a580) at /opt/src/svn-current/sys/net/if_ethersubr.c :661 #14 ether_nh_input (m=) at /opt/src/svn-current/sys/net/if_ethersubr.c:691 #15 0xffffffff80721756 in netisr_dispatch_src (proto=5, source=, m=0x1) at /opt/src/svn-current/sys/net/netisr.c:1122 #16 0xffffffff8070e5c4 in ether_input (ifp=0xfffff80003222800, m=0x0) at /opt/src/svn-current/sys/net/if_ethersubr.c:781 #17 0xffffffff813fdb81 in sk_rxeof (sc_if=) at /opt/src/svn-current/sys/dev/sk/if_sk.c:2792 #18 0xffffffff813fd168 in sk_intr (xsc=0xfffff800031ac600) at /opt/src/svn-current/sys/dev/sk/if_sk.c:3119 #19 0xffffffff805ce299 in intr_event_execute_handlers (p= , ie=0xfffff8000205e500) at /opt/src/svn-current/sys/kern/kern_intr.c: 1013 #20 0xffffffff805ce5a7 in ithread_execute_handlers (ie=, p=) at /opt/src/svn-current/sys/kern/kern_intr.c:1026 #21 ithread_loop (arg=0xfffff80003029f60) at /opt/src/svn-current/sys/kern/kern_intr.c:1106 #22 0xffffffff805cb553 in fork_exit ( ---Type to continue, or q to quit---q callout=0xffffffff805ce4c0 , Quit (kgdb) frame 9 #9 udp6_input (mp=, offp=, proto=) at /opt/src/svn-current/sys/netinet6/udp6_usrreq.c:424 424 if (__predict_true(inp->inp_flags2 & INP_FREED) == 0) { (kgdb) l 419 UDPSTAT_INC(udps_noport); 420 UDPSTAT_INC(udps_noportmcast); 421 goto badheadlocked; 422 } 423 INP_RLOCK(last); 424 if (__predict_true(inp->inp_flags2 & INP_FREED) == 0) { 425 UDP_PROBE(receive, NULL, last, ip6, last, uh); 426 if (udp6_append(last, m, off, fromsa) == 0) 427 INP_RUNLOCK(last); 428 } else (kgdb) p last $1 = (kgdb) p inp->inp_flags2 value has been optimized out (kgdb) p inp $2 = (kgdb) -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jul 4 13:22:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CEF610350BE; Wed, 4 Jul 2018 13:22:49 +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 108DA7A036; Wed, 4 Jul 2018 13:22:49 +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 E55EB3AAC; Wed, 4 Jul 2018 13:22:48 +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 w64DMm7B002553; Wed, 4 Jul 2018 13:22:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DMmgv002552; Wed, 4 Jul 2018 13:22:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807041322.w64DMmgv002552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 4 Jul 2018 13:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335935 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:22:49 -0000 Author: kib Date: Wed Jul 4 13:22:48 2018 New Revision: 335935 URL: https://svnweb.freebsd.org/changeset/base/335935 Log: Add a way for the process to request cleanup of the kernel cache of the process arguments. New arguments length zero causes the drop of the pargs instead of allocation of useless zero-length buffer. Submitted by: Thomas Munro MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16111 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Jul 4 09:07:18 2018 (r335934) +++ head/sys/kern/kern_proc.c Wed Jul 4 13:22:48 2018 (r335935) @@ -1988,11 +1988,20 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARGS) if (req->newlen > ps_arg_cache_limit - sizeof(struct pargs)) return (ENOMEM); - newpa = pargs_alloc(req->newlen); - error = SYSCTL_IN(req, newpa->ar_args, req->newlen); - if (error != 0) { - pargs_free(newpa); - return (error); + + if (req->newlen == 0) { + /* + * Clear the argument pointer, so that we'll fetch arguments + * with proc_getargv() until further notice. + */ + newpa = NULL; + } else { + newpa = pargs_alloc(req->newlen); + error = SYSCTL_IN(req, newpa->ar_args, req->newlen); + if (error != 0) { + pargs_free(newpa); + return (error); + } } PROC_LOCK(p); pa = p->p_args; From owner-svn-src-head@freebsd.org Wed Jul 4 13:26:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F00CE1035457; Wed, 4 Jul 2018 13:26:47 +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 9E9A47A2D4; Wed, 4 Jul 2018 13:26:47 +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 7C59F3AB9; Wed, 4 Jul 2018 13:26:47 +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 w64DQlGP002758; Wed, 4 Jul 2018 13:26:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DQlGI002757; Wed, 4 Jul 2018 13:26:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041326.w64DQlGI002757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 13:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335936 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:26:48 -0000 Author: trasz Date: Wed Jul 4 13:26:47 2018 New Revision: 335936 URL: https://svnweb.freebsd.org/changeset/base/335936 Log: Use a macro for iteration. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:22:48 2018 (r335935) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:26:47 2018 (r335936) @@ -63,6 +63,8 @@ static volatile int alarm_fired; } \ } while (0) +#define BENCHMARK_FOREACH(I, NUM) for (I = 0; I < NUM && alarm_fired == 0; I++) + static void alarm_handler(int signum) { @@ -103,9 +105,7 @@ test_getuid(uintmax_t num, uintmax_t int_arg, const ch * call is MPSAFE. */ benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { getuid(); } benchmark_stop(); @@ -122,9 +122,7 @@ test_getppid(uintmax_t num, uintmax_t int_arg, const c * lock. */ benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { getppid(); } benchmark_stop(); @@ -138,9 +136,7 @@ test_getresuid(uintmax_t num, uintmax_t int_arg, const uintmax_t i; benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { (void)getresuid(&ruid, &euid, &suid); } benchmark_stop(); @@ -154,9 +150,7 @@ test_clock_gettime(uintmax_t num, uintmax_t int_arg, c uintmax_t i; benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { (void)clock_gettime(CLOCK_REALTIME, &ts); } benchmark_stop(); @@ -170,9 +164,7 @@ test_gettimeofday(uintmax_t num, uintmax_t int_arg, co uintmax_t i; benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { (void)gettimeofday(&tv, NULL); } benchmark_stop(); @@ -185,9 +177,7 @@ test_getpriority(uintmax_t num, uintmax_t int_arg, con uintmax_t i; benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { (void)getpriority(PRIO_PROCESS, 0); } benchmark_stop(); @@ -210,9 +200,7 @@ test_pipe(uintmax_t num, uintmax_t int_arg, const char close(fd[0]); close(fd[1]); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { if (pipe(fd) == -1) err(-1, "test_pipe: pipe"); close(fd[0]); @@ -238,9 +226,7 @@ test_select(uintmax_t num, uintmax_t int_arg, const ch tv.tv_usec = 0; benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { (void)select(0, &readfds, &writefds, &exceptfds, &tv); } benchmark_stop(); @@ -258,9 +244,7 @@ test_socket_stream(uintmax_t num, uintmax_t int_arg, c err(-1, "test_socket_stream: socket"); close(so); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { so = socket(int_arg, SOCK_STREAM, 0); if (so == -1) err(-1, "test_socket_stream: socket"); @@ -281,9 +265,7 @@ test_socket_dgram(uintmax_t num, uintmax_t int_arg, co err(-1, "test_socket_dgram: socket"); close(so); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { so = socket(int_arg, SOCK_DGRAM, 0); if (so == -1) err(-1, "test_socket_dgram: socket"); @@ -304,9 +286,7 @@ test_socketpair_stream(uintmax_t num, uintmax_t int_ar close(so[0]); close(so[1]); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { if (socketpair(PF_LOCAL, SOCK_STREAM, 0, so) == -1) err(-1, "test_socketpair_stream: socketpair"); close(so[0]); @@ -327,9 +307,7 @@ test_socketpair_dgram(uintmax_t num, uintmax_t int_arg close(so[0]); close(so[1]); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, so) == -1) err(-1, "test_socketpair_dgram: socketpair"); close(so[0]); @@ -351,9 +329,7 @@ test_access(uintmax_t num, uintmax_t int_arg, const ch close(fd); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { access(path, O_RDONLY); close(fd); } @@ -375,9 +351,7 @@ test_create_unlink(uintmax_t num, uintmax_t int_arg, c if (unlink(path) < 0) err(-1, "test_create_unlink: unlink: %s", path); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { fd = open(path, O_RDWR | O_CREAT, 0600); if (fd < 0) err(-1, "test_create_unlink: create: %s", path); @@ -401,9 +375,7 @@ test_open_close(uintmax_t num, uintmax_t int_arg, cons close(fd); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { fd = open(path, O_RDONLY); if (fd < 0) err(-1, "test_open_close: %s", path); @@ -419,9 +391,7 @@ test_bad_open(uintmax_t num, uintmax_t int_arg, const uintmax_t i; benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { open("", O_RDONLY); } benchmark_stop(); @@ -441,9 +411,7 @@ test_read(uintmax_t num, uintmax_t int_arg, const char (void)pread(fd, buf, int_arg, 0); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { (void)pread(fd, buf, int_arg, 0); } benchmark_stop(); @@ -465,9 +433,7 @@ test_open_read_close(uintmax_t num, uintmax_t int_arg, close(fd); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { fd = open(path, O_RDONLY); if (fd < 0) err(-1, "test_open_read_close: %s", path); @@ -490,9 +456,7 @@ test_dup(uintmax_t num, uintmax_t int_arg, const char if (fd >= 0) close(fd); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { fd = dup(shmfd); if (fd >= 0) close(fd); @@ -513,9 +477,7 @@ test_shmfd(uintmax_t num, uintmax_t int_arg, const cha err(-1, "test_shmfd: shm_open"); close(shmfd); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); if (shmfd < 0) err(-1, "test_shmfd: shm_open"); @@ -538,9 +500,7 @@ test_fstat_shmfd(uintmax_t num, uintmax_t int_arg, con if (fstat(shmfd, &sb) < 0) err(-1, "test_fstat_shmfd: fstat"); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { (void)fstat(shmfd, &sb); } benchmark_stop(); @@ -562,9 +522,7 @@ test_fork(uintmax_t num, uintmax_t int_arg, const char if (waitpid(pid, NULL, 0) < 0) err(-1, "test_fork: waitpid"); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { pid = fork(); if (pid < 0) err(-1, "test_fork: fork"); @@ -591,9 +549,7 @@ test_vfork(uintmax_t num, uintmax_t int_arg, const cha if (waitpid(pid, NULL, 0) < 0) err(-1, "test_vfork: waitpid"); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { pid = vfork(); if (pid < 0) err(-1, "test_vfork: vfork"); @@ -626,9 +582,7 @@ test_fork_exec(uintmax_t num, uintmax_t int_arg, const if (waitpid(pid, NULL, 0) < 0) err(-1, "test_fork: waitpid"); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { pid = fork(); if (pid < 0) err(-1, "test_fork_exec: fork"); @@ -659,9 +613,7 @@ test_vfork_exec(uintmax_t num, uintmax_t int_arg, cons if (waitpid(pid, NULL, 0) < 0) err(-1, "test_vfork_exec: waitpid"); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { pid = vfork(); if (pid < 0) err(-1, "test_vfork_exec: vfork"); @@ -684,9 +636,7 @@ test_chroot(uintmax_t num, uintmax_t int_arg, const ch if (chroot("/") < 0) err(-1, "test_chroot: chroot"); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { if (chroot("/") < 0) err(-1, "test_chroot: chroot"); } @@ -704,9 +654,7 @@ test_setuid(uintmax_t num, uintmax_t int_arg, const ch if (setuid(uid) < 0) err(-1, "test_setuid: setuid"); benchmark_start(); - for (i = 0; i < num; i++) { - if (alarm_fired) - break; + BENCHMARK_FOREACH(i, num) { if (setuid(uid) < 0) err(-1, "test_setuid: setuid"); } From owner-svn-src-head@freebsd.org Wed Jul 4 13:28:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46C9A10355F6; Wed, 4 Jul 2018 13:28:17 +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 E93657A49C; Wed, 4 Jul 2018 13:28:16 +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 C99E33AC1; Wed, 4 Jul 2018 13:28:16 +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 w64DSGqm002872; Wed, 4 Jul 2018 13:28:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DSGxa002871; Wed, 4 Jul 2018 13:28:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807041328.w64DSGxa002871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 4 Jul 2018 13:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335937 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:28:17 -0000 Author: kib Date: Wed Jul 4 13:28:16 2018 New Revision: 335937 URL: https://svnweb.freebsd.org/changeset/base/335937 Log: top: do not fall to the thread name if kernel cache of the process args is empty. Instead, use kvm_getargv() unconditionally to obtain the process arguments. It means that one additional sysctl(2) is performed there. Submitted by: Thomas Munro MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16111 Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Jul 4 13:26:47 2018 (r335936) +++ head/usr.bin/top/machine.c Wed Jul 4 13:28:16 2018 (r335937) @@ -951,7 +951,6 @@ format_next_process(struct handle * xhandle, char *(*g } } else { if (pp->ki_flag & P_SYSTEM || - pp->ki_args == NULL || (args = kvm_getargv(kd, pp, cmdlen)) == NULL || !(*args)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && From owner-svn-src-head@freebsd.org Wed Jul 4 13:28:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7D7810356A9; Wed, 4 Jul 2018 13:28:44 +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 5833D7A5F8; Wed, 4 Jul 2018 13:28:44 +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 398073AC8; Wed, 4 Jul 2018 13:28:44 +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 w64DSig5002934; Wed, 4 Jul 2018 13:28:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DSiW6002933; Wed, 4 Jul 2018 13:28:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041328.w64DSiW6002933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 13:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335938 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:28:44 -0000 Author: trasz Date: Wed Jul 4 13:28:43 2018 New Revision: 335938 URL: https://svnweb.freebsd.org/changeset/base/335938 Log: Add getprogname(3) (ie null) benchmark. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:28:16 2018 (r335937) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:28:43 2018 (r335938) @@ -184,7 +184,24 @@ test_getpriority(uintmax_t num, uintmax_t int_arg, con return (i); } +/* + * The point of this one is to figure out the cost of a call into libc, + * through PLT, and back. + */ uintmax_t +test_getprogname(uintmax_t num, uintmax_t int_arg, const char *path) +{ + uintmax_t i; + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + (void)getprogname(); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_pipe(uintmax_t num, uintmax_t int_arg, const char *path) { int fd[2], i; @@ -678,6 +695,7 @@ static const struct test tests[] = { { "clock_gettime", test_clock_gettime }, { "gettimeofday", test_gettimeofday }, { "getpriority", test_getpriority }, + { "getprogname", test_getprogname }, { "pipe", test_pipe }, { "select", test_select }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, From owner-svn-src-head@freebsd.org Wed Jul 4 13:31:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B502D10359D7; Wed, 4 Jul 2018 13:31:17 +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 689987AA33; Wed, 4 Jul 2018 13:31:17 +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 4A2693C25; Wed, 4 Jul 2018 13:31:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64DVHwY007498; Wed, 4 Jul 2018 13:31:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DVG5U007495; Wed, 4 Jul 2018 13:31:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807041331.w64DVG5U007495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 4 Jul 2018 13:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335939 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 335939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:31:18 -0000 Author: kib Date: Wed Jul 4 13:31:16 2018 New Revision: 335939 URL: https://svnweb.freebsd.org/changeset/base/335939 Log: Add setproctitle_fast(3) for frequent callers. Some applications, notably PostgreSQL, want to call setproctitle() very often. It's slow. Provide an alternative cheap way of updating process titles without making any syscalls, instead requiring other processes (top, ps etc) to do a bit more work to retrieve the data. This uses a pre-existing code path inherited from ancient BSD, which always did it that way. Submitted by: Thomas Munro MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D16111 Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/setproctitle.3 head/lib/libc/gen/setproctitle.c Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Wed Jul 4 13:28:43 2018 (r335938) +++ head/lib/libc/gen/Symbol.map Wed Jul 4 13:31:16 2018 (r335939) @@ -419,6 +419,7 @@ FBSD_1.5 { scandir; scandir_b; sem_clockwait_np; + setproctitle_fast; }; FBSDprivate_1.0 { Modified: head/lib/libc/gen/setproctitle.3 ============================================================================== --- head/lib/libc/gen/setproctitle.3 Wed Jul 4 13:28:43 2018 (r335938) +++ head/lib/libc/gen/setproctitle.3 Wed Jul 4 13:31:16 2018 (r335939) @@ -20,7 +20,7 @@ .\" $FreeBSD$ .\" .\" The following requests are required for all man pages. -.Dd December 16, 1995 +.Dd July 4, 2018 .Dt SETPROCTITLE 3 .Os .Sh NAME @@ -31,12 +31,20 @@ .In unistd.h .Ft void .Fn setproctitle "const char *fmt" "..." +.Ft void +.Fn setproctitle_fast "const char *fmt" "..." .Sh DESCRIPTION The .Fn setproctitle library routine sets the process title that appears on the .Xr ps 1 command. +The +.Fn setproctitle_fast +variant is optimized for high frequency updates, but may make the +.Xr ps 1 +command slightly slower by not updating the kernel cache of the program +arguments. .Pp The title is set from the executable's name, followed by the result of a @@ -96,6 +104,10 @@ The function first appeared in .Fx 2.2 . +The +.Fn setproctitle_fast +function first appeared in +.Fx 12 . Other operating systems have similar functions. .Sh AUTHORS Modified: head/lib/libc/gen/setproctitle.c ============================================================================== --- head/lib/libc/gen/setproctitle.c Wed Jul 4 13:28:43 2018 (r335938) +++ head/lib/libc/gen/setproctitle.c Wed Jul 4 13:31:16 2018 (r335939) @@ -55,8 +55,8 @@ struct old_ps_strings { #define SPT_BUFSIZE 2048 /* from other parts of sendmail */ -void -setproctitle(const char *fmt, ...) +static char * +setproctitle_internal(const char *fmt, va_list ap) { static struct ps_strings *ps_strings; static char *buf = NULL; @@ -67,27 +67,23 @@ setproctitle(const char *fmt, ...) char **nargvp; int nargc; int i; - va_list ap; size_t len; unsigned long ul_ps_strings; - int oid[4]; if (buf == NULL) { buf = malloc(SPT_BUFSIZE); if (buf == NULL) - return; + return (NULL); nargv[0] = buf; } if (obuf == NULL ) { obuf = malloc(SPT_BUFSIZE); if (obuf == NULL) - return; + return (NULL); *obuf = '\0'; } - va_start(ap, fmt); - if (fmt) { buf[SPT_BUFSIZE - 1] = '\0'; @@ -114,22 +110,13 @@ setproctitle(const char *fmt, ...) kbuf = obuf; } else /* Nothing to restore */ - return; + return (NULL); - va_end(ap); - - /* Set the title into the kernel cached command line */ - oid[0] = CTL_KERN; - oid[1] = KERN_PROC; - oid[2] = KERN_PROC_ARGS; - oid[3] = getpid(); - sysctl(oid, 4, 0, 0, kbuf, strlen(kbuf) + 1); - if (ps_strings == NULL) { len = sizeof(ul_ps_strings); if (sysctlbyname("kern.ps_strings", &ul_ps_strings, &len, NULL, 0) == -1) - return; + return (NULL); ps_strings = (struct ps_strings *)ul_ps_strings; } @@ -138,7 +125,7 @@ setproctitle(const char *fmt, ...) * Should not happen. */ if (ps_strings->ps_argvstr == NULL) - return; + return (NULL); /* style #3 */ if (oargc == -1) { @@ -167,4 +154,52 @@ setproctitle(const char *fmt, ...) } ps_strings->ps_nargvstr = nargc; ps_strings->ps_argvstr = nargvp; + + return (nargvp[0]); +} + +static int fast_update = 0; + +void +setproctitle_fast(const char *fmt, ...) +{ + va_list ap; + char *buf; + int oid[4]; + + va_start(ap, fmt); + buf = setproctitle_internal(fmt, ap); + va_end(ap); + + if (buf && !fast_update) { + /* Tell the kernel to start looking in user-space */ + oid[0] = CTL_KERN; + oid[1] = KERN_PROC; + oid[2] = KERN_PROC_ARGS; + oid[3] = getpid(); + sysctl(oid, 4, 0, 0, "", 0); + fast_update = 1; + } +} + +void +setproctitle(const char *fmt, ...) +{ + va_list ap; + char *buf; + int oid[4]; + + va_start(ap, fmt); + buf = setproctitle_internal(fmt, ap); + va_end(ap); + + if (buf != NULL) { + /* Set the title into the kernel cached command line */ + oid[0] = CTL_KERN; + oid[1] = KERN_PROC; + oid[2] = KERN_PROC_ARGS; + oid[3] = getpid(); + sysctl(oid, 4, 0, 0, buf, strlen(buf) + 1); + fast_update = 0; + } } From owner-svn-src-head@freebsd.org Wed Jul 4 13:31:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B9941035AB2; Wed, 4 Jul 2018 13:31:56 +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 414337AC00; Wed, 4 Jul 2018 13:31:56 +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 2268A3C61; Wed, 4 Jul 2018 13:31:56 +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 w64DVuLC007570; Wed, 4 Jul 2018 13:31:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DVtdJ007568; Wed, 4 Jul 2018 13:31:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041331.w64DVtdJ007568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 13:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335940 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:31:57 -0000 Author: trasz Date: Wed Jul 4 13:31:55 2018 New Revision: 335940 URL: https://svnweb.freebsd.org/changeset/base/335940 Log: Make syscall_timing(1) build with WARNS=6. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/Makefile head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/Makefile ============================================================================== --- head/tools/tools/syscall_timing/Makefile Wed Jul 4 13:31:16 2018 (r335939) +++ head/tools/tools/syscall_timing/Makefile Wed Jul 4 13:31:55 2018 (r335940) @@ -6,4 +6,6 @@ PROG= syscall_timing CFLAGS+= -static -O MAN= +WARNS= 6 + .include Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:31:16 2018 (r335939) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:31:55 2018 (r335940) @@ -66,7 +66,7 @@ static volatile int alarm_fired; #define BENCHMARK_FOREACH(I, NUM) for (I = 0; I < NUM && alarm_fired == 0; I++) static void -alarm_handler(int signum) +alarm_handler(int signum __unused) { alarm_fired = 1; @@ -95,8 +95,8 @@ benchmark_stop(void) assert(error == 0); } -uintmax_t -test_getuid(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_getuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; @@ -112,8 +112,8 @@ test_getuid(uintmax_t num, uintmax_t int_arg, const ch return (i); } -uintmax_t -test_getppid(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_getppid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; @@ -129,8 +129,8 @@ test_getppid(uintmax_t num, uintmax_t int_arg, const c return (i); } -uintmax_t -test_getresuid(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_getresuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uid_t ruid, euid, suid; uintmax_t i; @@ -143,8 +143,8 @@ test_getresuid(uintmax_t num, uintmax_t int_arg, const return (i); } -uintmax_t -test_clock_gettime(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_clock_gettime(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { struct timespec ts; uintmax_t i; @@ -157,8 +157,8 @@ test_clock_gettime(uintmax_t num, uintmax_t int_arg, c return (i); } -uintmax_t -test_gettimeofday(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_gettimeofday(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { struct timeval tv; uintmax_t i; @@ -171,8 +171,8 @@ test_gettimeofday(uintmax_t num, uintmax_t int_arg, co return (i); } -uintmax_t -test_getpriority(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_getpriority(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; @@ -188,8 +188,8 @@ test_getpriority(uintmax_t num, uintmax_t int_arg, con * The point of this one is to figure out the cost of a call into libc, * through PLT, and back. */ -uintmax_t -test_getprogname(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_getprogname(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; @@ -201,10 +201,11 @@ test_getprogname(uintmax_t num, uintmax_t int_arg, con return (i); } -uintmax_t -test_pipe(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_pipe(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { - int fd[2], i; + int fd[2]; + uintmax_t i; /* * pipe creation is expensive, as it will allocate a new file @@ -227,13 +228,12 @@ test_pipe(uintmax_t num, uintmax_t int_arg, const char return (i); } -uintmax_t -test_select(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_select(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { fd_set readfds, writefds, exceptfds; struct timeval tv; uintmax_t i; - int error; FD_ZERO(&readfds); FD_ZERO(&writefds); @@ -250,8 +250,8 @@ test_select(uintmax_t num, uintmax_t int_arg, const ch return (i); } -uintmax_t -test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path __unused) { uintmax_t i; int so; @@ -271,8 +271,8 @@ test_socket_stream(uintmax_t num, uintmax_t int_arg, c return (i); } -uintmax_t -test_socket_dgram(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_socket_dgram(uintmax_t num, uintmax_t int_arg, const char *path __unused) { uintmax_t i; int so; @@ -292,8 +292,8 @@ test_socket_dgram(uintmax_t num, uintmax_t int_arg, co return (i); } -uintmax_t -test_socketpair_stream(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_socketpair_stream(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; int so[2]; @@ -313,8 +313,8 @@ test_socketpair_stream(uintmax_t num, uintmax_t int_ar return (i); } -uintmax_t -test_socketpair_dgram(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_socketpair_dgram(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; int so[2]; @@ -334,8 +334,8 @@ test_socketpair_dgram(uintmax_t num, uintmax_t int_arg return (i); } -uintmax_t -test_access(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_access(uintmax_t num, uintmax_t int_arg __unused, const char *path) { uintmax_t i; int fd; @@ -354,8 +354,8 @@ test_access(uintmax_t num, uintmax_t int_arg, const ch return (i); } -uintmax_t -test_create_unlink(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_create_unlink(uintmax_t num, uintmax_t int_arg __unused, const char *path) { uintmax_t i; int fd; @@ -380,8 +380,8 @@ test_create_unlink(uintmax_t num, uintmax_t int_arg, c return (i); } -uintmax_t -test_open_close(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_open_close(uintmax_t num, uintmax_t int_arg __unused, const char *path) { uintmax_t i; int fd; @@ -402,8 +402,8 @@ test_open_close(uintmax_t num, uintmax_t int_arg, cons return (i); } -uintmax_t -test_bad_open(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_bad_open(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; @@ -415,7 +415,7 @@ test_bad_open(uintmax_t num, uintmax_t int_arg, const return (i); } -uintmax_t +static uintmax_t test_read(uintmax_t num, uintmax_t int_arg, const char *path) { char buf[int_arg]; @@ -436,7 +436,7 @@ test_read(uintmax_t num, uintmax_t int_arg, const char return (i); } -uintmax_t +static uintmax_t test_open_read_close(uintmax_t num, uintmax_t int_arg, const char *path) { char buf[int_arg]; @@ -461,10 +461,11 @@ test_open_read_close(uintmax_t num, uintmax_t int_arg, return (i); } -uintmax_t -test_dup(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_dup(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { - int fd, i, shmfd; + uintmax_t i; + int fd, shmfd; shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); if (shmfd < 0) @@ -483,8 +484,8 @@ test_dup(uintmax_t num, uintmax_t int_arg, const char return (i); } -uintmax_t -test_shmfd(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_shmfd(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; int shmfd; @@ -504,8 +505,8 @@ test_shmfd(uintmax_t num, uintmax_t int_arg, const cha return (i); } -uintmax_t -test_fstat_shmfd(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_fstat_shmfd(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { struct stat sb; uintmax_t i; @@ -525,8 +526,8 @@ test_fstat_shmfd(uintmax_t num, uintmax_t int_arg, con return (i); } -uintmax_t -test_fork(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_fork(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { pid_t pid; uintmax_t i; @@ -552,8 +553,8 @@ test_fork(uintmax_t num, uintmax_t int_arg, const char return (i); } -uintmax_t -test_vfork(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_vfork(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { pid_t pid; uintmax_t i; @@ -580,11 +581,11 @@ test_vfork(uintmax_t num, uintmax_t int_arg, const cha } #define USR_BIN_TRUE "/usr/bin/true" -static char *execve_args[] = { USR_BIN_TRUE, NULL}; +static char *execve_args[] = { __DECONST(char *, USR_BIN_TRUE), NULL}; extern char **environ; -uintmax_t -test_fork_exec(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_fork_exec(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { pid_t pid; uintmax_t i; @@ -614,8 +615,8 @@ test_fork_exec(uintmax_t num, uintmax_t int_arg, const return (i); } -uintmax_t -test_vfork_exec(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_vfork_exec(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { pid_t pid; uintmax_t i; @@ -645,8 +646,8 @@ test_vfork_exec(uintmax_t num, uintmax_t int_arg, cons return (i); } -uintmax_t -test_chroot(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_chroot(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; @@ -661,8 +662,8 @@ test_chroot(uintmax_t num, uintmax_t int_arg, const ch return (i); } -uintmax_t -test_setuid(uintmax_t num, uintmax_t int_arg, const char *path) +static uintmax_t +test_setuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uid_t uid; uintmax_t i; @@ -689,24 +690,24 @@ struct test { #define FLAG_PATH 0x00000001 static const struct test tests[] = { - { "getuid", test_getuid }, - { "getppid", test_getppid }, - { "getresuid", test_getresuid }, - { "clock_gettime", test_clock_gettime }, - { "gettimeofday", test_gettimeofday }, - { "getpriority", test_getpriority }, - { "getprogname", test_getprogname }, - { "pipe", test_pipe }, - { "select", test_select }, + { "getuid", test_getuid, .t_flags = 0 }, + { "getppid", test_getppid, .t_flags = 0 }, + { "getresuid", test_getresuid, .t_flags = 0 }, + { "clock_gettime", test_clock_gettime, .t_flags = 0 }, + { "gettimeofday", test_gettimeofday, .t_flags = 0 }, + { "getpriority", test_getpriority, .t_flags = 0 }, + { "getprogname", test_getprogname, .t_flags = 0 }, + { "pipe", test_pipe, .t_flags = 0 }, + { "select", test_select, .t_flags = 0 }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL }, - { "socketpair_stream", test_socketpair_stream }, - { "socketpair_dgram", test_socketpair_dgram }, + { "socketpair_stream", test_socketpair_stream, .t_flags = 0 }, + { "socketpair_dgram", test_socketpair_dgram, .t_flags = 0 }, { "socket_tcp", test_socket_stream, .t_int = PF_INET }, { "socket_udp", test_socket_dgram, .t_int = PF_INET }, { "access", test_access, .t_flags = FLAG_PATH }, { "create_unlink", test_create_unlink, .t_flags = FLAG_PATH }, - { "bad_open", test_bad_open }, + { "bad_open", test_bad_open, .t_flags = 0 }, { "open_close", test_open_close, .t_flags = FLAG_PATH }, { "open_read_close_1", test_open_read_close, .t_flags = FLAG_PATH, .t_int = 1 }, @@ -729,15 +730,15 @@ static const struct test tests[] = { { "read_10000", test_read, .t_flags = FLAG_PATH, .t_int = 10000 }, { "read_100000", test_read, .t_flags = FLAG_PATH, .t_int = 100000 }, { "read_1000000", test_read, .t_flags = FLAG_PATH, .t_int = 1000000 }, - { "dup", test_dup }, - { "shmfd", test_shmfd }, - { "fstat_shmfd", test_fstat_shmfd }, - { "fork", test_fork }, - { "vfork", test_vfork }, - { "fork_exec", test_fork_exec }, - { "vfork_exec", test_vfork_exec }, - { "chroot", test_chroot }, - { "setuid", test_setuid }, + { "dup", test_dup, .t_flags = 0 }, + { "shmfd", test_shmfd, .t_flags = 0 }, + { "fstat_shmfd", test_fstat_shmfd, .t_flags = 0 }, + { "fork", test_fork, .t_flags = 0 }, + { "vfork", test_vfork, .t_flags = 0 }, + { "fork_exec", test_fork_exec, .t_flags = 0 }, + { "vfork_exec", test_vfork_exec, .t_flags = 0 }, + { "chroot", test_chroot, .t_flags = 0 }, + { "setuid", test_setuid, .t_flags = 0 }, }; static const int tests_count = sizeof(tests) / sizeof(tests[0]); @@ -762,8 +763,8 @@ main(int argc, char *argv[]) char *tmp_dir, *tmp_path; long long ll; char *endp; - int ch, fd, error, i, j, k, rv; - uintmax_t iterations, loops; + int ch, fd, error, i, j, rv; + uintmax_t iterations, k, loops; alarm_timeout = 1; iterations = 0; @@ -877,7 +878,7 @@ main(int argc, char *argv[]) calls = the_test->t_func(iterations, the_test->t_int, path); timespecsub(&ts_end, &ts_start); - printf("%s\t%d\t", the_test->t_name, k); + printf("%s\t%ju\t", the_test->t_name, k); printf("%ju.%09ju\t%ju\t", (uintmax_t)ts_end.tv_sec, (uintmax_t)ts_end.tv_nsec, calls); From owner-svn-src-head@freebsd.org Wed Jul 4 13:34:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C26E3103712C; Wed, 4 Jul 2018 13:34:34 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B4597AF41; Wed, 4 Jul 2018 13:34:34 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 49F94408181D; Wed, 4 Jul 2018 16:34:31 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2r4NZv1Hcv-YVoK9f6r; Wed, 04 Jul 2018 16:34:31 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1530711271; bh=3LNzjYcAvicXB/TBZ9lSoaO2mh+WJCbkvRIoFEDc7aI=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=jNynw5mz38DnnhETT0b2YFh8bFK3YiAx2tUNIVMWSedQHLuINTxr2tn7xiXkdyjYZ TLCtYFLlhEiIwLqHuBUeKhIut74km4amtdHpc/uPkEZzYGzMU8jXp2DshGdjVI0K3p 7pM2+18ospB97JS+hoaI0NIJU4pYB+9F1FKFsgnk= Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id RmwVJ1Qvbc-YUOWxVdD; Wed, 04 Jul 2018 16:34:30 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1530711270; bh=3LNzjYcAvicXB/TBZ9lSoaO2mh+WJCbkvRIoFEDc7aI=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=XJVmyxZ7pxF4eeOua3Uwv2WjvoOdAfSJ9FjxE9dbue+yegDxs3c0Ig0Ap4yT1ECL8 quGvNL/bP7528/qkKeaGbJoUJVpQB+y+1DkFWw889AnsXP5rkXdkDqMYyrWAawYQip TS1Nc5b1hEW4YLZY9Oa/q2Y54iYviC7cTEovJgVw= Authentication-Results: smtp2p.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r335919 - head/sys/netinet6 To: Cy Schubert , Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807041305.w64D5qiK002898@slippy.cwsent.com> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <13fa004f-6d8a-025e-9d4f-957f081113b4@yandex.ru> Date: Wed, 4 Jul 2018 16:31:04 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807041305.w64D5qiK002898@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DYq4DERiQq8E3pDWhQQJu3pRxNkEa3XRw" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:34:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DYq4DERiQq8E3pDWhQQJu3pRxNkEa3XRw Content-Type: multipart/mixed; boundary="3UyYmNTJPMJYH4JeWdQTZY41T0JnKZ9UW"; protected-headers="v1" From: "Andrey V. Elsukov" To: Cy Schubert , Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <13fa004f-6d8a-025e-9d4f-957f081113b4@yandex.ru> Subject: Re: svn commit: r335919 - head/sys/netinet6 References: <201807041305.w64D5qiK002898@slippy.cwsent.com> In-Reply-To: <201807041305.w64D5qiK002898@slippy.cwsent.com> --3UyYmNTJPMJYH4JeWdQTZY41T0JnKZ9UW Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04.07.2018 16:05, Cy Schubert wrote: > Hi Matt, >=20 > This is causing a panic of my gateway machine. Likely due to router=20 > solicitations. Hi, probably in the last two chunks "inp" should be replaced with "last" Index: udp6_usrreq.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- udp6_usrreq.c (revision 335934) +++ udp6_usrreq.c (working copy) @@ -387,7 +387,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) if ((n =3D m_copym(m, 0, M_COPYALL, M_NOWAIT)) !=3D NULL) { INP_RLOCK(last); - if (__predict_true(inp->inp_flags2 & INP_FREED) =3D=3D 0) { + if (__predict_true(last->inp_flags2 & INP_FREED) =3D=3D 0) { UDP_PROBE(receive, NULL, last, ip6, last, uh); if (udp6_append(last, n, off, fromsa)) @@ -421,7 +421,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) goto badheadlocked; } INP_RLOCK(last); - if (__predict_true(inp->inp_flags2 & INP_FREED) =3D=3D 0) { + if (__predict_true(last->inp_flags2 & INP_FREED) =3D=3D 0) { UDP_PROBE(receive, NULL, last, ip6, last, uh); if (udp6_append(last, m, off, fromsa) =3D=3D 0) INP_RUNLOCK(last); --=20 WBR, Andrey V. Elsukov --3UyYmNTJPMJYH4JeWdQTZY41T0JnKZ9UW-- --DYq4DERiQq8E3pDWhQQJu3pRxNkEa3XRw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAls8zBgACgkQAcXqBBDI oXpnJwf/ZG+4ubzE/aIyOTWkmt9F0H3oXDsQmJurDT4Eo7okLFaFcXqFqnjJU06I wKeiqb/h537MZB1qwmk4LK44DEliepAkJ6bpx1Wo/+z3d5gT3Z7HVssB0Asq0lHd BZO8WDmqovI1aajUsTMr4bkhutzB1juPU+aWrvk70N9nSbp8WC2DGShx3RdUQVvb t9pL4FrMsBV4JTSFj96iulKqTwaoDAS8mZSmbd4ONiawZ1kVd50EA70dxL/qWpcC BiSbrTv1qfDRc2oofDkHkQipGXayN4+CWCsH9DvLGxLIyyeL1oaDyQxnt5R6Uw39 6nuLtodHpt+QFJLz5xFk+iQlARIfGw== =Ci2t -----END PGP SIGNATURE----- --DYq4DERiQq8E3pDWhQQJu3pRxNkEa3XRw-- From owner-svn-src-head@freebsd.org Wed Jul 4 13:34:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20AB103716F; Wed, 4 Jul 2018 13:34:45 +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 A57907B028; Wed, 4 Jul 2018 13:34:44 +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 3A5E53C88; Wed, 4 Jul 2018 13:34:44 +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 w64DYhAD007747; Wed, 4 Jul 2018 13:34:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DYhQu007746; Wed, 4 Jul 2018 13:34:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041334.w64DYhQu007746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 13:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335941 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:34:46 -0000 Author: trasz Date: Wed Jul 4 13:34:43 2018 New Revision: 335941 URL: https://svnweb.freebsd.org/changeset/base/335941 Log: Add a trivial "pipe ping" (two processes) benchmark. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:31:55 2018 (r335940) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:34:43 2018 (r335941) @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -251,6 +252,52 @@ test_select(uintmax_t num, uintmax_t int_arg __unused, } static uintmax_t +test_pipeping(uintmax_t num, uintmax_t int_arg, const char *path __unused) +{ + char buf[int_arg]; + uintmax_t i; + ssize_t ret; + pid_t pid; + int fd[2], procfd; + + if (pipe(fd) < 0) + err(-1, "pipe"); + + pid = pdfork(&procfd, 0); + if (pid < 0) + err(1, "pdfork"); + + if (pid == 0) { + close(fd[0]); + + for (;;) { + ret = read(fd[1], buf, int_arg); + if ((uintmax_t)ret != int_arg) + err(1, "read"); + ret = write(fd[1], buf, int_arg); + if ((uintmax_t)ret != int_arg) + err(1, "write"); + } + } + + close(fd[1]); + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + ret = write(fd[0], buf, int_arg); + if ((uintmax_t)ret != int_arg) + err(1, "write"); + ret = read(fd[0], buf, int_arg); + if ((uintmax_t)ret != int_arg) + err(1, "read"); + } + benchmark_stop(); + + close(procfd); + return (i); +} + +static uintmax_t test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path __unused) { uintmax_t i; @@ -694,6 +741,18 @@ static const struct test tests[] = { { "getppid", test_getppid, .t_flags = 0 }, { "getresuid", test_getresuid, .t_flags = 0 }, { "clock_gettime", test_clock_gettime, .t_flags = 0 }, + { "pipeping_1", test_pipeping, .t_flags = 0, .t_int = 1 }, + { "pipeping_10", test_pipeping, .t_flags = 0, .t_int = 10 }, + { "pipeping_100", test_pipeping, .t_flags = 0, .t_int = 100 }, + { "pipeping_1000", test_pipeping, .t_flags = 0, .t_int = 1000 }, + { "pipeping_10000", test_pipeping, .t_flags = 0, .t_int = 10000 }, +#ifdef notyet + /* + * XXX: Doesn't work; kernel pipe buffer too small? + */ + { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 }, + { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = 1000000 }, + #endif { "gettimeofday", test_gettimeofday, .t_flags = 0 }, { "getpriority", test_getpriority, .t_flags = 0 }, { "getprogname", test_getprogname, .t_flags = 0 }, From owner-svn-src-head@freebsd.org Wed Jul 4 13:38:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A06371037604; Wed, 4 Jul 2018 13:38:03 +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 4EACA7B3E1; Wed, 4 Jul 2018 13:38:03 +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 2FC0A3C8E; Wed, 4 Jul 2018 13:38:03 +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 w64Dc35H008059; Wed, 4 Jul 2018 13:38:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64Dc3UX008058; Wed, 4 Jul 2018 13:38:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201807041338.w64Dc3UX008058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Jul 2018 13:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335942 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 335942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:38:03 -0000 Author: emaste Date: Wed Jul 4 13:38:02 2018 New Revision: 335942 URL: https://svnweb.freebsd.org/changeset/base/335942 Log: muge(4): remove DTB MAC addr from TODO list after r335925 Also replace numbered list with - bulleted so the list entries do not need to be renumbered as tasks are completed. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Wed Jul 4 13:34:43 2018 (r335941) +++ head/sys/dev/usb/net/if_muge.c Wed Jul 4 13:38:02 2018 (r335942) @@ -54,16 +54,14 @@ __FBSDID("$FreeBSD$"); * A number of features supported by the lan78xx are not yet implemented in * this driver: * - * 1. RX/TX checksum offloading: Nothing has been implemented yet for - * TX checksumming. RX checksumming works with ICMP messages, but is broken - * for TCP/UDP packets. - * 2. Direct address translation filtering: Implemented but untested. - * 3. VLAN tag removal. - * 4. Reading MAC address from the device tree: Specific to the RPi 3B+. - * Currently, the driver assigns a random MAC address itself. - * 5. Support for USB interrupt endpoints. - * 6. Latency Tolerance Messaging (LTM) support. - * 7. TCP LSO support. + * - RX/TX checksum offloading: Nothing has been implemented yet for + * TX checksumming. RX checksumming works with ICMP messages, but is broken + * for TCP/UDP packets. + * - Direct address translation filtering: Implemented but untested. + * - VLAN tag removal. + * - Support for USB interrupt endpoints. + * - Latency Tolerance Messaging (LTM) support. + * - TCP LSO support. * */ From owner-svn-src-head@freebsd.org Wed Jul 4 13:39:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09BFA1037825; Wed, 4 Jul 2018 13:39:50 +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 B31FE7B5B6; Wed, 4 Jul 2018 13:39: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 959963C90; Wed, 4 Jul 2018 13:39: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 w64Ddnje008169; Wed, 4 Jul 2018 13:39:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64Ddndw008168; Wed, 4 Jul 2018 13:39:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041339.w64Ddndw008168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 13:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335943 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:39:50 -0000 Author: trasz Date: Wed Jul 4 13:39:48 2018 New Revision: 335943 URL: https://svnweb.freebsd.org/changeset/base/335943 Log: Add threaded pipe ping benchmark. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/Makefile head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/Makefile ============================================================================== --- head/tools/tools/syscall_timing/Makefile Wed Jul 4 13:38:02 2018 (r335942) +++ head/tools/tools/syscall_timing/Makefile Wed Jul 4 13:39:48 2018 (r335943) @@ -6,6 +6,8 @@ PROG= syscall_timing CFLAGS+= -static -O MAN= +LIBADD= pthread + WARNS= 6 .include Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:38:02 2018 (r335942) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:39:48 2018 (r335943) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -158,7 +159,74 @@ test_clock_gettime(uintmax_t num, uintmax_t int_arg __ return (i); } +struct pipepingtd_ctx { + int fd; + uintmax_t int_arg; +}; + +static void * +pipepingtd_proc(void *arg) +{ + struct pipepingtd_ctx *ctxp; + int fd; + void *buf; + uintmax_t int_arg; + ssize_t ret; + + ctxp = arg; + fd = ctxp->fd; + int_arg = ctxp->int_arg; + + buf = malloc(int_arg); + if (buf == NULL) + err(1, "malloc"); + + for (;;) { + ret = read(fd, buf, int_arg); + if ((uintmax_t)ret != int_arg) + err(1, "read"); + ret = write(fd, buf, int_arg); + if ((uintmax_t)ret != int_arg) + err(1, "write"); + } +} + static uintmax_t +test_pipepingtd(uintmax_t num, uintmax_t int_arg, const char *path __unused) +{ + struct pipepingtd_ctx ctx; + char buf[int_arg]; + pthread_t td; + uintmax_t i; + ssize_t ret; + int error, fd[2]; + + if (pipe(fd) < 0) + err(-1, "pipe"); + + ctx.fd = fd[1]; + ctx.int_arg = int_arg; + + error = pthread_create(&td, NULL, pipepingtd_proc, &ctx); + if (error != 0) + err(1, "pthread_create"); + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + ret = write(fd[0], buf, int_arg); + if ((uintmax_t)ret != int_arg) + err(1, "write"); + ret = read(fd[0], buf, int_arg); + if ((uintmax_t)ret != int_arg) + err(1, "read"); + } + benchmark_stop(); + pthread_cancel(td); + + return (i); +} + +static uintmax_t test_gettimeofday(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { struct timeval tv; @@ -752,6 +820,18 @@ static const struct test tests[] = { */ { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 }, { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = 1000000 }, +#endif + { "pipepingtd_1", test_pipepingtd, .t_flags = 0, .t_int = 1 }, + { "pipepingtd_10", test_pipepingtd, .t_flags = 0, .t_int = 10 }, + { "pipepingtd_100", test_pipepingtd, .t_flags = 0, .t_int = 100 }, + { "pipepingtd_1000", test_pipepingtd, .t_flags = 0, .t_int = 1000 }, + { "pipepingtd_10000", test_pipepingtd, .t_flags = 0, .t_int = 10000 }, +#ifdef notyet + /* + * XXX: Doesn't work; kernel pipe buffer too small? + */ + { "pipepingtd_100000", test_pipepingtd, .t_flags = 0, .t_int = 100000 }, + { "pipepingtd_1000000", test_pipepingtd, .t_flags = 0, .t_int = 1000000 }, #endif { "gettimeofday", test_gettimeofday, .t_flags = 0 }, { "getpriority", test_getpriority, .t_flags = 0 }, From owner-svn-src-head@freebsd.org Wed Jul 4 13:45:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A5471037F7E; Wed, 4 Jul 2018 13:45:30 +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 BAE7F7BB22; Wed, 4 Jul 2018 13:45:29 +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 914473E25; Wed, 4 Jul 2018 13:45:29 +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 w64DjTPs013172; Wed, 4 Jul 2018 13:45:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DjTAv013171; Wed, 4 Jul 2018 13:45:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041345.w64DjTAv013171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 13:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335944 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:45:30 -0000 Author: trasz Date: Wed Jul 4 13:45:29 2018 New Revision: 335944 URL: https://svnweb.freebsd.org/changeset/base/335944 Log: Make the pipeping benchmarks work with larger buffer sizes. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:39:48 2018 (r335943) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:45:29 2018 (r335944) @@ -159,74 +159,7 @@ test_clock_gettime(uintmax_t num, uintmax_t int_arg __ return (i); } -struct pipepingtd_ctx { - int fd; - uintmax_t int_arg; -}; - -static void * -pipepingtd_proc(void *arg) -{ - struct pipepingtd_ctx *ctxp; - int fd; - void *buf; - uintmax_t int_arg; - ssize_t ret; - - ctxp = arg; - fd = ctxp->fd; - int_arg = ctxp->int_arg; - - buf = malloc(int_arg); - if (buf == NULL) - err(1, "malloc"); - - for (;;) { - ret = read(fd, buf, int_arg); - if ((uintmax_t)ret != int_arg) - err(1, "read"); - ret = write(fd, buf, int_arg); - if ((uintmax_t)ret != int_arg) - err(1, "write"); - } -} - static uintmax_t -test_pipepingtd(uintmax_t num, uintmax_t int_arg, const char *path __unused) -{ - struct pipepingtd_ctx ctx; - char buf[int_arg]; - pthread_t td; - uintmax_t i; - ssize_t ret; - int error, fd[2]; - - if (pipe(fd) < 0) - err(-1, "pipe"); - - ctx.fd = fd[1]; - ctx.int_arg = int_arg; - - error = pthread_create(&td, NULL, pipepingtd_proc, &ctx); - if (error != 0) - err(1, "pthread_create"); - - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - ret = write(fd[0], buf, int_arg); - if ((uintmax_t)ret != int_arg) - err(1, "write"); - ret = read(fd[0], buf, int_arg); - if ((uintmax_t)ret != int_arg) - err(1, "read"); - } - benchmark_stop(); - pthread_cancel(td); - - return (i); -} - -static uintmax_t test_gettimeofday(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { struct timeval tv; @@ -319,12 +252,41 @@ test_select(uintmax_t num, uintmax_t int_arg __unused, return (i); } +static void +readx(int fd, char *buf, size_t size) +{ + ssize_t ret; + + do { + ret = read(fd, buf, size); + if (ret == -1) + err(1, "read"); + assert((size_t)ret <= size); + size -= ret; + buf += ret; + } while (size > 0); +} + +static void +writex(int fd, const char *buf, size_t size) +{ + ssize_t ret; + + do { + ret = write(fd, buf, size); + if (ret == -1) + err(1, "write"); + assert((size_t)ret <= size); + size -= ret; + buf += ret; + } while (size > 0); +} + static uintmax_t test_pipeping(uintmax_t num, uintmax_t int_arg, const char *path __unused) { char buf[int_arg]; uintmax_t i; - ssize_t ret; pid_t pid; int fd[2], procfd; @@ -339,12 +301,8 @@ test_pipeping(uintmax_t num, uintmax_t int_arg, const close(fd[0]); for (;;) { - ret = read(fd[1], buf, int_arg); - if ((uintmax_t)ret != int_arg) - err(1, "read"); - ret = write(fd[1], buf, int_arg); - if ((uintmax_t)ret != int_arg) - err(1, "write"); + readx(fd[1], buf, int_arg); + writex(fd[1], buf, int_arg); } } @@ -352,12 +310,8 @@ test_pipeping(uintmax_t num, uintmax_t int_arg, const benchmark_start(); BENCHMARK_FOREACH(i, num) { - ret = write(fd[0], buf, int_arg); - if ((uintmax_t)ret != int_arg) - err(1, "write"); - ret = read(fd[0], buf, int_arg); - if ((uintmax_t)ret != int_arg) - err(1, "read"); + writex(fd[0], buf, int_arg); + readx(fd[0], buf, int_arg); } benchmark_stop(); @@ -365,7 +319,64 @@ test_pipeping(uintmax_t num, uintmax_t int_arg, const return (i); } +struct pipepingtd_ctx { + int fd; + uintmax_t int_arg; +}; + +static void * +pipepingtd_proc(void *arg) +{ + struct pipepingtd_ctx *ctxp; + int fd; + void *buf; + uintmax_t int_arg; + + ctxp = arg; + fd = ctxp->fd; + int_arg = ctxp->int_arg; + + buf = malloc(int_arg); + if (buf == NULL) + err(1, "malloc"); + + for (;;) { + readx(fd, buf, int_arg); + writex(fd, buf, int_arg); + } +} + static uintmax_t +test_pipepingtd(uintmax_t num, uintmax_t int_arg, const char *path __unused) +{ + struct pipepingtd_ctx ctx; + char buf[int_arg]; + pthread_t td; + uintmax_t i; + int error, fd[2]; + + if (pipe(fd) < 0) + err(-1, "pipe"); + + ctx.fd = fd[1]; + ctx.int_arg = int_arg; + + error = pthread_create(&td, NULL, pipepingtd_proc, &ctx); + if (error != 0) + err(1, "pthread_create"); + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + writex(fd[0], buf, int_arg); + readx(fd[0], buf, int_arg); + } + benchmark_stop(); + pthread_cancel(td); + + return (i); +} + +static uintmax_t test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path __unused) { uintmax_t i; @@ -814,25 +825,15 @@ static const struct test tests[] = { { "pipeping_100", test_pipeping, .t_flags = 0, .t_int = 100 }, { "pipeping_1000", test_pipeping, .t_flags = 0, .t_int = 1000 }, { "pipeping_10000", test_pipeping, .t_flags = 0, .t_int = 10000 }, -#ifdef notyet - /* - * XXX: Doesn't work; kernel pipe buffer too small? - */ { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 }, { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = 1000000 }, -#endif { "pipepingtd_1", test_pipepingtd, .t_flags = 0, .t_int = 1 }, { "pipepingtd_10", test_pipepingtd, .t_flags = 0, .t_int = 10 }, { "pipepingtd_100", test_pipepingtd, .t_flags = 0, .t_int = 100 }, { "pipepingtd_1000", test_pipepingtd, .t_flags = 0, .t_int = 1000 }, { "pipepingtd_10000", test_pipepingtd, .t_flags = 0, .t_int = 10000 }, -#ifdef notyet - /* - * XXX: Doesn't work; kernel pipe buffer too small? - */ { "pipepingtd_100000", test_pipepingtd, .t_flags = 0, .t_int = 100000 }, { "pipepingtd_1000000", test_pipepingtd, .t_flags = 0, .t_int = 1000000 }, - #endif { "gettimeofday", test_gettimeofday, .t_flags = 0 }, { "getpriority", test_getpriority, .t_flags = 0 }, { "getprogname", test_getprogname, .t_flags = 0 }, From owner-svn-src-head@freebsd.org Wed Jul 4 13:52:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47056103889A; Wed, 4 Jul 2018 13:52: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 F14A27C179; Wed, 4 Jul 2018 13:52: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 D254B3FF8; Wed, 4 Jul 2018 13:52: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 w64DqDCY018243; Wed, 4 Jul 2018 13:52:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DqDhB018241; Wed, 4 Jul 2018 13:52:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041352.w64DqDhB018241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 13:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335945 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:52:14 -0000 Author: trasz Date: Wed Jul 4 13:52:13 2018 New Revision: 335945 URL: https://svnweb.freebsd.org/changeset/base/335945 Log: Disable pipepingtd benchmarks, to make it not depend on libthr. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/Makefile head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/Makefile ============================================================================== --- head/tools/tools/syscall_timing/Makefile Wed Jul 4 13:45:29 2018 (r335944) +++ head/tools/tools/syscall_timing/Makefile Wed Jul 4 13:52:13 2018 (r335945) @@ -6,7 +6,7 @@ PROG= syscall_timing CFLAGS+= -static -O MAN= -LIBADD= pthread +#LIBADD= pthread WARNS= 6 Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:45:29 2018 (r335944) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:52:13 2018 (r335945) @@ -44,7 +44,9 @@ #include #include #include +#ifdef WITH_PTHREAD #include +#endif #include #include #include @@ -319,6 +321,7 @@ test_pipeping(uintmax_t num, uintmax_t int_arg, const return (i); } +#ifdef WITH_PTHREAD struct pipepingtd_ctx { int fd; uintmax_t int_arg; @@ -375,6 +378,7 @@ test_pipepingtd(uintmax_t num, uintmax_t int_arg, cons return (i); } +#endif /* WITH_PTHREAD */ static uintmax_t test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path __unused) @@ -827,6 +831,7 @@ static const struct test tests[] = { { "pipeping_10000", test_pipeping, .t_flags = 0, .t_int = 10000 }, { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 }, { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = 1000000 }, +#ifdef WITH_PTHREAD { "pipepingtd_1", test_pipepingtd, .t_flags = 0, .t_int = 1 }, { "pipepingtd_10", test_pipepingtd, .t_flags = 0, .t_int = 10 }, { "pipepingtd_100", test_pipepingtd, .t_flags = 0, .t_int = 100 }, @@ -834,6 +839,7 @@ static const struct test tests[] = { { "pipepingtd_10000", test_pipepingtd, .t_flags = 0, .t_int = 10000 }, { "pipepingtd_100000", test_pipepingtd, .t_flags = 0, .t_int = 100000 }, { "pipepingtd_1000000", test_pipepingtd, .t_flags = 0, .t_int = 1000000 }, +#endif { "gettimeofday", test_gettimeofday, .t_flags = 0 }, { "getpriority", test_getpriority, .t_flags = 0 }, { "getprogname", test_getprogname, .t_flags = 0 }, From owner-svn-src-head@freebsd.org Wed Jul 4 14:07:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65E2C103A5A9; Wed, 4 Jul 2018 14:07:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B15957D1CB; Wed, 4 Jul 2018 14:07:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id aiRJfDxNEogHjaiRKfy8vS; Wed, 04 Jul 2018 08:07:28 -0600 X-Authority-Analysis: v=2.3 cv=Sre+FsG0 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=R9QF1RCXAYgA:10 a=vaJtXVxTAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=VxmjJ2MpAAAA:8 a=15uXNp85ToZJJYQ7xH8A:9 a=CjuIK1q_8ugA:10 a=9T6p9fL4ueEA: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 0A804145; Wed, 4 Jul 2018 07:07:25 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w64E7O8b080440; Wed, 4 Jul 2018 07:07:24 -0700 (PDT) (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 w64E7NxV080432; Wed, 4 Jul 2018 07:07:23 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807041407.w64E7NxV080432@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: "Andrey V. Elsukov" cc: Cy Schubert , Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335919 - head/sys/netinet6 In-Reply-To: Message from "Andrey V. Elsukov" of "Wed, 04 Jul 2018 16:31:04 +0300." <13fa004f-6d8a-025e-9d4f-957f081113b4@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Jul 2018 07:07:23 -0700 X-CMAE-Envelope: MS4wfBD75Bg2+7Xhaeby8lWDoJLhFeM+C3KTP5It+aHUoTUcOpsrq8ELDNstUeGvYOEY+N5QvXG7pgyKxLKS/PCSanDq+kTIpa9xQfR2RMws6/rujQOcK+Br pGB0A4P18sdhaL7U0WA8ER/bMMn217z0N/IUeIY+dRoZt9/0fQIbNlX9uNIV2HEBs+cZ70lhZKAghZwQIn0LMfolAc7kUW/WKek/DQ7QBINRRESB4DNs5yRt CO7ht9XYXjM9imELbpsNfnkOBSNbOiWNwzH4rxuN5WghGOFsPPO9iRonefnwAPWJ X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 14:07:30 -0000 In message <13fa004f-6d8a-025e-9d4f-957f081113b4@yandex.ru>, "Andrey V. Elsukov " writes: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --DYq4DERiQq8E3pDWhQQJu3pRxNkEa3XRw > Content-Type: multipart/mixed; boundary="3UyYmNTJPMJYH4JeWdQTZY41T0JnKZ9UW"; > protected-headers="v1" > From: "Andrey V. Elsukov" > To: Cy Schubert , Matt Macy > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Message-ID: <13fa004f-6d8a-025e-9d4f-957f081113b4@yandex.ru> > Subject: Re: svn commit: r335919 - head/sys/netinet6 > References: <201807041305.w64D5qiK002898@slippy.cwsent.com> > In-Reply-To: <201807041305.w64D5qiK002898@slippy.cwsent.com> > > --3UyYmNTJPMJYH4JeWdQTZY41T0JnKZ9UW > Content-Type: text/plain; charset=utf-8 > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > On 04.07.2018 16:05, Cy Schubert wrote: > > Hi Matt, > >=20 > > This is causing a panic of my gateway machine. Likely due to router=20 > > solicitations. > > Hi, > > probably in the last two chunks "inp" should be replaced with "last" > > Index: udp6_usrreq.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- udp6_usrreq.c (revision 335934) > +++ udp6_usrreq.c (working copy) > @@ -387,7 +387,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) > if ((n =3D m_copym(m, 0, M_COPYALL, M_NOWAIT)) > !=3D > NULL) { > INP_RLOCK(last); > - if (__predict_true(inp->inp_flags2 & IN > P_FREED) =3D=3D 0) { > + if (__predict_true(last->inp_flags2 & I > NP_FREED) =3D=3D 0) { > UDP_PROBE(receive, NULL, last, > ip6, > last, uh); > if (udp6_append(last, n, off, f > romsa)) > @@ -421,7 +421,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) > goto badheadlocked; > } > INP_RLOCK(last); > - if (__predict_true(inp->inp_flags2 & INP_FREED) =3D=3D 0) { > + if (__predict_true(last->inp_flags2 & INP_FREED) =3D=3D 0) { > UDP_PROBE(receive, NULL, last, ip6, last, uh); > if (udp6_append(last, m, off, fromsa) =3D=3D 0) > INP_RUNLOCK(last); > > > --=20 > WBR, Andrey V. Elsukov Makes sense. Gave it a spin before heading off to $JOB. No more panic loop. Thanks. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jul 4 14:11:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D6BC103ABD6; Wed, 4 Jul 2018 14:11:50 +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 B00E87D777; Wed, 4 Jul 2018 14:11: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 77C61433E; Wed, 4 Jul 2018 14:11: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 w64EBnYQ024433; Wed, 4 Jul 2018 14:11:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64EBn5k024432; Wed, 4 Jul 2018 14:11:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041411.w64EBn5k024432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 14:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335951 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 14:11:50 -0000 Author: trasz Date: Wed Jul 4 14:11:49 2018 New Revision: 335951 URL: https://svnweb.freebsd.org/changeset/base/335951 Log: Sort the benchmarks; no functional changes intended. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:10:36 2018 (r335950) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:11:49 2018 (r335951) @@ -98,50 +98,51 @@ benchmark_stop(void) error = clock_gettime(CLOCK_REALTIME, &ts_end); assert(error == 0); } - + static uintmax_t -test_getuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +test_access(uintmax_t num, uintmax_t int_arg __unused, const char *path) { uintmax_t i; + int fd; - /* - * Thread-local data should require no locking if system - * call is MPSAFE. - */ + fd = access(path, O_RDONLY); + if (fd < 0) + err(-1, "test_access: %s", path); + close(fd); + benchmark_start(); BENCHMARK_FOREACH(i, num) { - getuid(); + access(path, O_RDONLY); + close(fd); } benchmark_stop(); return (i); } static uintmax_t -test_getppid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +test_bad_open(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; - /* - * This is process-local, but can change, so will require a - * lock. - */ benchmark_start(); BENCHMARK_FOREACH(i, num) { - getppid(); + open("", O_RDONLY); } benchmark_stop(); return (i); } static uintmax_t -test_getresuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +test_chroot(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { - uid_t ruid, euid, suid; uintmax_t i; + if (chroot("/") < 0) + err(-1, "test_chroot: chroot"); benchmark_start(); BENCHMARK_FOREACH(i, num) { - (void)getresuid(&ruid, &euid, &suid); + if (chroot("/") < 0) + err(-1, "test_chroot: chroot"); } benchmark_stop(); return (i); @@ -162,20 +163,111 @@ test_clock_gettime(uintmax_t num, uintmax_t int_arg __ } static uintmax_t -test_gettimeofday(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +test_create_unlink(uintmax_t num, uintmax_t int_arg __unused, const char *path) { - struct timeval tv; uintmax_t i; + int fd; + (void)unlink(path); + fd = open(path, O_RDWR | O_CREAT, 0600); + if (fd < 0) + err(-1, "test_create_unlink: create: %s", path); + close(fd); + if (unlink(path) < 0) + err(-1, "test_create_unlink: unlink: %s", path); benchmark_start(); BENCHMARK_FOREACH(i, num) { - (void)gettimeofday(&tv, NULL); + fd = open(path, O_RDWR | O_CREAT, 0600); + if (fd < 0) + err(-1, "test_create_unlink: create: %s", path); + close(fd); + if (unlink(path) < 0) + err(-1, "test_create_unlink: unlink: %s", path); } benchmark_stop(); return (i); } static uintmax_t +test_fork(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + pid_t pid; + uintmax_t i; + + pid = fork(); + if (pid < 0) + err(-1, "test_fork: fork"); + if (pid == 0) + _exit(0); + if (waitpid(pid, NULL, 0) < 0) + err(-1, "test_fork: waitpid"); + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + pid = fork(); + if (pid < 0) + err(-1, "test_fork: fork"); + if (pid == 0) + _exit(0); + if (waitpid(pid, NULL, 0) < 0) + err(-1, "test_fork: waitpid"); + } + benchmark_stop(); + return (i); +} + +#define USR_BIN_TRUE "/usr/bin/true" +static char *execve_args[] = { __DECONST(char *, USR_BIN_TRUE), NULL}; +extern char **environ; + +static uintmax_t +test_fork_exec(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + pid_t pid; + uintmax_t i; + + pid = fork(); + if (pid < 0) + err(-1, "test_fork_exec: fork"); + if (pid == 0) { + (void)execve(USR_BIN_TRUE, execve_args, environ); + err(-1, "execve"); + } + if (waitpid(pid, NULL, 0) < 0) + err(-1, "test_fork: waitpid"); + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + pid = fork(); + if (pid < 0) + err(-1, "test_fork_exec: fork"); + if (pid == 0) { + (void)execve(USR_BIN_TRUE, execve_args, environ); + err(-1, "test_fork_exec: execve"); + } + if (waitpid(pid, NULL, 0) < 0) + err(-1, "test_fork_exec: waitpid"); + } + benchmark_stop(); + return (i); +} + +static uintmax_t +test_getppid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + uintmax_t i; + + /* + * This is process-local, but can change, so will require a + * lock. + */ + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + getppid(); + } + benchmark_stop(); + return (i); +} + +static uintmax_t test_getpriority(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; @@ -206,6 +298,98 @@ test_getprogname(uintmax_t num, uintmax_t int_arg __un } static uintmax_t +test_getresuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + uid_t ruid, euid, suid; + uintmax_t i; + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + (void)getresuid(&ruid, &euid, &suid); + } + benchmark_stop(); + return (i); +} + +static uintmax_t +test_gettimeofday(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + struct timeval tv; + uintmax_t i; + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + (void)gettimeofday(&tv, NULL); + } + benchmark_stop(); + return (i); +} + +static uintmax_t +test_getuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + uintmax_t i; + + /* + * Thread-local data should require no locking if system + * call is MPSAFE. + */ + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + getuid(); + } + benchmark_stop(); + return (i); +} + +static uintmax_t +test_open_close(uintmax_t num, uintmax_t int_arg __unused, const char *path) +{ + uintmax_t i; + int fd; + + fd = open(path, O_RDONLY); + if (fd < 0) + err(-1, "test_open_close: %s", path); + close(fd); + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + fd = open(path, O_RDONLY); + if (fd < 0) + err(-1, "test_open_close: %s", path); + close(fd); + } + benchmark_stop(); + return (i); +} + +static uintmax_t +test_open_read_close(uintmax_t num, uintmax_t int_arg, const char *path) +{ + char buf[int_arg]; + uintmax_t i; + int fd; + + fd = open(path, O_RDONLY); + if (fd < 0) + err(-1, "test_open_read_close: %s", path); + (void)read(fd, buf, int_arg); + close(fd); + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + fd = open(path, O_RDONLY); + if (fd < 0) + err(-1, "test_open_read_close: %s", path); + (void)read(fd, buf, int_arg); + close(fd); + } + benchmark_stop(); + return (i); +} + +static uintmax_t test_pipe(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { int fd[2]; @@ -232,28 +416,6 @@ test_pipe(uintmax_t num, uintmax_t int_arg __unused, c return (i); } -static uintmax_t -test_select(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - fd_set readfds, writefds, exceptfds; - struct timeval tv; - uintmax_t i; - - FD_ZERO(&readfds); - FD_ZERO(&writefds); - FD_ZERO(&exceptfds); - - tv.tv_sec = 0; - tv.tv_usec = 0; - - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - (void)select(0, &readfds, &writefds, &exceptfds, &tv); - } - benchmark_stop(); - return (i); -} - static void readx(int fd, char *buf, size_t size) { @@ -381,6 +543,67 @@ test_pipepingtd(uintmax_t num, uintmax_t int_arg, cons #endif /* WITH_PTHREAD */ static uintmax_t +test_read(uintmax_t num, uintmax_t int_arg, const char *path) +{ + char buf[int_arg]; + uintmax_t i; + int fd; + + fd = open(path, O_RDONLY); + if (fd < 0) + err(-1, "test_open_read: %s", path); + (void)pread(fd, buf, int_arg, 0); + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + (void)pread(fd, buf, int_arg, 0); + } + benchmark_stop(); + close(fd); + return (i); +} + +static uintmax_t +test_select(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + fd_set readfds, writefds, exceptfds; + struct timeval tv; + uintmax_t i; + + FD_ZERO(&readfds); + FD_ZERO(&writefds); + FD_ZERO(&exceptfds); + + tv.tv_sec = 0; + tv.tv_usec = 0; + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + (void)select(0, &readfds, &writefds, &exceptfds, &tv); + } + benchmark_stop(); + return (i); +} + +static uintmax_t +test_setuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + uid_t uid; + uintmax_t i; + + uid = getuid(); + if (setuid(uid) < 0) + err(-1, "test_setuid: setuid"); + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + if (setuid(uid) < 0) + err(-1, "test_setuid: setuid"); + } + benchmark_stop(); + return (i); +} + +static uintmax_t test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path __unused) { uintmax_t i; @@ -465,133 +688,6 @@ test_socketpair_dgram(uintmax_t num, uintmax_t int_arg } static uintmax_t -test_access(uintmax_t num, uintmax_t int_arg __unused, const char *path) -{ - uintmax_t i; - int fd; - - fd = access(path, O_RDONLY); - if (fd < 0) - err(-1, "test_access: %s", path); - close(fd); - - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - access(path, O_RDONLY); - close(fd); - } - benchmark_stop(); - return (i); -} - -static uintmax_t -test_create_unlink(uintmax_t num, uintmax_t int_arg __unused, const char *path) -{ - uintmax_t i; - int fd; - - (void)unlink(path); - fd = open(path, O_RDWR | O_CREAT, 0600); - if (fd < 0) - err(-1, "test_create_unlink: create: %s", path); - close(fd); - if (unlink(path) < 0) - err(-1, "test_create_unlink: unlink: %s", path); - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - fd = open(path, O_RDWR | O_CREAT, 0600); - if (fd < 0) - err(-1, "test_create_unlink: create: %s", path); - close(fd); - if (unlink(path) < 0) - err(-1, "test_create_unlink: unlink: %s", path); - } - benchmark_stop(); - return (i); -} - -static uintmax_t -test_open_close(uintmax_t num, uintmax_t int_arg __unused, const char *path) -{ - uintmax_t i; - int fd; - - fd = open(path, O_RDONLY); - if (fd < 0) - err(-1, "test_open_close: %s", path); - close(fd); - - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - fd = open(path, O_RDONLY); - if (fd < 0) - err(-1, "test_open_close: %s", path); - close(fd); - } - benchmark_stop(); - return (i); -} - -static uintmax_t -test_bad_open(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - uintmax_t i; - - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - open("", O_RDONLY); - } - benchmark_stop(); - return (i); -} - -static uintmax_t -test_read(uintmax_t num, uintmax_t int_arg, const char *path) -{ - char buf[int_arg]; - uintmax_t i; - int fd; - - fd = open(path, O_RDONLY); - if (fd < 0) - err(-1, "test_open_read: %s", path); - (void)pread(fd, buf, int_arg, 0); - - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - (void)pread(fd, buf, int_arg, 0); - } - benchmark_stop(); - close(fd); - return (i); -} - -static uintmax_t -test_open_read_close(uintmax_t num, uintmax_t int_arg, const char *path) -{ - char buf[int_arg]; - uintmax_t i; - int fd; - - fd = open(path, O_RDONLY); - if (fd < 0) - err(-1, "test_open_read_close: %s", path); - (void)read(fd, buf, int_arg); - close(fd); - - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - fd = open(path, O_RDONLY); - if (fd < 0) - err(-1, "test_open_read_close: %s", path); - (void)read(fd, buf, int_arg); - close(fd); - } - benchmark_stop(); - return (i); -} - -static uintmax_t test_dup(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; @@ -657,33 +753,6 @@ test_fstat_shmfd(uintmax_t num, uintmax_t int_arg __un } static uintmax_t -test_fork(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - pid_t pid; - uintmax_t i; - - pid = fork(); - if (pid < 0) - err(-1, "test_fork: fork"); - if (pid == 0) - _exit(0); - if (waitpid(pid, NULL, 0) < 0) - err(-1, "test_fork: waitpid"); - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - pid = fork(); - if (pid < 0) - err(-1, "test_fork: fork"); - if (pid == 0) - _exit(0); - if (waitpid(pid, NULL, 0) < 0) - err(-1, "test_fork: waitpid"); - } - benchmark_stop(); - return (i); -} - -static uintmax_t test_vfork(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { pid_t pid; @@ -710,42 +779,7 @@ test_vfork(uintmax_t num, uintmax_t int_arg __unused, return (i); } -#define USR_BIN_TRUE "/usr/bin/true" -static char *execve_args[] = { __DECONST(char *, USR_BIN_TRUE), NULL}; -extern char **environ; - static uintmax_t -test_fork_exec(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - pid_t pid; - uintmax_t i; - - pid = fork(); - if (pid < 0) - err(-1, "test_fork_exec: fork"); - if (pid == 0) { - (void)execve(USR_BIN_TRUE, execve_args, environ); - err(-1, "execve"); - } - if (waitpid(pid, NULL, 0) < 0) - err(-1, "test_fork: waitpid"); - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - pid = fork(); - if (pid < 0) - err(-1, "test_fork_exec: fork"); - if (pid == 0) { - (void)execve(USR_BIN_TRUE, execve_args, environ); - err(-1, "test_fork_exec: execve"); - } - if (waitpid(pid, NULL, 0) < 0) - err(-1, "test_fork_exec: waitpid"); - } - benchmark_stop(); - return (i); -} - -static uintmax_t test_vfork_exec(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { pid_t pid; @@ -776,40 +810,6 @@ test_vfork_exec(uintmax_t num, uintmax_t int_arg __unu return (i); } -static uintmax_t -test_chroot(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - uintmax_t i; - - if (chroot("/") < 0) - err(-1, "test_chroot: chroot"); - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - if (chroot("/") < 0) - err(-1, "test_chroot: chroot"); - } - benchmark_stop(); - return (i); -} - -static uintmax_t -test_setuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - uid_t uid; - uintmax_t i; - - uid = getuid(); - if (setuid(uid) < 0) - err(-1, "test_setuid: setuid"); - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - if (setuid(uid) < 0) - err(-1, "test_setuid: setuid"); - } - benchmark_stop(); - return (i); -} - struct test { const char *t_name; uintmax_t (*t_func)(uintmax_t, uintmax_t, const char *); @@ -820,40 +820,19 @@ struct test { #define FLAG_PATH 0x00000001 static const struct test tests[] = { - { "getuid", test_getuid, .t_flags = 0 }, - { "getppid", test_getppid, .t_flags = 0 }, - { "getresuid", test_getresuid, .t_flags = 0 }, + { "access", test_access, .t_flags = FLAG_PATH }, + { "bad_open", test_bad_open, .t_flags = 0 }, + { "chroot", test_chroot, .t_flags = 0 }, { "clock_gettime", test_clock_gettime, .t_flags = 0 }, - { "pipeping_1", test_pipeping, .t_flags = 0, .t_int = 1 }, - { "pipeping_10", test_pipeping, .t_flags = 0, .t_int = 10 }, - { "pipeping_100", test_pipeping, .t_flags = 0, .t_int = 100 }, - { "pipeping_1000", test_pipeping, .t_flags = 0, .t_int = 1000 }, - { "pipeping_10000", test_pipeping, .t_flags = 0, .t_int = 10000 }, - { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 }, - { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = 1000000 }, -#ifdef WITH_PTHREAD - { "pipepingtd_1", test_pipepingtd, .t_flags = 0, .t_int = 1 }, - { "pipepingtd_10", test_pipepingtd, .t_flags = 0, .t_int = 10 }, - { "pipepingtd_100", test_pipepingtd, .t_flags = 0, .t_int = 100 }, - { "pipepingtd_1000", test_pipepingtd, .t_flags = 0, .t_int = 1000 }, - { "pipepingtd_10000", test_pipepingtd, .t_flags = 0, .t_int = 10000 }, - { "pipepingtd_100000", test_pipepingtd, .t_flags = 0, .t_int = 100000 }, - { "pipepingtd_1000000", test_pipepingtd, .t_flags = 0, .t_int = 1000000 }, -#endif - { "gettimeofday", test_gettimeofday, .t_flags = 0 }, + { "create_unlink", test_create_unlink, .t_flags = FLAG_PATH }, + { "fork", test_fork, .t_flags = 0 }, + { "fork_exec", test_fork_exec, .t_flags = 0 }, + { "getppid", test_getppid, .t_flags = 0 }, { "getpriority", test_getpriority, .t_flags = 0 }, { "getprogname", test_getprogname, .t_flags = 0 }, - { "pipe", test_pipe, .t_flags = 0 }, - { "select", test_select, .t_flags = 0 }, - { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, - { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL }, - { "socketpair_stream", test_socketpair_stream, .t_flags = 0 }, - { "socketpair_dgram", test_socketpair_dgram, .t_flags = 0 }, - { "socket_tcp", test_socket_stream, .t_int = PF_INET }, - { "socket_udp", test_socket_dgram, .t_int = PF_INET }, - { "access", test_access, .t_flags = FLAG_PATH }, - { "create_unlink", test_create_unlink, .t_flags = FLAG_PATH }, - { "bad_open", test_bad_open, .t_flags = 0 }, + { "getresuid", test_getresuid, .t_flags = 0 }, + { "gettimeofday", test_gettimeofday, .t_flags = 0 }, + { "getuid", test_getuid, .t_flags = 0 }, { "open_close", test_open_close, .t_flags = FLAG_PATH }, { "open_read_close_1", test_open_read_close, .t_flags = FLAG_PATH, .t_int = 1 }, @@ -869,6 +848,23 @@ static const struct test tests[] = { .t_flags = FLAG_PATH, .t_int = 100000 }, { "open_read_close_1000000", test_open_read_close, .t_flags = FLAG_PATH, .t_int = 1000000 }, + { "pipe", test_pipe, .t_flags = 0 }, + { "pipeping_1", test_pipeping, .t_flags = 0, .t_int = 1 }, + { "pipeping_10", test_pipeping, .t_flags = 0, .t_int = 10 }, + { "pipeping_100", test_pipeping, .t_flags = 0, .t_int = 100 }, + { "pipeping_1000", test_pipeping, .t_flags = 0, .t_int = 1000 }, + { "pipeping_10000", test_pipeping, .t_flags = 0, .t_int = 10000 }, + { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 }, + { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = 1000000 }, +#ifdef WITH_PTHREAD + { "pipepingtd_1", test_pipepingtd, .t_flags = 0, .t_int = 1 }, + { "pipepingtd_10", test_pipepingtd, .t_flags = 0, .t_int = 10 }, + { "pipepingtd_100", test_pipepingtd, .t_flags = 0, .t_int = 100 }, + { "pipepingtd_1000", test_pipepingtd, .t_flags = 0, .t_int = 1000 }, + { "pipepingtd_10000", test_pipepingtd, .t_flags = 0, .t_int = 10000 }, + { "pipepingtd_100000", test_pipepingtd, .t_flags = 0, .t_int = 100000 }, + { "pipepingtd_1000000", test_pipepingtd, .t_flags = 0, .t_int = 1000000 }, +#endif { "read_1", test_read, .t_flags = FLAG_PATH, .t_int = 1 }, { "read_10", test_read, .t_flags = FLAG_PATH, .t_int = 10 }, { "read_100", test_read, .t_flags = FLAG_PATH, .t_int = 100 }, @@ -876,15 +872,19 @@ static const struct test tests[] = { { "read_10000", test_read, .t_flags = FLAG_PATH, .t_int = 10000 }, { "read_100000", test_read, .t_flags = FLAG_PATH, .t_int = 100000 }, { "read_1000000", test_read, .t_flags = FLAG_PATH, .t_int = 1000000 }, + { "select", test_select, .t_flags = 0 }, + { "setuid", test_setuid, .t_flags = 0 }, + { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, + { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL }, + { "socketpair_stream", test_socketpair_stream, .t_flags = 0 }, + { "socketpair_dgram", test_socketpair_dgram, .t_flags = 0 }, + { "socket_tcp", test_socket_stream, .t_int = PF_INET }, + { "socket_udp", test_socket_dgram, .t_int = PF_INET }, { "dup", test_dup, .t_flags = 0 }, { "shmfd", test_shmfd, .t_flags = 0 }, { "fstat_shmfd", test_fstat_shmfd, .t_flags = 0 }, - { "fork", test_fork, .t_flags = 0 }, { "vfork", test_vfork, .t_flags = 0 }, - { "fork_exec", test_fork_exec, .t_flags = 0 }, { "vfork_exec", test_vfork_exec, .t_flags = 0 }, - { "chroot", test_chroot, .t_flags = 0 }, - { "setuid", test_setuid, .t_flags = 0 }, }; static const int tests_count = sizeof(tests) / sizeof(tests[0]); From owner-svn-src-head@freebsd.org Wed Jul 4 14:14:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E25C103AE73; Wed, 4 Jul 2018 14:14:01 +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 E4ED17DBDB; Wed, 4 Jul 2018 14:14:00 +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 C5071437F; Wed, 4 Jul 2018 14:14:00 +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 w64EE0WD029298; Wed, 4 Jul 2018 14:14:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64EE0RX029297; Wed, 4 Jul 2018 14:14:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041414.w64EE0RX029297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 14:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335953 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 14:14:01 -0000 Author: trasz Date: Wed Jul 4 14:14:00 2018 New Revision: 335953 URL: https://svnweb.freebsd.org/changeset/base/335953 Log: Rename "dup" and "fstat_shmfd" to "shmfd_dup" and "shmfd_fstat" for consistency. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:12:09 2018 (r335952) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:14:00 2018 (r335953) @@ -688,14 +688,14 @@ test_socketpair_dgram(uintmax_t num, uintmax_t int_arg } static uintmax_t -test_dup(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +test_shmfd_dup(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uintmax_t i; int fd, shmfd; shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); if (shmfd < 0) - err(-1, "test_dup: shm_open"); + err(-1, "test_shmfd_dup: shm_open"); fd = dup(shmfd); if (fd >= 0) close(fd); @@ -732,7 +732,7 @@ test_shmfd(uintmax_t num, uintmax_t int_arg __unused, } static uintmax_t -test_fstat_shmfd(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +test_shmfd_fstat(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { struct stat sb; uintmax_t i; @@ -740,9 +740,9 @@ test_fstat_shmfd(uintmax_t num, uintmax_t int_arg __un shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); if (shmfd < 0) - err(-1, "test_fstat_shmfd: shm_open"); + err(-1, "test_shmfd_fstat: shm_open"); if (fstat(shmfd, &sb) < 0) - err(-1, "test_fstat_shmfd: fstat"); + err(-1, "test_shmfd_fstat: fstat"); benchmark_start(); BENCHMARK_FOREACH(i, num) { (void)fstat(shmfd, &sb); @@ -880,9 +880,9 @@ static const struct test tests[] = { { "socketpair_dgram", test_socketpair_dgram, .t_flags = 0 }, { "socket_tcp", test_socket_stream, .t_int = PF_INET }, { "socket_udp", test_socket_dgram, .t_int = PF_INET }, - { "dup", test_dup, .t_flags = 0 }, + { "shmfd_dup", test_shmfd_dup, .t_flags = 0 }, { "shmfd", test_shmfd, .t_flags = 0 }, - { "fstat_shmfd", test_fstat_shmfd, .t_flags = 0 }, + { "shmfd_fstat", test_shmfd_fstat, .t_flags = 0 }, { "vfork", test_vfork, .t_flags = 0 }, { "vfork_exec", test_vfork_exec, .t_flags = 0 }, }; From owner-svn-src-head@freebsd.org Wed Jul 4 14:15:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AD48103B063; Wed, 4 Jul 2018 14:15: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 2CF017DD9C; Wed, 4 Jul 2018 14:15: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 0E0344381; Wed, 4 Jul 2018 14:15: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 w64EFmNa029420; Wed, 4 Jul 2018 14:15:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64EFmRn029419; Wed, 4 Jul 2018 14:15:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041415.w64EFmRn029419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 14:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335954 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 14:15:49 -0000 Author: trasz Date: Wed Jul 4 14:15:48 2018 New Revision: 335954 URL: https://svnweb.freebsd.org/changeset/base/335954 Log: Sort the benchmarks even more. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:14:00 2018 (r335953) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:15:48 2018 (r335954) @@ -604,6 +604,71 @@ test_setuid(uintmax_t num, uintmax_t int_arg __unused, } static uintmax_t +test_shmfd(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + uintmax_t i; + int shmfd; + + shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); + if (shmfd < 0) + err(-1, "test_shmfd: shm_open"); + close(shmfd); + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); + if (shmfd < 0) + err(-1, "test_shmfd: shm_open"); + close(shmfd); + } + benchmark_stop(); + return (i); +} + +static uintmax_t +test_shmfd_dup(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + uintmax_t i; + int fd, shmfd; + + shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); + if (shmfd < 0) + err(-1, "test_shmfd_dup: shm_open"); + fd = dup(shmfd); + if (fd >= 0) + close(fd); + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + fd = dup(shmfd); + if (fd >= 0) + close(fd); + } + benchmark_stop(); + close(shmfd); + return (i); +} + +static uintmax_t +test_shmfd_fstat(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + struct stat sb; + uintmax_t i; + int shmfd; + + shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); + if (shmfd < 0) + err(-1, "test_shmfd_fstat: shm_open"); + if (fstat(shmfd, &sb) < 0) + err(-1, "test_shmfd_fstat: fstat"); + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + (void)fstat(shmfd, &sb); + } + benchmark_stop(); + close(shmfd); + return (i); +} + +static uintmax_t test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path __unused) { uintmax_t i; @@ -688,71 +753,6 @@ test_socketpair_dgram(uintmax_t num, uintmax_t int_arg } static uintmax_t -test_shmfd_dup(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - uintmax_t i; - int fd, shmfd; - - shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); - if (shmfd < 0) - err(-1, "test_shmfd_dup: shm_open"); - fd = dup(shmfd); - if (fd >= 0) - close(fd); - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - fd = dup(shmfd); - if (fd >= 0) - close(fd); - } - benchmark_stop(); - close(shmfd); - return (i); -} - -static uintmax_t -test_shmfd(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - uintmax_t i; - int shmfd; - - shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); - if (shmfd < 0) - err(-1, "test_shmfd: shm_open"); - close(shmfd); - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); - if (shmfd < 0) - err(-1, "test_shmfd: shm_open"); - close(shmfd); - } - benchmark_stop(); - return (i); -} - -static uintmax_t -test_shmfd_fstat(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) -{ - struct stat sb; - uintmax_t i; - int shmfd; - - shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); - if (shmfd < 0) - err(-1, "test_shmfd_fstat: shm_open"); - if (fstat(shmfd, &sb) < 0) - err(-1, "test_shmfd_fstat: fstat"); - benchmark_start(); - BENCHMARK_FOREACH(i, num) { - (void)fstat(shmfd, &sb); - } - benchmark_stop(); - close(shmfd); - return (i); -} - -static uintmax_t test_vfork(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { pid_t pid; @@ -874,15 +874,15 @@ static const struct test tests[] = { { "read_1000000", test_read, .t_flags = FLAG_PATH, .t_int = 1000000 }, { "select", test_select, .t_flags = 0 }, { "setuid", test_setuid, .t_flags = 0 }, + { "shmfd", test_shmfd, .t_flags = 0 }, + { "shmfd_dup", test_shmfd_dup, .t_flags = 0 }, + { "shmfd_fstat", test_shmfd_fstat, .t_flags = 0 }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL }, { "socketpair_stream", test_socketpair_stream, .t_flags = 0 }, { "socketpair_dgram", test_socketpair_dgram, .t_flags = 0 }, { "socket_tcp", test_socket_stream, .t_int = PF_INET }, { "socket_udp", test_socket_dgram, .t_int = PF_INET }, - { "shmfd_dup", test_shmfd_dup, .t_flags = 0 }, - { "shmfd", test_shmfd, .t_flags = 0 }, - { "shmfd_fstat", test_shmfd_fstat, .t_flags = 0 }, { "vfork", test_vfork, .t_flags = 0 }, { "vfork_exec", test_vfork_exec, .t_flags = 0 }, }; From owner-svn-src-head@freebsd.org Wed Jul 4 14:18:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FD38103B311; Wed, 4 Jul 2018 14:18:13 +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 C658C7DFC4; Wed, 4 Jul 2018 14:18:12 +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 A7917438B; Wed, 4 Jul 2018 14:18:12 +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 w64EIC1E029567; Wed, 4 Jul 2018 14:18:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64EICGu029566; Wed, 4 Jul 2018 14:18:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041418.w64EICGu029566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 14:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335955 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 14:18:13 -0000 Author: trasz Date: Wed Jul 4 14:18:12 2018 New Revision: 335955 URL: https://svnweb.freebsd.org/changeset/base/335955 Log: Add a very simple memcpy benchmark. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:15:48 2018 (r335954) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:18:12 2018 (r335955) @@ -343,6 +343,26 @@ test_getuid(uintmax_t num, uintmax_t int_arg __unused, } static uintmax_t +test_memcpy(uintmax_t num, uintmax_t int_arg, const char *path __unused) +{ + char buf[int_arg], buf2[int_arg]; + uintmax_t i; + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + /* + * Copy the memory there and back, to match the total amount + * moved by pipeping/pipepingtd tests. + */ + memcpy(buf2, buf, int_arg); + memcpy(buf, buf2, int_arg); + } + benchmark_stop(); + + return (i); +} + +static uintmax_t test_open_close(uintmax_t num, uintmax_t int_arg __unused, const char *path) { uintmax_t i; @@ -833,6 +853,13 @@ static const struct test tests[] = { { "getresuid", test_getresuid, .t_flags = 0 }, { "gettimeofday", test_gettimeofday, .t_flags = 0 }, { "getuid", test_getuid, .t_flags = 0 }, + { "memcpy_1", test_memcpy, .t_flags = 0, .t_int = 1 }, + { "memcpy_10", test_memcpy, .t_flags = 0, .t_int = 10 }, + { "memcpy_100", test_memcpy, .t_flags = 0, .t_int = 100 }, + { "memcpy_1000", test_memcpy, .t_flags = 0, .t_int = 1000 }, + { "memcpy_10000", test_memcpy, .t_flags = 0, .t_int = 10000 }, + { "memcpy_100000", test_memcpy, .t_flags = 0, .t_int = 100000 }, + { "memcpy_1000000", test_memcpy, .t_flags = 0, .t_int = 1000000 }, { "open_close", test_open_close, .t_flags = FLAG_PATH }, { "open_read_close_1", test_open_read_close, .t_flags = FLAG_PATH, .t_int = 1 }, From owner-svn-src-head@freebsd.org Wed Jul 4 14:20:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4865D103B590; Wed, 4 Jul 2018 14:20:20 +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 F2C057E1C6; Wed, 4 Jul 2018 14:20:19 +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 BB9CB4391; Wed, 4 Jul 2018 14:20:19 +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 w64EKJZA029716; Wed, 4 Jul 2018 14:20:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64EKJQu029715; Wed, 4 Jul 2018 14:20:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041420.w64EKJQu029715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 14:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335956 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 14:20:20 -0000 Author: trasz Date: Wed Jul 4 14:20:19 2018 New Revision: 335956 URL: https://svnweb.freebsd.org/changeset/base/335956 Log: Add a semaphore ping benchmark. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:18:12 2018 (r335955) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 14:20:19 2018 (r335956) @@ -29,6 +29,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -47,6 +48,7 @@ #ifdef WITH_PTHREAD #include #endif +#include #include #include #include @@ -606,6 +608,65 @@ test_select(uintmax_t num, uintmax_t int_arg __unused, } static uintmax_t +test_semaping(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + uintmax_t i; + pid_t pid; + sem_t *buf; + int error, j, procfd; + + buf = mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); + if (buf == MAP_FAILED) + err(1, "mmap"); + + for (j = 0; j < 2; j++) { + error = sem_init(&buf[j], 1, 0); + if (error != 0) + err(1, "sem_init"); + } + + pid = pdfork(&procfd, 0); + if (pid < 0) + err(1, "pdfork"); + + if (pid == 0) { + for (;;) { + error = sem_wait(&buf[0]); + if (error != 0) + err(1, "sem_wait"); + error = sem_post(&buf[1]); + if (error != 0) + err(1, "sem_post"); + } + } + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + error = sem_post(&buf[0]); + if (error != 0) + err(1, "sem_post"); + error = sem_wait(&buf[1]); + if (error != 0) + err(1, "sem_wait"); + } + benchmark_stop(); + + close(procfd); + + for (j = 0; j < 2; j++) { + error = sem_destroy(&buf[j]); + if (error != 0) + err(1, "sem_destroy"); + } + + error = munmap(buf, PAGE_SIZE); + if (error != 0) + err(1, "munmap"); + + return (i); +} + +static uintmax_t test_setuid(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) { uid_t uid; @@ -900,6 +961,7 @@ static const struct test tests[] = { { "read_100000", test_read, .t_flags = FLAG_PATH, .t_int = 100000 }, { "read_1000000", test_read, .t_flags = FLAG_PATH, .t_int = 1000000 }, { "select", test_select, .t_flags = 0 }, + { "semaping", test_semaping, .t_flags = 0 }, { "setuid", test_setuid, .t_flags = 0 }, { "shmfd", test_shmfd, .t_flags = 0 }, { "shmfd_dup", test_shmfd_dup, .t_flags = 0 }, From owner-svn-src-head@freebsd.org Wed Jul 4 14:22:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A942103B9EE; Wed, 4 Jul 2018 14:22:41 +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 07DF87E746; Wed, 4 Jul 2018 14:22:40 +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 w64EMXb2029851 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 4 Jul 2018 17:22:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w64EMXb2029851 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w64EMXBe029850; Wed, 4 Jul 2018 17:22:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 4 Jul 2018 17:22:33 +0300 From: Konstantin Belousov To: Matt Macy , jhb@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335916 - head/sys/conf Message-ID: <20180704142233.GB5562@kib.kiev.ua> References: <201807032305.w63N5guY063293@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807032305.w63N5guY063293@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 14:22:41 -0000 On Tue, Jul 03, 2018 at 11:05:42PM +0000, Matt Macy wrote: > Author: mmacy > Date: Tue Jul 3 23:05:42 2018 > New Revision: 335916 > URL: https://svnweb.freebsd.org/changeset/base/335916 > > Log: > Enable MODULE_TIED by default for modules compiled with the kernel But why ? > > Requested by: jhb From owner-svn-src-head@freebsd.org Wed Jul 4 14:25:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 336C3103BDD9; Wed, 4 Jul 2018 14:25:39 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD54B7EA5D; Wed, 4 Jul 2018 14:25:38 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C02264523; Wed, 4 Jul 2018 14:25:38 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64EPcQW034875; Wed, 4 Jul 2018 14:25:38 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64EPcRV034874; Wed, 4 Jul 2018 14:25:38 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201807041425.w64EPcRV034874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Wed, 4 Jul 2018 14:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335957 - head/sys/dev/mxge X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/dev/mxge X-SVN-Commit-Revision: 335957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 14:25:39 -0000 Author: gallatin Date: Wed Jul 4 14:25:38 2018 New Revision: 335957 URL: https://svnweb.freebsd.org/changeset/base/335957 Log: mxge: fix panic at module unload r333175 (multicast changes) exposed a bug where mxge was not checking to see if the driver was being unloaded while handing ioctls that touch hardware. As a result, now that in6m_disconnect() is run from an async gtaskq, it was busy-waiting in mxge_send_cmd() while the mcast list was destroyed. Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Wed Jul 4 14:20:19 2018 (r335956) +++ head/sys/dev/mxge/if_mxge.c Wed Jul 4 14:25:38 2018 (r335957) @@ -4193,6 +4193,10 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t case SIOCADDMULTI: case SIOCDELMULTI: mtx_lock(&sc->driver_mtx); + if (sc->dying) { + mtx_unlock(&sc->driver_mtx); + return (EINVAL); + } mxge_set_multicast_list(sc); mtx_unlock(&sc->driver_mtx); break; @@ -4278,6 +4282,10 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t case SIOCGIFMEDIA: mtx_lock(&sc->driver_mtx); + if (sc->dying) { + mtx_unlock(&sc->driver_mtx); + return (EINVAL); + } mxge_media_probe(sc); mtx_unlock(&sc->driver_mtx); err = ifmedia_ioctl(ifp, (struct ifreq *)data, From owner-svn-src-head@freebsd.org Wed Jul 4 15:15:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C182104143B; Wed, 4 Jul 2018 15:15:50 +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 DF9C3821AB; Wed, 4 Jul 2018 15:15:49 +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 w64FFmvv043459; Wed, 4 Jul 2018 08:15:48 -0700 (PDT) (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 w64FFmXY043458; Wed, 4 Jul 2018 08:15:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807041515.w64FFmXY043458@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335941 - head/tools/tools/syscall_timing In-Reply-To: <201807041334.w64DYhQu007746@repo.freebsd.org> To: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 08:15:48 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 15:15:50 -0000 > Author: trasz > Date: Wed Jul 4 13:34:43 2018 > New Revision: 335941 > URL: https://svnweb.freebsd.org/changeset/base/335941 > > Log: > Add a trivial "pipe ping" (two processes) benchmark. > > Obtained from: CheriBSD > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/tools/tools/syscall_timing/syscall_timing.c > > Modified: head/tools/tools/syscall_timing/syscall_timing.c > ============================================================================== > --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:31:55 2018 (r335940) > +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:34:43 2018 (r335941) > @@ -31,6 +31,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -251,6 +252,52 @@ test_select(uintmax_t num, uintmax_t int_arg __unused, > } > > static uintmax_t > +test_pipeping(uintmax_t num, uintmax_t int_arg, const char *path __unused) > +{ > + char buf[int_arg]; > + uintmax_t i; > + ssize_t ret; > + pid_t pid; > + int fd[2], procfd; > + > + if (pipe(fd) < 0) > + err(-1, "pipe"); > + > + pid = pdfork(&procfd, 0); > + if (pid < 0) > + err(1, "pdfork"); > + > + if (pid == 0) { > + close(fd[0]); > + > + for (;;) { > + ret = read(fd[1], buf, int_arg); > + if ((uintmax_t)ret != int_arg) > + err(1, "read"); > + ret = write(fd[1], buf, int_arg); > + if ((uintmax_t)ret != int_arg) > + err(1, "write"); > + } > + } > + > + close(fd[1]); > + > + benchmark_start(); > + BENCHMARK_FOREACH(i, num) { > + ret = write(fd[0], buf, int_arg); > + if ((uintmax_t)ret != int_arg) > + err(1, "write"); > + ret = read(fd[0], buf, int_arg); > + if ((uintmax_t)ret != int_arg) > + err(1, "read"); > + } > + benchmark_stop(); > + > + close(procfd); > + return (i); > +} > + > +static uintmax_t > test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path __unused) > { > uintmax_t i; > @@ -694,6 +741,18 @@ static const struct test tests[] = { > { "getppid", test_getppid, .t_flags = 0 }, > { "getresuid", test_getresuid, .t_flags = 0 }, > { "clock_gettime", test_clock_gettime, .t_flags = 0 }, > + { "pipeping_1", test_pipeping, .t_flags = 0, .t_int = 1 }, > + { "pipeping_10", test_pipeping, .t_flags = 0, .t_int = 10 }, > + { "pipeping_100", test_pipeping, .t_flags = 0, .t_int = 100 }, > + { "pipeping_1000", test_pipeping, .t_flags = 0, .t_int = 1000 }, > + { "pipeping_10000", test_pipeping, .t_flags = 0, .t_int = 10000 }, > +#ifdef notyet > + /* > + * XXX: Doesn't work; kernel pipe buffer too small? > + */ > + { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 }, > + { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = 1000000 }, > + #endif Can you get the size of the pipe buffer and make a run time decision on this? Not all of us run with defaults.... Hum, does not seem it is easy to get this pipe size info from userland... > { "gettimeofday", test_gettimeofday, .t_flags = 0 }, > { "getpriority", test_getpriority, .t_flags = 0 }, > { "getprogname", test_getprogname, .t_flags = 0 }, > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jul 4 15:26:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC2B41041FA5; Wed, 4 Jul 2018 15:26:07 +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 5CCDD8282C; Wed, 4 Jul 2018 15:26: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 w64FQ3cx043503; Wed, 4 Jul 2018 08:26:03 -0700 (PDT) (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 w64FQ3YN043502; Wed, 4 Jul 2018 08:26:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807041526.w64FQ3YN043502@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335941 - head/tools/tools/syscall_timing In-Reply-To: <201807041515.w64FFmXY043458@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Wed, 4 Jul 2018 08:26:03 -0700 (PDT) CC: Edward Tomasz Napierala , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 15:26:08 -0000 > > Author: trasz > > Date: Wed Jul 4 13:34:43 2018 > > New Revision: 335941 > > URL: https://svnweb.freebsd.org/changeset/base/335941 > > > > Log: ... > > +#ifdef notyet > > + /* > > + * XXX: Doesn't work; kernel pipe buffer too small? > > + */ > > + { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 }, > > + { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = 1000000 }, > > + #endif > > Can you get the size of the pipe buffer and make a run time > decision on this? Not all of us run with defaults.... > Hum, does not seem it is easy to get this pipe size info from userland... Nvm, if I read the rest of the commit mail correctly you already have done this, THANKS! > > { "gettimeofday", test_gettimeofday, .t_flags = 0 }, > > { "getpriority", test_getpriority, .t_flags = 0 }, > > { "getprogname", test_getprogname, .t_flags = 0 }, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jul 4 16:15:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3CE101A0C2 for ; Wed, 4 Jul 2018 16:15:21 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 4F5CE849E9; Wed, 4 Jul 2018 16:15:21 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1129) id 4650A1FA53; Wed, 4 Jul 2018 16:15:21 +0000 (UTC) Date: Wed, 4 Jul 2018 16:15:21 +0000 From: Li-Wen Hsu To: Mark Millard Cc: Bryan Drewery , svn-src-head@freebsd.org Subject: Re: Something broke ci.freebsd.org 's FreeBSD-head-{amd64,i386,riscv64}-{images,testvm} : fetch authentication errors Message-ID: <20180704161521.GA76770@freefall.freebsd.org> References: <290972A4-3188-4158-AFCA-DC856A7DB0E2@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <290972A4-3188-4158-AFCA-DC856A7DB0E2@yahoo.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 16:15:21 -0000 On Tue, Jul 03, 2018 at 23:10:55 -0700, Mark Millard wrote: > [Note: around -r33590{4,6,7,8} these build attempts broke > in some cases but FreeBSD-head-{amd64,i386,riscv64}-{images,testvm} > just was never built for such. FreeBSD-head-amd64-testvm > first fails at -r335904 but FreeBSD-head-amd64-images > built -r335904 and failed for -r335908. Both i386's jumped > from -r335902 (built) to -r335907 (failed). riscv64's: from > -r335905 (built) to -r335907 (failed).] > > Example: https://ci.freebsd.org/job/FreeBSD-head-amd64-testvm/8651/console > shows: > > . . . > 20:23:29 setup jail FreeBSD-head-amd64-testvm using following parameters: > . . . > 20:23:29 Certificate verification failed for /CN=artifact.ci.freebsd.org > 20:23:29 34364199992:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/s3_clnt.c:1269: > 20:23:29 fetch: https://artifact.ci.FreeBSD.org/snapshot/head/r329172/amd64/amd64/base.txz: Authentication error > . . . > 20:24:04 + DIST_PACKAGES='base kernel doc tests base-dbg kernel-dbg lib32 lib32-dbg' > 20:24:04 + mkdir -p ufs > 20:24:04 + fetch https://artifact.ci.freebsd.org/snapshot/head/r335904/amd64/amd64/base.txz > 20:24:04 Certificate verification failed for /CN=artifact.ci.freebsd.org > 20:24:04 34364183608:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/s3_clnt.c:1269: > 20:24:04 fetch: https://artifact.ci.freebsd.org/snapshot/head/r335904/amd64/amd64/base.txz: Authentication error > 20:24:04 Build step 'Execute shell' marked build as failure > 20:24:04 FTP: Current build result is [FAILURE], not going to run. This is fixed, sorry that the nginx didn't be restart after letsencrypt certificate got updated. -- Li-Wen Hsu https://lwhsu.org From owner-svn-src-head@freebsd.org Wed Jul 4 16:17:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05939101A350; Wed, 4 Jul 2018 16:17:12 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ua0-x233.google.com (mail-ua0-x233.google.com [IPv6:2607:f8b0:400c:c08::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EEAF84B5D; Wed, 4 Jul 2018 16:17:11 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ua0-x233.google.com with SMTP id t14-v6so3747766uao.8; Wed, 04 Jul 2018 09:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Nnlf9MygDe0wrzduA98QfnBoYWogOGRf2ZbM4NARyxw=; b=OnDpBl+LxRiFm2L0eAEg3hjnaHDfCvpSTFDb8COFi9w7aOtZG6ADBP5PFGMOq8RsIo LzEHV5D8qINDQTJrVMyIN2Fh7kR+Qv+xUm4l01M4dd33mr2iAMm/s9NQzwkuERLmvJwU MFt+bVh7CqRskKZ2mfFq6wmNBT8WcCuoz5GZAGk/xnvqHSMEvg81fTrQHhUr5pB3cCOg on3az3xarjvJgJlV7sObLzXomw2mqnfVn2s7nVFsH4sGoh1ffccj6P/JWKPGlnXXvmtl 20T2B0f3motcHIzwLjFR2BY0/BMRmz//J93HZftwkfaqvtkIBGnyAKYzorrL9azbA40t mYKQ== 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:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Nnlf9MygDe0wrzduA98QfnBoYWogOGRf2ZbM4NARyxw=; b=rRsLNbab6IFtCngL1CHjoD5rp4ckaPLMMsd+WD+syhdJOA66T/6YUUN2vatjZvGrQz p5kmYitTciJaGQGED0d5hnKX82HNbKVSIxpyG9nJSJPSOr1vAqqUjjnwU5eWVXE83fKL 5k6tyZPHa3G1gDqDPhXfRip4YXxmqJSdCrDk4cbLAYLmdMKhWpR/NthS44NvFmquFLMZ u3t3gT3/znRKjiCZhF13xc7J0ncYdWDIE4lQxxTRpHup/wgim86xrNMKojBC8lHonSu5 3P2BU1/cG9Re9fGnbPfHGx4y9lDyBgCUNgVsAeTNsXdtYeBRI8GY1YZMiREDJp3kbeNL OPlQ== X-Gm-Message-State: APt69E2wtTZNfMvp0wFuweyKvsDDh5LD+ylPLNYEZPBtA5AReUw+W15U h+XYZCIfgrSW44ksJ7+VjB7cJ+6KVBWn8ocQCSM= X-Google-Smtp-Source: AAOMgpe7hheBSp8L3I30f4JLPbwQT18iMmnEin1OeEDymENed4F2mPm2OCh0D0PLkHS571jQsg2Q9/2DQaI+OSXcUpw= X-Received: by 2002:ab0:304e:: with SMTP id x14-v6mr1576878ual.80.1530721030330; Wed, 04 Jul 2018 09:17:10 -0700 (PDT) MIME-Version: 1.0 Sender: etnapierala@gmail.com Received: by 2002:ab0:5c2f:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 09:17:09 -0700 (PDT) In-Reply-To: <201807041526.w64FQ3YN043502@pdx.rh.CN85.dnsmgr.net> References: <201807041515.w64FFmXY043458@pdx.rh.CN85.dnsmgr.net> <201807041526.w64FQ3YN043502@pdx.rh.CN85.dnsmgr.net> From: Edward Napierala Date: Wed, 4 Jul 2018 17:17:09 +0100 X-Google-Sender-Auth: l6PSDmxVTn91nWdHFm_EOKR0j3A Message-ID: Subject: Re: svn commit: r335941 - head/tools/tools/syscall_timing To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 16:17:12 -0000 2018-07-04 16:26 GMT+01:00 Rodney W. Grimes : > > > Author: trasz > > > Date: Wed Jul 4 13:34:43 2018 > > > New Revision: 335941 > > > URL: https://svnweb.freebsd.org/changeset/base/335941 > > > > > > Log: > ... > > > +#ifdef notyet > > > + /* > > > + * XXX: Doesn't work; kernel pipe buffer too small? > > > + */ > > > + { "pipeping_100000", test_pipeping, .t_flags = 0, .t_int = 100000 > }, > > > + { "pipeping_1000000", test_pipeping, .t_flags = 0, .t_int = > 1000000 }, > > > + #endif > > > > Can you get the size of the pipe buffer and make a run time > > decision on this? Not all of us run with defaults.... > > Hum, does not seem it is easy to get this pipe size info from userland... > > Nvm, if I read the rest of the commit mail correctly you > already have done this, THANKS! > Yeah, I've been merging it from Git, commit by commit, and that's the result. Thanks :-) From owner-svn-src-head@freebsd.org Wed Jul 4 16:34:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B532101F031; Wed, 4 Jul 2018 16:34:08 +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 A92A485897; Wed, 4 Jul 2018 16:34:07 +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 84CEC5A96; Wed, 4 Jul 2018 16:34:07 +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 w64GY7Yp002038; Wed, 4 Jul 2018 16:34:07 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64GY7YP002037; Wed, 4 Jul 2018 16:34:07 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807041634.w64GY7YP002037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 4 Jul 2018 16:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335958 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 335958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 16:34:08 -0000 Author: mmacy Date: Wed Jul 4 16:34:07 2018 New Revision: 335958 URL: https://svnweb.freebsd.org/changeset/base/335958 Log: fix 335919 - check "last" not "inp" where appropriate Submitted by: ae Reported by: cy Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Wed Jul 4 14:25:38 2018 (r335957) +++ head/sys/netinet6/udp6_usrreq.c Wed Jul 4 16:34:07 2018 (r335958) @@ -387,7 +387,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { INP_RLOCK(last); - if (__predict_true(inp->inp_flags2 & INP_FREED) == 0) { + if (__predict_true(last->inp_flags2 & INP_FREED) == 0) { UDP_PROBE(receive, NULL, last, ip6, last, uh); if (udp6_append(last, n, off, fromsa)) @@ -421,7 +421,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) goto badheadlocked; } INP_RLOCK(last); - if (__predict_true(inp->inp_flags2 & INP_FREED) == 0) { + if (__predict_true(last->inp_flags2 & INP_FREED) == 0) { UDP_PROBE(receive, NULL, last, ip6, last, uh); if (udp6_append(last, m, off, fromsa) == 0) INP_RUNLOCK(last); From owner-svn-src-head@freebsd.org Wed Jul 4 16:41:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E422A101FB8F; Wed, 4 Jul 2018 16:41:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (mx-int.allbsd.org [IPv6:2001:2f0:104:e002::7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gatekeeper.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6E785C57; Wed, 4 Jul 2018 16:41:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:c00:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id w64GenQ2011085 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) (Client CN "/OU=GT07882699/OU=See+20www.rapidssl.com/resources/cps+20+28c+2915/OU=Domain+20Control+20Validated+20-+20RapidSSL+28R+29/CN=*.allbsd.org", Issuer "/C=US/O=GeoTrust+20Inc./CN=RapidSSL+20SHA256+20CA+20-+20G3"); Thu, 5 Jul 2018 01:41:00 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:c00:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id w64GehOU094747 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Jul 2018 01:40:43 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:0:0:0:0:0:0:0:1]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id w64Gee3l094744; Thu, 5 Jul 2018 01:40:42 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Thu, 05 Jul 2018 01:37:15 +0900 (JST) Message-Id: <20180705.013715.810854236306970666.hrs@allbsd.org> To: daichigoto@icloud.com, daichi@freebsd.org Cc: lists@eitanadler.com, gnn@FreeBSD.org, cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335836 - head/usr.bin/top From: Hiroki Sato In-Reply-To: <20180703.020956.859981414196673670.hrs@allbsd.org> References: <20180702.155529.1102410939281120947.hrs@allbsd.org> <459BD898-8072-426E-A968-96C1382AC616@icloud.com> <20180703.020956.859981414196673670.hrs@allbsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Thu_Jul__5_01_37_15_2018_534)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Wed, 04 Jul 2018 16:41:01 +0000 (UTC) X-Spam-Status: No, score=-95.0 required=13.0 tests=CONTENT_TYPE_PRESENT, ISO2022JP_BODY,QENCPTR1,RCVD_IN_AHBL,RCVD_IN_AHBL_PROXY,RCVD_IN_AHBL_SPAM, RDNS_NONE,SPF_SOFTFAIL,URIBL_SC2_SURBL,URIBL_XS_SURBL,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mx.allbsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 16:41:14 -0000 ----Security_Multipart0(Thu_Jul__5_01_37_15_2018_534)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Jul__5_01_37_15_2018_361)--" Content-Transfer-Encoding: 7bit ----Next_Part(Thu_Jul__5_01_37_15_2018_361)-- Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Hiroki Sato wrote in <20180703.020956.859981414196673670.hrs@allbsd.org>: hr> $B8eF#BgCO(B wrote hr> in <459BD898-8072-426E-A968-96C1382AC616@icloud.com>: hr> hr> da> hr> da> hr> da> > 2018/07/02 15:55$B!"(BHiroki Sato $B$N%a!<%k(B: hr> da> > hr> da> > Eitan Adler wrote hr> da> > in : hr> da> > hr> da> > li> On 1 July 2018 at 10:08, Conrad Meyer wrote: hr> da> > li> > Hi Daichi, hr> da> > li> > hr> da> > li> > hr> da> > li> > hr> da> > li> > I don't think code to decode UTF-8 belongs in top(1). I don't know hr> da> > li> > what the goal of this routine is, but I doubt this is the right way to hr> da> > li> > accomplish it. hr> da> > li> hr> da> > li> For the record, I agree. This is why I didn't click "accept" on the hr> da> > li> revision. I don't fully oppose leaving it in top(1) for now as we work hr> da> > li> out the API, but long term its the wrong place. hr> da> > li> hr> da> > li> https://reviews.freebsd.org/D16058 is the review. hr> da> > hr> da> > I strongly object this kind of encoding-specific routine. Please hr> da> > back out it. The problem is that top(1) does not support multibyte hr> da> > encoding in functions for printing, and using C99 wide/multibyte hr> da> > character manipulation API such as iswprint(3) is the way to solve hr> da> > it. Doing getenv("LANG") and assuming an encoding based on it is a hr> da> > very bad practice to internationalize software. hr> da> > hr> da> > -- Hiroki hr> da> hr> da> I respect what you mean. hr> da> hr> da> Once I back out, I will begin implementing it in a different way. hr> da> Please advise which function should be used for implementation hr> da> (iswprint (3) and what other functions should be used?) hr> hr> Roughly speaking, POSIX/XPG/C99 I18N model requires the following hr> steps: (snip) Are you going to back out r335836, or disagree about it? If there is no objection in the next 24 hours, I will commit the attached patch. This should be a minimal change to support multibyte characters in ARGV array depending on LC_CTYPE, not limited to UTF-8. -- Hiroki ----Next_Part(Thu_Jul__5_01_37_15_2018_361)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="top_mbsupport.20180705-1.diff" Index: usr.bin/top/display.c =================================================================== --- usr.bin/top/display.c (revision 335957) +++ usr.bin/top/display.c (working copy) @@ -1248,55 +1248,6 @@ } } -/* - * printable(str) - make the string pointed to by "str" into one that is - * printable (i.e.: all ascii), by converting all non-printable - * characters into '?'. Replacements are done in place and a pointer - * to the original buffer is returned. - */ - -char * -printable(char str[]) -{ - char *ptr; - char ch; - - ptr = str; - if (utf8flag) { - while ((ch = *ptr) != '\0') { - if (0x00 == (0x80 & ch)) { - if (!isprint(ch)) { - *ptr = '?'; - } - ++ptr; - } else if (0xC0 == (0xE0 & ch)) { - ++ptr; - if ('\0' != *ptr) ++ptr; - } else if (0xE0 == (0xF0 & ch)) { - ++ptr; - if ('\0' != *ptr) ++ptr; - if ('\0' != *ptr) ++ptr; - } else if (0xF0 == (0xF8 & ch)) { - ++ptr; - if ('\0' != *ptr) ++ptr; - if ('\0' != *ptr) ++ptr; - if ('\0' != *ptr) ++ptr; - } else { - *ptr = '?'; - ++ptr; - } - } - } else { - while ((ch = *ptr) != '\0') { - if (!isprint(ch)) { - *ptr = '?'; - } - ptr++; - } - } - return(str); -} - void i_uptime(struct timeval *bt, time_t *tod) { Index: usr.bin/top/display.h =================================================================== --- usr.bin/top/display.h (revision 335957) +++ usr.bin/top/display.h (working copy) @@ -11,7 +11,6 @@ void clear_message(void); int display_resize(void); void i_header(const char *text); -char *printable(char *string); void display_header(int t); int display_init(struct statics *statics); void i_arc(int *stats); Index: usr.bin/top/machine.c =================================================================== --- usr.bin/top/machine.c (revision 335957) +++ usr.bin/top/machine.c (working copy) @@ -986,13 +986,8 @@ if (*src == '\0') continue; len = (argbuflen - (dst - argbuf) - 1) / 4; - if (utf8flag) { - utf8strvisx(dst, src, MIN(strlen(src), len)); - } else { - strvisx(dst, src, - MIN(strlen(src), len), - VIS_NL | VIS_CSTYLE); - } + strvisx(dst, src, MIN(strlen(src), len), + VIS_NL | VIS_CSTYLE | VIS_OCTAL); while (*dst != '\0') dst++; if ((argbuflen - (dst - argbuf) - 1) / 4 > 0) @@ -1089,7 +1084,7 @@ sbuf_printf(procbuf, "%6s ", format_time(cputime)); sbuf_printf(procbuf, "%6.2f%% ", ps.wcpu ? 100.0 * weighted_cpu(PCTCPU(pp), pp) : 100.0 * PCTCPU(pp)); } - sbuf_printf(procbuf, "%s", printable(cmdbuf)); + sbuf_printf(procbuf, "%s", cmdbuf); free(cmdbuf); return (sbuf_data(procbuf)); } Index: usr.bin/top/top.c =================================================================== --- usr.bin/top/top.c (revision 335957) +++ usr.bin/top/top.c (working copy) @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -69,7 +70,6 @@ struct process_select ps; const char * myname = "top"; pid_t mypid; -bool utf8flag = false; /* pointers to display routines */ static void (*d_loadave)(int mpid, double *avenrun) = i_loadave; @@ -276,6 +276,11 @@ } } + if (setlocale(LC_ALL, "") == NULL) { + fprintf(stderr, "%s: invalid locale.\n", myname); + exit(1); + } + mypid = getpid(); /* get our name */ @@ -607,14 +612,6 @@ fputc('\n', stderr); } - /* check if you are using UTF-8 */ - char *env_lang; - if (NULL != (env_lang = getenv("LANG")) && - 0 != strcmp(env_lang, "") && - NULL != strstr(env_lang, "UTF-8")) { - utf8flag = true; - } - restart: /* Index: usr.bin/top/top.h =================================================================== --- usr.bin/top/top.h (revision 335957) +++ usr.bin/top/top.h (working copy) @@ -8,7 +8,6 @@ #define TOP_H #include -#include /* Number of lines of header information on the standard screen */ extern int Header_lines; @@ -38,7 +37,6 @@ extern int pcpu_stats; extern int overstrike; extern pid_t mypid; -extern bool utf8flag; extern const char * myname; Index: usr.bin/top/utils.c =================================================================== --- usr.bin/top/utils.c (revision 335957) +++ usr.bin/top/utils.c (working copy) @@ -2,7 +2,6 @@ * This program may be freely redistributed, * but this entire comment MUST remain intact. * - * Copyright (c) 2018, Daichi Goto * Copyright (c) 2018, Eitan Adler * Copyright (c) 1984, 1989, William LeFebvre, Rice University * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University @@ -329,61 +328,3 @@ kvm_close(kd); return ret; } - -/* - * utf8strvisx(dst,src,src_len) - * strvisx(dst,src,src_len,VIS_NL|VIS_CSTYLE) coresponding to UTF-8. - */ -static const char *vis_encodes[] = { - "\\0", "\\^A", "\\^B", "\\^C", "\\^D", "\\^E", "\\^F", "\\a", - "\\b", "\t", "\\n", "\\v", "\\f", "\\r", "\\^N", "\\^O", "\\^P", - "\\^Q", "\\^R", "\\^S", "\\^T", "\\^U", "\\^V", "\\^W", "\\^X", - "\\^Y", "\\^Z", "\\^[", "\\^\\", "\\^]", "\\^^", "\\^_" -}; - -int -utf8strvisx(char *dst, const char *src, size_t src_len) -{ - const signed char *src_p; - char *dst_p; - int i, j, olen, len; - - src_p = src; - dst_p = dst; - i = olen = 0; - len = (int)src_len; - while (i < len) { - if (0x00 == (0x80 & *src_p)) { - if (0 <= *src_p && *src_p <= 31) { - j = strlen(vis_encodes[(int)*src_p]); - strcpy(dst_p, vis_encodes[(int)*src_p]); - dst_p += j; - olen += j; - } else if (127 == *src_p) { - strcpy(dst_p, "\\^?"); - olen += 3; - } else { - *dst_p++ = *src_p; - ++olen; - } - ++i; - ++src_p; - } else if (0xC0 == (0xE0 & *src_p)) { - *dst_p++ = *src_p++; ++i; ++olen; - if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } - } else if (0xE0 == (0xF0 & *src_p)) { - *dst_p++ = *src_p++; ++i; ++olen; - if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } - if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } - } else if (0xF0 == (0xF8 & *src_p)) { - *dst_p++ = *src_p++; ++i; ++olen; - if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } - if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } - if (i < len) { *dst_p++ = *src_p++; ++i; ++olen; } - } else { - *dst_p++ = '?'; ++i; ++olen; - } - } - - return olen; -} Index: usr.bin/top/utils.h =================================================================== --- usr.bin/top/utils.h (revision 335957) +++ usr.bin/top/utils.h (working copy) @@ -22,5 +22,4 @@ char *format_k(int64_t); int string_index(const char *string, const char * const *array); int find_pid(pid_t pid); -int utf8strvisx(char *, const char *, size_t); ----Next_Part(Thu_Jul__5_01_37_15_2018_361)---- ----Security_Multipart0(Thu_Jul__5_01_37_15_2018_534)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAls897sACgkQTyzT2CeTzy0hWgCdGFlfYH9+dCrZ53Nm0hm1qqL3 XLcAnROqVtAT85GtvSdg/spBq1kqH3Kq =jnqj -----END PGP SIGNATURE----- ----Security_Multipart0(Thu_Jul__5_01_37_15_2018_534)---- From owner-svn-src-head@freebsd.org Wed Jul 4 16:50:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC5861022B85; Wed, 4 Jul 2018 16:50:52 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59CAE86285; Wed, 4 Jul 2018 16:50:52 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C5165C67; Wed, 4 Jul 2018 16:50:52 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64Goqfj007466; Wed, 4 Jul 2018 16:50:52 GMT (envelope-from seanc@FreeBSD.org) Received: (from seanc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64GoqdH007465; Wed, 4 Jul 2018 16:50:52 GMT (envelope-from seanc@FreeBSD.org) Message-Id: <201807041650.w64GoqdH007465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: seanc set sender to seanc@FreeBSD.org using -f From: Sean Chittenden Date: Wed, 4 Jul 2018 16:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335959 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: seanc X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 335959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 16:50:52 -0000 Author: seanc (ports committer) Date: Wed Jul 4 16:50:51 2018 New Revision: 335959 URL: https://svnweb.freebsd.org/changeset/base/335959 Log: Complete my vertex even though edges were in place. Reported by: swills Approved by: swills (mentor, implicit) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Jul 4 16:34:07 2018 (r335958) +++ head/share/misc/committers-ports.dot Wed Jul 4 16:50:51 2018 (r335959) @@ -225,6 +225,7 @@ sat [label="Andrew Pantyukhin\nsat@FreeBSD.org\n2006/0 sbruno [label="Sean Bruno\nsbruno@FreeBSD.org\n2014/09/14"] sbz [label="Sofian Brabez\nsbz@FreeBSD.org\n2011/03/14"] scheidell [label="Michael Scheidell\nscheidell@FreeBSD.org\n2011/11/06"] +seanc [label="Sean Chittenden\nseanc@FreeBSD.org\n2002/08/15"] sem [label="Sergey Matveychuk\nsem@FreeBSD.org\n2004/07/07"] sergei [label="Sergei Kolobov\nsergei@FreeBSD.org\n2003/10/21"] shaun [label="Shaun Amott\nshaun@FreeBSD.org\n2006/06/19"] From owner-svn-src-head@freebsd.org Wed Jul 4 17:06:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C42A8102474C; Wed, 4 Jul 2018 17:06:24 +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 79AF587101; Wed, 4 Jul 2018 17:06:24 +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 5AF1D5FD6; Wed, 4 Jul 2018 17:06:24 +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 w64H6Osg017635; Wed, 4 Jul 2018 17:06:24 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64H6OgX017634; Wed, 4 Jul 2018 17:06:24 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807041706.w64H6OgX017634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 4 Jul 2018 17:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335960 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 17:06:24 -0000 Author: mmacy Date: Wed Jul 4 17:06:23 2018 New Revision: 335960 URL: https://svnweb.freebsd.org/changeset/base/335960 Log: epoch(9): Fix man page typo Submitted by: se Reported by: se Modified: head/share/man/man9/epoch.9 Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Wed Jul 4 16:50:51 2018 (r335959) +++ head/share/man/man9/epoch.9 Wed Jul 4 17:06:23 2018 (r335960) @@ -108,7 +108,7 @@ A caller should never call .Fn epoch_wait in the middle of an epoch section for the same epoch as this will lead to a deadlock. .Pp -Be default mutexes cannot be held across +By default mutexes cannot be held across .Fn epoch_wait_preempt . To permit this the epoch must be allocated with EPOCH_LOCKED. From owner-svn-src-head@freebsd.org Wed Jul 4 17:06:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BFB11024805; Wed, 4 Jul 2018 17:06: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 E262B87245; Wed, 4 Jul 2018 17:06:51 +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 C39375FD7; Wed, 4 Jul 2018 17:06: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 w64H6pXF017703; Wed, 4 Jul 2018 17:06:51 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64H6pFU017702; Wed, 4 Jul 2018 17:06:51 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201807041706.w64H6pFU017702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 4 Jul 2018 17:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335961 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 17:06:52 -0000 Author: oshogbo Date: Wed Jul 4 17:06:51 2018 New Revision: 335961 URL: https://svnweb.freebsd.org/changeset/base/335961 Log: Add description to debug.ncores sysctl. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D16123 Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed Jul 4 17:06:23 2018 (r335960) +++ head/sys/kern/kern_sig.c Wed Jul 4 17:06:51 2018 (r335961) @@ -3243,7 +3243,8 @@ sysctl_debug_num_cores_check (SYSCTL_HANDLER_ARGS) return (0); } SYSCTL_PROC(_debug, OID_AUTO, ncores, CTLTYPE_INT|CTLFLAG_RW, - 0, sizeof(int), sysctl_debug_num_cores_check, "I", ""); + 0, sizeof(int), sysctl_debug_num_cores_check, "I", + "Maximum number of generated process corefiles while using index format"); #define GZIP_SUFFIX ".gz" #define ZSTD_SUFFIX ".zst" From owner-svn-src-head@freebsd.org Wed Jul 4 17:10:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 514691024E3E; Wed, 4 Jul 2018 17:10:08 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F187987528; Wed, 4 Jul 2018 17:10:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D27515FE1; Wed, 4 Jul 2018 17:10:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64HA7BL017909; Wed, 4 Jul 2018 17:10:07 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64HA7ZW017908; Wed, 4 Jul 2018 17:10:07 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807041710.w64HA7ZW017908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 4 Jul 2018 17:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335962 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 335962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 17:10:08 -0000 Author: sbruno Date: Wed Jul 4 17:10:07 2018 New Revision: 335962 URL: https://svnweb.freebsd.org/changeset/base/335962 Log: fix locking within tcp_ipsec_pcbctl() to match ipsec4_pcbctl(), ipsec4_pcbctl() IPSEC_PCBCTL() functions, which include tcp_ipsec_pcbctl(), ipsec4_pcbctl(), and ipsec6_pcbctl(), should all have matching locking semantics. ipsec4_pcbctl() and ipsec6_pcbctl() expect the inp to be unlocked on entry and exit and appear to be correctly implemented as such. But tcp_ipsec_pcbctl() had other semantics. This patch fixes the semantics for tcp_ipsec_pcbctl(). Submitted by: Jason Eggleston MFH: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14623 Modified: head/sys/netipsec/xform_tcp.c Modified: head/sys/netipsec/xform_tcp.c ============================================================================== --- head/sys/netipsec/xform_tcp.c Wed Jul 4 17:06:51 2018 (r335961) +++ head/sys/netipsec/xform_tcp.c Wed Jul 4 17:10:07 2018 (r335962) @@ -80,23 +80,24 @@ tcp_ipsec_pcbctl(struct inpcb *inp, struct sockopt *so struct tcpcb *tp; int error, optval; - INP_WLOCK_ASSERT(inp); if (sopt->sopt_name != TCP_MD5SIG) { - INP_WUNLOCK(inp); return (ENOPROTOOPT); } - tp = intotcpcb(inp); if (sopt->sopt_dir == SOPT_GET) { + INP_RLOCK(inp); + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { + INP_RUNLOCK(inp); + return (ECONNRESET); + } + tp = intotcpcb(inp); optval = (tp->t_flags & TF_SIGNATURE) ? 1 : 0; - INP_WUNLOCK(inp); + INP_RUNLOCK(inp); /* On success return with released INP_WLOCK */ return (sooptcopyout(sopt, &optval, sizeof(optval))); } - INP_WUNLOCK(inp); - error = sooptcopyin(sopt, &optval, sizeof(optval), sizeof(optval)); if (error != 0) return (error); @@ -107,12 +108,13 @@ tcp_ipsec_pcbctl(struct inpcb *inp, struct sockopt *so INP_WUNLOCK(inp); return (ECONNRESET); } + tp = intotcpcb(inp); if (optval > 0) tp->t_flags |= TF_SIGNATURE; else tp->t_flags &= ~TF_SIGNATURE; - /* On success return with acquired INP_WLOCK */ + INP_WUNLOCK(inp); return (error); } From owner-svn-src-head@freebsd.org Wed Jul 4 17:18:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0F211025CE2; Wed, 4 Jul 2018 17:18:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 946D58860D; Wed, 4 Jul 2018 17:18:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75A5261A1; Wed, 4 Jul 2018 17:18:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64HIaKh022781; Wed, 4 Jul 2018 17:18:36 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64HIZOg022778; Wed, 4 Jul 2018 17:18:35 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807041718.w64HIZOg022778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 4 Jul 2018 17:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: etc share/mk tools/build/mk tools/build/options X-SVN-Commit-Revision: 335963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 17:18:37 -0000 Author: sbruno Date: Wed Jul 4 17:18:35 2018 New Revision: 335963 URL: https://svnweb.freebsd.org/changeset/base/335963 Log: WITHOUT_SERVICESDB: Add src.conf knob to disable the installation of /var/db/services.db Default to leaving services.db in place, but allow the removal of the file and its creation with a src.conf knob. This file ends up being 2MB in size. For small systems this is a waste of space but its a tradeoff. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D9655 Added: head/tools/build/options/WITHOUT_SERVICESDB (contents, props changed) Modified: head/etc/Makefile head/share/mk/src.opts.mk head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jul 4 17:10:07 2018 (r335962) +++ head/etc/Makefile Wed Jul 4 17:18:35 2018 (r335963) @@ -192,12 +192,17 @@ distribution: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${BIN1} ${DESTDIR}/etc; \ cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \ - services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ - ${DESTDIR}/etc/services; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \ ${BIN2} ${DESTDIR}/etc; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; + +.if ${MK_SERVICESDB} != "no" + cd ${.CURDIR}; \ + services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ + ${DESTDIR}/etc/services; +.endif + .if ${MK_BSNMP} != "no" cd ${.CURDIR}; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jul 4 17:10:07 2018 (r335962) +++ head/share/mk/src.opts.mk Wed Jul 4 17:18:35 2018 (r335963) @@ -160,6 +160,7 @@ __DEFAULT_YES_OPTIONS = \ RESCUE \ ROUTED \ SENDMAIL \ + SERVICESDB \ SETUID_LOGIN \ SHAREDOCS \ SOURCELESS \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 4 17:10:07 2018 (r335962) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 4 17:18:35 2018 (r335963) @@ -7527,6 +7527,10 @@ OLD_DIRS+=usr/share/sendmail/cf OLD_DIRS+=usr/share/sendmail .endif +.if ${MK_SERVICESDB} == no +OLD_FILES+=var/db/services.db +.endif + .if ${MK_SHAREDOCS} == no OLD_FILES+=usr/share/doc/pjdfstest/README OLD_DIRS+=usr/share/doc/pjdfstest Added: head/tools/build/options/WITHOUT_SERVICESDB ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_SERVICESDB Wed Jul 4 17:18:35 2018 (r335963) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not install +.Pa /var/db/services.db . From owner-svn-src-head@freebsd.org Wed Jul 4 17:48:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27193102944D; Wed, 4 Jul 2018 17:48: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 84C028A3DD; Wed, 4 Jul 2018 17:48: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 w64HmQvC044035; Wed, 4 Jul 2018 10:48:26 -0700 (PDT) (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 w64HmO13044034; Wed, 4 Jul 2018 10:48:24 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807041748.w64HmO13044034@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options In-Reply-To: <201807041718.w64HIZOg022778@repo.freebsd.org> To: Sean Bruno Date: Wed, 4 Jul 2018 10:48:24 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 17:48:31 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: sbruno > Date: Wed Jul 4 17:18:35 2018 > New Revision: 335963 > URL: https://svnweb.freebsd.org/changeset/base/335963 > > Log: > WITHOUT_SERVICESDB: > > Add src.conf knob to disable the installation of /var/db/services.db > > Default to leaving services.db in place, but allow the removal of the > file and its creation with a src.conf knob. > > This file ends up being 2MB in size. For small systems this is a waste > of space but its a tradeoff. THANK YOU! I can now remove an ugly local hack :-) > > Reviewed by: bdrewery > Differential Revision: https://reviews.freebsd.org/D9655 > > Added: > head/tools/build/options/WITHOUT_SERVICESDB (contents, props changed) > Modified: > head/etc/Makefile > head/share/mk/src.opts.mk > head/tools/build/mk/OptionalObsoleteFiles.inc > > Modified: head/etc/Makefile > ============================================================================== > --- head/etc/Makefile Wed Jul 4 17:10:07 2018 (r335962) > +++ head/etc/Makefile Wed Jul 4 17:18:35 2018 (r335963) > @@ -192,12 +192,17 @@ distribution: > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > ${BIN1} ${DESTDIR}/etc; \ > cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \ > - services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ > - ${DESTDIR}/etc/services; \ > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \ > ${BIN2} ${DESTDIR}/etc; \ > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ > master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; > + > +.if ${MK_SERVICESDB} != "no" > + cd ${.CURDIR}; \ > + services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ > + ${DESTDIR}/etc/services; > +.endif > + > .if ${MK_BSNMP} != "no" > cd ${.CURDIR}; \ > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ > > Modified: head/share/mk/src.opts.mk > ============================================================================== > --- head/share/mk/src.opts.mk Wed Jul 4 17:10:07 2018 (r335962) > +++ head/share/mk/src.opts.mk Wed Jul 4 17:18:35 2018 (r335963) > @@ -160,6 +160,7 @@ __DEFAULT_YES_OPTIONS = \ > RESCUE \ > ROUTED \ > SENDMAIL \ > + SERVICESDB \ > SETUID_LOGIN \ > SHAREDOCS \ > SOURCELESS \ > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > ============================================================================== > --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 4 17:10:07 2018 (r335962) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 4 17:18:35 2018 (r335963) > @@ -7527,6 +7527,10 @@ OLD_DIRS+=usr/share/sendmail/cf > OLD_DIRS+=usr/share/sendmail > .endif > > +.if ${MK_SERVICESDB} == no > +OLD_FILES+=var/db/services.db > +.endif > + > .if ${MK_SHAREDOCS} == no > OLD_FILES+=usr/share/doc/pjdfstest/README > OLD_DIRS+=usr/share/doc/pjdfstest > > Added: head/tools/build/options/WITHOUT_SERVICESDB > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/build/options/WITHOUT_SERVICESDB Wed Jul 4 17:18:35 2018 (r335963) > @@ -0,0 +1,3 @@ > +.\" $FreeBSD$ > +Set to not install > +.Pa /var/db/services.db . > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jul 4 17:49:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D024F102961F; Wed, 4 Jul 2018 17:49:43 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 597668A56C; Wed, 4 Jul 2018 17:49:42 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-234-146.albq.qwest.net [67.0.234.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id EA3291AF637; Wed, 4 Jul 2018 09:57:56 +0000 (UTC) Subject: Re: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807041748.w64HmO13044034@pdx.rh.CN85.dnsmgr.net> From: Sean Bruno Openpgp: preference=signencrypt Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAHNN1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz7CwJQEEwEKAD4WIQToxOn4gDUE4eP0ujS95PX+ibX8tgUCWT7RQQIbAwUJBaOagAUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRC95PX+ibX8ttKTCACFKzRc56EBAlVotq02EjZP SfX+unlk6AuPBzShxqRxeK+bGYVCigrYd1M8nnskv0dEiZ5iYeND9HIxbpEyopqgpVTibA7w gBXaZ7SOEhNX1wXwg14JrralfSmPFMYni+sWegPMX/zwfAsn1z4mG1Nn44Xqo3o7CfpkMPy6 M5Bow2IDzIhEYISLR+urxs74/aHU35PLtBSDtu18914SEMDdva27MARN8mbeCDbuJVfGCPWy YHuy2t+9u2Zn5Dd+t3sBXLM9gpeaMm+4x6TNPpESygbVdh4tDdjVZ9DK/bWFg0kMgfZoaq6J l0jNsQXrZV3bzYNFbVw04pFcvA2GIJ7xzsBNBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAHCwHwEGAEKACYWIQToxOn4gDUE4eP0ujS95PX+ ibX8tgUCWT7RQQIbDAUJBaOagAAKCRC95PX+ibX8trrIB/9Pljqt/JGamD9tx4dOVmxSyFg9 z2xzgklTLuDgS73MM120mM7ao9AQUeWiSle/H0UCK7xPOzC/aeUC4oygDQKAfkkNbCNTo3+A qDjBRA8qx0e9a/QjDL+RFgD4L5kLT4tToY8T8HaBp8h03LBfk510IaI8oL/Jg7vpM3PDtJMW tUi2H+yNFmL3NfM2oBToWKLFsoP54f/eeeImrNnrlLjLHPzqS+/9apgYqX2Jwiv3tHBc4FTO GuY8VvF7BpixJs8Pc2RUuCfSyodrp1YG1kRGlXAH0cqwwr0Zmk4+7dZvtVQMCl6kS6q1+84q JwtItxS2eXSEA4NO0sQ3BXUywANh Message-ID: <75d04b89-33d0-af7f-53b4-cc45b1fd6b21@freebsd.org> Date: Wed, 4 Jul 2018 11:49:32 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807041748.w64HmO13044034@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OG8nRPxp8zNBJIxr0RSe7xTOTYOlNRwoX" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 17:49:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OG8nRPxp8zNBJIxr0RSe7xTOTYOlNRwoX Content-Type: multipart/mixed; boundary="9KdxkAApJp1lSmys9ZtXI4RDq7hKA3cIm"; protected-headers="v1" From: Sean Bruno To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <75d04b89-33d0-af7f-53b4-cc45b1fd6b21@freebsd.org> Subject: Re: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options References: <201807041748.w64HmO13044034@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201807041748.w64HmO13044034@pdx.rh.CN85.dnsmgr.net> --9KdxkAApJp1lSmys9ZtXI4RDq7hKA3cIm Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 07/04/18 11:48, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: sbruno >> Date: Wed Jul 4 17:18:35 2018 >> New Revision: 335963 >> URL: https://svnweb.freebsd.org/changeset/base/335963 >> >> Log: >> WITHOUT_SERVICESDB: >> =20 >> Add src.conf knob to disable the installation of /var/db/services.db= >> =20 >> Default to leaving services.db in place, but allow the removal of th= e >> file and its creation with a src.conf knob. >> =20 >> This file ends up being 2MB in size. For small systems this is a wa= ste >> of space but its a tradeoff. >=20 > THANK YOU! I can now remove an ugly local hack :-) >=20 >=20 Was it "rm -rf /var/db/services.db" ? :-P sean --9KdxkAApJp1lSmys9ZtXI4RDq7hKA3cIm-- --OG8nRPxp8zNBJIxr0RSe7xTOTYOlNRwoX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAls9CKxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LbPwQgAoEPovcI3LNEuFwWqryFglbeePhXKSOrhSp9vdxPx84uwso9iIp0ETeON 1NKFWwhcOvtYeNwqf+96/Qvkg2QMrQjzvv+LiCiYa4i66jzCYaYXQflZO4aLxeyo s1K/n8mUWA7tY4eL2w+CoWFvuVYLwRbbLa6nXoL/Vw159D73I91P354WrlsBHzNg kgpqWhDBSi1u16GH8MU6NYjDPcGw4MMjUuHuRI4Ft819DZwy6FXh7U9IuOjw+zW7 7wcQx3Tzm11z1kseER1rykfX+Iro9J9uSNyqj8mm90l1UhjSQ0ZXWqtIVtX7AJ1o lxlOsbWIr+lAVWkamYo6zBiyxsTDhA== =NzIH -----END PGP SIGNATURE----- --OG8nRPxp8zNBJIxr0RSe7xTOTYOlNRwoX-- From owner-svn-src-head@freebsd.org Wed Jul 4 18:54:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02C71102F96A; Wed, 4 Jul 2018 18:54:45 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A933E8D616; Wed, 4 Jul 2018 18:54:44 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B8097200; Wed, 4 Jul 2018 18:54:44 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64IsiNK075722; Wed, 4 Jul 2018 18:54:44 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64IsiVA075721; Wed, 4 Jul 2018 18:54:44 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201807041854.w64IsiVA075721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Wed, 4 Jul 2018 18:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335966 - head/sys/dev/mxge X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/dev/mxge X-SVN-Commit-Revision: 335966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 18:54:45 -0000 Author: gallatin Date: Wed Jul 4 18:54:44 2018 New Revision: 335966 URL: https://svnweb.freebsd.org/changeset/base/335966 Log: mxge: Add SIOCGI2C support for devices with SFP/XFP cages Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Wed Jul 4 18:03:19 2018 (r335965) +++ head/sys/dev/mxge/if_mxge.c Wed Jul 4 18:54:44 2018 (r335966) @@ -4154,10 +4154,50 @@ mxge_media_status(struct ifnet *ifp, struct ifmediareq } static int +mxge_fetch_i2c(mxge_softc_t *sc, struct ifi2creq *i2c) +{ + mxge_cmd_t cmd; + uint32_t i2c_args; + int i, ms, err; + + + if (i2c->dev_addr != 0xA0 && + i2c->dev_addr != 0xA2) + return (EINVAL); + if (i2c->len > sizeof(i2c->data)) + return (EINVAL); + + for (i = 0; i < i2c->len; i++) { + i2c_args = i2c->dev_addr << 0x8; + i2c_args |= i2c->offset + i; + cmd.data0 = 0; /* just fetch 1 byte, not all 256 */ + cmd.data1 = i2c_args; + err = mxge_send_cmd(sc, MXGEFW_CMD_I2C_READ, &cmd); + + if (err != MXGEFW_CMD_OK) + return (EIO); + /* now we wait for the data to be cached */ + cmd.data0 = i2c_args & 0xff; + err = mxge_send_cmd(sc, MXGEFW_CMD_I2C_BYTE, &cmd); + for (ms = 0; (err == EBUSY) && (ms < 50); ms++) { + cmd.data0 = i2c_args & 0xff; + err = mxge_send_cmd(sc, MXGEFW_CMD_I2C_BYTE, &cmd); + if (err == EBUSY) + DELAY(1000); + } + if (err != MXGEFW_CMD_OK) + return (EIO); + i2c->data[i] = cmd.data0; + } + return (0); +} + +static int mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { mxge_softc_t *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; + struct ifi2creq i2c; int err, mask; err = 0; @@ -4292,6 +4332,26 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t &sc->media, command); break; + case SIOCGI2C: + if (sc->connector != MXGE_XFP && + sc->connector != MXGE_SFP) { + err = ENXIO; + break; + } + err = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); + if (err != 0) + break; + mtx_lock(&sc->driver_mtx); + if (sc->dying) { + mtx_unlock(&sc->driver_mtx); + return (EINVAL); + } + err = mxge_fetch_i2c(sc, &i2c); + mtx_unlock(&sc->driver_mtx); + if (err == 0) + err = copyout(&i2c, ifr->ifr_ifru.ifru_data, + sizeof(i2c)); + break; default: err = ether_ioctl(ifp, command, data); break; From owner-svn-src-head@freebsd.org Wed Jul 4 18:56:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082BA102FC1D; Wed, 4 Jul 2018 18:56:39 +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 602D48D7E5; Wed, 4 Jul 2018 18:56:38 +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 w64IuYdG044258; Wed, 4 Jul 2018 11:56:34 -0700 (PDT) (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 w64IuY0N044257; Wed, 4 Jul 2018 11:56:34 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807041856.w64IuY0N044257@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options In-Reply-To: <75d04b89-33d0-af7f-53b4-cc45b1fd6b21@freebsd.org> To: Sean Bruno Date: Wed, 4 Jul 2018 11:56:34 -0700 (PDT) CC: rgrimes@freebsd.org, 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 18:56:39 -0000 > On 07/04/18 11:48, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: sbruno > >> Date: Wed Jul 4 17:18:35 2018 > >> New Revision: 335963 > >> URL: https://svnweb.freebsd.org/changeset/base/335963 > >> > >> Log: > >> WITHOUT_SERVICESDB: > >> > >> Add src.conf knob to disable the installation of /var/db/services.db > >> > >> Default to leaving services.db in place, but allow the removal of the > >> file and its creation with a src.conf knob. > >> > >> This file ends up being 2MB in size. For small systems this is a waste > >> of space but its a tradeoff. > > > > THANK YOU! I can now remove an ugly local hack :-) > > > > > > Was it "rm -rf /var/db/services.db" ? :-P Close, tar with --exclude services.db -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jul 4 18:59:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFDEE102FFFC; Wed, 4 Jul 2018 18:59:22 +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 67DC68D9EE; Wed, 4 Jul 2018 18:59:22 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (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 032222700341; Wed, 4 Jul 2018 14:59:15 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 032222700341 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=1530730756; bh=Xw5UQDeRvBUyQZWRHEhhHCwIF2jtLEUfnDyPwq7SO0k=; h=Subject:To:From:Date:From; b=iqEUAEhgWkwy/ahYm8OeDg8U6FFdEQeZsPRSTDt0GrixBu/KyPHwu8yDtgs0UMIup 6u5+AXxLXDucX/Zm+596CC1GHZqjYcjsuT3yXwVqcFZ6kpj0T76vbLiXyJ3wScUP3T ot5XhWTtTCt7Edf8pf6/Aq1D4ngXhuZ/vdm4xNkzjZHCbU9c0JmWntOxTAadIKyRdJ x81i6oBhD4JHCoYtyUp9AC3ZX/X+3wcPzPPE/9x6pmDy3prUXwSKp/dxgiulCrrruP iqzowCI0wlZT9dpOPr/0AgYtjBnbT96pXfZQHgOhZysw+TIHh3Y0D5zqk6MUJSOnqH M/e8WeQ/owmZA== Subject: Re: svn commit: r335966 - head/sys/dev/mxge To: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807041854.w64IsiVA075721@repo.freebsd.org> From: Andrew Gallatin Message-ID: <4176da4b-7d3a-5e1d-57e5-6c6071da3a78@cs.duke.edu> Date: Wed, 4 Jul 2018 14:59:14 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201807041854.w64IsiVA075721@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 18:59:22 -0000 On 07/04/18 14:54, Andrew Gallatin wrote: > mxge: Add SIOCGI2C support for devices with SFP/XFP cages > Note that I do not have any XFP devices to test with, only SFP and CX4. If this causes problems for XFP devices, I can restrict SIOCGI2C support to just SFP if needed. Drew From owner-svn-src-head@freebsd.org Wed Jul 4 19:29:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EEF61032D5B; Wed, 4 Jul 2018 19:29:07 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A5718F59B; Wed, 4 Jul 2018 19:29:07 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF97876F4; Wed, 4 Jul 2018 19:29:06 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64JT6kT091472; Wed, 4 Jul 2018 19:29:06 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64JT67O091471; Wed, 4 Jul 2018 19:29:06 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201807041929.w64JT67O091471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Wed, 4 Jul 2018 19:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335967 - head/sys/dev/mxge X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/dev/mxge X-SVN-Commit-Revision: 335967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 19:29:07 -0000 Author: gallatin Date: Wed Jul 4 19:29:06 2018 New Revision: 335967 URL: https://svnweb.freebsd.org/changeset/base/335967 Log: mxge: choose appropriate values for hw tso Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Wed Jul 4 18:54:44 2018 (r335966) +++ head/sys/dev/mxge/if_mxge.c Wed Jul 4 19:29:06 2018 (r335967) @@ -4984,6 +4984,9 @@ mxge_attach(device_t dev) ifp->if_ioctl = mxge_ioctl; ifp->if_start = mxge_start; ifp->if_get_counter = mxge_get_counter; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = sc->ss[0].tx.max_desc; + ifp->if_hw_tsomaxsegsize = 65536; /* Initialise the ifmedia structure */ ifmedia_init(&sc->media, 0, mxge_media_change, mxge_media_status); From owner-svn-src-head@freebsd.org Wed Jul 4 19:46:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A75A1034793; Wed, 4 Jul 2018 19:46:24 +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 A108E704FA; Wed, 4 Jul 2018 19:46:23 +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 w64JkKi1044530; Wed, 4 Jul 2018 12:46:20 -0700 (PDT) (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 w64JkKHM044529; Wed, 4 Jul 2018 12:46:20 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807041946.w64JkKHM044529@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335967 - head/sys/dev/mxge In-Reply-To: <201807041929.w64JT67O091471@repo.freebsd.org> To: Andrew Gallatin Date: Wed, 4 Jul 2018 12:46:20 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 19:46:24 -0000 > Author: gallatin > Date: Wed Jul 4 19:29:06 2018 > New Revision: 335967 > URL: https://svnweb.freebsd.org/changeset/base/335967 > > Log: > mxge: choose appropriate values for hw tso > > Modified: > head/sys/dev/mxge/if_mxge.c > > Modified: head/sys/dev/mxge/if_mxge.c > ============================================================================== > --- head/sys/dev/mxge/if_mxge.c Wed Jul 4 18:54:44 2018 (r335966) > +++ head/sys/dev/mxge/if_mxge.c Wed Jul 4 19:29:06 2018 (r335967) > @@ -4984,6 +4984,9 @@ mxge_attach(device_t dev) > ifp->if_ioctl = mxge_ioctl; > ifp->if_start = mxge_start; > ifp->if_get_counter = mxge_get_counter; > + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); Would not this be more accurate (need to reorder assigns): ifp->if_hw_tsomax = ifp->if_hw_tsomaxsegsize - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); > + ifp->if_hw_tsomaxsegcount = sc->ss[0].tx.max_desc; > + ifp->if_hw_tsomaxsegsize = 65536; > /* Initialise the ifmedia structure */ > ifmedia_init(&sc->media, 0, mxge_media_change, > mxge_media_status); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jul 4 19:46:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BB3710347C7; Wed, 4 Jul 2018 19:46:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBC4470501; Wed, 4 Jul 2018 19:46:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDE877A2B; Wed, 4 Jul 2018 19:46:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64JkQ5R001592; Wed, 4 Jul 2018 19:46:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64JkQu3001591; Wed, 4 Jul 2018 19:46:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807041946.w64JkQu3001591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 4 Jul 2018 19:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335968 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 335968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 19:46:27 -0000 Author: rmacklem Date: Wed Jul 4 19:46:26 2018 New Revision: 335968 URL: https://svnweb.freebsd.org/changeset/base/335968 Log: Fix the pNFS server so that it handles the "#mds_path" check for mirrors. The recently added feature of the pNFS server will set an fsid for the MDS file system to define the file system a DS should store files for. For a case where a DS handling all file systems has failed, it was possible for the code to check for a mirror with a specified fs, even though nfsdev_mdsisset was 0, possibly causing a false successful check for a mirror. This patch adds a check for nfsdev_mdsisset != 0 to avoid this. It only affects the pNFS server for a rare case. Found via code inspection. Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jul 4 19:29:06 2018 (r335967) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jul 4 19:46:26 2018 (r335968) @@ -7597,7 +7597,7 @@ nfsrv_delds(char *devid, NFSPROC_T *p) } if (fndds->nfsdev_mdsisset == 0 && nfsrv_faildscnt > 0) fndmirror = 1; - else { + else if (fndds->nfsdev_mdsisset != 0) { /* For the fsid is set case, search for a mirror. */ TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds != fndds && ds->nfsdev_nmp != NULL && @@ -8463,7 +8463,7 @@ nfsrv_findmirroredds(struct nfsmount *nmp) return (fndds); if (fndds->nfsdev_mdsisset == 0 && nfsrv_faildscnt > 0) fndmirror = 1; - else { + else if (fndds->nfsdev_mdsisset != 0) { /* For the fsid is set case, search for a mirror. */ TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds != fndds && ds->nfsdev_nmp != NULL && From owner-svn-src-head@freebsd.org Wed Jul 4 21:22:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FF39103DED8; Wed, 4 Jul 2018 21:22:01 +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 B6F1E73E04; Wed, 4 Jul 2018 21:22:00 +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 97F6F10A5D; Wed, 4 Jul 2018 21:22:00 +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 w64LM0Nl052096; Wed, 4 Jul 2018 21:22:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64LM0sC052094; Wed, 4 Jul 2018 21:22:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807042122.w64LM0sC052094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 4 Jul 2018 21:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335969 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 335969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 21:22:01 -0000 Author: kib Date: Wed Jul 4 21:21:59 2018 New Revision: 335969 URL: https://svnweb.freebsd.org/changeset/base/335969 Log: In x86 pmap_extract_and_hold()s, handle the case of PHYS_TO_VM_PAGE() returning NULL. vm_fault_quick_hold_pages() can be legitimately called on userspace mappings backed by fictitious pages created by unmanaged device and sg pagers. Note that other architectures pmap_extract_and_hold() might need similar fix, but I postponed the examination. Reported by: bde Discussed with: alc Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D16085 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jul 4 19:46:26 2018 (r335968) +++ head/sys/amd64/amd64/pmap.c Wed Jul 4 21:21:59 2018 (r335969) @@ -2319,7 +2319,8 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); - vm_page_hold(m); + if (m != NULL) + vm_page_hold(m); } } } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Jul 4 19:46:26 2018 (r335968) +++ head/sys/i386/i386/pmap.c Wed Jul 4 21:21:59 2018 (r335969) @@ -1684,7 +1684,8 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); - vm_page_hold(m); + if (m != NULL) + vm_page_hold(m); } } } From owner-svn-src-head@freebsd.org Wed Jul 4 21:34:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D42103EFE5; Wed, 4 Jul 2018 21:34:09 +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 D9F3E747C8; Wed, 4 Jul 2018 21:34:08 +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 BB13310C2A; Wed, 4 Jul 2018 21:34:08 +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 w64LY8fK058421; Wed, 4 Jul 2018 21:34:08 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64LY8JS058420; Wed, 4 Jul 2018 21:34:08 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807042134.w64LY8JS058420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 4 Jul 2018 21:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335970 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 21:34:09 -0000 Author: mmacy Date: Wed Jul 4 21:34:08 2018 New Revision: 335970 URL: https://svnweb.freebsd.org/changeset/base/335970 Log: epoch(9): make nesting assert in epoch_wait_preempt more specific Reported by: markj Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Wed Jul 4 21:21:59 2018 (r335969) +++ head/sys/kern/subr_epoch.c Wed Jul 4 21:34:08 2018 (r335970) @@ -421,7 +421,9 @@ 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(td->td_epochnest == 0, ("epoch_wait() in the middle of an epoch section")); + 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(); From owner-svn-src-head@freebsd.org Wed Jul 4 21:53:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D9C01040B94 for ; Wed, 4 Jul 2018 21:53:26 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x22d.google.com (mail-yb0-x22d.google.com [IPv6:2607:f8b0:4002:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2D727544B for ; Wed, 4 Jul 2018 21:53:25 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x22d.google.com with SMTP id s14-v6so2507461ybp.13 for ; Wed, 04 Jul 2018 14:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RUgwW0Y+wvuyJ/uWm0Ay9bo6ZiqDhw/mfOa8bfEnzGU=; b=A40BvB7bxxFkTLKSIUq9YmkeZ+2DJcdfEGNput1+w1dgFWIzzWcJSp1glyVcHtW5XH i5CfOj25v7DV+BdKG3F4PBb30BEnz3H489QJMRfcp5cDFJsP0hrvFs8M22sZvpI8Zbpt Dvs9ZEjr1J92D4q2eu+6H8wLhEW5k7qDhcxdM= 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=RUgwW0Y+wvuyJ/uWm0Ay9bo6ZiqDhw/mfOa8bfEnzGU=; b=UwZYjuimk7S93/2/QJ8cvLzzyLfkpmGUEQ1YBqvfnGednPkRNtBLwZJCERSQVmxFoS fjCrK3wwDuY8EBdYkZaBM0bk+L0vrhAaZLCPvJ+MlhoUnxA0dqM+AQByl2ZeoJZSKNUK 4gYkcMaMgUWAuQeXh6ek3MmakOKNRhAjdVIgYFxdXeXZ2h/MNgq8q2behLVupMx745IF BycP4yO+L358FIV1OnyOYPk2r2IuT2cJE0iY9X/l5PK7v/WeZGA9B2uWDgNFdDbyXUZf h/qE08f5hvpmjYOzzeQl7VVsgOUo0W1icqt3OCE0wFzaUG7g364+Kx6kHfZYbcgWV87L Clbg== X-Gm-Message-State: APt69E1hBxqJra2MorJhijGDCFzSzuccdCR3fbrWko1C35hCgOZf1pJt MEKk+tyfcY0LNC/RDajieQYuKRnMv54nNWEfATHBDQ== X-Google-Smtp-Source: AAOMgpdQtz/JdJbAj1t5tE8Smmo5czSxuriE9LQKWYVn4jNcRIx2l6Ps/kjtcu4Gi1UGGpd4Q1QV2TWYUDtPqtmWf5Q= X-Received: by 2002:a25:9b03:: with SMTP id y3-v6mr1873939ybn.194.1530741204869; Wed, 04 Jul 2018 14:53:24 -0700 (PDT) MIME-Version: 1.0 References: <20180702.155529.1102410939281120947.hrs@allbsd.org> <459BD898-8072-426E-A968-96C1382AC616@icloud.com> <20180703.020956.859981414196673670.hrs@allbsd.org> <20180705.013715.810854236306970666.hrs@allbsd.org> In-Reply-To: <20180705.013715.810854236306970666.hrs@allbsd.org> From: Eitan Adler Date: Wed, 4 Jul 2018 14:52:58 -0700 Message-ID: Subject: Re: svn commit: r335836 - head/usr.bin/top To: Hiroki Sato Cc: daichigoto@icloud.com, Daichi GOTO , George Neville-Neil , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 21:53:26 -0000 On Wed, 4 Jul 2018 at 09:41, Hiroki Sato wrote: > > Are you going to back out r335836, or disagree about it? > > If there is no objection in the next 24 hours, I will commit the > attached patch. This should be a minimal change to support multibyte > characters in ARGV array depending on LC_CTYPE, not limited to UTF-8. Based on this conversation and my otherwise minimal knowledge about software localization this LGTM. Thanks! -- Eitan Adler From owner-svn-src-head@freebsd.org Wed Jul 4 23:44:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8301029513; Wed, 4 Jul 2018 23:44:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 248F679862; Wed, 4 Jul 2018 23:44:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x242.google.com with SMTP id l7-v6so6100727ioj.1; Wed, 04 Jul 2018 16:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=D+5rSZioY2v38ZosgZdENulGQONJIdeGOofeGa4Ln/U=; b=FA5v6WKwTQuq5fmKGP67oRRIMWdbNxkNE6pNw7Dn33LTlNapnunFlxbEKxVnseSWCB QaaY3PoH5nAq5VDnIS5Vh7xD3a0c9AHc2CrDSFFCRUT9W9AifNXsHr+S6DmZ56hE9Wfj ptabU2nGhK2b05zgdVR+xsGsDjB/GDm4m5Zs7xpWYOgCxInoZRuWyQudZp3Lz3Ddocj5 7sYComOTNRM+o5Rv/TtZJhO8OrACEFBH6l8fkCCNZRLixHJG4LtSZqqdL1W7IWb8S9sH l84697CBeAqgYkGqJgoD5HWpwTtCLMwDEXfFoZy+2G+fzYOotJXvAWFAtRXB2nELyuHF l0lA== 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:in-reply-to:references:from :date:message-id:subject:to:cc; bh=D+5rSZioY2v38ZosgZdENulGQONJIdeGOofeGa4Ln/U=; b=ll8A+xPeI4/YRVSyPpoNiPCG1p1D7BIXepyOwcbQxqoqUNBTCC5rcUNYbTw24LG5on ObeCS4QO7o5pmWX10qVdCPkva3TalB6DE/lD1eutHsE9n7NZI/pE7z387FvwWU3Cq7u3 LcPBWS8eLHa30kiTL6/bqGLJOg144O0EmmN8V/x68nj6UK+VCYBsnEy+xO2w4u4bbm0m zNfxvkMgP3ZqV8CKhjqxAImz07o8MMq4vCem/OMqeqMW4PoDzqVix0XzN78GaVz0Tkzv n+tcVswoiOZdYAPFKEmVX1ZHx0Jin+ixb+FGCBqgpLcRaadEmG1jD6zsRIg1ip7auZiN FkLQ== X-Gm-Message-State: AOUpUlHn41/po6lLeBgaLcX6LJqNXmGasAgMDANIC0R6xuUYd4J1QimM l5Ug6gGKQSFTFAnacfzCGx6BI3i6imhdcIYd3G61cg== X-Google-Smtp-Source: AAOMgpeP5m6oha6MmbnqoGqkNhahMV66nbaeX05aOn/DOGIksasK1blSZ+QKocKtpx7dFV2/vZOXDEwT1I4vqP7s6AI= X-Received: by 2002:a6b:3e46:: with SMTP id l67-v6mr3006090ioa.294.1530747867369; Wed, 04 Jul 2018 16:44:27 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 2002:a6b:290d:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 16:44:06 -0700 (PDT) In-Reply-To: <201807041718.w64HIZOg022778@repo.freebsd.org> References: <201807041718.w64HIZOg022778@repo.freebsd.org> From: Ed Maste Date: Wed, 4 Jul 2018 19:44:06 -0400 X-Google-Sender-Auth: lW-CgmM65dW6OCfiO2aGIl_QSgs Message-ID: Subject: Re: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options To: Sean Bruno Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 23:44:28 -0000 On 4 July 2018 at 13:18, Sean Bruno wrote: > Author: sbruno > Date: Wed Jul 4 17:18:35 2018 > New Revision: 335963 > URL: https://svnweb.freebsd.org/changeset/base/335963 > > Log: > WITHOUT_SERVICESDB: > > Add src.conf knob to disable the installation of /var/db/services.db > > Default to leaving services.db in place, but allow the removal of the > file and its creation with a src.conf knob. > > This file ends up being 2MB in size. For small systems this is a waste > of space but its a tradeoff. I'm happy to have this knob, but we ought to also see if we can reduce the size of services.db - it seems quite silly for it to be 2MB. From owner-svn-src-head@freebsd.org Thu Jul 5 00:07:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 491E6102B68A; Thu, 5 Jul 2018 00:07:06 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (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 CD5967A55A; Thu, 5 Jul 2018 00:07:05 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id D79241C8B6; Thu, 5 Jul 2018 00:06:58 +0000 (UTC) Subject: Re: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options To: Ed Maste , Sean Bruno Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807041718.w64HIZOg022778@repo.freebsd.org> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= xsFNBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABzSJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+wsF/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6bOwU0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAHCwWUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Message-ID: Date: Wed, 4 Jul 2018 20:06:58 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4v5kwibS2UucXClWr9h0mikijXBwBJvRN" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 00:07:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4v5kwibS2UucXClWr9h0mikijXBwBJvRN Content-Type: multipart/mixed; boundary="C35qLIHUKavst9aHyMR9XMK5j61TMyZtG"; protected-headers="v1" From: Allan Jude To: Ed Maste , Sean Bruno Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options References: <201807041718.w64HIZOg022778@repo.freebsd.org> In-Reply-To: --C35qLIHUKavst9aHyMR9XMK5j61TMyZtG Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-07-04 19:44, Ed Maste wrote: > On 4 July 2018 at 13:18, Sean Bruno wrote: >> Author: sbruno >> Date: Wed Jul 4 17:18:35 2018 >> New Revision: 335963 >> URL: https://svnweb.freebsd.org/changeset/base/335963 >> >> Log: >> WITHOUT_SERVICESDB: >> >> Add src.conf knob to disable the installation of /var/db/services.db= >> >> Default to leaving services.db in place, but allow the removal of th= e >> file and its creation with a src.conf knob. >> >> This file ends up being 2MB in size. For small systems this is a wa= ste >> of space but its a tradeoff. >=20 > I'm happy to have this knob, but we ought to also see if we can reduce > the size of services.db - it seems quite silly for it to be 2MB. >=20 I have somewhere a revival of bapt@'s old patch to use NetBSD's cdb to make much smaller .db files. Here is bapt@'s original work: https://people.freebsd.org/~bapt/cdbrw.dif= f --=20 Allan Jude --C35qLIHUKavst9aHyMR9XMK5j61TMyZtG-- --4v5kwibS2UucXClWr9h0mikijXBwBJvRN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJbPWEiAAoJEBmVNT4SmAt+BQ0QAIDafNqWA/8ribSlU7ETb4nE H1APK1TPzllKfAtvZ2fb7isJRDvnFdhGu0ZYNL8kytoxaBvYta9mrohskv8e1AM/ jMUhUkH1Wt+kFOmTwRXvwY7Tfy7rEDlzLwNHeF2yx3Pn3u78vdauJCqxXr0HeSYi nJzjmUywQrQbrBmrHq/R14QEU5Zo6JSIHUl3rSLk30b/Tn2KGJWQOUnPS9610x6t XuqLgSpTDR4P7SQNI3GZuWurZ0+1PE283SN9fn43MdPHPJiMWPZDhG7UjtVZneAd JWSV7xR+RApDoaFhSfNGBrvWCMxbEPCHSKtcSw/1/bsE0LKE7w1lzOwngdyggUDE mjiggPG4bHFsV6UAeIXpMgUCIqRQNZ5qXOajHvKm5O/O4tG9MZRnBbes0GNyqQRL A2fQ2vS/Z8HJ3TeKj6/766ujTQhu7hUELV8ZQE3Oi5rd68DL64UtLRsNS8VEBl/p iaHxRbKCCAUJKrWzJovUV9AyoMYyNH/o+yunG/jdSJmFrWBO49opGTxUbyIrRvKG j+LBJeRkDijAd8B8cfQWpzM1WYSA00Le3pgka/JBWuQq4mCi+G9+UWQB20s4ILQO EKwnr3VsQNWLW9aVu91ytlfKMgcKWbw1Rsye2s60Nz2OBJmt2aCrOGb2BT/41M65 ZN4/ykqbFYFLovOuNBxs =HqnH -----END PGP SIGNATURE----- --4v5kwibS2UucXClWr9h0mikijXBwBJvRN-- From owner-svn-src-head@freebsd.org Thu Jul 5 00:56:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21AE5103013A for ; Thu, 5 Jul 2018 00:56:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x22d.google.com (mail-yb0-x22d.google.com [IPv6:2607:f8b0:4002:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7FDA7C778 for ; Thu, 5 Jul 2018 00:56:01 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x22d.google.com with SMTP id k127-v6so2610223ybk.6 for ; Wed, 04 Jul 2018 17:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5gLT+zoq+GIlJjr5EtHiSzr5RfntzJ9y9Y1yVyasdHk=; b=SGbwFZE5op+8ANKQ44vNaAydmKPCwC+VdaqwQrDFrmwHZd8RQOJXeltRR3SehHluG5 YuVfMPdM0BiNIoJTi9Icomr56nJ+SaItAkTF5HXVnowIoHLX0xZRUf9AuBrWOhu4Q1+b zvnLc2vXg+Rdn0+OiXo/PEUtlEuXoFUr/zf/Y= 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=5gLT+zoq+GIlJjr5EtHiSzr5RfntzJ9y9Y1yVyasdHk=; b=raKTG8wYuGiGaFwstSWP+JjxqOdlAfdiLXLfjjiLYZt+wBpRPYE3tXaxjWe0kH7FWh hOXppgFf23UEwedLr+SJX021fer4Ule74DJJQH4vVhCZl5ZW68wrWJVuYRC2Tp6dE8LL u/5BrshH/1jLcYjZ3+g9gWngpUckLZTr6HfmCKAM1GhLjtcOnl6H5+vP3Hr6JrkP3QTM n7ypJIevmML+MhgOWieJOus32XnGUxcAF6BhzIY5HNEu76OuVAM9uiLxPdXRBR6uBXoi 5Yx9cGv7CUwm34jvRZjTTkm6NzK2iy/TNQ8e5EOLMo/5+hzkrGJWv/Y9Fg5srZ54/0XW z1pw== X-Gm-Message-State: APt69E3rNLRV3A1QfTswqfxsxkuVBCWZMgnfj4whbvnSDSMQbn2UHXnE z0AuagkZY692+BvdsNSw7wgGldI+HhOIu7akxcgyDA== X-Google-Smtp-Source: AAOMgpfQYuNmF+C3Z6Mf8Hpq1FKAKII+GnsvzzzGTmX+YaB5al5sj8NTaP5AHPCtp2XdK0iUmgOTo7uVvLVe3aK03Ec= X-Received: by 2002:a25:f406:: with SMTP id q6-v6mr2004494ybd.460.1530752161024; Wed, 04 Jul 2018 17:56:01 -0700 (PDT) MIME-Version: 1.0 References: <201807031353.w63DrsAa079940@repo.freebsd.org> <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> <20180703150203.GA34086@bsdpad.com> In-Reply-To: From: Eitan Adler Date: Wed, 4 Jul 2018 17:55:34 -0700 Message-ID: Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd To: John Baldwin Cc: ruslan.bukin@cl.cam.ac.uk, br@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 00:56:02 -0000 On Tue, 3 Jul 2018 at 08:22, John Baldwin wrote: > since GCC usually breaks > them. Could you explain what you mean or point to a prior conversation? -- Eitan Adler From owner-svn-src-head@freebsd.org Thu Jul 5 00:56:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A38591030196; Thu, 5 Jul 2018 00:56:16 +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 505BC7C8BC; Thu, 5 Jul 2018 00:56:16 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (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 EC9F327000E7; Wed, 4 Jul 2018 20:56:14 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu EC9F327000E7 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=1530752175; bh=MhwS/ugCG24yUN0uFu5C60KOiWY7zGwOwORMqeveRvs=; h=Subject:To:From:Date:From; b=TCy2w5dka01kksxHCMJ64PUgtmSJzKgzCK2PEX6W1m3aNUXtAWPfra/ieipKvGwlt clKDr63YLTaC8vMhiR+fuCPuAVGRT4nFRt3Cv8tBhJcCiHlZUDVXxmltlej1hY3ecq Y7t39g8CLpEZhZWN9/5meJDb//xlml6HmMH0xsFmM0tHcy/BipoZt8tf4q/fpf+uDt dzeyKJ/9LondoZgSnlA9CwaudeFkF1BFHd8FwJGiQ3M0/svYcm4nwBxdXem1suNzQL KVblNLSvJwIk7Qa2Vk82bt7Jc3rxrgFYzPEg4N018zwizbft+BjSGaD4C9KSXcsJ6a chOISxuLZE8+g== Subject: Re: svn commit: r335967 - head/sys/dev/mxge To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807041946.w64JkKHM044529@pdx.rh.CN85.dnsmgr.net> From: Andrew Gallatin Message-ID: <658fb418-5a84-dc91-2cc8-1a503a3d43a6@cs.duke.edu> Date: Wed, 4 Jul 2018 20:56:14 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201807041946.w64JkKHM044529@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 00:56:16 -0000 On 07/04/18 15:46, Rodney W. Grimes wrote: >> Author: gallatin >> Date: Wed Jul 4 19:29:06 2018 >> New Revision: 335967 >> URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_335967&d=DwICAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=2rIiw5AUJ2ishkBkygGMa_9kr0LJOaonX8ni3BF2BHk&s=MwCt6_IgNah0XklsYThsXFcwZD54Xl78TRlnFXJ4zWs&e= >> >> Log: >> mxge: choose appropriate values for hw tso >> >> Modified: >> head/sys/dev/mxge/if_mxge.c >> >> Modified: head/sys/dev/mxge/if_mxge.c >> ============================================================================== >> --- head/sys/dev/mxge/if_mxge.c Wed Jul 4 18:54:44 2018 (r335966) >> +++ head/sys/dev/mxge/if_mxge.c Wed Jul 4 19:29:06 2018 (r335967) >> @@ -4984,6 +4984,9 @@ mxge_attach(device_t dev) >> ifp->if_ioctl = mxge_ioctl; >> ifp->if_start = mxge_start; >> ifp->if_get_counter = mxge_get_counter; >> + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); > > Would not this be more accurate (need to reorder assigns): > ifp->if_hw_tsomax = ifp->if_hw_tsomaxsegsize - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); > >> + ifp->if_hw_tsomaxsegcount = sc->ss[0].tx.max_desc; >> + ifp->if_hw_tsomaxsegsize = 65536; It seems simpler as-is to me. Looking around at other drivers, I see at least one (cxgbe) which does the same thing. After doing the grep, I'm more concerned with drivers which may be setting their tsomaxsegsize incorrectly to be too small and hurting their performance by causing TCP to chop needlessly at smaller boundaries which are already enforced by their busdma tags. PAGE_SIZE, which seems to be the common mistaken size, won't hurt too much I suppose. But the default of 2K is probably not very good. Drew From owner-svn-src-head@freebsd.org Thu Jul 5 01:20:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8249E1032C07; Thu, 5 Jul 2018 01:20:30 +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 DF72D7DEB8; Thu, 5 Jul 2018 01:20:29 +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 w651KPeY045634; Wed, 4 Jul 2018 18:20:25 -0700 (PDT) (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 w651KP5K045633; Wed, 4 Jul 2018 18:20:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807050120.w651KP5K045633@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335967 - head/sys/dev/mxge In-Reply-To: <658fb418-5a84-dc91-2cc8-1a503a3d43a6@cs.duke.edu> To: Andrew Gallatin Date: Wed, 4 Jul 2018 18:20:25 -0700 (PDT) CC: rgrimes@freebsd.org, 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 01:20:30 -0000 > On 07/04/18 15:46, Rodney W. Grimes wrote: > >> Author: gallatin > >> Date: Wed Jul 4 19:29:06 2018 > >> New Revision: 335967 > >> URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_335967&d=DwICAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=2rIiw5AUJ2ishkBkygGMa_9kr0LJOaonX8ni3BF2BHk&s=MwCt6_IgNah0XklsYThsXFcwZD54Xl78TRlnFXJ4zWs&e= > >> > >> Log: > >> mxge: choose appropriate values for hw tso > >> > >> Modified: > >> head/sys/dev/mxge/if_mxge.c > >> > >> Modified: head/sys/dev/mxge/if_mxge.c > >> ============================================================================== > >> --- head/sys/dev/mxge/if_mxge.c Wed Jul 4 18:54:44 2018 (r335966) > >> +++ head/sys/dev/mxge/if_mxge.c Wed Jul 4 19:29:06 2018 (r335967) > >> @@ -4984,6 +4984,9 @@ mxge_attach(device_t dev) > >> ifp->if_ioctl = mxge_ioctl; > >> ifp->if_start = mxge_start; > >> ifp->if_get_counter = mxge_get_counter; > >> + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); > > > > Would not this be more accurate (need to reorder assigns): > > ifp->if_hw_tsomax = ifp->if_hw_tsomaxsegsize - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); > > > >> + ifp->if_hw_tsomaxsegcount = sc->ss[0].tx.max_desc; > >> + ifp->if_hw_tsomaxsegsize = 65536; > > > It seems simpler as-is to me. It is using a magic constant twice, where one has a derived value that is dependent on the value of the other. That is bad and error prone and does not document that one depends on the other. Please fix this. Or at least make 65536 a #define so that it only needs changed one place and clearly shows the interdependence of these values. > Looking around at other drivers, I see > at least one (cxgbe) which does the same thing. Bad examples are usually easy to find. > After doing the grep, I'm more concerned with drivers which may > be setting their tsomaxsegsize incorrectly to be too small and > hurting their performance by causing TCP to chop needlessly > at smaller boundaries which are already enforced by their > busdma tags. PAGE_SIZE, which seems to be the common mistaken > size, won't hurt too much I suppose. But the default of 2K > is probably not very good. > > Drew > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jul 5 01:31:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 782851033DBB; Thu, 5 Jul 2018 01:31:42 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from mr22p34im-asmtp002.me.com (mr22p34im-asmtp002.me.com [17.111.211.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15F3D7E8DE; Thu, 5 Jul 2018 01:31:42 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from process-dkim-sign-daemon.mr22p34im-asmtp002.me.com by mr22p34im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0PBD00F00DANUD00@mr22p34im-asmtp002.me.com>; Thu, 05 Jul 2018 01:31:35 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by mr22p34im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0PBD00FFWDKF7000@mr22p34im-asmtp002.me.com>; Thu, 05 Jul 2018 01:31:34 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-07-04_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1807050016 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r335836 - head/usr.bin/top From: =?utf-8?B?5b6M6Jek5aSn5Zyw?= In-reply-to: <20180705.013715.810854236306970666.hrs@allbsd.org> Date: Thu, 05 Jul 2018 10:31:27 +0900 Cc: daichi@freebsd.org, lists@eitanadler.com, gnn@FreeBSD.org, cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: References: <20180702.155529.1102410939281120947.hrs@allbsd.org> <459BD898-8072-426E-A968-96C1382AC616@icloud.com> <20180703.020956.859981414196673670.hrs@allbsd.org> <20180705.013715.810854236306970666.hrs@allbsd.org> To: Hiroki Sato X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 01:31:42 -0000 I think that=E2=80=99s fine. I have not been committed for a while, so now I am in the state of being reactive commit bit mentee under George=E2=80=99s mentor. So I = sent=20 him an e-mail about rollback, but I have not heard back from him yet.=20 I have been waiting for a reply mail. I planed to roll back as soon as permission comes out from him. =20 However, I think that there is no problem with your commit. Thank you. Best regards, Daichi > 2018/07/05 1:37=E3=80=81Hiroki Sato =E3=81=AE=E3=83=A1=E3= =83=BC=E3=83=AB: >=20 > Hiroki Sato wrote > in <20180703.020956.859981414196673670.hrs@allbsd.org>: >=20 > hr> =E5=BE=8C=E8=97=A4=E5=A4=A7=E5=9C=B0 wrote > hr> in <459BD898-8072-426E-A968-96C1382AC616@icloud.com>: > hr> > hr> da> > hr> da> > hr> da> > 2018/07/02 15:55=E3=80=81Hiroki Sato = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB: > hr> da> > > hr> da> > Eitan Adler wrote > hr> da> > in = : > hr> da> > > hr> da> > li> On 1 July 2018 at 10:08, Conrad Meyer = wrote: > hr> da> > li> > Hi Daichi, > hr> da> > li> > > hr> da> > li> > > hr> da> > li> > > hr> da> > li> > I don't think code to decode UTF-8 belongs in top(1). = I don't know > hr> da> > li> > what the goal of this routine is, but I doubt this is = the right way to > hr> da> > li> > accomplish it. > hr> da> > li> > hr> da> > li> For the record, I agree. This is why I didn't click = "accept" on the > hr> da> > li> revision. I don't fully oppose leaving it in top(1) for = now as we work > hr> da> > li> out the API, but long term its the wrong place. > hr> da> > li> > hr> da> > li> https://reviews.freebsd.org/D16058 is the review. > hr> da> > > hr> da> > I strongly object this kind of encoding-specific routine. = Please > hr> da> > back out it. The problem is that top(1) does not support = multibyte > hr> da> > encoding in functions for printing, and using C99 = wide/multibyte > hr> da> > character manipulation API such as iswprint(3) is the way to = solve > hr> da> > it. Doing getenv("LANG") and assuming an encoding based on = it is a > hr> da> > very bad practice to internationalize software. > hr> da> > > hr> da> > -- Hiroki > hr> da> > hr> da> I respect what you mean. > hr> da> > hr> da> Once I back out, I will begin implementing it in a different = way. > hr> da> Please advise which function should be used for implementation > hr> da> (iswprint (3) and what other functions should be used?) > hr> > hr> Roughly speaking, POSIX/XPG/C99 I18N model requires the following > hr> steps: > (snip) >=20 > Are you going to back out r335836, or disagree about it? >=20 > If there is no objection in the next 24 hours, I will commit the > attached patch. This should be a minimal change to support multibyte > characters in ARGV array depending on LC_CTYPE, not limited to UTF-8. >=20 > -- Hiroki > Index: usr.bin/top/display.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- usr.bin/top/display.c (revision 335957) > +++ usr.bin/top/display.c (working copy) > @@ -1248,55 +1248,6 @@ > } > } >=20 > -/* > - * printable(str) - make the string pointed to by "str" into one = that is > - * printable (i.e.: all ascii), by converting all non-printable > - * characters into '?'. Replacements are done in place and a = pointer > - * to the original buffer is returned. > - */ > - > -char * > -printable(char str[]) > -{ > - char *ptr; > - char ch; > - > - ptr =3D str; > - if (utf8flag) { > - while ((ch =3D *ptr) !=3D '\0') { > - if (0x00 =3D=3D (0x80 & ch)) { > - if (!isprint(ch)) { > - *ptr =3D '?'; > - } > - ++ptr; > - } else if (0xC0 =3D=3D (0xE0 & ch)) { > - ++ptr; > - if ('\0' !=3D *ptr) ++ptr; > - } else if (0xE0 =3D=3D (0xF0 & ch)) { > - ++ptr; > - if ('\0' !=3D *ptr) ++ptr; > - if ('\0' !=3D *ptr) ++ptr; > - } else if (0xF0 =3D=3D (0xF8 & ch)) { > - ++ptr; > - if ('\0' !=3D *ptr) ++ptr; > - if ('\0' !=3D *ptr) ++ptr; > - if ('\0' !=3D *ptr) ++ptr; > - } else { > - *ptr =3D '?'; > - ++ptr; > - } > - } > - } else { > - while ((ch =3D *ptr) !=3D '\0') { > - if (!isprint(ch)) { > - *ptr =3D '?'; > - } > - ptr++; > - } > - } > - return(str); > -} > - > void > i_uptime(struct timeval *bt, time_t *tod) > { > Index: usr.bin/top/display.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 > --- usr.bin/top/display.h (revision 335957) > +++ usr.bin/top/display.h (working copy) > @@ -11,7 +11,6 @@ > void clear_message(void); > int display_resize(void); > void i_header(const char *text); > -char *printable(char *string); > void display_header(int t); > int display_init(struct statics *statics); > void i_arc(int *stats); > Index: usr.bin/top/machine.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- usr.bin/top/machine.c (revision 335957) > +++ usr.bin/top/machine.c (working copy) > @@ -986,13 +986,8 @@ > if (*src =3D=3D '\0') > continue; > len =3D (argbuflen - (dst - argbuf) - 1) = / 4; > - if (utf8flag) { > - utf8strvisx(dst, src, = MIN(strlen(src), len)); > - } else { > - strvisx(dst, src, > - MIN(strlen(src), len), > - VIS_NL | VIS_CSTYLE); > - } > + strvisx(dst, src, MIN(strlen(src), len), > + VIS_NL | VIS_CSTYLE | VIS_OCTAL); > while (*dst !=3D '\0') > dst++; > if ((argbuflen - (dst - argbuf) - 1) / 4 = > 0) > @@ -1089,7 +1084,7 @@ > sbuf_printf(procbuf, "%6s ", format_time(cputime)); > sbuf_printf(procbuf, "%6.2f%% ", ps.wcpu ? 100.0 * = weighted_cpu(PCTCPU(pp), pp) : 100.0 * PCTCPU(pp)); > } > - sbuf_printf(procbuf, "%s", printable(cmdbuf)); > + sbuf_printf(procbuf, "%s", cmdbuf); > free(cmdbuf); > return (sbuf_data(procbuf)); > } > Index: usr.bin/top/top.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- usr.bin/top/top.c (revision 335957) > +++ usr.bin/top/top.c (working copy) > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -69,7 +70,6 @@ > struct process_select ps; > const char * myname =3D "top"; > pid_t mypid; > -bool utf8flag =3D false; >=20 > /* pointers to display routines */ > static void (*d_loadave)(int mpid, double *avenrun) =3D i_loadave; > @@ -276,6 +276,11 @@ > } > } >=20 > + if (setlocale(LC_ALL, "") =3D=3D NULL) { > + fprintf(stderr, "%s: invalid locale.\n", myname); > + exit(1); > + } > + > mypid =3D getpid(); >=20 > /* get our name */ > @@ -607,14 +612,6 @@ > fputc('\n', stderr); > } >=20 > - /* check if you are using UTF-8 */ > - char *env_lang; > - if (NULL !=3D (env_lang =3D getenv("LANG")) && > - 0 !=3D strcmp(env_lang, "") && > - NULL !=3D strstr(env_lang, "UTF-8")) { > - utf8flag =3D true; > - } > - > restart: >=20 > /* > Index: usr.bin/top/top.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 > --- usr.bin/top/top.h (revision 335957) > +++ usr.bin/top/top.h (working copy) > @@ -8,7 +8,6 @@ > #define TOP_H >=20 > #include > -#include >=20 > /* Number of lines of header information on the standard screen */ > extern int Header_lines; > @@ -38,7 +37,6 @@ > extern int pcpu_stats; > extern int overstrike; > extern pid_t mypid; > -extern bool utf8flag; >=20 > extern const char * myname; >=20 > Index: usr.bin/top/utils.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- usr.bin/top/utils.c (revision 335957) > +++ usr.bin/top/utils.c (working copy) > @@ -2,7 +2,6 @@ > * This program may be freely redistributed, > * but this entire comment MUST remain intact. > * > - * Copyright (c) 2018, Daichi Goto > * Copyright (c) 2018, Eitan Adler > * Copyright (c) 1984, 1989, William LeFebvre, Rice University > * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern = University > @@ -329,61 +328,3 @@ > kvm_close(kd); > return ret; > } > - > -/* > - * utf8strvisx(dst,src,src_len) > - * strvisx(dst,src,src_len,VIS_NL|VIS_CSTYLE) coresponding to = UTF-8. > - */ > -static const char *vis_encodes[] =3D { > - "\\0", "\\^A", "\\^B", "\\^C", "\\^D", "\\^E", "\\^F", "\\a", > - "\\b", "\t", "\\n", "\\v", "\\f", "\\r", "\\^N", "\\^O", "\\^P", > - "\\^Q", "\\^R", "\\^S", "\\^T", "\\^U", "\\^V", "\\^W", "\\^X", > - "\\^Y", "\\^Z", "\\^[", "\\^\\", "\\^]", "\\^^", "\\^_" > -}; > - > -int > -utf8strvisx(char *dst, const char *src, size_t src_len) > -{ > - const signed char *src_p; > - char *dst_p; > - int i, j, olen, len; > - > - src_p =3D src; > - dst_p =3D dst; > - i =3D olen =3D 0; > - len =3D (int)src_len; > - while (i < len) { > - if (0x00 =3D=3D (0x80 & *src_p)) { > - if (0 <=3D *src_p && *src_p <=3D 31) { > - j =3D strlen(vis_encodes[(int)*src_p]); > - strcpy(dst_p, vis_encodes[(int)*src_p]); > - dst_p +=3D j; > - olen +=3D j; > - } else if (127 =3D=3D *src_p) { > - strcpy(dst_p, "\\^?"); > - olen +=3D 3; > - } else { > - *dst_p++ =3D *src_p; > - ++olen; > - } > - ++i; > - ++src_p; > - } else if (0xC0 =3D=3D (0xE0 & *src_p)) { > - *dst_p++ =3D *src_p++; ++i; ++olen; > - if (i < len) { *dst_p++ =3D *src_p++; ++i; = ++olen; } > - } else if (0xE0 =3D=3D (0xF0 & *src_p)) { > - *dst_p++ =3D *src_p++; ++i; ++olen; > - if (i < len) { *dst_p++ =3D *src_p++; ++i; = ++olen; } > - if (i < len) { *dst_p++ =3D *src_p++; ++i; = ++olen; } > - } else if (0xF0 =3D=3D (0xF8 & *src_p)) { > - *dst_p++ =3D *src_p++; ++i; ++olen; > - if (i < len) { *dst_p++ =3D *src_p++; ++i; = ++olen; } > - if (i < len) { *dst_p++ =3D *src_p++; ++i; = ++olen; } > - if (i < len) { *dst_p++ =3D *src_p++; ++i; = ++olen; } > - } else { > - *dst_p++ =3D '?'; ++i; ++olen; > - } > - } > - > - return olen; > -} > Index: usr.bin/top/utils.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 > --- usr.bin/top/utils.h (revision 335957) > +++ usr.bin/top/utils.h (working copy) > @@ -22,5 +22,4 @@ > char *format_k(int64_t); > int string_index(const char *string, const char * const *array); > int find_pid(pid_t pid); > -int utf8strvisx(char *, const char *, size_t); >=20 From owner-svn-src-head@freebsd.org Thu Jul 5 02:03:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96E591038198 for ; Thu, 5 Jul 2018 02:03:56 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic304-23.consmr.mail.gq1.yahoo.com (sonic304-23.consmr.mail.gq1.yahoo.com [98.137.68.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20B3480785 for ; Thu, 5 Jul 2018 02:03:55 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: SyNll8cVM1lYCcogehcOUy5HJJ1UC6F6qufzX9G51bUWGAT4DEFPG2NqYuLFhU5 55PBjIXVaT.iF9Iv6Rvf0xctMksM66rgY6Q261_rk_Dg8Dxibd3iDSlTr0.ucuewIv2IR0U_Xuj3 0QOr4ZDi6iqItr6nTcMfok6zRpA.JSMJo.VNTEWvuy3aizGblW1vmGWLEfurCOmn2sOtAp1TSJ_9 doYIi85oC3qjKYcLWMUWZXOeCOO_1rWjoDfjWMIBc3tmYP_fn0KCDtQUJirlF_0gr8usd_wh.qHC gv_7X1_vv57lGIiGPEHwXhaqHFDamvPS.ElXDoVPjoSKe2oh193n645xFzo9elhF2yGX5MgiylLV wpb1GNXjI9CgfIdTy76Zvk6BXmXWH1ByfwiDbkLPOIrwdjDqBp2vA8GQUo6Iukc1rbNNd.NuLE3a 5D29RGA_dCmMQSiS5yqXXAMhZm44BF_srInG7lzsvfq83Z2lOO7TUnfh_LSF._DCdANlSqH67tz1 HMIrfP3IJusf3x4LNgusTEpv4x6u5gT2LIGNb5lqBiwsL.wZOei3iiwPa.CYxNLkVvu_RMLytF7I WFN4SnyavbJcbP0towue_H4rBrWrGuB3sFq01Xw07tAdIWB7a25_J_bvGvJktoTsQBXepFqG57Zi UrY9UtJTfHEKLaQQQn8kPbysboHwAkkaLVmSkkoKqOp7dlT3tzVGX74Zj7QOwFEZQiLkd3.u_Yc5 mPZVrBvTM4THlWZ1IF4ow6HixL.NP107UcTx80st18m2aO56KfZLsH7723R7.8huYpj5JDjpqqF4 ARIaBQr.yLVmtGiHvGxZ1RlLkWLUOcHQuMm2xIUk6RcrFRdGtYLvDv5QggRUOeLw6m4f8za0uz0K iwHo.h4D6vT57Pr2iEgQgmUmsjp8aLwqxOH3zIcPmBfA2NRPgCObAwRIoU.Nyixpp.uSnLw0I3Df YRMe2zwDp15g6a_2HLZCW.zpFRo6pixPp8E3rKoRI.TJSlHOgWRVIP2JxbhhBkhMuN4RJ Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Thu, 5 Jul 2018 02:03:49 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp417.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 695dbe83b0f58e3bcd3a4919b1e4c523; Thu, 05 Jul 2018 02:03:47 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd Message-Id: <1DED9D35-81AF-4814-9CE0-8556193524DF@yahoo.com> Date: Wed, 4 Jul 2018 19:03:46 -0700 To: Eitan Adler , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 02:03:56 -0000 Eitan Adler lists at eitanadler.com wrote on Thu Jul 5 00:56:02 UTC 2018 : > On Tue, 3 Jul 2018 at 08:22, John Baldwin > wrote: > > since GCC usually breaks > > them. > > > Could you explain what you mean or point to a prior conversation? I'll take a stab at it without giving much for specific code examples. I do not claim the wording gives complete coverage but it should suggest some types of problems to expect. A) Gcc considers various FreeBSD definitions wrong by their criteria and attempts to override them. (That is what the Gcc "include-fixed" headers are for relative to FreeBSD. The issue is not unique to FreeBSD.) B) FreeBSD considers various Gcc definitions wrong by its criteria and attempts to override them. (FreeBSD, being an OS, would normally have the larger set of definitions overall. For example Gcc likely would not consider FreeBSD's _STANDALONE distinctions for max_align_t, say. [I've not checked the details. Only illustrative of a potential example.]) The mixing of code with (A) and (B) tends to be problematical. One way is that if the details for Gcc or FreeBSD change, things tend to end up mis-matched (at least until both sides adjust) even if they were working together correctly before. But even without that there are frequently problems with various details as they have been. Part of the overall issue is that FredBSD targets multiple standards, not just language standards, and various standards are not in full agreement. Gcc does not necessarily target the same set of standards or have the same selections for dealing with potential conflicts for what it does target. There are also issues of file conflicts, such as the area with float.h (from C) for Gcc also having altivec.h (not from C) and FreeBSD having its own file of the name --and the system-clang compiler source also having one. The 3 altivec.h files serve different purposes and are not alternatives for each other, despite the common name. Having Gcc (as a cross compiler) build system-clang with __ALTIVEC__ defined and picking out clang's altivec.h would be painful. (Currently targeting powerpc64 that way does not build system-clang with __ALTIVEC__ defined. The lack avoids the file issue but does not cover altivec correctly in the built clang.) (A) has been a difficult area for a long time and sometime back a ways was finally disabled in various Gcc ports. Even without (A), there are issues like the altivec.h issue that can end up involved. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Thu Jul 5 02:04:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DC61103821E; Thu, 5 Jul 2018 02:04:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4D4B807B7; Thu, 5 Jul 2018 02:04:18 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7B61138C0; Thu, 5 Jul 2018 02:04:18 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6524Ijf097675; Thu, 5 Jul 2018 02:04:18 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6524IRH097674; Thu, 5 Jul 2018 02:04:18 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201807050204.w6524IRH097674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 5 Jul 2018 02:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335971 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 335971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 02:04:19 -0000 Author: alc Date: Thu Jul 5 02:04:18 2018 New Revision: 335971 URL: https://svnweb.freebsd.org/changeset/base/335971 Log: As of r335784, if pmap_enter() replaces a managed mapping by an unmanaged mapping, then it leaks the unlinked PV entry. This change eliminates that leak, freeing the PV entry. Reviewed by: kib, markj X-MFC with: r335784 Differential Revision: https://reviews.freebsd.org/D16130 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jul 4 21:34:08 2018 (r335970) +++ head/sys/amd64/amd64/pmap.c Thu Jul 5 02:04:18 2018 (r335971) @@ -4900,6 +4900,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); + if ((newpte & PG_MANAGED) == 0) + free_pv_entry(pmap, pv); if ((om->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || From owner-svn-src-head@freebsd.org Thu Jul 5 02:08:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0C1B103897F; Thu, 5 Jul 2018 02:08:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5E780B4E; Thu, 5 Jul 2018 02:08:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF32138CF; Thu, 5 Jul 2018 02:08:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6528vgL098119; Thu, 5 Jul 2018 02:08:57 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6528voB098118; Thu, 5 Jul 2018 02:08:57 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201807050208.w6528voB098118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 5 Jul 2018 02:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335972 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 335972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 02:08:58 -0000 Author: alc Date: Thu Jul 5 02:08:57 2018 New Revision: 335972 URL: https://svnweb.freebsd.org/changeset/base/335972 Log: Allow callers to vm_phys_split_pages() to specify whether insertion should occur at the head or the tail of the page queues. Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Thu Jul 5 02:04:18 2018 (r335971) +++ head/sys/vm/vm_phys.c Thu Jul 5 02:08:57 2018 (r335972) @@ -156,7 +156,7 @@ static vm_page_t vm_phys_alloc_seg_contig(struct vm_ph static void _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int domain); static void vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end); static void vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, - int order); + int order, int tail); /* * Red-black tree helpers for vm fictitious range management. @@ -588,9 +588,16 @@ vm_phys_init(void) /* * Split a contiguous, power of two-sized set of physical pages. + * + * When this function is called by a page allocation function, the caller + * should request insertion at the head unless the order [order, oind) queues + * are known to be empty. The objective being to reduce the likelihood of + * long-term fragmentation by promoting contemporaneous allocation and + * (hopefully) deallocation. */ static __inline void -vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order) +vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, + int tail) { vm_page_t m_buddy; @@ -600,7 +607,7 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_f KASSERT(m_buddy->order == VM_NFREEORDER, ("vm_phys_split_pages: page %p has unexpected order %d", m_buddy, m_buddy->order)); - vm_freelist_add(fl, m_buddy, oind, 0); + vm_freelist_add(fl, m_buddy, oind, tail); } } @@ -777,7 +784,8 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, m = TAILQ_FIRST(&fl[oind].pl); if (m != NULL) { vm_freelist_rem(fl, m, oind); - vm_phys_split_pages(m, oind, fl, order); + /* The order [order, oind) queues are empty. */ + vm_phys_split_pages(m, oind, fl, order, 1); return (m); } } @@ -795,7 +803,8 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, if (m != NULL) { vm_freelist_rem(alt, m, oind); vm_phys_set_pool(pool, m, oind); - vm_phys_split_pages(m, oind, fl, order); + /* The order [order, oind) queues are empty. */ + vm_phys_split_pages(m, oind, fl, order, 1); return (m); } } From owner-svn-src-head@freebsd.org Thu Jul 5 02:25:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CB60103A635; Thu, 5 Jul 2018 02:25:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFCEA8161C; Thu, 5 Jul 2018 02:25:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id u4-v6so9928891itg.0; Wed, 04 Jul 2018 19:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=BZs0b+xbPhHnrVg+26QZIRwO64gw5wXu/yVUNba13E8=; b=aoJap9gq3vT6uTtBRfh9No7vlWF3XxrELg5tRDqbjX2DvGKssakYMLmc8gNnRMDMIn 1n9B+MtfZHtcYqgnMZfl98Csu3T8g+rarOayA7c/G/cCHbUHImjWrennmsELOK45LWnl YDQt1VhedWtxBjXhBs1DIpaXW5jRpYU1kvNt9iZMU+gnFMdCM0ZPcB2fUjPVte5egODE eyAa9B7VUXbSkCLGbumw1vvW8wmV5FiwiWkrFyArt4FmIdC0/Wx/OneZXVr8RULoxwly ppdlD8fDcm9bKwE9530mZucPqTzzQXRJ+ohld0qPCVFhKtWYu7zBxLPBSf6KRAKGlkqk GYDA== 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:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BZs0b+xbPhHnrVg+26QZIRwO64gw5wXu/yVUNba13E8=; b=kcUOduHIbChbF17ZaFENXZcrG8EmxGJJ6eQscIJpNo9jySauKYlpmR9KwndXTkadDB kBHw8DievMjfGfTavm9hTMuqwznagr152iBZrEHztoDfBPFyzEKI1MPMx+uW3EQd0w89 DsQoRKFlCx46lWIs638cGKgelQNlWU6HefVEsw7x2b7Gyul0JZx92LlzWGPOxKm9G8MY vgLEeIClo4WY4QzhG54x7fUocmLnncJNC0E28J3lFZmiXLoKJZcAug60XSN64DgHeOJy aNIW57KGLkBzO4gw3Nmratk5/63HUHfCmFnv2XfrGbXpqKnIRgAecHqgeqsevovlXIBB NmYw== X-Gm-Message-State: APt69E0A6zVhDkDsqs3Ap91nF3SZbZYJ6zaZ02203e1qr6BiWDtNJI5V S/wD+HFwiqfVn6bw8wk0XvwbMxvvEEV+WdnGrNP6Ig== X-Google-Smtp-Source: AAOMgpc9HufrnRTHmIiNJiuCyOl8DJ0gtUuqzwPBVG2a0J9NG+4QHzaKYkzdAjwh1nUZquZMabnF/hCgHdS0BwKfYKc= X-Received: by 2002:a24:9c46:: with SMTP id b67-v6mr3649743ite.78.1530757541896; Wed, 04 Jul 2018 19:25:41 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 2002:a6b:290d:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 19:25:21 -0700 (PDT) In-Reply-To: References: <201807031353.w63DrsAa079940@repo.freebsd.org> <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> <20180703150203.GA34086@bsdpad.com> From: Ed Maste Date: Wed, 4 Jul 2018 22:25:21 -0400 X-Google-Sender-Auth: WS0rTsybBCwvkGhxFogOI9g7nWY Message-ID: Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd To: Eitan Adler Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 02:25:43 -0000 On 4 July 2018 at 20:55, Eitan Adler wrote: > On Tue, 3 Jul 2018 at 08:22, John Baldwin wrote: >> > since GCC usually breaks >> them. > > Could you explain what you mean or point to a prior conversation? > I'm not sure if there's a previous discussion, but the short version is that the GCC build process includes a 'fixincludes' step which installs modified versions of system headers in some path that GCC uses in preference to /usr/include. Originally this was done to work around broken system includes in proprietary operating systems that couldn't easily be fixed upstream. In the case of FreeBSD GCC's fixincludes actually just installs broken headers, and removing its broken copies is the easy fix. From owner-svn-src-head@freebsd.org Thu Jul 5 02:33:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B008E103AFB2; Thu, 5 Jul 2018 02:33:11 +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 6EB6581B54; Thu, 5 Jul 2018 02:33:11 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.210] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (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 5F5922700341; Wed, 4 Jul 2018 22:33:10 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 5F5922700341 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=1530757990; bh=/14FZyGAfCM4YC/ClGl69iMd2FWNGvDRUyHUEo9mLL4=; h=Subject:To:From:Date:From; b=XrQ+JIxcHJwEJRfjEyIJ/Y7YEyft/PWQsKEgB+qXy+M6FtoEJMrwoZZ2J1azWH8iz MaqvkDP0htYf6O9i61hg7J0FzabPZPUopLoegW5aM+5myc/mMfwDp0f4nca0I6V+hR j9YWnD8HmbvPTGzMGvsh6ae4N9qKTIs0jWfRH5gW+7aWia06SEO4K7LMvlYACZnUKb ZCMwWo80239yi42rFognb3ootcRGHJPHxhh720fsmPSqr+rnokFwAY3YmZFt+UADoy pUG1HjaYtyrtMZoaSKimgi4SWLnISY6kOzVZmaiishN8yJC09y7ZBu8sDaU6AYxbUm 6uyCkA+2tCRHA== Subject: Re: svn commit: r335967 - head/sys/dev/mxge To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807050120.w651KP5K045633@pdx.rh.CN85.dnsmgr.net> From: Andrew Gallatin Message-ID: <97ae3381-7c25-7b41-9670-84b825722f52@cs.duke.edu> Date: Wed, 4 Jul 2018 22:33:09 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807050120.w651KP5K045633@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 02:33:11 -0000 On 7/4/18 9:20 PM, Rodney W. Grimes wrote: >> On 07/04/18 15:46, Rodney W. Grimes wrote: >>>> Author: gallatin >>>> Date: Wed Jul 4 19:29:06 2018 >>>> New Revision: 335967 >>>> URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_335967&d=DwICAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=2rIiw5AUJ2ishkBkygGMa_9kr0LJOaonX8ni3BF2BHk&s=MwCt6_IgNah0XklsYThsXFcwZD54Xl78TRlnFXJ4zWs&e= >>>> >>>> Log: >>>> mxge: choose appropriate values for hw tso >>>> >>>> Modified: >>>> head/sys/dev/mxge/if_mxge.c >>>> >>>> Modified: head/sys/dev/mxge/if_mxge.c >>>> ============================================================================== >>>> --- head/sys/dev/mxge/if_mxge.c Wed Jul 4 18:54:44 2018 (r335966) >>>> +++ head/sys/dev/mxge/if_mxge.c Wed Jul 4 19:29:06 2018 (r335967) >>>> @@ -4984,6 +4984,9 @@ mxge_attach(device_t dev) >>>> ifp->if_ioctl = mxge_ioctl; >>>> ifp->if_start = mxge_start; >>>> ifp->if_get_counter = mxge_get_counter; >>>> + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); >>> >>> Would not this be more accurate (need to reorder assigns): >>> ifp->if_hw_tsomax = ifp->if_hw_tsomaxsegsize - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); >>> >>>> + ifp->if_hw_tsomaxsegcount = sc->ss[0].tx.max_desc; >>>> + ifp->if_hw_tsomaxsegsize = 65536; >> >> >> It seems simpler as-is to me. > > It is using a magic constant twice, where one has a > derived value that is dependent on the value of the other. > That is bad and error prone and does not document that > one depends on the other. Please fix this. Or at least > make 65536 a #define so that it only needs changed one > place and clearly shows the interdependence of these > values. To me, 65536 is one of the few cases where the magic number is more meaningful than a name. But fine, if you feel that strongly about it, I'll change it for you. From owner-svn-src-head@freebsd.org Thu Jul 5 02:43:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DA9D103BB0A; Thu, 5 Jul 2018 02:43:11 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C39DF820F7; Thu, 5 Jul 2018 02:43:10 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A436513F64; Thu, 5 Jul 2018 02:43:10 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w652hAQq018216; Thu, 5 Jul 2018 02:43:10 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w652hAYL018215; Thu, 5 Jul 2018 02:43:10 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201807050243.w652hAYL018215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Thu, 5 Jul 2018 02:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335973 - head/sys/dev/mxge X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/dev/mxge X-SVN-Commit-Revision: 335973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 02:43:11 -0000 Author: gallatin Date: Thu Jul 5 02:43:10 2018 New Revision: 335973 URL: https://svnweb.freebsd.org/changeset/base/335973 Log: mxge: replace 65536 with IP_MAXPACKET in tso settings. Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Jul 5 02:08:57 2018 (r335972) +++ head/sys/dev/mxge/if_mxge.c Thu Jul 5 02:43:10 2018 (r335973) @@ -4984,9 +4984,9 @@ mxge_attach(device_t dev) ifp->if_ioctl = mxge_ioctl; ifp->if_start = mxge_start; ifp->if_get_counter = mxge_get_counter; - ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomax = IP_MAXPACKET - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); ifp->if_hw_tsomaxsegcount = sc->ss[0].tx.max_desc; - ifp->if_hw_tsomaxsegsize = 65536; + ifp->if_hw_tsomaxsegsize = IP_MAXPACKET; /* Initialise the ifmedia structure */ ifmedia_init(&sc->media, 0, mxge_media_change, mxge_media_status); From owner-svn-src-head@freebsd.org Thu Jul 5 03:34:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE366103FE00; Thu, 5 Jul 2018 03:33:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FD29842BC; Thu, 5 Jul 2018 03:33:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51B0E14845; Thu, 5 Jul 2018 03:33:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w653Xx8l044936; Thu, 5 Jul 2018 03:33:59 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w653XwbR044932; Thu, 5 Jul 2018 03:33:58 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201807050333.w653XwbR044932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 5 Jul 2018 03:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335974 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 335974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 03:34:00 -0000 Author: araujo Date: Thu Jul 5 03:33:58 2018 New Revision: 335974 URL: https://svnweb.freebsd.org/changeset/base/335974 Log: - Add bhyve NVMe device emulation. The initial work on bhyve NVMe device emulation was done by the GSoC student Shunsuke Mie and was heavily modified in performan, functionality and guest support by Leon Dang. bhyve: -s ,nvme,devpath,maxq=#,qsz=#,ioslots=#,sectsz=#,ser=A-Z accepted devpath: /dev/blockdev /path/to/image ram=size_in_MiB Tested with guest OS: FreeBSD Head, Linux Fedora fc27, Ubuntu 18.04, OpenSuse 15.0, Windows Server 2016 Datacenter. Tested with all accepted device paths: Real nvme, zdev and also with ram. Tested on: AMD Ryzen Threadripper 1950X 16-Core Processor and Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz. Tests at: https://people.freebsd.org/~araujo/bhyve_nvme/nvme.txt Submitted by: Shunsuke Mie , Leon Dang Reviewed by: chuck (early version), grehan Relnotes: Yes Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D14022 Added: head/usr.sbin/bhyve/pci_nvme.c (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/block_if.h Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Thu Jul 5 02:43:10 2018 (r335973) +++ head/usr.sbin/bhyve/Makefile Thu Jul 5 03:33:58 2018 (r335974) @@ -41,6 +41,7 @@ SRCS= \ pci_hostbridge.c \ pci_irq.c \ pci_lpc.c \ + pci_nvme.c \ pci_passthru.c \ pci_virtio_block.c \ pci_virtio_console.c \ Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Thu Jul 5 02:43:10 2018 (r335973) +++ head/usr.sbin/bhyve/bhyve.8 Thu Jul 5 03:33:58 2018 (r335974) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jun 11, 2018 +.Dd Jul 05, 2018 .Dt BHYVE 8 .Os .Sh NAME @@ -241,6 +241,8 @@ The LPC bridge emulation can only be configured on bus Raw framebuffer device attached to VNC server. .It Li xhci eXtensible Host Controller Interface (xHCI) USB controller. +.It Li nvme +NVM Express (NVMe) controller. .El .It Op Ar conf This optional parameter describes the backend for device emulations. @@ -432,6 +434,27 @@ xHCI USB devices: .It Li tablet A USB tablet device which provides precise cursor synchronization when using VNC. +.El +.Pp +NVMe devices: +.Bl -tag -width 10n +.It Li devpath +Accepted device paths are: +.Ar /dev/blockdev +or +.Ar /path/to/image +or +.Ar ram=size_in_MiB . +.It Li maxq +Max number of queues. +.It Li qsz +Max elements in each queue. +.It Li ioslots +Max number of concurrent I/O requests. +.It Li sectsz +Sector size (defaults to blockif sector size). +.It Li ser +Serial number with maximum 20 characters. .El .El .It Fl S Modified: head/usr.sbin/bhyve/block_if.h ============================================================================== --- head/usr.sbin/bhyve/block_if.h Thu Jul 5 02:43:10 2018 (r335973) +++ head/usr.sbin/bhyve/block_if.h Thu Jul 5 03:33:58 2018 (r335974) @@ -44,12 +44,12 @@ #define BLOCKIF_IOV_MAX 33 /* not practical to be IOV_MAX */ struct blockif_req { - struct iovec br_iov[BLOCKIF_IOV_MAX]; int br_iovcnt; off_t br_offset; ssize_t br_resid; void (*br_callback)(struct blockif_req *req, int err); void *br_param; + struct iovec br_iov[BLOCKIF_IOV_MAX]; }; struct blockif_ctxt; Added: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_nvme.c Thu Jul 5 03:33:58 2018 (r335974) @@ -0,0 +1,1853 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 Shunsuke Mie + * Copyright (c) 2018 Leon Dang + * + * 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. + */ + +/* + * bhyve PCIe-NVMe device emulation. + * + * options: + * -s ,nvme,devpath,maxq=#,qsz=#,ioslots=#,sectsz=#,ser=A-Z + * + * accepted devpath: + * /dev/blockdev + * /path/to/image + * ram=size_in_MiB + * + * maxq = max number of queues + * qsz = max elements in each queue + * ioslots = max number of concurrent io requests + * sectsz = sector size (defaults to blockif sector size) + * ser = serial number (20-chars max) + * + */ + +/* TODO: + - create async event for smart and log + - intr coalesce + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "bhyverun.h" +#include "block_if.h" +#include "pci_emul.h" + + +static int nvme_debug = 0; +#define DPRINTF(params) if (nvme_debug) printf params +#define WPRINTF(params) printf params + +/* defaults; can be overridden */ +#define NVME_MSIX_BAR 4 + +#define NVME_IOSLOTS 8 + +#define NVME_QUEUES 16 +#define NVME_MAX_QENTRIES 2048 + +#define NVME_PRP2_ITEMS (PAGE_SIZE/sizeof(uint64_t)) +#define NVME_MAX_BLOCKIOVS 512 + +/* helpers */ + +#define NVME_DOORBELL_OFFSET offsetof(struct nvme_registers, doorbell) + +enum nvme_controller_register_offsets { + NVME_CR_CAP_LOW = 0x00, + NVME_CR_CAP_HI = 0x04, + NVME_CR_VS = 0x08, + NVME_CR_INTMS = 0x0c, + NVME_CR_INTMC = 0x10, + NVME_CR_CC = 0x14, + NVME_CR_CSTS = 0x1c, + NVME_CR_NSSR = 0x20, + NVME_CR_AQA = 0x24, + NVME_CR_ASQ_LOW = 0x28, + NVME_CR_ASQ_HI = 0x2c, + NVME_CR_ACQ_LOW = 0x30, + NVME_CR_ACQ_HI = 0x34, +}; + +enum nvme_cmd_cdw11 { + NVME_CMD_CDW11_PC = 0x0001, + NVME_CMD_CDW11_IEN = 0x0002, + NVME_CMD_CDW11_IV = 0xFFFF0000, +}; + +#define NVME_CMD_GET_OPC(opc) \ + ((opc) >> NVME_CMD_OPC_SHIFT & NVME_CMD_OPC_MASK) + +#define NVME_CQ_INTEN 0x01 +#define NVME_CQ_INTCOAL 0x02 + +struct nvme_completion_queue { + struct nvme_completion *qbase; + uint32_t size; + uint16_t tail; /* nvme progress */ + uint16_t head; /* guest progress */ + uint16_t intr_vec; + uint32_t intr_en; + pthread_mutex_t mtx; +}; + +struct nvme_submission_queue { + struct nvme_command *qbase; + uint32_t size; + uint16_t head; /* nvme progress */ + uint16_t tail; /* guest progress */ + uint16_t cqid; /* completion queue id */ + int busy; /* queue is being processed */ + int qpriority; +}; + +enum nvme_storage_type { + NVME_STOR_BLOCKIF = 0, + NVME_STOR_RAM = 1, +}; + +struct pci_nvme_blockstore { + enum nvme_storage_type type; + void *ctx; + uint64_t size; + uint32_t sectsz; + uint32_t sectsz_bits; +}; + +struct pci_nvme_ioreq { + struct pci_nvme_softc *sc; + struct pci_nvme_ioreq *next; + struct nvme_submission_queue *nvme_sq; + uint16_t sqid; + + /* command information */ + uint16_t opc; + uint16_t cid; + uint32_t nsid; + + uint64_t prev_gpaddr; + size_t prev_size; + + /* + * lock if all iovs consumed (big IO); + * complete transaction before continuing + */ + pthread_mutex_t mtx; + pthread_cond_t cv; + + struct blockif_req io_req; + + /* pad to fit up to 512 page descriptors from guest IO request */ + struct iovec iovpadding[NVME_MAX_BLOCKIOVS-BLOCKIF_IOV_MAX]; +}; + +struct pci_nvme_softc { + struct pci_devinst *nsc_pi; + + pthread_mutex_t mtx; + + struct nvme_registers regs; + + struct nvme_namespace_data nsdata; + struct nvme_controller_data ctrldata; + + struct pci_nvme_blockstore nvstore; + + uint16_t max_qentries; /* max entries per queue */ + uint32_t max_queues; + uint32_t num_cqueues; + uint32_t num_squeues; + + struct pci_nvme_ioreq *ioreqs; + struct pci_nvme_ioreq *ioreqs_free; /* free list of ioreqs */ + uint32_t pending_ios; + uint32_t ioslots; + sem_t iosemlock; + + /* status and guest memory mapped queues */ + struct nvme_completion_queue *compl_queues; + struct nvme_submission_queue *submit_queues; + + /* controller features */ + uint32_t intr_coales_aggr_time; /* 0x08: uS to delay intr */ + uint32_t intr_coales_aggr_thresh; /* 0x08: compl-Q entries */ + uint32_t async_ev_config; /* 0x0B: async event config */ +}; + + +static void pci_nvme_io_partial(struct blockif_req *br, int err); + +/* Controller Configuration utils */ +#define NVME_CC_GET_EN(cc) \ + ((cc) >> NVME_CC_REG_EN_SHIFT & NVME_CC_REG_EN_MASK) +#define NVME_CC_GET_CSS(cc) \ + ((cc) >> NVME_CC_REG_CSS_SHIFT & NVME_CC_REG_CSS_MASK) +#define NVME_CC_GET_SHN(cc) \ + ((cc) >> NVME_CC_REG_SHN_SHIFT & NVME_CC_REG_SHN_MASK) +#define NVME_CC_GET_IOSQES(cc) \ + ((cc) >> NVME_CC_REG_IOSQES_SHIFT & NVME_CC_REG_IOSQES_MASK) +#define NVME_CC_GET_IOCQES(cc) \ + ((cc) >> NVME_CC_REG_IOCQES_SHIFT & NVME_CC_REG_IOCQES_MASK) + +#define NVME_CC_WRITE_MASK \ + ((NVME_CC_REG_EN_MASK << NVME_CC_REG_EN_SHIFT) | \ + (NVME_CC_REG_IOSQES_MASK << NVME_CC_REG_IOSQES_SHIFT) | \ + (NVME_CC_REG_IOCQES_MASK << NVME_CC_REG_IOCQES_SHIFT)) + +#define NVME_CC_NEN_WRITE_MASK \ + ((NVME_CC_REG_CSS_MASK << NVME_CC_REG_CSS_SHIFT) | \ + (NVME_CC_REG_MPS_MASK << NVME_CC_REG_MPS_SHIFT) | \ + (NVME_CC_REG_AMS_MASK << NVME_CC_REG_AMS_SHIFT)) + +/* Controller Status utils */ +#define NVME_CSTS_GET_RDY(sts) \ + ((sts) >> NVME_CSTS_REG_RDY_SHIFT & NVME_CSTS_REG_RDY_MASK) + +#define NVME_CSTS_RDY (1 << NVME_CSTS_REG_RDY_SHIFT) + +/* Completion Queue status word utils */ +#define NVME_STATUS_P (1 << NVME_STATUS_P_SHIFT) +#define NVME_STATUS_MASK \ + ((NVME_STATUS_SCT_MASK << NVME_STATUS_SCT_SHIFT) |\ + (NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT)) + +static __inline void +pci_nvme_status_tc(uint16_t *status, uint16_t type, uint16_t code) +{ + + *status &= ~NVME_STATUS_MASK; + *status |= (type & NVME_STATUS_SCT_MASK) << NVME_STATUS_SCT_SHIFT | + (code & NVME_STATUS_SC_MASK) << NVME_STATUS_SC_SHIFT; +} + +static __inline void +pci_nvme_status_genc(uint16_t *status, uint16_t code) +{ + + pci_nvme_status_tc(status, NVME_SCT_GENERIC, code); +} + +static __inline void +pci_nvme_toggle_phase(uint16_t *status, int prev) +{ + + if (prev) + *status &= ~NVME_STATUS_P; + else + *status |= NVME_STATUS_P; +} + +static void +pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) +{ + struct nvme_controller_data *cd = &sc->ctrldata; + + cd->vid = 0xFB5D; + cd->ssvid = 0x0000; + + cd->mn[0] = 'b'; + cd->mn[1] = 'h'; + cd->mn[2] = 'y'; + cd->mn[3] = 'v'; + cd->mn[4] = 'e'; + cd->mn[5] = '-'; + cd->mn[6] = 'N'; + cd->mn[7] = 'V'; + cd->mn[8] = 'M'; + cd->mn[9] = 'e'; + + cd->fr[0] = '1'; + cd->fr[1] = '.'; + cd->fr[2] = '0'; + + /* Num of submission commands that we can handle at a time (2^rab) */ + cd->rab = 4; + + /* FreeBSD OUI */ + cd->ieee[0] = 0x58; + cd->ieee[1] = 0x9c; + cd->ieee[2] = 0xfc; + + cd->mic = 0; + + cd->mdts = 9; /* max data transfer size (2^mdts * CAP.MPSMIN) */ + + cd->ver = 0x00010300; + + cd->oacs = 1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT; + cd->acl = 2; + cd->aerl = 4; + + cd->lpa = 0; /* TODO: support some simple things like SMART */ + cd->elpe = 0; /* max error log page entries */ + cd->npss = 1; /* number of power states support */ + + /* Warning Composite Temperature Threshold */ + cd->wctemp = 0x0157; + + cd->sqes = (6 << NVME_CTRLR_DATA_SQES_MAX_SHIFT) | + (6 << NVME_CTRLR_DATA_SQES_MIN_SHIFT); + cd->cqes = (4 << NVME_CTRLR_DATA_CQES_MAX_SHIFT) | + (4 << NVME_CTRLR_DATA_CQES_MIN_SHIFT); + cd->nn = 1; /* number of namespaces */ + + cd->fna = 0x03; + + cd->power_state[0].mp = 10; +} + +static void +pci_nvme_init_nsdata(struct pci_nvme_softc *sc) +{ + struct nvme_namespace_data *nd; + + nd = &sc->nsdata; + + nd->nsze = sc->nvstore.size / sc->nvstore.sectsz; + nd->ncap = nd->nsze; + nd->nuse = nd->nsze; + + /* Get LBA and backstore information from backing store */ + nd->nlbaf = 1; + /* LBA data-sz = 2^lbads */ + nd->lbaf[0] = sc->nvstore.sectsz_bits << NVME_NS_DATA_LBAF_LBADS_SHIFT; + + nd->flbas = 0; +} + +static void +pci_nvme_reset(struct pci_nvme_softc *sc) +{ + DPRINTF(("%s\r\n", __func__)); + + sc->regs.cap_lo = (sc->max_qentries & NVME_CAP_LO_REG_MQES_MASK) | + (1 << NVME_CAP_LO_REG_CQR_SHIFT) | + (60 << NVME_CAP_LO_REG_TO_SHIFT); + + sc->regs.cap_hi = 1 << NVME_CAP_HI_REG_CSS_NVM_SHIFT; + + sc->regs.vs = 0x00010300; /* NVMe v1.3 */ + + sc->regs.cc = 0; + sc->regs.csts = 0; + + if (sc->submit_queues != NULL) { + pthread_mutex_lock(&sc->mtx); + sc->num_cqueues = sc->num_squeues = sc->max_queues; + + for (int i = 0; i <= sc->max_queues; i++) { + /* + * The Admin Submission Queue is at index 0. + * It must not be changed at reset otherwise the + * emulation will be out of sync with the guest. + */ + if (i != 0) { + sc->submit_queues[i].qbase = NULL; + sc->submit_queues[i].size = 0; + sc->submit_queues[i].cqid = 0; + + sc->compl_queues[i].qbase = NULL; + sc->compl_queues[i].size = 0; + } + sc->submit_queues[i].tail = 0; + sc->submit_queues[i].head = 0; + sc->submit_queues[i].busy = 0; + + sc->compl_queues[i].tail = 0; + sc->compl_queues[i].head = 0; + } + + pthread_mutex_unlock(&sc->mtx); + } else + sc->submit_queues = calloc(sc->max_queues + 1, + sizeof(struct nvme_submission_queue)); + + if (sc->compl_queues == NULL) { + sc->compl_queues = calloc(sc->max_queues + 1, + sizeof(struct nvme_completion_queue)); + + for (int i = 0; i <= sc->num_cqueues; i++) + pthread_mutex_init(&sc->compl_queues[i].mtx, NULL); + } +} + +static void +pci_nvme_init_controller(struct vmctx *ctx, struct pci_nvme_softc *sc) +{ + uint16_t acqs, asqs; + + DPRINTF(("%s\r\n", __func__)); + + asqs = (sc->regs.aqa & NVME_AQA_REG_ASQS_MASK) + 1; + sc->submit_queues[0].size = asqs; + sc->submit_queues[0].qbase = vm_map_gpa(ctx, sc->regs.asq, + sizeof(struct nvme_command) * asqs); + + DPRINTF(("%s mapping Admin-SQ guest 0x%lx, host: %p\r\n", + __func__, sc->regs.asq, sc->submit_queues[0].qbase)); + + acqs = ((sc->regs.aqa >> NVME_AQA_REG_ACQS_SHIFT) & + NVME_AQA_REG_ACQS_MASK) + 1; + sc->compl_queues[0].size = acqs; + sc->compl_queues[0].qbase = vm_map_gpa(ctx, sc->regs.acq, + sizeof(struct nvme_completion) * acqs); + DPRINTF(("%s mapping Admin-CQ guest 0x%lx, host: %p\r\n", + __func__, sc->regs.acq, sc->compl_queues[0].qbase)); +} + +static int +nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + uint16_t qid = command->cdw10 & 0xffff; + + DPRINTF(("%s DELETE_IO_SQ %u\r\n", __func__, qid)); + if (qid == 0 || qid > sc->num_cqueues) { + WPRINTF(("%s NOT PERMITTED queue id %u / num_squeues %u\r\n", + __func__, qid, sc->num_squeues)); + pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_QUEUE_IDENTIFIER); + return (1); + } + + sc->submit_queues[qid].qbase = NULL; + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + return (1); +} + +static int +nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + if (command->cdw11 & NVME_CMD_CDW11_PC) { + uint16_t qid = command->cdw10 & 0xffff; + struct nvme_submission_queue *nsq; + + if (qid > sc->num_squeues) { + WPRINTF(("%s queue index %u > num_squeues %u\r\n", + __func__, qid, sc->num_squeues)); + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_QUEUE_IDENTIFIER); + return (1); + } + + nsq = &sc->submit_queues[qid]; + nsq->size = ((command->cdw10 >> 16) & 0xffff) + 1; + + nsq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, + sizeof(struct nvme_command) * (size_t)nsq->size); + nsq->cqid = (command->cdw11 >> 16) & 0xffff; + nsq->qpriority = (command->cdw11 >> 1) & 0x03; + + DPRINTF(("%s sq %u size %u gaddr %p cqid %u\r\n", __func__, + qid, nsq->size, nsq->qbase, nsq->cqid)); + + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + + DPRINTF(("%s completed creating IOSQ qid %u\r\n", + __func__, qid)); + } else { + /* + * Guest sent non-cont submission queue request. + * This setting is unsupported by this emulation. + */ + WPRINTF(("%s unsupported non-contig (list-based) " + "create i/o submission queue\r\n", __func__)); + + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + } + return (1); +} + +static int +nvme_opc_delete_io_cq(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + uint16_t qid = command->cdw10 & 0xffff; + + DPRINTF(("%s DELETE_IO_CQ %u\r\n", __func__, qid)); + if (qid == 0 || qid > sc->num_cqueues) { + WPRINTF(("%s queue index %u / num_cqueues %u\r\n", + __func__, qid, sc->num_cqueues)); + pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_QUEUE_IDENTIFIER); + return (1); + } + + sc->compl_queues[qid].qbase = NULL; + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + return (1); +} + +static int +nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + if (command->cdw11 & NVME_CMD_CDW11_PC) { + uint16_t qid = command->cdw10 & 0xffff; + struct nvme_completion_queue *ncq; + + if (qid > sc->num_cqueues) { + WPRINTF(("%s queue index %u > num_cqueues %u\r\n", + __func__, qid, sc->num_cqueues)); + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_QUEUE_IDENTIFIER); + return (1); + } + + ncq = &sc->compl_queues[qid]; + ncq->intr_en = (command->cdw11 & NVME_CMD_CDW11_IEN) >> 1; + ncq->intr_vec = (command->cdw11 >> 16) & 0xffff; + ncq->size = ((command->cdw10 >> 16) & 0xffff) + 1; + + ncq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, + command->prp1, + sizeof(struct nvme_command) * (size_t)ncq->size); + + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + } else { + /* + * Non-contig completion queue unsupported. + */ + WPRINTF(("%s unsupported non-contig (list-based) " + "create i/o completion queue\r\n", + __func__)); + + /* 0x12 = Invalid Use of Controller Memory Buffer */ + pci_nvme_status_genc(&compl->status, 0x12); + } + + return (1); +} + +static int +nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + uint32_t logsize = (1 + ((command->cdw10 >> 16) & 0xFFF)) * 2; + uint8_t logpage = command->cdw10 & 0xFF; + void *data; + + DPRINTF(("%s log page %u len %u\r\n", __func__, logpage, logsize)); + + if (logpage >= 1 && logpage <= 3) + data = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, + PAGE_SIZE); + + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + + switch (logpage) { + case 0x01: /* Error information */ + memset(data, 0, logsize > PAGE_SIZE ? PAGE_SIZE : logsize); + break; + case 0x02: /* SMART/Health information */ + /* TODO: present some smart info */ + memset(data, 0, logsize > PAGE_SIZE ? PAGE_SIZE : logsize); + break; + case 0x03: /* Firmware slot information */ + memset(data, 0, logsize > PAGE_SIZE ? PAGE_SIZE : logsize); + break; + default: + WPRINTF(("%s get log page %x command not supported\r\n", + __func__, logpage)); + + pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_LOG_PAGE); + } + + return (1); +} + +static int +nvme_opc_identify(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + void *dest; + + DPRINTF(("%s identify 0x%x nsid 0x%x\r\n", __func__, + command->cdw10 & 0xFF, command->nsid)); + + switch (command->cdw10 & 0xFF) { + case 0x00: /* return Identify Namespace data structure */ + dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, + sizeof(sc->nsdata)); + memcpy(dest, &sc->nsdata, sizeof(sc->nsdata)); + break; + case 0x01: /* return Identify Controller data structure */ + dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, + sizeof(sc->ctrldata)); + memcpy(dest, &sc->ctrldata, sizeof(sc->ctrldata)); + break; + case 0x02: /* list of 1024 active NSIDs > CDW1.NSID */ + dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, + sizeof(uint32_t) * 1024); + ((uint32_t *)dest)[0] = 1; + ((uint32_t *)dest)[1] = 0; + break; + case 0x11: + pci_nvme_status_genc(&compl->status, + NVME_SC_INVALID_NAMESPACE_OR_FORMAT); + return (1); + case 0x03: /* list of NSID structures in CDW1.NSID, 4096 bytes */ + case 0x10: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + default: + DPRINTF(("%s unsupported identify command requested 0x%x\r\n", + __func__, command->cdw10 & 0xFF)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (1); + } + + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + return (1); +} + +static int +nvme_opc_set_features(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + int feature = command->cdw10 & 0x0F; + uint32_t iv; + + DPRINTF(("%s feature 0x%x\r\n", __func__, feature)); + compl->cdw0 = 0; + + switch (feature) { + case NVME_FEAT_ARBITRATION: + DPRINTF((" arbitration 0x%x\r\n", command->cdw11)); + break; + case NVME_FEAT_POWER_MANAGEMENT: + DPRINTF((" power management 0x%x\r\n", command->cdw11)); + break; + case NVME_FEAT_LBA_RANGE_TYPE: + DPRINTF((" lba range 0x%x\r\n", command->cdw11)); + break; + case NVME_FEAT_TEMPERATURE_THRESHOLD: + DPRINTF((" temperature threshold 0x%x\r\n", command->cdw11)); + break; + case NVME_FEAT_ERROR_RECOVERY: + DPRINTF((" error recovery 0x%x\r\n", command->cdw11)); + break; + case NVME_FEAT_VOLATILE_WRITE_CACHE: + DPRINTF((" volatile write cache 0x%x\r\n", command->cdw11)); + break; + case NVME_FEAT_NUMBER_OF_QUEUES: + sc->num_squeues = command->cdw11 & 0xFFFF; + sc->num_cqueues = (command->cdw11 >> 16) & 0xFFFF; + DPRINTF((" number of queues (submit %u, completion %u)\r\n", + sc->num_squeues, sc->num_cqueues)); + + if (sc->num_squeues == 0 || sc->num_squeues > sc->max_queues) + sc->num_squeues = sc->max_queues; + if (sc->num_cqueues == 0 || sc->num_cqueues > sc->max_queues) + sc->num_cqueues = sc->max_queues; + + compl->cdw0 = (sc->num_squeues & 0xFFFF) | + ((sc->num_cqueues & 0xFFFF) << 16); + + break; + case NVME_FEAT_INTERRUPT_COALESCING: + DPRINTF((" interrupt coalescing 0x%x\r\n", command->cdw11)); + + /* in uS */ + sc->intr_coales_aggr_time = ((command->cdw11 >> 8) & 0xFF)*100; + + sc->intr_coales_aggr_thresh = command->cdw11 & 0xFF; + break; + case NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION: + iv = command->cdw11 & 0xFFFF; + + DPRINTF((" interrupt vector configuration 0x%x\r\n", + command->cdw11)); + + for (uint32_t i = 0; i <= sc->num_cqueues; i++) { + if (sc->compl_queues[i].intr_vec == iv) { + if (command->cdw11 & (1 << 16)) + sc->compl_queues[i].intr_en |= + NVME_CQ_INTCOAL; + else + sc->compl_queues[i].intr_en &= + ~NVME_CQ_INTCOAL; + } + } + break; + case NVME_FEAT_WRITE_ATOMICITY: + DPRINTF((" write atomicity 0x%x\r\n", command->cdw11)); + break; + case NVME_FEAT_ASYNC_EVENT_CONFIGURATION: + DPRINTF((" async event configuration 0x%x\r\n", + command->cdw11)); + sc->async_ev_config = command->cdw11; + break; + case NVME_FEAT_SOFTWARE_PROGRESS_MARKER: + DPRINTF((" software progress marker 0x%x\r\n", + command->cdw11)); + break; + case 0x0C: + DPRINTF((" autonomous power state transition 0x%x\r\n", + command->cdw11)); + break; + default: + WPRINTF(("%s invalid feature\r\n", __func__)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (1); + } + + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + return (1); +} + +static int +nvme_opc_get_features(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + int feature = command->cdw10 & 0x0F; + + DPRINTF(("%s feature 0x%x\r\n", __func__, feature)); + + compl->cdw0 = 0; + + switch (feature) { + case NVME_FEAT_ARBITRATION: + DPRINTF((" arbitration\r\n")); + break; + case NVME_FEAT_POWER_MANAGEMENT: + DPRINTF((" power management\r\n")); + break; + case NVME_FEAT_LBA_RANGE_TYPE: + DPRINTF((" lba range\r\n")); + break; + case NVME_FEAT_TEMPERATURE_THRESHOLD: + DPRINTF((" temperature threshold\r\n")); + switch ((command->cdw11 >> 20) & 0x3) { + case 0: + /* Over temp threshold */ + compl->cdw0 = 0xFFFF; + break; + case 1: + /* Under temp threshold */ + compl->cdw0 = 0; + break; + default: + WPRINTF((" invalid threshold type select\r\n")); + pci_nvme_status_genc(&compl->status, + NVME_SC_INVALID_FIELD); + return (1); + } + break; + case NVME_FEAT_ERROR_RECOVERY: + DPRINTF((" error recovery\r\n")); + break; + case NVME_FEAT_VOLATILE_WRITE_CACHE: + DPRINTF((" volatile write cache\r\n")); + break; + case NVME_FEAT_NUMBER_OF_QUEUES: + compl->cdw0 = 0; + if (sc->num_squeues == 0) + compl->cdw0 |= sc->max_queues & 0xFFFF; + else + compl->cdw0 |= sc->num_squeues & 0xFFFF; + + if (sc->num_cqueues == 0) + compl->cdw0 |= (sc->max_queues & 0xFFFF) << 16; + else + compl->cdw0 |= (sc->num_cqueues & 0xFFFF) << 16; + + DPRINTF((" number of queues (submit %u, completion %u)\r\n", + compl->cdw0 & 0xFFFF, + (compl->cdw0 >> 16) & 0xFFFF)); + + break; + case NVME_FEAT_INTERRUPT_COALESCING: + DPRINTF((" interrupt coalescing\r\n")); + break; + case NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION: + DPRINTF((" interrupt vector configuration\r\n")); + break; + case NVME_FEAT_WRITE_ATOMICITY: + DPRINTF((" write atomicity\r\n")); + break; + case NVME_FEAT_ASYNC_EVENT_CONFIGURATION: + DPRINTF((" async event configuration\r\n")); + sc->async_ev_config = command->cdw11; + break; + case NVME_FEAT_SOFTWARE_PROGRESS_MARKER: + DPRINTF((" software progress marker\r\n")); + break; + case 0x0C: + DPRINTF((" autonomous power state transition\r\n")); + break; + default: + WPRINTF(("%s invalid feature 0x%x\r\n", __func__, feature)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (1); + } + + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + return (1); +} + +static int +nvme_opc_abort(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + DPRINTF(("%s submission queue %u, command ID 0x%x\r\n", __func__, + command->cdw10 & 0xFFFF, (command->cdw10 >> 16) & 0xFFFF)); + + /* TODO: search for the command ID and abort it */ + + compl->cdw0 = 1; + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + return (1); +} + +static int +nvme_opc_async_event_req(struct pci_nvme_softc* sc, + struct nvme_command* command, struct nvme_completion* compl) +{ + DPRINTF(("%s async event request 0x%x\r\n", __func__, command->cdw11)); + + /* + * TODO: raise events when they happen based on the Set Features cmd. + * These events happen async, so only set completion successful if + * there is an event reflective of the request to get event. + */ + pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED); + return (0); +} + +static void +pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, uint64_t value) +{ + struct nvme_completion compl; + struct nvme_command *cmd; + struct nvme_submission_queue *sq; + struct nvme_completion_queue *cq; + int do_intr = 0; + uint16_t sqhead; + + DPRINTF(("%s index %u\r\n", __func__, (uint32_t)value)); + + sq = &sc->submit_queues[0]; + + sqhead = atomic_load_acq_short(&sq->head); + + if (atomic_testandset_int(&sq->busy, 1)) { + DPRINTF(("%s SQ busy, head %u, tail %u\r\n", + __func__, sqhead, sq->tail)); + return; + } + + DPRINTF(("sqhead %u, tail %u\r\n", sqhead, sq->tail)); + + while (sqhead != atomic_load_acq_short(&sq->tail)) { + cmd = &(sq->qbase)[sqhead]; + compl.status = 0; + + switch (NVME_CMD_GET_OPC(cmd->opc_fuse)) { + case NVME_OPC_DELETE_IO_SQ: + DPRINTF(("%s command DELETE_IO_SQ\r\n", __func__)); + do_intr |= nvme_opc_delete_io_sq(sc, cmd, &compl); + break; + case NVME_OPC_CREATE_IO_SQ: + DPRINTF(("%s command CREATE_IO_SQ\r\n", __func__)); + do_intr |= nvme_opc_create_io_sq(sc, cmd, &compl); + break; + case NVME_OPC_DELETE_IO_CQ: + DPRINTF(("%s command DELETE_IO_CQ\r\n", __func__)); + do_intr |= nvme_opc_delete_io_cq(sc, cmd, &compl); + break; + case NVME_OPC_CREATE_IO_CQ: + DPRINTF(("%s command CREATE_IO_CQ\r\n", __func__)); + do_intr |= nvme_opc_create_io_cq(sc, cmd, &compl); + break; + case NVME_OPC_GET_LOG_PAGE: + DPRINTF(("%s command GET_LOG_PAGE\r\n", __func__)); + do_intr |= nvme_opc_get_log_page(sc, cmd, &compl); + break; + case NVME_OPC_IDENTIFY: + DPRINTF(("%s command IDENTIFY\r\n", __func__)); + do_intr |= nvme_opc_identify(sc, cmd, &compl); + break; + case NVME_OPC_ABORT: + DPRINTF(("%s command ABORT\r\n", __func__)); + do_intr |= nvme_opc_abort(sc, cmd, &compl); + break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jul 5 04:12:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D3191042970; Thu, 5 Jul 2018 04:12:06 +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 E503C857B8; Thu, 5 Jul 2018 04:12:05 +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 w654C1sS046150; Wed, 4 Jul 2018 21:12:01 -0700 (PDT) (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 w654C1IO046149; Wed, 4 Jul 2018 21:12:01 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807050412.w654C1IO046149@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335973 - head/sys/dev/mxge In-Reply-To: <201807050243.w652hAYL018215@repo.freebsd.org> To: Andrew Gallatin Date: Wed, 4 Jul 2018 21:12:01 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 04:12:06 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: gallatin > Date: Thu Jul 5 02:43:10 2018 > New Revision: 335973 > URL: https://svnweb.freebsd.org/changeset/base/335973 > > Log: > mxge: replace 65536 with IP_MAXPACKET in tso settings. > Thank you, I see some of the oddities in tso for other cards but I think there are card limitations occuring there that are at issue. > Modified: > head/sys/dev/mxge/if_mxge.c > > Modified: head/sys/dev/mxge/if_mxge.c > ============================================================================== > --- head/sys/dev/mxge/if_mxge.c Thu Jul 5 02:08:57 2018 (r335972) > +++ head/sys/dev/mxge/if_mxge.c Thu Jul 5 02:43:10 2018 (r335973) > @@ -4984,9 +4984,9 @@ mxge_attach(device_t dev) > ifp->if_ioctl = mxge_ioctl; > ifp->if_start = mxge_start; > ifp->if_get_counter = mxge_get_counter; > - ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); > + ifp->if_hw_tsomax = IP_MAXPACKET - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); > ifp->if_hw_tsomaxsegcount = sc->ss[0].tx.max_desc; > - ifp->if_hw_tsomaxsegsize = 65536; > + ifp->if_hw_tsomaxsegsize = IP_MAXPACKET; > /* Initialise the ifmedia structure */ > ifmedia_init(&sc->media, 0, mxge_media_change, > mxge_media_status); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jul 5 05:41:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C24C31024A11; Thu, 5 Jul 2018 05:41:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AD5989328; Thu, 5 Jul 2018 05:41:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [192.168.0.15] (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A36E4D911; Thu, 5 Jul 2018 07:41:47 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_C1CC5E40-7B21-46BF-9AEC-AAE12896AE56"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd Date: Thu, 5 Jul 2018 07:41:42 +0200 In-Reply-To: Cc: Eitan Adler , John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Gerald Pfeifer To: Ed Maste References: <201807031353.w63DrsAa079940@repo.freebsd.org> <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> <20180703150203.GA34086@bsdpad.com> X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 05:41:54 -0000 --Apple-Mail=_C1CC5E40-7B21-46BF-9AEC-AAE12896AE56 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 5 Jul 2018, at 04:25, Ed Maste wrote: > > On 4 July 2018 at 20:55, Eitan Adler wrote: >> On Tue, 3 Jul 2018 at 08:22, John Baldwin wrote: >>> >> since GCC usually breaks >>> them. >> >> Could you explain what you mean or point to a prior conversation? >> > I'm not sure if there's a previous discussion, but the short version > is that the GCC build process includes a 'fixincludes' step which > installs modified versions of system headers in some path that GCC > uses in preference to /usr/include. Originally this was done to work > around broken system includes in proprietary operating systems that > couldn't easily be fixed upstream. In the case of FreeBSD GCC's > fixincludes actually just installs broken headers, and removing its > broken copies is the easy fix. Those fixed includes are no longer installed in more recent gcc ports, see e.g: https://svnweb.freebsd.org/ports?view=revision&revision=444860 https://svnweb.freebsd.org/ports?view=revision&revision=444861 https://svnweb.freebsd.org/ports?view=revision&revision=445313 -Dimitry --Apple-Mail=_C1CC5E40-7B21-46BF-9AEC-AAE12896AE56 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWz2vlgAKCRCwXqMKLiCW ozUnAKCvfnVslEvEWxewhyPy44z9wuY4PgCfXZSQyjJ19QKPpvlydULPnOP43Ks= =1x7L -----END PGP SIGNATURE----- --Apple-Mail=_C1CC5E40-7B21-46BF-9AEC-AAE12896AE56-- From owner-svn-src-head@freebsd.org Thu Jul 5 10:34:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62F93103F25E; Thu, 5 Jul 2018 10:34:02 +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 15DB07470F; Thu, 5 Jul 2018 10:34:02 +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 D0FC718C10; Thu, 5 Jul 2018 10:34:01 +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 w65AY1i2058429; Thu, 5 Jul 2018 10:34:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65AY1V9058428; Thu, 5 Jul 2018 10:34:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051034.w65AY1V9058428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 10:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335975 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 335975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 10:34:02 -0000 Author: kib Date: Thu Jul 5 10:34:01 2018 New Revision: 335975 URL: https://svnweb.freebsd.org/changeset/base/335975 Log: Order the portion of the AMD-specific MSRs names definitions numerically. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu Jul 5 03:33:58 2018 (r335974) +++ head/sys/x86/include/specialreg.h Thu Jul 5 10:34:01 2018 (r335975) @@ -998,18 +998,18 @@ #define MSR_TOP_MEM 0xc001001a /* boundary for ram below 4G */ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ #define MSR_NB_CFG1 0xc001001f /* NB configuration 1 */ +#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ +#define MSR_MC0_CTL_MASK 0xc0010044 #define MSR_P_STATE_LIMIT 0xc0010061 /* P-state Current Limit Register */ #define MSR_P_STATE_CONTROL 0xc0010062 /* P-state Control Register */ #define MSR_P_STATE_STATUS 0xc0010063 /* P-state Status Register */ #define MSR_P_STATE_CONFIG(n) (0xc0010064 + (n)) /* P-state Config */ #define MSR_SMM_ADDR 0xc0010112 /* SMM TSEG base address */ #define MSR_SMM_MASK 0xc0010113 /* SMM TSEG address mask */ +#define MSR_VM_CR 0xc0010114 /* SVM: feature control */ +#define MSR_VM_HSAVE_PA 0xc0010117 /* SVM: host save area address */ #define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */ #define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ -#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ -#define MSR_MC0_CTL_MASK 0xc0010044 -#define MSR_VM_CR 0xc0010114 /* SVM: feature control */ -#define MSR_VM_HSAVE_PA 0xc0010117 /* SVM: host save area address */ /* MSR_VM_CR related */ #define VM_CR_SVMDIS 0x10 /* SVM: disabled by BIOS */ From owner-svn-src-head@freebsd.org Thu Jul 5 10:44:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0307E103FD3A; Thu, 5 Jul 2018 10:44:19 +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 A8DC974E79; Thu, 5 Jul 2018 10:44:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A76318DB2; Thu, 5 Jul 2018 10:44:18 +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 w65AiIMN063535; Thu, 5 Jul 2018 10:44:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65AiIom063534; Thu, 5 Jul 2018 10:44:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051044.w65AiIom063534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 10:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335976 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 335976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 10:44:19 -0000 Author: kib Date: Thu Jul 5 10:44:18 2018 New Revision: 335976 URL: https://svnweb.freebsd.org/changeset/base/335976 Log: Add a name for the MSR controlling standard extended features report on AMD. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu Jul 5 10:34:01 2018 (r335975) +++ head/sys/x86/include/specialreg.h Thu Jul 5 10:44:18 2018 (r335976) @@ -1008,6 +1008,7 @@ #define MSR_SMM_MASK 0xc0010113 /* SMM TSEG address mask */ #define MSR_VM_CR 0xc0010114 /* SVM: feature control */ #define MSR_VM_HSAVE_PA 0xc0010117 /* SVM: host save area address */ +#define MSR_AMD_CPUID07 0xc0011002 /* CPUID 07 %ebx override */ #define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */ #define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ From owner-svn-src-head@freebsd.org Thu Jul 5 11:03:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BEC710413C6; Thu, 5 Jul 2018 11:03:12 +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 1EB2C75E2C; Thu, 5 Jul 2018 11:03:12 +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 00081190E9; Thu, 5 Jul 2018 11:03:11 +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 w65B3Bsj073692; Thu, 5 Jul 2018 11:03:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65B3BRa073691; Thu, 5 Jul 2018 11:03:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807051103.w65B3BRa073691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 5 Jul 2018 11:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335977 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 335977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 11:03:12 -0000 Author: trasz Date: Thu Jul 5 11:03:11 2018 New Revision: 335977 URL: https://svnweb.freebsd.org/changeset/base/335977 Log: Add trivial usage example to ports(7). MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Thu Jul 5 10:44:18 2018 (r335976) +++ head/share/man/man7/ports.7 Thu Jul 5 11:03:11 2018 (r335977) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd July 5, 2018 .Dt PORTS 7 .Os .Sh NAME @@ -530,6 +530,13 @@ The default ports directory .It Pa /usr/ports/Mk/bsd.port.mk The big Kahuna. .El +.Sh EXAMPLES +Build and install Emacs: +.Bd -literal -offset indent +cd /usr/ports/editors/emacs +make install +.Ed +.Pp .Sh SEE ALSO .Xr make 1 , .Xr make.conf 5 , From owner-svn-src-head@freebsd.org Thu Jul 5 11:51:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 613EF10440A2; Thu, 5 Jul 2018 11:51:00 +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 127D7778FA; Thu, 5 Jul 2018 11:51:00 +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 E8E4219772; Thu, 5 Jul 2018 11:50:59 +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 w65BoxS7097996; Thu, 5 Jul 2018 11:50:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65Boxlr097995; Thu, 5 Jul 2018 11:50:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807051150.w65Boxlr097995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 5 Jul 2018 11:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335978 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 335978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 11:51:00 -0000 Author: trasz Date: Thu Jul 5 11:50:59 2018 New Revision: 335978 URL: https://svnweb.freebsd.org/changeset/base/335978 Log: Fix mandoc -Tlint warning introduced in r335977. Reported by: 0mp@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Thu Jul 5 11:03:11 2018 (r335977) +++ head/share/man/man7/ports.7 Thu Jul 5 11:50:59 2018 (r335978) @@ -536,7 +536,6 @@ Build and install Emacs: cd /usr/ports/editors/emacs make install .Ed -.Pp .Sh SEE ALSO .Xr make 1 , .Xr make.conf 5 , From owner-svn-src-head@freebsd.org Thu Jul 5 12:24:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D767A102413B; Thu, 5 Jul 2018 12:24:55 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6564379A47; Thu, 5 Jul 2018 12:24:55 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it0-x243.google.com with SMTP id p17-v6so12043192itc.2; Thu, 05 Jul 2018 05:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=Dp6U0uteILqI84pqk7vSUiH/tgwKkh22UiHvq9RSVaE=; b=PIe9WODdPAAZSDYu37HejSkqXs41dKOwDisY1yGWB5HPo1bO8Wg3QmhIKhldtxr9W9 B/0d8HitbMbq5vlTh/lrZe0cq3a2DvZ0qOybUG9YkPJ428bPMq1FACj5p0hKk/jtCWo2 +HEQQL24it378HwT7KlTzfKhv0L3cdvYApI0ywQPjoeFx9mJKOJIYy6e7uV9KpafyJy4 vxmXFpaTX3/jPwCRlTNsq0g4Hw3dur8ntcdkCI3+vIIUqYyjUAtuXaA8Wkv2+CYLAyHP r7xT00vDqWiPAvLd2kxFBxoyAaLtduImT1R/rgcauMqamBsn5N9mqqg82HhVZo+LE5Qe opgg== 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:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=Dp6U0uteILqI84pqk7vSUiH/tgwKkh22UiHvq9RSVaE=; b=mcOb6KzWcAlMc5JNkPLDF+0LV23/gHAcC/AEsBKQ75R6mFSZYdN3O5H5xHymmj5UO2 l6/2K8HB7G2vP1ol3zdJKvF2RJrD1gUC/JTsid0dhrkUl9ddJTDcIE0+nlLdXPW0VQwC xNre461BZJYnN865K+pl98Vfc8qc5cUuQofVCYn4Az9I0U8CTn9Z1no7d/x7bp00tztv y4obietAV+vwdqYzUPcYT62l1ZoHBLdexWG2rFSsyi5/7cXkIu/squJI/iKGpELaP+0d A0NTZYgCjvKc/tcpupwvfaLZBS7JHmeJnoQ54AyYvAfAD4kD9dk+/ToxqbAj8CCzjycJ W56w== X-Gm-Message-State: APt69E03VDeHowmL8XxWoKLscxcyhjw/rs/hrcdQe/Od5FNMD++Fp0YT FiszckW6YcipD977ei00M2bAf5y2Scpu2xU1noI= X-Google-Smtp-Source: AAOMgpff5Yyyq1BHNRyAS1gWt0TCfEZNc6Yg120k5XsLZlgDaM7nLkA3/NqyKEN1jl+DDM8i64MzDKwXLX5Dz19+YHM= X-Received: by 2002:a24:2c49:: with SMTP id i70-v6mr4705198iti.135.1530793494808; Thu, 05 Jul 2018 05:24:54 -0700 (PDT) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 2002:a02:a495:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 05:24:54 -0700 (PDT) In-Reply-To: <081170FC-D433-4FE6-87E1-D5470480B971@sigsegv.be> References: <201807010116.w611G35w008185@repo.freebsd.org> <081170FC-D433-4FE6-87E1-D5470480B971@sigsegv.be> From: Antoine Brodin Date: Thu, 5 Jul 2018 12:24:54 +0000 X-Google-Sender-Auth: qTn7tBvINsdt19jlecyGQKtuDao Message-ID: Subject: Re: svn commit: r335833 - in head: share/man/man4 sys/net sys/netpfil/pf To: Kristof Provost Cc: Will Andrews , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 12:24:56 -0000 On Tue, Jul 3, 2018 at 7:42 AM, Kristof Provost wrote: > On 3 Jul 2018, at 7:38, Antoine Brodin wrote: > > On Sun, Jul 1, 2018 at 3:16 AM, Will Andrews wrote: > > Author: will > Date: Sun Jul 1 01:16:03 2018 > New Revision: 335833 > URL: https://svnweb.freebsd.org/changeset/base/335833 > > Log: > pf: remove unused ioctls. > > Several ioctls are unused in pf, in the sense that no base utility > references them. Additionally, a cursory review of pf-based ports > indicates they're not used elsewhere either. Some of them have been > unused since the original import. As far as I can tell, they're also > unused in OpenBSD. Finally, removing this code removes the need for > future pf work to take them into account. > > Reviewed by: kp > Differential Revision: https://reviews.freebsd.org/D16076 > > Modified: > head/share/man/man4/pf.4 > head/sys/net/pfvar.h > head/sys/netpfil/pf/pf_ioctl.c > > Hi, > > This breaks some ports like net/libdnet, please revert or fix the > ports fallout. > > It also uses DIOCCHANGERULE (like sshuttle). > > Do you know of any other failures? > It=E2=80=99d be good to know if reverting just the DIOCCHANGERULE removal= would be > enough to fix all failures, or if there are others that are used as well. The 2 failures I see are libdnet and miniupnpd missing DIOCCHANGERULE, so adding it back may be enough. Antoine From owner-svn-src-head@freebsd.org Thu Jul 5 13:13:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E661027FF8; Thu, 5 Jul 2018 13:13: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 491D87B842; Thu, 5 Jul 2018 13:13: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 2AE451A5A5; Thu, 5 Jul 2018 13:13: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 w65DDrPp041303; Thu, 5 Jul 2018 13:13:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65DDnQJ041281; Thu, 5 Jul 2018 13:13:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201807051313.w65DDnQJ041281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Jul 2018 13:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat X-SVN-Commit-Revision: 335979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 13:13:54 -0000 Author: brooks Date: Thu Jul 5 13:13:48 2018 New Revision: 335979 URL: https://svnweb.freebsd.org/changeset/base/335979 Log: Make struct xinpcb and friends word-size independent. Replace size_t members with ksize_t (uint64_t) and pointer members (never used as pointers in userspace, but instead as unique idenitifiers) with kvaddr_t (uint64_t). This makes the structs identical between 32-bit and 64-bit ABIs. On 64-bit bit systems, the ABI is maintained. On 32-bit systems, this is an ABI breaking change. The ABI of most of these structs was previously broken in r315662. This also imposes a small API change on userspace consumers who must handle kernel pointers becoming virtual addresses. PR: 228301 (exp-run by antoine) Reviewed by: jtl, kib, rwatson (various versions) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15386 Modified: head/UPDATING head/lib/libkvm/kvm.h head/sys/kern/kern_descrip.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_usrreq.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_uio.h head/sys/netinet/tcp_var.h head/sys/sys/file.h head/sys/sys/param.h head/sys/sys/socketvar.h head/sys/sys/types.h head/sys/sys/unpcb.h head/usr.bin/netstat/inet.c head/usr.bin/netstat/unix.c head/usr.bin/sockstat/sockstat.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jul 5 11:50:59 2018 (r335978) +++ head/UPDATING Thu Jul 5 13:13:48 2018 (r335979) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180705: + The ABI of syscalls used by management tools like sockstat and + netstat has been broken to allow 32-bit binaries to work on + 64-bit kernels without modification. These programs will need + to match the kernel in order to function. External programs may + require minor modifications to accommodate a change of type in + structures from pointers to 64-bit virtual addresses. + 20180702: On i386 and amd64 atomics are now inlined. Out of tree modules using atomics will need to be rebuilt. Modified: head/lib/libkvm/kvm.h ============================================================================== --- head/lib/libkvm/kvm.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/lib/libkvm/kvm.h Thu Jul 5 13:13:48 2018 (r335979) @@ -61,8 +61,6 @@ typedef __ssize_t ssize_t; #define _SSIZE_T_DECLARED #endif -typedef uint64_t kvaddr_t; /* An address in a target image. */ - struct kvm_nlist { const char *n_name; unsigned char n_type; Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/kern/kern_descrip.c Thu Jul 5 13:13:48 2018 (r335979) @@ -3362,10 +3362,10 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) if ((fp = fdp->fd_ofiles[n].fde_file) == NULL) continue; xf.xf_fd = n; - xf.xf_file = fp; - xf.xf_data = fp->f_data; - xf.xf_vnode = fp->f_vnode; - xf.xf_type = fp->f_type; + xf.xf_file = (kvaddr_t)fp; + xf.xf_data = (kvaddr_t)fp->f_data; + xf.xf_vnode = (kvaddr_t)fp->f_vnode; + xf.xf_type = (kvaddr_t)fp->f_type; xf.xf_count = fp->f_count; xf.xf_msgcount = 0; xf.xf_offset = foffset_get(fp); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/kern/uipc_socket.c Thu Jul 5 13:13:48 2018 (r335979) @@ -3985,12 +3985,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso) { xso->xso_len = sizeof *xso; - xso->xso_so = so; + xso->xso_so = (kvaddr_t)so; xso->so_type = so->so_type; xso->so_options = so->so_options; xso->so_linger = so->so_linger; xso->so_state = so->so_state; - xso->so_pcb = so->so_pcb; + xso->so_pcb = (kvaddr_t)so->so_pcb; xso->xso_protocol = so->so_proto->pr_protocol; xso->xso_family = so->so_proto->pr_domain->dom_family; xso->so_timeo = so->so_timeo; Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/kern/uipc_usrreq.c Thu Jul 5 13:13:48 2018 (r335979) @@ -1853,7 +1853,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) if (freeunp == 0 && unp->unp_gencnt <= gencnt) { xu->xu_len = sizeof *xu; - xu->xu_unpp = unp; + xu->xu_unpp = (kvaddr_t)unp; /* * XXX - need more locking here to protect against * connect/disconnect races for SMP. @@ -1870,10 +1870,10 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) unp->unp_conn->unp_addr->sun_len); else bzero(&xu->xu_caddr, sizeof(xu->xu_caddr)); - xu->unp_vnode = unp->unp_vnode; - xu->unp_conn = unp->unp_conn; - xu->xu_firstref = LIST_FIRST(&unp->unp_refs); - xu->xu_nextref = LIST_NEXT(unp, unp_reflink); + xu->unp_vnode = (kvaddr_t)unp->unp_vnode; + xu->unp_conn = (kvaddr_t)unp->unp_conn; + xu->xu_firstref = (kvaddr_t)LIST_FIRST(&unp->unp_refs); + xu->xu_nextref = (kvaddr_t)LIST_NEXT(unp, unp_reflink); xu->unp_gencnt = unp->unp_gencnt; sotoxsocket(unp->unp_socket, &xu->xu_socket); UNP_PCB_UNLOCK(unp); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/netinet/in_pcb.c Thu Jul 5 13:13:48 2018 (r335979) @@ -2906,7 +2906,7 @@ in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb bzero(&xi->xi_socket, sizeof(struct xsocket)); bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo)); xi->inp_gencnt = inp->inp_gencnt; - xi->inp_ppcb = inp->inp_ppcb; + xi->inp_ppcb = (kvaddr_t)inp->inp_ppcb; xi->inp_flow = inp->inp_flow; xi->inp_flowid = inp->inp_flowid; xi->inp_flowtype = inp->inp_flowtype; Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/netinet/in_pcb.h Thu Jul 5 13:13:48 2018 (r335979) @@ -366,12 +366,12 @@ struct inpcb { */ #ifdef _SYS_SOCKETVAR_H_ struct xinpcb { - size_t xi_len; /* length of this structure */ + ksize_t xi_len; /* length of this structure */ struct xsocket xi_socket; /* (s,p) */ struct in_conninfo inp_inc; /* (s,p) */ uint64_t inp_gencnt; /* (s,p) */ union { - void *inp_ppcb; /* (s) netstat(1) */ + kvaddr_t inp_ppcb; /* (s) netstat(1) */ int64_t ph_ppcb; }; int64_t inp_spare64[4]; @@ -394,10 +394,12 @@ struct xinpcb { } __aligned(8); struct xinpgen { - size_t xig_len; /* length of this structure */ + ksize_t xig_len; /* length of this structure */ u_int xig_count; /* number of PCBs at this time */ + uint32_t _xig_spare32; inp_gen_t xig_gen; /* generation count at this time */ so_gen_t xig_sogen; /* socket generation count this time */ + uint64_t _xig_spare64[4]; } __aligned(8); #ifdef _KERNEL void in_pcbtoxinpcb(const struct inpcb *, struct xinpcb *); Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/netinet/sctp_sysctl.c Thu Jul 5 13:13:48 2018 (r335979) @@ -409,7 +409,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) xinpcb.total_recvs = inp->total_recvs; xinpcb.total_nospaces = inp->total_nospaces; xinpcb.fragmentation_point = inp->sctp_frag_point; - xinpcb.socket = inp->sctp_socket; + xinpcb.socket = (kvaddr_t)inp->sctp_socket; so = inp->sctp_socket; if ((so == NULL) || (!SCTP_IS_LISTENING(inp)) || Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/netinet/sctp_uio.h Thu Jul 5 13:13:48 2018 (r335979) @@ -1175,14 +1175,11 @@ struct xsctp_inpcb { uint16_t local_port; uint16_t qlen_old; uint16_t maxqlen_old; - void *socket; + uint16_t __spare16; + kvaddr_t socket; uint32_t qlen; uint32_t maxqlen; -#if defined(__LP64__) - uint32_t extra_padding[27]; /* future */ -#else - uint32_t extra_padding[28]; /* future */ -#endif + uint32_t extra_padding[26]; /* future */ }; struct xsctp_tcb { Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/netinet/tcp_var.h Thu Jul 5 13:13:48 2018 (r335979) @@ -677,7 +677,7 @@ void hhook_run_tcp_est_out(struct tcpcb *tp, */ #if defined(_NETINET_IN_PCB_H_) && defined(_SYS_SOCKETVAR_H_) struct xtcpcb { - size_t xt_len; /* length of this structure */ + ksize_t xt_len; /* length of this structure */ struct xinpcb xt_inp; char xt_stack[TCP_FUNCTION_NAME_LEN_MAX]; /* (s) */ char xt_logid[TCP_LOG_ID_LEN]; /* (s) */ Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/sys/file.h Thu Jul 5 13:13:48 2018 (r335979) @@ -209,18 +209,23 @@ struct file { * Userland version of struct file, for sysctl */ struct xfile { - size_t xf_size; /* size of struct xfile */ + ksize_t xf_size; /* size of struct xfile */ pid_t xf_pid; /* owning process */ uid_t xf_uid; /* effective uid of owning process */ int xf_fd; /* descriptor number */ - void *xf_file; /* address of struct file */ + int _xf_int_pad1; + kvaddr_t xf_file; /* address of struct file */ short xf_type; /* descriptor type */ + short _xf_short_pad1; int xf_count; /* reference count */ int xf_msgcount; /* references from message queue */ + int _xf_int_pad2; off_t xf_offset; /* file offset */ - void *xf_data; /* file descriptor specific data */ - void *xf_vnode; /* vnode pointer */ + kvaddr_t xf_data; /* file descriptor specific data */ + kvaddr_t xf_vnode; /* vnode pointer */ u_int xf_flag; /* flags (see fcntl.h) */ + int _xf_int_pad3; + int64_t _xf_int64_pad[6]; }; #ifdef _KERNEL Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/sys/param.h Thu Jul 5 13:13:48 2018 (r335979) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200071 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200072 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/sys/socketvar.h Thu Jul 5 13:13:48 2018 (r335979) @@ -474,13 +474,13 @@ int accept_filt_generic_mod_event(module_t mod, int ev * Structure to export socket from kernel to utilities, via sysctl(3). */ struct xsocket { - size_t xso_len; /* length of this structure */ + ksize_t xso_len; /* length of this structure */ union { - void *xso_so; /* kernel address of struct socket */ + kvaddr_t xso_so; /* kernel address of struct socket */ int64_t ph_so; }; union { - void *so_pcb; /* kernel address of struct inpcb */ + kvaddr_t so_pcb; /* kernel address of struct inpcb */ int64_t ph_pcb; }; uint64_t so_oobmark; Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/sys/types.h Thu Jul 5 13:13:48 2018 (r335979) @@ -251,6 +251,15 @@ struct cap_rights; typedef struct cap_rights cap_rights_t; #endif +/* + * Types suitable for exporting size and pointers (as virtual addresses) + * from the kernel independent of native word size. These should be + * used in place of size_t and (u)intptr_t in structs which contain such + * types that are shared with userspace. + */ +typedef __uint64_t kvaddr_t; +typedef __uint64_t ksize_t; + typedef __vm_offset_t vm_offset_t; typedef __int64_t vm_ooffset_t; typedef __vm_paddr_t vm_paddr_t; Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Thu Jul 5 11:50:59 2018 (r335978) +++ head/sys/sys/unpcb.h Thu Jul 5 13:13:48 2018 (r335979) @@ -138,12 +138,12 @@ struct unpcb { */ #ifdef _SYS_SOCKETVAR_H_ struct xunpcb { - size_t xu_len; /* length of this structure */ - void *xu_unpp; /* to help netstat, fstat */ - void *unp_vnode; /* (s) */ - void *unp_conn; /* (s) */ - void *xu_firstref; /* (s) */ - void *xu_nextref; /* (s) */ + ksize_t xu_len; /* length of this structure */ + kvaddr_t xu_unpp; /* to help netstat, fstat */ + kvaddr_t unp_vnode; /* (s) */ + kvaddr_t unp_conn; /* (s) */ + kvaddr_t xu_firstref; /* (s) */ + kvaddr_t xu_nextref; /* (s) */ unp_gen_t unp_gencnt; /* (s) */ int64_t xu_spare64[8]; int32_t xu_spare32[8]; @@ -159,7 +159,7 @@ struct xunpcb { } __aligned(8); struct xunpgen { - size_t xug_len; + ksize_t xug_len; u_int xug_count; unp_gen_t xug_gen; so_gen_t xug_sogen; Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Thu Jul 5 11:50:59 2018 (r335978) +++ head/usr.bin/netstat/inet.c Thu Jul 5 13:13:48 2018 (r335979) @@ -159,12 +159,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso) bzero(xso, sizeof *xso); xso->xso_len = sizeof *xso; - xso->xso_so = so; + xso->xso_so = (kvaddr_t)so; xso->so_type = so->so_type; xso->so_options = so->so_options; xso->so_linger = so->so_linger; xso->so_state = so->so_state; - xso->so_pcb = so->so_pcb; + xso->so_pcb = (kvaddr_t)so->so_pcb; if (kread((uintptr_t)so->so_proto, &proto, sizeof(proto)) != 0) return (-1); xso->xso_protocol = proto.pr_protocol; Modified: head/usr.bin/netstat/unix.c ============================================================================== --- head/usr.bin/netstat/unix.c Thu Jul 5 11:50:59 2018 (r335978) +++ head/usr.bin/netstat/unix.c Thu Jul 5 13:13:48 2018 (r335979) @@ -153,7 +153,7 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, u_lon xu.xu_len = sizeof xu; KREAD(head_off, &head, sizeof(head)); LIST_FOREACH(unp, &head, unp_link) { - xu.xu_unpp = unp; + xu.xu_unpp = (kvaddr_t)unp; KREAD(unp, &unp0, sizeof (*unp)); unp = &unp0; Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Thu Jul 5 11:50:59 2018 (r335978) +++ head/usr.bin/sockstat/sockstat.c Thu Jul 5 13:13:48 2018 (r335979) @@ -108,8 +108,8 @@ struct addr { }; struct sock { - void *socket; - void *pcb; + kvaddr_t socket; + kvaddr_t pcb; int shown; int vflag; int family; @@ -789,8 +789,8 @@ gather_unix(int proto) warnx("struct xunpcb size mismatch"); goto out; } - if ((xup->unp_conn == NULL && !opt_l) || - (xup->unp_conn != NULL && !opt_c)) + if ((xup->unp_conn == 0 && !opt_l) || + (xup->unp_conn != 0 && !opt_c)) continue; if ((sock = calloc(1, sizeof(*sock))) == NULL) err(1, "malloc()"); @@ -806,8 +806,8 @@ gather_unix(int proto) if (xup->xu_addr.sun_family == AF_UNIX) laddr->address = *(struct sockaddr_storage *)(void *)&xup->xu_addr; - else if (xup->unp_conn != NULL) - *(void **)&(faddr->address) = xup->unp_conn; + else if (xup->unp_conn != 0) + *(kvaddr_t*)&(faddr->address) = xup->unp_conn; laddr->next = NULL; faddr->next = NULL; sock->laddr = laddr; @@ -1008,7 +1008,7 @@ sctp_path_state(int state) static void displaysock(struct sock *s, int pos) { - void *p; + kvaddr_t p; int hash, first, offset; struct addr *laddr, *faddr; struct sock *s_tmp; @@ -1054,8 +1054,8 @@ displaysock(struct sock *s, int pos) break; } /* client */ - p = *(void **)&(faddr->address); - if (p == NULL) { + p = *(kvaddr_t*)&(faddr->address); + if (p == 0) { pos += xprintf("(not connected)"); offset += opt_w ? 92 : 44; break; @@ -1174,13 +1174,13 @@ display(void) } setpassent(1); for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) { - if (xf->xf_data == NULL) + if (xf->xf_data == 0) continue; if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid)) continue; hash = (int)((uintptr_t)xf->xf_data % HASHSIZE); for (s = sockhash[hash]; s != NULL; s = s->next) { - if ((void *)s->socket != xf->xf_data) + if (s->socket != xf->xf_data) continue; if (!check_ports(s)) continue; From owner-svn-src-head@freebsd.org Thu Jul 5 13:37:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD63E1029E85; Thu, 5 Jul 2018 13:37:32 +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 6C1B77C966; Thu, 5 Jul 2018 13:37:32 +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 4D6D31A8FD; Thu, 5 Jul 2018 13:37:32 +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 w65DbWx9051590; Thu, 5 Jul 2018 13:37:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65DbW3q051589; Thu, 5 Jul 2018 13:37:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051337.w65DbW3q051589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 13:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335980 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 13:37:33 -0000 Author: kib Date: Thu Jul 5 13:37:31 2018 New Revision: 335980 URL: https://svnweb.freebsd.org/changeset/base/335980 Log: Silence warnings about unused variables when RACCT is defined but RCTL is not. Reported by: Dries Michiels Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Jul 5 13:13:48 2018 (r335979) +++ head/sys/kern/kern_jail.c Thu Jul 5 13:37:31 2018 (r335980) @@ -3988,8 +3988,10 @@ prison_racct_attach(struct prison *pr) static void prison_racct_modify(struct prison *pr) { +#ifdef RCTL struct proc *p; struct ucred *cred; +#endif struct prison_racct *oldprr; ASSERT_RACCT_ENABLED(); From owner-svn-src-head@freebsd.org Thu Jul 5 13:50:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10AC1102B4DA; Thu, 5 Jul 2018 13:50:50 +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 A2D6A7D817; Thu, 5 Jul 2018 13:50:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 9F571260247; Thu, 5 Jul 2018 15:50:46 +0200 (CEST) Subject: Re: svn commit: r335873 - in head: . sys/amd64/amd64 sys/amd64/include sys/conf sys/i386/i386 sys/i386/include sys/sys sys/vm To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807021948.w62JmcV6019378@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <646866ab-1fe1-1866-8777-c4ad852fef7d@selasky.org> Date: Thu, 5 Jul 2018 15:50:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807021948.w62JmcV6019378@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 13:50:50 -0000 On 07/02/18 21:48, Matt Macy wrote: > Author: mmacy > Date: Mon Jul 2 19:48:38 2018 > New Revision: 335873 > URL:https://svnweb.freebsd.org/changeset/base/335873 > > Log: > inline atomics and allow tied modules to inline locks > > - inline atomics in modules on i386 and amd64 (they were always > inline on other arches) > - allow modules to opt in to inlining locks by specifying > MODULE_TIED=1 in the makefile > > Reviewed by: kib > Sponsored by: Limelight Networks > Differential Revision:https://reviews.freebsd.org/D16079 Hi, This change breaks all atomic usage in drm-next-kmod even after r335913. The problem is simply that SMP is not defined at all for KLD's so all non-kernel atomic usage is with MPLOCKED empty! /* * For userland, always use lock prefixes so that the binaries will run * on both SMP and !SMP systems. */ #if defined(SMP) || !defined(_KERNEL) #define MPLOCKED "lock ; " #else #define MPLOCKED #endif Should the check above be: #if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) --HPS From owner-svn-src-head@freebsd.org Thu Jul 5 14:09:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5979102CE52; Thu, 5 Jul 2018 14:09:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 935397E846; Thu, 5 Jul 2018 14:09:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71BA21ADE7; Thu, 5 Jul 2018 14:09:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65E9mkO067477; Thu, 5 Jul 2018 14:09:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65E9mg0067476; Thu, 5 Jul 2018 14:09:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807051409.w65E9mg0067476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 5 Jul 2018 14:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335982 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 335982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 14:09:49 -0000 Author: ian Date: Thu Jul 5 14:09:48 2018 New Revision: 335982 URL: https://svnweb.freebsd.org/changeset/base/335982 Log: Fix an out-of-bounds array access... the irq data for teardown is in two arrays, as elements 0 and 1 of one array and elements 1 and 2 of the other. Run the loop 0..1 instead of 1..2 and use named constants to offset into one of the arrays. PR: 229508 Modified: head/sys/arm/freescale/imx/imx_gpio.c Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Thu Jul 5 13:45:56 2018 (r335981) +++ head/sys/arm/freescale/imx/imx_gpio.c Thu Jul 5 14:09:48 2018 (r335982) @@ -134,6 +134,8 @@ static struct resource_spec imx_gpio_spec[] = { { SYS_RES_IRQ, 1, RF_ACTIVE }, { -1, 0 } }; +#define FIRST_IRQRES 1 +#define NUM_IRQRES 2 /* * Helpers @@ -852,9 +854,10 @@ imx51_gpio_detach(device_t dev) sc = device_get_softc(dev); gpiobus_detach_bus(dev); - for (irq = 1; irq <= 2; irq++) { + for (irq = 0; irq < NUM_IRQRES; irq++) { if (sc->gpio_ih[irq]) - bus_teardown_intr(dev, sc->sc_res[irq], sc->gpio_ih[irq]); + bus_teardown_intr(dev, sc->sc_res[irq + FIRST_IRQRES], + sc->gpio_ih[irq]); } bus_release_resources(dev, imx_gpio_spec, sc->sc_res); mtx_destroy(&sc->sc_mtx); From owner-svn-src-head@freebsd.org Thu Jul 5 14:12:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38374102D384; Thu, 5 Jul 2018 14:12:58 +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 DFC007F1D0; Thu, 5 Jul 2018 14:12:57 +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 C0B931AF77; Thu, 5 Jul 2018 14:12:57 +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 w65ECvI7072093; Thu, 5 Jul 2018 14:12:57 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65ECuIT072088; Thu, 5 Jul 2018 14:12:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201807051412.w65ECuIT072088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Jul 2018 14:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335983 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Commit-Revision: 335983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 14:12:58 -0000 Author: brooks Date: Thu Jul 5 14:12:56 2018 New Revision: 335983 URL: https://svnweb.freebsd.org/changeset/base/335983 Log: Get rid of netbsd_lchown and netbsd_msync syscall entries. No valid FreeBSD binary ever called them (they would call lchown and msync directly) and we haven't supported NetBSD binaries in ages. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15814 Added: head/lib/libc/sys/compat-stub.c (contents, props changed) Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Thu Jul 5 14:09:48 2018 (r335982) +++ head/lib/libc/sys/Makefile.inc Thu Jul 5 14:12:56 2018 (r335983) @@ -48,6 +48,8 @@ SRCS+= brk.c SRCS+= pipe.c SRCS+= vadvise.c +SRCS+= compat-stub.c + INTERPOSED = \ accept \ accept4 \ Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Thu Jul 5 14:09:48 2018 (r335982) +++ head/lib/libc/sys/Symbol.map Thu Jul 5 14:12:56 2018 (r335983) @@ -179,8 +179,6 @@ FBSD_1.0 { munlockall; munmap; nanosleep; - netbsd_lchown; - netbsd_msync; nfssvc; nmount; ntp_adjtime; @@ -777,10 +775,6 @@ FBSDprivate_1.0 { __sys_munmap; _nanosleep; __sys_nanosleep; - _netbsd_lchown; - __sys_netbsd_lchown; - _netbsd_msync; - __sys_netbsd_msync; _nfssvc; __sys_nfssvc; _nmount; Added: head/lib/libc/sys/compat-stub.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/compat-stub.c Thu Jul 5 14:12:56 2018 (r335983) @@ -0,0 +1,50 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +int compat_enosys(void); + +int +compat_enosys(void) +{ + + return (ENOSYS); +} + +__sym_compat(netbsd_lchown, compat_enosys, FBSD_1.0); +__sym_compat(netbsd_msync, compat_enosys, FBSD_1.0); Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Jul 5 14:09:48 2018 (r335982) +++ head/sys/compat/freebsd32/syscalls.master Thu Jul 5 14:12:56 2018 (r335983) @@ -499,13 +499,10 @@ int count); } 273 AUE_NULL UNIMPL nosys 274 AUE_LCHMOD NOPROTO { int lchmod(char *path, mode_t mode); } -275 AUE_LCHOWN NOPROTO { int lchown(char *path, uid_t uid, \ - gid_t gid); } netbsd_lchown \ - lchown_args int +275 AUE_NULL OBSOL netbsd_lchown 276 AUE_LUTIMES STD { int freebsd32_lutimes(char *path, \ struct timeval32 *tptr); } -277 AUE_MSYNC NOPROTO { int msync(void *addr, size_t len, \ - int flags); } netbsd_msync msync_args int +277 AUE_NULL OBSOL netbsd_msync 278 AUE_STAT COMPAT11|NOPROTO { int nstat(char *path, struct nstat *ub); } 279 AUE_FSTAT COMPAT11|NOPROTO { int nfstat(int fd, struct nstat *sb); } 280 AUE_LSTAT COMPAT11|NOPROTO { int nlstat(char *path, struct nstat *ub); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Jul 5 14:09:48 2018 (r335982) +++ head/sys/kern/syscalls.master Thu Jul 5 14:12:56 2018 (r335983) @@ -630,13 +630,10 @@ size_t count); } 273 AUE_NULL UNIMPL nosys 274 AUE_LCHMOD STD { int lchmod(_In_z_ char *path, mode_t mode); } -275 AUE_LCHOWN NOPROTO { int lchown(char *path, uid_t uid, \ - gid_t gid); } netbsd_lchown lchown_args \ - int +275 AUE_NULL OBSOL netbsd_lchown 276 AUE_LUTIMES STD { int lutimes(_In_z_ char *path, \ _In_ struct timeval *tptr); } -277 AUE_MSYNC NOPROTO { int msync(_In_ void *addr, size_t len, \ - int flags); } netbsd_msync msync_args int +277 AUE_NULL OBSOL netbsd_msync 278 AUE_STAT COMPAT11 { int nstat(_In_z_ char *path, \ _Out_ struct nstat *ub); } 279 AUE_FSTAT COMPAT11 { int nfstat(int fd, _Out_ struct nstat *sb); } From owner-svn-src-head@freebsd.org Thu Jul 5 14:56:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C512103088A; Thu, 5 Jul 2018 14:56:26 +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 19FCB80E58; Thu, 5 Jul 2018 14:56:26 +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 177B810A87D; Thu, 5 Jul 2018 10:56:23 -0400 (EDT) Subject: Re: svn commit: r335916 - head/sys/conf To: Konstantin Belousov , Matt Macy References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> Date: Thu, 5 Jul 2018 07:56:22 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180704142233.GB5562@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 05 Jul 2018 10:56:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 14:56:26 -0000 On 7/4/18 7:22 AM, Konstantin Belousov wrote: > On Tue, Jul 03, 2018 at 11:05:42PM +0000, Matt Macy wrote: >> Author: mmacy >> Date: Tue Jul 3 23:05:42 2018 >> New Revision: 335916 >> URL: https://svnweb.freebsd.org/changeset/base/335916 >> >> Log: >> Enable MODULE_TIED by default for modules compiled with the kernel > But why ? I think we should enable KLD_TIED to inline critical_* etc. for modules built as part of a kernel that are installed alongside the kernel in /boot/. I don't think we need to support modules built with kernel A loaded into kernel B. I think we should not enable it for "standalone" module builds done in ports or via "cd /sys/modules/foo; make" that install to /boot/modules so that those modules can work with different kernels. This still permits someone to load a module into kernel A that they had disabled in kernel A's config file (via NO_MODULES or MODULES_OVERRIDE or some such) by doing 'cd /sys/modules/foo; make; make load'. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jul 5 14:58:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA7361030C69; Thu, 5 Jul 2018 14:58:43 +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 97206810B4; Thu, 5 Jul 2018 14:58:43 +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 34F1310AFD4; Thu, 5 Jul 2018 10:58:42 -0400 (EDT) Subject: Re: svn commit: r335888 - in head: contrib/blacklist/bin lib/libpjdlog sbin/hastd To: Ed Maste , Eitan Adler References: <201807031353.w63DrsAa079940@repo.freebsd.org> <980f862d-02d0-a1ce-cf4c-1d39021013fb@FreeBSD.org> <20180703150203.GA34086@bsdpad.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: Date: Thu, 5 Jul 2018 07:58:41 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 05 Jul 2018 10:58:42 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 14:58:44 -0000 On 7/4/18 7:25 PM, Ed Maste wrote: > On 4 July 2018 at 20:55, Eitan Adler wrote: >> On Tue, 3 Jul 2018 at 08:22, John Baldwin wrote: >>> >> since GCC usually breaks >>> them. >> >> Could you explain what you mean or point to a prior conversation? >> > I'm not sure if there's a previous discussion, but the short version > is that the GCC build process includes a 'fixincludes' step which > installs modified versions of system headers in some path that GCC > uses in preference to /usr/include. Originally this was done to work > around broken system includes in proprietary operating systems that > couldn't easily be fixed upstream. In the case of FreeBSD GCC's > fixincludes actually just installs broken headers, and removing its > broken copies is the easy fix. Worse, the headers in include-fixed don't get updated if you install a new world with updated system headers, so you can get weird compile issues because GCC from ports is using stale copies of headers. It's generally a hack for ancient OS's that isn't relevant on FreeBSD. The issues that fixincludes thinks it finds and needs to fix aren't legitimate issues AFAIK (and if they were we'd want to fix our real headers instead). -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jul 5 15:34:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 931241033D47; Thu, 5 Jul 2018 15:34:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43D1C82CF4; Thu, 5 Jul 2018 15:34:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24DCA1BD47; Thu, 5 Jul 2018 15:34:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65FYG9I012965; Thu, 5 Jul 2018 15:34:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65FYGvl012964; Thu, 5 Jul 2018 15:34:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807051534.w65FYGvl012964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 5 Jul 2018 15:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335985 - head/sys/arm/freescale/vybrid X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/vybrid X-SVN-Commit-Revision: 335985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 15:34:17 -0000 Author: ian Date: Thu Jul 5 15:34:16 2018 New Revision: 335985 URL: https://svnweb.freebsd.org/changeset/base/335985 Log: Remove a test and early-out which just can't possibly be right. It causes detach() to do nothing if attach() succeeded, which is the opposite of what's needed. Also, move device_delete_children() from the end to the beginning of detach(), so that children won't be trying to make use of the hardware we're in the process of shutting down. PR: 229510 Modified: head/sys/arm/freescale/vybrid/vf_ehci.c Modified: head/sys/arm/freescale/vybrid/vf_ehci.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ehci.c Thu Jul 5 15:27:38 2018 (r335984) +++ head/sys/arm/freescale/vybrid/vf_ehci.c Thu Jul 5 15:34:16 2018 (r335985) @@ -390,8 +390,9 @@ vybrid_ehci_detach(device_t dev) esc = device_get_softc(dev); sc = &esc->base; - if (sc->sc_flags & EHCI_SCFLG_DONEINIT) - return (0); + /* First detach all children; we can't detach if that fails. */ + if ((err = device_delete_children(dev)) != 0) + return (err); /* * only call ehci_detach() after ehci_init() @@ -419,14 +420,6 @@ vybrid_ehci_detach(device_t dev) } sc->sc_intr_hdl = NULL; } - - if (sc->sc_bus.bdev) { - device_delete_child(dev, sc->sc_bus.bdev); - sc->sc_bus.bdev = NULL; - } - - /* During module unload there are lots of children leftover */ - device_delete_children(dev); bus_release_resources(dev, vybrid_ehci_spec, esc->res); From owner-svn-src-head@freebsd.org Thu Jul 5 15:38:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4DF01034360; Thu, 5 Jul 2018 15:38:35 +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 31CBC830F7; Thu, 5 Jul 2018 15:38:35 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 D7A5D26032A; Thu, 5 Jul 2018 17:38:33 +0200 (CEST) Subject: Re: svn commit: r335873 - in head: . sys/amd64/amd64 sys/amd64/include sys/conf sys/i386/i386 sys/i386/include sys/sys sys/vm From: Hans Petter Selasky To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807021948.w62JmcV6019378@repo.freebsd.org> <646866ab-1fe1-1866-8777-c4ad852fef7d@selasky.org> Message-ID: <709dc4f7-a207-2123-e3a0-d258c8a60db4@selasky.org> Date: Thu, 5 Jul 2018 17:38:14 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <646866ab-1fe1-1866-8777-c4ad852fef7d@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 15:38:35 -0000 On 07/05/18 15:50, Hans Petter Selasky wrote: > Hi, > > This change breaks all atomic usage in drm-next-kmod even after r335913. > > The problem is simply that SMP is not defined at all for KLD's so all > non-kernel atomic usage is with MPLOCKED empty! > > /* >  * For userland, always use lock prefixes so that the binaries will run >  * on both SMP and !SMP systems. >  */ > #if defined(SMP) || !defined(_KERNEL) > #define MPLOCKED        "lock ; " > #else > #define MPLOCKED > #endif > > > Should the check above be: > #if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) The problem seems more convoluted. There are more checks I wonder if has to be changed. Currently testing this patch: Same applies for i386. > Index: sys/amd64/include/atomic.h > =================================================================== > --- sys/amd64/include/atomic.h (revision 335974) > +++ sys/amd64/include/atomic.h (working copy) > @@ -132,7 +132,7 @@ > * For userland, always use lock prefixes so that the binaries will run > * on both SMP and !SMP systems. > */ > -#if defined(SMP) || !defined(_KERNEL) > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > #define MPLOCKED "lock ; " > #else > #define MPLOCKED > @@ -343,7 +343,7 @@ > * and release. > */ > > -#if defined(_KERNEL) > +#if defined(_KERNEL) || defined(KLD_MODULE) > > /* > * OFFSETOF_MONITORBUF == __pcpu_offset(pc_monitorbuf). > @@ -354,7 +354,7 @@ > */ > #define OFFSETOF_MONITORBUF 0x100 > > -#if defined(SMP) > +#if defined(SMP) || defined(KLD_MODULE) > static __inline void > __storeload_barrier(void) > { --HPS From owner-svn-src-head@freebsd.org Thu Jul 5 15:40:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82DF01034616; Thu, 5 Jul 2018 15:40:15 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3411F832C8; Thu, 5 Jul 2018 15:40:15 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 125461BD5C; Thu, 5 Jul 2018 15:40:15 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65FeEYN013371; Thu, 5 Jul 2018 15:40:14 GMT (envelope-from seanc@FreeBSD.org) Received: (from seanc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65FeEcZ013370; Thu, 5 Jul 2018 15:40:14 GMT (envelope-from seanc@FreeBSD.org) Message-Id: <201807051540.w65FeEcZ013370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: seanc set sender to seanc@FreeBSD.org using -f From: Sean Chittenden Date: Thu, 5 Jul 2018 15:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335987 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: seanc X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 335987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 15:40:15 -0000 Author: seanc (ports committer) Date: Thu Jul 5 15:40:14 2018 New Revision: 335987 URL: https://svnweb.freebsd.org/changeset/base/335987 Log: Update with the members of the 10th core team, core.x. Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Thu Jul 5 15:36:49 2018 (r335986) +++ head/share/misc/organization.dot Thu Jul 5 15:40:14 2018 (r335987) @@ -25,7 +25,7 @@ _misc [label="Miscellaneous Hats"] # Development teams go here alphabetically sorted -core [label="Core Team\ncore@FreeBSD.org\nallanjude, bapt, bcr,\nbenno, emaste, gnn,\nhrs, jhb, kmoore"] +core [label="Core Team\ncore@FreeBSD.org\nallanjude, bcr, brooks,\nimp, hrs, jeff,\njhb, kmoore, seanc"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\nmatthew"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs,\nwblock"] From owner-svn-src-head@freebsd.org Thu Jul 5 15:52:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CE0B103573F; Thu, 5 Jul 2018 15:52:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DEDD83D39; Thu, 5 Jul 2018 15:52:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2006D1C081; Thu, 5 Jul 2018 15:52:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65FqRXX022998; Thu, 5 Jul 2018 15:52:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65FqROS022990; Thu, 5 Jul 2018 15:52:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807051552.w65FqROS022990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 5 Jul 2018 15:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335988 - head/sys/arm/freescale/vybrid X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/vybrid X-SVN-Commit-Revision: 335988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 15:52:27 -0000 Author: ian Date: Thu Jul 5 15:52:26 2018 New Revision: 335988 URL: https://svnweb.freebsd.org/changeset/base/335988 Log: Add a missing call to usb_bus_mem_free_all() when detaching. Modified: head/sys/arm/freescale/vybrid/vf_ehci.c Modified: head/sys/arm/freescale/vybrid/vf_ehci.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ehci.c Thu Jul 5 15:40:14 2018 (r335987) +++ head/sys/arm/freescale/vybrid/vf_ehci.c Thu Jul 5 15:52:26 2018 (r335988) @@ -421,6 +421,8 @@ vybrid_ehci_detach(device_t dev) sc->sc_intr_hdl = NULL; } + usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); + bus_release_resources(dev, vybrid_ehci_spec, esc->res); return (0); From owner-svn-src-head@freebsd.org Thu Jul 5 15:54:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2C411035C16; Thu, 5 Jul 2018 15:54:25 +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 5594D84019; Thu, 5 Jul 2018 15:54:25 +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 w65FsHMg079546 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Jul 2018 18:54:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w65FsHMg079546 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w65FsH1C079545; Thu, 5 Jul 2018 18:54:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 5 Jul 2018 18:54:17 +0300 From: Konstantin Belousov To: John Baldwin Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335916 - head/sys/conf Message-ID: <20180705155417.GI5562@kib.kiev.ua> References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 15:54:26 -0000 On Thu, Jul 05, 2018 at 07:56:22AM -0700, John Baldwin wrote: > On 7/4/18 7:22 AM, Konstantin Belousov wrote: > > On Tue, Jul 03, 2018 at 11:05:42PM +0000, Matt Macy wrote: > >> Author: mmacy > >> Date: Tue Jul 3 23:05:42 2018 > >> New Revision: 335916 > >> URL: https://svnweb.freebsd.org/changeset/base/335916 > >> > >> Log: > >> Enable MODULE_TIED by default for modules compiled with the kernel > > But why ? > > I think we should enable KLD_TIED to inline critical_* etc. for modules > built as part of a kernel that are installed alongside the kernel in /boot/. > I don't think we need to support modules built with kernel A loaded into kernel B. > This is the crusial point. I do not object, but this this is a radical change from the previous mode of modules build. I do not want to put words in other person mouth, but I beliee that the original intent of KLD_TIED/MODULE_TIED was much more limited. Only some specific modules were to be tied. > I think we should not enable it for "standalone" module builds done in ports or via > "cd /sys/modules/foo; make" that install to /boot/modules so that those modules can > work with different kernels. This still permits someone to load a module into kernel > A that they had disabled in kernel A's config file (via NO_MODULES or MODULES_OVERRIDE > or some such) by doing 'cd /sys/modules/foo; make; make load'. > > -- > John Baldwin From owner-svn-src-head@freebsd.org Thu Jul 5 16:00:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9751110376E8; Thu, 5 Jul 2018 16:00:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49E378438D; Thu, 5 Jul 2018 16:00:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B3621C1C1; Thu, 5 Jul 2018 16:00:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65G0x2N024311; Thu, 5 Jul 2018 16:00:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65G0xUr024310; Thu, 5 Jul 2018 16:00:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807051600.w65G0xUr024310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 5 Jul 2018 16:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335989 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 335989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:00:59 -0000 Author: ian Date: Thu Jul 5 16:00:58 2018 New Revision: 335989 URL: https://svnweb.freebsd.org/changeset/base/335989 Log: Detach all children before beginning to tear down the hardware, instead of doing it last. Also, remove the local tracking of whether usb's busdma memory allocation got done, because it's safe to call the free_all function even if it wasn't. Modified: head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Thu Jul 5 15:52:26 2018 (r335988) +++ head/sys/dev/usb/controller/ehci_imx.c Thu Jul 5 16:00:58 2018 (r335989) @@ -268,7 +268,6 @@ struct imx_ehci_softc { device_t dev; struct resource *ehci_mem_res; /* EHCI core regs. */ struct resource *ehci_irq_res; /* EHCI core IRQ. */ - bool usb_mem_allocated; }; static struct ofw_compat_data compat_data[] = { @@ -313,13 +312,16 @@ imx_ehci_detach(device_t dev) { struct imx_ehci_softc *sc; ehci_softc_t *esc; + int err; sc = device_get_softc(dev); esc = &sc->ehci_softc; - if (esc->sc_bus.bdev != NULL) - device_delete_child(dev, esc->sc_bus.bdev); + /* First detach all children; we can't detach if that fails. */ + if ((err = device_delete_children(dev)) != 0) + return (err); + if (esc->sc_flags & EHCI_SCFLG_DONEINIT) ehci_detach(esc); if (esc->sc_intr_hdl != NULL) @@ -332,12 +334,8 @@ imx_ehci_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->ehci_mem_res); - if (sc->usb_mem_allocated) - usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); + usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); - /* During module unload there are lots of children leftover */ - device_delete_children(dev); - return (0); } @@ -415,7 +413,6 @@ imx_ehci_attach(device_t dev) err = ENOMEM; goto out; } - sc->usb_mem_allocated = true; /* * Set handle to USB related registers subregion used by From owner-svn-src-head@freebsd.org Thu Jul 5 16:03:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF74E1037990; Thu, 5 Jul 2018 16:03: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 65B4584781; Thu, 5 Jul 2018 16:03:04 +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 46D831C23E; Thu, 5 Jul 2018 16:03:04 +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 w65G34tY028454; Thu, 5 Jul 2018 16:03:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65G33dB028450; Thu, 5 Jul 2018 16:03:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201807051603.w65G33dB028450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Jul 2018 16:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335990 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Commit-Revision: 335990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:03:05 -0000 Author: brooks Date: Thu Jul 5 16:03:03 2018 New Revision: 335990 URL: https://svnweb.freebsd.org/changeset/base/335990 Log: Revert r335983. The bfd linker in tree doesn't support multiple names for the same symbol (at least with current flags). Deleted: head/lib/libc/sys/compat-stub.c Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Thu Jul 5 16:00:58 2018 (r335989) +++ head/lib/libc/sys/Makefile.inc Thu Jul 5 16:03:03 2018 (r335990) @@ -48,8 +48,6 @@ SRCS+= brk.c SRCS+= pipe.c SRCS+= vadvise.c -SRCS+= compat-stub.c - INTERPOSED = \ accept \ accept4 \ Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Thu Jul 5 16:00:58 2018 (r335989) +++ head/lib/libc/sys/Symbol.map Thu Jul 5 16:03:03 2018 (r335990) @@ -179,6 +179,8 @@ FBSD_1.0 { munlockall; munmap; nanosleep; + netbsd_lchown; + netbsd_msync; nfssvc; nmount; ntp_adjtime; @@ -775,6 +777,10 @@ FBSDprivate_1.0 { __sys_munmap; _nanosleep; __sys_nanosleep; + _netbsd_lchown; + __sys_netbsd_lchown; + _netbsd_msync; + __sys_netbsd_msync; _nfssvc; __sys_nfssvc; _nmount; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Jul 5 16:00:58 2018 (r335989) +++ head/sys/compat/freebsd32/syscalls.master Thu Jul 5 16:03:03 2018 (r335990) @@ -499,10 +499,13 @@ int count); } 273 AUE_NULL UNIMPL nosys 274 AUE_LCHMOD NOPROTO { int lchmod(char *path, mode_t mode); } -275 AUE_NULL OBSOL netbsd_lchown +275 AUE_LCHOWN NOPROTO { int lchown(char *path, uid_t uid, \ + gid_t gid); } netbsd_lchown \ + lchown_args int 276 AUE_LUTIMES STD { int freebsd32_lutimes(char *path, \ struct timeval32 *tptr); } -277 AUE_NULL OBSOL netbsd_msync +277 AUE_MSYNC NOPROTO { int msync(void *addr, size_t len, \ + int flags); } netbsd_msync msync_args int 278 AUE_STAT COMPAT11|NOPROTO { int nstat(char *path, struct nstat *ub); } 279 AUE_FSTAT COMPAT11|NOPROTO { int nfstat(int fd, struct nstat *sb); } 280 AUE_LSTAT COMPAT11|NOPROTO { int nlstat(char *path, struct nstat *ub); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Jul 5 16:00:58 2018 (r335989) +++ head/sys/kern/syscalls.master Thu Jul 5 16:03:03 2018 (r335990) @@ -630,10 +630,13 @@ size_t count); } 273 AUE_NULL UNIMPL nosys 274 AUE_LCHMOD STD { int lchmod(_In_z_ char *path, mode_t mode); } -275 AUE_NULL OBSOL netbsd_lchown +275 AUE_LCHOWN NOPROTO { int lchown(char *path, uid_t uid, \ + gid_t gid); } netbsd_lchown lchown_args \ + int 276 AUE_LUTIMES STD { int lutimes(_In_z_ char *path, \ _In_ struct timeval *tptr); } -277 AUE_NULL OBSOL netbsd_msync +277 AUE_MSYNC NOPROTO { int msync(_In_ void *addr, size_t len, \ + int flags); } netbsd_msync msync_args int 278 AUE_STAT COMPAT11 { int nstat(_In_z_ char *path, \ _Out_ struct nstat *ub); } 279 AUE_FSTAT COMPAT11 { int nfstat(int fd, _Out_ struct nstat *sb); } From owner-svn-src-head@freebsd.org Thu Jul 5 16:10:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37DD6103841F; Thu, 5 Jul 2018 16:10:59 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 DD1A784BE7; Thu, 5 Jul 2018 16:10:58 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.4] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id DE9E3277FB; Thu, 5 Jul 2018 16:10:57 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.e.1.180613 Date: Thu, 05 Jul 2018 09:10:54 -0700 Subject: Re: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat From: Ravi Pokala To: Brooks Davis , , , Message-ID: Thread-Topic: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat References: <201807051313.w65DDnQJ041281@repo.freebsd.org> In-Reply-To: <201807051313.w65DDnQJ041281@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:10:59 -0000 Hi Brooks, -----Original Message----- From: on behalf of Brooks Davis Date: 2018-07-05, Thursday at 06:13 To: , , Subject: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat > Author: brooks > Date: Thu Jul 5 13:13:48 2018 > New Revision: 335979 > URL: https://svnweb.freebsd.org/changeset/base/335979 > > Log: > Make struct xinpcb and friends word-size independent. > > Replace size_t members with ksize_t (uint64_t) and pointer members > (never used as pointers in userspace, but instead as unique > idenitifiers) with kvaddr_t (uint64_t). This makes the structs > identical between 32-bit and 64-bit ABIs. ... > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Thu Jul 5 11:50:59 2018 (r335978) > +++ head/UPDATING Thu Jul 5 13:13:48 2018 (r335979) > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20180705: > + The ABI of syscalls used by management tools like sockstat and > + netstat has been broken to allow 32-bit binaries to work on > + 64-bit kernels without modification. Isn't that what the compat32 layer is for? > These programs will need > + to match the kernel in order to function. External programs may > + require minor modifications to accommodate a change of type in > + structures from pointers to 64-bit virtual addresses. > + Doesn't this contradict the earlier statement about letting things run unmodified? Thanks, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Thu Jul 5 16:16:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFD711038E71; Thu, 5 Jul 2018 16:16:28 +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 9E63485769; Thu, 5 Jul 2018 16:16:28 +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 7F7981C3D9; Thu, 5 Jul 2018 16:16:28 +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 w65GGSGE033863; Thu, 5 Jul 2018 16:16:28 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GGSfk033862; Thu, 5 Jul 2018 16:16:28 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201807051616.w65GGSfk033862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 5 Jul 2018 16:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335993 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:16:29 -0000 Author: bz Date: Thu Jul 5 16:16:28 2018 New Revision: 335993 URL: https://svnweb.freebsd.org/changeset/base/335993 Log: With the introduction of reapers and reaplists in r275800, proc0 and init are setup as a circular dependency. create_init() calls fork1() which calls do_fork(). There the newproc (initproc) is setup with a reaper of proc0 who's reaper points to itself. The newproc (initproc) is then put on its reaper's (proc0) p_reaplist (initproc is a descendants of proc0 for proc0 to reap). Upon return to create_init(), proc0 is added to initproc's p_reaplist (which would mean proc0 is a descendant of init, for init to reap). This creates a circular dependency which eventually leads to LIST corruptions when trying to kill init and a proc0. For the base system we never really hit this case during reboot. The problem only became visible after adding more virtual process spaces which could go away cleanly (work existing in an experimental branch). Reviewed by: kib Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D15924 Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Jul 5 16:15:17 2018 (r335992) +++ head/sys/kern/init_main.c Thu Jul 5 16:16:28 2018 (r335993) @@ -514,6 +514,7 @@ proc0_init(void *dummy __unused) p->p_peers = 0; p->p_leader = p; p->p_reaper = p; + p->p_treeflag |= P_TREE_REAPER; LIST_INIT(&p->p_reaplist); strncpy(p->p_comm, "kernel", sizeof (p->p_comm)); @@ -851,7 +852,6 @@ create_init(const void *udata __unused) PROC_LOCK(initproc); initproc->p_flag |= P_SYSTEM | P_INMEM; initproc->p_treeflag |= P_TREE_REAPER; - LIST_INSERT_HEAD(&initproc->p_reaplist, &proc0, p_reapsibling); oldcred = initproc->p_ucred; crcopy(newcred, oldcred); #ifdef MAC From owner-svn-src-head@freebsd.org Thu Jul 5 16:18:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76C451039A05; Thu, 5 Jul 2018 16:18:06 +0000 (UTC) (envelope-from jsm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB0285A0F; Thu, 5 Jul 2018 16:18:06 +0000 (UTC) (envelope-from jsm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BD371C3DF; Thu, 5 Jul 2018 16:18:06 +0000 (UTC) (envelope-from jsm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65GI51s033980; Thu, 5 Jul 2018 16:18:05 GMT (envelope-from jsm@FreeBSD.org) Received: (from jsm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GI5oX033979; Thu, 5 Jul 2018 16:18:05 GMT (envelope-from jsm@FreeBSD.org) Message-Id: <201807051618.w65GI5oX033979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jsm set sender to jsm@FreeBSD.org using -f From: Jesper Schmitz Mouridsen Date: Thu, 5 Jul 2018 16:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335994 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: jsm X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 335994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:18:06 -0000 Author: jsm (ports committer) Date: Thu Jul 5 16:18:05 2018 New Revision: 335994 URL: https://svnweb.freebsd.org/changeset/base/335994 Log: Add jsm in committers-ports.dot with mentor/mentee Approved by: miwi (mentor) Differential Revision:https://reviews.freebsd.org/D16143 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Jul 5 16:16:28 2018 (r335993) +++ head/share/misc/committers-ports.dot Thu Jul 5 16:18:05 2018 (r335994) @@ -143,6 +143,7 @@ josef [label="Josef El-Rayes\njosef@FreeBSD.org\n2004/ jpaetzel [label="Josh Paetzel\njpaetzel@FreeBSD.org\n2008/09/05"] jrm [label="Joseph R. Mingrone\njrm@FreeBSD.org\n2016/09/17"] jsa [label="Joseph S. Atkinson\njsa@FreeBSD.org\n2010/07/15"] +jsm [label="Jesper Schmitz Mouridsen\njsm@FreeBSD.org\n2018/06/30"] junovitch [label="Jason Unovitch\njunovitch@FreeBSD.org\n2015/07/27"] jylefort [label="Jean-Yves Lefort\njylefort@FreeBSD.org\n2005/04/12"] kami [label="Dominic Fandrey\nkami@FreeBSD.org\n2014/09/09"] @@ -553,6 +554,7 @@ miwi -> farrokhi miwi -> fluffy miwi -> gahr miwi -> joneum +miwi -> jsm miwi -> kmoore miwi -> lme miwi -> makc @@ -658,6 +660,7 @@ swills -> dch swills -> feld swills -> jmd swills -> jrm +swills -> jsm swills -> mfechner swills -> milki swills -> pclin From owner-svn-src-head@freebsd.org Thu Jul 5 16:25:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3145103A58C; Thu, 5 Jul 2018 16:25:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7913386128; Thu, 5 Jul 2018 16:25:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 578571C580; Thu, 5 Jul 2018 16:25:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65GPoWb038981; Thu, 5 Jul 2018 16:25:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GPmg4038972; Thu, 5 Jul 2018 16:25:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807051625.w65GPmg4038972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 5 Jul 2018 16:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335995 - in head: sys/kern sys/sys usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: sys/kern sys/sys usr.sbin/config X-SVN-Commit-Revision: 335995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:25:51 -0000 Author: kevans Date: Thu Jul 5 16:25:48 2018 New Revision: 335995 URL: https://svnweb.freebsd.org/changeset/base/335995 Log: kern_environment: use any provided environments, evict hintmode/envmode At the moment, hintmode and envmode are used to indicate whether static hints or static env have been provided in the kernel config(5) and the static versions are mutually exclusive with loader(8)-provided environment. hintmode *can* be reconfigured later to pull from the dynamic environment, thus taking advantage of the loader(8) or post-kmem environment setting. This changeset fixes both problems at once to move us from a semi-confusing state to a consistent state: if an environment file, hints file, or loader(8) environment are provided, we use them in a well-known order of precedence: - loader(8) environment - static environment - static hints file Once the dynamic environment is setup this becomes a moot point. The loader(8) and static environments are merged (respecting the above order of precedence), and the static hints are merged in on an as-needed basis after the dynamic environment has been setup. Hints lookup are changed to respect all of the above. Before the dynamic environment is setup, lookups use the above-mentioned order and fallback to the next environment if a matching hint is not found. Once the dynamic environment is setup, that is used on its own since it captures all of the above information plus any dynamic kenv settings that came up later in boot. The following tangentially related changes were made to res_find: - A hintp cookie is now passed in so that related searches continue using the chain of environments (or dynamic environment) without relying on global state - All three environments will be searched if they actually have valid hints to use, rather than just choosing the first environment that actually had a hint and rolling with that only The hintmode sysctl has been ripped out. static_{env,hints}.disabled are still honored and will disable their respective environments from being used for hint lookups and from being merged into the dynamic environment, as expected. MFC after: 1 month (maybe) Differential Revision: https://reviews.freebsd.org/D15953 Modified: head/sys/kern/kern_environment.c head/sys/kern/subr_hints.c head/sys/kern/tty.c head/sys/sys/systm.h head/usr.sbin/config/config.5 head/usr.sbin/config/config.h head/usr.sbin/config/config.y head/usr.sbin/config/mkmakefile.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Thu Jul 5 16:18:05 2018 (r335994) +++ head/sys/kern/kern_environment.c Thu Jul 5 16:25:48 2018 (r335995) @@ -57,14 +57,21 @@ __FBSDID("$FreeBSD$"); #include +static char *_getenv_dynamic_locked(const char *name, int *idx); +static char *_getenv_dynamic(const char *name, int *idx); + static MALLOC_DEFINE(M_KENV, "kenv", "kernel environment"); #define KENV_SIZE 512 /* Maximum number of environment strings */ -/* pointer to the static environment */ +/* pointer to the config-generated static environment */ char *kern_envp; -static int env_len; -static int env_pos; + +/* pointer to the md-static environment */ +char *md_envp; +static int md_env_len; +static int md_env_pos; + static char *kernenv_next(char *); /* dynamic environment variables */ @@ -220,16 +227,9 @@ done: * environment obtained from a boot loader, or to provide an empty buffer into * which MD code can store an initial environment using kern_setenv() calls. * - * When a copy of an initial environment is passed in, we start by scanning that - * env for overrides to the compiled-in envmode and hintmode variables. + * kern_envp is set to the static_env generated by config(8). This implements + * the env keyword described in config(5). * - * If the global envmode is 1, the environment is initialized from the global - * static_env[], regardless of the arguments passed. This implements the env - * keyword described in config(5). In this case env_pos is set to env_len, - * causing kern_setenv() to return -1 (if len > 0) or panic (if len == 0) until - * the dynamic environment is available. The envmode and static_env variables - * are defined in env.c which is generated by config(8). - * * If len is non-zero, the caller is providing an empty buffer. The caller will * subsequently use kern_setenv() to add up to len bytes of initial environment * before the dynamic environment is available. @@ -237,68 +237,112 @@ done: * If len is zero, the caller is providing a pre-loaded buffer containing * environment strings. Additional strings cannot be added until the dynamic * environment is available. The memory pointed to must remain stable at least - * until sysinit runs init_dynamic_kenv(). If no initial environment is - * available from the boot loader, passing a NULL pointer allows the static_env - * to be installed if it is configured. + * until sysinit runs init_dynamic_kenv() and preferably until after SI_SUB_KMEM + * is finished so that subr_hints routines may continue to use it until the + * environments have been fully merged at the end of the pass. If no initial + * environment is available from the boot loader, passing a NULL pointer allows + * the static_env to be installed if it is configured. In this case, any call + * to kern_setenv() prior to the setup of the dynamic environment will result in + * a panic. */ void init_static_kenv(char *buf, size_t len) { - char *cp; - - for (cp = buf; cp != NULL && cp[0] != '\0'; cp += strlen(cp) + 1) { - if (strcmp(cp, "static_env.disabled=1") == 0) - envmode = 0; - if (strcmp(cp, "static_hints.disabled=1") == 0) - hintmode = 0; - } + char *eval; - if (envmode == 1) { + md_envp = buf; + md_env_len = len; + md_env_pos = 0; + + /* + * static_env and static_hints may both be disabled, but in slightly + * different ways. For static_env, we just don't setup kern_envp and + * it's as if a static env wasn't even provided. For static_hints, + * we effectively zero out the buffer to stop the rest of the kernel + * from being able to use it. + * + * We're intentionally setting this up so that static_hints.disabled may + * be specified in either the MD env or the static env. This keeps us + * consistent in our new world view. + */ + eval = kern_getenv("static_env.disabled"); + if (eval == NULL || strcmp(eval, "1") != 0) kern_envp = static_env; - env_len = len; - env_pos = len; - } else { - kern_envp = buf; - env_len = len; - env_pos = 0; - } + eval = kern_getenv("static_hints.disabled"); + if (eval != NULL && strcmp(eval, "1") == 0) + *static_hints = '\0'; } -/* - * Setup the dynamic kernel environment. - */ static void -init_dynamic_kenv(void *data __unused) +init_dynamic_kenv_from(char *init_env, int *curpos) { - char *cp, *cpnext; + char *cp, *cpnext, *eqpos, *found; size_t len; int i; - kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, - M_WAITOK | M_ZERO); - i = 0; - if (kern_envp && *kern_envp != '\0') { - for (cp = kern_envp; cp != NULL; cp = cpnext) { + if (init_env && *init_env != '\0') { + found = NULL; + i = *curpos; + for (cp = init_env; cp != NULL; cp = cpnext) { cpnext = kernenv_next(cp); len = strlen(cp) + 1; if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { printf( "WARNING: too long kenv string, ignoring %s\n", cp); - continue; + goto sanitize; } - if (i < KENV_SIZE) { - kenvp[i] = malloc(len, M_KENV, M_WAITOK); - strcpy(kenvp[i++], cp); - explicit_bzero(cp, strlen(cp)); - } else + eqpos = strchr(cp, '='); + if (eqpos == NULL) { printf( + "WARNING: malformed static env value, ignoring %s\n", + cp); + goto sanitize; + } + *eqpos = 0; + /* + * De-dupe the environment as we go. We don't add the + * duplicated assignments because config(8) will flip + * the order of the static environment around to make + * kernel processing match the order of specification + * in the kernel config. + */ + found = _getenv_dynamic_locked(cp, NULL); + *eqpos = '='; + if (found != NULL) + goto sanitize; + if (i > KENV_SIZE) { + printf( "WARNING: too many kenv strings, ignoring %s\n", cp); + goto sanitize; + } + + kenvp[i] = malloc(len, M_KENV, M_WAITOK); + strcpy(kenvp[i++], cp); +sanitize: + explicit_bzero(cp, len - 1); } + *curpos = i; } - kenvp[i] = NULL; +} +/* + * Setup the dynamic kernel environment. + */ +static void +init_dynamic_kenv(void *data __unused) +{ + int dynamic_envpos; + + kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, + M_WAITOK | M_ZERO); + + dynamic_envpos = 0; + init_dynamic_kenv_from(md_envp, &dynamic_envpos); + init_dynamic_kenv_from(kern_envp, &dynamic_envpos); + kenvp[dynamic_envpos] = NULL; + mtx_init(&kenv_lock, "kernel environment", NULL, MTX_DEF); dynamic_kenv = 1; } @@ -318,12 +362,11 @@ freeenv(char *env) * Internal functions for string lookup. */ static char * -_getenv_dynamic(const char *name, int *idx) +_getenv_dynamic_locked(const char *name, int *idx) { char *cp; int len, i; - mtx_assert(&kenv_lock, MA_OWNED); len = strlen(name); for (cp = kenvp[0], i = 0; cp != NULL; cp = kenvp[++i]) { if ((strncmp(cp, name, len) == 0) && @@ -337,12 +380,20 @@ _getenv_dynamic(const char *name, int *idx) } static char * -_getenv_static(const char *name) +_getenv_dynamic(const char *name, int *idx) { + + mtx_assert(&kenv_lock, MA_OWNED); + return (_getenv_dynamic_locked(name, idx)); +} + +static char * +_getenv_static_from(char *chkenv, const char *name) +{ char *cp, *ep; int len; - for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { + for (cp = chkenv; cp != NULL; cp = kernenv_next(cp)) { for (ep = cp; (*ep != '=') && (*ep != 0); ep++) ; if (*ep != '=') @@ -355,6 +406,20 @@ _getenv_static(const char *name) return (NULL); } +static char * +_getenv_static(const char *name) +{ + char *val; + + val = _getenv_static_from(md_envp, name); + if (val != NULL) + return (val); + val = _getenv_static_from(kern_envp, name); + if (val != NULL) + return (val); + return (NULL); +} + /* * Look up an environment variable by name. * Return a pointer to the string if found. @@ -399,20 +464,25 @@ testenv(const char *name) return (0); } +/* + * Set an environment variable in the MD-static environment. This cannot + * feasibly be done on config(8)-generated static environments as they don't + * generally include space for extra variables. + */ static int setenv_static(const char *name, const char *value) { int len; - if (env_pos >= env_len) + if (md_env_pos >= md_env_len) return (-1); /* Check space for x=y and two nuls */ len = strlen(name) + strlen(value); - if (len + 3 < env_len - env_pos) { - len = sprintf(&kern_envp[env_pos], "%s=%s", name, value); - env_pos += len+1; - kern_envp[env_pos] = '\0'; + if (len + 3 < md_env_len - md_env_pos) { + len = sprintf(&md_envp[md_env_pos], "%s=%s", name, value); + md_env_pos += len+1; + md_envp[md_env_pos] = '\0'; return (0); } else return (-1); @@ -428,7 +498,7 @@ kern_setenv(const char *name, const char *value) char *buf, *cp, *oldenv; int namelen, vallen, i; - if (dynamic_kenv == 0 && env_len > 0) + if (dynamic_kenv == 0 && md_env_len > 0) return (setenv_static(name, value)); KENV_CHECK; Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Thu Jul 5 16:18:05 2018 (r335994) +++ head/sys/kern/subr_hints.c Thu Jul 5 16:25:48 2018 (r335995) @@ -31,61 +31,36 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include -#define HINTMODE_KENV 0 -#define HINTMODE_STATIC 1 -#define HINTMODE_FALLBACK 2 +#define FBACK_MDENV 0 /* MD env (e.g. loader.conf) */ +#define FBACK_STENV 1 /* Static env */ +#define FBACK_STATIC 2 /* static_hints */ /* - * Access functions for device resources. + * We'll use hintenv_merged to indicate that the dynamic environment has been + * properly prepared for hint usage. This implies that the dynamic environment + * has already been setup (dynamic_kenv) and that we have added any supplied + * static_hints to the dynamic environment. */ +static int hintenv_merged; -static int checkmethod = 1; -static char *hintp; - /* - * Define kern.hintmode sysctl, which only accept value 2, that cause to - * switch from Static KENV mode to Dynamic KENV. So systems that have hints - * compiled into kernel will be able to see/modify KENV (and hints too). + * Access functions for device resources. */ -static int -sysctl_hintmode(SYSCTL_HANDLER_ARGS) +static void +static_hints_to_env(void *data __unused) { const char *cp; char *line, *eq; - int eqidx, error, i, value; + int eqidx, i; - value = hintmode; - - /* Fetch candidate for new hintmode value */ - error = sysctl_handle_int(oidp, &value, 0, req); - if (error || req->newptr == NULL) - return (error); - - if (value != HINTMODE_FALLBACK) - /* Only accept swithing to hintmode 2 */ - return (EINVAL); - - /* - * The rest of the sysctl handler is just making sure that our - * environment is consistent with the world we've already seen. - * If we came from kenv at all, then we have nothing to do: static - * kenv will get merged into dynamic kenv as soon as kmem becomes - * available, dynamic kenv is the environment we'd be setting these - * things in anyways. Therefore, we have nothing left to do unless - * we came from a static hints configuration. - */ - if (hintmode != HINTMODE_STATIC) { - hintmode = value; - return (0); - } - cp = static_hints; while (cp && *cp != '\0') { eq = strchr(cp, '='); @@ -95,103 +70,152 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) eqidx = eq - cp; i = strlen(cp); - line = malloc(i+1, M_TEMP, M_WAITOK); + line = malloc(i + 1, M_TEMP, M_WAITOK); strcpy(line, cp); - line[eqidx] = '\0'; - kern_setenv(line, line + eqidx + 1); + line[eqidx] = line[i] = '\0'; + /* + * Before adding a hint to the dynamic environment, check if + * another value for said hint has already been added. This is + * needed because static environment overrides static hints and + * dynamic environment overrides all. + */ + if (testenv(line) == 0) + kern_setenv(line, line + eqidx + 1); free(line, M_TEMP); cp += i + 1; } - - hintmode = value; - return (0); + hintenv_merged = 1; } -SYSCTL_PROC(_kern, OID_AUTO, hintmode, CTLTYPE_INT|CTLFLAG_RW, - &hintmode, 0, sysctl_hintmode, "I", "Get/set current hintmode"); +/* Any time after dynamic env is setup */ +SYSINIT(hintenv, SI_SUB_KMEM, SI_ORDER_ANY, static_hints_to_env, NULL); /* + * Checks the environment to see if we even have any hints. If it has no hints, + * then res_find can take the hint that there's no point in searching it and + * either move on to the next environment or fail early. + */ +static bool +_res_checkenv(char *envp) +{ + char *cp; + + cp = envp; + while (cp) { + if (strncmp(cp, "hint.", 5) == 0) + return (true); + while (*cp != '\0') + cp++; + cp++; + if (*cp == '\0') + break; + } + return (false); +} + +/* * Evil wildcarding resource string lookup. * This walks the supplied env string table and returns a match. * The start point can be remembered for incremental searches. */ static int -res_find(int *line, int *startln, +res_find(char **hintp_cookie, int *line, int *startln, const char *name, int *unit, const char *resname, const char *value, const char **ret_name, int *ret_namelen, int *ret_unit, const char **ret_resname, int *ret_resnamelen, const char **ret_value) { - int n = 0, hit, i = 0; + int dyn_used = 0, fbacklvl = FBACK_MDENV, hit, i = 0, n = 0; char r_name[32]; - int r_unit, use_kenv = (hintmode != HINTMODE_STATIC && dynamic_kenv); + int r_unit; char r_resname[32]; char r_value[128]; const char *s, *cp; - char *p; + char *hintp, *p; - if (checkmethod) { - hintp = NULL; - switch (hintmode) { - case HINTMODE_KENV: /* loader hints in environment only */ - break; - case HINTMODE_STATIC: /* static hints only */ - hintp = static_hints; - checkmethod = 0; - break; - case HINTMODE_FALLBACK: /* fallback mode */ - if (dynamic_kenv) { - mtx_lock(&kenv_lock); - cp = kenvp[0]; - for (i = 0; cp != NULL; cp = kenvp[++i]) { - if (!strncmp(cp, "hint.", 5)) { - use_kenv = 1; - checkmethod = 0; - break; - } + /* + * We are expecting that the caller will pass us a hintp_cookie that + * they are tracking. Upon entry, if *hintp_cookie is *not* set, this + * indicates to us that we should be figuring out based on the current + * environment where to search. This keeps us sane throughout the + * entirety of a single search. + */ + if (*hintp_cookie == NULL) { + hintp = NULL; + if (hintenv_merged) { + /* + * static_hints, if it was previously used, has + * already been folded in to the environment + * by this point. + */ + mtx_lock(&kenv_lock); + cp = kenvp[0]; + for (i = 0; cp != NULL; cp = kenvp[++i]) { + if (!strncmp(cp, "hint.", 5)) { + hintp = kenvp[0]; + break; } - mtx_unlock(&kenv_lock); - } else { - cp = kern_envp; - while (cp) { - if (strncmp(cp, "hint.", 5) == 0) { - cp = NULL; - hintp = kern_envp; - break; - } - while (*cp != '\0') - cp++; - cp++; - if (*cp == '\0') { - cp = NULL; - hintp = static_hints; - break; - } - } } - break; - default: - break; - } - if (hintp == NULL) { - if (dynamic_kenv) { - use_kenv = 1; - checkmethod = 0; - } else + mtx_unlock(&kenv_lock); + dyn_used = 1; + } else { + /* + * We'll have a chance to keep coming back here until + * we've actually exhausted all of our possibilities. + * We might have chosen the MD/Static env because it + * had some kind of hints, but perhaps it didn't have + * the hint we are looking for. We don't provide any + * fallback when searching the dynamic environment. + */ +fallback: + if (dyn_used || fbacklvl >= FBACK_STATIC) + return (ENOENT); + + if (fbacklvl <= FBACK_MDENV && + _res_checkenv(md_envp)) { + hintp = md_envp; + goto found; + } + fbacklvl++; + + if (fbacklvl <= FBACK_STENV && + _res_checkenv(kern_envp)) { hintp = kern_envp; + goto found; + } + fbacklvl++; + + /* We'll fallback to static_hints if needed/can */ + if (fbacklvl <= FBACK_STATIC && + _res_checkenv(static_hints)) + hintp = static_hints; +found: + fbacklvl++; } + + if (hintp == NULL) + return (ENOENT); + *hintp_cookie = hintp; + } else { + hintp = *hintp_cookie; + if (hintenv_merged && hintp == kenvp[0]) + dyn_used = 1; + else + /* + * If we aren't using the dynamic environment, we need + * to run through the proper fallback procedure again. + * This is so that we do continuations right if we're + * working with *line and *startln. + */ + goto fallback; } - if (use_kenv) { + if (dyn_used) { mtx_lock(&kenv_lock); i = 0; - cp = kenvp[0]; - if (cp == NULL) { - mtx_unlock(&kenv_lock); - return (ENOENT); - } - } else - cp = hintp; + } + + cp = hintp; while (cp) { hit = 1; (*line)++; @@ -200,25 +224,28 @@ res_find(int *line, int *startln, else n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%127s", r_name, &r_unit, r_resname, r_value); - if (hit && n != 4) { - printf("CONFIG: invalid hint '%s'\n", cp); - p = strchr(cp, 'h'); - *p = 'H'; - hit = 0; + /* We'll circumvent all of the checks if we already know */ + if (hit) { + if (n != 4) { + printf("CONFIG: invalid hint '%s'\n", cp); + p = strchr(cp, 'h'); + *p = 'H'; + hit = 0; + } + if (hit && startln && *startln >= 0 && *line < *startln) + hit = 0; + if (hit && name && strcmp(name, r_name) != 0) + hit = 0; + if (hit && unit && *unit != r_unit) + hit = 0; + if (hit && resname && strcmp(resname, r_resname) != 0) + hit = 0; + if (hit && value && strcmp(value, r_value) != 0) + hit = 0; + if (hit) + break; } - if (hit && startln && *startln >= 0 && *line < *startln) - hit = 0; - if (hit && name && strcmp(name, r_name) != 0) - hit = 0; - if (hit && unit && *unit != r_unit) - hit = 0; - if (hit && resname && strcmp(resname, r_resname) != 0) - hit = 0; - if (hit && value && strcmp(value, r_value) != 0) - hit = 0; - if (hit) - break; - if (use_kenv) { + if (dyn_used) { cp = kenvp[++i]; if (cp == NULL) break; @@ -232,10 +259,10 @@ res_find(int *line, int *startln, } } } - if (use_kenv) + if (dyn_used) mtx_unlock(&kenv_lock); if (cp == NULL) - return ENOENT; + goto fallback; s = cp; /* This is a bit of a hack, but at least is reentrant */ @@ -273,11 +300,13 @@ resource_find(int *line, int *startln, { int i; int un; + char *hintp; *line = 0; + hintp = NULL; /* Search for exact unit matches first */ - i = res_find(line, startln, name, unit, resname, value, + i = res_find(&hintp, line, startln, name, unit, resname, value, ret_name, ret_namelen, ret_unit, ret_resname, ret_resnamelen, ret_value); if (i == 0) @@ -286,7 +315,7 @@ resource_find(int *line, int *startln, return ENOENT; /* If we are still here, search for wildcard matches */ un = -1; - i = res_find(line, startln, name, &un, resname, value, + i = res_find(&hintp, line, startln, name, &un, resname, value, ret_name, ret_namelen, ret_unit, ret_resname, ret_resnamelen, ret_value); if (i == 0) Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Jul 5 16:18:05 2018 (r335994) +++ head/sys/kern/tty.c Thu Jul 5 16:25:48 2018 (r335995) @@ -269,7 +269,7 @@ ttydev_open(struct cdev *dev, int oflags, int devtype struct thread *td) { struct tty *tp; - int error; + int cflags, error; tp = dev->si_drv1; error = 0; @@ -325,7 +325,14 @@ ttydev_open(struct cdev *dev, int oflags, int devtype if (TTY_CALLOUT(tp, dev) || dev == dev_console) tp->t_termios.c_cflag |= CLOCAL; - ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); + cflags = 0; + if (tp->t_termios.c_cflag & CDTR_IFLOW) + cflags |= SER_DTR; + if (tp->t_termios.c_cflag & CRTS_IFLOW) + cflags |= SER_RTS; + + if (cflags != 0) + ttydevsw_modem(tp, cflags, 0); error = ttydevsw_open(tp); if (error != 0) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Thu Jul 5 16:18:05 2018 (r335994) +++ head/sys/sys/systm.h Thu Jul 5 16:25:48 2018 (r335995) @@ -156,11 +156,10 @@ void kassert_panic(const char *fmt, ...) __printflike * XXX most of these variables should be const. */ extern int osreldate; -extern int envmode; -extern int hintmode; /* 0 = off. 1 = config, 2 = fallback */ extern int dynamic_kenv; extern struct mtx kenv_lock; extern char *kern_envp; +extern char *md_envp; extern char static_env[]; extern char static_hints[]; /* by config for now */ Modified: head/usr.sbin/config/config.5 ============================================================================== --- head/usr.sbin/config/config.5 Thu Jul 5 16:18:05 2018 (r335994) +++ head/usr.sbin/config/config.5 Thu Jul 5 16:25:48 2018 (r335995) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 26, 2018 +.Dd July 5, 2018 .Dt CONFIG 5 .Os .Sh NAME @@ -114,13 +114,25 @@ are defined in the file .Pp .It Ic env Ar filename Specifies a filename containing a kernel environment definition. -The kernel normally uses an environment prepared for it at boot time -by +.Pp +The kernel will augment this compiled-in environment with the environment +prepared for it at boot time by .Xr loader 8 . -This directive makes the kernel ignore the boot environment and use -the compiled-in environment instead, unless the boot environment contains -.Va static_env.disabled=1 . +Environment variables specified in the +.Xr loader 8 +environment will take precedence over environment variables specified in +.Ar filename , +and environment variables specified in the dynamic environment take precedence +over both of these. .Pp +.Va static_env.disabled=1 +may be specified in the +.Xr loader 8 +environment to disable use of this compiled-in environment. +This option has no effect if specified in any environment after the +.Xr loader 8 +environment is processed. +.Pp This directive is useful for setting kernel tunables in embedded environments that do not start from .Xr loader 8 . @@ -172,9 +184,28 @@ time (see .Xr device.hints 5 ) . This directive configures the kernel to use the static device configuration listed in -.Ar filename , -unless the boot environment contains -.Va static_hints.disabled=1 . +.Ar filename . +.Pp +Hints provided in this static device configuration will be overwritten in the +order in which they're encountered. +Hints in the compiled-in environment takes precedence over compiled-in hints, +and hints in the environment prepared for the kernel by +.Xr loader 8 +takes precedence over hints in the compiled-in environment. +.Pp +Once the dynamic environment becomes available, all compiled-in hints will be +added to the dynamic environment if they do not already have an override in +the dynamic environment. +The dynamic environment will then be used for all searches of hints. +.Pp +.Va static_hints.disabled=1 +may be specified in either a compiled-in environment or the +.Xr loader 8 +environment to disable use of these hints files. +This option has no effect if specified in any environment after the +.Xr loader 8 +environment is processed. +.Pp The file .Ar filename must conform to the syntax specified by Modified: head/usr.sbin/config/config.h ============================================================================== --- head/usr.sbin/config/config.h Thu Jul 5 16:18:05 2018 (r335994) +++ head/usr.sbin/config/config.h Thu Jul 5 16:25:48 2018 (r335995) @@ -179,8 +179,6 @@ SLIST_HEAD(, includepath) includepath; extern char *ident; extern char kernconfstr[]; extern int do_trace; -extern int envmode; -extern int hintmode; extern int incignore; char *get_word(FILE *); Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Thu Jul 5 16:18:05 2018 (r335994) +++ head/usr.sbin/config/config.y Thu Jul 5 16:25:48 2018 (r335995) @@ -82,8 +82,7 @@ struct device_head dtab; char *ident; -int envmode; -int hintmode; +char *env; int yyline; const char *yyfile; struct file_list_head ftab; @@ -201,7 +200,6 @@ Config_spec: err(EXIT_FAILURE, "calloc"); hint->hint_name = $2; STAILQ_INSERT_HEAD(&hints, hint, hint_next); - hintmode = 1; } System_spec: @@ -361,7 +359,6 @@ newenvvar(char *name, bool is_file) envvar->env_str = name; envvar->env_is_file = is_file; STAILQ_INSERT_HEAD(&envvars, envvar, envvar_next); - envmode = 1; } /* Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Thu Jul 5 16:18:05 2018 (r335994) +++ head/usr.sbin/config/mkmakefile.c Thu Jul 5 16:25:48 2018 (r335995) @@ -197,7 +197,6 @@ makehints(void) fprintf(ofp, "#include \n"); fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); - fprintf(ofp, "int hintmode = %d;\n", hintmode); fprintf(ofp, "char static_hints[] = {\n"); STAILQ_FOREACH(hint, &hints, hint_next) { ifp = fopen(hint->hint_name, "r"); @@ -312,7 +311,6 @@ makeenv(void) fprintf(ofp, "#include \n"); fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); - fprintf(ofp, "int envmode = %d;\n", envmode); fprintf(ofp, "char static_env[] = {\n"); STAILQ_FOREACH(envvar, &envvars, envvar_next) { if (envvar->env_is_file) { From owner-svn-src-head@freebsd.org Thu Jul 5 16:27:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6083103A7D0; Thu, 5 Jul 2018 16:27:35 +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 6B9F186355; Thu, 5 Jul 2018 16:27:35 +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 4D71F1C5A0; Thu, 5 Jul 2018 16:27:35 +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 w65GRZI2039108; Thu, 5 Jul 2018 16:27:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GRZ4q039106; Thu, 5 Jul 2018 16:27:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051627.w65GRZ4q039106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 16:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335996 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 335996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:27:35 -0000 Author: kib Date: Thu Jul 5 16:27:34 2018 New Revision: 335996 URL: https://svnweb.freebsd.org/changeset/base/335996 Log: In x86 pmap_extract_and_hold(), there is no need to recalculate the physical address, which is readily available after sucessfull vm_page_pa_tryrelock(). Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16085 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 5 16:25:48 2018 (r335995) +++ head/sys/amd64/amd64/pmap.c Thu Jul 5 16:27:34 2018 (r335996) @@ -2307,8 +2307,7 @@ retry: if (vm_page_pa_tryrelock(pmap, (pde & PG_PS_FRAME) | (va & PDRMASK), &pa)) goto retry; - m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | - (va & PDRMASK)); + m = PHYS_TO_VM_PAGE(pa); vm_page_hold(m); } } else { @@ -2318,7 +2317,7 @@ retry: if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, &pa)) goto retry; - m = PHYS_TO_VM_PAGE(pte & PG_FRAME); + m = PHYS_TO_VM_PAGE(pa); if (m != NULL) vm_page_hold(m); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jul 5 16:25:48 2018 (r335995) +++ head/sys/i386/i386/pmap.c Thu Jul 5 16:27:34 2018 (r335996) @@ -1672,8 +1672,7 @@ retry: if (vm_page_pa_tryrelock(pmap, (pde & PG_PS_FRAME) | (va & PDRMASK), &pa)) goto retry; - m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | - (va & PDRMASK)); + m = PHYS_TO_VM_PAGE(pa); vm_page_hold(m); } } else { @@ -1683,7 +1682,7 @@ retry: if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, &pa)) goto retry; - m = PHYS_TO_VM_PAGE(pte & PG_FRAME); + m = PHYS_TO_VM_PAGE(pa); if (m != NULL) vm_page_hold(m); } From owner-svn-src-head@freebsd.org Thu Jul 5 16:28:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81C5103AA1D; Thu, 5 Jul 2018 16:28: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 6BA32865FE; Thu, 5 Jul 2018 16:28: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 4C9221C5A8; Thu, 5 Jul 2018 16:28: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 w65GSja5039330; Thu, 5 Jul 2018 16:28:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GShLv039323; Thu, 5 Jul 2018 16:28:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807051628.w65GShLv039323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 5 Jul 2018 16:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335997 - in head: sys/kern sys/sys usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: sys/kern sys/sys usr.sbin/config X-SVN-Commit-Revision: 335997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:28:46 -0000 Author: kevans Date: Thu Jul 5 16:28:43 2018 New Revision: 335997 URL: https://svnweb.freebsd.org/changeset/base/335997 Log: Revert r335995 due to accidental changes snuck in Modified: head/sys/kern/kern_environment.c head/sys/kern/subr_hints.c head/sys/kern/tty.c head/sys/sys/systm.h head/usr.sbin/config/config.5 head/usr.sbin/config/config.h head/usr.sbin/config/config.y head/usr.sbin/config/mkmakefile.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Thu Jul 5 16:27:34 2018 (r335996) +++ head/sys/kern/kern_environment.c Thu Jul 5 16:28:43 2018 (r335997) @@ -57,21 +57,14 @@ __FBSDID("$FreeBSD$"); #include -static char *_getenv_dynamic_locked(const char *name, int *idx); -static char *_getenv_dynamic(const char *name, int *idx); - static MALLOC_DEFINE(M_KENV, "kenv", "kernel environment"); #define KENV_SIZE 512 /* Maximum number of environment strings */ -/* pointer to the config-generated static environment */ +/* pointer to the static environment */ char *kern_envp; - -/* pointer to the md-static environment */ -char *md_envp; -static int md_env_len; -static int md_env_pos; - +static int env_len; +static int env_pos; static char *kernenv_next(char *); /* dynamic environment variables */ @@ -227,9 +220,16 @@ done: * environment obtained from a boot loader, or to provide an empty buffer into * which MD code can store an initial environment using kern_setenv() calls. * - * kern_envp is set to the static_env generated by config(8). This implements - * the env keyword described in config(5). + * When a copy of an initial environment is passed in, we start by scanning that + * env for overrides to the compiled-in envmode and hintmode variables. * + * If the global envmode is 1, the environment is initialized from the global + * static_env[], regardless of the arguments passed. This implements the env + * keyword described in config(5). In this case env_pos is set to env_len, + * causing kern_setenv() to return -1 (if len > 0) or panic (if len == 0) until + * the dynamic environment is available. The envmode and static_env variables + * are defined in env.c which is generated by config(8). + * * If len is non-zero, the caller is providing an empty buffer. The caller will * subsequently use kern_setenv() to add up to len bytes of initial environment * before the dynamic environment is available. @@ -237,112 +237,68 @@ done: * If len is zero, the caller is providing a pre-loaded buffer containing * environment strings. Additional strings cannot be added until the dynamic * environment is available. The memory pointed to must remain stable at least - * until sysinit runs init_dynamic_kenv() and preferably until after SI_SUB_KMEM - * is finished so that subr_hints routines may continue to use it until the - * environments have been fully merged at the end of the pass. If no initial - * environment is available from the boot loader, passing a NULL pointer allows - * the static_env to be installed if it is configured. In this case, any call - * to kern_setenv() prior to the setup of the dynamic environment will result in - * a panic. + * until sysinit runs init_dynamic_kenv(). If no initial environment is + * available from the boot loader, passing a NULL pointer allows the static_env + * to be installed if it is configured. */ void init_static_kenv(char *buf, size_t len) { - char *eval; + char *cp; + + for (cp = buf; cp != NULL && cp[0] != '\0'; cp += strlen(cp) + 1) { + if (strcmp(cp, "static_env.disabled=1") == 0) + envmode = 0; + if (strcmp(cp, "static_hints.disabled=1") == 0) + hintmode = 0; + } - md_envp = buf; - md_env_len = len; - md_env_pos = 0; - - /* - * static_env and static_hints may both be disabled, but in slightly - * different ways. For static_env, we just don't setup kern_envp and - * it's as if a static env wasn't even provided. For static_hints, - * we effectively zero out the buffer to stop the rest of the kernel - * from being able to use it. - * - * We're intentionally setting this up so that static_hints.disabled may - * be specified in either the MD env or the static env. This keeps us - * consistent in our new world view. - */ - eval = kern_getenv("static_env.disabled"); - if (eval == NULL || strcmp(eval, "1") != 0) + if (envmode == 1) { kern_envp = static_env; - eval = kern_getenv("static_hints.disabled"); - if (eval != NULL && strcmp(eval, "1") == 0) - *static_hints = '\0'; + env_len = len; + env_pos = len; + } else { + kern_envp = buf; + env_len = len; + env_pos = 0; + } } +/* + * Setup the dynamic kernel environment. + */ static void -init_dynamic_kenv_from(char *init_env, int *curpos) +init_dynamic_kenv(void *data __unused) { - char *cp, *cpnext, *eqpos, *found; + char *cp, *cpnext; size_t len; int i; - if (init_env && *init_env != '\0') { - found = NULL; - i = *curpos; - for (cp = init_env; cp != NULL; cp = cpnext) { + kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, + M_WAITOK | M_ZERO); + i = 0; + if (kern_envp && *kern_envp != '\0') { + for (cp = kern_envp; cp != NULL; cp = cpnext) { cpnext = kernenv_next(cp); len = strlen(cp) + 1; if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { printf( "WARNING: too long kenv string, ignoring %s\n", cp); - goto sanitize; + continue; } - eqpos = strchr(cp, '='); - if (eqpos == NULL) { + if (i < KENV_SIZE) { + kenvp[i] = malloc(len, M_KENV, M_WAITOK); + strcpy(kenvp[i++], cp); + explicit_bzero(cp, strlen(cp)); + } else printf( - "WARNING: malformed static env value, ignoring %s\n", - cp); - goto sanitize; - } - *eqpos = 0; - /* - * De-dupe the environment as we go. We don't add the - * duplicated assignments because config(8) will flip - * the order of the static environment around to make - * kernel processing match the order of specification - * in the kernel config. - */ - found = _getenv_dynamic_locked(cp, NULL); - *eqpos = '='; - if (found != NULL) - goto sanitize; - if (i > KENV_SIZE) { - printf( "WARNING: too many kenv strings, ignoring %s\n", cp); - goto sanitize; - } - - kenvp[i] = malloc(len, M_KENV, M_WAITOK); - strcpy(kenvp[i++], cp); -sanitize: - explicit_bzero(cp, len - 1); } - *curpos = i; } -} + kenvp[i] = NULL; -/* - * Setup the dynamic kernel environment. - */ -static void -init_dynamic_kenv(void *data __unused) -{ - int dynamic_envpos; - - kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, - M_WAITOK | M_ZERO); - - dynamic_envpos = 0; - init_dynamic_kenv_from(md_envp, &dynamic_envpos); - init_dynamic_kenv_from(kern_envp, &dynamic_envpos); - kenvp[dynamic_envpos] = NULL; - mtx_init(&kenv_lock, "kernel environment", NULL, MTX_DEF); dynamic_kenv = 1; } @@ -362,11 +318,12 @@ freeenv(char *env) * Internal functions for string lookup. */ static char * -_getenv_dynamic_locked(const char *name, int *idx) +_getenv_dynamic(const char *name, int *idx) { char *cp; int len, i; + mtx_assert(&kenv_lock, MA_OWNED); len = strlen(name); for (cp = kenvp[0], i = 0; cp != NULL; cp = kenvp[++i]) { if ((strncmp(cp, name, len) == 0) && @@ -380,20 +337,12 @@ _getenv_dynamic_locked(const char *name, int *idx) } static char * -_getenv_dynamic(const char *name, int *idx) +_getenv_static(const char *name) { - - mtx_assert(&kenv_lock, MA_OWNED); - return (_getenv_dynamic_locked(name, idx)); -} - -static char * -_getenv_static_from(char *chkenv, const char *name) -{ char *cp, *ep; int len; - for (cp = chkenv; cp != NULL; cp = kernenv_next(cp)) { + for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { for (ep = cp; (*ep != '=') && (*ep != 0); ep++) ; if (*ep != '=') @@ -406,20 +355,6 @@ _getenv_static_from(char *chkenv, const char *name) return (NULL); } -static char * -_getenv_static(const char *name) -{ - char *val; - - val = _getenv_static_from(md_envp, name); - if (val != NULL) - return (val); - val = _getenv_static_from(kern_envp, name); - if (val != NULL) - return (val); - return (NULL); -} - /* * Look up an environment variable by name. * Return a pointer to the string if found. @@ -464,25 +399,20 @@ testenv(const char *name) return (0); } -/* - * Set an environment variable in the MD-static environment. This cannot - * feasibly be done on config(8)-generated static environments as they don't - * generally include space for extra variables. - */ static int setenv_static(const char *name, const char *value) { int len; - if (md_env_pos >= md_env_len) + if (env_pos >= env_len) return (-1); /* Check space for x=y and two nuls */ len = strlen(name) + strlen(value); - if (len + 3 < md_env_len - md_env_pos) { - len = sprintf(&md_envp[md_env_pos], "%s=%s", name, value); - md_env_pos += len+1; - md_envp[md_env_pos] = '\0'; + if (len + 3 < env_len - env_pos) { + len = sprintf(&kern_envp[env_pos], "%s=%s", name, value); + env_pos += len+1; + kern_envp[env_pos] = '\0'; return (0); } else return (-1); @@ -498,7 +428,7 @@ kern_setenv(const char *name, const char *value) char *buf, *cp, *oldenv; int namelen, vallen, i; - if (dynamic_kenv == 0 && md_env_len > 0) + if (dynamic_kenv == 0 && env_len > 0) return (setenv_static(name, value)); KENV_CHECK; Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Thu Jul 5 16:27:34 2018 (r335996) +++ head/sys/kern/subr_hints.c Thu Jul 5 16:28:43 2018 (r335997) @@ -31,36 +31,61 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include #include -#define FBACK_MDENV 0 /* MD env (e.g. loader.conf) */ -#define FBACK_STENV 1 /* Static env */ -#define FBACK_STATIC 2 /* static_hints */ +#define HINTMODE_KENV 0 +#define HINTMODE_STATIC 1 +#define HINTMODE_FALLBACK 2 /* - * We'll use hintenv_merged to indicate that the dynamic environment has been - * properly prepared for hint usage. This implies that the dynamic environment - * has already been setup (dynamic_kenv) and that we have added any supplied - * static_hints to the dynamic environment. + * Access functions for device resources. */ -static int hintenv_merged; +static int checkmethod = 1; +static char *hintp; + /* - * Access functions for device resources. + * Define kern.hintmode sysctl, which only accept value 2, that cause to + * switch from Static KENV mode to Dynamic KENV. So systems that have hints + * compiled into kernel will be able to see/modify KENV (and hints too). */ -static void -static_hints_to_env(void *data __unused) +static int +sysctl_hintmode(SYSCTL_HANDLER_ARGS) { const char *cp; char *line, *eq; - int eqidx, i; + int eqidx, error, i, value; + value = hintmode; + + /* Fetch candidate for new hintmode value */ + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || req->newptr == NULL) + return (error); + + if (value != HINTMODE_FALLBACK) + /* Only accept swithing to hintmode 2 */ + return (EINVAL); + + /* + * The rest of the sysctl handler is just making sure that our + * environment is consistent with the world we've already seen. + * If we came from kenv at all, then we have nothing to do: static + * kenv will get merged into dynamic kenv as soon as kmem becomes + * available, dynamic kenv is the environment we'd be setting these + * things in anyways. Therefore, we have nothing left to do unless + * we came from a static hints configuration. + */ + if (hintmode != HINTMODE_STATIC) { + hintmode = value; + return (0); + } + cp = static_hints; while (cp && *cp != '\0') { eq = strchr(cp, '='); @@ -70,152 +95,103 @@ static_hints_to_env(void *data __unused) eqidx = eq - cp; i = strlen(cp); - line = malloc(i + 1, M_TEMP, M_WAITOK); + line = malloc(i+1, M_TEMP, M_WAITOK); strcpy(line, cp); - line[eqidx] = line[i] = '\0'; - /* - * Before adding a hint to the dynamic environment, check if - * another value for said hint has already been added. This is - * needed because static environment overrides static hints and - * dynamic environment overrides all. - */ - if (testenv(line) == 0) - kern_setenv(line, line + eqidx + 1); + line[eqidx] = '\0'; + kern_setenv(line, line + eqidx + 1); free(line, M_TEMP); cp += i + 1; } - hintenv_merged = 1; + + hintmode = value; + return (0); } -/* Any time after dynamic env is setup */ -SYSINIT(hintenv, SI_SUB_KMEM, SI_ORDER_ANY, static_hints_to_env, NULL); +SYSCTL_PROC(_kern, OID_AUTO, hintmode, CTLTYPE_INT|CTLFLAG_RW, + &hintmode, 0, sysctl_hintmode, "I", "Get/set current hintmode"); /* - * Checks the environment to see if we even have any hints. If it has no hints, - * then res_find can take the hint that there's no point in searching it and - * either move on to the next environment or fail early. - */ -static bool -_res_checkenv(char *envp) -{ - char *cp; - - cp = envp; - while (cp) { - if (strncmp(cp, "hint.", 5) == 0) - return (true); - while (*cp != '\0') - cp++; - cp++; - if (*cp == '\0') - break; - } - return (false); -} - -/* * Evil wildcarding resource string lookup. * This walks the supplied env string table and returns a match. * The start point can be remembered for incremental searches. */ static int -res_find(char **hintp_cookie, int *line, int *startln, +res_find(int *line, int *startln, const char *name, int *unit, const char *resname, const char *value, const char **ret_name, int *ret_namelen, int *ret_unit, const char **ret_resname, int *ret_resnamelen, const char **ret_value) { - int dyn_used = 0, fbacklvl = FBACK_MDENV, hit, i = 0, n = 0; + int n = 0, hit, i = 0; char r_name[32]; - int r_unit; + int r_unit, use_kenv = (hintmode != HINTMODE_STATIC && dynamic_kenv); char r_resname[32]; char r_value[128]; const char *s, *cp; - char *hintp, *p; + char *p; - - /* - * We are expecting that the caller will pass us a hintp_cookie that - * they are tracking. Upon entry, if *hintp_cookie is *not* set, this - * indicates to us that we should be figuring out based on the current - * environment where to search. This keeps us sane throughout the - * entirety of a single search. - */ - if (*hintp_cookie == NULL) { + if (checkmethod) { hintp = NULL; - if (hintenv_merged) { - /* - * static_hints, if it was previously used, has - * already been folded in to the environment - * by this point. - */ - mtx_lock(&kenv_lock); - cp = kenvp[0]; - for (i = 0; cp != NULL; cp = kenvp[++i]) { - if (!strncmp(cp, "hint.", 5)) { - hintp = kenvp[0]; - break; + + switch (hintmode) { + case HINTMODE_KENV: /* loader hints in environment only */ + break; + case HINTMODE_STATIC: /* static hints only */ + hintp = static_hints; + checkmethod = 0; + break; + case HINTMODE_FALLBACK: /* fallback mode */ + if (dynamic_kenv) { + mtx_lock(&kenv_lock); + cp = kenvp[0]; + for (i = 0; cp != NULL; cp = kenvp[++i]) { + if (!strncmp(cp, "hint.", 5)) { + use_kenv = 1; + checkmethod = 0; + break; + } } + mtx_unlock(&kenv_lock); + } else { + cp = kern_envp; + while (cp) { + if (strncmp(cp, "hint.", 5) == 0) { + cp = NULL; + hintp = kern_envp; + break; + } + while (*cp != '\0') + cp++; + cp++; + if (*cp == '\0') { + cp = NULL; + hintp = static_hints; + break; + } + } } - mtx_unlock(&kenv_lock); - dyn_used = 1; - } else { - /* - * We'll have a chance to keep coming back here until - * we've actually exhausted all of our possibilities. - * We might have chosen the MD/Static env because it - * had some kind of hints, but perhaps it didn't have - * the hint we are looking for. We don't provide any - * fallback when searching the dynamic environment. - */ -fallback: - if (dyn_used || fbacklvl >= FBACK_STATIC) - return (ENOENT); - - if (fbacklvl <= FBACK_MDENV && - _res_checkenv(md_envp)) { - hintp = md_envp; - goto found; - } - fbacklvl++; - - if (fbacklvl <= FBACK_STENV && - _res_checkenv(kern_envp)) { + break; + default: + break; + } + if (hintp == NULL) { + if (dynamic_kenv) { + use_kenv = 1; + checkmethod = 0; + } else hintp = kern_envp; - goto found; - } - fbacklvl++; - - /* We'll fallback to static_hints if needed/can */ - if (fbacklvl <= FBACK_STATIC && - _res_checkenv(static_hints)) - hintp = static_hints; -found: - fbacklvl++; } - - if (hintp == NULL) - return (ENOENT); - *hintp_cookie = hintp; - } else { - hintp = *hintp_cookie; - if (hintenv_merged && hintp == kenvp[0]) - dyn_used = 1; - else - /* - * If we aren't using the dynamic environment, we need - * to run through the proper fallback procedure again. - * This is so that we do continuations right if we're - * working with *line and *startln. - */ - goto fallback; } - if (dyn_used) { + if (use_kenv) { mtx_lock(&kenv_lock); i = 0; - } - - cp = hintp; + cp = kenvp[0]; + if (cp == NULL) { + mtx_unlock(&kenv_lock); + return (ENOENT); + } + } else + cp = hintp; while (cp) { hit = 1; (*line)++; @@ -224,28 +200,25 @@ found: else n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%127s", r_name, &r_unit, r_resname, r_value); - /* We'll circumvent all of the checks if we already know */ - if (hit) { - if (n != 4) { - printf("CONFIG: invalid hint '%s'\n", cp); - p = strchr(cp, 'h'); - *p = 'H'; - hit = 0; - } - if (hit && startln && *startln >= 0 && *line < *startln) - hit = 0; - if (hit && name && strcmp(name, r_name) != 0) - hit = 0; - if (hit && unit && *unit != r_unit) - hit = 0; - if (hit && resname && strcmp(resname, r_resname) != 0) - hit = 0; - if (hit && value && strcmp(value, r_value) != 0) - hit = 0; - if (hit) - break; + if (hit && n != 4) { + printf("CONFIG: invalid hint '%s'\n", cp); + p = strchr(cp, 'h'); + *p = 'H'; + hit = 0; } - if (dyn_used) { + if (hit && startln && *startln >= 0 && *line < *startln) + hit = 0; + if (hit && name && strcmp(name, r_name) != 0) + hit = 0; + if (hit && unit && *unit != r_unit) + hit = 0; + if (hit && resname && strcmp(resname, r_resname) != 0) + hit = 0; + if (hit && value && strcmp(value, r_value) != 0) + hit = 0; + if (hit) + break; + if (use_kenv) { cp = kenvp[++i]; if (cp == NULL) break; @@ -259,10 +232,10 @@ found: } } } - if (dyn_used) + if (use_kenv) mtx_unlock(&kenv_lock); if (cp == NULL) - goto fallback; + return ENOENT; s = cp; /* This is a bit of a hack, but at least is reentrant */ @@ -300,13 +273,11 @@ resource_find(int *line, int *startln, { int i; int un; - char *hintp; *line = 0; - hintp = NULL; /* Search for exact unit matches first */ - i = res_find(&hintp, line, startln, name, unit, resname, value, + i = res_find(line, startln, name, unit, resname, value, ret_name, ret_namelen, ret_unit, ret_resname, ret_resnamelen, ret_value); if (i == 0) @@ -315,7 +286,7 @@ resource_find(int *line, int *startln, return ENOENT; /* If we are still here, search for wildcard matches */ un = -1; - i = res_find(&hintp, line, startln, name, &un, resname, value, + i = res_find(line, startln, name, &un, resname, value, ret_name, ret_namelen, ret_unit, ret_resname, ret_resnamelen, ret_value); if (i == 0) Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Jul 5 16:27:34 2018 (r335996) +++ head/sys/kern/tty.c Thu Jul 5 16:28:43 2018 (r335997) @@ -269,7 +269,7 @@ ttydev_open(struct cdev *dev, int oflags, int devtype struct thread *td) { struct tty *tp; - int cflags, error; + int error; tp = dev->si_drv1; error = 0; @@ -325,14 +325,7 @@ ttydev_open(struct cdev *dev, int oflags, int devtype if (TTY_CALLOUT(tp, dev) || dev == dev_console) tp->t_termios.c_cflag |= CLOCAL; - cflags = 0; - if (tp->t_termios.c_cflag & CDTR_IFLOW) - cflags |= SER_DTR; - if (tp->t_termios.c_cflag & CRTS_IFLOW) - cflags |= SER_RTS; - - if (cflags != 0) - ttydevsw_modem(tp, cflags, 0); + ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); error = ttydevsw_open(tp); if (error != 0) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Thu Jul 5 16:27:34 2018 (r335996) +++ head/sys/sys/systm.h Thu Jul 5 16:28:43 2018 (r335997) @@ -156,10 +156,11 @@ void kassert_panic(const char *fmt, ...) __printflike * XXX most of these variables should be const. */ extern int osreldate; +extern int envmode; +extern int hintmode; /* 0 = off. 1 = config, 2 = fallback */ extern int dynamic_kenv; extern struct mtx kenv_lock; extern char *kern_envp; -extern char *md_envp; extern char static_env[]; extern char static_hints[]; /* by config for now */ Modified: head/usr.sbin/config/config.5 ============================================================================== --- head/usr.sbin/config/config.5 Thu Jul 5 16:27:34 2018 (r335996) +++ head/usr.sbin/config/config.5 Thu Jul 5 16:28:43 2018 (r335997) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2018 +.Dd June 26, 2018 .Dt CONFIG 5 .Os .Sh NAME @@ -114,25 +114,13 @@ are defined in the file .Pp .It Ic env Ar filename Specifies a filename containing a kernel environment definition. -.Pp -The kernel will augment this compiled-in environment with the environment -prepared for it at boot time by +The kernel normally uses an environment prepared for it at boot time +by .Xr loader 8 . -Environment variables specified in the -.Xr loader 8 -environment will take precedence over environment variables specified in -.Ar filename , -and environment variables specified in the dynamic environment take precedence -over both of these. +This directive makes the kernel ignore the boot environment and use +the compiled-in environment instead, unless the boot environment contains +.Va static_env.disabled=1 . .Pp -.Va static_env.disabled=1 -may be specified in the -.Xr loader 8 -environment to disable use of this compiled-in environment. -This option has no effect if specified in any environment after the -.Xr loader 8 -environment is processed. -.Pp This directive is useful for setting kernel tunables in embedded environments that do not start from .Xr loader 8 . @@ -184,28 +172,9 @@ time (see .Xr device.hints 5 ) . This directive configures the kernel to use the static device configuration listed in -.Ar filename . -.Pp -Hints provided in this static device configuration will be overwritten in the -order in which they're encountered. -Hints in the compiled-in environment takes precedence over compiled-in hints, -and hints in the environment prepared for the kernel by -.Xr loader 8 -takes precedence over hints in the compiled-in environment. -.Pp -Once the dynamic environment becomes available, all compiled-in hints will be -added to the dynamic environment if they do not already have an override in -the dynamic environment. -The dynamic environment will then be used for all searches of hints. -.Pp -.Va static_hints.disabled=1 -may be specified in either a compiled-in environment or the -.Xr loader 8 -environment to disable use of these hints files. -This option has no effect if specified in any environment after the -.Xr loader 8 -environment is processed. -.Pp +.Ar filename , +unless the boot environment contains +.Va static_hints.disabled=1 . The file .Ar filename must conform to the syntax specified by Modified: head/usr.sbin/config/config.h ============================================================================== --- head/usr.sbin/config/config.h Thu Jul 5 16:27:34 2018 (r335996) +++ head/usr.sbin/config/config.h Thu Jul 5 16:28:43 2018 (r335997) @@ -179,6 +179,8 @@ SLIST_HEAD(, includepath) includepath; extern char *ident; extern char kernconfstr[]; extern int do_trace; +extern int envmode; +extern int hintmode; extern int incignore; char *get_word(FILE *); Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Thu Jul 5 16:27:34 2018 (r335996) +++ head/usr.sbin/config/config.y Thu Jul 5 16:28:43 2018 (r335997) @@ -82,7 +82,8 @@ struct device_head dtab; char *ident; -char *env; +int envmode; +int hintmode; int yyline; const char *yyfile; struct file_list_head ftab; @@ -200,6 +201,7 @@ Config_spec: err(EXIT_FAILURE, "calloc"); hint->hint_name = $2; STAILQ_INSERT_HEAD(&hints, hint, hint_next); + hintmode = 1; } System_spec: @@ -359,6 +361,7 @@ newenvvar(char *name, bool is_file) envvar->env_str = name; envvar->env_is_file = is_file; STAILQ_INSERT_HEAD(&envvars, envvar, envvar_next); + envmode = 1; } /* Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Thu Jul 5 16:27:34 2018 (r335996) +++ head/usr.sbin/config/mkmakefile.c Thu Jul 5 16:28:43 2018 (r335997) @@ -197,6 +197,7 @@ makehints(void) fprintf(ofp, "#include \n"); fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); + fprintf(ofp, "int hintmode = %d;\n", hintmode); fprintf(ofp, "char static_hints[] = {\n"); STAILQ_FOREACH(hint, &hints, hint_next) { ifp = fopen(hint->hint_name, "r"); @@ -311,6 +312,7 @@ makeenv(void) fprintf(ofp, "#include \n"); fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); + fprintf(ofp, "int envmode = %d;\n", envmode); fprintf(ofp, "char static_env[] = {\n"); STAILQ_FOREACH(envvar, &envvars, envvar_next) { if (envvar->env_is_file) { From owner-svn-src-head@freebsd.org Thu Jul 5 16:29:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4479A103AB6D for ; Thu, 5 Jul 2018 16:29:28 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-19.consmr.mail.gq1.yahoo.com (sonic313-19.consmr.mail.gq1.yahoo.com [98.137.65.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C34FB86859 for ; Thu, 5 Jul 2018 16:29:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: gDdoXgoVM1mfi6PwrVgsZabaGf9nrvTboQ9Nq1_xZFsIZ0ZudIIsXS9hj4VKsL1 Y9J5dRt3gq.FT2FrG1ZEIDqFuh62vltF6qz9FclZbFGUnFZ8bOHJEq6tg7STXYRMUxMubzhDk3dD YpG4BSeExcO5ltttC5EAGLWB35i3C1YxKGrhjV6.bJitu7dV3ifFLAGn96p4jrorfG.aNle7iBWX do.7yBK.S5s7jdgbBQeGx6UGqELmh8GcBA3Pm3K4ubMZF_bFXSHYGEwolAmGEWeqx91U.1JB1r9P VCD1jsS7YGhj1GeFidT6t1gWnMAa0I10Tin0dxRMfSb6KgvBKaUqsCMcnuGRq09xbKkNt7Ptsicn CGlMm4zyhSQwAP2w1vt81r5g9dqfJYk3Bf77OWR_hD1tc.g7AKiEpQ5zZBl7G8Etm89w_ZOn5kwZ Z5xYHQEHSdGzXTN767pdN4WikMZAuGYrCR3Spm1nelmuLWwYiYAyqrs7mvDKQZLSYuJG5SSePJrN 030YDrJPWonNiK0n4ho2xP0EyxbyGpgBymjWnbDq2tV5QquZupFq1Kd1r.lndMelH_XXrqauHC03 cPY4m3o4XKfW3lJGAiLIdtYtFNUuhJkWX.d7E0DakY8qbw7hL1tCfh5X5kDiEJhQoA0wp8fu0t6q VNxiYn_I1443212AiQv4zfXXYtsze5FVz3pl9DdigL1v4LqeUwh_f0HvdlwpPozOnsL95mgQqYgZ iYDpgInl7Osz1zBXaDBToKK9gX5ZfID5Lxb.mATbnx9XSehJMPcYHph2V4t1b11rjVNebpghGLrq uhbBiPaitb0G.pbWjW9qJ8Qg9RJEo0ZN0jaEAFJ7aKxcE_GwfqCyF9Oi_D7wmFH3OFc.3K4rUqKd CMa2DZBzg3yULb_g1wOwFXQcsCBxGn15i7p3WumWvzTAffbO4n9QUZNqOUk.YKdfRYRcY9U9X0y1 UtjkAjg.IazUx9SJSJdTk8RXieTfT8nQuSUtJaXLiJ2nY8UF.xEVZaks0DfRG4Q-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Thu, 5 Jul 2018 16:29:21 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp405.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5f17871b1ca2f80f18cfa69f0d9e2e7e; Thu, 05 Jul 2018 16:29:17 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335979 - in head: [ Broke the ci.freebsd.org's FreeBSD-head-{mips,powerpc,powerpcspe}-build ] Message-Id: <47E6BC09-8F21-4192-8BC9-E827E14C4A58@yahoo.com> Date: Thu, 5 Jul 2018 09:29:16 -0700 To: brooks@FreeBSD.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:29:28 -0000 These are the gcc 4.2.1 32-bit architectures that are broken. And example is . . . https://ci.freebsd.org/job/FreeBSD-head-mips-build/3186/consoleText = shows: --- all_subdir_usr.bin --- cc1: warnings being treated as errors /usr/src/usr.bin/netstat/inet.c: In function 'sotoxsocket': /usr/src/usr.bin/netstat/inet.c:162: warning: cast from pointer to = integer of different size /usr/src/usr.bin/netstat/inet.c:167: warning: cast from pointer to = integer of different size - =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Thu Jul 5 16:30:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CFF9103AD0F; Thu, 5 Jul 2018 16:30:34 +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 DF43F86913; Thu, 5 Jul 2018 16:30:33 +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 C17571C5AE; Thu, 5 Jul 2018 16:30:33 +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 w65GUX9k039493; Thu, 5 Jul 2018 16:30:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GUW2j039487; Thu, 5 Jul 2018 16:30:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807051630.w65GUW2j039487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 5 Jul 2018 16:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335998 - in head: sys/kern sys/sys usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: sys/kern sys/sys usr.sbin/config X-SVN-Commit-Revision: 335998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:30:34 -0000 Author: kevans Date: Thu Jul 5 16:30:32 2018 New Revision: 335998 URL: https://svnweb.freebsd.org/changeset/base/335998 Log: kern_environment: use any provided environments, evict hintmode/envmode At the moment, hintmode and envmode are used to indicate whether static hints or static env have been provided in the kernel config(5) and the static versions are mutually exclusive with loader(8)-provided environment. hintmode *can* be reconfigured later to pull from the dynamic environment, thus taking advantage of the loader(8) or post-kmem environment setting. This changeset fixes both problems at once to move us from a semi-confusing state to a consistent state: if an environment file, hints file, or loader(8) environment are provided, we use them in a well-known order of precedence: - loader(8) environment - static environment - static hints file Once the dynamic environment is setup this becomes a moot point. The loader(8) and static environments are merged (respecting the above order of precedence), and the static hints are merged in on an as-needed basis after the dynamic environment has been setup. Hints lookup are changed to respect all of the above. Before the dynamic environment is setup, lookups use the above-mentioned order and fallback to the next environment if a matching hint is not found. Once the dynamic environment is setup, that is used on its own since it captures all of the above information plus any dynamic kenv settings that came up later in boot. The following tangentially related changes were made to res_find: - A hintp cookie is now passed in so that related searches continue using the chain of environments (or dynamic environment) without relying on global state - All three environments will be searched if they actually have valid hints to use, rather than just choosing the first environment that actually had a hint and rolling with that only The hintmode sysctl has been ripped out. static_{env,hints}.disabled are still honored and will disable their respective environments from being used for hint lookups and from being merged into the dynamic environment, as expected. MFC after: 1 month (maybe) Differential Revision: https://reviews.freebsd.org/D15953 Modified: head/sys/kern/kern_environment.c head/sys/kern/subr_hints.c head/sys/sys/systm.h head/usr.sbin/config/config.5 head/usr.sbin/config/config.h head/usr.sbin/config/config.y head/usr.sbin/config/mkmakefile.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Thu Jul 5 16:28:43 2018 (r335997) +++ head/sys/kern/kern_environment.c Thu Jul 5 16:30:32 2018 (r335998) @@ -57,14 +57,21 @@ __FBSDID("$FreeBSD$"); #include +static char *_getenv_dynamic_locked(const char *name, int *idx); +static char *_getenv_dynamic(const char *name, int *idx); + static MALLOC_DEFINE(M_KENV, "kenv", "kernel environment"); #define KENV_SIZE 512 /* Maximum number of environment strings */ -/* pointer to the static environment */ +/* pointer to the config-generated static environment */ char *kern_envp; -static int env_len; -static int env_pos; + +/* pointer to the md-static environment */ +char *md_envp; +static int md_env_len; +static int md_env_pos; + static char *kernenv_next(char *); /* dynamic environment variables */ @@ -220,16 +227,9 @@ done: * environment obtained from a boot loader, or to provide an empty buffer into * which MD code can store an initial environment using kern_setenv() calls. * - * When a copy of an initial environment is passed in, we start by scanning that - * env for overrides to the compiled-in envmode and hintmode variables. + * kern_envp is set to the static_env generated by config(8). This implements + * the env keyword described in config(5). * - * If the global envmode is 1, the environment is initialized from the global - * static_env[], regardless of the arguments passed. This implements the env - * keyword described in config(5). In this case env_pos is set to env_len, - * causing kern_setenv() to return -1 (if len > 0) or panic (if len == 0) until - * the dynamic environment is available. The envmode and static_env variables - * are defined in env.c which is generated by config(8). - * * If len is non-zero, the caller is providing an empty buffer. The caller will * subsequently use kern_setenv() to add up to len bytes of initial environment * before the dynamic environment is available. @@ -237,68 +237,112 @@ done: * If len is zero, the caller is providing a pre-loaded buffer containing * environment strings. Additional strings cannot be added until the dynamic * environment is available. The memory pointed to must remain stable at least - * until sysinit runs init_dynamic_kenv(). If no initial environment is - * available from the boot loader, passing a NULL pointer allows the static_env - * to be installed if it is configured. + * until sysinit runs init_dynamic_kenv() and preferably until after SI_SUB_KMEM + * is finished so that subr_hints routines may continue to use it until the + * environments have been fully merged at the end of the pass. If no initial + * environment is available from the boot loader, passing a NULL pointer allows + * the static_env to be installed if it is configured. In this case, any call + * to kern_setenv() prior to the setup of the dynamic environment will result in + * a panic. */ void init_static_kenv(char *buf, size_t len) { - char *cp; - - for (cp = buf; cp != NULL && cp[0] != '\0'; cp += strlen(cp) + 1) { - if (strcmp(cp, "static_env.disabled=1") == 0) - envmode = 0; - if (strcmp(cp, "static_hints.disabled=1") == 0) - hintmode = 0; - } + char *eval; - if (envmode == 1) { + md_envp = buf; + md_env_len = len; + md_env_pos = 0; + + /* + * static_env and static_hints may both be disabled, but in slightly + * different ways. For static_env, we just don't setup kern_envp and + * it's as if a static env wasn't even provided. For static_hints, + * we effectively zero out the buffer to stop the rest of the kernel + * from being able to use it. + * + * We're intentionally setting this up so that static_hints.disabled may + * be specified in either the MD env or the static env. This keeps us + * consistent in our new world view. + */ + eval = kern_getenv("static_env.disabled"); + if (eval == NULL || strcmp(eval, "1") != 0) kern_envp = static_env; - env_len = len; - env_pos = len; - } else { - kern_envp = buf; - env_len = len; - env_pos = 0; - } + eval = kern_getenv("static_hints.disabled"); + if (eval != NULL && strcmp(eval, "1") == 0) + *static_hints = '\0'; } -/* - * Setup the dynamic kernel environment. - */ static void -init_dynamic_kenv(void *data __unused) +init_dynamic_kenv_from(char *init_env, int *curpos) { - char *cp, *cpnext; + char *cp, *cpnext, *eqpos, *found; size_t len; int i; - kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, - M_WAITOK | M_ZERO); - i = 0; - if (kern_envp && *kern_envp != '\0') { - for (cp = kern_envp; cp != NULL; cp = cpnext) { + if (init_env && *init_env != '\0') { + found = NULL; + i = *curpos; + for (cp = init_env; cp != NULL; cp = cpnext) { cpnext = kernenv_next(cp); len = strlen(cp) + 1; if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { printf( "WARNING: too long kenv string, ignoring %s\n", cp); - continue; + goto sanitize; } - if (i < KENV_SIZE) { - kenvp[i] = malloc(len, M_KENV, M_WAITOK); - strcpy(kenvp[i++], cp); - explicit_bzero(cp, strlen(cp)); - } else + eqpos = strchr(cp, '='); + if (eqpos == NULL) { printf( + "WARNING: malformed static env value, ignoring %s\n", + cp); + goto sanitize; + } + *eqpos = 0; + /* + * De-dupe the environment as we go. We don't add the + * duplicated assignments because config(8) will flip + * the order of the static environment around to make + * kernel processing match the order of specification + * in the kernel config. + */ + found = _getenv_dynamic_locked(cp, NULL); + *eqpos = '='; + if (found != NULL) + goto sanitize; + if (i > KENV_SIZE) { + printf( "WARNING: too many kenv strings, ignoring %s\n", cp); + goto sanitize; + } + + kenvp[i] = malloc(len, M_KENV, M_WAITOK); + strcpy(kenvp[i++], cp); +sanitize: + explicit_bzero(cp, len - 1); } + *curpos = i; } - kenvp[i] = NULL; +} +/* + * Setup the dynamic kernel environment. + */ +static void +init_dynamic_kenv(void *data __unused) +{ + int dynamic_envpos; + + kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, + M_WAITOK | M_ZERO); + + dynamic_envpos = 0; + init_dynamic_kenv_from(md_envp, &dynamic_envpos); + init_dynamic_kenv_from(kern_envp, &dynamic_envpos); + kenvp[dynamic_envpos] = NULL; + mtx_init(&kenv_lock, "kernel environment", NULL, MTX_DEF); dynamic_kenv = 1; } @@ -318,12 +362,11 @@ freeenv(char *env) * Internal functions for string lookup. */ static char * -_getenv_dynamic(const char *name, int *idx) +_getenv_dynamic_locked(const char *name, int *idx) { char *cp; int len, i; - mtx_assert(&kenv_lock, MA_OWNED); len = strlen(name); for (cp = kenvp[0], i = 0; cp != NULL; cp = kenvp[++i]) { if ((strncmp(cp, name, len) == 0) && @@ -337,12 +380,20 @@ _getenv_dynamic(const char *name, int *idx) } static char * -_getenv_static(const char *name) +_getenv_dynamic(const char *name, int *idx) { + + mtx_assert(&kenv_lock, MA_OWNED); + return (_getenv_dynamic_locked(name, idx)); +} + +static char * +_getenv_static_from(char *chkenv, const char *name) +{ char *cp, *ep; int len; - for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { + for (cp = chkenv; cp != NULL; cp = kernenv_next(cp)) { for (ep = cp; (*ep != '=') && (*ep != 0); ep++) ; if (*ep != '=') @@ -355,6 +406,20 @@ _getenv_static(const char *name) return (NULL); } +static char * +_getenv_static(const char *name) +{ + char *val; + + val = _getenv_static_from(md_envp, name); + if (val != NULL) + return (val); + val = _getenv_static_from(kern_envp, name); + if (val != NULL) + return (val); + return (NULL); +} + /* * Look up an environment variable by name. * Return a pointer to the string if found. @@ -399,20 +464,25 @@ testenv(const char *name) return (0); } +/* + * Set an environment variable in the MD-static environment. This cannot + * feasibly be done on config(8)-generated static environments as they don't + * generally include space for extra variables. + */ static int setenv_static(const char *name, const char *value) { int len; - if (env_pos >= env_len) + if (md_env_pos >= md_env_len) return (-1); /* Check space for x=y and two nuls */ len = strlen(name) + strlen(value); - if (len + 3 < env_len - env_pos) { - len = sprintf(&kern_envp[env_pos], "%s=%s", name, value); - env_pos += len+1; - kern_envp[env_pos] = '\0'; + if (len + 3 < md_env_len - md_env_pos) { + len = sprintf(&md_envp[md_env_pos], "%s=%s", name, value); + md_env_pos += len+1; + md_envp[md_env_pos] = '\0'; return (0); } else return (-1); @@ -428,7 +498,7 @@ kern_setenv(const char *name, const char *value) char *buf, *cp, *oldenv; int namelen, vallen, i; - if (dynamic_kenv == 0 && env_len > 0) + if (dynamic_kenv == 0 && md_env_len > 0) return (setenv_static(name, value)); KENV_CHECK; Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Thu Jul 5 16:28:43 2018 (r335997) +++ head/sys/kern/subr_hints.c Thu Jul 5 16:30:32 2018 (r335998) @@ -31,61 +31,36 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include -#define HINTMODE_KENV 0 -#define HINTMODE_STATIC 1 -#define HINTMODE_FALLBACK 2 +#define FBACK_MDENV 0 /* MD env (e.g. loader.conf) */ +#define FBACK_STENV 1 /* Static env */ +#define FBACK_STATIC 2 /* static_hints */ /* - * Access functions for device resources. + * We'll use hintenv_merged to indicate that the dynamic environment has been + * properly prepared for hint usage. This implies that the dynamic environment + * has already been setup (dynamic_kenv) and that we have added any supplied + * static_hints to the dynamic environment. */ +static int hintenv_merged; -static int checkmethod = 1; -static char *hintp; - /* - * Define kern.hintmode sysctl, which only accept value 2, that cause to - * switch from Static KENV mode to Dynamic KENV. So systems that have hints - * compiled into kernel will be able to see/modify KENV (and hints too). + * Access functions for device resources. */ -static int -sysctl_hintmode(SYSCTL_HANDLER_ARGS) +static void +static_hints_to_env(void *data __unused) { const char *cp; char *line, *eq; - int eqidx, error, i, value; + int eqidx, i; - value = hintmode; - - /* Fetch candidate for new hintmode value */ - error = sysctl_handle_int(oidp, &value, 0, req); - if (error || req->newptr == NULL) - return (error); - - if (value != HINTMODE_FALLBACK) - /* Only accept swithing to hintmode 2 */ - return (EINVAL); - - /* - * The rest of the sysctl handler is just making sure that our - * environment is consistent with the world we've already seen. - * If we came from kenv at all, then we have nothing to do: static - * kenv will get merged into dynamic kenv as soon as kmem becomes - * available, dynamic kenv is the environment we'd be setting these - * things in anyways. Therefore, we have nothing left to do unless - * we came from a static hints configuration. - */ - if (hintmode != HINTMODE_STATIC) { - hintmode = value; - return (0); - } - cp = static_hints; while (cp && *cp != '\0') { eq = strchr(cp, '='); @@ -95,103 +70,152 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) eqidx = eq - cp; i = strlen(cp); - line = malloc(i+1, M_TEMP, M_WAITOK); + line = malloc(i + 1, M_TEMP, M_WAITOK); strcpy(line, cp); - line[eqidx] = '\0'; - kern_setenv(line, line + eqidx + 1); + line[eqidx] = line[i] = '\0'; + /* + * Before adding a hint to the dynamic environment, check if + * another value for said hint has already been added. This is + * needed because static environment overrides static hints and + * dynamic environment overrides all. + */ + if (testenv(line) == 0) + kern_setenv(line, line + eqidx + 1); free(line, M_TEMP); cp += i + 1; } - - hintmode = value; - return (0); + hintenv_merged = 1; } -SYSCTL_PROC(_kern, OID_AUTO, hintmode, CTLTYPE_INT|CTLFLAG_RW, - &hintmode, 0, sysctl_hintmode, "I", "Get/set current hintmode"); +/* Any time after dynamic env is setup */ +SYSINIT(hintenv, SI_SUB_KMEM, SI_ORDER_ANY, static_hints_to_env, NULL); /* + * Checks the environment to see if we even have any hints. If it has no hints, + * then res_find can take the hint that there's no point in searching it and + * either move on to the next environment or fail early. + */ +static bool +_res_checkenv(char *envp) +{ + char *cp; + + cp = envp; + while (cp) { + if (strncmp(cp, "hint.", 5) == 0) + return (true); + while (*cp != '\0') + cp++; + cp++; + if (*cp == '\0') + break; + } + return (false); +} + +/* * Evil wildcarding resource string lookup. * This walks the supplied env string table and returns a match. * The start point can be remembered for incremental searches. */ static int -res_find(int *line, int *startln, +res_find(char **hintp_cookie, int *line, int *startln, const char *name, int *unit, const char *resname, const char *value, const char **ret_name, int *ret_namelen, int *ret_unit, const char **ret_resname, int *ret_resnamelen, const char **ret_value) { - int n = 0, hit, i = 0; + int dyn_used = 0, fbacklvl = FBACK_MDENV, hit, i = 0, n = 0; char r_name[32]; - int r_unit, use_kenv = (hintmode != HINTMODE_STATIC && dynamic_kenv); + int r_unit; char r_resname[32]; char r_value[128]; const char *s, *cp; - char *p; + char *hintp, *p; - if (checkmethod) { - hintp = NULL; - switch (hintmode) { - case HINTMODE_KENV: /* loader hints in environment only */ - break; - case HINTMODE_STATIC: /* static hints only */ - hintp = static_hints; - checkmethod = 0; - break; - case HINTMODE_FALLBACK: /* fallback mode */ - if (dynamic_kenv) { - mtx_lock(&kenv_lock); - cp = kenvp[0]; - for (i = 0; cp != NULL; cp = kenvp[++i]) { - if (!strncmp(cp, "hint.", 5)) { - use_kenv = 1; - checkmethod = 0; - break; - } + /* + * We are expecting that the caller will pass us a hintp_cookie that + * they are tracking. Upon entry, if *hintp_cookie is *not* set, this + * indicates to us that we should be figuring out based on the current + * environment where to search. This keeps us sane throughout the + * entirety of a single search. + */ + if (*hintp_cookie == NULL) { + hintp = NULL; + if (hintenv_merged) { + /* + * static_hints, if it was previously used, has + * already been folded in to the environment + * by this point. + */ + mtx_lock(&kenv_lock); + cp = kenvp[0]; + for (i = 0; cp != NULL; cp = kenvp[++i]) { + if (!strncmp(cp, "hint.", 5)) { + hintp = kenvp[0]; + break; } - mtx_unlock(&kenv_lock); - } else { - cp = kern_envp; - while (cp) { - if (strncmp(cp, "hint.", 5) == 0) { - cp = NULL; - hintp = kern_envp; - break; - } - while (*cp != '\0') - cp++; - cp++; - if (*cp == '\0') { - cp = NULL; - hintp = static_hints; - break; - } - } } - break; - default: - break; - } - if (hintp == NULL) { - if (dynamic_kenv) { - use_kenv = 1; - checkmethod = 0; - } else + mtx_unlock(&kenv_lock); + dyn_used = 1; + } else { + /* + * We'll have a chance to keep coming back here until + * we've actually exhausted all of our possibilities. + * We might have chosen the MD/Static env because it + * had some kind of hints, but perhaps it didn't have + * the hint we are looking for. We don't provide any + * fallback when searching the dynamic environment. + */ +fallback: + if (dyn_used || fbacklvl >= FBACK_STATIC) + return (ENOENT); + + if (fbacklvl <= FBACK_MDENV && + _res_checkenv(md_envp)) { + hintp = md_envp; + goto found; + } + fbacklvl++; + + if (fbacklvl <= FBACK_STENV && + _res_checkenv(kern_envp)) { hintp = kern_envp; + goto found; + } + fbacklvl++; + + /* We'll fallback to static_hints if needed/can */ + if (fbacklvl <= FBACK_STATIC && + _res_checkenv(static_hints)) + hintp = static_hints; +found: + fbacklvl++; } + + if (hintp == NULL) + return (ENOENT); + *hintp_cookie = hintp; + } else { + hintp = *hintp_cookie; + if (hintenv_merged && hintp == kenvp[0]) + dyn_used = 1; + else + /* + * If we aren't using the dynamic environment, we need + * to run through the proper fallback procedure again. + * This is so that we do continuations right if we're + * working with *line and *startln. + */ + goto fallback; } - if (use_kenv) { + if (dyn_used) { mtx_lock(&kenv_lock); i = 0; - cp = kenvp[0]; - if (cp == NULL) { - mtx_unlock(&kenv_lock); - return (ENOENT); - } - } else - cp = hintp; + } + + cp = hintp; while (cp) { hit = 1; (*line)++; @@ -200,25 +224,28 @@ res_find(int *line, int *startln, else n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%127s", r_name, &r_unit, r_resname, r_value); - if (hit && n != 4) { - printf("CONFIG: invalid hint '%s'\n", cp); - p = strchr(cp, 'h'); - *p = 'H'; - hit = 0; + /* We'll circumvent all of the checks if we already know */ + if (hit) { + if (n != 4) { + printf("CONFIG: invalid hint '%s'\n", cp); + p = strchr(cp, 'h'); + *p = 'H'; + hit = 0; + } + if (hit && startln && *startln >= 0 && *line < *startln) + hit = 0; + if (hit && name && strcmp(name, r_name) != 0) + hit = 0; + if (hit && unit && *unit != r_unit) + hit = 0; + if (hit && resname && strcmp(resname, r_resname) != 0) + hit = 0; + if (hit && value && strcmp(value, r_value) != 0) + hit = 0; + if (hit) + break; } - if (hit && startln && *startln >= 0 && *line < *startln) - hit = 0; - if (hit && name && strcmp(name, r_name) != 0) - hit = 0; - if (hit && unit && *unit != r_unit) - hit = 0; - if (hit && resname && strcmp(resname, r_resname) != 0) - hit = 0; - if (hit && value && strcmp(value, r_value) != 0) - hit = 0; - if (hit) - break; - if (use_kenv) { + if (dyn_used) { cp = kenvp[++i]; if (cp == NULL) break; @@ -232,10 +259,10 @@ res_find(int *line, int *startln, } } } - if (use_kenv) + if (dyn_used) mtx_unlock(&kenv_lock); if (cp == NULL) - return ENOENT; + goto fallback; s = cp; /* This is a bit of a hack, but at least is reentrant */ @@ -273,11 +300,13 @@ resource_find(int *line, int *startln, { int i; int un; + char *hintp; *line = 0; + hintp = NULL; /* Search for exact unit matches first */ - i = res_find(line, startln, name, unit, resname, value, + i = res_find(&hintp, line, startln, name, unit, resname, value, ret_name, ret_namelen, ret_unit, ret_resname, ret_resnamelen, ret_value); if (i == 0) @@ -286,7 +315,7 @@ resource_find(int *line, int *startln, return ENOENT; /* If we are still here, search for wildcard matches */ un = -1; - i = res_find(line, startln, name, &un, resname, value, + i = res_find(&hintp, line, startln, name, &un, resname, value, ret_name, ret_namelen, ret_unit, ret_resname, ret_resnamelen, ret_value); if (i == 0) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Thu Jul 5 16:28:43 2018 (r335997) +++ head/sys/sys/systm.h Thu Jul 5 16:30:32 2018 (r335998) @@ -156,11 +156,10 @@ void kassert_panic(const char *fmt, ...) __printflike * XXX most of these variables should be const. */ extern int osreldate; -extern int envmode; -extern int hintmode; /* 0 = off. 1 = config, 2 = fallback */ extern int dynamic_kenv; extern struct mtx kenv_lock; extern char *kern_envp; +extern char *md_envp; extern char static_env[]; extern char static_hints[]; /* by config for now */ Modified: head/usr.sbin/config/config.5 ============================================================================== --- head/usr.sbin/config/config.5 Thu Jul 5 16:28:43 2018 (r335997) +++ head/usr.sbin/config/config.5 Thu Jul 5 16:30:32 2018 (r335998) @@ -114,13 +114,25 @@ are defined in the file .Pp .It Ic env Ar filename Specifies a filename containing a kernel environment definition. -The kernel normally uses an environment prepared for it at boot time -by +.Pp +The kernel will augment this compiled-in environment with the environment +prepared for it at boot time by .Xr loader 8 . -This directive makes the kernel ignore the boot environment and use -the compiled-in environment instead, unless the boot environment contains -.Va static_env.disabled=1 . +Environment variables specified in the +.Xr loader 8 +environment will take precedence over environment variables specified in +.Ar filename , +and environment variables specified in the dynamic environment take precedence +over both of these. .Pp +.Va static_env.disabled=1 +may be specified in the +.Xr loader 8 +environment to disable use of this compiled-in environment. +This option has no effect if specified in any environment after the +.Xr loader 8 +environment is processed. +.Pp This directive is useful for setting kernel tunables in embedded environments that do not start from .Xr loader 8 . @@ -172,9 +184,28 @@ time (see .Xr device.hints 5 ) . This directive configures the kernel to use the static device configuration listed in -.Ar filename , -unless the boot environment contains -.Va static_hints.disabled=1 . +.Ar filename . +.Pp +Hints provided in this static device configuration will be overwritten in the +order in which they're encountered. +Hints in the compiled-in environment takes precedence over compiled-in hints, +and hints in the environment prepared for the kernel by +.Xr loader 8 +takes precedence over hints in the compiled-in environment. +.Pp +Once the dynamic environment becomes available, all compiled-in hints will be +added to the dynamic environment if they do not already have an override in +the dynamic environment. +The dynamic environment will then be used for all searches of hints. +.Pp +.Va static_hints.disabled=1 +may be specified in either a compiled-in environment or the +.Xr loader 8 +environment to disable use of these hints files. +This option has no effect if specified in any environment after the +.Xr loader 8 +environment is processed. +.Pp The file .Ar filename must conform to the syntax specified by Modified: head/usr.sbin/config/config.h ============================================================================== --- head/usr.sbin/config/config.h Thu Jul 5 16:28:43 2018 (r335997) +++ head/usr.sbin/config/config.h Thu Jul 5 16:30:32 2018 (r335998) @@ -179,8 +179,6 @@ SLIST_HEAD(, includepath) includepath; extern char *ident; extern char kernconfstr[]; extern int do_trace; -extern int envmode; -extern int hintmode; extern int incignore; char *get_word(FILE *); Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Thu Jul 5 16:28:43 2018 (r335997) +++ head/usr.sbin/config/config.y Thu Jul 5 16:30:32 2018 (r335998) @@ -82,8 +82,7 @@ struct device_head dtab; char *ident; -int envmode; -int hintmode; +char *env; int yyline; const char *yyfile; struct file_list_head ftab; @@ -201,7 +200,6 @@ Config_spec: err(EXIT_FAILURE, "calloc"); hint->hint_name = $2; STAILQ_INSERT_HEAD(&hints, hint, hint_next); - hintmode = 1; } System_spec: @@ -361,7 +359,6 @@ newenvvar(char *name, bool is_file) envvar->env_str = name; envvar->env_is_file = is_file; STAILQ_INSERT_HEAD(&envvars, envvar, envvar_next); - envmode = 1; } /* Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Thu Jul 5 16:28:43 2018 (r335997) +++ head/usr.sbin/config/mkmakefile.c Thu Jul 5 16:30:32 2018 (r335998) @@ -197,7 +197,6 @@ makehints(void) fprintf(ofp, "#include \n"); fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); - fprintf(ofp, "int hintmode = %d;\n", hintmode); fprintf(ofp, "char static_hints[] = {\n"); STAILQ_FOREACH(hint, &hints, hint_next) { ifp = fopen(hint->hint_name, "r"); @@ -312,7 +311,6 @@ makeenv(void) fprintf(ofp, "#include \n"); fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); - fprintf(ofp, "int envmode = %d;\n", envmode); fprintf(ofp, "char static_env[] = {\n"); STAILQ_FOREACH(envvar, &envvars, envvar_next) { if (envvar->env_is_file) { From owner-svn-src-head@freebsd.org Thu Jul 5 16:33:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AAD3103B29D; Thu, 5 Jul 2018 16:33:45 +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 C453F86E6A; Thu, 5 Jul 2018 16:33:44 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 898AF5A9F17; Thu, 5 Jul 2018 16:33:38 +0000 (UTC) Date: Thu, 5 Jul 2018 16:33:38 +0000 From: Brooks Davis To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat Message-ID: <20180705163338.GA67089@spindle.one-eyed-alien.net> References: <201807051313.w65DDnQJ041281@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:33:45 -0000 --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 05, 2018 at 09:10:54AM -0700, Ravi Pokala wrote: > Hi Brooks, >=20 > -----Original Message----- > From: on behalf of Brooks Davis > Date: 2018-07-05, Thursday at 06:13 > To: , , > Subject: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet= sys/sys usr.bin/netstat usr.bin/sockstat >=20 > > Author: brooks > > Date: Thu Jul 5 13:13:48 2018 > > New Revision: 335979 > > URL: https://svnweb.freebsd.org/changeset/base/335979 > >=20 > > Log: > > Make struct xinpcb and friends word-size independent. > > =20 > > Replace size_t members with ksize_t (uint64_t) and pointer members > > (never used as pointers in userspace, but instead as unique > > idenitifiers) with kvaddr_t (uint64_t). This makes the structs > > identical between 32-bit and 64-bit ABIs. > ... > > Modified: head/UPDATING > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/UPDATING Thu Jul 5 11:50:59 2018 (r335978) > > +++ head/UPDATING Thu Jul 5 13:13:48 2018 (r335979) > > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > > disable the most expensive debugging functionality run > > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > =20 > > +20180705: > > + The ABI of syscalls used by management tools like sockstat and > > + netstat has been broken to allow 32-bit binaries to work on > > + 64-bit kernels without modification. >=20 > Isn't that what the compat32 layer is for? compat32 isn't magic. If one tried, one could hardly design structures to make 32-bit compat harder then the previous versions. It's certainly possible to make work, but quite annoying. Since the ABI of most these structures was already broken for 12, I chose this approach as it is quite trivial. > > These programs will need > > + to match the kernel in order to function. External programs may > > + require minor modifications to accommodate a change of type in > > + structures from pointers to 64-bit virtual addresses. >=20 > Doesn't this contradict the earlier statement about letting things run un= modified? Unmodified post this commit. We already don't support netstat and sockstat from 11 on 12 in any architecture combination. -- Brooks --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbPkhhAAoJEKzQXbSebgfAo18H/AlCg0VMBICtPMoLdwCn73Cc agUY15e/YUZbW9opHKUkdvr/xXz9vQVHGfHC2rXGhha1HJ3mhFizp2E6LR0GBMzc JOwDkukmEfFIDnn9UPCgYyd7b75GHcZ5kX5qgmLYTZ3U+ODxqlFkkWSa/c55VGqO Ie3xz9q4pfGDGPhB3eUaIj/bR682DmmhgzJNcdado7wGOISu/dvUfWbF/R8OmixQ dXJGe1G33KaEgtAsTCVD9Vk6xHgsjLhVr7juhbaEDZwpXEz6QEEjJpVn9PQUP4xQ B+NTAoVzQ+38758WX7NRQBEFXoUlDWnCCgLGxrA3igypOT6/mTSgeFstmBmtk1A= =qcVb -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2-- From owner-svn-src-head@freebsd.org Thu Jul 5 16:38:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13212103B928; Thu, 5 Jul 2018 16:38:56 +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 B6D83871DF; Thu, 5 Jul 2018 16:38:55 +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 956FE1C77C; Thu, 5 Jul 2018 16:38:55 +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 w65Gctgp044635; Thu, 5 Jul 2018 16:38:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GctbL044633; Thu, 5 Jul 2018 16:38:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051638.w65GctbL044633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 16:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335999 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 335999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:38:56 -0000 Author: kib Date: Thu Jul 5 16:38:54 2018 New Revision: 335999 URL: https://svnweb.freebsd.org/changeset/base/335999 Log: In x86 pmap_extract_and_hold(), there is no need to recalculate the physical address, which is readily available after sucessfull vm_page_pa_tryrelock(). Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16085 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 5 16:30:32 2018 (r335998) +++ head/sys/amd64/amd64/pmap.c Thu Jul 5 16:38:54 2018 (r335999) @@ -2308,7 +2308,6 @@ retry: PG_PS_FRAME) | (va & PDRMASK), &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); - vm_page_hold(m); } } else { pte = *pmap_pde_to_pte(pdep, va); @@ -2318,10 +2317,10 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); - if (m != NULL) - vm_page_hold(m); } } + if (m != NULL) + vm_page_hold(m); } PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jul 5 16:30:32 2018 (r335998) +++ head/sys/i386/i386/pmap.c Thu Jul 5 16:38:54 2018 (r335999) @@ -1673,7 +1673,6 @@ retry: PG_PS_FRAME) | (va & PDRMASK), &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); - vm_page_hold(m); } } else { pte = pmap_pte_ufast(pmap, va, pde); @@ -1683,10 +1682,10 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); - if (m != NULL) - vm_page_hold(m); } } + if (m != NULL) + vm_page_hold(m); } PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); From owner-svn-src-head@freebsd.org Thu Jul 5 16:40:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528FD103BBAB; Thu, 5 Jul 2018 16:40:21 +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 04BE6873EE; Thu, 5 Jul 2018 16:40:21 +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 D9F6B1C793; Thu, 5 Jul 2018 16:40:20 +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 w65GeKer044764; Thu, 5 Jul 2018 16:40:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GeKP3044763; Thu, 5 Jul 2018 16:40:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051640.w65GeKP3044763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 16:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336000 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 336000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:40:21 -0000 Author: kib Date: Thu Jul 5 16:40:20 2018 New Revision: 336000 URL: https://svnweb.freebsd.org/changeset/base/336000 Log: Use vm_page_unhold_pages() instead of manually rolling unoptimized version of it. Noted by: alc Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/copyout.c Modified: head/sys/i386/i386/copyout.c ============================================================================== --- head/sys/i386/i386/copyout.c Thu Jul 5 16:38:54 2018 (r335999) +++ head/sys/i386/i386/copyout.c Thu Jul 5 16:40:20 2018 (r336000) @@ -140,11 +140,7 @@ cp_slow0(vm_offset_t uva, size_t len, bool write, sx_xunlock(&pc->pc_copyout_slock); else mtx_unlock(&pc->pc_copyout_mlock); - for (i = 0; i < plen; i++) { - vm_page_lock(m[i]); - vm_page_unhold(m[i]); - vm_page_unlock(m[i]); - } + vm_page_unhold_pages(m, plen); return (error); } From owner-svn-src-head@freebsd.org Thu Jul 5 16:43:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0357103C124; Thu, 5 Jul 2018 16:43: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 58F76882BA; Thu, 5 Jul 2018 16:43:16 +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 3A5741C92B; Thu, 5 Jul 2018 16:43:16 +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 w65GhGRt049660; Thu, 5 Jul 2018 16:43:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65GhGFQ049659; Thu, 5 Jul 2018 16:43:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051643.w65GhGFQ049659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 16:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336001 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 336001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:43:17 -0000 Author: kib Date: Thu Jul 5 16:43:15 2018 New Revision: 336001 URL: https://svnweb.freebsd.org/changeset/base/336001 Log: Copyout(9) on 4/4 i386 needs correct vm_page_array[]. On the 4/4 i386, copyout(9) may need to call pmap_extract_and_hold() on arbitrary userspace mapping. If the mapping is backed by the non-managed cdev pager or by the sg pager, on dense configs we might access arbitrary element of vm_page_array[], in particular, not corresponding to a page from the memory segment. Initialize such pages as fictitious with the corresponding physical address. Reported by: bde Reviewed by: alc, markj (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D16085 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jul 5 16:40:20 2018 (r336000) +++ head/sys/vm/vm_page.c Thu Jul 5 16:43:15 2018 (r336001) @@ -551,6 +551,9 @@ vm_page_startup(vm_offset_t vaddr) vm_paddr_t biggestsize, last_pa, pa; u_long pagecount; int biggestone, i, segind; +#if defined(__i386__) && defined(VM_PHYSSEG_DENSE) + long ii; +#endif biggestsize = 0; biggestone = 0; @@ -789,6 +792,13 @@ vm_page_startup(vm_offset_t vaddr) * Initialize the page structures and add every available page to the * physical memory allocator's free lists. */ +#if defined(__i386__) && defined(VM_PHYSSEG_DENSE) + for (ii = 0; ii < vm_page_array_size; ii++) { + m = &vm_page_array[ii]; + vm_page_init_page(m, (first_page + ii) << PAGE_SHIFT, 0); + m->flags = PG_FICTITIOUS; + } +#endif vm_cnt.v_page_count = 0; for (segind = 0; segind < vm_phys_nsegs; segind++) { seg = &vm_phys_segs[segind]; From owner-svn-src-head@freebsd.org Thu Jul 5 16:50:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4235103CB58 for ; Thu, 5 Jul 2018 16:50:26 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F48E8889F for ; Thu, 5 Jul 2018 16:50:26 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw0-x232.google.com with SMTP id c135-v6so3194035ywa.0 for ; Thu, 05 Jul 2018 09:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QD7rRZVKDQxDGPAj7aoVtV0Jww17S6QJHzlfBCyt/c0=; b=HWpCj8zVot4A+TjS0VvSMIEh/UMOlt7E8i2uZ1RsdYEX6Ti7QCODdrClxqjcGsxkMg uoKSK5xHaWoS1zZKggtx6RPlALMc+UnIAxHRPEQAor+v4ijfQ9al8GW/omFULzX/fsYs 8gdobAa0r5wjxeMv2r1HsxqB/+Sq+ams+pKtlaHSpVMM+a1mgLcmchZ7pYQqWRSs7TaF +aP3mp9sW69ynlJFlmTWS96atJlkftrM9ZpY1zG4iLIcxLCqHLB6EmtWrZa0M+M+PAc6 HQ6Feyb45/7j/fTla5x0YmsRv9QWPab9IoF6aQIn6XfaULm0AObKcm7Yrmo5JcGqLMO6 4YZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QD7rRZVKDQxDGPAj7aoVtV0Jww17S6QJHzlfBCyt/c0=; b=k2MniSIpCLxPYd/pgGo8SrE0TDnKvhLavOU40b2a7jFVZeeDUqV9hDI8JzTLCrcYi0 YA/K7eCzSJUZK0F0Am89/xocyJvR6fcF2p32DZ3aKfaK4wkfezzeumvsFKES3hhT33nP d4VMHjsj0nDHURT5fp+GwGm/2DrzqRGMUxQAzbk810aVMUtHWOy1p+uEvoi1J5tU3oSp a0UV3yjuNcgqJ7IthRjOz9XasNLBDlqv1ZrND1kTnL3pLmr4PP0pzDy1DVA1X0NF285n 5jijGkNjmdgHGArCCY44U76wPzCChSj11EhPl+Zn8REFETjWcQk7XyAF1c/+Q0Md7Uwk GM5g== X-Gm-Message-State: APt69E1Dyn/uKSjMKv1tIBCIXqCzpV/K136T4ohETiI/Hz9xSGullWAy VeGnaMJzZzEaoS0R5dUuoTXpQpRlyn6IDxHqYXlVKQ== X-Google-Smtp-Source: AAOMgpfY1enY7w7VZK/1jVWd8EG0nyNgE74RGf7kP1po/vZncVaPl3rA6FOgPbEbrUcSN+7ngN1qML9H8oGEpNym6S0= X-Received: by 2002:a81:93c6:: with SMTP id k189-v6mr2463783ywg.41.1530809425629; Thu, 05 Jul 2018 09:50:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:b90:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 09:50:25 -0700 (PDT) In-Reply-To: <201807051638.w65GctbL044633@repo.freebsd.org> References: <201807051638.w65GctbL044633@repo.freebsd.org> From: Oliver Pinter Date: Thu, 5 Jul 2018 18:50:25 +0200 Message-ID: Subject: Re: svn commit: r335999 - in head/sys: amd64/amd64 i386/i386 To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 16:50:27 -0000 On Thursday, July 5, 2018, Konstantin Belousov wrote: > Author: kib > Date: Thu Jul 5 16:38:54 2018 > New Revision: 335999 > URL: https://svnweb.freebsd.org/changeset/base/335999 > > Log: > In x86 pmap_extract_and_hold(), there is no need to recalculate the > physical address, which is readily available after sucessfull > vm_page_pa_tryrelock(). Hi! Wrong commit message. > > Noted and reviewed by: alc > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D16085 > > Modified: > head/sys/amd64/amd64/pmap.c > head/sys/i386/i386/pmap.c > > Modified: head/sys/amd64/amd64/pmap.c > ============================================================ > ================== > --- head/sys/amd64/amd64/pmap.c Thu Jul 5 16:30:32 2018 (r335998) > +++ head/sys/amd64/amd64/pmap.c Thu Jul 5 16:38:54 2018 (r335999) > @@ -2308,7 +2308,6 @@ retry: > PG_PS_FRAME) | (va & PDRMASK), &pa)) > goto retry; > m = PHYS_TO_VM_PAGE(pa); > - vm_page_hold(m); > } > } else { > pte = *pmap_pde_to_pte(pdep, va); > @@ -2318,10 +2317,10 @@ retry: > &pa)) > goto retry; > m = PHYS_TO_VM_PAGE(pa); > - if (m != NULL) > - vm_page_hold(m); > } > } > + if (m != NULL) > + vm_page_hold(m); > } > PA_UNLOCK_COND(pa); > PMAP_UNLOCK(pmap); > > Modified: head/sys/i386/i386/pmap.c > ============================================================ > ================== > --- head/sys/i386/i386/pmap.c Thu Jul 5 16:30:32 2018 (r335998) > +++ head/sys/i386/i386/pmap.c Thu Jul 5 16:38:54 2018 (r335999) > @@ -1673,7 +1673,6 @@ retry: > PG_PS_FRAME) | (va & PDRMASK), &pa)) > goto retry; > m = PHYS_TO_VM_PAGE(pa); > - vm_page_hold(m); > } > } else { > pte = pmap_pte_ufast(pmap, va, pde); > @@ -1683,10 +1682,10 @@ retry: > &pa)) > goto retry; > m = PHYS_TO_VM_PAGE(pa); > - if (m != NULL) > - vm_page_hold(m); > } > } > + if (m != NULL) > + vm_page_hold(m); > } > PA_UNLOCK_COND(pa); > PMAP_UNLOCK(pmap); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Thu Jul 5 17:02:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC00D103DC48; Thu, 5 Jul 2018 17:02:11 +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 99FCF894D2; Thu, 5 Jul 2018 17:02:11 +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 7BF741CC66; Thu, 5 Jul 2018 17:02:11 +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 w65H2BvI058834; Thu, 5 Jul 2018 17:02:11 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65H2AXB058831; Thu, 5 Jul 2018 17:02:10 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201807051702.w65H2AXB058831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Jul 2018 17:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336002 - in head: usr.bin/netstat usr.sbin/tcpdrop X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: usr.bin/netstat usr.sbin/tcpdrop X-SVN-Commit-Revision: 336002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:02:12 -0000 Author: brooks Date: Thu Jul 5 17:02:10 2018 New Revision: 336002 URL: https://svnweb.freebsd.org/changeset/base/336002 Log: Work around lame warnings in ancient gcc on 32-bit platforms. Fixes r335979. Modified: head/usr.bin/netstat/inet.c head/usr.bin/netstat/unix.c head/usr.sbin/tcpdrop/tcpdrop.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Thu Jul 5 16:43:15 2018 (r336001) +++ head/usr.bin/netstat/inet.c Thu Jul 5 17:02:10 2018 (r336002) @@ -159,12 +159,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso) bzero(xso, sizeof *xso); xso->xso_len = sizeof *xso; - xso->xso_so = (kvaddr_t)so; + xso->xso_so = (kvaddr_t)(long)so; xso->so_type = so->so_type; xso->so_options = so->so_options; xso->so_linger = so->so_linger; xso->so_state = so->so_state; - xso->so_pcb = (kvaddr_t)so->so_pcb; + xso->so_pcb = (kvaddr_t)(long)so->so_pcb; if (kread((uintptr_t)so->so_proto, &proto, sizeof(proto)) != 0) return (-1); xso->xso_protocol = proto.pr_protocol; Modified: head/usr.bin/netstat/unix.c ============================================================================== --- head/usr.bin/netstat/unix.c Thu Jul 5 16:43:15 2018 (r336001) +++ head/usr.bin/netstat/unix.c Thu Jul 5 17:02:10 2018 (r336002) @@ -153,7 +153,7 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, u_lon xu.xu_len = sizeof xu; KREAD(head_off, &head, sizeof(head)); LIST_FOREACH(unp, &head, unp_link) { - xu.xu_unpp = (kvaddr_t)unp; + xu.xu_unpp = (kvaddr_t)(long)unp; KREAD(unp, &unp0, sizeof (*unp)); unp = &unp0; Modified: head/usr.sbin/tcpdrop/tcpdrop.c ============================================================================== --- head/usr.sbin/tcpdrop/tcpdrop.c Thu Jul 5 16:43:15 2018 (r336001) +++ head/usr.sbin/tcpdrop/tcpdrop.c Thu Jul 5 17:02:10 2018 (r336002) @@ -235,7 +235,7 @@ tcpdropall(const char *stack, int state) head = getxpcblist("net.inet.tcp.pcblist"); #define XINP_NEXT(xinp) \ - ((struct xinpgen *)((uintptr_t)(xinp) + (xinp)->xig_len)) + ((struct xinpgen *)(long)((uintptr_t)(xinp) + (xinp)->xig_len)) for (xinp = XINP_NEXT(head); xinp->xig_len > sizeof *xinp; xinp = XINP_NEXT(xinp)) { From owner-svn-src-head@freebsd.org Thu Jul 5 17:06:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A4B2103E3DE; Thu, 5 Jul 2018 17:06:55 +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 F38D1899C5; Thu, 5 Jul 2018 17:06: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 D16971CCAD; Thu, 5 Jul 2018 17:06: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 w65H6sl9059989; Thu, 5 Jul 2018 17:06:54 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65H6sVP059988; Thu, 5 Jul 2018 17:06:54 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201807051706.w65H6sVP059988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 5 Jul 2018 17:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336003 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 336003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:06:55 -0000 Author: bz Date: Thu Jul 5 17:06:54 2018 New Revision: 336003 URL: https://svnweb.freebsd.org/changeset/base/336003 Log: Split up deadlkres() to make it more readable in anticipation of further changes adding another level of indentation. Some of the logic got simplified with the break out functions. There should be no functional changes. Reviewed by: kib Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D15914 Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Thu Jul 5 17:02:10 2018 (r336002) +++ head/sys/kern/kern_clock.c Thu Jul 5 17:06:54 2018 (r336003) @@ -185,12 +185,70 @@ static int blktime_threshold = 900; static int sleepfreq = 3; static void +deadlres_td_on_lock(struct proc *p, struct thread *td, int blkticks) +{ + int tticks; + + sx_assert(&allproc_lock, SX_LOCKED); + PROC_LOCK_ASSERT(p, MA_OWNED); + THREAD_LOCK_ASSERT(td, MA_OWNED); + /* + * The thread should be blocked on a turnstile, simply check + * if the turnstile channel is in good state. + */ + MPASS(td->td_blocked != NULL); + + tticks = ticks - td->td_blktick; + if (tticks > blkticks) + /* + * Accordingly with provided thresholds, this thread is stuck + * for too long on a turnstile. + */ + panic("%s: possible deadlock detected for %p, " + "blocked for %d ticks\n", __func__, td, tticks); +} + +static void +deadlres_td_sleep_q(struct proc *p, struct thread *td, int slpticks) +{ + void *wchan; + int i, slptype, tticks; + + sx_assert(&allproc_lock, SX_LOCKED); + PROC_LOCK_ASSERT(p, MA_OWNED); + THREAD_LOCK_ASSERT(td, MA_OWNED); + /* + * Check if the thread is sleeping on a lock, otherwise skip the check. + * Drop the thread lock in order to avoid a LOR with the sleepqueue + * spinlock. + */ + wchan = td->td_wchan; + tticks = ticks - td->td_slptick; + slptype = sleepq_type(wchan); + if ((slptype == SLEEPQ_SX || slptype == SLEEPQ_LK) && + tticks > slpticks) { + + /* + * Accordingly with provided thresholds, this thread is stuck + * for too long on a sleepqueue. + * However, being on a sleepqueue, we might still check for the + * blessed list. + */ + for (i = 0; blessed[i] != NULL; i++) + if (!strcmp(blessed[i], td->td_wmesg)) + return; + + panic("%s: possible deadlock detected for %p, " + "blocked for %d ticks\n", __func__, td, tticks); + } +} + +static void deadlkres(void) { struct proc *p; struct thread *td; - void *wchan; - int blkticks, i, slpticks, slptype, tryl, tticks; + int blkticks, slpticks, tryl; tryl = 0; for (;;) { @@ -198,14 +256,15 @@ deadlkres(void) slpticks = slptime_threshold * hz; /* - * Avoid to sleep on the sx_lock in order to avoid a possible - * priority inversion problem leading to starvation. + * Avoid to sleep on the sx_lock in order to avoid a + * possible priority inversion problem leading to + * starvation. * If the lock can't be held after 100 tries, panic. */ if (!sx_try_slock(&allproc_lock)) { if (tryl > 100) - panic("%s: possible deadlock detected on allproc_lock\n", - __func__); + panic("%s: possible deadlock detected " + "on allproc_lock\n", __func__); tryl++; pause("allproc", sleepfreq * hz); continue; @@ -218,80 +277,15 @@ deadlkres(void) continue; } FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - if (TD_ON_LOCK(td)) { - - /* - * The thread should be blocked on a - * turnstile, simply check if the - * turnstile channel is in good state. - */ - MPASS(td->td_blocked != NULL); - - tticks = ticks - td->td_blktick; - thread_unlock(td); - if (tticks > blkticks) { - - /* - * Accordingly with provided - * thresholds, this thread is - * stuck for too long on a - * turnstile. - */ - PROC_UNLOCK(p); - sx_sunlock(&allproc_lock); - panic("%s: possible deadlock detected for %p, blocked for %d ticks\n", - __func__, td, tticks); - } - } else if (TD_IS_SLEEPING(td) && - TD_ON_SLEEPQ(td)) { - - /* - * Check if the thread is sleeping on a - * lock, otherwise skip the check. - * Drop the thread lock in order to - * avoid a LOR with the sleepqueue - * spinlock. - */ - wchan = td->td_wchan; - tticks = ticks - td->td_slptick; - thread_unlock(td); - slptype = sleepq_type(wchan); - if ((slptype == SLEEPQ_SX || - slptype == SLEEPQ_LK) && - tticks > slpticks) { - - /* - * Accordingly with provided - * thresholds, this thread is - * stuck for too long on a - * sleepqueue. - * However, being on a - * sleepqueue, we might still - * check for the blessed - * list. - */ - tryl = 0; - for (i = 0; blessed[i] != NULL; - i++) { - if (!strcmp(blessed[i], - td->td_wmesg)) { - tryl = 1; - break; - } - } - if (tryl != 0) { - tryl = 0; - continue; - } - PROC_UNLOCK(p); - sx_sunlock(&allproc_lock); - panic("%s: possible deadlock detected for %p, blocked for %d ticks\n", - __func__, td, tticks); - } - } else - thread_unlock(td); + if (TD_ON_LOCK(td)) + deadlres_td_on_lock(p, td, + blkticks); + else if (TD_IS_SLEEPING(td) && + TD_ON_SLEEPQ(td)) + deadlres_td_sleep_q(p, td, + slpticks); + thread_unlock(td); } PROC_UNLOCK(p); } From owner-svn-src-head@freebsd.org Thu Jul 5 17:07:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03DFD103E45F; Thu, 5 Jul 2018 17:07:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAB8F89ADD; Thu, 5 Jul 2018 17:07:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BACE1CCB3; Thu, 5 Jul 2018 17:07:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65H7OVo060063; Thu, 5 Jul 2018 17:07:24 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65H7N9p060058; Thu, 5 Jul 2018 17:07:23 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807051707.w65H7N9p060058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 5 Jul 2018 17:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336004 - in head/sys: conf mips/conf riscv/conf X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys: conf mips/conf riscv/conf X-SVN-Commit-Revision: 336004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:07:25 -0000 Author: sbruno Date: Thu Jul 5 17:07:23 2018 New Revision: 336004 URL: https://svnweb.freebsd.org/changeset/base/336004 Log: Make ZSTD a real option via ZSTDIO. It looks like the intent was to allow ZSTD support to be compiled into the kernel with options ZSTDIO. But it doesn't look like that was ever implemented or I'm missing how to do it. I did a cursory audit of kernel config files and made a decision to enable ZSTDIO in riscv GENERIC and mips MALTA configurations. All other kernel configurations already had this option in their kernel configs but they didn't do anything useful as the feature was declared as "standard" prior to this. Reviewed by: cem allanjude Differential Revision: https://reviews.freebsd.org/D16007 Modified: head/sys/conf/files head/sys/conf/files.mips head/sys/conf/files.riscv head/sys/mips/conf/std.MALTA head/sys/riscv/conf/GENERIC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jul 5 17:06:54 2018 (r336003) +++ head/sys/conf/files Thu Jul 5 17:07:23 2018 (r336004) @@ -635,22 +635,22 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional nga contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" # Zstd -contrib/zstd/lib/freebsd/zstd_kmalloc.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/common/zstd_common.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/common/fse_decompress.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/common/entropy_common.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/common/error_private.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/common/xxhash.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/compress/zstd_compress.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/compress/fse_compress.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/compress/huf_compress.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/compress/zstd_double_fast.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/compress/zstd_fast.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/compress/zstd_lazy.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/compress/zstd_ldm.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/compress/zstd_opt.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/decompress/zstd_decompress.c standard compile-with ${ZSTD_C} -contrib/zstd/lib/decompress/huf_decompress.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/freebsd/zstd_kmalloc.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/zstd_common.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/fse_decompress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/entropy_common.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/error_private.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/xxhash.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/fse_compress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/huf_compress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_double_fast.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_fast.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_lazy.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_ldm.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_opt.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/zstd_decompress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/huf_decompress.c optional zstdio compile-with ${ZSTD_C} # Blake 2 contrib/libb2/blake2b-ref.c optional crypto | ipsec | ipsec_support \ compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Jul 5 17:06:54 2018 (r336003) +++ head/sys/conf/files.mips Thu Jul 5 17:07:23 2018 (r336004) @@ -113,4 +113,4 @@ cddl/dev/dtrace/mips/dtrace_subr.c optional dtrace c cddl/dev/fbt/mips/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" # Zstd -contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/freebsd/zstd_kfreebsd.c optional zstdio compile-with ${ZSTD_C} Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Thu Jul 5 17:06:54 2018 (r336003) +++ head/sys/conf/files.riscv Thu Jul 5 17:07:23 2018 (r336004) @@ -63,4 +63,4 @@ riscv/riscv/unwind.c optional ddb | kdtrace_hooks | s riscv/riscv/vm_machdep.c standard # Zstd -contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/freebsd/zstd_kfreebsd.c optional zstdio compile-with ${ZSTD_C} Modified: head/sys/mips/conf/std.MALTA ============================================================================== --- head/sys/mips/conf/std.MALTA Thu Jul 5 17:06:54 2018 (r336003) +++ head/sys/mips/conf/std.MALTA Thu Jul 5 17:07:23 2018 (r336004) @@ -45,6 +45,9 @@ options INVARIANT_SUPPORT #Extra sanity checks of int #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +# Kernel dump features. +options ZSTDIO # zstd-compressed kernel and user dumps + device loop device ether device le Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Thu Jul 5 17:06:54 2018 (r336003) +++ head/sys/riscv/conf/GENERIC Thu Jul 5 17:07:23 2018 (r336004) @@ -116,6 +116,9 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) # options EARLY_PRINTF # options VERBOSE_SYSINIT +# Kernel dump features. +options ZSTDIO # zstd-compressed kernel and user dumps + # Pseudo devices. device loop # Network loopback device random # Entropy device From owner-svn-src-head@freebsd.org Thu Jul 5 17:09:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCC1C103E7F3; Thu, 5 Jul 2018 17:09:47 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6996B89D8A; Thu, 5 Jul 2018 17:09:47 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A9E91CCBB; Thu, 5 Jul 2018 17:09:47 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65H9lxf060196; Thu, 5 Jul 2018 17:09:47 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65H9lCe060195; Thu, 5 Jul 2018 17:09:47 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807051709.w65H9lCe060195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 5 Jul 2018 17:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336005 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 336005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:09:48 -0000 Author: sbruno Date: Thu Jul 5 17:09:46 2018 New Revision: 336005 URL: https://svnweb.freebsd.org/changeset/base/336005 Log: Remove redundant AH_DEBUG_ALQ. Modified: head/sys/mips/conf/std.AR_MIPS_BASE Modified: head/sys/mips/conf/std.AR_MIPS_BASE ============================================================================== --- head/sys/mips/conf/std.AR_MIPS_BASE Thu Jul 5 17:07:23 2018 (r336004) +++ head/sys/mips/conf/std.AR_MIPS_BASE Thu Jul 5 17:09:46 2018 (r336005) @@ -55,7 +55,6 @@ options ATH_ENABLE_DFS options AH_DEBUG_ALQ options AH_DEBUG -options AH_DEBUG_ALQ options AH_SUPPORT_AR5416 options AH_AR5416_INTERRUPT_MITIGATION options AH_RXCFG_SDMAMW_4BYTES From owner-svn-src-head@freebsd.org Thu Jul 5 17:11:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2A06103EBD3; Thu, 5 Jul 2018 17:11:55 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A450B8A0BB; Thu, 5 Jul 2018 17:11:55 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 866811CE19; Thu, 5 Jul 2018 17:11:55 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65HBtlP064772; Thu, 5 Jul 2018 17:11:55 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65HBtdq064771; Thu, 5 Jul 2018 17:11:55 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807051711.w65HBtdq064771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 5 Jul 2018 17:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336006 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 336006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:11:56 -0000 Author: sbruno Date: Thu Jul 5 17:11:55 2018 New Revision: 336006 URL: https://svnweb.freebsd.org/changeset/base/336006 Log: Remove redundant device ar71xx_wdog which is now included from std.AR_MIPS_BASE Modified: head/sys/mips/conf/AR71XX_BASE Modified: head/sys/mips/conf/AR71XX_BASE ============================================================================== --- head/sys/mips/conf/AR71XX_BASE Thu Jul 5 17:09:46 2018 (r336005) +++ head/sys/mips/conf/AR71XX_BASE Thu Jul 5 17:11:55 2018 (r336006) @@ -63,6 +63,5 @@ device scbus device umass device da -device ar71xx_wdog device uart_ar71xx device ar71xx_apb From owner-svn-src-head@freebsd.org Thu Jul 5 17:13:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54A4D103EE61; Thu, 5 Jul 2018 17:13:42 +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 061038A497; Thu, 5 Jul 2018 17:13:42 +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 C34521CE50; Thu, 5 Jul 2018 17:13:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65HDf8u064897; Thu, 5 Jul 2018 17:13:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65HDbrO064877; Thu, 5 Jul 2018 17:13:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201807051713.w65HDbrO064877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 5 Jul 2018 17:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336007 - in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/mips/mips sys/mips/nlm sys/netinet sys/netpfil/ipfw sys/powerpc/powerpc sys/sys sys/vm sys/x86/xen X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/mips/mips sys/mips/nlm sys/netinet sys/netpfil/ipfw sys/powerpc/powerpc sys/sys sys/vm sys/x86/xen X-SVN-Commit-Revision: 336007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:13:42 -0000 Author: andrew Date: Thu Jul 5 17:13:37 2018 New Revision: 336007 URL: https://svnweb.freebsd.org/changeset/base/336007 Log: Create a new macro for static DPCPU data. On arm64 (and possible other architectures) we are unable to use static DPCPU data in kernel modules. This is because the compiler will generate PC-relative accesses, however the runtime-linker expects to be able to relocate these. In preparation to fix this create two macros depending on if the data is global or static. Reviewed by: bz, emaste, markj Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D16140 Modified: head/share/man/man9/dpcpu.9 head/sys/compat/linuxkpi/common/src/linux_idr.c head/sys/compat/linuxkpi/common/src/linux_rcu.c head/sys/compat/linuxkpi/common/src/linux_tasklet.c head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/kern/kern_exec.c head/sys/kern/kern_tc.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_pcpu.c head/sys/mips/mips/tick.c head/sys/mips/nlm/tick.c head/sys/netinet/siftr.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/powerpc/powerpc/clock.c head/sys/sys/pcpu.h head/sys/vm/vm_page.c head/sys/x86/xen/xen_intr.c Modified: head/share/man/man9/dpcpu.9 ============================================================================== --- head/share/man/man9/dpcpu.9 Thu Jul 5 17:11:55 2018 (r336006) +++ head/share/man/man9/dpcpu.9 Thu Jul 5 17:13:37 2018 (r336007) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 26, 2017 +.Dd July 5, 2018 .Dt DPCPU 9 .Os .Sh NAME @@ -35,6 +35,7 @@ .In sys/pcpu.h .Ss Per-CPU Variable Definition and Declaration .Fn DPCPU_DEFINE "type" "name" +.Fn DPCPU_DEFINE_STATIC "type" "name" .Fn DPCPU_DECLARE "type" "name" .Ss Current CPU Accessor Functions .Fn DPCPU_PTR "name" @@ -66,11 +67,12 @@ per-CPU instance to be initialized with the value: DPCPU_DEFINE(int, foo_int) = 1; .Ed .Pp -Syntactically, the definition may be treated as a variable. -For example, a dynamic per-CPU variable may be declared as -.Dv static : +Values that can be defined as +.Dv static +must use +.Fn DPCPU_DEFINE_STATIC : .Bd -literal -offset 1234 -static DPCPU_DEFINE(int, foo_int); +DPCPU_DEFINE_STATIC(int, foo_int); .Ed .Pp .Fn DPCPU_DECLARE @@ -111,8 +113,8 @@ Alternatively, it may be desirable to cache the CPU ID sequence of accesses, using suitable synchronization to make non-atomic sequences safe in the presence of migration. .Bd -literal -offset 1234 -static DPCPU_DEFINE(int, foo_int); -static DPCPU_DEFINE(struct mutex, foo_lock); +DPCPU_DEFINE_STATIC(int, foo_int); +DPCPU_DEFINE_STATIC(struct mutex, foo_lock); void foo_int_increment(void) Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_idr.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/compat/linuxkpi/common/src/linux_idr.c Thu Jul 5 17:13:37 2018 (r336007) @@ -55,7 +55,7 @@ struct linux_idr_cache { unsigned count; }; -static DPCPU_DEFINE(struct linux_idr_cache, linux_idr_cache); +DPCPU_DEFINE_STATIC(struct linux_idr_cache, linux_idr_cache); /* * IDR Implementation. Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_rcu.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Thu Jul 5 17:13:37 2018 (r336007) @@ -92,7 +92,7 @@ CTASSERT(offsetof(struct linux_epoch_record, epoch_rec static ck_epoch_t linux_epoch; static struct linux_epoch_head linux_epoch_head; -static DPCPU_DEFINE(struct linux_epoch_record, linux_epoch_record); +DPCPU_DEFINE_STATIC(struct linux_epoch_record, linux_epoch_record); static void linux_rcu_cleaner_func(void *, int); Modified: head/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_tasklet.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/compat/linuxkpi/common/src/linux_tasklet.c Thu Jul 5 17:13:37 2018 (r336007) @@ -61,7 +61,7 @@ struct tasklet_worker { #define TASKLET_WORKER_LOCK(tw) mtx_lock(&(tw)->mtx) #define TASKLET_WORKER_UNLOCK(tw) mtx_unlock(&(tw)->mtx) -static DPCPU_DEFINE(struct tasklet_worker, tasklet_worker); +DPCPU_DEFINE_STATIC(struct tasklet_worker, tasklet_worker); static void tasklet_handler(void *arg) Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/kern/kern_clock.c Thu Jul 5 17:13:37 2018 (r336007) @@ -382,7 +382,7 @@ int profprocs; volatile int ticks; int psratio; -static DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ +DPCPU_DEFINE_STATIC(int, pcputicks); /* Per-CPU version of ticks. */ #ifdef DEVICE_POLLING static int devpoll_run = 0; #endif Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/kern/kern_clocksource.c Thu Jul 5 17:13:37 2018 (r336007) @@ -126,7 +126,7 @@ struct pcpu_state { int idle; /* This CPU is in idle mode. */ }; -static DPCPU_DEFINE(struct pcpu_state, timerstate); +DPCPU_DEFINE_STATIC(struct pcpu_state, timerstate); DPCPU_DEFINE(sbintime_t, hardclocktime); /* Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/kern/kern_exec.c Thu Jul 5 17:13:37 2018 (r336007) @@ -1331,7 +1331,7 @@ struct exec_args_kva { SLIST_ENTRY(exec_args_kva) next; }; -static DPCPU_DEFINE(struct exec_args_kva *, exec_args_kva); +DPCPU_DEFINE_STATIC(struct exec_args_kva *, exec_args_kva); static SLIST_HEAD(, exec_args_kva) exec_args_kva_freelist; static struct mtx exec_args_kva_mtx; Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/kern/kern_tc.c Thu Jul 5 17:13:37 2018 (r336007) @@ -2001,8 +2001,8 @@ SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_SECOND, i static int cpu_tick_variable; static uint64_t cpu_tick_frequency; -static DPCPU_DEFINE(uint64_t, tc_cpu_ticks_base); -static DPCPU_DEFINE(unsigned, tc_cpu_ticks_last); +DPCPU_DEFINE_STATIC(uint64_t, tc_cpu_ticks_base); +DPCPU_DEFINE_STATIC(unsigned, tc_cpu_ticks_last); static uint64_t tc_cpu_ticks(void) Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/kern/sched_4bsd.c Thu Jul 5 17:13:37 2018 (r336007) @@ -176,7 +176,7 @@ struct pcpuidlestat { u_int idlecalls; u_int oldidlecalls; }; -static DPCPU_DEFINE(struct pcpuidlestat, idlestat); +DPCPU_DEFINE_STATIC(struct pcpuidlestat, idlestat); static void setup_runqs(void) Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/kern/sched_ule.c Thu Jul 5 17:13:37 2018 (r336007) @@ -283,7 +283,7 @@ static int trysteal_limit = 2; static struct tdq tdq_cpu[MAXCPU]; static struct tdq *balance_tdq; static int balance_ticks; -static DPCPU_DEFINE(uint32_t, randomval); +DPCPU_DEFINE_STATIC(uint32_t, randomval); #define TDQ_SELF() (&tdq_cpu[PCPU_GET(cpuid)]) #define TDQ_CPU(x) (&tdq_cpu[(x)]) Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/kern/subr_pcpu.c Thu Jul 5 17:13:37 2018 (r336007) @@ -72,7 +72,7 @@ struct dpcpu_free { TAILQ_ENTRY(dpcpu_free) df_link; }; -static DPCPU_DEFINE(char, modspace[DPCPU_MODMIN]); +DPCPU_DEFINE_STATIC(char, modspace[DPCPU_MODMIN]); static TAILQ_HEAD(, dpcpu_free) dpcpu_head = TAILQ_HEAD_INITIALIZER(dpcpu_head); static struct sx dpcpu_lock; uintptr_t dpcpu_off[MAXCPU]; Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/mips/mips/tick.c Thu Jul 5 17:13:37 2018 (r336007) @@ -61,13 +61,13 @@ uint64_t counter_freq; struct timecounter *platform_timecounter; -static DPCPU_DEFINE(uint32_t, cycles_per_tick); +DPCPU_DEFINE_STATIC(uint32_t, cycles_per_tick); static uint32_t cycles_per_usec; -static DPCPU_DEFINE(volatile uint32_t, counter_upper); -static DPCPU_DEFINE(volatile uint32_t, counter_lower_last); -static DPCPU_DEFINE(uint32_t, compare_ticks); -static DPCPU_DEFINE(uint32_t, lost_ticks); +DPCPU_DEFINE_STATIC(volatile uint32_t, counter_upper); +DPCPU_DEFINE_STATIC(volatile uint32_t, counter_lower_last); +DPCPU_DEFINE_STATIC(uint32_t, compare_ticks); +DPCPU_DEFINE_STATIC(uint32_t, lost_ticks); struct clock_softc { int intr_rid; Modified: head/sys/mips/nlm/tick.c ============================================================================== --- head/sys/mips/nlm/tick.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/mips/nlm/tick.c Thu Jul 5 17:13:37 2018 (r336007) @@ -62,13 +62,13 @@ uint64_t counter_freq; struct timecounter *platform_timecounter; -static DPCPU_DEFINE(uint32_t, cycles_per_tick); +DPCPU_DEFINE_STATIC(uint32_t, cycles_per_tick); static uint32_t cycles_per_usec; -static DPCPU_DEFINE(volatile uint32_t, counter_upper); -static DPCPU_DEFINE(volatile uint32_t, counter_lower_last); -static DPCPU_DEFINE(uint32_t, compare_ticks); -static DPCPU_DEFINE(uint32_t, lost_ticks); +DPCPU_DEFINE_STATIC(volatile uint32_t, counter_upper); +DPCPU_DEFINE_STATIC(volatile uint32_t, counter_lower_last); +DPCPU_DEFINE_STATIC(uint32_t, compare_ticks); +DPCPU_DEFINE_STATIC(uint32_t, lost_ticks); struct clock_softc { int intr_rid; Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/netinet/siftr.c Thu Jul 5 17:13:37 2018 (r336007) @@ -268,7 +268,7 @@ struct siftr_stats uint32_t nskip_out_dejavu; }; -static DPCPU_DEFINE(struct siftr_stats, ss); +DPCPU_DEFINE_STATIC(struct siftr_stats, ss); static volatile unsigned int siftr_exit_pkt_manager_thread = 0; static unsigned int siftr_enabled = 0; Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Jul 5 17:13:37 2018 (r336007) @@ -219,7 +219,7 @@ static VNET_DEFINE(struct dyn_ipv6_slist, dyn_expired_ * and must not be reclaimed by expiration callout. */ static void **dyn_hp_cache; -static DPCPU_DEFINE(void *, dyn_hp); +DPCPU_DEFINE_STATIC(void *, dyn_hp); #define DYNSTATE_GET(cpu) ck_pr_load_ptr(DPCPU_ID_PTR((cpu), dyn_hp)) #define DYNSTATE_PROTECT(v) ck_pr_store_ptr(DPCPU_PTR(dyn_hp), (v)) #define DYNSTATE_RELEASE() DYNSTATE_PROTECT(NULL) Modified: head/sys/powerpc/powerpc/clock.c ============================================================================== --- head/sys/powerpc/powerpc/clock.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/powerpc/powerpc/clock.c Thu Jul 5 17:13:37 2018 (r336007) @@ -95,7 +95,7 @@ struct decr_state { int mode; /* 0 - off, 1 - periodic, 2 - one-shot. */ int32_t div; /* Periodic divisor. */ }; -static DPCPU_DEFINE(struct decr_state, decr_state); +DPCPU_DEFINE_STATIC(struct decr_state, decr_state); static struct eventtimer decr_et; static struct timecounter decr_tc = { Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/sys/pcpu.h Thu Jul 5 17:13:37 2018 (r336007) @@ -81,7 +81,11 @@ extern uintptr_t dpcpu_off[]; */ #define DPCPU_NAME(n) pcpu_entry_##n #define DPCPU_DECLARE(t, n) extern t DPCPU_NAME(n) -#define DPCPU_DEFINE(t, n) t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used +/* struct _hack is to stop this from being used with the static keyword. */ +#define DPCPU_DEFINE(t, n) \ + struct _hack; t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used +#define DPCPU_DEFINE_STATIC(t, n) \ + static t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used /* * Accessors with a given base. Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/vm/vm_page.c Thu Jul 5 17:13:37 2018 (r336007) @@ -134,7 +134,7 @@ extern int vmem_startup_count(void); struct vm_domain vm_dom[MAXMEMDOM]; -static DPCPU_DEFINE(struct vm_batchqueue, pqbatch[MAXMEMDOM][PQ_COUNT]); +DPCPU_DEFINE_STATIC(struct vm_batchqueue, pqbatch[MAXMEMDOM][PQ_COUNT]); struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT]; Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Thu Jul 5 17:11:55 2018 (r336006) +++ head/sys/x86/xen/xen_intr.c Thu Jul 5 17:13:37 2018 (r336007) @@ -103,7 +103,7 @@ struct xen_intr_pcpu_data { * Start the scan at port 0 by initializing the last scanned * location as the highest numbered event channel port. */ -static DPCPU_DEFINE(struct xen_intr_pcpu_data, xen_intr_pcpu) = { +DPCPU_DEFINE_STATIC(struct xen_intr_pcpu_data, xen_intr_pcpu) = { .last_processed_l1i = LONG_BIT - 1, .last_processed_l2i = LONG_BIT - 1 }; From owner-svn-src-head@freebsd.org Thu Jul 5 17:26:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 691F310400E5; Thu, 5 Jul 2018 17:26:14 +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 12DAF8B084; Thu, 5 Jul 2018 17:26:14 +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 E807C1D008; Thu, 5 Jul 2018 17:26:13 +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 w65HQDxY070191; Thu, 5 Jul 2018 17:26:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65HQDWf070190; Thu, 5 Jul 2018 17:26:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051726.w65HQDWf070190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 17:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336008 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 336008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:26:14 -0000 Author: kib Date: Thu Jul 5 17:26:13 2018 New Revision: 336008 URL: https://svnweb.freebsd.org/changeset/base/336008 Log: Revert r335999 to re-commit with the correct error message. Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 5 17:13:37 2018 (r336007) +++ head/sys/amd64/amd64/pmap.c Thu Jul 5 17:26:13 2018 (r336008) @@ -2308,6 +2308,7 @@ retry: PG_PS_FRAME) | (va & PDRMASK), &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); + vm_page_hold(m); } } else { pte = *pmap_pde_to_pte(pdep, va); @@ -2317,10 +2318,10 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); + if (m != NULL) + vm_page_hold(m); } } - if (m != NULL) - vm_page_hold(m); } PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jul 5 17:13:37 2018 (r336007) +++ head/sys/i386/i386/pmap.c Thu Jul 5 17:26:13 2018 (r336008) @@ -1673,6 +1673,7 @@ retry: PG_PS_FRAME) | (va & PDRMASK), &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); + vm_page_hold(m); } } else { pte = pmap_pte_ufast(pmap, va, pde); @@ -1682,10 +1683,10 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); + if (m != NULL) + vm_page_hold(m); } } - if (m != NULL) - vm_page_hold(m); } PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); From owner-svn-src-head@freebsd.org Thu Jul 5 17:26:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 039491040174; Thu, 5 Jul 2018 17:26:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A653A8B1EE; Thu, 5 Jul 2018 17:26:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87BFB1D009; Thu, 5 Jul 2018 17:26:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w65HQiHj070261; Thu, 5 Jul 2018 17:26:44 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65HQiPn070260; Thu, 5 Jul 2018 17:26:44 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807051726.w65HQiPn070260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 5 Jul 2018 17:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336009 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 336009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:26:45 -0000 Author: sbruno Date: Thu Jul 5 17:26:44 2018 New Revision: 336009 URL: https://svnweb.freebsd.org/changeset/base/336009 Log: riscv: Remove unused variable "code" gcc found that the variabl "code", while being assigned a value, isn't be used for anything. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D16114 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Thu Jul 5 17:26:13 2018 (r336008) +++ head/sys/riscv/riscv/machdep.c Thu Jul 5 17:26:44 2018 (r336009) @@ -548,7 +548,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask struct thread *td; struct proc *p; int onstack; - int code; int sig; td = curthread; @@ -556,7 +555,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask PROC_LOCK_ASSERT(p, MA_OWNED); sig = ksi->ksi_signo; - code = ksi->ksi_code; psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); From owner-svn-src-head@freebsd.org Thu Jul 5 17:28:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 364CD104043B; Thu, 5 Jul 2018 17:28:07 +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 0D00F8B46D; Thu, 5 Jul 2018 17:28:07 +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 E37311D00F; Thu, 5 Jul 2018 17:28:06 +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 w65HS6N7070369; Thu, 5 Jul 2018 17:28:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65HS68t070367; Thu, 5 Jul 2018 17:28:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807051728.w65HS68t070367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Jul 2018 17:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336010 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 336010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:28:07 -0000 Author: kib Date: Thu Jul 5 17:28:06 2018 New Revision: 336010 URL: https://svnweb.freebsd.org/changeset/base/336010 Log: Extend r335969 to superpages. It is possible that a fictitious unmanaged userspace mapping of superpage is created on x86, e.g. by pmap_object_init_pt(), with the physical address outside the vm_page_array[] coverage. Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16085 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 5 17:26:44 2018 (r336009) +++ head/sys/amd64/amd64/pmap.c Thu Jul 5 17:28:06 2018 (r336010) @@ -2308,7 +2308,6 @@ retry: PG_PS_FRAME) | (va & PDRMASK), &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); - vm_page_hold(m); } } else { pte = *pmap_pde_to_pte(pdep, va); @@ -2318,10 +2317,10 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); - if (m != NULL) - vm_page_hold(m); } } + if (m != NULL) + vm_page_hold(m); } PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jul 5 17:26:44 2018 (r336009) +++ head/sys/i386/i386/pmap.c Thu Jul 5 17:28:06 2018 (r336010) @@ -1673,7 +1673,6 @@ retry: PG_PS_FRAME) | (va & PDRMASK), &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); - vm_page_hold(m); } } else { pte = pmap_pte_ufast(pmap, va, pde); @@ -1683,10 +1682,10 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pa); - if (m != NULL) - vm_page_hold(m); } } + if (m != NULL) + vm_page_hold(m); } PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); From owner-svn-src-head@freebsd.org Thu Jul 5 17:49:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 121911042225; Thu, 5 Jul 2018 17:49:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 834458C52E; Thu, 5 Jul 2018 17:49:02 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 9070242A194; Fri, 6 Jul 2018 03:48:52 +1000 (AEST) Date: Fri, 6 Jul 2018 03:48:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Brooks Davis cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336002 - in head: usr.bin/netstat usr.sbin/tcpdrop In-Reply-To: <201807051702.w65H2AXB058831@repo.freebsd.org> Message-ID: <20180706031434.G2327@besplex.bde.org> References: <201807051702.w65H2AXB058831@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=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=xdn9BsdD-U1_5kZtKNQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:49:04 -0000 On Thu, 5 Jul 2018, Brooks Davis wrote: > Log: > Work around lame warnings in ancient gcc on 32-bit platforms. > > Fixes r335979. These are correct warnings. Why not fix the bug instead of rorking around it? > Modified: head/usr.bin/netstat/inet.c > ============================================================================== > --- head/usr.bin/netstat/inet.c Thu Jul 5 16:43:15 2018 (r336001) > +++ head/usr.bin/netstat/inet.c Thu Jul 5 17:02:10 2018 (r336002) > @@ -159,12 +159,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso) > > bzero(xso, sizeof *xso); > xso->xso_len = sizeof *xso; > - xso->xso_so = (kvaddr_t)so; > + xso->xso_so = (kvaddr_t)(long)so; This (and kvaddr_t having the same 64-bit size for all arches) are unportable. Converting object pointers to integers is only portable if one or both of intptr_t or uintptr_t exists and is used. The above assumes that intptr_t exists and is the same as long, and that there are no problems with the sign mismatch between long and kvaddr_t. But long != intptr_t on any supported 32-bit arches. It only has the same size. The sign mismatch probably doesn't matter, but this is unclear. Correct code: xso->xso_so = (kvaddr_t)(uintptr_t)so; This only assumes that uintptr_t exists and is not larger than kvaddr_t. FreeBSD and maybe POSIX require uintptr_t to exist, and kvaddr_t must be chosen to be no smaller than uintptr_t. The burden is larger for using these pointers represented as integers. On all 32-bit arches, converting kvaddr_t back to a pointer reduces its size, and only very broken compilers would not warn about that. But it is a bug for the API to even have kernel pointers, so hopefully this conversion is rarely done. An application might just print these pointers, and should do this without converting them to void so as to misprint them using %p format. ps(1) attempts to do some compression when printing kernel addresses, but IIRC this is quite broken especially on 64-bit arches where it is most needed. E.g, ps laxw -o wchan. wchan is documented to trim leading zeros when printing the value numerically. It needs to trim leading f's on at least amd64 and i386 3/1. But wchan is almost useless since it is rarely printed numerically, so it is the same as wchan for all processes on freefall now. The leading zeros in it are stripped by printing it in %lx format after bogusly casting ki_wchan to long. ki_wchan is still void *, so kinfo's ABI is very MD. kinfo has lots of other design errors like this, but its ABI has only been broken once or twice since FreeBSD-~5. Bruce From owner-svn-src-head@freebsd.org Thu Jul 5 17:53:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADB7D1042A52; Thu, 5 Jul 2018 17:53:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 604F28CC41; Thu, 5 Jul 2018 17:53: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 42CD61D4E9; Thu, 5 Jul 2018 17:53: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 w65Hrqpa085591; Thu, 5 Jul 2018 17:53:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65HrpQm085589; Thu, 5 Jul 2018 17:53:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807051753.w65HrpQm085589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 5 Jul 2018 17:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336011 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 336011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:53:52 -0000 Author: kevans Date: Thu Jul 5 17:53:51 2018 New Revision: 336011 URL: https://svnweb.freebsd.org/changeset/base/336011 Log: config(8): De-dupe hint/env vars within a single file r335653 flipped the order in which hints/env files are concatenated to match the order in which vars are processed by the kernel. This is the other hammer to drop. Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the latest value specified for a key. This leaves some duplicates if a variable is specified in multiple hint/env files or via `envvar` in a kernel config, but the reversed order of concatenation (from r335653) makes this a non-issue as the latest-specified version will be seen first. This change also silently rewrote hint bits to use the same sanitization process that ian@ wrote for r335642. To the kernel, hints and env vars are basically the same thing through early boot, then get merged into the dynamic environment once kmem becomes available and the dynamic environment is created. They should be subjected to the same restrictions. MFC after: 1 month Modified: head/usr.sbin/config/Makefile head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/Makefile ============================================================================== --- head/usr.sbin/config/Makefile Thu Jul 5 17:28:06 2018 (r336010) +++ head/usr.sbin/config/Makefile Thu Jul 5 17:53:51 2018 (r336011) @@ -18,7 +18,7 @@ CFLAGS+= -I. -I${SRCDIR} NO_WMISSING_VARIABLE_DECLARATIONS= -LIBADD= l sbuf +LIBADD= l nv sbuf CLEANFILES+= kernconf.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Thu Jul 5 17:28:06 2018 (r336010) +++ head/usr.sbin/config/mkmakefile.c Thu Jul 5 17:53:51 2018 (r336011) @@ -49,6 +49,8 @@ static const char rcsid[] = #include #include #include +#include +#include #include #include "y.tab.h" #include "config.h" @@ -62,6 +64,10 @@ static void do_objs(FILE *); static void do_before_depend(FILE *); static int opteq(const char *, const char *); static void read_files(void); +static void sanitize_envline(char *result, const char *src); +static void process_into_file(char *line, FILE *ofp); +static void process_into_nvlist(char *line, nvlist_t *nvl); +static void dump_nvlist(nvlist_t *nvl, FILE *ofp); static void errout(const char *fmt, ...) { @@ -180,64 +186,6 @@ makefile(void) moveifchanged(path("Makefile.new"), path("Makefile")); } -/* - * Build hints.c from the skeleton - */ -void -makehints(void) -{ - FILE *ifp, *ofp; - char line[BUFSIZ]; - char *s; - struct hint *hint; - - ofp = fopen(path("hints.c.new"), "w"); - if (ofp == NULL) - err(1, "%s", path("hints.c.new")); - fprintf(ofp, "#include \n"); - fprintf(ofp, "#include \n"); - fprintf(ofp, "\n"); - fprintf(ofp, "char static_hints[] = {\n"); - STAILQ_FOREACH(hint, &hints, hint_next) { - ifp = fopen(hint->hint_name, "r"); - if (ifp == NULL) - err(1, "%s", hint->hint_name); - while (fgets(line, BUFSIZ, ifp) != NULL) { - /* zap trailing CR and/or LF */ - while ((s = strrchr(line, '\n')) != NULL) - *s = '\0'; - while ((s = strrchr(line, '\r')) != NULL) - *s = '\0'; - /* remove # comments */ - s = strchr(line, '#'); - if (s) - *s = '\0'; - /* remove any whitespace and " characters */ - s = line; - while (*s) { - if (*s == ' ' || *s == '\t' || *s == '"') { - while (*s) { - s[0] = s[1]; - s++; - } - /* start over */ - s = line; - continue; - } - s++; - } - /* anything left? */ - if (*line == '\0') - continue; - fprintf(ofp, "\"%s\\0\"\n", line); - } - fclose(ifp); - } - fprintf(ofp, "\"\\0\"\n};\n"); - fclose(ofp); - moveifchanged(path("hints.c.new"), path("hints.c")); -} - static void sanitize_envline(char *result, const char *src) { @@ -295,14 +243,96 @@ sanitize_envline(char *result, const char *src) *dst = 0; } +static void +process_into_file(char *line, FILE *ofp) +{ + char result[BUFSIZ]; + + sanitize_envline(result, line); + /* anything left? */ + if (*result == '\0') + return; + fprintf(ofp, "\"%s\\0\"\n", result); +} + +static void +process_into_nvlist(char *line, nvlist_t *nvl) +{ + char result[BUFSIZ], *s; + + sanitize_envline(result, line); + /* anything left? */ + if (*result == '\0') + return; + s = strchr(result, '='); + *s = 0; + if (nvlist_exists(nvl, result)) + nvlist_free(nvl, result); + nvlist_add_string(nvl, result, s + 1); +} + +static void +dump_nvlist(nvlist_t *nvl, FILE *ofp) +{ + const char *name; + void *cookie; + + if (nvl == NULL) + return; + + while (!nvlist_empty(nvl)) { + cookie = NULL; + name = nvlist_next(nvl, NULL, &cookie); + fprintf(ofp, "\"%s=%s\\0\"\n", name, + cnvlist_get_string(cookie)); + + cnvlist_free_string(nvl, cookie); + } +} + /* + * Build hints.c from the skeleton + */ +void +makehints(void) +{ + FILE *ifp, *ofp; + nvlist_t *nvl; + char line[BUFSIZ]; + struct hint *hint; + + ofp = fopen(path("hints.c.new"), "w"); + if (ofp == NULL) + err(1, "%s", path("hints.c.new")); + fprintf(ofp, "#include \n"); + fprintf(ofp, "#include \n"); + fprintf(ofp, "\n"); + fprintf(ofp, "char static_hints[] = {\n"); + nvl = nvlist_create(0); + STAILQ_FOREACH(hint, &hints, hint_next) { + ifp = fopen(hint->hint_name, "r"); + if (ifp == NULL) + err(1, "%s", hint->hint_name); + while (fgets(line, BUFSIZ, ifp) != NULL) + process_into_nvlist(line, nvl); + dump_nvlist(nvl, ofp); + fclose(ifp); + } + nvlist_destroy(nvl); + fprintf(ofp, "\"\\0\"\n};\n"); + fclose(ofp); + moveifchanged(path("hints.c.new"), path("hints.c")); +} + +/* * Build env.c from the skeleton */ void makeenv(void) { FILE *ifp, *ofp; - char line[BUFSIZ], result[BUFSIZ], *linep; + nvlist_t *nvl; + char line[BUFSIZ]; struct envvar *envvar; ofp = fopen(path("env.c.new"), "w"); @@ -312,27 +342,20 @@ makeenv(void) fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); fprintf(ofp, "char static_env[] = {\n"); + nvl = nvlist_create(0); STAILQ_FOREACH(envvar, &envvars, envvar_next) { if (envvar->env_is_file) { ifp = fopen(envvar->env_str, "r"); if (ifp == NULL) err(1, "%s", envvar->env_str); - while (fgets(line, BUFSIZ, ifp) != NULL) { - sanitize_envline(result, line); - /* anything left? */ - if (*result == '\0') - continue; - fprintf(ofp, "\"%s\\0\"\n", result); - } + while (fgets(line, BUFSIZ, ifp) != NULL) + process_into_nvlist(line, nvl); + dump_nvlist(nvl, ofp); fclose(ifp); - } else { - linep = envvar->env_str; - sanitize_envline(result, linep); - if (*result == '\0') - continue; - fprintf(ofp, "\"%s\\0\"\n", result); - } + } else + process_into_file(envvar->env_str, ofp); } + nvlist_destroy(nvl); fprintf(ofp, "\"\\0\"\n};\n"); fclose(ofp); moveifchanged(path("env.c.new"), path("env.c")); From owner-svn-src-head@freebsd.org Thu Jul 5 17:55:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 090981042CC8; Thu, 5 Jul 2018 17:55:36 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 B06EF8CE1C; Thu, 5 Jul 2018 17:55:35 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com [209.85.214.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 72AFC839D; Thu, 5 Jul 2018 17:55:35 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f45.google.com with SMTP id o5-v6so13159815itc.1; Thu, 05 Jul 2018 10:55:35 -0700 (PDT) X-Gm-Message-State: APt69E0KRLGpwdgCyVwyYGU7UKDxIMU693Dz7ZZ8IHIwb+mfPTvNqSaq C8qLEjbjCMbuQpAzj5cqbGBj0kUCw1y/eETFRGM= X-Google-Smtp-Source: AAOMgpc+mJGLQedLMAABN5f0bL/hYb+2HJ/Us/KQN5tYzHOOmgns33fXcgcXD0P4CEgvTgic0jf1cl53GNzq3KPN7KM= X-Received: by 2002:a24:8ac1:: with SMTP id v184-v6mr5614674itd.7.1530813334676; Thu, 05 Jul 2018 10:55:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8d2:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 10:55:34 -0700 (PDT) In-Reply-To: <20180705155417.GI5562@kib.kiev.ua> References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> From: Matthew Macy Date: Thu, 5 Jul 2018 10:55:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335916 - head/sys/conf To: Konstantin Belousov Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:55:36 -0000 On Thu, Jul 5, 2018 at 8:54 AM, Konstantin Belousov wrote: > On Thu, Jul 05, 2018 at 07:56:22AM -0700, John Baldwin wrote: >> On 7/4/18 7:22 AM, Konstantin Belousov wrote: >> > On Tue, Jul 03, 2018 at 11:05:42PM +0000, Matt Macy wrote: >> >> Author: mmacy >> >> Date: Tue Jul 3 23:05:42 2018 >> >> New Revision: 335916 >> >> URL: https://svnweb.freebsd.org/changeset/base/335916 >> >> >> >> Log: >> >> Enable MODULE_TIED by default for modules compiled with the kernel >> > But why ? >> >> I think we should enable KLD_TIED to inline critical_* etc. for modules >> built as part of a kernel that are installed alongside the kernel in /boot/. > >> I don't think we need to support modules built with kernel A loaded into kernel B. >> > This is the crusial point. I do not object, but this this is a radical > change from the previous mode of modules build. > > I do not want to put words in other person mouth, but I beliee that the > original intent of KLD_TIED/MODULE_TIED was much more limited. Only some > specific modules were to be tied. My intention was only to allow it for select modules compiled _with_ the kernel. Then there was a heated discussion about documentation and how to communicate it's distinction with DECLARE_MODULE_TIED. In response to which John said (assuming I understood correctly, communication is hard) that it should be the default and specified doing it the way I did it. That seemed reasonable - but I don't have strong feelings one way or the other. I apologize if I misunderstood any guidance I was provided. -M From owner-svn-src-head@freebsd.org Thu Jul 5 17:58:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 623BB1043043; Thu, 5 Jul 2018 17:58:27 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C259F8D0E9; Thu, 5 Jul 2018 17:58:26 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.227.83.41]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LsfrR-1gHIy81rbd-012HVB; Thu, 05 Jul 2018 19:58:17 +0200 Date: Thu, 5 Jul 2018 19:57:43 +0200 From: "O. Hartmann" To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336011 - head/usr.sbin/config Message-ID: <20180705195810.12487074@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201807051753.w65HrpQm085589@repo.freebsd.org> References: <201807051753.w65HrpQm085589@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:pbJn8TUBiRPeUlw8qTOmDmAN+dQ4T8+IQ+7i0tT87V/jl6s5Wu9 9JXzz11cqyfnFzG1uCsF94VoY28LpUKVqgrFN6Q6W4/kxaWgU7o//dunOwG7FU2Ph9jLquY LXGeEzHMw5e9OoQ9EVRVPod2oHEGhVzOmX+4VtYE93no9IO+utH08hgw8vVi/dFDsajfeo4 AKT7Ecv8FIy3WH7/8GAEQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:fhc/spZh8AQ=:iZ6HT9lxy2M+M/exSZ4aDU OYQziSbAfVI/OHfGMIkKnNKxhF+G2k0aQOxaN9cK7i9HaGVhUEuWr7ZOSAvskxBYL1skjUUEK R7ymXwwOb8+nSCfJTBViTYg7NPltSCkLUjaqpxXi73ZnXDkisHZNOjQ7+1B9aUQ87wkGwmkdo JE8AP/Aby8Z/x3VII2TENC8UaMfYhwhDwCQCPprUOltEF7ZZvvDlDyVMoAw5+vpMkhjpSj8Cd aoDwbX0c14xsM51fNQQx3jxDGz1+0wkdphxTT1K+GjA2kl+bjsN1x3Sp+3bfFSsHvirzytl8n +acUDvBj42E95WM3yuov7mJv3HLxrJwXHldHjY5XQ8r4Pa3OStmM0+F0Tgz2tkbf8+0o7MyaD l2fEaz/oZm8frLYdO96XPb0crTm/5v4N6V2A/OxqZmLgy/Cmv47axvUP3cBGbLf2C5eqEZaN3 Jxm76Vi2HqcsCqyLIrXgACwTT1Rsdem54K0c+88/4bCT09AnJPuDyPMU1GEVdl5dwxbDxmgX5 vjUVdfd2naa7MiIg2b86IR/tw8FAv/tk3ODngPsKENJzOL7nM5Z9ycM62mS7z/M14swIGzK1H dWWES5C69S4BRbQ5lModSoXcQzBKReWUDEe0hePSFWYnypn5i0HmkGEk14tjjC6qee2NSkWNn p5BWU0PgQoYTtjKWoUHRf8d4JX2oL2fHPPJJ2e3jQWOO0oOhi9HwLkmkgNDerZCl+QK+gt4pa ImvbAJhp8CdmSxwHsh8x7Da8V4S5Qervsv1qAzY7BZvfWbDBmRXqc1iC+NmeNhUn7paPq0nDE LljnCMX X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 17:58:27 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFRo dSwgNSBKdWwgMjAxOCAxNzo1Mzo1MSArMDAwMCAoVVRDKQ0KS3lsZSBFdmFucyA8a2V2YW5zQEZy ZWVCU0Qub3JnPiBzY2hyaWViOg0KDQo+IEF1dGhvcjoga2V2YW5zDQo+IERhdGU6IFRodSBKdWwg IDUgMTc6NTM6NTEgMjAxOA0KPiBOZXcgUmV2aXNpb246IDMzNjAxMQ0KPiBVUkw6IGh0dHBzOi8v c3Zud2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzMzNjAxMQ0KPiANCj4gTG9nOg0KPiAg IGNvbmZpZyg4KTogRGUtZHVwZSBoaW50L2VudiB2YXJzIHdpdGhpbiBhIHNpbmdsZSBmaWxlDQo+ ICAgDQo+ICAgcjMzNTY1MyBmbGlwcGVkIHRoZSBvcmRlciBpbiB3aGljaCBoaW50cy9lbnYgZmls ZXMgYXJlIGNvbmNhdGVuYXRlZCB0byBtYXRjaA0KPiAgIHRoZSBvcmRlciBpbiB3aGljaCB2YXJz IGFyZSBwcm9jZXNzZWQgYnkgdGhlIGtlcm5lbC4gVGhpcyBpcyB0aGUgb3RoZXINCj4gICBoYW1t ZXIgdG8gZHJvcC4NCj4gICANCj4gICBVc2UgbnYoOSkgdG8gZGUtZHVwZSBlbnRyaWVzIHdpdGhp biBhIHNpbmdsZSBgaGludGAgb3IgYGVudmAgZmlsZSwgdXNpbmcgdGhlDQo+ICAgbGF0ZXN0IHZh bHVlIHNwZWNpZmllZCBmb3IgYSBrZXkuIFRoaXMgbGVhdmVzIHNvbWUgZHVwbGljYXRlcyBpZiBh IHZhcmlhYmxlDQo+ICAgaXMgc3BlY2lmaWVkIGluIG11bHRpcGxlIGhpbnQvZW52IGZpbGVzIG9y IHZpYSBgZW52dmFyYCBpbiBhIGtlcm5lbCBjb25maWcsDQo+ICAgYnV0IHRoZSByZXZlcnNlZCBv cmRlciBvZiBjb25jYXRlbmF0aW9uIChmcm9tIHIzMzU2NTMpIG1ha2VzIHRoaXMgYQ0KPiAgIG5v bi1pc3N1ZSBhcyB0aGUgbGF0ZXN0LXNwZWNpZmllZCB2ZXJzaW9uIHdpbGwgYmUgc2VlbiBmaXJz dC4NCj4gICANCj4gICBUaGlzIGNoYW5nZSBhbHNvIHNpbGVudGx5IHJld3JvdGUgaGludCBiaXRz IHRvIHVzZSB0aGUgc2FtZSBzYW5pdGl6YXRpb24NCj4gICBwcm9jZXNzIHRoYXQgaWFuQCB3cm90 ZSBmb3IgcjMzNTY0Mi4gVG8gdGhlIGtlcm5lbCwgaGludHMgYW5kIGVudiB2YXJzIGFyZQ0KPiAg IGJhc2ljYWxseSB0aGUgc2FtZSB0aGluZyB0aHJvdWdoIGVhcmx5IGJvb3QsIHRoZW4gZ2V0IG1l cmdlZCBpbnRvIHRoZQ0KPiAgIGR5bmFtaWMgZW52aXJvbm1lbnQgb25jZSBrbWVtIGJlY29tZXMg YXZhaWxhYmxlIGFuZCB0aGUgZHluYW1pYyBlbnZpcm9ubWVudA0KPiAgIGlzIGNyZWF0ZWQuIFRo ZXkgc2hvdWxkIGJlIHN1YmplY3RlZCB0byB0aGUgc2FtZSByZXN0cmljdGlvbnMuDQo+ICAgDQo+ ICAgTUZDIGFmdGVyOgkxIG1vbnRoDQo+IA0KPiBNb2RpZmllZDoNCj4gICBoZWFkL3Vzci5zYmlu L2NvbmZpZy9NYWtlZmlsZQ0KPiAgIGhlYWQvdXNyLnNiaW4vY29uZmlnL21rbWFrZWZpbGUuYw0K PiANCj4gTW9kaWZpZWQ6IGhlYWQvdXNyLnNiaW4vY29uZmlnL01ha2VmaWxlDQo+ID09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC91c3Iuc2Jpbi9jb25maWcvTWFrZWZpbGUJVGh1IEp1 bCAgNSAxNzoyODowNiAyMDE4CShyMzM2MDEwKQ0KPiArKysgaGVhZC91c3Iuc2Jpbi9jb25maWcv TWFrZWZpbGUJVGh1IEp1bCAgNSAxNzo1Mzo1MSAyMDE4CShyMzM2MDExKQ0KPiBAQCAtMTgsNyAr MTgsNyBAQCBDRkxBR1MrPSAtSS4gLUkke1NSQ0RJUn0NCj4gIA0KPiAgTk9fV01JU1NJTkdfVkFS SUFCTEVfREVDTEFSQVRJT05TPQ0KPiAgDQo+IC1MSUJBREQ9CWwgc2J1Zg0KPiArTElCQUREPQls IG52IHNidWYNCj4gIA0KPiAgQ0xFQU5GSUxFUys9CWtlcm5jb25mLmMNCj4gIA0KPiANCj4gTW9k aWZpZWQ6IGhlYWQvdXNyLnNiaW4vY29uZmlnL21rbWFrZWZpbGUuYw0KPiA9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0NCj4gLS0tIGhlYWQvdXNyLnNiaW4vY29uZmlnL21rbWFrZWZpbGUuYwlUaHUgSnVs ICA1IDE3OjI4OjA2IDIwMTgJKHIzMzYwMTApDQo+ICsrKyBoZWFkL3Vzci5zYmluL2NvbmZpZy9t a21ha2VmaWxlLmMJVGh1IEp1bCAgNSAxNzo1Mzo1MSAyMDE4CShyMzM2MDExKQ0KPiBAQCAtNDks NiArNDksOCBAQCBzdGF0aWMgY29uc3QgY2hhciByY3NpZFtdID0NCj4gICNpbmNsdWRlIDxzdGRi b29sLmg+DQo+ICAjaW5jbHVkZSA8c3RkaW8uaD4NCj4gICNpbmNsdWRlIDxzdHJpbmcuaD4NCj4g KyNpbmNsdWRlIDxzeXMvY252Lmg+DQo+ICsjaW5jbHVkZSA8c3lzL252Lmg+DQo+ICAjaW5jbHVk ZSA8c3lzL3BhcmFtLmg+DQo+ICAjaW5jbHVkZSAieS50YWIuaCINCj4gICNpbmNsdWRlICJjb25m aWcuaCINCj4gQEAgLTYyLDYgKzY0LDEwIEBAIHN0YXRpYyB2b2lkIGRvX29ianMoRklMRSAqKTsN Cj4gIHN0YXRpYyB2b2lkIGRvX2JlZm9yZV9kZXBlbmQoRklMRSAqKTsNCj4gIHN0YXRpYyBpbnQg b3B0ZXEoY29uc3QgY2hhciAqLCBjb25zdCBjaGFyICopOw0KPiAgc3RhdGljIHZvaWQgcmVhZF9m aWxlcyh2b2lkKTsNCj4gK3N0YXRpYyB2b2lkIHNhbml0aXplX2VudmxpbmUoY2hhciAqcmVzdWx0 LCBjb25zdCBjaGFyICpzcmMpOw0KPiArc3RhdGljIHZvaWQgcHJvY2Vzc19pbnRvX2ZpbGUoY2hh ciAqbGluZSwgRklMRSAqb2ZwKTsNCj4gK3N0YXRpYyB2b2lkIHByb2Nlc3NfaW50b19udmxpc3Qo Y2hhciAqbGluZSwgbnZsaXN0X3QgKm52bCk7DQo+ICtzdGF0aWMgdm9pZCBkdW1wX252bGlzdChu dmxpc3RfdCAqbnZsLCBGSUxFICpvZnApOw0KPiAgDQo+ICBzdGF0aWMgdm9pZCBlcnJvdXQoY29u c3QgY2hhciAqZm10LCAuLi4pDQo+ICB7DQo+IEBAIC0xODAsNjQgKzE4Niw2IEBAIG1ha2VmaWxl KHZvaWQpDQo+ICAJbW92ZWlmY2hhbmdlZChwYXRoKCJNYWtlZmlsZS5uZXciKSwgcGF0aCgiTWFr ZWZpbGUiKSk7DQo+ICB9DQo+ICANCj4gLS8qDQo+IC0gKiBCdWlsZCBoaW50cy5jIGZyb20gdGhl IHNrZWxldG9uDQo+IC0gKi8NCj4gLXZvaWQNCj4gLW1ha2VoaW50cyh2b2lkKQ0KPiAtew0KPiAt CUZJTEUgKmlmcCwgKm9mcDsNCj4gLQljaGFyIGxpbmVbQlVGU0laXTsNCj4gLQljaGFyICpzOw0K PiAtCXN0cnVjdCBoaW50ICpoaW50Ow0KPiAtDQo+IC0Jb2ZwID0gZm9wZW4ocGF0aCgiaGludHMu Yy5uZXciKSwgInciKTsNCj4gLQlpZiAob2ZwID09IE5VTEwpDQo+IC0JCWVycigxLCAiJXMiLCBw YXRoKCJoaW50cy5jLm5ldyIpKTsNCj4gLQlmcHJpbnRmKG9mcCwgIiNpbmNsdWRlIDxzeXMvdHlw ZXMuaD5cbiIpOw0KPiAtCWZwcmludGYob2ZwLCAiI2luY2x1ZGUgPHN5cy9zeXN0bS5oPlxuIik7 DQo+IC0JZnByaW50ZihvZnAsICJcbiIpOw0KPiAtCWZwcmludGYob2ZwLCAiY2hhciBzdGF0aWNf aGludHNbXSA9IHtcbiIpOw0KPiAtCVNUQUlMUV9GT1JFQUNIKGhpbnQsICZoaW50cywgaGludF9u ZXh0KSB7DQo+IC0JCWlmcCA9IGZvcGVuKGhpbnQtPmhpbnRfbmFtZSwgInIiKTsNCj4gLQkJaWYg KGlmcCA9PSBOVUxMKQ0KPiAtCQkJZXJyKDEsICIlcyIsIGhpbnQtPmhpbnRfbmFtZSk7DQo+IC0J CXdoaWxlIChmZ2V0cyhsaW5lLCBCVUZTSVosIGlmcCkgIT0gTlVMTCkgew0KPiAtCQkJLyogemFw IHRyYWlsaW5nIENSIGFuZC9vciBMRiAqLw0KPiAtCQkJd2hpbGUgKChzID0gc3RycmNocihsaW5l LCAnXG4nKSkgIT0gTlVMTCkNCj4gLQkJCQkqcyA9ICdcMCc7DQo+IC0JCQl3aGlsZSAoKHMgPSBz dHJyY2hyKGxpbmUsICdccicpKSAhPSBOVUxMKQ0KPiAtCQkJCSpzID0gJ1wwJzsNCj4gLQkJCS8q IHJlbW92ZSAjIGNvbW1lbnRzICovDQo+IC0JCQlzID0gc3RyY2hyKGxpbmUsICcjJyk7DQo+IC0J CQlpZiAocykNCj4gLQkJCQkqcyA9ICdcMCc7DQo+IC0JCQkvKiByZW1vdmUgYW55IHdoaXRlc3Bh Y2UgYW5kICIgY2hhcmFjdGVycyAqLw0KPiAtCQkJcyA9IGxpbmU7DQo+IC0JCQl3aGlsZSAoKnMp IHsNCj4gLQkJCQlpZiAoKnMgPT0gJyAnIHx8ICpzID09ICdcdCcgfHwgKnMgPT0gJyInKSB7DQo+ IC0JCQkJCXdoaWxlICgqcykgew0KPiAtCQkJCQkJc1swXSA9IHNbMV07DQo+IC0JCQkJCQlzKys7 DQo+IC0JCQkJCX0NCj4gLQkJCQkJLyogc3RhcnQgb3ZlciAqLw0KPiAtCQkJCQlzID0gbGluZTsN Cj4gLQkJCQkJY29udGludWU7DQo+IC0JCQkJfQ0KPiAtCQkJCXMrKzsNCj4gLQkJCX0NCj4gLQkJ CS8qIGFueXRoaW5nIGxlZnQ/ICovDQo+IC0JCQlpZiAoKmxpbmUgPT0gJ1wwJykNCj4gLQkJCQlj b250aW51ZTsNCj4gLQkJCWZwcmludGYob2ZwLCAiXCIlc1xcMFwiXG4iLCBsaW5lKTsNCj4gLQkJ fQ0KPiAtCQlmY2xvc2UoaWZwKTsNCj4gLQl9DQo+IC0JZnByaW50ZihvZnAsICJcIlxcMFwiXG59 O1xuIik7DQo+IC0JZmNsb3NlKG9mcCk7DQo+IC0JbW92ZWlmY2hhbmdlZChwYXRoKCJoaW50cy5j Lm5ldyIpLCBwYXRoKCJoaW50cy5jIikpOw0KPiAtfQ0KPiAtDQo+ICBzdGF0aWMgdm9pZA0KPiAg c2FuaXRpemVfZW52bGluZShjaGFyICpyZXN1bHQsIGNvbnN0IGNoYXIgKnNyYykNCj4gIHsNCj4g QEAgLTI5NSwxNCArMjQzLDk2IEBAIHNhbml0aXplX2VudmxpbmUoY2hhciAqcmVzdWx0LCBjb25z dCBjaGFyICpzcmMpDQo+ICAJKmRzdCA9IDA7DQo+ICB9DQo+ICANCj4gK3N0YXRpYyB2b2lkDQo+ ICtwcm9jZXNzX2ludG9fZmlsZShjaGFyICpsaW5lLCBGSUxFICpvZnApDQo+ICt7DQo+ICsJY2hh ciByZXN1bHRbQlVGU0laXTsNCj4gKw0KPiArCXNhbml0aXplX2VudmxpbmUocmVzdWx0LCBsaW5l KTsNCj4gKwkvKiBhbnl0aGluZyBsZWZ0PyAqLw0KPiArCWlmICgqcmVzdWx0ID09ICdcMCcpDQo+ ICsJCXJldHVybjsNCj4gKwlmcHJpbnRmKG9mcCwgIlwiJXNcXDBcIlxuIiwgcmVzdWx0KTsNCj4g K30NCj4gKw0KPiArc3RhdGljIHZvaWQNCj4gK3Byb2Nlc3NfaW50b19udmxpc3QoY2hhciAqbGlu ZSwgbnZsaXN0X3QgKm52bCkNCj4gK3sNCj4gKwljaGFyIHJlc3VsdFtCVUZTSVpdLCAqczsNCj4g Kw0KPiArCXNhbml0aXplX2VudmxpbmUocmVzdWx0LCBsaW5lKTsNCj4gKwkvKiBhbnl0aGluZyBs ZWZ0PyAqLw0KPiArCWlmICgqcmVzdWx0ID09ICdcMCcpDQo+ICsJCXJldHVybjsNCj4gKwlzID0g c3RyY2hyKHJlc3VsdCwgJz0nKTsNCj4gKwkqcyA9IDA7DQo+ICsJaWYgKG52bGlzdF9leGlzdHMo bnZsLCByZXN1bHQpKQ0KPiArCQludmxpc3RfZnJlZShudmwsIHJlc3VsdCk7DQo+ICsJbnZsaXN0 X2FkZF9zdHJpbmcobnZsLCByZXN1bHQsIHMgKyAxKTsNCj4gK30NCj4gKw0KPiArc3RhdGljIHZv aWQNCj4gK2R1bXBfbnZsaXN0KG52bGlzdF90ICpudmwsIEZJTEUgKm9mcCkNCj4gK3sNCj4gKwlj b25zdCBjaGFyICpuYW1lOw0KPiArCXZvaWQgKmNvb2tpZTsNCj4gKw0KPiArCWlmIChudmwgPT0g TlVMTCkNCj4gKwkJcmV0dXJuOw0KPiArDQo+ICsJd2hpbGUgKCFudmxpc3RfZW1wdHkobnZsKSkg ew0KPiArCQljb29raWUgPSBOVUxMOw0KPiArCQluYW1lID0gbnZsaXN0X25leHQobnZsLCBOVUxM LCAmY29va2llKTsNCj4gKwkJZnByaW50ZihvZnAsICJcIiVzPSVzXFwwXCJcbiIsIG5hbWUsDQo+ ICsJCSAgICAgY252bGlzdF9nZXRfc3RyaW5nKGNvb2tpZSkpOw0KPiArDQo+ICsJCWNudmxpc3Rf ZnJlZV9zdHJpbmcobnZsLCBjb29raWUpOw0KPiArCX0NCj4gK30NCj4gKw0KPiAgLyoNCj4gKyAq IEJ1aWxkIGhpbnRzLmMgZnJvbSB0aGUgc2tlbGV0b24NCj4gKyAqLw0KPiArdm9pZA0KPiArbWFr ZWhpbnRzKHZvaWQpDQo+ICt7DQo+ICsJRklMRSAqaWZwLCAqb2ZwOw0KPiArCW52bGlzdF90ICpu dmw7DQo+ICsJY2hhciBsaW5lW0JVRlNJWl07DQo+ICsJc3RydWN0IGhpbnQgKmhpbnQ7DQo+ICsN Cj4gKwlvZnAgPSBmb3BlbihwYXRoKCJoaW50cy5jLm5ldyIpLCAidyIpOw0KPiArCWlmIChvZnAg PT0gTlVMTCkNCj4gKwkJZXJyKDEsICIlcyIsIHBhdGgoImhpbnRzLmMubmV3IikpOw0KPiArCWZw cmludGYob2ZwLCAiI2luY2x1ZGUgPHN5cy90eXBlcy5oPlxuIik7DQo+ICsJZnByaW50ZihvZnAs ICIjaW5jbHVkZSA8c3lzL3N5c3RtLmg+XG4iKTsNCj4gKwlmcHJpbnRmKG9mcCwgIlxuIik7DQo+ ICsJZnByaW50ZihvZnAsICJjaGFyIHN0YXRpY19oaW50c1tdID0ge1xuIik7DQo+ICsJbnZsID0g bnZsaXN0X2NyZWF0ZSgwKTsNCj4gKwlTVEFJTFFfRk9SRUFDSChoaW50LCAmaGludHMsIGhpbnRf bmV4dCkgew0KPiArCQlpZnAgPSBmb3BlbihoaW50LT5oaW50X25hbWUsICJyIik7DQo+ICsJCWlm IChpZnAgPT0gTlVMTCkNCj4gKwkJCWVycigxLCAiJXMiLCBoaW50LT5oaW50X25hbWUpOw0KPiAr CQl3aGlsZSAoZmdldHMobGluZSwgQlVGU0laLCBpZnApICE9IE5VTEwpDQo+ICsJCQlwcm9jZXNz X2ludG9fbnZsaXN0KGxpbmUsIG52bCk7DQo+ICsJCWR1bXBfbnZsaXN0KG52bCwgb2ZwKTsNCj4g KwkJZmNsb3NlKGlmcCk7DQo+ICsJfQ0KPiArCW52bGlzdF9kZXN0cm95KG52bCk7DQo+ICsJZnBy aW50ZihvZnAsICJcIlxcMFwiXG59O1xuIik7DQo+ICsJZmNsb3NlKG9mcCk7DQo+ICsJbW92ZWlm Y2hhbmdlZChwYXRoKCJoaW50cy5jLm5ldyIpLCBwYXRoKCJoaW50cy5jIikpOw0KPiArfQ0KPiAr DQo+ICsvKg0KPiAgICogQnVpbGQgZW52LmMgZnJvbSB0aGUgc2tlbGV0b24NCj4gICAqLw0KPiAg dm9pZA0KPiAgbWFrZWVudih2b2lkKQ0KPiAgew0KPiAgCUZJTEUgKmlmcCwgKm9mcDsNCj4gLQlj aGFyIGxpbmVbQlVGU0laXSwgcmVzdWx0W0JVRlNJWl0sICpsaW5lcDsNCj4gKwludmxpc3RfdCAq bnZsOw0KPiArCWNoYXIgbGluZVtCVUZTSVpdOw0KPiAgCXN0cnVjdCBlbnZ2YXIgKmVudnZhcjsN Cj4gIA0KPiAgCW9mcCA9IGZvcGVuKHBhdGgoImVudi5jLm5ldyIpLCAidyIpOw0KPiBAQCAtMzEy LDI3ICszNDIsMjAgQEAgbWFrZWVudih2b2lkKQ0KPiAgCWZwcmludGYob2ZwLCAiI2luY2x1ZGUg PHN5cy9zeXN0bS5oPlxuIik7DQo+ICAJZnByaW50ZihvZnAsICJcbiIpOw0KPiAgCWZwcmludGYo b2ZwLCAiY2hhciBzdGF0aWNfZW52W10gPSB7XG4iKTsNCj4gKwludmwgPSBudmxpc3RfY3JlYXRl KDApOw0KPiAgCVNUQUlMUV9GT1JFQUNIKGVudnZhciwgJmVudnZhcnMsIGVudnZhcl9uZXh0KSB7 DQo+ICAJCWlmIChlbnZ2YXItPmVudl9pc19maWxlKSB7DQo+ICAJCQlpZnAgPSBmb3BlbihlbnZ2 YXItPmVudl9zdHIsICJyIik7DQo+ICAJCQlpZiAoaWZwID09IE5VTEwpDQo+ICAJCQkJZXJyKDEs ICIlcyIsIGVudnZhci0+ZW52X3N0cik7DQo+IC0JCQl3aGlsZSAoZmdldHMobGluZSwgQlVGU0la LCBpZnApICE9IE5VTEwpIHsNCj4gLQkJCQlzYW5pdGl6ZV9lbnZsaW5lKHJlc3VsdCwgbGluZSk7 DQo+IC0JCQkJLyogYW55dGhpbmcgbGVmdD8gKi8NCj4gLQkJCQlpZiAoKnJlc3VsdCA9PSAnXDAn KQ0KPiAtCQkJCQljb250aW51ZTsNCj4gLQkJCQlmcHJpbnRmKG9mcCwgIlwiJXNcXDBcIlxuIiwg cmVzdWx0KTsNCj4gLQkJCX0NCj4gKwkJCXdoaWxlIChmZ2V0cyhsaW5lLCBCVUZTSVosIGlmcCkg IT0gTlVMTCkNCj4gKwkJCQlwcm9jZXNzX2ludG9fbnZsaXN0KGxpbmUsIG52bCk7DQo+ICsJCQlk dW1wX252bGlzdChudmwsIG9mcCk7DQo+ICAJCQlmY2xvc2UoaWZwKTsNCj4gLQkJfSBlbHNlIHsN Cj4gLQkJCWxpbmVwID0gZW52dmFyLT5lbnZfc3RyOw0KPiAtCQkJc2FuaXRpemVfZW52bGluZShy ZXN1bHQsIGxpbmVwKTsNCj4gLQkJCWlmICgqcmVzdWx0ID09ICdcMCcpDQo+IC0JCQkJY29udGlu dWU7DQo+IC0JCQlmcHJpbnRmKG9mcCwgIlwiJXNcXDBcIlxuIiwgcmVzdWx0KTsNCj4gLQkJfQ0K PiArCQl9IGVsc2UNCj4gKwkJCXByb2Nlc3NfaW50b19maWxlKGVudnZhci0+ZW52X3N0ciwgb2Zw KTsNCj4gIAl9DQo+ICsJbnZsaXN0X2Rlc3Ryb3kobnZsKTsNCj4gIAlmcHJpbnRmKG9mcCwgIlwi XFwwXCJcbn07XG4iKTsNCj4gIAlmY2xvc2Uob2ZwKTsNCj4gIAltb3ZlaWZjaGFuZ2VkKHBhdGgo ImVudi5jLm5ldyIpLCBwYXRoKCJlbnYuYyIpKTsNCj4gX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX18NCj4gc3ZuLXNyYy1oZWFkQGZyZWVic2Qub3JnIG1haWxp bmcgbGlzdA0KPiBodHRwczovL2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4vbGlzdGluZm8vc3Zu LXNyYy1oZWFkDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGFueSBtYWlsIHRvICJzdm4tc3JjLWhl YWQtdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmciDQoNClRoaXMgY29tbWl0IG1pZ2h0IGJlIHJlc3Bv bnNpYmxlIGZvciBhIGJyb2tlbiBidWlsZHdvcmxkOg0KDQpbLi4uXQ0KLSAtLS0gX2Jvb3RzdHJh cC10b29scy11c3Iuc2Jpbi9jb25maWcgLS0tDQotIC0tLSBta21ha2VmaWxlLm8gLS0tDQovdXNy L3NyYy91c3Iuc2Jpbi9jb25maWcvbWttYWtlZmlsZS5jOjI4OToyODogZXJyb3I6IHRvbyBtYW55 IGFyZ3VtZW50cyB0byBmdW5jdGlvbiBjYWxsLA0KZXhwZWN0ZWQgc2luZ2xlIGFyZ3VtZW50ICdj b29raWUnLCBoYXZlIDIgYXJndW1lbnRzIGNudmxpc3RfZnJlZV9zdHJpbmcobnZsLCBjb29raWUp Ow0KICAgICAgICAgICAgICAgIH5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICBefn5+fn4NCi91c3Iv aW5jbHVkZS9zeXMvY252Lmg6MTA2OjE6IG5vdGU6ICdjbnZsaXN0X2ZyZWVfc3RyaW5nJyBkZWNs YXJlZCBoZXJlDQp2b2lkICAgIGNudmxpc3RfZnJlZV9zdHJpbmcodm9pZCAqY29va2llKTsNCl4N Ci0gLS0tIF9ib290c3RyYXAtdG9vbHMta2VyYmVyb3M1L3Rvb2xzL2FzbjFfY29tcGlsZSAtLS0N Cj09PT4ga2VyYmVyb3M1L3Rvb2xzL2FzbjFfY29tcGlsZSAob2JqLGFsbCxpbnN0YWxsKQ0KLSAt LS0gX2Jvb3RzdHJhcC10b29scy11c3Iuc2Jpbi9jb25maWcgLS0tDQoxIGVycm9yIGdlbmVyYXRl ZC4NCg0KDQotIC0tIA0KTy4gSGFydG1hbm4NCg0KSWNoIHdpZGVyc3ByZWNoZSBkZXIgTnV0enVu ZyBvZGVyIMOcYmVybWl0dGx1bmcgbWVpbmVyIERhdGVuIGbDvHINCldlcmJlendlY2tlIG9kZXIg ZsO8ciBkaWUgTWFya3QtIG9kZXIgTWVpbnVuZ3Nmb3JzY2h1bmcgKMKnIDI4IEFicy4gNCBCRFNH KS4NCi0tLS0tQkVHSU4gUEdQIFNJR05BVFVSRS0tLS0tDQoNCmlMVUVBUk1LQUIwV0lRUVpWWk16 QXR3QzJULzg2VHJTNTI4ZnlGaFlsQVVDV3o1Y01nQUtDUkRTNTI4ZnlGaFkNCmxMc2pBZjlQNEZS T0VlM0JJRENJTmFrTGdqSVFVeFZHSHlIUFlOZWhuUlZDbzVmSVc5ZmxFZmxLS1pBSjNROE4NCnA0 VVhraWFpZWlQamJsZmxyKzloNk50dkJvK3BBZjRvWmRFOWlSdm9ZeC9iVXF4c0cvZEl3ZkNHZDdi S2dZQ0cNCnVPUHlJUlgxNGNrVlQ4UUg5OXFHdEF3RXU2MlQxalRsNGhpczNiNVBnN3didXpqN04z YkgNCj04cGtoDQotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0NCg== From owner-svn-src-head@freebsd.org Thu Jul 5 18:12:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 882B91044101; Thu, 5 Jul 2018 18:12:37 +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 C713E8DCD1; Thu, 5 Jul 2018 18:12:36 +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 C48AF1047A97; Fri, 6 Jul 2018 04:12:27 +1000 (AEST) Date: Fri, 6 Jul 2018 04:12:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336002 - in head: usr.bin/netstat usr.sbin/tcpdrop In-Reply-To: <20180706031434.G2327@besplex.bde.org> Message-ID: <20180706035359.U2464@besplex.bde.org> References: <201807051702.w65H2AXB058831@repo.freebsd.org> <20180706031434.G2327@besplex.bde.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=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=1IadEPXVrUyXDEyL5O8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 18:12:37 -0000 On Fri, 6 Jul 2018, Bruce Evans wrote: > On Thu, 5 Jul 2018, Brooks Davis wrote: > >> Log: >> Work around lame warnings in ancient gcc on 32-bit platforms. >> >> Fixes r335979. > > These are correct warnings. > > Why not fix the bug instead of rorking around it? > >> Modified: head/usr.bin/netstat/inet.c >> ============================================================================== >> --- head/usr.bin/netstat/inet.c Thu Jul 5 16:43:15 2018 >> (r336001) >> +++ head/usr.bin/netstat/inet.c Thu Jul 5 17:02:10 2018 >> (r336002) >> @@ -159,12 +159,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso) >> >> bzero(xso, sizeof *xso); >> xso->xso_len = sizeof *xso; >> - xso->xso_so = (kvaddr_t)so; >> + xso->xso_so = (kvaddr_t)(long)so; > > This (and kvaddr_t having the same 64-bit size for all arches) are > unportable. > ... Lots is still broken. In just my kernel with few options: X cc1: warnings being treated as errors X ../../../kern/uipc_usrreq.c: In function 'unp_pcblist': X ../../../kern/uipc_usrreq.c:1856: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X ../../../kern/uipc_usrreq.c:1873: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X ../../../kern/uipc_usrreq.c:1874: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X ../../../kern/uipc_usrreq.c:1875: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X ../../../kern/uipc_usrreq.c:1876: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X cc1: warnings being treated as errors X ../../../netinet/in_pcb.c: In function 'in_pcbtoxinpcb': X ../../../netinet/in_pcb.c:2909: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X cc1: warnings being treated as errors X ../../../kern/kern_descrip.c: In function 'sysctl_kern_file': X ../../../kern/kern_descrip.c:3365: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X ../../../kern/kern_descrip.c:3366: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X ../../../kern/kern_descrip.c:3367: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X --- in_pcb.o --- X *** [in_pcb.o] Error code 1 X X make: stopped in /home/bde/syscn/i386/compile/Bsmp X --- uipc_usrreq.o --- X *** [uipc_usrreq.o] Error code 1 X X make: stopped in /home/bde/syscn/i386/compile/Bsmp X --- kern_descrip.o --- X *** [kern_descrip.o] Error code 1 X X make: stopped in /home/bde/syscn/i386/compile/Bsmp X cc1: warnings being treated as errors X ../../../kern/uipc_socket.c: In function 'sotoxsocket': X ../../../kern/uipc_socket.c:3988: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X ../../../kern/uipc_socket.c:3993: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] X --- uipc_socket.o --- X *** [uipc_socket.o] Error code 1 X X make: stopped in /home/bde/syscn/i386/compile/Bsmp The warnings are especially correct since they were asked for by [-Wpointer-to-int-cast]. I think this is implicit in -W or -Wall. clang doesn't even warn that it doesn't support this flag when the flag is added explicitly. It apparently silently ignores this flag, since it accepts it but doesn't even warn for downcasts. Bruce From owner-svn-src-head@freebsd.org Thu Jul 5 18:21:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8AC61044F55; Thu, 5 Jul 2018 18:21:31 +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 938748E420; Thu, 5 Jul 2018 18:21:31 +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 16EE910AFD2; Thu, 5 Jul 2018 14:21:30 -0400 (EDT) Subject: Re: svn commit: r335916 - head/sys/conf To: Konstantin Belousov References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> Date: Thu, 5 Jul 2018 11:21:28 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180705155417.GI5562@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 05 Jul 2018 14:21:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 18:21:32 -0000 On 7/5/18 8:54 AM, Konstantin Belousov wrote: > On Thu, Jul 05, 2018 at 07:56:22AM -0700, John Baldwin wrote: >> On 7/4/18 7:22 AM, Konstantin Belousov wrote: >>> On Tue, Jul 03, 2018 at 11:05:42PM +0000, Matt Macy wrote: >>>> Author: mmacy >>>> Date: Tue Jul 3 23:05:42 2018 >>>> New Revision: 335916 >>>> URL: https://svnweb.freebsd.org/changeset/base/335916 >>>> >>>> Log: >>>> Enable MODULE_TIED by default for modules compiled with the kernel >>> But why ? >> >> I think we should enable KLD_TIED to inline critical_* etc. for modules >> built as part of a kernel that are installed alongside the kernel in /boot/. > >> I don't think we need to support modules built with kernel A loaded into kernel B. >> > This is the crusial point. I do not object, but this this is a radical > change from the previous mode of modules build. > > I do not want to put words in other person mouth, but I beliee that the > original intent of KLD_TIED/MODULE_TIED was much more limited. Only some > specific modules were to be tied. Yes, this is a change though I find it the logical outcome of the original change to move away from MODULES_WITH_WORLD. And to be clear, Matt certainly only intended to use MODULE_TIED in a few places, but I think tagging all those places will be cumbersome and tedious compared to just doing it in this way. I think this will also tie into something I proposed earlier in a commit reply and that I also brought up at BSDCan which is that I think that kernel modules in ports should install their sources and build glue to some location we choose (e.g. /usr/local/sys/modules/) and that we should support a variable folks can set in their kernel config file similar to MODULES_OVERRIDE that is a list of local modules to recompile and install into /boot/kernel along with other modules (and that these recompiled modules would be TIED). The binary module from the package would still be present in /boot/modules, but the tied module in /boot/kernel would be preferred and used instead when it exists (our existing module_path already does this last part). This would replace the existing PORTS_MODULES but in a way that is more graceful and works with packages, not just ports IMO. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jul 5 18:26:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBE811045720; Thu, 5 Jul 2018 18:26:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 6F9F98EB7C; Thu, 5 Jul 2018 18:26:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id E422D86BA; Thu, 5 Jul 2018 18:26:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f51.google.com with SMTP id n24-v6so7743967lfh.3; Thu, 05 Jul 2018 11:26:48 -0700 (PDT) X-Gm-Message-State: APt69E20YF1x/HPaGRSuYXDCj39Z+lYqei+5LNd6K1QCuuhYRhK/q5wo u4g5TBjO5xKEsOZyC7Corn00N373hVuPgVjlPEM= X-Google-Smtp-Source: AAOMgpdjspnJvG0zSd3zRkpokmyk+IZX2XItWJo+VW2w/poTEn+BF+k8XSFAh2zGmGj9I0YN5rqvJT7hEDjLJajOsUs= X-Received: by 2002:a19:9481:: with SMTP id o1-v6mr5305900lfk.38.1530815207497; Thu, 05 Jul 2018 11:26:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 11:26:26 -0700 (PDT) In-Reply-To: <20180705195810.12487074@thor.intern.walstatt.dynvpn.de> References: <201807051753.w65HrpQm085589@repo.freebsd.org> <20180705195810.12487074@thor.intern.walstatt.dynvpn.de> From: Kyle Evans Date: Thu, 5 Jul 2018 13:26:26 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r336011 - head/usr.sbin/config To: "O. Hartmann" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 18:26:50 -0000 On Thu, Jul 5, 2018 at 12:57 PM, O. Hartmann wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Am Thu, 5 Jul 2018 17:53:51 +0000 (UTC) > Kyle Evans schrieb: > >> Author: kevans >> Date: Thu Jul 5 17:53:51 2018 >> New Revision: 336011 >> URL: https://svnweb.freebsd.org/changeset/base/336011 >> >> Log: >> config(8): De-dupe hint/env vars within a single file >> >> r335653 flipped the order in which hints/env files are concatenated to match >> the order in which vars are processed by the kernel. This is the other >> hammer to drop. >> >> Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the >> latest value specified for a key. This leaves some duplicates if a variable >> is specified in multiple hint/env files or via `envvar` in a kernel config, >> but the reversed order of concatenation (from r335653) makes this a >> non-issue as the latest-specified version will be seen first. >> >> This change also silently rewrote hint bits to use the same sanitization >> process that ian@ wrote for r335642. To the kernel, hints and env vars are >> basically the same thing through early boot, then get merged into the >> dynamic environment once kmem becomes available and the dynamic environment >> is created. They should be subjected to the same restrictions. >> >> MFC after: 1 month >> >> Modified: >> head/usr.sbin/config/Makefile >> head/usr.sbin/config/mkmakefile.c >> >> Modified: head/usr.sbin/config/Makefile >> ============================================================================== >> --- head/usr.sbin/config/Makefile Thu Jul 5 17:28:06 2018 (r336010) >> +++ head/usr.sbin/config/Makefile Thu Jul 5 17:53:51 2018 (r336011) >> @@ -18,7 +18,7 @@ CFLAGS+= -I. -I${SRCDIR} >> >> NO_WMISSING_VARIABLE_DECLARATIONS= >> >> -LIBADD= l sbuf >> +LIBADD= l nv sbuf >> >> CLEANFILES+= kernconf.c >> >> >> Modified: head/usr.sbin/config/mkmakefile.c >> ============================================================================== >> --- head/usr.sbin/config/mkmakefile.c Thu Jul 5 17:28:06 2018 (r336010) >> +++ head/usr.sbin/config/mkmakefile.c Thu Jul 5 17:53:51 2018 (r336011) >> @@ -49,6 +49,8 @@ static const char rcsid[] = >> #include >> #include >> #include >> +#include >> +#include >> #include >> #include "y.tab.h" >> #include "config.h" >> @@ -62,6 +64,10 @@ static void do_objs(FILE *); >> static void do_before_depend(FILE *); >> static int opteq(const char *, const char *); >> static void read_files(void); >> +static void sanitize_envline(char *result, const char *src); >> +static void process_into_file(char *line, FILE *ofp); >> +static void process_into_nvlist(char *line, nvlist_t *nvl); >> +static void dump_nvlist(nvlist_t *nvl, FILE *ofp); >> >> static void errout(const char *fmt, ...) >> { >> @@ -180,64 +186,6 @@ makefile(void) >> moveifchanged(path("Makefile.new"), path("Makefile")); >> } >> >> -/* >> - * Build hints.c from the skeleton >> - */ >> -void >> -makehints(void) >> -{ >> - FILE *ifp, *ofp; >> - char line[BUFSIZ]; >> - char *s; >> - struct hint *hint; >> - >> - ofp = fopen(path("hints.c.new"), "w"); >> - if (ofp == NULL) >> - err(1, "%s", path("hints.c.new")); >> - fprintf(ofp, "#include \n"); >> - fprintf(ofp, "#include \n"); >> - fprintf(ofp, "\n"); >> - fprintf(ofp, "char static_hints[] = {\n"); >> - STAILQ_FOREACH(hint, &hints, hint_next) { >> - ifp = fopen(hint->hint_name, "r"); >> - if (ifp == NULL) >> - err(1, "%s", hint->hint_name); >> - while (fgets(line, BUFSIZ, ifp) != NULL) { >> - /* zap trailing CR and/or LF */ >> - while ((s = strrchr(line, '\n')) != NULL) >> - *s = '\0'; >> - while ((s = strrchr(line, '\r')) != NULL) >> - *s = '\0'; >> - /* remove # comments */ >> - s = strchr(line, '#'); >> - if (s) >> - *s = '\0'; >> - /* remove any whitespace and " characters */ >> - s = line; >> - while (*s) { >> - if (*s == ' ' || *s == '\t' || *s == '"') { >> - while (*s) { >> - s[0] = s[1]; >> - s++; >> - } >> - /* start over */ >> - s = line; >> - continue; >> - } >> - s++; >> - } >> - /* anything left? */ >> - if (*line == '\0') >> - continue; >> - fprintf(ofp, "\"%s\\0\"\n", line); >> - } >> - fclose(ifp); >> - } >> - fprintf(ofp, "\"\\0\"\n};\n"); >> - fclose(ofp); >> - moveifchanged(path("hints.c.new"), path("hints.c")); >> -} >> - >> static void >> sanitize_envline(char *result, const char *src) >> { >> @@ -295,14 +243,96 @@ sanitize_envline(char *result, const char *src) >> *dst = 0; >> } >> >> +static void >> +process_into_file(char *line, FILE *ofp) >> +{ >> + char result[BUFSIZ]; >> + >> + sanitize_envline(result, line); >> + /* anything left? */ >> + if (*result == '\0') >> + return; >> + fprintf(ofp, "\"%s\\0\"\n", result); >> +} >> + >> +static void >> +process_into_nvlist(char *line, nvlist_t *nvl) >> +{ >> + char result[BUFSIZ], *s; >> + >> + sanitize_envline(result, line); >> + /* anything left? */ >> + if (*result == '\0') >> + return; >> + s = strchr(result, '='); >> + *s = 0; >> + if (nvlist_exists(nvl, result)) >> + nvlist_free(nvl, result); >> + nvlist_add_string(nvl, result, s + 1); >> +} >> + >> +static void >> +dump_nvlist(nvlist_t *nvl, FILE *ofp) >> +{ >> + const char *name; >> + void *cookie; >> + >> + if (nvl == NULL) >> + return; >> + >> + while (!nvlist_empty(nvl)) { >> + cookie = NULL; >> + name = nvlist_next(nvl, NULL, &cookie); >> + fprintf(ofp, "\"%s=%s\\0\"\n", name, >> + cnvlist_get_string(cookie)); >> + >> + cnvlist_free_string(nvl, cookie); >> + } >> +} >> + >> /* >> + * Build hints.c from the skeleton >> + */ >> +void >> +makehints(void) >> +{ >> + FILE *ifp, *ofp; >> + nvlist_t *nvl; >> + char line[BUFSIZ]; >> + struct hint *hint; >> + >> + ofp = fopen(path("hints.c.new"), "w"); >> + if (ofp == NULL) >> + err(1, "%s", path("hints.c.new")); >> + fprintf(ofp, "#include \n"); >> + fprintf(ofp, "#include \n"); >> + fprintf(ofp, "\n"); >> + fprintf(ofp, "char static_hints[] = {\n"); >> + nvl = nvlist_create(0); >> + STAILQ_FOREACH(hint, &hints, hint_next) { >> + ifp = fopen(hint->hint_name, "r"); >> + if (ifp == NULL) >> + err(1, "%s", hint->hint_name); >> + while (fgets(line, BUFSIZ, ifp) != NULL) >> + process_into_nvlist(line, nvl); >> + dump_nvlist(nvl, ofp); >> + fclose(ifp); >> + } >> + nvlist_destroy(nvl); >> + fprintf(ofp, "\"\\0\"\n};\n"); >> + fclose(ofp); >> + moveifchanged(path("hints.c.new"), path("hints.c")); >> +} >> + >> +/* >> * Build env.c from the skeleton >> */ >> void >> makeenv(void) >> { >> FILE *ifp, *ofp; >> - char line[BUFSIZ], result[BUFSIZ], *linep; >> + nvlist_t *nvl; >> + char line[BUFSIZ]; >> struct envvar *envvar; >> >> ofp = fopen(path("env.c.new"), "w"); >> @@ -312,27 +342,20 @@ makeenv(void) >> fprintf(ofp, "#include \n"); >> fprintf(ofp, "\n"); >> fprintf(ofp, "char static_env[] = {\n"); >> + nvl = nvlist_create(0); >> STAILQ_FOREACH(envvar, &envvars, envvar_next) { >> if (envvar->env_is_file) { >> ifp = fopen(envvar->env_str, "r"); >> if (ifp == NULL) >> err(1, "%s", envvar->env_str); >> - while (fgets(line, BUFSIZ, ifp) != NULL) { >> - sanitize_envline(result, line); >> - /* anything left? */ >> - if (*result == '\0') >> - continue; >> - fprintf(ofp, "\"%s\\0\"\n", result); >> - } >> + while (fgets(line, BUFSIZ, ifp) != NULL) >> + process_into_nvlist(line, nvl); >> + dump_nvlist(nvl, ofp); >> fclose(ifp); >> - } else { >> - linep = envvar->env_str; >> - sanitize_envline(result, linep); >> - if (*result == '\0') >> - continue; >> - fprintf(ofp, "\"%s\\0\"\n", result); >> - } >> + } else >> + process_into_file(envvar->env_str, ofp); >> } >> + nvlist_destroy(nvl); >> fprintf(ofp, "\"\\0\"\n};\n"); >> fclose(ofp); >> moveifchanged(path("env.c.new"), path("env.c")); >> _______________________________________________ >> 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" > > This commit might be responsible for a broken buildworld: > > [...] > - --- _bootstrap-tools-usr.sbin/config --- > - --- mkmakefile.o --- > /usr/src/usr.sbin/config/mkmakefile.c:289:28: error: too many arguments to function call, > expected single argument 'cookie', have 2 arguments cnvlist_free_string(nvl, cookie); > ~~~~~~~~~~~~~~~~~~~ ^~~~~~ > /usr/include/sys/cnv.h:106:1: note: 'cnvlist_free_string' declared here > void cnvlist_free_string(void *cookie); > ^ > - --- _bootstrap-tools-kerberos5/tools/asn1_compile --- > ===> kerberos5/tools/asn1_compile (obj,all,install) > - --- _bootstrap-tools-usr.sbin/config --- > 1 error generated. > > Hmm... indeed, r335343 removed the nvlist argument. Taking a look- I guess config(8) needs libnv to be built with bootstrap-tools and link against that- I'll poke at it for a bit and revert in short order if I can't figure it out. From owner-svn-src-head@freebsd.org Thu Jul 5 18:33:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E40E1016344; Thu, 5 Jul 2018 18:33:00 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id B2E3F8F36D; Thu, 5 Jul 2018 18:32:58 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2001:630:212:2a8:3442:2c0b:60cd:e735] (unknown [IPv6:2001:630:212:2a8:3442:2c0b:60cd:e735]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 65AD84E628; Thu, 5 Jul 2018 18:32:58 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r336011 - head/usr.sbin/config From: Andrew Turner In-Reply-To: <201807051753.w65HrpQm085589@repo.freebsd.org> Date: Thu, 5 Jul 2018 19:32:57 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6F4B0D2B-4155-42E2-8C13-8F3A355E3BC3@fubar.geek.nz> References: <201807051753.w65HrpQm085589@repo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 18:33:00 -0000 > On 5 Jul 2018, at 18:53, Kyle Evans wrote: >=20 > Author: kevans > Date: Thu Jul 5 17:53:51 2018 > New Revision: 336011 > URL: https://svnweb.freebsd.org/changeset/base/336011 >=20 > Log: > config(8): De-dupe hint/env vars within a single file >=20 > r335653 flipped the order in which hints/env files are concatenated = to match > the order in which vars are processed by the kernel. This is the = other > hammer to drop. >=20 > Use nv(9) to de-dupe entries within a single `hint` or `env` file, = using the > latest value specified for a key. This leaves some duplicates if a = variable > is specified in multiple hint/env files or via `envvar` in a kernel = config, > but the reversed order of concatenation (from r335653) makes this a > non-issue as the latest-specified version will be seen first. >=20 > This change also silently rewrote hint bits to use the same = sanitization > process that ian@ wrote for r335642. To the kernel, hints and env = vars are > basically the same thing through early boot, then get merged into the > dynamic environment once kmem becomes available and the dynamic = environment > is created. They should be subjected to the same restrictions. >=20 > MFC after: 1 month >=20 > Modified: > head/usr.sbin/config/Makefile > head/usr.sbin/config/mkmakefile.c >=20 > Modified: head/usr.sbin/config/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.sbin/config/Makefile Thu Jul 5 17:28:06 2018 = (r336010) > +++ head/usr.sbin/config/Makefile Thu Jul 5 17:53:51 2018 = (r336011) > @@ -18,7 +18,7 @@ CFLAGS+=3D -I. -I${SRCDIR} >=20 > NO_WMISSING_VARIABLE_DECLARATIONS=3D >=20 > -LIBADD=3D l sbuf > +LIBADD=3D l nv sbuf >=20 > CLEANFILES+=3D kernconf.c >=20 >=20 > Modified: head/usr.sbin/config/mkmakefile.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.sbin/config/mkmakefile.c Thu Jul 5 17:28:06 2018 = (r336010) > +++ head/usr.sbin/config/mkmakefile.c Thu Jul 5 17:53:51 2018 = (r336011) > @@ -49,6 +49,8 @@ static const char rcsid[] =3D > #include > #include > #include > +#include > +#include It looks like this breaks the build from 11 [1]. cnv.h doesn=E2=80=99t = exist there. Andrew [1] https://ci.freebsd.org/job/FreeBSD-head-aarch64-build/8427/console From owner-svn-src-head@freebsd.org Thu Jul 5 18:39:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 809B71016F2E; Thu, 5 Jul 2018 18:39:03 +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 33E3E8F89D; Thu, 5 Jul 2018 18:39:03 +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 150441DB77; Thu, 5 Jul 2018 18:39:03 +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 w65Id26o006273; Thu, 5 Jul 2018 18:39:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65Id2QE006270; Thu, 5 Jul 2018 18:39:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807051839.w65Id2QE006270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 5 Jul 2018 18:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336012 - in head: . usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . usr.sbin/config X-SVN-Commit-Revision: 336012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 18:39:03 -0000 Author: kevans Date: Thu Jul 5 18:39:02 2018 New Revision: 336012 URL: https://svnweb.freebsd.org/changeset/base/336012 Log: Fix build after r336011 Add libnv to bootstrap-tools, use ${SRCTOP}/sys headers. Modified: head/Makefile.inc1 head/usr.sbin/config/Makefile head/usr.sbin/config/mkmakefile.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jul 5 17:53:51 2018 (r336011) +++ head/Makefile.inc1 Thu Jul 5 18:39:02 2018 (r336012) @@ -2063,6 +2063,15 @@ _kerberos5_bootstrap_tools= \ .ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g} .endif +# Later config(8) requires newer libnv cnvlist* API +.if ${BOOTSTRAPPING} < 1200070 +_config= \ + lib/libnv \ + usr.sbin/config +.else +_config= usr.sbin/config +.endif + ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd bootstrap-tools: .PHONY @@ -2087,7 +2096,7 @@ bootstrap-tools: .PHONY ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ - usr.sbin/config \ + ${_config} \ ${_crunchide} \ ${_crunchgen} \ ${_nmtree} \ Modified: head/usr.sbin/config/Makefile ============================================================================== --- head/usr.sbin/config/Makefile Thu Jul 5 17:53:51 2018 (r336011) +++ head/usr.sbin/config/Makefile Thu Jul 5 18:39:02 2018 (r336012) @@ -14,7 +14,7 @@ kernconf.c: kernconf.tmpl ${FILE2C} 'char kernconfstr[] = {' ',0};' < \ ${SRCDIR}/kernconf.tmpl > kernconf.c -CFLAGS+= -I. -I${SRCDIR} +CFLAGS+= -I. -I${SRCDIR} -I${SRCTOP}/sys NO_WMISSING_VARIABLE_DECLARATIONS= Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Thu Jul 5 17:53:51 2018 (r336011) +++ head/usr.sbin/config/mkmakefile.c Thu Jul 5 18:39:02 2018 (r336012) @@ -286,7 +286,7 @@ dump_nvlist(nvlist_t *nvl, FILE *ofp) fprintf(ofp, "\"%s=%s\\0\"\n", name, cnvlist_get_string(cookie)); - cnvlist_free_string(nvl, cookie); + cnvlist_free_string(cookie); } } From owner-svn-src-head@freebsd.org Thu Jul 5 18:39:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CD5610220C4; Thu, 5 Jul 2018 18:39:43 +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 C23148FA2B; Thu, 5 Jul 2018 18:39:42 +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 w65IdZ5r017838 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Jul 2018 21:39:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w65IdZ5r017838 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w65IdYo9017837; Thu, 5 Jul 2018 21:39:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 5 Jul 2018 21:39:34 +0300 From: Konstantin Belousov To: John Baldwin Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335916 - head/sys/conf Message-ID: <20180705183934.GL5562@kib.kiev.ua> References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 18:39:43 -0000 On Thu, Jul 05, 2018 at 11:21:28AM -0700, John Baldwin wrote: > On 7/5/18 8:54 AM, Konstantin Belousov wrote: > > On Thu, Jul 05, 2018 at 07:56:22AM -0700, John Baldwin wrote: > >> On 7/4/18 7:22 AM, Konstantin Belousov wrote: > >>> On Tue, Jul 03, 2018 at 11:05:42PM +0000, Matt Macy wrote: > >>>> Author: mmacy > >>>> Date: Tue Jul 3 23:05:42 2018 > >>>> New Revision: 335916 > >>>> URL: https://svnweb.freebsd.org/changeset/base/335916 > >>>> > >>>> Log: > >>>> Enable MODULE_TIED by default for modules compiled with the kernel > >>> But why ? > >> > >> I think we should enable KLD_TIED to inline critical_* etc. for modules > >> built as part of a kernel that are installed alongside the kernel in /boot/. > > > >> I don't think we need to support modules built with kernel A loaded into kernel B. > >> > > This is the crusial point. I do not object, but this this is a radical > > change from the previous mode of modules build. > > > > I do not want to put words in other person mouth, but I beliee that the > > original intent of KLD_TIED/MODULE_TIED was much more limited. Only some > > specific modules were to be tied. > > Yes, this is a change though I find it the logical outcome of the original change > to move away from MODULES_WITH_WORLD. And to be clear, Matt certainly only > intended to use MODULE_TIED in a few places, but I think tagging all those > places will be cumbersome and tedious compared to just doing it in this way. I > think this will also tie into something I proposed earlier in a commit reply and > that I also brought up at BSDCan which is that I think that kernel modules in > ports should install their sources and build glue to some location we choose > (e.g. /usr/local/sys/modules/) and that we should support a variable folks > can set in their kernel config file similar to MODULES_OVERRIDE that is a list > of local modules to recompile and install into /boot/kernel along with other > modules (and that these recompiled modules would be TIED). The binary module > from the package would still be present in /boot/modules, but the tied module > in /boot/kernel would be preferred and used instead when it exists (our existing > module_path already does this last part). This would replace the existing > PORTS_MODULES but in a way that is more graceful and works with packages, not > just ports IMO. > I probably need to say more explicit why this change made me surprised, and the surprise is fueled even more by your proposal. It basically means that we do not need stable KBI, and detecting KBI breakage in such setup is practically impossible. Most consumers would be recompiled, except the modules used in very specific scenario: inter-release updates with the modules used from the portmgr-provided packages while packages are still built against the older release. Again, I do not object against the proposed new world order, I do not believe that KBI stability gives positive value comparing with the burden and restrictions it puts on the liveness of the stable branches. But I do believe that the migration to such new attitude to the kernel interfaces would benefit from the discussion. From owner-svn-src-head@freebsd.org Thu Jul 5 18:55:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F4FF1023D4D; Thu, 5 Jul 2018 18:55:43 +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 123D2709BB; Thu, 5 Jul 2018 18:55:43 +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 E862E1DEDF; Thu, 5 Jul 2018 18:55:42 +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 w65ItgRC016558; Thu, 5 Jul 2018 18:55:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65ItggO016556; Thu, 5 Jul 2018 18:55:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807051855.w65ItggO016556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 5 Jul 2018 18:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336013 - in head: . usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . usr.sbin/config X-SVN-Commit-Revision: 336013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 18:55:43 -0000 Author: kevans Date: Thu Jul 5 18:55:42 2018 New Revision: 336013 URL: https://svnweb.freebsd.org/changeset/base/336013 Log: Revert r336011,r336012 until I can competently test Modified: head/Makefile.inc1 head/usr.sbin/config/Makefile head/usr.sbin/config/mkmakefile.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jul 5 18:39:02 2018 (r336012) +++ head/Makefile.inc1 Thu Jul 5 18:55:42 2018 (r336013) @@ -2063,15 +2063,6 @@ _kerberos5_bootstrap_tools= \ .ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g} .endif -# Later config(8) requires newer libnv cnvlist* API -.if ${BOOTSTRAPPING} < 1200070 -_config= \ - lib/libnv \ - usr.sbin/config -.else -_config= usr.sbin/config -.endif - ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd bootstrap-tools: .PHONY @@ -2096,7 +2087,7 @@ bootstrap-tools: .PHONY ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ - ${_config} \ + usr.sbin/config \ ${_crunchide} \ ${_crunchgen} \ ${_nmtree} \ Modified: head/usr.sbin/config/Makefile ============================================================================== --- head/usr.sbin/config/Makefile Thu Jul 5 18:39:02 2018 (r336012) +++ head/usr.sbin/config/Makefile Thu Jul 5 18:55:42 2018 (r336013) @@ -14,11 +14,11 @@ kernconf.c: kernconf.tmpl ${FILE2C} 'char kernconfstr[] = {' ',0};' < \ ${SRCDIR}/kernconf.tmpl > kernconf.c -CFLAGS+= -I. -I${SRCDIR} -I${SRCTOP}/sys +CFLAGS+= -I. -I${SRCDIR} NO_WMISSING_VARIABLE_DECLARATIONS= -LIBADD= l nv sbuf +LIBADD= l sbuf CLEANFILES+= kernconf.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Thu Jul 5 18:39:02 2018 (r336012) +++ head/usr.sbin/config/mkmakefile.c Thu Jul 5 18:55:42 2018 (r336013) @@ -49,8 +49,6 @@ static const char rcsid[] = #include #include #include -#include -#include #include #include "y.tab.h" #include "config.h" @@ -64,10 +62,6 @@ static void do_objs(FILE *); static void do_before_depend(FILE *); static int opteq(const char *, const char *); static void read_files(void); -static void sanitize_envline(char *result, const char *src); -static void process_into_file(char *line, FILE *ofp); -static void process_into_nvlist(char *line, nvlist_t *nvl); -static void dump_nvlist(nvlist_t *nvl, FILE *ofp); static void errout(const char *fmt, ...) { @@ -186,6 +180,64 @@ makefile(void) moveifchanged(path("Makefile.new"), path("Makefile")); } +/* + * Build hints.c from the skeleton + */ +void +makehints(void) +{ + FILE *ifp, *ofp; + char line[BUFSIZ]; + char *s; + struct hint *hint; + + ofp = fopen(path("hints.c.new"), "w"); + if (ofp == NULL) + err(1, "%s", path("hints.c.new")); + fprintf(ofp, "#include \n"); + fprintf(ofp, "#include \n"); + fprintf(ofp, "\n"); + fprintf(ofp, "char static_hints[] = {\n"); + STAILQ_FOREACH(hint, &hints, hint_next) { + ifp = fopen(hint->hint_name, "r"); + if (ifp == NULL) + err(1, "%s", hint->hint_name); + while (fgets(line, BUFSIZ, ifp) != NULL) { + /* zap trailing CR and/or LF */ + while ((s = strrchr(line, '\n')) != NULL) + *s = '\0'; + while ((s = strrchr(line, '\r')) != NULL) + *s = '\0'; + /* remove # comments */ + s = strchr(line, '#'); + if (s) + *s = '\0'; + /* remove any whitespace and " characters */ + s = line; + while (*s) { + if (*s == ' ' || *s == '\t' || *s == '"') { + while (*s) { + s[0] = s[1]; + s++; + } + /* start over */ + s = line; + continue; + } + s++; + } + /* anything left? */ + if (*line == '\0') + continue; + fprintf(ofp, "\"%s\\0\"\n", line); + } + fclose(ifp); + } + fprintf(ofp, "\"\\0\"\n};\n"); + fclose(ofp); + moveifchanged(path("hints.c.new"), path("hints.c")); +} + static void sanitize_envline(char *result, const char *src) { @@ -243,96 +295,14 @@ sanitize_envline(char *result, const char *src) *dst = 0; } -static void -process_into_file(char *line, FILE *ofp) -{ - char result[BUFSIZ]; - - sanitize_envline(result, line); - /* anything left? */ - if (*result == '\0') - return; - fprintf(ofp, "\"%s\\0\"\n", result); -} - -static void -process_into_nvlist(char *line, nvlist_t *nvl) -{ - char result[BUFSIZ], *s; - - sanitize_envline(result, line); - /* anything left? */ - if (*result == '\0') - return; - s = strchr(result, '='); - *s = 0; - if (nvlist_exists(nvl, result)) - nvlist_free(nvl, result); - nvlist_add_string(nvl, result, s + 1); -} - -static void -dump_nvlist(nvlist_t *nvl, FILE *ofp) -{ - const char *name; - void *cookie; - - if (nvl == NULL) - return; - - while (!nvlist_empty(nvl)) { - cookie = NULL; - name = nvlist_next(nvl, NULL, &cookie); - fprintf(ofp, "\"%s=%s\\0\"\n", name, - cnvlist_get_string(cookie)); - - cnvlist_free_string(cookie); - } -} - /* - * Build hints.c from the skeleton - */ -void -makehints(void) -{ - FILE *ifp, *ofp; - nvlist_t *nvl; - char line[BUFSIZ]; - struct hint *hint; - - ofp = fopen(path("hints.c.new"), "w"); - if (ofp == NULL) - err(1, "%s", path("hints.c.new")); - fprintf(ofp, "#include \n"); - fprintf(ofp, "#include \n"); - fprintf(ofp, "\n"); - fprintf(ofp, "char static_hints[] = {\n"); - nvl = nvlist_create(0); - STAILQ_FOREACH(hint, &hints, hint_next) { - ifp = fopen(hint->hint_name, "r"); - if (ifp == NULL) - err(1, "%s", hint->hint_name); - while (fgets(line, BUFSIZ, ifp) != NULL) - process_into_nvlist(line, nvl); - dump_nvlist(nvl, ofp); - fclose(ifp); - } - nvlist_destroy(nvl); - fprintf(ofp, "\"\\0\"\n};\n"); - fclose(ofp); - moveifchanged(path("hints.c.new"), path("hints.c")); -} - -/* * Build env.c from the skeleton */ void makeenv(void) { FILE *ifp, *ofp; - nvlist_t *nvl; - char line[BUFSIZ]; + char line[BUFSIZ], result[BUFSIZ], *linep; struct envvar *envvar; ofp = fopen(path("env.c.new"), "w"); @@ -342,20 +312,27 @@ makeenv(void) fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); fprintf(ofp, "char static_env[] = {\n"); - nvl = nvlist_create(0); STAILQ_FOREACH(envvar, &envvars, envvar_next) { if (envvar->env_is_file) { ifp = fopen(envvar->env_str, "r"); if (ifp == NULL) err(1, "%s", envvar->env_str); - while (fgets(line, BUFSIZ, ifp) != NULL) - process_into_nvlist(line, nvl); - dump_nvlist(nvl, ofp); + while (fgets(line, BUFSIZ, ifp) != NULL) { + sanitize_envline(result, line); + /* anything left? */ + if (*result == '\0') + continue; + fprintf(ofp, "\"%s\\0\"\n", result); + } fclose(ifp); - } else - process_into_file(envvar->env_str, ofp); + } else { + linep = envvar->env_str; + sanitize_envline(result, linep); + if (*result == '\0') + continue; + fprintf(ofp, "\"%s\\0\"\n", result); + } } - nvlist_destroy(nvl); fprintf(ofp, "\"\\0\"\n};\n"); fclose(ofp); moveifchanged(path("env.c.new"), path("env.c")); From owner-svn-src-head@freebsd.org Thu Jul 5 19:09:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC3FB1025283 for ; Thu, 5 Jul 2018 19:08:59 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-22.consmr.mail.gq1.yahoo.com (sonic312-22.consmr.mail.gq1.yahoo.com [98.137.69.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02F097129A for ; Thu, 5 Jul 2018 19:08:58 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: PLkTH5cVM1mzoWBI7Fghpaw81cjtgEylB9lEJj6iPJ_htqjJLcfE6bXlzeU62UF mcGNR1IsMXa6upG8npR2lWUhk8Fg_BBLYKZKM2GJ8qpQYP4htyHcfGcECbolZvi3Scum1n7A0IEJ 9RGdJ_y4qroNGUe94YA7vGcLhkqEKByk9e._paJ8LUqMw.odPN.vfCDwEfScsy_rLqFFL1cdFDxQ vfTeoxaV2V_speBOi1IJh5BrTmW05amqeTeMMfKUwhJ9EaLFCT4pfy_h9vKhwuWYELBwI9ArZ4XF A_enxXl.mOBOg3aDPj75rsTEnjvxyxen3rZI_mSaI4Xw9OSxgD3eId9kR_kEKeBdHKyWsKVhT_50 wlRlmiD2mUDSmkraM0jWL4As.y4U5yUCJu8Z9cfs9MN9F7QhTWIDFEigg3cZ_mCzPv0Ws6qFBAXy rQAgwcgUNQSr3tk3fqbewiQURZm36s9C6qykYJ2AKi0MBC2nI22fnEJoklAUSiDVZbftCsSp6M_Y O0xZTmycPEhfhkkHAs7tDkJqaxkJfkjF.r7bXsaRF5_bgcivWTjV3O7KTMBOj3QFniI3WydzrEra OCEkXmPdeMXHdRwbBRFNa5OdndfxJhAZ1rzV6jEw9YPpSO5b3v2L6qJ3iNt663HvvoYgPJXjbe36 __aghce3pKmRh87Q6jXiKuRP_wKwYdCZcGOTIWgm0yGjUfA5VKu3xAQ.b3_slIX7MpzTN9DwAiAS vh02ciwVqva.YHFDhISvGBdEaoIKDCvwGIOthlU3WzdEjPE_N4YPE6SDytJv9aL1zzyRfROCyIpP 2F0KZprMNxJmUSDOwlUgaUdwtOsT1q_f7tOJ.WbKR8Hx43ImRypyekn_1MhMkgmmwsz45PQ2pqM1 mi5sZIXhxDVYatsMi8oKlhhKv6ojXUAA2415NNyg8v5HHEdZIpOkZMhBIcsYkPRyJ8ULKdJfyAFH g4SvFq_.pmHhTyL1LxaEq7TpIW8RIYg5z7.negKsYeJRXLBHymLibye.vUewEBw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Thu, 5 Jul 2018 19:08:52 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp413.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID eda95d9478b40b865b9fea1c44b72b15; Thu, 05 Jul 2018 19:08:50 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r336012 - in head: . usr.sbin/config [ broken for ci.freebsd.org's FreeBSD-head-{sparc64,powerpcspe,powerpc,i386,armv7}-build Message-Id: <2D701F12-BF14-4C95-AAEC-8184577C0B22@yahoo.com> Date: Thu, 5 Jul 2018 12:08:49 -0700 To: kevans@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 19:09:00 -0000 Examples: https://ci.freebsd.org/job/FreeBSD-head-armv7-build/568/console shows: 18:54:11=20 --- _bootstrap-tools-usr.sbin/config --- 18:54:11=20 mkmakefile.o: In function `dump_nvlist': 18:54:11=20 /usr/src/usr.sbin/config/mkmakefile.c:287: undefined reference to = `cnvlist_get_string' 18:54:11=20 /usr/src/usr.sbin/config/mkmakefile.c:289: undefined reference to = `cnvlist_free_string' 18:54:11=20 cc: error: linker command failed with exit code 1 (use -v to see = invocation) 18:54:11=20 *** [config.full] Error code 1 (i386 agrees.) As for gcc 4.2.1 (32-bit and 64-bit targets), an example: https://ci.freebsd.org/job/FreeBSD-head-powerpcspe-build/ shows: -------------------------------------------------------------- >>> stage 1: configuring the kernel -------------------------------------------------------------- cd /usr/src/sys/powerpc/conf; = PATH=3D/usr/obj/usr/src/powerpc.powerpcspe/tmp/legacy/usr/sbin:/usr/obj/us= r/src/powerpc.powerpcspe/tmp/legacy/usr/bin:/usr/obj/usr/src/powerpc.power= pcspe/tmp/legacy/bin:/usr/obj/usr/src/powerpc.powerpcspe/tmp/usr/sbin:/usr= /obj/usr/src/powerpc.powerpcspe/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin = config -d /usr/obj/usr/src/powerpc.powerpcspe/sys/MPC85XXSPE -I = '/usr/src/sys/powerpc/conf' '/usr/src/sys/powerpc/conf/MPC85XXSPE' config: /usr/src/sys/powerpc/conf/MPC85XXSPE: No error: 0 *** [buildkernel] Error code 2 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Thu Jul 5 19:40:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B440D1028947; Thu, 5 Jul 2018 19:40:04 +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 5813C72B3A; Thu, 5 Jul 2018 19:40:04 +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 CD1B810AFD2; Thu, 5 Jul 2018 15:40:02 -0400 (EDT) Subject: Re: svn commit: r335916 - head/sys/conf To: Konstantin Belousov References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <20180705183934.GL5562@kib.kiev.ua> Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <9c8d5aeb-c85b-8891-a67d-00208ad036cb@FreeBSD.org> Date: Thu, 5 Jul 2018 12:40:01 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180705183934.GL5562@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 05 Jul 2018 15:40:03 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 19:40:05 -0000 On 7/5/18 11:39 AM, Konstantin Belousov wrote: > On Thu, Jul 05, 2018 at 11:21:28AM -0700, John Baldwin wrote: >> On 7/5/18 8:54 AM, Konstantin Belousov wrote: >>> On Thu, Jul 05, 2018 at 07:56:22AM -0700, John Baldwin wrote: >>>> On 7/4/18 7:22 AM, Konstantin Belousov wrote: >>>>> On Tue, Jul 03, 2018 at 11:05:42PM +0000, Matt Macy wrote: >>>>>> Author: mmacy >>>>>> Date: Tue Jul 3 23:05:42 2018 >>>>>> New Revision: 335916 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/335916 >>>>>> >>>>>> Log: >>>>>> Enable MODULE_TIED by default for modules compiled with the kernel >>>>> But why ? >>>> >>>> I think we should enable KLD_TIED to inline critical_* etc. for modules >>>> built as part of a kernel that are installed alongside the kernel in /boot/. >>> >>>> I don't think we need to support modules built with kernel A loaded into kernel B. >>>> >>> This is the crusial point. I do not object, but this this is a radical >>> change from the previous mode of modules build. >>> >>> I do not want to put words in other person mouth, but I beliee that the >>> original intent of KLD_TIED/MODULE_TIED was much more limited. Only some >>> specific modules were to be tied. >> >> Yes, this is a change though I find it the logical outcome of the original change >> to move away from MODULES_WITH_WORLD. And to be clear, Matt certainly only >> intended to use MODULE_TIED in a few places, but I think tagging all those >> places will be cumbersome and tedious compared to just doing it in this way. I >> think this will also tie into something I proposed earlier in a commit reply and >> that I also brought up at BSDCan which is that I think that kernel modules in >> ports should install their sources and build glue to some location we choose >> (e.g. /usr/local/sys/modules/) and that we should support a variable folks >> can set in their kernel config file similar to MODULES_OVERRIDE that is a list >> of local modules to recompile and install into /boot/kernel along with other >> modules (and that these recompiled modules would be TIED). The binary module >> from the package would still be present in /boot/modules, but the tied module >> in /boot/kernel would be preferred and used instead when it exists (our existing >> module_path already does this last part). This would replace the existing >> PORTS_MODULES but in a way that is more graceful and works with packages, not >> just ports IMO. >> > > I probably need to say more explicit why this change made me surprised, > and the surprise is fueled even more by your proposal. It basically > means that we do not need stable KBI, and detecting KBI breakage in such > setup is practically impossible. Most consumers would be recompiled, > except the modules used in very specific scenario: inter-release updates > with the modules used from the portmgr-provided packages while packages > are still built against the older release. > > Again, I do not object against the proposed new world order, I do not > believe that KBI stability gives positive value comparing with the burden > and restrictions it puts on the liveness of the stable branches. > > But I do believe that the migration to such new attitude to the kernel > interfaces would benefit from the discussion. I am not quite saying to abolish KBI as I don't think we need to ban the ability to build standalone modules. I just think that modules built with a kernel should be tied to that kernel. In particular as there is a push to move from GENERIC towards MINIMAL, where more things like drivers are pulled from modules instead of the base kernel file, there is a need for modules built with the kernel to be less pessimized. It is actually that factor more than others that makes me want to tie modules built with a kernel to the kernel. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jul 5 19:46:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45BBA1029668 for ; Thu, 5 Jul 2018 19:46:46 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-22.consmr.mail.ne1.yahoo.com (sonic303-22.consmr.mail.ne1.yahoo.com [66.163.188.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D224973210 for ; Thu, 5 Jul 2018 19:46:45 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: OFIUESUVM1mlEsX1lPAXSwsLLtyHtBckuuT0Nn8..KApT0fH2h_1a_g4O7We11Q 4p8.onhciolACEELKTMOz_JaLYIgdLk0_8.C4EIDKvryBVC6Jow27zN3w_deWt.wu3tqEB5UG8gp dR2mCzMhw2nWUwDkbVt03lBRtHuWvuRUC8ff26h06R2XvR3om5FEzo4XNUtqufR1SDlu.jcta7xX bKF4tfl3S5TSuEz8RnN1uC_1_KHeak2U4lP_AGdFr7yCswLFzNKx6Pz4_WfRdSxcRumT5qi0prEs QR439hKIgmesEzLcNPWSpt7fifzJHmou1cMuDWZkunOQyRQtE2tU70qxUnhl.6H2KS6wKJuEHlIE iEEF_gQT8ruwb7MkpTvFd1ecQlONKTL9SzO63fQa6995V9mBdCnnD_w125BfMMgR3XNGcSIhisQj 5QBJcyUYzbuQbJg_xGbhbv_438j80hoPmkJ.B__zLAkgOFSvIY3pM1VqeVRFL4_vGtndqrIP5w6I ZeDS3vKrxw0KfhxktlEouepLExMfGSY5KX1s9fMklZlYP3HOixQOAw5HOe1xd6GqB0xG3AwxQa_N EHW37aDTzeAQt.PpV.DXXKatER9oWPgJYOPhIKQe1zUgwVaILD0EfsESchQgCLI4_wf_uYO0IavX u.ttORjNhNqRBkMr_FdIGYsCtDrgY6hJ_JKbzfNbEhgvIXo5sL0098RnbbeDIcWet2eub8PJtLkE xspA9wJjVnVK5XGqe5OhWWZFQG9z0cAQAw_102TUCD9okkVLQsLg3k.IzVvDW4fk8lfu7GS_DJGz wNJI8LDYxasFh6dNTz7TUC2qPeZMgu7R4.4NvznIO72XOn.VN41SLlpPpp7_tOfZ1GKCbrVyEFQp hD2onU4xj3uwMQ.KvTY.ME22u_IoV7VreATppx_mhRINg4Q1YAHSSZoLka.2Wur3B4hnn9Fmw4V1 n1KvqhkQZbie1geXb796_Vron0gdpq3mVm0u89ZXjem7ARLVZ_QLbNpxDh1zw Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Thu, 5 Jul 2018 19:46:44 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp401.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 8391765ab9d3d487c536ed63aee1322f; Thu, 05 Jul 2018 19:46:44 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r336002 - in head: usr.bin/netstat usr.sbin/tcpdrop [ as-of -r336013: still broken: ci.freebsd.org FreeBSD-head-{mips,powerpc,powerpcspe}-build Message-Id: <18A86BF1-7428-4387-8889-7EEC07CD8EDA@yahoo.com> Date: Thu, 5 Jul 2018 12:46:42 -0700 To: brooks@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 19:46:46 -0000 > Author: brooks > Date: Thu Jul 5 17:02:10 2018 > New Revision: 336002 > URL:=20 > https://svnweb.freebsd.org/changeset/base/336002 >=20 >=20 > Log: > Work around lame warnings in ancient gcc on 32-bit platforms. > =20 > Fixes r335979. [The below are the gcc 4.2.1 based 32-bit architectures.] https://ci.freebsd.org/job/FreeBSD-head-mips-build/3192/consoleText = shows (as an example): --- kern_descrip.o --- cc1: warnings being treated as errors /usr/src/sys/kern/kern_descrip.c: In function 'sysctl_kern_file': /usr/src/sys/kern/kern_descrip.c:3365: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast] /usr/src/sys/kern/kern_descrip.c:3366: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast] /usr/src/sys/kern/kern_descrip.c:3367: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast] powerpc and powerpcspe agree. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Thu Jul 5 21:14:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A991031B7B; Thu, 5 Jul 2018 21:14:41 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660083.outbound.protection.outlook.com [40.107.66.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 261EF76C82; Thu, 5 Jul 2018 21:14:41 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM (52.132.44.24) by YTOPR0101MB1787.CANPRD01.PROD.OUTLOOK.COM (52.132.44.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.20; Thu, 5 Jul 2018 21:14:39 +0000 Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM ([fe80::7098:a543:5be8:f30e]) by YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM ([fe80::7098:a543:5be8:f30e%4]) with mapi id 15.20.0930.016; Thu, 5 Jul 2018 21:14:39 +0000 From: Rick Macklem To: Andrew Gallatin , "rgrimes@freebsd.org" CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r335967 - head/sys/dev/mxge Thread-Topic: svn commit: r335967 - head/sys/dev/mxge Thread-Index: AQHUE/r/U9IY4eihoEW9Zacqgo0Qe6R/1L2AgAAUUoCAATWlZw== Date: Thu, 5 Jul 2018 21:14:39 +0000 Message-ID: References: <201807050120.w651KP5K045633@pdx.rh.CN85.dnsmgr.net>, <97ae3381-7c25-7b41-9670-84b825722f52@cs.duke.edu> In-Reply-To: <97ae3381-7c25-7b41-9670-84b825722f52@cs.duke.edu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB1787; 7:T9QDR2/7hfMqjD34muyRs7FXwe7DH3y8DrRgQlYmCU0HjqshTuhfjD8jmjEKNc4CPNiIgjrCHX33kN9GeC7kBbcPMhonvW1ZPxkMnFJa5aGkogKG7R+C0YXiaYyrfGKJEeLH2bk3FdQJrQgCpHJP8eUCO2Y9ExX3uIL3KNbWcSWoFvsFt1anF7xRYSect1klbCGnvZP0uiSjb9+qmn78lX6yhxae8zmD0l+Pc/XXsula8a5BD5Gp+2X9pca+luBh x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 0d761224-3d77-4882-0b34-08d5e2bc51d6 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB1787; x-ms-traffictypediagnostic: YTOPR0101MB1787: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:YTOPR0101MB1787; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB1787; x-forefront-prvs: 0724FCD4CD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(366004)(136003)(39860400002)(199004)(189003)(476003)(68736007)(99286004)(486006)(4326008)(446003)(11346002)(6506007)(53546011)(106356001)(45080400002)(2501003)(55016002)(105586002)(86362001)(74316002)(9686003)(2906002)(305945005)(5660300001)(14444005)(256004)(2171002)(74482002)(6246003)(53936002)(110136005)(316002)(54906003)(26005)(786003)(97736004)(8936002)(186003)(33656002)(478600001)(25786009)(229853002)(6436002)(102836004)(5250100002)(2900100001)(81166006)(7696005)(81156014)(76176011)(14454004)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB1787; H:YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: GBGSavHlhZDsvBfEjfGs0TyenOkjohOZb6KTYvH9ofUH+rF/mM6w7z++0LBJ3nx0KuM1IuGyukH8tei4Yvg4iJdZcZLNJBYABv9YH3dk+wb4ZrDs+pZS0TUnEVbsS7k2+rbBl+712TxeUgwcEDC9uhDvSPJKIf9LYOZGSyxL/HwS6VzlH8kOB6PeoN/TL1T1rmEf8jQ6YbV+S85XorGoWDvqp5f/Pw0TJ/DCwe3qcdEYSqzirA8g75NWD63u//1mDKkOOMb6DFRQjRB+TjG6nJcsc339vbSQM/yJ226MWbxo+LQfEJlqr5ptKji+YBUZFwf3GPUFwXOKgSk6mjS33+d2IacQ7tT/cWpyfGE8qME= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 0d761224-3d77-4882-0b34-08d5e2bc51d6 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2018 21:14:39.7035 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1787 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 21:14:41 -0000 Andrew Gallatin wrote: On 7/4/18 9:20 PM, Rodney W. Grimes wrote: [stuff snipped] >> >> It is using a magic constant twice, where one has a >> derived value that is dependent on the value of the other. >> That is bad and error prone and does not document that >> one depends on the other. Please fix this. Or at least >> make 65536 a #define so that it only needs changed one >> place and clearly shows the interdependence of these >> values. > >To me, 65536 is one of the few cases where the magic number is >more meaningful than a name. But fine, if you feel that >strongly about it, I'll change it for you. Btw, in general, if_hw_tsomax and if_hw_tsomaxsegsize are not related or the same value. It just happens that they both appear to be related to 64K in this case. (I believe this is fairly common, since the original Microsoft "standard" used 64K as a limit, since it was stored in 16bits.) if_hw_tsomax is the maximum size of the entire TSO segment, including MAC level headers (commonly 64K, due to Mircosoft... but could be larger if the hardware guys chose to do so). if_hw_tsomaxsegsize is the maximum size of contiguous memory that a "chunk" of the TSO segment can be stored in for handling by the driver's transmit side. Since higher level code such as NFS (and iSCSI, I think?) uses MCLBYTE clusters, anything 2K or higher normally works the same. Not sure about sosend(), but I think it also copies the data into MCLBYTE clusters? This would change if someday jumbo mbuf clusters become the norm. (I tried changing the NFS code to use jumbo clusters, but it would result in fragmentation of the memory used for mbuf cluster allocation, so I never committed it.) rick ps: And I'll admit I don't find 65536 very magic;-) From owner-svn-src-head@freebsd.org Thu Jul 5 21:38:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919D51033C83; Thu, 5 Jul 2018 21:38:55 +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 43D8F77A2D; Thu, 5 Jul 2018 21:38:55 +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 20D1E1F900; Thu, 5 Jul 2018 21:38:55 +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 w65LcsuU098143; Thu, 5 Jul 2018 21:38:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65LcsWZ098142; Thu, 5 Jul 2018 21:38:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201807052138.w65LcsWZ098142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 5 Jul 2018 21:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336016 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 336016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 21:38:55 -0000 Author: cem Date: Thu Jul 5 21:38:54 2018 New Revision: 336016 URL: https://svnweb.freebsd.org/changeset/base/336016 Log: ath(4): Fix typo in debugging code PR: 229548 Submitted by: David Binderman Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jul 5 20:20:06 2018 (r336015) +++ head/sys/dev/ath/if_ath.c Thu Jul 5 21:38:54 2018 (r336016) @@ -2151,7 +2151,7 @@ ath_intr(void *arg) if (ah->ah_syncstate != 0) { int i; for (i = 0; i < 32; i++) - if (ah->ah_syncstate & (i << i)) + if (ah->ah_syncstate & (1 << i)) sc->sc_intr_stats.sync_intr[i]++; } From owner-svn-src-head@freebsd.org Thu Jul 5 22:56:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94443103C1B6; Thu, 5 Jul 2018 22:56:15 +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 41CCD7AF59; Thu, 5 Jul 2018 22:56:15 +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 1EEEE205F9; Thu, 5 Jul 2018 22:56:15 +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 w65MuF0Z038729; Thu, 5 Jul 2018 22:56:15 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w65MuETx038724; Thu, 5 Jul 2018 22:56:14 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201807052256.w65MuETx038724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Thu, 5 Jul 2018 22:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336017 - in head: include/rpcsvc lib/libutil libexec/rpc.rquotad sys/cddl/contrib/opensolaris/uts/common/fs/zfs usr.bin/quota X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: in head: include/rpcsvc lib/libutil libexec/rpc.rquotad sys/cddl/contrib/opensolaris/uts/common/fs/zfs usr.bin/quota X-SVN-Commit-Revision: 336017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 22:56:15 -0000 Author: sef Date: Thu Jul 5 22:56:13 2018 New Revision: 336017 URL: https://svnweb.freebsd.org/changeset/base/336017 Log: This exposes ZFS user and group quotas via the normal quatactl(2) mechanism. (Read-only at this point, however.) In particular, this is to allow rpc.rquotad query quotas for NFS mounts, allowing users to see their quotas on the hosts using the datasets. The changes specifically: * Add new RPC entry points for querying quotas. * Changes the library routines to allow non-UFS quotas. * Changes rquotad to check for quotas on mounted filesystems, rather than being limited to entries in /etc/fstab * Lastly, adds a VFS entry-point for ZFS to query quotas. Note that this makes one unavoidable behavioural change: if quotas are enabled, then they can be queried, as opposed to the current method of checking for quotas being specified in fstab. (With ZFS, if there are user or group quotas, they're used, always.) Reviewed by: delphij, mav Approved by: mav Sponsored by: iXsystems Inc Differential Revision: https://reviews.freebsd.org/D15886 Modified: head/include/rpcsvc/rquota.x head/lib/libutil/quotafile.c head/libexec/rpc.rquotad/rquotad.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/usr.bin/quota/quota.c Modified: head/include/rpcsvc/rquota.x ============================================================================== --- head/include/rpcsvc/rquota.x Thu Jul 5 21:38:54 2018 (r336016) +++ head/include/rpcsvc/rquota.x Thu Jul 5 22:56:13 2018 (r336017) @@ -1,24 +1,55 @@ +/* @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC */ +/* @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro */ + /* * Remote quota protocol * Requires unix authentication */ #ifndef RPC_HDR -%#ifndef lint -%/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/ -%/*static char sccsid[] = "from: @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC";*/ -%#endif /* not lint */ %#include %__FBSDID("$FreeBSD$"); #endif const RQ_PATHLEN = 1024; +struct sq_dqblk { + unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */ + unsigned int rq_bsoftlimit; /* preferred limit on disk blks */ + unsigned int rq_curblocks; /* current block count */ + unsigned int rq_fhardlimit; /* absolute limit on allocated files */ + unsigned int rq_fsoftlimit; /* preferred file limit */ + unsigned int rq_curfiles; /* current # allocated files */ + unsigned int rq_btimeleft; /* time left for excessive disk use */ + unsigned int rq_ftimeleft; /* time left for excessive files */ +}; + struct getquota_args { string gqa_pathp; /* path to filesystem of interest */ - int gqa_uid; /* inquire about quota for uid */ + int gqa_uid; /* Inquire about quota for uid */ }; +struct setquota_args { + int sqa_qcmd; + string sqa_pathp; /* path to filesystem of interest */ + int sqa_id; /* Set quota for uid */ + sq_dqblk sqa_dqblk; +}; + +struct ext_getquota_args { + string gqa_pathp; /* path to filesystem of interest */ + int gqa_type; /* Type of quota info is needed about */ + int gqa_id; /* Inquire about quota for id */ +}; + +struct ext_setquota_args { + int sqa_qcmd; + string sqa_pathp; /* path to filesystem of interest */ + int sqa_id; /* Set quota for id */ + int sqa_type; /* Type of quota to set */ + sq_dqblk sqa_dqblk; +}; + /* * remote quota structure */ @@ -37,7 +68,7 @@ struct rquota { enum gqr_status { Q_OK = 1, /* quota returned */ - Q_NOQUOTA = 2, /* noquota for uid */ + Q_NOQUOTA = 2, /* noquota for uid */ Q_EPERM = 3 /* no permission to access quota */ }; @@ -50,6 +81,15 @@ case Q_EPERM: void; }; +union setquota_rslt switch (gqr_status status) { +case Q_OK: + rquota sqr_rquota; /* valid if status == Q_OK */ +case Q_NOQUOTA: + void; +case Q_EPERM: + void; +}; + program RQUOTAPROG { version RQUOTAVERS { /* @@ -63,5 +103,42 @@ program RQUOTAPROG { */ getquota_rslt RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2; + + /* + * Set all quotas + */ + setquota_rslt + RQUOTAPROC_SETQUOTA(setquota_args) = 3; + + /* + * Get active quotas only + */ + setquota_rslt + RQUOTAPROC_SETACTIVEQUOTA(setquota_args) = 4; } = 1; + version EXT_RQUOTAVERS { + /* + * Get all quotas + */ + getquota_rslt + RQUOTAPROC_GETQUOTA(ext_getquota_args) = 1; + + /* + * Get active quotas only + */ + getquota_rslt + RQUOTAPROC_GETACTIVEQUOTA(ext_getquota_args) = 2; + + /* + * Set all quotas + */ + setquota_rslt + RQUOTAPROC_SETQUOTA(ext_setquota_args) = 3; + + /* + * Set active quotas only + */ + setquota_rslt + RQUOTAPROC_SETACTIVEQUOTA(ext_setquota_args) = 4; + } = 2; } = 100011; Modified: head/lib/libutil/quotafile.c ============================================================================== --- head/lib/libutil/quotafile.c Thu Jul 5 21:38:54 2018 (r336016) +++ head/lib/libutil/quotafile.c Thu Jul 5 22:56:13 2018 (r336017) @@ -120,8 +120,6 @@ quota_open(struct fstab *fs, int quotatype, int openfl struct stat st; int qcmd, serrno; - if (strcmp(fs->fs_vfstype, "ufs")) - return (NULL); if ((qf = calloc(1, sizeof(*qf))) == NULL) return (NULL); qf->fd = -1; @@ -130,10 +128,15 @@ quota_open(struct fstab *fs, int quotatype, int openfl if (stat(qf->fsname, &st) != 0) goto error; qf->dev = st.st_dev; - serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname)); qcmd = QCMD(Q_GETQUOTASIZE, quotatype); if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) == 0) return (qf); + /* We only check the quota file for ufs */ + if (strcmp(fs->fs_vfstype, "ufs")) { + errno = 0; + goto error; + } + serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname)); if (serrno == 0) { errno = EOPNOTSUPP; goto error; Modified: head/libexec/rpc.rquotad/rquotad.c ============================================================================== --- head/libexec/rpc.rquotad/rquotad.c Thu Jul 5 21:38:54 2018 (r336016) +++ head/libexec/rpc.rquotad/rquotad.c Thu Jul 5 22:56:13 2018 (r336017) @@ -28,18 +28,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -static void rquota_service(struct svc_req *request, SVCXPRT *transp); +static void rquota_service_1(struct svc_req *request, SVCXPRT *transp); +static void rquota_service_2(struct svc_req *request, SVCXPRT *transp); static void sendquota(struct svc_req *request, SVCXPRT *transp); -static void initfs(void); -static int getfsquota(long id, char *path, struct dqblk *dqblk); +static void sendquota_extended(struct svc_req *request, SVCXPRT *transp); +static int getfsquota(int type, long id, char *path, struct dqblk *dqblk); -static struct quotafile **qfa; /* array of qfs */ -static int nqf, szqf; /* number of qfs and size of array */ static int from_inetd = 1; +static int debug = 0; static void cleanup(int sig) @@ -51,19 +52,32 @@ cleanup(int sig) } int -main(void) +main(int argc, char **argv) { SVCXPRT *transp; int ok; struct sockaddr_storage from; socklen_t fromlen; + int vers; + int ch; + while ((ch = getopt(argc, argv, "d")) != -1) { + switch (ch) { + case 'd': + debug++; + break; + default: + break; + } + } + fromlen = sizeof(from); if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) from_inetd = 0; if (!from_inetd) { - daemon(0, 0); + if (!debug) + daemon(0, 0); (void)rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); (void)signal(SIGINT, cleanup); (void)signal(SIGTERM, cleanup); @@ -79,27 +93,40 @@ main(void) syslog(LOG_ERR, "couldn't create udp service."); exit(1); } + vers = RQUOTAVERS; ok = svc_reg(transp, RQUOTAPROG, RQUOTAVERS, - rquota_service, NULL); + rquota_service_1, NULL); + if (ok) { + vers = EXT_RQUOTAVERS; + ok = svc_reg(transp, RQUOTAPROG, EXT_RQUOTAVERS, + rquota_service_2, NULL); + } } else { - ok = svc_create(rquota_service, + vers = RQUOTAVERS; + ok = svc_create(rquota_service_1, RQUOTAPROG, RQUOTAVERS, "udp"); + if (ok) { + vers = EXT_RQUOTAVERS; + ok = svc_create(rquota_service_2, + RQUOTAPROG, EXT_RQUOTAVERS, "udp"); + + } } if (!ok) { syslog(LOG_ERR, - "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", - from_inetd ? "(inetd)" : "udp"); + "unable to register (RQUOTAPROG, %s, %s)", + vers == RQUOTAVERS ? "RQUOTAVERS" : "EXT_RQUOTAVERS", + from_inetd ? "(inetd)" : "udp"); exit(1); } - initfs(); svc_run(); syslog(LOG_ERR, "svc_run returned"); exit(1); } static void -rquota_service(struct svc_req *request, SVCXPRT *transp) +rquota_service_2(struct svc_req *request, SVCXPRT *transp) { switch (request->rq_proc) { @@ -108,6 +135,26 @@ rquota_service(struct svc_req *request, SVCXPRT *trans break; case RQUOTAPROC_GETQUOTA: case RQUOTAPROC_GETACTIVEQUOTA: + sendquota_extended(request, transp); + break; + default: + svcerr_noproc(transp); + break; + } + if (from_inetd) + exit(0); +} + +static void +rquota_service_1(struct svc_req *request, SVCXPRT *transp) +{ + + switch (request->rq_proc) { + case NULLPROC: + (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL); + break; + case RQUOTAPROC_GETQUOTA: + case RQUOTAPROC_GETACTIVEQUOTA: sendquota(request, transp); break; default: @@ -136,7 +183,7 @@ sendquota(struct svc_req *request, SVCXPRT *transp) if (request->rq_cred.oa_flavor != AUTH_UNIX) { /* bad auth */ getq_rslt.status = Q_EPERM; - } else if (!getfsquota(getq_args.gqa_uid, getq_args.gqa_pathp, &dqblk)) { + } else if (!getfsquota(USRQUOTA, getq_args.gqa_uid, getq_args.gqa_pathp, &dqblk)) { /* failed, return noquota */ getq_rslt.status = Q_NOQUOTA; } else { @@ -172,38 +219,55 @@ sendquota(struct svc_req *request, SVCXPRT *transp) } static void -initfs(void) +sendquota_extended(struct svc_req *request, SVCXPRT *transp) { - struct fstab *fs; + struct ext_getquota_args getq_args; + struct getquota_rslt getq_rslt; + struct dqblk dqblk; + struct timeval timev; + int scale; - setfsent(); - szqf = 8; - if ((qfa = malloc(szqf * sizeof *qfa)) == NULL) - goto enomem; - while ((fs = getfsent())) { - if (strcmp(fs->fs_vfstype, "ufs")) - continue; - if (nqf >= szqf) { - szqf *= 2; - if ((qfa = reallocf(qfa, szqf * sizeof *qfa)) == NULL) - goto enomem; - } - if ((qfa[nqf] = quota_open(fs, USRQUOTA, O_RDONLY)) == NULL) { - if (errno != EOPNOTSUPP) - goto fserr; - continue; - } - ++nqf; - /* XXX */ + bzero(&getq_args, sizeof(getq_args)); + if (!svc_getargs(transp, (xdrproc_t)xdr_ext_getquota_args, &getq_args)) { + svcerr_decode(transp); + return; } - endfsent(); - return; -enomem: - syslog(LOG_ERR, "out of memory"); - exit(1); -fserr: - syslog(LOG_ERR, "%s: %s", fs->fs_file, strerror(errno)); - exit(1); + if (request->rq_cred.oa_flavor != AUTH_UNIX) { + /* bad auth */ + getq_rslt.status = Q_EPERM; + } else if (!getfsquota(getq_args.gqa_type, getq_args.gqa_id, getq_args.gqa_pathp, &dqblk)) { + /* failed, return noquota */ + getq_rslt.status = Q_NOQUOTA; + } else { + gettimeofday(&timev, NULL); + getq_rslt.status = Q_OK; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_active = TRUE; + scale = 1 << flsll(dqblk.dqb_bhardlimit >> 32); + getq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize = + DEV_BSIZE * scale; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit = + dqblk.dqb_bhardlimit / scale; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit = + dqblk.dqb_bsoftlimit / scale; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks = + dqblk.dqb_curblocks / scale; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit = + dqblk.dqb_ihardlimit; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_fsoftlimit = + dqblk.dqb_isoftlimit; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_curfiles = + dqblk.dqb_curinodes; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_btimeleft = + dqblk.dqb_btime - timev.tv_sec; + getq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft = + dqblk.dqb_itime - timev.tv_sec; + } + if (!svc_sendreply(transp, (xdrproc_t)xdr_getquota_rslt, &getq_rslt)) + svcerr_systemerr(transp); + if (!svc_freeargs(transp, (xdrproc_t)xdr_getquota_args, &getq_args)) { + syslog(LOG_ERR, "unable to free arguments"); + exit(1); + } } /* @@ -211,12 +275,43 @@ fserr: * Return 0 if fail, 1 otherwise */ static int -getfsquota(long id, char *path, struct dqblk *dqblk) +getfsquota(int type, long id, char *path, struct dqblk *dqblk) { - int i; + struct quotafile *qf; + /* + * Remote quota checking is limited to mounted filesystems. + * Since UFS and ZFS support the quota system calls, we + * only need to make an fstab object that has the path, and + * a blank name for the filesystem type. + * This allows the quota_open() call to work the way we + * expect it to. + * + * The static char declaration is because compiler warnings + * don't allow passing a const char * to a char *. + */ + int rv; + static char blank[] = ""; + struct fstab fst; - for (i = 0; i < nqf; ++i) - if (quota_check_path(qfa[i], path) == 1) - return (quota_read(qfa[i], dqblk, id) == 0); - return (0); + fst.fs_file = path; + fst.fs_mntops = blank; + fst.fs_vfstype = blank; + + if (type != USRQUOTA && type != GRPQUOTA) + return (0); + + qf = quota_open(&fst, type, O_RDONLY); + if (debug) + warnx("quota_open(<%s, %s>, %d) returned %p", + fst.fs_file, fst.fs_mntops, type, + qf); + if (qf == NULL) + return (0); + + rv = quota_read(qf, dqblk, id) == 0; + quota_close(qf); + if (debug) + warnx("getfsquota(%d, %ld, %s, %p) -> %d", + type, id, path, dqblk, rv); + return (rv); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jul 5 21:38:54 2018 (r336016) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jul 5 22:56:13 2018 (r336017) @@ -64,6 +64,8 @@ #include #include #include +#include + #include "zfs_comutil.h" struct mtx zfs_debug_mtx; @@ -90,6 +92,7 @@ static int zfs_version_zpl = ZPL_VERSION; SYSCTL_INT(_vfs_zfs_version, OID_AUTO, zpl, CTLFLAG_RD, &zfs_version_zpl, 0, "ZPL_VERSION"); +static int zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg); static int zfs_mount(vfs_t *vfsp); static int zfs_umount(vfs_t *vfsp, int fflag); static int zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp); @@ -111,6 +114,7 @@ struct vfsops zfs_vfsops = { .vfs_sync = zfs_sync, .vfs_checkexp = zfs_checkexp, .vfs_fhtovp = zfs_fhtovp, + .vfs_quotactl = zfs_quotactl, }; VFS_SET(zfs_vfsops, zfs, VFCF_JAIL | VFCF_DELEGADMIN); @@ -121,6 +125,159 @@ VFS_SET(zfs_vfsops, zfs, VFCF_JAIL | VFCF_DELEGADMIN); * from being unloaded after a umount -f */ static uint32_t zfs_active_fs_count = 0; + +static int +zfs_getquota(zfsvfs_t *zfsvfs, uid_t id, int isgroup, struct dqblk64 *dqp) +{ + int error = 0; + char buf[32]; + int err; + uint64_t usedobj, quotaobj; + uint64_t quota, used = 0; + timespec_t now; + + usedobj = isgroup ? DMU_GROUPUSED_OBJECT : DMU_USERUSED_OBJECT; + quotaobj = isgroup ? zfsvfs->z_groupquota_obj : zfsvfs->z_userquota_obj; + + if (quotaobj == 0 || zfsvfs->z_replay) { + error = ENOENT; + goto done; + } + (void)sprintf(buf, "%llx", (longlong_t)id); + if ((error = zap_lookup(zfsvfs->z_os, quotaobj, + buf, sizeof(quota), 1, "a)) != 0) { + dprintf("%s(%d): quotaobj lookup failed\n", __FUNCTION__, __LINE__); + goto done; + } + /* + * quota(8) uses bsoftlimit as "quoota", and hardlimit as "limit". + * So we set them to be the same. + */ + dqp->dqb_bsoftlimit = dqp->dqb_bhardlimit = btodb(quota); + error = zap_lookup(zfsvfs->z_os, usedobj, buf, sizeof(used), 1, &used); + if (error && error != ENOENT) { + dprintf("%s(%d): usedobj failed; %d\n", __FUNCTION__, __LINE__, error); + goto done; + } + dqp->dqb_curblocks = btodb(used); + dqp->dqb_ihardlimit = dqp->dqb_isoftlimit = 0; + vfs_timestamp(&now); + /* + * Setting this to 0 causes FreeBSD quota(8) to print + * the number of days since the epoch, which isn't + * particularly useful. + */ + dqp->dqb_btime = dqp->dqb_itime = now.tv_sec; +done: + return (error); +} + +static int +zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg) +{ + zfsvfs_t *zfsvfs = vfsp->vfs_data; + struct thread *td; + int cmd, type, error = 0; + int bitsize; + uint64_t fuid; + zfs_userquota_prop_t quota_type; + struct dqblk64 dqblk = { 0 }; + + td = curthread; + cmd = cmds >> SUBCMDSHIFT; + type = cmds & SUBCMDMASK; + + ZFS_ENTER(zfsvfs); + if (id == -1) { + switch (type) { + case USRQUOTA: + id = td->td_ucred->cr_ruid; + break; + case GRPQUOTA: + id = td->td_ucred->cr_rgid; + break; + default: + error = EINVAL; + goto done; + } + } + /* + * Map BSD type to: + * ZFS_PROP_USERUSED, + * ZFS_PROP_USERQUOTA, + * ZFS_PROP_GROUPUSED, + * ZFS_PROP_GROUPQUOTA + */ + switch (cmd) { + case Q_SETQUOTA: + case Q_SETQUOTA32: + if (type == USRQUOTA) + quota_type = ZFS_PROP_USERQUOTA; + else if (type == GRPQUOTA) + quota_type = ZFS_PROP_GROUPQUOTA; + else + error = EINVAL; + break; + case Q_GETQUOTA: + case Q_GETQUOTA32: + if (type == USRQUOTA) + quota_type = ZFS_PROP_USERUSED; + else if (type == GRPQUOTA) + quota_type = ZFS_PROP_GROUPUSED; + else + error = EINVAL; + break; + } + + /* + * Depending on the cmd, we may need to get + * the ruid and domain (see fuidstr_to_sid?), + * the fuid (how?), or other information. + * Create fuid using zfs_fuid_create(zfsvfs, id, + * ZFS_OWNER or ZFS_GROUP, cr, &fuidp)? + * I think I can use just the id? + * + * Look at zfs_fuid_overquota() to look up a quota. + * zap_lookup(something, quotaobj, fuidstring, sizeof(long long), 1, "a) + * + * See zfs_set_userquota() to set a quota. + */ + if ((u_int)type >= MAXQUOTAS) { + error = EINVAL; + goto done; + } + + switch (cmd) { + case Q_GETQUOTASIZE: + bitsize = 64; + error = copyout(&bitsize, arg, sizeof(int)); + break; + case Q_QUOTAON: + // As far as I can tell, you can't turn quotas on or off on zfs + error = 0; + break; + case Q_QUOTAOFF: + error = ENOTSUP; + break; + case Q_SETQUOTA: + error = copyin(&dqblk, arg, sizeof(dqblk)); + if (error == 0) + error = zfs_set_userquota(zfsvfs, quota_type, + "", id, dbtob(dqblk.dqb_bhardlimit)); + break; + case Q_GETQUOTA: + error = zfs_getquota(zfsvfs, id, type == GRPQUOTA, &dqblk); + if (error == 0) + error = copyout(&dqblk, arg, sizeof(dqblk)); + break; + default: + error = EINVAL; + break; + } +done: + ZFS_EXIT(zfsvfs); + return (error); +} /*ARGSUSED*/ static int Modified: head/usr.bin/quota/quota.c ============================================================================== --- head/usr.bin/quota/quota.c Thu Jul 5 21:38:54 2018 (r336016) +++ head/usr.bin/quota/quota.c Thu Jul 5 22:56:13 2018 (r336017) @@ -98,7 +98,7 @@ static int getufsquota(struct fstab *fs, struct quotau int quotatype); static int getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype); -static int callaurpc(char *host, int prognum, int versnum, int procnum, +static enum clnt_stat callaurpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, char *in, xdrproc_t outproc, char *out); static int alldigits(char *s); @@ -568,22 +568,18 @@ getufsquota(struct fstab *fs, struct quotause *qup, lo static int getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype) { - struct getquota_args gq_args; + struct ext_getquota_args gq_args; + struct getquota_args old_gq_args; struct getquota_rslt gq_rslt; struct dqblk *dqp = &qup->dqblk; struct timeval tv; char *cp, host[NI_MAXHOST]; + enum clnt_stat call_stat; if (fst->f_flags & MNT_LOCAL) return (0); /* - * rpc.rquotad does not support group quotas - */ - if (quotatype != USRQUOTA) - return (0); - - /* * must be some form of "hostname:/path" */ cp = fst->f_mntfromname; @@ -604,12 +600,27 @@ getnfsquota(struct statfs *fst, struct quotause *qup, return (0); gq_args.gqa_pathp = cp + 1; - gq_args.gqa_uid = id; - if (callaurpc(host, RQUOTAPROG, RQUOTAVERS, - RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_getquota_args, (char *)&gq_args, - (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt) != 0) - return (0); + gq_args.gqa_id = id; + gq_args.gqa_type = quotatype; + call_stat = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS, + RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args, + (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt); + if (call_stat == RPC_PROGVERSMISMATCH) { + if (quotatype == USRQUOTA) { + old_gq_args.gqa_pathp = cp + 1; + old_gq_args.gqa_uid = id; + call_stat = callaurpc(host, RQUOTAPROG, RQUOTAVERS, + RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_getquota_args, (char *)&old_gq_args, + (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt); + } else { + /* Old rpc quota does not support group type */ + return (0); + } + } + if (call_stat != 0) + return (call_stat); + switch (gq_rslt.status) { case Q_NOQUOTA: break; @@ -650,7 +661,7 @@ getnfsquota(struct statfs *fst, struct quotause *qup, return (0); } -static int +static enum clnt_stat callaurpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, char *in, xdrproc_t outproc, char *out) { @@ -671,8 +682,7 @@ callaurpc(char *host, int prognum, int versnum, int pr tottimeout.tv_usec = 0; clnt_stat = clnt_call(client, procnum, inproc, in, outproc, out, tottimeout); - - return ((int) clnt_stat); + return (clnt_stat); } static int From owner-svn-src-head@freebsd.org Thu Jul 5 23:18:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06132103E124; Thu, 5 Jul 2018 23:18:14 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [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 8E1367BC0A; Thu, 5 Jul 2018 23:18:13 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w65NI6un023293 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Jul 2018 01:18:07 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jhb@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 w65NI3Rg089573 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 6 Jul 2018 06:18:03 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r335916 - head/sys/conf To: John Baldwin , Konstantin Belousov References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B3EA725.4010202@grosbein.net> Date: Fri, 6 Jul 2018 06:17:57 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 23:18:14 -0000 06.07.2018 1:21, John Baldwin wrote: > Yes, this is a change though I find it the logical outcome of the original change > to move away from MODULES_WITH_WORLD. And to be clear, Matt certainly only > intended to use MODULE_TIED in a few places, but I think tagging all those > places will be cumbersome and tedious compared to just doing it in this way. I > think this will also tie into something I proposed earlier in a commit reply and > that I also brought up at BSDCan which is that I think that kernel modules in > ports should install their sources and build glue to some location we choose > (e.g. /usr/local/sys/modules/) and that we should support a variable folks > can set in their kernel config file similar to MODULES_OVERRIDE that is a list > of local modules to recompile and install into /boot/kernel along with other > modules (and that these recompiled modules would be TIED). The binary module > from the package would still be present in /boot/modules, but the tied module > in /boot/kernel would be preferred and used instead when it exists (our existing > module_path already does this last part). This would replace the existing > PORTS_MODULES but in a way that is more graceful and works with packages, not > just ports IMO. I'm not sure I understand the topic quite right, but please do not drop MODULES_WITH_WORLD support at it allows us to quickly rebuild the kernel in case of slight changes of its config file not changing ABI and/or similar source changes without HUGE modules compilation overhead. Also, we should not use /usr/local/sys/modules/ as /usr/local can be inaccessible for the loader. Better use /boot/modules/local or /boot/local as /boot is guaranteed to be accessible. From owner-svn-src-head@freebsd.org Thu Jul 5 23:59:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC45A104198C; Thu, 5 Jul 2018 23:59:10 +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 A04757D22F; Thu, 5 Jul 2018 23:59:10 +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 EDD7710A87D; Thu, 5 Jul 2018 19:59:07 -0400 (EDT) Subject: Re: svn commit: r335916 - head/sys/conf To: Eugene Grosbein , Konstantin Belousov References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> Date: Thu, 5 Jul 2018 16:59:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <5B3EA725.4010202@grosbein.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 05 Jul 2018 19:59:08 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 23:59:11 -0000 On 7/5/18 4:17 PM, Eugene Grosbein wrote: > 06.07.2018 1:21, John Baldwin wrote: > >> Yes, this is a change though I find it the logical outcome of the original change >> to move away from MODULES_WITH_WORLD. And to be clear, Matt certainly only >> intended to use MODULE_TIED in a few places, but I think tagging all those >> places will be cumbersome and tedious compared to just doing it in this way. I >> think this will also tie into something I proposed earlier in a commit reply and >> that I also brought up at BSDCan which is that I think that kernel modules in >> ports should install their sources and build glue to some location we choose >> (e.g. /usr/local/sys/modules/) and that we should support a variable folks >> can set in their kernel config file similar to MODULES_OVERRIDE that is a list >> of local modules to recompile and install into /boot/kernel along with other >> modules (and that these recompiled modules would be TIED). The binary module >> from the package would still be present in /boot/modules, but the tied module >> in /boot/kernel would be preferred and used instead when it exists (our existing >> module_path already does this last part). This would replace the existing >> PORTS_MODULES but in a way that is more graceful and works with packages, not >> just ports IMO. > > I'm not sure I understand the topic quite right, but please do not drop > MODULES_WITH_WORLD support at it allows us to quickly rebuild the kernel > in case of slight changes of its config file not changing ABI and/or > similar source changes without HUGE modules compilation overhead. This would not drop it, but it would mean that you can't necessarily kldload /boot/kernel.GENERIC/foo.ko while running some other kernel. > Also, we should not use /usr/local/sys/modules/ as /usr/local > can be inaccessible for the loader. Better use /boot/modules/local or /boot/local > as /boot is guaranteed to be accessible. You misunderstand. /usr/local/sys/modules would hold module sources so that they can be recompiled when building a kernel without having to rebuild the package or reinstall the package. Binary modules would continue to be installed in /boot/modules. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jul 6 00:14:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F90A10431F8; Fri, 6 Jul 2018 00:14:13 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [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 BE7807DFFA; Fri, 6 Jul 2018 00:14:12 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w660E5jl023714 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Jul 2018 02:14:06 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jhb@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 w660E19X090043 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 6 Jul 2018 07:14:01 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r335916 - head/sys/conf To: John Baldwin , Konstantin Belousov References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B3EB443.50004@grosbein.net> Date: Fri, 6 Jul 2018 07:13:55 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 00:14:13 -0000 06.07.2018 6:59, John Baldwin wrote: >> I'm not sure I understand the topic quite right, but please do not drop >> MODULES_WITH_WORLD support at it allows us to quickly rebuild the kernel >> in case of slight changes of its config file not changing ABI and/or >> similar source changes without HUGE modules compilation overhead. > > This would not drop it, but it would mean that you can't necessarily kldload > /boot/kernel.GENERIC/foo.ko while running some other kernel. And what's profit of such restriction? There were several cases when I was forced to extract somemodule.ko from FreeBSD distribution files and upload it to some customized installation such as FreeNAS or NAS4Free or another one running custom kernel and having stripped-down module set out-of-the-box. For example, ichwd.ko or something like that. And I was just happy I could do that and that just work. Why should we break it? From owner-svn-src-head@freebsd.org Fri Jul 6 00:20:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FF351043A05; Fri, 6 Jul 2018 00:20:35 +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 386377E2DE; Fri, 6 Jul 2018 00:20:35 +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 1526C10AFD2; Thu, 5 Jul 2018 20:20:32 -0400 (EDT) Subject: Re: svn commit: r335916 - head/sys/conf To: Eugene Grosbein , Konstantin Belousov References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> <5B3EB443.50004@grosbein.net> Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: Date: Thu, 5 Jul 2018 17:20:32 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <5B3EB443.50004@grosbein.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 05 Jul 2018 20:20:33 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 00:20:35 -0000 On 7/5/18 5:13 PM, Eugene Grosbein wrote: > 06.07.2018 6:59, John Baldwin wrote: > >>> I'm not sure I understand the topic quite right, but please do not drop >>> MODULES_WITH_WORLD support at it allows us to quickly rebuild the kernel >>> in case of slight changes of its config file not changing ABI and/or >>> similar source changes without HUGE modules compilation overhead. >> >> This would not drop it, but it would mean that you can't necessarily kldload >> /boot/kernel.GENERIC/foo.ko while running some other kernel. > > And what's profit of such restriction? There were several cases > when I was forced to extract somemodule.ko from FreeBSD distribution files > and upload it to some customized installation such as FreeNAS or NAS4Free > or another one running custom kernel and having stripped-down module set out-of-the-box. > For example, ichwd.ko or something like that. And I was just happy I could do that and > that just work. Why should we break it? You would still do that by 'cd /sys/modules/foo; make; scp foo.ko somebox:' The profit of the restriction is performance. Making kernel modules generic makes them slower by forcing them to indirect certain lightweight operations through function calls that the kernel itself performs inline (and "tied" modules would inline these same things). The other benefit is that providing a convenient way to recompile modules from ports would alleviate KBI breakage for ports such as nvidia-graphics and virtualbox-ose-kmod that can break since they use parts of the kernel for which we do not guarantee KBI stability. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jul 6 00:28:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1350B1044646; Fri, 6 Jul 2018 00:28:48 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [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 8138A7E882; Fri, 6 Jul 2018 00:28:47 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w660SeHo023851 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Jul 2018 02:28:41 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jhb@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 w660SbS8090104 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 6 Jul 2018 07:28:37 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r335916 - head/sys/conf To: John Baldwin , Konstantin Belousov References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> <5B3EB443.50004@grosbein.net> Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B3EB7AF.3040306@grosbein.net> Date: Fri, 6 Jul 2018 07:28:31 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 00:28:48 -0000 06.07.2018 7:20, John Baldwin wrote: >>> This would not drop it, but it would mean that you can't necessarily kldload >>> /boot/kernel.GENERIC/foo.ko while running some other kernel. >> >> And what's profit of such restriction? There were several cases >> when I was forced to extract somemodule.ko from FreeBSD distribution files >> and upload it to some customized installation such as FreeNAS or NAS4Free >> or another one running custom kernel and having stripped-down module set out-of-the-box. >> For example, ichwd.ko or something like that. And I was just happy I could do that and >> that just work. Why should we break it? > > You would still do that by 'cd /sys/modules/foo; make; scp foo.ko somebox:' Yes, provided I have a buildbox handy. > The profit of the restriction is performance. Making kernel modules > generic makes them slower by forcing them to indirect certain lightweight > operations through function calls that the kernel itself performs inline > (and "tied" modules would inline these same things). The other benefit is > that providing a convenient way to recompile modules from ports would alleviate > KBI breakage for ports such as nvidia-graphics and virtualbox-ose-kmod > that can break since they use parts of the kernel for which we do not > guarantee KBI stability. Thanks, now I got it. From owner-svn-src-head@freebsd.org Fri Jul 6 00:31:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECDBF1044B5B; Fri, 6 Jul 2018 00:31:46 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [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 69E797F18C; Fri, 6 Jul 2018 00:31:46 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w660Vd0U023887 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Jul 2018 02:31:40 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jhb@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 w660VaBP090187 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 6 Jul 2018 07:31:36 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r335916 - head/sys/conf To: John Baldwin , Konstantin Belousov References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> <5B3EB443.50004@grosbein.net> Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B3EB862.8020303@grosbein.net> Date: Fri, 6 Jul 2018 07:31:30 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 00:31:47 -0000 06.07.2018 7:20, John Baldwin wrote: >> And what's profit of such restriction? There were several cases >> when I was forced to extract somemodule.ko from FreeBSD distribution files >> and upload it to some customized installation such as FreeNAS or NAS4Free >> or another one running custom kernel and having stripped-down module set out-of-the-box. >> For example, ichwd.ko or something like that. And I was just happy I could do that and >> that just work. Why should we break it? > > You would still do that by 'cd /sys/modules/foo; make; scp foo.ko somebox:' May I suggest that release installation media would provide two copies of modules/ directory for one major release, one with tied modules for performance and another set (not installed by default) with "un-tied" for reference? From owner-svn-src-head@freebsd.org Fri Jul 6 01:11:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CBA5102396D; Fri, 6 Jul 2018 01:11:08 +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 0D4D5808EA; Fri, 6 Jul 2018 01:11:08 +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 C8E9721BEF; Fri, 6 Jul 2018 01:11:07 +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 w661B7W9005642; Fri, 6 Jul 2018 01:11:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w661B76W005640; Fri, 6 Jul 2018 01:11:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807060111.w661B76W005640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Jul 2018 01:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336019 - in head: . usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . usr.sbin/config X-SVN-Commit-Revision: 336019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 01:11:08 -0000 Author: kevans Date: Fri Jul 6 01:11:06 2018 New Revision: 336019 URL: https://svnweb.freebsd.org/changeset/base/336019 Log: config(8): De-dupe hint/env vars within a single file r335653 flipped the order in which hints/env files are concatenated to match the order in which vars are processed by the kernel. This is the other hammer to drop. Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the latest value specified for a key. This leaves some duplicates if a variable is specified in multiple hint/env files or via `envvar` in a kernel config, but the reversed order of concatenation (from r335653) makes this a non-issue as the latest-specified version will be seen first. This change also silently rewrote hint bits to use the same sanitization process that ian@ wrote for r335642. To the kernel, hints and env vars are basically the same thing through early boot, then get merged into the dynamic environment once kmem becomes available and the dynamic environment is created. They should be subjected to the same restrictions. libnv has been added to -legacy for the time being to support the build of config(8) with the new cnvlist API. Tested with: universe (11 host & 12 host) MFC after: 1 month Modified: head/Makefile.inc1 head/usr.sbin/config/Makefile head/usr.sbin/config/mkmakefile.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jul 6 00:58:51 2018 (r336018) +++ head/Makefile.inc1 Fri Jul 6 01:11:06 2018 (r336019) @@ -1941,13 +1941,19 @@ update: .PHONY _elftoolchain_libs= lib/libelf lib/libdwarf .endif +# An updated libnv is needed for the cnv(9) API used in config(8). +# r335343 stabilized the cnvlist API used by config(8) +.if ${BOOTSTRAPPING} < 1200070 +_libnv= lib/libnv +.endif + legacy: .PHONY .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ false .endif -.for _tool in tools/build ${_elftoolchain_libs} +.for _tool in tools/build ${_elftoolchain_libs} ${_libnv} ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ cd ${.CURDIR}/${_tool}; \ if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ Modified: head/usr.sbin/config/Makefile ============================================================================== --- head/usr.sbin/config/Makefile Fri Jul 6 00:58:51 2018 (r336018) +++ head/usr.sbin/config/Makefile Fri Jul 6 01:11:06 2018 (r336019) @@ -14,11 +14,11 @@ kernconf.c: kernconf.tmpl ${FILE2C} 'char kernconfstr[] = {' ',0};' < \ ${SRCDIR}/kernconf.tmpl > kernconf.c -CFLAGS+= -I. -I${SRCDIR} +CFLAGS+= -I. -I${SRCDIR} -I${SRCTOP}/sys NO_WMISSING_VARIABLE_DECLARATIONS= -LIBADD= l sbuf +LIBADD= l nv sbuf CLEANFILES+= kernconf.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Fri Jul 6 00:58:51 2018 (r336018) +++ head/usr.sbin/config/mkmakefile.c Fri Jul 6 01:11:06 2018 (r336019) @@ -49,6 +49,8 @@ static const char rcsid[] = #include #include #include +#include +#include #include #include "y.tab.h" #include "config.h" @@ -62,6 +64,10 @@ static void do_objs(FILE *); static void do_before_depend(FILE *); static int opteq(const char *, const char *); static void read_files(void); +static void sanitize_envline(char *result, const char *src); +static void process_into_file(char *line, FILE *ofp); +static void process_into_nvlist(char *line, nvlist_t *nvl); +static void dump_nvlist(nvlist_t *nvl, FILE *ofp); static void errout(const char *fmt, ...) { @@ -180,64 +186,6 @@ makefile(void) moveifchanged(path("Makefile.new"), path("Makefile")); } -/* - * Build hints.c from the skeleton - */ -void -makehints(void) -{ - FILE *ifp, *ofp; - char line[BUFSIZ]; - char *s; - struct hint *hint; - - ofp = fopen(path("hints.c.new"), "w"); - if (ofp == NULL) - err(1, "%s", path("hints.c.new")); - fprintf(ofp, "#include \n"); - fprintf(ofp, "#include \n"); - fprintf(ofp, "\n"); - fprintf(ofp, "char static_hints[] = {\n"); - STAILQ_FOREACH(hint, &hints, hint_next) { - ifp = fopen(hint->hint_name, "r"); - if (ifp == NULL) - err(1, "%s", hint->hint_name); - while (fgets(line, BUFSIZ, ifp) != NULL) { - /* zap trailing CR and/or LF */ - while ((s = strrchr(line, '\n')) != NULL) - *s = '\0'; - while ((s = strrchr(line, '\r')) != NULL) - *s = '\0'; - /* remove # comments */ - s = strchr(line, '#'); - if (s) - *s = '\0'; - /* remove any whitespace and " characters */ - s = line; - while (*s) { - if (*s == ' ' || *s == '\t' || *s == '"') { - while (*s) { - s[0] = s[1]; - s++; - } - /* start over */ - s = line; - continue; - } - s++; - } - /* anything left? */ - if (*line == '\0') - continue; - fprintf(ofp, "\"%s\\0\"\n", line); - } - fclose(ifp); - } - fprintf(ofp, "\"\\0\"\n};\n"); - fclose(ofp); - moveifchanged(path("hints.c.new"), path("hints.c")); -} - static void sanitize_envline(char *result, const char *src) { @@ -295,14 +243,96 @@ sanitize_envline(char *result, const char *src) *dst = 0; } +static void +process_into_file(char *line, FILE *ofp) +{ + char result[BUFSIZ]; + + sanitize_envline(result, line); + /* anything left? */ + if (*result == '\0') + return; + fprintf(ofp, "\"%s\\0\"\n", result); +} + +static void +process_into_nvlist(char *line, nvlist_t *nvl) +{ + char result[BUFSIZ], *s; + + sanitize_envline(result, line); + /* anything left? */ + if (*result == '\0') + return; + s = strchr(result, '='); + *s = 0; + if (nvlist_exists(nvl, result)) + nvlist_free(nvl, result); + nvlist_add_string(nvl, result, s + 1); +} + +static void +dump_nvlist(nvlist_t *nvl, FILE *ofp) +{ + const char *name; + void *cookie; + + if (nvl == NULL) + return; + + while (!nvlist_empty(nvl)) { + cookie = NULL; + name = nvlist_next(nvl, NULL, &cookie); + fprintf(ofp, "\"%s=%s\\0\"\n", name, + cnvlist_get_string(cookie)); + + cnvlist_free_string(cookie); + } +} + /* + * Build hints.c from the skeleton + */ +void +makehints(void) +{ + FILE *ifp, *ofp; + nvlist_t *nvl; + char line[BUFSIZ]; + struct hint *hint; + + ofp = fopen(path("hints.c.new"), "w"); + if (ofp == NULL) + err(1, "%s", path("hints.c.new")); + fprintf(ofp, "#include \n"); + fprintf(ofp, "#include \n"); + fprintf(ofp, "\n"); + fprintf(ofp, "char static_hints[] = {\n"); + nvl = nvlist_create(0); + STAILQ_FOREACH(hint, &hints, hint_next) { + ifp = fopen(hint->hint_name, "r"); + if (ifp == NULL) + err(1, "%s", hint->hint_name); + while (fgets(line, BUFSIZ, ifp) != NULL) + process_into_nvlist(line, nvl); + dump_nvlist(nvl, ofp); + fclose(ifp); + } + nvlist_destroy(nvl); + fprintf(ofp, "\"\\0\"\n};\n"); + fclose(ofp); + moveifchanged(path("hints.c.new"), path("hints.c")); +} + +/* * Build env.c from the skeleton */ void makeenv(void) { FILE *ifp, *ofp; - char line[BUFSIZ], result[BUFSIZ], *linep; + nvlist_t *nvl; + char line[BUFSIZ]; struct envvar *envvar; ofp = fopen(path("env.c.new"), "w"); @@ -312,27 +342,20 @@ makeenv(void) fprintf(ofp, "#include \n"); fprintf(ofp, "\n"); fprintf(ofp, "char static_env[] = {\n"); + nvl = nvlist_create(0); STAILQ_FOREACH(envvar, &envvars, envvar_next) { if (envvar->env_is_file) { ifp = fopen(envvar->env_str, "r"); if (ifp == NULL) err(1, "%s", envvar->env_str); - while (fgets(line, BUFSIZ, ifp) != NULL) { - sanitize_envline(result, line); - /* anything left? */ - if (*result == '\0') - continue; - fprintf(ofp, "\"%s\\0\"\n", result); - } + while (fgets(line, BUFSIZ, ifp) != NULL) + process_into_nvlist(line, nvl); + dump_nvlist(nvl, ofp); fclose(ifp); - } else { - linep = envvar->env_str; - sanitize_envline(result, linep); - if (*result == '\0') - continue; - fprintf(ofp, "\"%s\\0\"\n", result); - } + } else + process_into_file(envvar->env_str, ofp); } + nvlist_destroy(nvl); fprintf(ofp, "\"\\0\"\n};\n"); fclose(ofp); moveifchanged(path("env.c.new"), path("env.c")); From owner-svn-src-head@freebsd.org Fri Jul 6 01:45:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DBA0102772D; Fri, 6 Jul 2018 01:45:35 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC0381F78; Fri, 6 Jul 2018 01:45:35 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-io0-x230.google.com with SMTP id q4-v6so9500336iob.2; Thu, 05 Jul 2018 18:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9XIN1Wgrv0koysbZafMb8OI8HN/3JtWPixzjZRWiIQY=; b=NTFFgi9XLddyJue42rY2a/BeHU9/0Aq/zPyhZhJBOkY+xZbyT4XwMEGltkxHITmsEQ w/cqrYNgP39E51VVX8NKydanRSZrmy72jBTLeKDhnFj12fhD/J4DVdvvYxQGr5qnFdJz mDCrBO9f8PlSFnghAvUUr8SfJ9fhUdoXVYOPcIiOIaSZ0e52s/5ITuyaxdUedWnsWV5C tsOU/R4REoz0pFfhPHQtzZUE1zJF3n7JzbExaESCT681zuxcAHuwVTlGa1BFzYj+cM0L c92WHGd3b0eXARwbR7tKB6de7R+ZYzvO6sY7f1nnowe+pPRh7QpR4CbMHU4s4AyA7fSL tMgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9XIN1Wgrv0koysbZafMb8OI8HN/3JtWPixzjZRWiIQY=; b=KtrzpbFHr0qGaS8vZCW/WAfCrdwMLnpHPleJFX85SfWoBfWf5qBceCSipH91dnuX2I FI9gxOB2rSpIOxdaIyOAwcC2cxkrMf5qz/yM0GMbBMxvO69pt5MVuSYiCzP/k8lkUENV c834GqvPi/EgZt581DKF5374JN/AycPNg3GOwOXMCpkUHxVd/u/X0bwseEW9LCqrUrCi H8LWGFghjIm3QBEHzrP9z7VRno9O9drCpqz7T3VKJJ9NFukdQerO777KwrorZGpMUhe7 nikbSA3QMrHq8BehfDOPFyiVtrKJQ0664TDf10Vz2ODDbjlOmh2hTkrAL30NDEuDfdFI 1y0w== X-Gm-Message-State: APt69E2pe6IJBc6xdJ2YySkYSbLpSg8VKxeBnUgw4a0Oa6tl6oHY3fcS 1uo4FAA8Ii/acfwmN/OiiCe5x5jO1p90RiO1JJA= X-Google-Smtp-Source: AAOMgpdZdKSyVyU9bjSekOm4X3j9vSnIRZggaqcreN3DX1ZlS8tanYNXY3jywxdg1ok2pjA6ASLvyegxQhNWtOSIr3M= X-Received: by 2002:a6b:5a08:: with SMTP id o8-v6mr6906722iob.5.1530841534262; Thu, 05 Jul 2018 18:45:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8d2:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 18:45:33 -0700 (PDT) In-Reply-To: <20180705163338.GA67089@spindle.one-eyed-alien.net> References: <201807051313.w65DDnQJ041281@repo.freebsd.org> <20180705163338.GA67089@spindle.one-eyed-alien.net> From: Matthew Macy Date: Thu, 5 Jul 2018 18:45:33 -0700 Message-ID: Subject: Re: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat To: Brooks Davis Cc: Ravi Pokala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 01:45:35 -0000 this breaks the MIPS builds. On Thu, Jul 5, 2018 at 9:33 AM, Brooks Davis wrote: > On Thu, Jul 05, 2018 at 09:10:54AM -0700, Ravi Pokala wrote: >> Hi Brooks, >> >> -----Original Message----- >> From: on behalf of Brooks Davis >> Date: 2018-07-05, Thursday at 06:13 >> To: , , >> Subject: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat >> >> > Author: brooks >> > Date: Thu Jul 5 13:13:48 2018 >> > New Revision: 335979 >> > URL: https://svnweb.freebsd.org/changeset/base/335979 >> > >> > Log: >> > Make struct xinpcb and friends word-size independent. >> > >> > Replace size_t members with ksize_t (uint64_t) and pointer members >> > (never used as pointers in userspace, but instead as unique >> > idenitifiers) with kvaddr_t (uint64_t). This makes the structs >> > identical between 32-bit and 64-bit ABIs. >> ... >> > Modified: head/UPDATING >> > ============================================================================== >> > --- head/UPDATING Thu Jul 5 11:50:59 2018 (r335978) >> > +++ head/UPDATING Thu Jul 5 13:13:48 2018 (r335979) >> > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: >> > disable the most expensive debugging functionality run >> > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >> > >> > +20180705: >> > + The ABI of syscalls used by management tools like sockstat and >> > + netstat has been broken to allow 32-bit binaries to work on >> > + 64-bit kernels without modification. >> >> Isn't that what the compat32 layer is for? > > compat32 isn't magic. If one tried, one could hardly design structures > to make 32-bit compat harder then the previous versions. It's certainly > possible to make work, but quite annoying. Since the ABI of most these > structures was already broken for 12, I chose this approach as it is > quite trivial. > >> > These programs will need >> > + to match the kernel in order to function. External programs may >> > + require minor modifications to accommodate a change of type in >> > + structures from pointers to 64-bit virtual addresses. >> >> Doesn't this contradict the earlier statement about letting things run unmodified? > > Unmodified post this commit. We already don't support netstat and > sockstat from 11 on 12 in any architecture combination. > > -- Brooks From owner-svn-src-head@freebsd.org Fri Jul 6 01:53:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 920E51028540; Fri, 6 Jul 2018 01:53:24 +0000 (UTC) (envelope-from kevans@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 43C598267D; Fri, 6 Jul 2018 01:53:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D726FB43F; Fri, 6 Jul 2018 01:53:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f176.google.com with SMTP id a6-v6so8007430ljj.7; Thu, 05 Jul 2018 18:53:23 -0700 (PDT) X-Gm-Message-State: APt69E1Tc3oQ5Dje8QzjZH68987Kv/crz1jIZbr9gh9/FXewxOI6XZc6 rAm0fZgFQwkrxDU4uCxTI5Cle12NTYCsyjUzEKA= X-Google-Smtp-Source: AAOMgpf1YSUG5C1pCfxoDNPBpaCb3KFgUZBQXIahwYo0t9ctFiDG7hVCpRgWNqR8KM//PUQoE6tAujlJ/weR7FrCHmM= X-Received: by 2002:a2e:87da:: with SMTP id v26-v6mr4999100ljj.69.1530842002516; Thu, 05 Jul 2018 18:53:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 18:53:01 -0700 (PDT) In-Reply-To: <201807060111.w661B76W005640@repo.freebsd.org> References: <201807060111.w661B76W005640@repo.freebsd.org> From: Kyle Evans Date: Thu, 5 Jul 2018 20:53:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r336019 - in head: . usr.sbin/config To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 01:53:24 -0000 On Thu, Jul 5, 2018 at 8:11 PM, Kyle Evans wrote: > Author: kevans > Date: Fri Jul 6 01:11:06 2018 > New Revision: 336019 > URL: https://svnweb.freebsd.org/changeset/base/336019 > > Log: > config(8): De-dupe hint/env vars within a single file > > r335653 flipped the order in which hints/env files are concatenated to match > the order in which vars are processed by the kernel. This is the other > hammer to drop. > > Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the > latest value specified for a key. This leaves some duplicates if a variable > is specified in multiple hint/env files or via `envvar` in a kernel config, > but the reversed order of concatenation (from r335653) makes this a > non-issue as the latest-specified version will be seen first. > > This change also silently rewrote hint bits to use the same sanitization > process that ian@ wrote for r335642. To the kernel, hints and env vars are > basically the same thing through early boot, then get merged into the > dynamic environment once kmem becomes available and the dynamic environment > is created. They should be subjected to the same restrictions. > > libnv has been added to -legacy for the time being to support the build of > config(8) with the new cnvlist API. > > Tested with: universe (11 host & 12 host) > MFC after: 1 month > This seems to be causing pretty consistent config(8) failures on CI, kernels with neither hints nor environment variables, that neither of my universe builds nor any of my post-commit builds can reproduce. Can anyone else reproduce these failures that might be willing to give me a hint as to what kind of setup causes this? 01:47:58 cd /usr/src/sys/arm/conf; PATH=/usr/obj/usr/src/arm.armv7/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm.armv7/tmp/legacy/usr/bin:/usr/obj/usr/src/arm.armv7/tmp/legacy/bin:/usr/obj/usr/src/arm.armv7/tmp/usr/sbin:/usr/obj/usr/src/arm.armv7/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin config -d /usr/obj/usr/src/arm.armv7/sys/GENERIC -I '/usr/src/sys/arm/conf' '/usr/src/sys/arm/conf/GENERIC' 01:47:58 config: /usr/src/sys/arm/conf/GENERIC: No error: 0 Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri Jul 6 02:06:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDBEA1029830; Fri, 6 Jul 2018 02:06: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 799B682D60; Fri, 6 Jul 2018 02:06:06 +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 568452244A; Fri, 6 Jul 2018 02:06:06 +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 w66266sk035297; Fri, 6 Jul 2018 02:06:06 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w662636M035282; Fri, 6 Jul 2018 02:06:03 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807060206.w662636M035282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 6 Jul 2018 02:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336020 - in head/sys: amd64/include arm/include arm64/include i386/include kern mips/include powerpc/include riscv/include sparc64/include sys vm x86/acpica X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: amd64/include arm/include arm64/include i386/include kern mips/include powerpc/include riscv/include sparc64/include sys vm x86/acpica X-SVN-Commit-Revision: 336020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 02:06:07 -0000 Author: mmacy Date: Fri Jul 6 02:06:03 2018 New Revision: 336020 URL: https://svnweb.freebsd.org/changeset/base/336020 Log: Back pcpu zone with domain correct pages - Change pcpu zone consumers to use a stride size of PAGE_SIZE. (defined as UMA_PCPU_ALLOC_SIZE to make future identification easier) - Allocate page from the correct domain for a given cpu. - Don't initialize pc_domain to non-zero value if NUMA is not defined There are some misconceptions surrounding this field. It is the _VM_ NUMA domain and should only ever correspond to valid domain values as understood by the VM. The former slab size of sizeof(struct pcpu) was somewhat arbitrary. The new value is PAGE_SIZE because that's the smallest granularity which the VM can allocate a slab for a given domain. If you have fewer than PAGE_SIZE/8 counters on your system there will be some memory wasted, but this is obviously something where you want the cache line to be coming from the correct domain. Reviewed by: jeff Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15933 Modified: head/sys/amd64/include/counter.h head/sys/arm/include/counter.h head/sys/arm64/include/counter.h head/sys/i386/include/counter.h head/sys/kern/subr_counter.c head/sys/mips/include/counter.h head/sys/powerpc/include/counter.h head/sys/riscv/include/counter.h head/sys/sparc64/include/counter.h head/sys/sys/pcpu.h head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/x86/acpica/srat.c Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/amd64/include/counter.h Fri Jul 6 02:06:03 2018 (r336020) @@ -45,7 +45,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); + return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); } static inline uint64_t @@ -65,7 +65,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))) = 0; } Modified: head/sys/arm/include/counter.h ============================================================================== --- head/sys/arm/include/counter.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/arm/include/counter.h Fri Jul 6 02:06:03 2018 (r336020) @@ -47,7 +47,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (atomic_load_64((uint64_t *)((char *)p + sizeof(struct pcpu) * + return (atomic_load_64((uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu))); } @@ -68,7 +68,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - atomic_store_64((uint64_t *)((char *)arg + sizeof(struct pcpu) * + atomic_store_64((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid)), 0); } Modified: head/sys/arm64/include/counter.h ============================================================================== --- head/sys/arm64/include/counter.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/arm64/include/counter.h Fri Jul 6 02:06:03 2018 (r336020) @@ -44,7 +44,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); + return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); } static inline uint64_t @@ -64,7 +64,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))) = 0; } Modified: head/sys/i386/include/counter.h ============================================================================== --- head/sys/i386/include/counter.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/i386/include/counter.h Fri Jul 6 02:06:03 2018 (r336020) @@ -104,13 +104,13 @@ counter_u64_fetch_inline(uint64_t *p) critical_enter(); CPU_FOREACH(i) { res += *(uint64_t *)((char *)p + - sizeof(struct pcpu) * i); + UMA_PCPU_ALLOC_SIZE * i); } critical_exit(); } else { CPU_FOREACH(i) res += counter_u64_read_one_8b((uint64_t *)((char *)p + - sizeof(struct pcpu) * i)); + UMA_PCPU_ALLOC_SIZE * i)); } return (res); } @@ -137,7 +137,7 @@ counter_u64_zero_one_cpu(void *arg) { uint64_t *p; - p = (uint64_t *)((char *)arg + sizeof(struct pcpu) * PCPU_GET(cpuid)); + p = (uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid)); counter_u64_zero_one_8b(p); } @@ -149,7 +149,7 @@ counter_u64_zero_inline(counter_u64_t c) if ((cpu_feature & CPUID_CX8) == 0) { critical_enter(); CPU_FOREACH(i) - *(uint64_t *)((char *)c + sizeof(struct pcpu) * i) = 0; + *(uint64_t *)((char *)c + UMA_PCPU_ALLOC_SIZE * i) = 0; critical_exit(); } else { smp_rendezvous(smp_no_rendezvous_barrier, Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/kern/subr_counter.c Fri Jul 6 02:06:03 2018 (r336020) @@ -42,7 +42,16 @@ __FBSDID("$FreeBSD$"); #define IN_SUBR_COUNTER_C #include - + +static void +counter_u64_zero_sync(counter_u64_t c) +{ + int cpu; + + CPU_FOREACH(cpu) + *(uint64_t*)zpcpu_get_cpu(c, cpu) = 0; +} + void counter_u64_zero(counter_u64_t c) { @@ -64,7 +73,7 @@ counter_u64_alloc(int flags) r = uma_zalloc_pcpu(pcpu_zone_64, flags); if (r != NULL) - counter_u64_zero(r); + counter_u64_zero_sync(r); return (r); } Modified: head/sys/mips/include/counter.h ============================================================================== --- head/sys/mips/include/counter.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/mips/include/counter.h Fri Jul 6 02:06:03 2018 (r336020) @@ -47,7 +47,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); + return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); } static inline uint64_t @@ -68,7 +68,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))) = 0; } Modified: head/sys/powerpc/include/counter.h ============================================================================== --- head/sys/powerpc/include/counter.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/powerpc/include/counter.h Fri Jul 6 02:06:03 2018 (r336020) @@ -50,7 +50,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); + return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); } static inline uint64_t @@ -70,7 +70,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))) = 0; } @@ -113,7 +113,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); + return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); } static inline uint64_t @@ -134,7 +134,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))) = 0; } Modified: head/sys/riscv/include/counter.h ============================================================================== --- head/sys/riscv/include/counter.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/riscv/include/counter.h Fri Jul 6 02:06:03 2018 (r336020) @@ -46,7 +46,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); + return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); } static inline uint64_t @@ -67,7 +67,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))) = 0; } Modified: head/sys/sparc64/include/counter.h ============================================================================== --- head/sys/sparc64/include/counter.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/sparc64/include/counter.h Fri Jul 6 02:06:03 2018 (r336020) @@ -47,7 +47,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); + return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); } static inline uint64_t @@ -68,7 +68,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))) = 0; } Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/sys/pcpu.h Fri Jul 6 02:06:03 2018 (r336020) @@ -207,19 +207,21 @@ extern struct pcpu *cpuid_to_pcpu[]; #endif #define curvidata PCPU_GET(vidata) +#define UMA_PCPU_ALLOC_SIZE PAGE_SIZE + /* Accessor to elements allocated via UMA_ZONE_PCPU zone. */ static inline void * zpcpu_get(void *base) { - return ((char *)(base) + sizeof(struct pcpu) * curcpu); + return ((char *)(base) + UMA_PCPU_ALLOC_SIZE * curcpu); } static inline void * zpcpu_get_cpu(void *base, int cpu) { - return ((char *)(base) + sizeof(struct pcpu) * cpu); + return ((char *)(base) + UMA_PCPU_ALLOC_SIZE * cpu); } /* Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/vm/uma.h Fri Jul 6 02:06:03 2018 (r336020) @@ -279,8 +279,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * mini-dumps. */ #define UMA_ZONE_PCPU 0x8000 /* - * Allocates mp_maxid + 1 slabs sized to - * sizeof(struct pcpu). + * Allocates mp_maxid + 1 slabs of PAGE_SIZE */ #define UMA_ZONE_NUMA 0x10000 /* * NUMA aware Zone. Implements a best Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/vm/uma_core.c Fri Jul 6 02:06:03 2018 (r336020) @@ -229,8 +229,10 @@ void uma_startup2(void); static void *noobj_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void *page_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); +static void *pcpu_page_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void *startup_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void page_free(void *, vm_size_t, uint8_t); +static void pcpu_page_free(void *, vm_size_t, uint8_t); static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int); static void cache_drain(uma_zone_t); static void bucket_drain(uma_zone_t, uma_bucket_t); @@ -1172,6 +1174,58 @@ page_alloc(uma_zone_t zone, vm_size_t bytes, int domai return (p); } +static void * +pcpu_page_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag, + int wait) +{ + struct pglist alloctail; + vm_offset_t addr, zkva; + int cpu, flags; + vm_page_t p, p_next; +#ifdef NUMA + struct pcpu *pc; +#endif + + TAILQ_INIT(&alloctail); + MPASS(bytes == (mp_maxid+1)*PAGE_SIZE); + *pflag = UMA_SLAB_KERNEL; + + flags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ | + ((wait & M_WAITOK) != 0 ? VM_ALLOC_WAITOK : + VM_ALLOC_NOWAIT); + for (cpu = 0; cpu <= mp_maxid; cpu++) { + if (CPU_ABSENT(cpu)) { + p = vm_page_alloc(NULL, 0, flags); + } else { +#ifndef NUMA + p = vm_page_alloc(NULL, 0, flags); +#else + pc = pcpu_find(cpu); + p = vm_page_alloc_domain(NULL, 0, pc->pc_domain, flags); + if (__predict_false(p == NULL)) + p = vm_page_alloc(NULL, 0, flags); +#endif + } + if (__predict_false(p == NULL)) + goto fail; + TAILQ_INSERT_TAIL(&alloctail, p, listq); + } + if ((addr = kva_alloc(bytes)) == 0) + goto fail; + zkva = addr; + TAILQ_FOREACH(p, &alloctail, listq) { + pmap_qenter(zkva, &p, 1); + zkva += PAGE_SIZE; + } + return ((void*)addr); + fail: + TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) { + vm_page_unwire(p, PQ_NONE); + vm_page_free(p); + } + return (NULL); +} + /* * Allocates a number of pages from within an object * @@ -1258,6 +1312,37 @@ page_free(void *mem, vm_size_t size, uint8_t flags) } /* + * Frees pcpu zone allocations + * + * Arguments: + * mem A pointer to the memory to be freed + * size The size of the memory being freed + * flags The original p->us_flags field + * + * Returns: + * Nothing + */ +static void +pcpu_page_free(void *mem, vm_size_t size, uint8_t flags) +{ + vm_offset_t sva, curva; + vm_paddr_t paddr; + vm_page_t m; + + MPASS(size == (mp_maxid+1)*PAGE_SIZE); + sva = (vm_offset_t)mem; + for (curva = sva; curva < sva + size; curva += PAGE_SIZE) { + paddr = pmap_kextract(curva); + m = PHYS_TO_VM_PAGE(paddr); + vm_page_unwire(m, PQ_NONE); + vm_page_free(m); + } + pmap_qremove(sva, size >> PAGE_SHIFT); + kva_free(sva, size); +} + + +/* * Zero fill initializer * * Arguments/Returns follow uma_init specifications @@ -1290,9 +1375,8 @@ keg_small_init(uma_keg_t keg) if (keg->uk_flags & UMA_ZONE_PCPU) { u_int ncpus = (mp_maxid + 1) ? (mp_maxid + 1) : MAXCPU; - slabsize = sizeof(struct pcpu); - keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu), - PAGE_SIZE); + slabsize = UMA_PCPU_ALLOC_SIZE; + keg->uk_ppera = ncpus; } else { slabsize = UMA_SLAB_SIZE; keg->uk_ppera = 1; @@ -1311,7 +1395,7 @@ keg_small_init(uma_keg_t keg) keg->uk_rsize = rsize; KASSERT((keg->uk_flags & UMA_ZONE_PCPU) == 0 || - keg->uk_rsize < sizeof(struct pcpu), + keg->uk_rsize < UMA_PCPU_ALLOC_SIZE, ("%s: size %u too large", __func__, keg->uk_rsize)); if (keg->uk_flags & UMA_ZONE_OFFPAGE) @@ -1529,6 +1613,8 @@ keg_ctor(void *mem, int size, void *udata, int flags) else if (keg->uk_ppera == 1) keg->uk_allocf = uma_small_alloc; #endif + else if (keg->uk_flags & UMA_ZONE_PCPU) + keg->uk_allocf = pcpu_page_alloc; else keg->uk_allocf = page_alloc; #ifdef UMA_MD_SMALL_ALLOC @@ -1536,6 +1622,9 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_freef = uma_small_free; else #endif + if (keg->uk_flags & UMA_ZONE_PCPU) + keg->uk_freef = pcpu_page_free; + else keg->uk_freef = page_free; /* Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Fri Jul 6 01:11:06 2018 (r336019) +++ head/sys/x86/acpica/srat.c Fri Jul 6 02:06:03 2018 (r336020) @@ -532,11 +532,15 @@ srat_set_cpus(void *dummy) if (!cpu->enabled) panic("SRAT: CPU with APIC ID %u is not known", pc->pc_apic_id); +#ifdef NUMA pc->pc_domain = cpu->domain; - CPU_SET(i, &cpuset_domain[cpu->domain]); +#else + pc->pc_domain = 0; +#endif + CPU_SET(i, &cpuset_domain[pc->pc_domain]); if (bootverbose) printf("SRAT: CPU %u has memory domain %d\n", i, - cpu->domain); + pc->pc_domain); } /* Last usage of the cpus array, unmap it. */ From owner-svn-src-head@freebsd.org Fri Jul 6 02:15:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A81B8102A58D; Fri, 6 Jul 2018 02:15: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 1D3F8833A3; Fri, 6 Jul 2018 02:15: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 w662F7wc050222; Thu, 5 Jul 2018 19:15:07 -0700 (PDT) (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 w662F6Kj050221; Thu, 5 Jul 2018 19:15:06 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807060215.w662F6Kj050221@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335916 - head/sys/conf In-Reply-To: <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> To: John Baldwin Date: Thu, 5 Jul 2018 19:15:06 -0700 (PDT) CC: Eugene Grosbein , Konstantin Belousov , Matt Macy , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 02:15:10 -0000 > On 7/5/18 4:17 PM, Eugene Grosbein wrote: > > 06.07.2018 1:21, John Baldwin wrote: > > > >> Yes, this is a change though I find it the logical outcome of the original change > >> to move away from MODULES_WITH_WORLD. And to be clear, Matt certainly only > >> intended to use MODULE_TIED in a few places, but I think tagging all those > >> places will be cumbersome and tedious compared to just doing it in this way. I > >> think this will also tie into something I proposed earlier in a commit reply and > >> that I also brought up at BSDCan which is that I think that kernel modules in > >> ports should install their sources and build glue to some location we choose > >> (e.g. /usr/local/sys/modules/) and that we should support a variable folks > >> can set in their kernel config file similar to MODULES_OVERRIDE that is a list > >> of local modules to recompile and install into /boot/kernel along with other > >> modules (and that these recompiled modules would be TIED). The binary module > >> from the package would still be present in /boot/modules, but the tied module > >> in /boot/kernel would be preferred and used instead when it exists (our existing > >> module_path already does this last part). This would replace the existing > >> PORTS_MODULES but in a way that is more graceful and works with packages, not > >> just ports IMO. > > > > I'm not sure I understand the topic quite right, but please do not drop > > MODULES_WITH_WORLD support at it allows us to quickly rebuild the kernel > > in case of slight changes of its config file not changing ABI and/or > > similar source changes without HUGE modules compilation overhead. > > This would not drop it, but it would mean that you can't necessarily kldload > /boot/kernel.GENERIC/foo.ko while running some other kernel. Please do not break that! If any module should continue to load with a custom kernel it should be the ones built with GENERIC, as long as the source code/KABI is unchanged why am I not being allowed to load this module? > > Also, we should not use /usr/local/sys/modules/ as /usr/local > > can be inaccessible for the loader. Better use /boot/modules/local or /boot/local > > as /boot is guaranteed to be accessible. > > You misunderstand. /usr/local/sys/modules would hold module sources so that > they can be recompiled when building a kernel without having to rebuild the > package or reinstall the package. Binary modules would continue to be > installed in /boot/modules. I like this part of it, as we discussed at BSDCan, this would in effect fix the VirtualBox, kmod-next, and nvidia module issues we currently face in stable/11. > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jul 6 02:18:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E1D102AB6D; Fri, 6 Jul 2018 02:18:52 +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 C67308369F; Fri, 6 Jul 2018 02:18:51 +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 w662IoUG050241; Thu, 5 Jul 2018 19:18:50 -0700 (PDT) (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 w662IooX050240; Thu, 5 Jul 2018 19:18:50 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807060218.w662IooX050240@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335916 - head/sys/conf In-Reply-To: To: John Baldwin Date: Thu, 5 Jul 2018 19:18:50 -0700 (PDT) CC: Eugene Grosbein , Konstantin Belousov , Matt Macy , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 02:18:53 -0000 [ Charset UTF-8 unsupported, converting... ] > On 7/5/18 5:13 PM, Eugene Grosbein wrote: > > 06.07.2018 6:59, John Baldwin wrote: > > > >>> I'm not sure I understand the topic quite right, but please do not drop > >>> MODULES_WITH_WORLD support at it allows us to quickly rebuild the kernel > >>> in case of slight changes of its config file not changing ABI and/or > >>> similar source changes without HUGE modules compilation overhead. > >> > >> This would not drop it, but it would mean that you can't necessarily kldload > >> /boot/kernel.GENERIC/foo.ko while running some other kernel. > > > > And what's profit of such restriction? There were several cases > > when I was forced to extract somemodule.ko from FreeBSD distribution files > > and upload it to some customized installation such as FreeNAS or NAS4Free > > or another one running custom kernel and having stripped-down module set out-of-the-box. > > For example, ichwd.ko or something like that. And I was just happy I could do that and > > that just work. Why should we break it? > > You would still do that by 'cd /sys/modules/foo; make; scp foo.ko somebox:' > > The profit of the restriction is performance. Making kernel modules > generic makes them slower by forcing them to indirect certain lightweight > operations through function calls that the kernel itself performs inline > (and "tied" modules would inline these same things). I build custom kernels with the modules compiled in if I want performant systems. I remove all the stuff I do not need or want in GENERIC for the same reason. Trying to make loaded kernel modules performant by placing near static linked kernel restrictions on them is not a direction I feel worth heading into as it breaks just too many other use cases. > The other benefit is > that providing a convenient way to recompile modules from ports would alleviate > KBI breakage for ports such as nvidia-graphics and virtualbox-ose-kmod > that can break since they use parts of the kernel for which we do not > guarantee KBI stability. Isnt that a totally seperate issue to this MODULE_TIED? > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jul 6 06:08:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD169104182B; Fri, 6 Jul 2018 06:08:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 7A0F58CBCB; Fri, 6 Jul 2018 06:08:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 3FCF81F801; Fri, 6 Jul 2018 06:08:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id DA45E1F25; Fri, 6 Jul 2018 06:08:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id TBu9OfhLUiB2; Fri, 6 Jul 2018 06:08:42 +0000 (UTC) Subject: Re: svn commit: r336019 - in head: . usr.sbin/config DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com AF5201F20 To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807060111.w661B76W005640@repo.freebsd.org> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: Date: Thu, 5 Jul 2018 23:08:39 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2IThXnlo7T5MBOOVOoX2tT0kI3rCZmTA2" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 06:08:47 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2IThXnlo7T5MBOOVOoX2tT0kI3rCZmTA2 Content-Type: multipart/mixed; boundary="PX2dU4yd7wU53pG2iq7IingH7Uk4T4F3W"; protected-headers="v1" From: Bryan Drewery To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r336019 - in head: . usr.sbin/config References: <201807060111.w661B76W005640@repo.freebsd.org> In-Reply-To: --PX2dU4yd7wU53pG2iq7IingH7Uk4T4F3W Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/5/18 6:53 PM, Kyle Evans wrote: > On Thu, Jul 5, 2018 at 8:11 PM, Kyle Evans wrote: >> Author: kevans >> Date: Fri Jul 6 01:11:06 2018 >> New Revision: 336019 >> URL: https://svnweb.freebsd.org/changeset/base/336019 >> >> Log: >> config(8): De-dupe hint/env vars within a single file >> >> r335653 flipped the order in which hints/env files are concatenated = to match >> the order in which vars are processed by the kernel. This is the oth= er >> hammer to drop. >> >> Use nv(9) to de-dupe entries within a single `hint` or `env` file, u= sing the >> latest value specified for a key. This leaves some duplicates if a v= ariable >> is specified in multiple hint/env files or via `envvar` in a kernel = config, >> but the reversed order of concatenation (from r335653) makes this a >> non-issue as the latest-specified version will be seen first. >> >> This change also silently rewrote hint bits to use the same sanitiza= tion >> process that ian@ wrote for r335642. To the kernel, hints and env va= rs are >> basically the same thing through early boot, then get merged into th= e >> dynamic environment once kmem becomes available and the dynamic envi= ronment >> is created. They should be subjected to the same restrictions. >> >> libnv has been added to -legacy for the time being to support the bu= ild of >> config(8) with the new cnvlist API. >> >> Tested with: universe (11 host & 12 host) >> MFC after: 1 month >> >=20 > This seems to be causing pretty consistent config(8) failures on CI, > kernels with neither hints nor environment variables, that neither of > my universe builds nor any of my post-commit builds can reproduce. Can > anyone else reproduce these failures that might be willing to give me > a hint as to what kind of setup causes this? >=20 > 01:47:58 cd /usr/src/sys/arm/conf; > PATH=3D/usr/obj/usr/src/arm.armv7/tmp/legacy/usr/sbin:/usr/obj/usr/src/= arm.armv7/tmp/legacy/usr/bin:/usr/obj/usr/src/arm.armv7/tmp/legacy/bin:/u= sr/obj/usr/src/arm.armv7/tmp/usr/sbin:/usr/obj/usr/src/arm.armv7/tmp/usr/= bin:/sbin:/bin:/usr/sbin:/usr/bin > config -d /usr/obj/usr/src/arm.armv7/sys/GENERIC -I > '/usr/src/sys/arm/conf' '/usr/src/sys/arm/conf/GENERIC' > 01:47:58 config: /usr/src/sys/arm/conf/GENERIC: No error: 0 >=20 I've seen this error with broken ABI. The -I${SRCTOP}/sys on the config build may be contributing to the problem since sys/stat.h is ino64 and the builder may not be. Really should not be bringing in the source sys/ directory for any of the early host tool phases. There's some hack patterns to bring in a limited amount of headers but in this case the headers should be getting staged somewhere already. Note legacy: ${MAKE} DIRPRFX=3D${_tool}/ DESTDIR=3D${WORLDTMP}/legacy includes; \ So -IWORLDTMP/legacy/sys should find the nv headers. This is already included via: tools/build/mk/Makefile.boot:CFLAGS+=3D -I${WORLDTMP}/legacy/usr/includ= e Which is brought in for bootstrap-tools though via: MAKEFLAGS=3D"-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" --=20 Regards, Bryan Drewery --PX2dU4yd7wU53pG2iq7IingH7Uk4T4F3W-- --2IThXnlo7T5MBOOVOoX2tT0kI3rCZmTA2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAls/B2cACgkQNddxu25G l8+XRgf/UjXK5BTC9nTpT8fAYLTpD0ktW98/PJRXCK9WLqis9weE7X6FKaVC8urb 5evAWS5TOLhAjoqKUCBqLhReQ/GuIPQRwQsqQq04/fjeDI5CLampLzqQYb3hSffU 8mgwx0azuDSa9RSeXCFU2pQlr5DaufGFToS2ybavDMgafC3Nzr1eLLnuryYXzBy+ QZgGIlx52O01q6Y3CLXrNpQat7iHDeWSYX8V3TMMxy0u3wzynVzqnCn6sasgPbjl Zya5Py0ggv8G4cowQrzFes5eKaQLs1zb9+6L+wkUT1RT+NtG1VAQnWgHmR11IPZx yty+HbaZK7MB/Owz1iGq3zXVEuu+UA== =l/ct -----END PGP SIGNATURE----- --2IThXnlo7T5MBOOVOoX2tT0kI3rCZmTA2-- From owner-svn-src-head@freebsd.org Fri Jul 6 06:20:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2857910427C4; Fri, 6 Jul 2018 06:20:04 +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 CE1B38D322; Fri, 6 Jul 2018 06:20:03 +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 AB07424D2E; Fri, 6 Jul 2018 06:20:03 +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 w666K3ar063539; Fri, 6 Jul 2018 06:20:03 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w666K3xU063536; Fri, 6 Jul 2018 06:20:03 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807060620.w666K3xU063536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 6 Jul 2018 06:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336021 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 336021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 06:20:04 -0000 Author: mmacy Date: Fri Jul 6 06:20:03 2018 New Revision: 336021 URL: https://svnweb.freebsd.org/changeset/base/336021 Log: epoch(9): simplify initialization replace manual NUMA aware allocation with a pcpu zone Modified: head/sys/kern/subr_epoch.c head/sys/sys/epoch_private.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri Jul 6 02:06:03 2018 (r336020) +++ head/sys/kern/subr_epoch.c Fri Jul 6 06:20:03 2018 (r336021) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -93,29 +94,23 @@ TAILQ_HEAD (threadlist, thread); CK_STACK_CONTAINER(struct ck_epoch_entry, stack_entry, ck_epoch_entry_container) - epoch_t allepochs[MAX_EPOCHS]; +epoch_t allepochs[MAX_EPOCHS]; DPCPU_DEFINE(struct grouptask, epoch_cb_task); DPCPU_DEFINE(int, epoch_cb_count); -static __read_mostly int domcount[MAXMEMDOM]; -static __read_mostly int domoffsets[MAXMEMDOM]; static __read_mostly int inited; static __read_mostly int epoch_count; __read_mostly epoch_t global_epoch; __read_mostly epoch_t global_epoch_preempt; static void epoch_call_task(void *context __unused); +static uma_zone_t pcpu_zone_record; -#if defined(__powerpc64__) || defined(__powerpc__) || !defined(NUMA) -static bool usedomains = false; -#else -static bool usedomains = true; -#endif static void epoch_init(void *arg __unused) { - int domain, cpu; + int cpu; block_count = counter_u64_alloc(M_WAITOK); migrate_count = counter_u64_alloc(M_WAITOK); @@ -123,25 +118,9 @@ epoch_init(void *arg __unused) switch_count = counter_u64_alloc(M_WAITOK); epoch_call_count = counter_u64_alloc(M_WAITOK); epoch_call_task_count = counter_u64_alloc(M_WAITOK); - if (usedomains == false) - goto done; - domain = 0; - domoffsets[0] = 0; - for (domain = 0; domain < vm_ndomains; domain++) { - domcount[domain] = CPU_COUNT(&cpuset_domain[domain]); - if (bootverbose) - printf("domcount[%d] %d\n", domain, domcount[domain]); - } - for (domain = 1; domain < vm_ndomains; domain++) - domoffsets[domain] = domoffsets[domain - 1] + domcount[domain - 1]; - for (domain = 0; domain < vm_ndomains; domain++) { - if (domcount[domain] == 0) { - usedomains = false; - break; - } - } -done: + 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"); @@ -161,39 +140,19 @@ epoch_init_smp(void *dummy __unused) SYSINIT(epoch_smp, SI_SUB_SMP + 1, SI_ORDER_FIRST, epoch_init_smp, NULL); #endif - static void -epoch_init_numa(epoch_t epoch) +epoch_ctor(epoch_t epoch) { - int domain, cpu_offset; epoch_record_t er; + int cpu; - for (domain = 0; domain < vm_ndomains; domain++) { - er = malloc_domain(sizeof(*er) * domcount[domain], M_EPOCH, - domain, M_ZERO | M_WAITOK); - epoch->e_pcpu_dom[domain] = er; - cpu_offset = domoffsets[domain]; - for (int i = 0; i < domcount[domain]; i++, er++) { - epoch->e_pcpu[cpu_offset + i] = er; - ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); - TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); - er->er_cpuid = cpu_offset + i; - } - } -} - -static void -epoch_init_legacy(epoch_t epoch) -{ - epoch_record_t er; - - er = malloc(sizeof(*er) * mp_ncpus, M_EPOCH, M_ZERO | M_WAITOK); - epoch->e_pcpu_dom[0] = er; - for (int i = 0; i < mp_ncpus; i++, er++) { - epoch->e_pcpu[i] = er; + epoch->e_pcpu_record = uma_zalloc_pcpu(pcpu_zone_record, M_WAITOK); + CPU_FOREACH(cpu) { + er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); + bzero(er, sizeof(*er)); ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); - er->er_cpuid = i; + er->er_cpuid = cpu; } } @@ -204,13 +163,9 @@ epoch_alloc(int flags) if (__predict_false(!inited)) panic("%s called too early in boot", __func__); - epoch = malloc(sizeof(struct epoch) + mp_ncpus * sizeof(void *), - M_EPOCH, M_ZERO | M_WAITOK); + epoch = malloc(sizeof(struct epoch), M_EPOCH, M_ZERO | M_WAITOK); ck_epoch_init(&epoch->e_epoch); - if (usedomains) - epoch_init_numa(epoch); - else - epoch_init_legacy(epoch); + epoch_ctor(epoch); MPASS(epoch_count < MAX_EPOCHS - 2); epoch->e_flags = flags; epoch->e_idx = epoch_count; @@ -221,23 +176,18 @@ epoch_alloc(int flags) void epoch_free(epoch_t epoch) { - int domain; #ifdef INVARIANTS struct epoch_record *er; int cpu; CPU_FOREACH(cpu) { - er = epoch->e_pcpu[cpu]; + er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); MPASS(TAILQ_EMPTY(&er->er_tdlist)); } #endif allepochs[epoch->e_idx] = NULL; epoch_wait(global_epoch); - if (usedomains) - for (domain = 0; domain < vm_ndomains; domain++) - free_domain(epoch->e_pcpu_dom[domain], M_EPOCH); - else - free(epoch->e_pcpu_dom[0], M_EPOCH); + uma_zfree_pcpu(pcpu_zone_record, epoch->e_pcpu_record); free(epoch, M_EPOCH); } @@ -496,7 +446,7 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* critical_enter(); *DPCPU_PTR(epoch_cb_count) += 1; - er = epoch->e_pcpu[curcpu]; + er = epoch_currecord(epoch); ck_epoch_call(&er->er_record, cb, (ck_epoch_cb_t *)callback); critical_exit(); return; @@ -509,6 +459,7 @@ epoch_call_task(void *arg __unused) { ck_stack_entry_t *cursor, *head, *next; ck_epoch_record_t *record; + epoch_record_t er; epoch_t epoch; ck_stack_t cb_stack; int i, npending, total; @@ -519,7 +470,8 @@ epoch_call_task(void *arg __unused) for (total = i = 0; i < epoch_count; i++) { if (__predict_false((epoch = allepochs[i]) == NULL)) continue; - record = &epoch->e_pcpu[curcpu]->er_record; + er = epoch_currecord(epoch); + record = &er->er_record; if ((npending = record->n_pending) == 0) continue; ck_epoch_poll_deferred(record, &cb_stack); @@ -555,7 +507,7 @@ in_epoch_verbose(epoch_t epoch, int dump_onfail) if (__predict_false((epoch) == NULL)) return (0); critical_enter(); - er = epoch->e_pcpu[curcpu]; + er = epoch_currecord(epoch); TAILQ_FOREACH(tdwait, &er->er_tdlist, et_link) if (tdwait->et_td == td) { critical_exit(); Modified: head/sys/sys/epoch_private.h ============================================================================== --- head/sys/sys/epoch_private.h Fri Jul 6 02:06:03 2018 (r336020) +++ head/sys/sys/epoch_private.h Fri Jul 6 06:20:03 2018 (r336021) @@ -97,12 +97,17 @@ typedef struct epoch_record { struct epoch { struct ck_epoch e_epoch __aligned(EPOCH_ALIGN); - struct epoch_record *e_pcpu_dom[MAXMEMDOM] __aligned(EPOCH_ALIGN); + epoch_record_t e_pcpu_record; int e_idx; int e_flags; - struct epoch_record *e_pcpu[0]; }; +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)) \ @@ -115,6 +120,7 @@ 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; @@ -130,7 +136,7 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) sched_pin_lite(td); td->td_pre_epoch_prio = td->td_priority; - er = epoch->e_pcpu[curcpu]; + er = epoch_currecord(epoch); TAILQ_INSERT_TAIL(&er->er_tdlist, etd, et_link); ck_epoch_begin(&er->er_record, (ck_epoch_section_t *)&etd->et_section); critical_exit_sa(td); @@ -139,16 +145,17 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) static __inline void epoch_enter(epoch_t epoch) { - ck_epoch_record_t *record; struct thread_lite *td; + epoch_record_t er; + MPASS(cold || epoch != NULL); INIT_CHECK(epoch); td = (struct thread_lite *)curthread; td->td_epochnest++; critical_enter_sa(td); - record = &epoch->e_pcpu[curcpu]->er_record; - ck_epoch_begin(record, NULL); + er = epoch_currecord(epoch); + ck_epoch_begin(&er->er_record, NULL); } static __inline void @@ -164,7 +171,7 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) sched_unpin_lite(td); MPASS(td->td_epochnest); td->td_epochnest--; - er = epoch->e_pcpu[curcpu]; + er = epoch_currecord(epoch); MPASS(epoch->e_flags & EPOCH_PREEMPT); etd = (void *)et; #ifdef INVARIANTS @@ -188,15 +195,15 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) static __inline void epoch_exit(epoch_t epoch) { - ck_epoch_record_t *record; struct thread_lite *td; + epoch_record_t er; INIT_CHECK(epoch); td = (struct thread_lite *)curthread; MPASS(td->td_epochnest); td->td_epochnest--; - record = &epoch->e_pcpu[curcpu]->er_record; - ck_epoch_end(record, NULL); + er = epoch_currecord(epoch); + ck_epoch_end(&er->er_record, NULL); critical_exit_sa(td); } #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Fri Jul 6 06:21:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF04910429CA; Fri, 6 Jul 2018 06:21:25 +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 84D518D54B; Fri, 6 Jul 2018 06:21:25 +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 6644E24E5D; Fri, 6 Jul 2018 06:21:25 +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 w666LPAp065119; Fri, 6 Jul 2018 06:21:25 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w666LPm3065118; Fri, 6 Jul 2018 06:21:25 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807060621.w666LPm3065118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 6 Jul 2018 06:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336022 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 336022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 06:21:26 -0000 Author: mmacy Date: Fri Jul 6 06:21:24 2018 New Revision: 336022 URL: https://svnweb.freebsd.org/changeset/base/336022 Log: hwpmc: remove hacks to work around incorrect pc_domain Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Fri Jul 6 06:20:03 2018 (r336021) +++ head/sys/dev/hwpmc/hwpmc_logging.c Fri Jul 6 06:21:24 2018 (r336022) @@ -65,15 +65,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef NUMA -#define NDOMAINS vm_ndomains #define curdomain PCPU_GET(domain) -#else -#define NDOMAINS 1 -#define curdomain 0 -#define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) -#define free_domain(addr, type) free(addr, type) -#endif /* * Sysctl tunables @@ -1261,7 +1253,7 @@ pmclog_initialize() pmc_nlogbuffers_pcpu = PMC_NLOGBUFFERS_PCPU; pmclog_buffer_size = PMC_LOG_BUFFER_SIZE; } - for (domain = 0; domain < NDOMAINS; domain++) { + for (domain = 0; domain < vm_ndomains; domain++) { int ncpus = pmc_dom_hdrs[domain]->pdbh_ncpus; int total = ncpus*pmc_nlogbuffers_pcpu; @@ -1293,7 +1285,7 @@ pmclog_shutdown() mtx_destroy(&pmc_kthread_mtx); - for (domain = 0; domain < NDOMAINS; domain++) { + for (domain = 0; domain < vm_ndomains; domain++) { while ((plb = TAILQ_FIRST(&pmc_dom_hdrs[domain]->pdbh_head)) != NULL) { TAILQ_REMOVE(&pmc_dom_hdrs[domain]->pdbh_head, plb, plb_next); free(plb->plb_base, M_PMC); From owner-svn-src-head@freebsd.org Fri Jul 6 06:43:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C50C61045B36; Fri, 6 Jul 2018 06:43:14 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7143C8EA03; Fri, 6 Jul 2018 06:43:14 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0PBF00800MGQZU00@st13p35im-asmtp001.me.com>; Fri, 06 Jul 2018 06:43:08 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0PBF00L9RMNSKD10@st13p35im-asmtp001.me.com>; Fri, 06 Jul 2018 06:43:07 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-07-06_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1807060073 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r336017 - in head: include/rpcsvc lib/libutil libexec/rpc.rquotad sys/cddl/contrib/opensolaris/uts/common/fs/zfs usr.bin/quota From: Toomas Soome In-reply-to: <201807052256.w65MuETx038724@repo.freebsd.org> Date: Fri, 06 Jul 2018 09:43:26 +0300 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <44B06A1B-360C-4826-A1B6-44AF772D70F5@me.com> References: <201807052256.w65MuETx038724@repo.freebsd.org> To: Sean Eric Fagan X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 06:43:15 -0000 Hi! Unfortunately this patch is not quite correct regarding how you define = the RPC interfaces. The versioning in RPC is to specify the interface, much like versioning = in shared library.=20 If you have RPC program version 1, exposing functions get_quota() and = get_active_quota(), and you want to expose new function, you should = introduce new version. The best example about this logic is in mount.x - there you can see how = they have done 2 versions of the interface, expanding the list of = exported functions. The problem is, to create connection with server, you specify = pair, and if supported, you will get the = corresponding handle. Now you can have situation with mixed new and old = interfaces (sharing the same version number) but the exported functions = are not the same. rgds, toomas > On 6 Jul 2018, at 01:56, Sean Eric Fagan wrote: >=20 > Author: sef > Date: Thu Jul 5 22:56:13 2018 > New Revision: 336017 > URL: https://svnweb.freebsd.org/changeset/base/336017 >=20 > Log: > This exposes ZFS user and group quotas via the normal > quatactl(2) mechanism. (Read-only at this point, however.) > In particular, this is to allow rpc.rquotad query quotas > for NFS mounts, allowing users to see their quotas on the > hosts using the datasets. >=20 > The changes specifically: >=20 > * Add new RPC entry points for querying quotas. > * Changes the library routines to allow non-UFS quotas. > * Changes rquotad to check for quotas on mounted filesystems, > rather than being limited to entries in /etc/fstab > * Lastly, adds a VFS entry-point for ZFS to query quotas. >=20 > Note that this makes one unavoidable behavioural change: if quotas > are enabled, then they can be queried, as opposed to the current > method of checking for quotas being specified in fstab. (With > ZFS, if there are user or group quotas, they're used, always.) >=20 > Reviewed by: delphij, mav > Approved by: mav > Sponsored by: iXsystems Inc > Differential Revision: https://reviews.freebsd.org/D15886 >=20 > Modified: > head/include/rpcsvc/rquota.x > head/lib/libutil/quotafile.c > head/libexec/rpc.rquotad/rquotad.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > head/usr.bin/quota/quota.c >=20 > Modified: head/include/rpcsvc/rquota.x > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/include/rpcsvc/rquota.x Thu Jul 5 21:38:54 2018 = (r336016) > +++ head/include/rpcsvc/rquota.x Thu Jul 5 22:56:13 2018 = (r336017) > @@ -1,24 +1,55 @@ > +/* @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC */ > +/* @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro */ > + > /* > * Remote quota protocol > * Requires unix authentication > */ >=20 > #ifndef RPC_HDR > -%#ifndef lint > -%/*static char sccsid[] =3D "from: @(#)rquota.x 1.2 87/09/20 Copyr = 1987 Sun Micro";*/ > -%/*static char sccsid[] =3D "from: @(#)rquota.x 2.1 88/08/01 4.0 = RPCSRC";*/ > -%#endif /* not lint */ > %#include > %__FBSDID("$FreeBSD$"); > #endif >=20 > const RQ_PATHLEN =3D 1024; >=20 > +struct sq_dqblk { > + unsigned int rq_bhardlimit; /* absolute limit on disk blks = alloc */ > + unsigned int rq_bsoftlimit; /* preferred limit on disk blks = */ > + unsigned int rq_curblocks; /* current block count */ > + unsigned int rq_fhardlimit; /* absolute limit on allocated = files */ > + unsigned int rq_fsoftlimit; /* preferred file limit */ > + unsigned int rq_curfiles; /* current # allocated files */ > + unsigned int rq_btimeleft; /* time left for excessive disk = use */ > + unsigned int rq_ftimeleft; /* time left for excessive files = */ > +}; > + > struct getquota_args { > string gqa_pathp; /* path to filesystem of = interest */ > - int gqa_uid; /* inquire about quota for uid = */ > + int gqa_uid; /* Inquire about quota for uid = */ > }; >=20 > +struct setquota_args { > + int sqa_qcmd; > + string sqa_pathp; /* path to filesystem of = interest */ > + int sqa_id; /* Set quota for uid */ > + sq_dqblk sqa_dqblk; > +}; > + > +struct ext_getquota_args { > + string gqa_pathp; /* path to filesystem of = interest */ > + int gqa_type; /* Type of quota info is needed = about */ > + int gqa_id; /* Inquire about quota for id */ > +}; > + > +struct ext_setquota_args { > + int sqa_qcmd; > + string sqa_pathp; /* path to filesystem of = interest */ > + int sqa_id; /* Set quota for id */ > + int sqa_type; /* Type of quota to set */ > + sq_dqblk sqa_dqblk; > +}; > + > /* > * remote quota structure > */ > @@ -37,7 +68,7 @@ struct rquota { >=20 > enum gqr_status { > Q_OK =3D 1, /* quota returned */ > - Q_NOQUOTA =3D 2, /* noquota for uid */ > + Q_NOQUOTA =3D 2, /* noquota for uid */ > Q_EPERM =3D 3 /* no permission to access quota */ > }; >=20 > @@ -50,6 +81,15 @@ case Q_EPERM: > void; > }; >=20 > +union setquota_rslt switch (gqr_status status) { > +case Q_OK: > + rquota sqr_rquota; /* valid if status =3D=3D Q_OK */ > +case Q_NOQUOTA: > + void; > +case Q_EPERM: > + void; > +}; > + > program RQUOTAPROG { > version RQUOTAVERS { > /* > @@ -63,5 +103,42 @@ program RQUOTAPROG { > */ > getquota_rslt > RQUOTAPROC_GETACTIVEQUOTA(getquota_args) =3D 2; > + > + /* > + * Set all quotas > + */ > + setquota_rslt > + RQUOTAPROC_SETQUOTA(setquota_args) =3D 3; > + > + /* > + * Get active quotas only > + */ > + setquota_rslt > + RQUOTAPROC_SETACTIVEQUOTA(setquota_args) =3D 4; > } =3D 1; > + version EXT_RQUOTAVERS { > + /* > + * Get all quotas > + */ > + getquota_rslt > + RQUOTAPROC_GETQUOTA(ext_getquota_args) =3D 1; > + > + /* > + * Get active quotas only > + */ > + getquota_rslt > + RQUOTAPROC_GETACTIVEQUOTA(ext_getquota_args) =3D 2; > + > + /* > + * Set all quotas > + */ > + setquota_rslt > + RQUOTAPROC_SETQUOTA(ext_setquota_args) =3D 3; > + > + /* > + * Set active quotas only > + */ > + setquota_rslt > + RQUOTAPROC_SETACTIVEQUOTA(ext_setquota_args) =3D 4; > + } =3D 2; > } =3D 100011; >=20 > Modified: head/lib/libutil/quotafile.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/lib/libutil/quotafile.c Thu Jul 5 21:38:54 2018 = (r336016) > +++ head/lib/libutil/quotafile.c Thu Jul 5 22:56:13 2018 = (r336017) > @@ -120,8 +120,6 @@ quota_open(struct fstab *fs, int quotatype, int = openfl > struct stat st; > int qcmd, serrno; >=20 > - if (strcmp(fs->fs_vfstype, "ufs")) > - return (NULL); > if ((qf =3D calloc(1, sizeof(*qf))) =3D=3D NULL) > return (NULL); > qf->fd =3D -1; > @@ -130,10 +128,15 @@ quota_open(struct fstab *fs, int quotatype, int = openfl > if (stat(qf->fsname, &st) !=3D 0) > goto error; > qf->dev =3D st.st_dev; > - serrno =3D hasquota(fs, quotatype, qf->qfname, = sizeof(qf->qfname)); > qcmd =3D QCMD(Q_GETQUOTASIZE, quotatype); > if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) =3D=3D 0) > return (qf); > + /* We only check the quota file for ufs */ > + if (strcmp(fs->fs_vfstype, "ufs")) { > + errno =3D 0; > + goto error; > + } > + serrno =3D hasquota(fs, quotatype, qf->qfname, = sizeof(qf->qfname)); > if (serrno =3D=3D 0) { > errno =3D EOPNOTSUPP; > goto error; >=20 > Modified: head/libexec/rpc.rquotad/rquotad.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/libexec/rpc.rquotad/rquotad.c Thu Jul 5 21:38:54 2018 = (r336016) > +++ head/libexec/rpc.rquotad/rquotad.c Thu Jul 5 22:56:13 2018 = (r336017) > @@ -28,18 +28,19 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include >=20 > -static void rquota_service(struct svc_req *request, SVCXPRT *transp); > +static void rquota_service_1(struct svc_req *request, SVCXPRT = *transp); > +static void rquota_service_2(struct svc_req *request, SVCXPRT = *transp); > static void sendquota(struct svc_req *request, SVCXPRT *transp); > -static void initfs(void); > -static int getfsquota(long id, char *path, struct dqblk *dqblk); > +static void sendquota_extended(struct svc_req *request, SVCXPRT = *transp); > +static int getfsquota(int type, long id, char *path, struct dqblk = *dqblk); >=20 > -static struct quotafile **qfa; /* array of qfs */ > -static int nqf, szqf; /* number of qfs and size of = array */ > static int from_inetd =3D 1; > +static int debug =3D 0; >=20 > static void > cleanup(int sig) > @@ -51,19 +52,32 @@ cleanup(int sig) > } >=20 > int > -main(void) > +main(int argc, char **argv) > { > SVCXPRT *transp; > int ok; > struct sockaddr_storage from; > socklen_t fromlen; > + int vers; > + int ch; >=20 > + while ((ch =3D getopt(argc, argv, "d")) !=3D -1) { > + switch (ch) { > + case 'd': > + debug++; > + break; > + default: > + break; > + } > + } > + > fromlen =3D sizeof(from); > if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) > from_inetd =3D 0; >=20 > if (!from_inetd) { > - daemon(0, 0); > + if (!debug) > + daemon(0, 0); > (void)rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); > (void)signal(SIGINT, cleanup); > (void)signal(SIGTERM, cleanup); > @@ -79,27 +93,40 @@ main(void) > syslog(LOG_ERR, "couldn't create udp service."); > exit(1); > } > + vers =3D RQUOTAVERS; > ok =3D svc_reg(transp, RQUOTAPROG, RQUOTAVERS, > - rquota_service, NULL); > + rquota_service_1, NULL); > + if (ok) { > + vers =3D EXT_RQUOTAVERS; > + ok =3D svc_reg(transp, RQUOTAPROG, = EXT_RQUOTAVERS, > + rquota_service_2, NULL); > + } > } else { > - ok =3D svc_create(rquota_service, > + vers =3D RQUOTAVERS; > + ok =3D svc_create(rquota_service_1, > RQUOTAPROG, RQUOTAVERS, "udp"); > + if (ok) { > + vers =3D EXT_RQUOTAVERS; > + ok =3D svc_create(rquota_service_2, > + RQUOTAPROG, EXT_RQUOTAVERS, = "udp"); > + > + } > } > if (!ok) { > syslog(LOG_ERR, > - "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", > - from_inetd ? "(inetd)" : "udp"); > + "unable to register (RQUOTAPROG, %s, %s)", > + vers =3D=3D RQUOTAVERS ? "RQUOTAVERS" : = "EXT_RQUOTAVERS", > + from_inetd ? "(inetd)" : "udp"); > exit(1); > } >=20 > - initfs(); > svc_run(); > syslog(LOG_ERR, "svc_run returned"); > exit(1); > } >=20 > static void > -rquota_service(struct svc_req *request, SVCXPRT *transp) > +rquota_service_2(struct svc_req *request, SVCXPRT *transp) > { >=20 > switch (request->rq_proc) { > @@ -108,6 +135,26 @@ rquota_service(struct svc_req *request, SVCXPRT = *trans > break; > case RQUOTAPROC_GETQUOTA: > case RQUOTAPROC_GETACTIVEQUOTA: > + sendquota_extended(request, transp); > + break; > + default: > + svcerr_noproc(transp); > + break; > + } > + if (from_inetd) > + exit(0); > +} > + > +static void > +rquota_service_1(struct svc_req *request, SVCXPRT *transp) > +{ > + > + switch (request->rq_proc) { > + case NULLPROC: > + (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char = *)NULL); > + break; > + case RQUOTAPROC_GETQUOTA: > + case RQUOTAPROC_GETACTIVEQUOTA: > sendquota(request, transp); > break; > default: > @@ -136,7 +183,7 @@ sendquota(struct svc_req *request, SVCXPRT = *transp) > if (request->rq_cred.oa_flavor !=3D AUTH_UNIX) { > /* bad auth */ > getq_rslt.status =3D Q_EPERM; > - } else if (!getfsquota(getq_args.gqa_uid, getq_args.gqa_pathp, = &dqblk)) { > + } else if (!getfsquota(USRQUOTA, getq_args.gqa_uid, = getq_args.gqa_pathp, &dqblk)) { > /* failed, return noquota */ > getq_rslt.status =3D Q_NOQUOTA; > } else { > @@ -172,38 +219,55 @@ sendquota(struct svc_req *request, SVCXPRT = *transp) > } >=20 > static void > -initfs(void) > +sendquota_extended(struct svc_req *request, SVCXPRT *transp) > { > - struct fstab *fs; > + struct ext_getquota_args getq_args; > + struct getquota_rslt getq_rslt; > + struct dqblk dqblk; > + struct timeval timev; > + int scale; >=20 > - setfsent(); > - szqf =3D 8; > - if ((qfa =3D malloc(szqf * sizeof *qfa)) =3D=3D NULL) > - goto enomem; > - while ((fs =3D getfsent())) { > - if (strcmp(fs->fs_vfstype, "ufs")) > - continue; > - if (nqf >=3D szqf) { > - szqf *=3D 2; > - if ((qfa =3D reallocf(qfa, szqf * sizeof *qfa)) = =3D=3D NULL) > - goto enomem; > - } > - if ((qfa[nqf] =3D quota_open(fs, USRQUOTA, O_RDONLY)) =3D=3D= NULL) { > - if (errno !=3D EOPNOTSUPP) > - goto fserr; > - continue; > - } > - ++nqf; > - /* XXX */ > + bzero(&getq_args, sizeof(getq_args)); > + if (!svc_getargs(transp, (xdrproc_t)xdr_ext_getquota_args, = &getq_args)) { > + svcerr_decode(transp); > + return; > } > - endfsent(); > - return; > -enomem: > - syslog(LOG_ERR, "out of memory"); > - exit(1); > -fserr: > - syslog(LOG_ERR, "%s: %s", fs->fs_file, strerror(errno)); > - exit(1); > + if (request->rq_cred.oa_flavor !=3D AUTH_UNIX) { > + /* bad auth */ > + getq_rslt.status =3D Q_EPERM; > + } else if (!getfsquota(getq_args.gqa_type, getq_args.gqa_id, = getq_args.gqa_pathp, &dqblk)) { > + /* failed, return noquota */ > + getq_rslt.status =3D Q_NOQUOTA; > + } else { > + gettimeofday(&timev, NULL); > + getq_rslt.status =3D Q_OK; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_active =3D TRUE; > + scale =3D 1 << flsll(dqblk.dqb_bhardlimit >> 32); > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize =3D > + DEV_BSIZE * scale; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit =3D > + dqblk.dqb_bhardlimit / scale; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit =3D > + dqblk.dqb_bsoftlimit / scale; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks =3D > + dqblk.dqb_curblocks / scale; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit =3D > + dqblk.dqb_ihardlimit; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_fsoftlimit =3D > + dqblk.dqb_isoftlimit; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_curfiles =3D > + dqblk.dqb_curinodes; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_btimeleft =3D > + dqblk.dqb_btime - timev.tv_sec; > + getq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft =3D > + dqblk.dqb_itime - timev.tv_sec; > + } > + if (!svc_sendreply(transp, (xdrproc_t)xdr_getquota_rslt, = &getq_rslt)) > + svcerr_systemerr(transp); > + if (!svc_freeargs(transp, (xdrproc_t)xdr_getquota_args, = &getq_args)) { > + syslog(LOG_ERR, "unable to free arguments"); > + exit(1); > + } > } >=20 > /* > @@ -211,12 +275,43 @@ fserr: > * Return 0 if fail, 1 otherwise > */ > static int > -getfsquota(long id, char *path, struct dqblk *dqblk) > +getfsquota(int type, long id, char *path, struct dqblk *dqblk) > { > - int i; > + struct quotafile *qf; > + /* > + * Remote quota checking is limited to mounted filesystems. > + * Since UFS and ZFS support the quota system calls, we > + * only need to make an fstab object that has the path, and > + * a blank name for the filesystem type. > + * This allows the quota_open() call to work the way we > + * expect it to. > + * > + * The static char declaration is because compiler warnings > + * don't allow passing a const char * to a char *. > + */ > + int rv; > + static char blank[] =3D ""; > + struct fstab fst; >=20 > - for (i =3D 0; i < nqf; ++i) > - if (quota_check_path(qfa[i], path) =3D=3D 1) > - return (quota_read(qfa[i], dqblk, id) =3D=3D 0); > - return (0); > + fst.fs_file =3D path; > + fst.fs_mntops =3D blank; > + fst.fs_vfstype =3D blank; > +=09 > + if (type !=3D USRQUOTA && type !=3D GRPQUOTA) > + return (0); > +=09 > + qf =3D quota_open(&fst, type, O_RDONLY); > + if (debug) > + warnx("quota_open(<%s, %s>, %d) returned %p", > + fst.fs_file, fst.fs_mntops, type, > + qf); > + if (qf =3D=3D NULL) > + return (0); > + > + rv =3D quota_read(qf, dqblk, id) =3D=3D 0; > + quota_close(qf); > + if (debug) > + warnx("getfsquota(%d, %ld, %s, %p) -> %d", > + type, id, path, dqblk, rv); > + return (rv); > } >=20 > Modified: = head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c = Thu Jul 5 21:38:54 2018 (r336016) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c = Thu Jul 5 22:56:13 2018 (r336017) > @@ -64,6 +64,8 @@ > #include > #include > #include > +#include > + > #include "zfs_comutil.h" >=20 > struct mtx zfs_debug_mtx; > @@ -90,6 +92,7 @@ static int zfs_version_zpl =3D ZPL_VERSION; > SYSCTL_INT(_vfs_zfs_version, OID_AUTO, zpl, CTLFLAG_RD, = &zfs_version_zpl, 0, > "ZPL_VERSION"); >=20 > +static int zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg); > static int zfs_mount(vfs_t *vfsp); > static int zfs_umount(vfs_t *vfsp, int fflag); > static int zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp); > @@ -111,6 +114,7 @@ struct vfsops zfs_vfsops =3D { > .vfs_sync =3D zfs_sync, > .vfs_checkexp =3D zfs_checkexp, > .vfs_fhtovp =3D zfs_fhtovp, > + .vfs_quotactl =3D zfs_quotactl, > }; >=20 > VFS_SET(zfs_vfsops, zfs, VFCF_JAIL | VFCF_DELEGADMIN); > @@ -121,6 +125,159 @@ VFS_SET(zfs_vfsops, zfs, VFCF_JAIL | = VFCF_DELEGADMIN); > * from being unloaded after a umount -f > */ > static uint32_t zfs_active_fs_count =3D 0; > + > +static int > +zfs_getquota(zfsvfs_t *zfsvfs, uid_t id, int isgroup, struct dqblk64 = *dqp) > +{ > + int error =3D 0; > + char buf[32]; > + int err; > + uint64_t usedobj, quotaobj; > + uint64_t quota, used =3D 0; > + timespec_t now; > +=09 > + usedobj =3D isgroup ? DMU_GROUPUSED_OBJECT : = DMU_USERUSED_OBJECT; > + quotaobj =3D isgroup ? zfsvfs->z_groupquota_obj : = zfsvfs->z_userquota_obj; > + > + if (quotaobj =3D=3D 0 || zfsvfs->z_replay) { > + error =3D ENOENT; > + goto done; > + } > + (void)sprintf(buf, "%llx", (longlong_t)id); > + if ((error =3D zap_lookup(zfsvfs->z_os, quotaobj, > + buf, sizeof(quota), 1, "a)) !=3D 0) = { > + dprintf("%s(%d): quotaobj lookup failed\n", = __FUNCTION__, __LINE__); > + goto done; > + } > + /* > + * quota(8) uses bsoftlimit as "quoota", and hardlimit as = "limit". > + * So we set them to be the same. > + */ > + dqp->dqb_bsoftlimit =3D dqp->dqb_bhardlimit =3D btodb(quota); > + error =3D zap_lookup(zfsvfs->z_os, usedobj, buf, sizeof(used), = 1, &used); > + if (error && error !=3D ENOENT) { > + dprintf("%s(%d): usedobj failed; %d\n", __FUNCTION__, = __LINE__, error); > + goto done; > + } > + dqp->dqb_curblocks =3D btodb(used); > + dqp->dqb_ihardlimit =3D dqp->dqb_isoftlimit =3D 0; > + vfs_timestamp(&now); > + /* > + * Setting this to 0 causes FreeBSD quota(8) to print > + * the number of days since the epoch, which isn't > + * particularly useful. > + */ > + dqp->dqb_btime =3D dqp->dqb_itime =3D now.tv_sec; > +done: > + return (error); > +} > + > +static int > +zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg) > +{ > + zfsvfs_t *zfsvfs =3D vfsp->vfs_data; > + struct thread *td; > + int cmd, type, error =3D 0; > + int bitsize; > + uint64_t fuid; > + zfs_userquota_prop_t quota_type; > + struct dqblk64 dqblk =3D { 0 }; > +=09 > + td =3D curthread; > + cmd =3D cmds >> SUBCMDSHIFT; > + type =3D cmds & SUBCMDMASK; > + > + ZFS_ENTER(zfsvfs); > + if (id =3D=3D -1) { > + switch (type) { > + case USRQUOTA: > + id =3D td->td_ucred->cr_ruid; > + break; > + case GRPQUOTA: > + id =3D td->td_ucred->cr_rgid; > + break; > + default: > + error =3D EINVAL; > + goto done; > + } > + } > + /* > + * Map BSD type to: > + * ZFS_PROP_USERUSED, > + * ZFS_PROP_USERQUOTA, > + * ZFS_PROP_GROUPUSED, > + * ZFS_PROP_GROUPQUOTA > + */ > + switch (cmd) { > + case Q_SETQUOTA: > + case Q_SETQUOTA32: > + if (type =3D=3D USRQUOTA) > + quota_type =3D ZFS_PROP_USERQUOTA; > + else if (type =3D=3D GRPQUOTA) > + quota_type =3D ZFS_PROP_GROUPQUOTA; > + else > + error =3D EINVAL; > + break; > + case Q_GETQUOTA: > + case Q_GETQUOTA32: > + if (type =3D=3D USRQUOTA) > + quota_type =3D ZFS_PROP_USERUSED; > + else if (type =3D=3D GRPQUOTA) > + quota_type =3D ZFS_PROP_GROUPUSED; > + else > + error =3D EINVAL; > + break; > + } > + > + /* > + * Depending on the cmd, we may need to get > + * the ruid and domain (see fuidstr_to_sid?), > + * the fuid (how?), or other information. > + * Create fuid using zfs_fuid_create(zfsvfs, id, > + * ZFS_OWNER or ZFS_GROUP, cr, &fuidp)? > + * I think I can use just the id? > + * > + * Look at zfs_fuid_overquota() to look up a quota. > + * zap_lookup(something, quotaobj, fuidstring, sizeof(long = long), 1, "a) > + * > + * See zfs_set_userquota() to set a quota. > + */ > + if ((u_int)type >=3D MAXQUOTAS) { > + error =3D EINVAL; > + goto done; > + } > + > + switch (cmd) { > + case Q_GETQUOTASIZE: > + bitsize =3D 64; > + error =3D copyout(&bitsize, arg, sizeof(int)); > + break; > + case Q_QUOTAON: > + // As far as I can tell, you can't turn quotas on or off = on zfs > + error =3D 0; > + break; > + case Q_QUOTAOFF: > + error =3D ENOTSUP; > + break; > + case Q_SETQUOTA: > + error =3D copyin(&dqblk, arg, sizeof(dqblk)); > + if (error =3D=3D 0) > + error =3D zfs_set_userquota(zfsvfs, quota_type, > + "", id, = dbtob(dqblk.dqb_bhardlimit)); > + break; > + case Q_GETQUOTA: > + error =3D zfs_getquota(zfsvfs, id, type =3D=3D GRPQUOTA, = &dqblk); > + if (error =3D=3D 0) > + error =3D copyout(&dqblk, arg, sizeof(dqblk)); > + break; > + default: > + error =3D EINVAL; > + break; > + } > +done: > + ZFS_EXIT(zfsvfs); > + return (error); > +} >=20 > /*ARGSUSED*/ > static int >=20 > Modified: head/usr.bin/quota/quota.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.bin/quota/quota.c Thu Jul 5 21:38:54 2018 = (r336016) > +++ head/usr.bin/quota/quota.c Thu Jul 5 22:56:13 2018 = (r336017) > @@ -98,7 +98,7 @@ static int getufsquota(struct fstab *fs, struct = quotau > int quotatype); > static int getnfsquota(struct statfs *fst, struct quotause *qup, long = id, > int quotatype); > -static int callaurpc(char *host, int prognum, int versnum, int = procnum,=20 > +static enum clnt_stat callaurpc(char *host, int prognum, int versnum, = int procnum,=20 > xdrproc_t inproc, char *in, xdrproc_t outproc, char *out); > static int alldigits(char *s); >=20 > @@ -568,22 +568,18 @@ getufsquota(struct fstab *fs, struct quotause = *qup, lo > static int > getnfsquota(struct statfs *fst, struct quotause *qup, long id, int = quotatype) > { > - struct getquota_args gq_args; > + struct ext_getquota_args gq_args; > + struct getquota_args old_gq_args; > struct getquota_rslt gq_rslt; > struct dqblk *dqp =3D &qup->dqblk; > struct timeval tv; > char *cp, host[NI_MAXHOST]; > + enum clnt_stat call_stat; >=20 > if (fst->f_flags & MNT_LOCAL) > return (0); >=20 > /* > - * rpc.rquotad does not support group quotas > - */ > - if (quotatype !=3D USRQUOTA) > - return (0); > - > - /* > * must be some form of "hostname:/path" > */ > cp =3D fst->f_mntfromname; > @@ -604,12 +600,27 @@ getnfsquota(struct statfs *fst, struct quotause = *qup,=20 > return (0); >=20 > gq_args.gqa_pathp =3D cp + 1; > - gq_args.gqa_uid =3D id; > - if (callaurpc(host, RQUOTAPROG, RQUOTAVERS, > - RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_getquota_args, (char = *)&gq_args, > - (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt) !=3D 0) > - return (0); > + gq_args.gqa_id =3D id; > + gq_args.gqa_type =3D quotatype; >=20 > + call_stat =3D callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS, > + RQUOTAPROC_GETQUOTA, = (xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args, > + (xdrproc_t)xdr_getquota_rslt, (char = *)&gq_rslt); > + if (call_stat =3D=3D RPC_PROGVERSMISMATCH) { > + if (quotatype =3D=3D USRQUOTA) { > + old_gq_args.gqa_pathp =3D cp + 1; > + old_gq_args.gqa_uid =3D id; > + call_stat =3D callaurpc(host, RQUOTAPROG, = RQUOTAVERS, > + RQUOTAPROC_GETQUOTA, = (xdrproc_t)xdr_getquota_args, (char *)&old_gq_args, > + = (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt); > + } else { > + /* Old rpc quota does not support group type */ > + return (0); > + } > + } > + if (call_stat !=3D 0) > + return (call_stat); > + > switch (gq_rslt.status) { > case Q_NOQUOTA: > break; > @@ -650,7 +661,7 @@ getnfsquota(struct statfs *fst, struct quotause = *qup,=20 > return (0); > } >=20 > -static int > +static enum clnt_stat > callaurpc(char *host, int prognum, int versnum, int procnum, > xdrproc_t inproc, char *in, xdrproc_t outproc, char *out) > { > @@ -671,8 +682,7 @@ callaurpc(char *host, int prognum, int versnum, = int pr > tottimeout.tv_usec =3D 0; > clnt_stat =3D clnt_call(client, procnum, inproc, in, > outproc, out, tottimeout); > -=20 > - return ((int) clnt_stat); > + return (clnt_stat); > } >=20 > static int >=20 From owner-svn-src-head@freebsd.org Fri Jul 6 09:56:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1C1710372D0; Fri, 6 Jul 2018 09:56:56 +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 85B5576D2A; Fri, 6 Jul 2018 09:56:56 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 890765A9F16; Fri, 6 Jul 2018 09:56:55 +0000 (UTC) Date: Fri, 6 Jul 2018 09:56:55 +0000 From: Brooks Davis To: Matthew Macy Cc: Brooks Davis , Ravi Pokala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat Message-ID: <20180706095655.GA83113@spindle.one-eyed-alien.net> References: <201807051313.w65DDnQJ041281@repo.freebsd.org> <20180705163338.GA67089@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 09:56:57 -0000 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sorry about that. I'm working on it. -- brooks On Thu, Jul 05, 2018 at 06:45:33PM -0700, Matthew Macy wrote: > this breaks the MIPS builds. >=20 > On Thu, Jul 5, 2018 at 9:33 AM, Brooks Davis wrote: > > On Thu, Jul 05, 2018 at 09:10:54AM -0700, Ravi Pokala wrote: > >> Hi Brooks, > >> > >> -----Original Message----- > >> From: on behalf of Brooks Davis > >> Date: 2018-07-05, Thursday at 06:13 > >> To: , , > >> Subject: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/neti= net sys/sys usr.bin/netstat usr.bin/sockstat > >> > >> > Author: brooks > >> > Date: Thu Jul 5 13:13:48 2018 > >> > New Revision: 335979 > >> > URL: https://svnweb.freebsd.org/changeset/base/335979 > >> > > >> > Log: > >> > Make struct xinpcb and friends word-size independent. > >> > > >> > Replace size_t members with ksize_t (uint64_t) and pointer members > >> > (never used as pointers in userspace, but instead as unique > >> > idenitifiers) with kvaddr_t (uint64_t). This makes the structs > >> > identical between 32-bit and 64-bit ABIs. > >> ... > >> > Modified: head/UPDATING > >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=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/UPDATING Thu Jul 5 11:50:59 2018 (r335978) > >> > +++ head/UPDATING Thu Jul 5 13:13:48 2018 (r335979) > >> > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLO= W: > >> > disable the most expensive debugging functionality run > >> > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > >> > > >> > +20180705: > >> > + The ABI of syscalls used by management tools like sockstat and > >> > + netstat has been broken to allow 32-bit binaries to work on > >> > + 64-bit kernels without modification. > >> > >> Isn't that what the compat32 layer is for? > > > > compat32 isn't magic. If one tried, one could hardly design structures > > to make 32-bit compat harder then the previous versions. It's certainly > > possible to make work, but quite annoying. Since the ABI of most these > > structures was already broken for 12, I chose this approach as it is > > quite trivial. > > > >> > These programs will need > >> > + to match the kernel in order to function. External programs may > >> > + require minor modifications to accommodate a change of type in > >> > + structures from pointers to 64-bit virtual addresses. > >> > >> Doesn't this contradict the earlier statement about letting things run= unmodified? > > > > Unmodified post this commit. We already don't support netstat and > > sockstat from 11 on 12 in any architecture combination. > > > > -- Brooks >=20 --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbPzzmAAoJEKzQXbSebgfAd+sH/0j2jVlxY2Ei3YWrXyqxuk0w 45t6+wbAG7JwIMXwj5QxtmvCQRwmF3M3YdHAd97nMkjzqhpasmid44g1NUSG4xw/ MJbTyiQ2w/I2Cs41RQVu/cVmtRBQfegLGXxygqneLTw6e1oFh/CL/EE7xsZtZa2A 3MNhgz3LF62nbHJlv11QuZC4EUr9CFd9uWgRC/Ai5VpA5lFPCdNM2WF0kSxYuVvC qkzF5d39ufWZgXEIMccfJFNkIus1jQ3lwNajmojBNlZJNP/oSz5F2SAtelMzBvGQ aN2ytJEDEq8vFlAOJ0BOUIdUa4y6jMf1kQkQQcnveYIQUHsfIwUSFfhDvuJ6lBU= =+o0S -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt-- From owner-svn-src-head@freebsd.org Fri Jul 6 10:03:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECFDD1037DB8; Fri, 6 Jul 2018 10:03:34 +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 C4567772D2; Fri, 6 Jul 2018 10:03:34 +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 A57FE27206; Fri, 6 Jul 2018 10:03:34 +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 w66A3Ytd082214; Fri, 6 Jul 2018 10:03:34 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66A3X6Z082209; Fri, 6 Jul 2018 10:03:33 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201807061003.w66A3X6Z082209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Jul 2018 10:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336023 - in head/sys: kern netinet X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: kern netinet X-SVN-Commit-Revision: 336023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 10:03:35 -0000 Author: brooks Date: Fri Jul 6 10:03:33 2018 New Revision: 336023 URL: https://svnweb.freebsd.org/changeset/base/336023 Log: Correct breakage on 32-bit platforms from r335979. Modified: head/sys/kern/kern_descrip.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_usrreq.c head/sys/netinet/in_pcb.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Jul 6 06:21:24 2018 (r336022) +++ head/sys/kern/kern_descrip.c Fri Jul 6 10:03:33 2018 (r336023) @@ -3362,10 +3362,10 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) if ((fp = fdp->fd_ofiles[n].fde_file) == NULL) continue; xf.xf_fd = n; - xf.xf_file = (kvaddr_t)fp; - xf.xf_data = (kvaddr_t)fp->f_data; - xf.xf_vnode = (kvaddr_t)fp->f_vnode; - xf.xf_type = (kvaddr_t)fp->f_type; + xf.xf_file = (kvaddr_t)(uintptr_t)fp; + xf.xf_data = (kvaddr_t)(uintptr_t)fp->f_data; + xf.xf_vnode = (kvaddr_t)(uintptr_t)fp->f_vnode; + xf.xf_type = (kvaddr_t)(uintptr_t)fp->f_type; xf.xf_count = fp->f_count; xf.xf_msgcount = 0; xf.xf_offset = foffset_get(fp); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Jul 6 06:21:24 2018 (r336022) +++ head/sys/kern/uipc_socket.c Fri Jul 6 10:03:33 2018 (r336023) @@ -3985,12 +3985,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso) { xso->xso_len = sizeof *xso; - xso->xso_so = (kvaddr_t)so; + xso->xso_so = (kvaddr_t)(uintptr_t)so; xso->so_type = so->so_type; xso->so_options = so->so_options; xso->so_linger = so->so_linger; xso->so_state = so->so_state; - xso->so_pcb = (kvaddr_t)so->so_pcb; + xso->so_pcb = (kvaddr_t)(uintptr_t)so->so_pcb; xso->xso_protocol = so->so_proto->pr_protocol; xso->xso_family = so->so_proto->pr_domain->dom_family; xso->so_timeo = so->so_timeo; Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jul 6 06:21:24 2018 (r336022) +++ head/sys/kern/uipc_usrreq.c Fri Jul 6 10:03:33 2018 (r336023) @@ -1853,7 +1853,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) if (freeunp == 0 && unp->unp_gencnt <= gencnt) { xu->xu_len = sizeof *xu; - xu->xu_unpp = (kvaddr_t)unp; + xu->xu_unpp = (kvaddr_t)(uintptr_t)unp; /* * XXX - need more locking here to protect against * connect/disconnect races for SMP. @@ -1870,10 +1870,12 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) unp->unp_conn->unp_addr->sun_len); else bzero(&xu->xu_caddr, sizeof(xu->xu_caddr)); - xu->unp_vnode = (kvaddr_t)unp->unp_vnode; - xu->unp_conn = (kvaddr_t)unp->unp_conn; - xu->xu_firstref = (kvaddr_t)LIST_FIRST(&unp->unp_refs); - xu->xu_nextref = (kvaddr_t)LIST_NEXT(unp, unp_reflink); + xu->unp_vnode = (kvaddr_t)(uintptr_t)unp->unp_vnode; + xu->unp_conn = (kvaddr_t)(uintptr_t)unp->unp_conn; + xu->xu_firstref = + (kvaddr_t)(uintptr_t)LIST_FIRST(&unp->unp_refs); + xu->xu_nextref = + (kvaddr_t)(uintptr_t)LIST_NEXT(unp, unp_reflink); xu->unp_gencnt = unp->unp_gencnt; sotoxsocket(unp->unp_socket, &xu->xu_socket); UNP_PCB_UNLOCK(unp); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Fri Jul 6 06:21:24 2018 (r336022) +++ head/sys/netinet/in_pcb.c Fri Jul 6 10:03:33 2018 (r336023) @@ -2906,7 +2906,7 @@ in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb bzero(&xi->xi_socket, sizeof(struct xsocket)); bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo)); xi->inp_gencnt = inp->inp_gencnt; - xi->inp_ppcb = (kvaddr_t)inp->inp_ppcb; + xi->inp_ppcb = (kvaddr_t)(uintptr_t)inp->inp_ppcb; xi->inp_flow = inp->inp_flow; xi->inp_flowid = inp->inp_flowid; xi->inp_flowtype = inp->inp_flowtype; From owner-svn-src-head@freebsd.org Fri Jul 6 10:10:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C43991038A72; Fri, 6 Jul 2018 10:10:01 +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 71FC1776FA; Fri, 6 Jul 2018 10:10:01 +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 4EAAF2720A; Fri, 6 Jul 2018 10:10:01 +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 w66AA1Td082591; Fri, 6 Jul 2018 10:10:01 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66AA1tK082590; Fri, 6 Jul 2018 10:10:01 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807061010.w66AA1tK082590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 6 Jul 2018 10:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336024 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 336024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 10:10:01 -0000 Author: mmacy Date: Fri Jul 6 10:10:00 2018 New Revision: 336024 URL: https://svnweb.freebsd.org/changeset/base/336024 Log: counter(9): unbreak amd64 following r336020 Apply temporary fix to counter until daylight hours. The fact that the assembly for counter_u64_add relied on the sizeof(struct pcpu) was the basis for the otherwise arbitrary offset never came up in D15933. critical_{enter,exit} is now inline so the only real added overhead is the added (mostly false) conditional branch in exit. Modified: head/sys/amd64/include/counter.h Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Fri Jul 6 10:03:33 2018 (r336023) +++ head/sys/amd64/include/counter.h Fri Jul 6 10:10:00 2018 (r336024) @@ -83,11 +83,18 @@ counter_u64_zero_inline(counter_u64_t c) static inline void counter_u64_add(counter_u64_t c, int64_t inc) { - + int64_t *p; +#ifdef notyet __asm __volatile("addq\t%1,%%gs:(%0)" : : "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc) : "memory", "cc"); +#endif + /* temporary */ + critical_enter(); + p = zpcpu_get(c); + *p += inc; + critical_exit(); } #endif /* ! __MACHINE_COUNTER_H__ */ From owner-svn-src-head@freebsd.org Fri Jul 6 10:13:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BFA91039A00; Fri, 6 Jul 2018 10:13:43 +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 00DE677BA3; Fri, 6 Jul 2018 10:13:43 +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 D719F27396; Fri, 6 Jul 2018 10:13:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66ADgXd087548; Fri, 6 Jul 2018 10:13:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66ADgbJ087546; Fri, 6 Jul 2018 10:13:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201807061013.w66ADgbJ087546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 6 Jul 2018 10:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336025 - in head/sys: amd64/include i386/include X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: amd64/include i386/include X-SVN-Commit-Revision: 336025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 10:13:43 -0000 Author: hselasky Date: Fri Jul 6 10:13:42 2018 New Revision: 336025 URL: https://svnweb.freebsd.org/changeset/base/336025 Log: Make sure kernel modules built by default are portable between UP and SMP systems by extending defined(SMP) to include defined(KLD_MODULE). This is a regression issue after r335873 . Discussed with: mmacy@ Sponsored by: Mellanox Technologies Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 (r336024) +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 (r336025) @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_ * For userland, always use lock prefixes so that the binaries will run * on both SMP and !SMP systems. */ -#if defined(SMP) || !defined(_KERNEL) +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) #define MPLOCKED "lock ; " #else #define MPLOCKED @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, u_int v) */ #define OFFSETOF_MONITORBUF 0x100 -#if defined(SMP) +#if defined(SMP) || defined(KLD_MODULE) static __inline void __storeload_barrier(void) { Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 (r336024) +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 (r336025) @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile uint64_t *, uint64_t * For userland, always use lock prefixes so that the binaries will run * on both SMP and !SMP systems. */ -#if defined(SMP) || !defined(_KERNEL) +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) #define MPLOCKED "lock ; " #else #define MPLOCKED @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v) */ #if defined(_KERNEL) -#if defined(SMP) +#if defined(SMP) || defined(KLD_MODULE) #define __storeload_barrier() __mbk() #else /* _KERNEL && UP */ #define __storeload_barrier() __compiler_membar() From owner-svn-src-head@freebsd.org Fri Jul 6 11:23:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EB3103FE3C; Fri, 6 Jul 2018 11:23:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FEEE7ACD9; Fri, 6 Jul 2018 11:23:15 +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 5283427EB5; Fri, 6 Jul 2018 11:23:15 +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 w66BNFaB022858; Fri, 6 Jul 2018 11:23:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66BNEtb022856; Fri, 6 Jul 2018 11:23:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807061123.w66BNEtb022856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Jul 2018 11:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336026 - in head: lib/libnv usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libnv usr.sbin/config X-SVN-Commit-Revision: 336026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 11:23:16 -0000 Author: kevans Date: Fri Jul 6 11:23:14 2018 New Revision: 336026 URL: https://svnweb.freebsd.org/changeset/base/336026 Log: config(8): Fix broken ABI r336019 introduced ${SRCTOP}/sys to the include paths in order to pull in a new sys/{c,}nv.h. This is wrong, because the build tree's ABI isn't guaranteed to match what's running on the host system. Fix instead by removing -I${SRCTOP}/sys and installing the libnv headers with `make -C lib/libnv includes`... this may or may not get re-worked in the future so that a userland lib isn't installing includes from sys/. Reported by: bdrewery Modified: head/lib/libnv/Makefile head/usr.sbin/config/Makefile Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Fri Jul 6 10:13:42 2018 (r336025) +++ head/lib/libnv/Makefile Fri Jul 6 11:23:14 2018 (r336026) @@ -17,6 +17,9 @@ SRCS+= msgio.c SRCS+= nvlist.c SRCS+= nvpair.c +INCSDIR= ${INCLUDEDIR}/sys +INCS= ${SRCTOP}/sys/sys/cnv.h ${SRCTOP}/sys/sys/nv.h + HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.sbin/config/Makefile ============================================================================== --- head/usr.sbin/config/Makefile Fri Jul 6 10:13:42 2018 (r336025) +++ head/usr.sbin/config/Makefile Fri Jul 6 11:23:14 2018 (r336026) @@ -14,7 +14,7 @@ kernconf.c: kernconf.tmpl ${FILE2C} 'char kernconfstr[] = {' ',0};' < \ ${SRCDIR}/kernconf.tmpl > kernconf.c -CFLAGS+= -I. -I${SRCDIR} -I${SRCTOP}/sys +CFLAGS+= -I. -I${SRCDIR} NO_WMISSING_VARIABLE_DECLARATIONS= From owner-svn-src-head@freebsd.org Fri Jul 6 11:29:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC0C1040567; Fri, 6 Jul 2018 11:29:25 +0000 (UTC) (envelope-from kevans@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 AFCBD7B051; Fri, 6 Jul 2018 11:29:24 +0000 (UTC) (envelope-from kevans@freebsd.org) 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 G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4DCFFEDE7; Fri, 6 Jul 2018 11:29:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f178.google.com with SMTP id p6-v6so8916452ljc.5; Fri, 06 Jul 2018 04:29:24 -0700 (PDT) X-Gm-Message-State: APt69E1X1oZ18v2HrIaFPmTG7O1LobbC9Waha9BSszfsp+yRNWKHbG09 Wb1A4oZyLj/vSi3s2nRHUjTKJodcoQUS9Z+cgNU= X-Google-Smtp-Source: AAOMgpd4qDEVXVXRiEFIXzbwniJz6Xq1jWPtK39taTRJ8z1RVCFOpcOQkm4uaz53XqTOjfKwGobPX2obPH8JY5G4UUU= X-Received: by 2002:a2e:80d3:: with SMTP id r19-v6mr4155965ljg.85.1530876562667; Fri, 06 Jul 2018 04:29:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Fri, 6 Jul 2018 04:29:02 -0700 (PDT) In-Reply-To: References: <201807060111.w661B76W005640@repo.freebsd.org> From: Kyle Evans Date: Fri, 6 Jul 2018 06:29:02 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r336019 - in head: . usr.sbin/config To: Bryan Drewery Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 11:29:25 -0000 On Fri, Jul 6, 2018 at 1:08 AM, Bryan Drewery wrote: > On 7/5/18 6:53 PM, Kyle Evans wrote: >> On Thu, Jul 5, 2018 at 8:11 PM, Kyle Evans wrote: >>> Author: kevans >>> Date: Fri Jul 6 01:11:06 2018 >>> New Revision: 336019 >>> URL: https://svnweb.freebsd.org/changeset/base/336019 >>> >>> Log: >>> config(8): De-dupe hint/env vars within a single file >>> >>> r335653 flipped the order in which hints/env files are concatenated to match >>> the order in which vars are processed by the kernel. This is the other >>> hammer to drop. >>> >>> Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the >>> latest value specified for a key. This leaves some duplicates if a variable >>> is specified in multiple hint/env files or via `envvar` in a kernel config, >>> but the reversed order of concatenation (from r335653) makes this a >>> non-issue as the latest-specified version will be seen first. >>> >>> This change also silently rewrote hint bits to use the same sanitization >>> process that ian@ wrote for r335642. To the kernel, hints and env vars are >>> basically the same thing through early boot, then get merged into the >>> dynamic environment once kmem becomes available and the dynamic environment >>> is created. They should be subjected to the same restrictions. >>> >>> libnv has been added to -legacy for the time being to support the build of >>> config(8) with the new cnvlist API. >>> >>> Tested with: universe (11 host & 12 host) >>> MFC after: 1 month >>> >> >> This seems to be causing pretty consistent config(8) failures on CI, >> kernels with neither hints nor environment variables, that neither of >> my universe builds nor any of my post-commit builds can reproduce. Can >> anyone else reproduce these failures that might be willing to give me >> a hint as to what kind of setup causes this? >> >> 01:47:58 cd /usr/src/sys/arm/conf; >> PATH=/usr/obj/usr/src/arm.armv7/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm.armv7/tmp/legacy/usr/bin:/usr/obj/usr/src/arm.armv7/tmp/legacy/bin:/usr/obj/usr/src/arm.armv7/tmp/usr/sbin:/usr/obj/usr/src/arm.armv7/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin >> config -d /usr/obj/usr/src/arm.armv7/sys/GENERIC -I >> '/usr/src/sys/arm/conf' '/usr/src/sys/arm/conf/GENERIC' >> 01:47:58 config: /usr/src/sys/arm/conf/GENERIC: No error: 0 >> > > I've seen this error with broken ABI. The -I${SRCTOP}/sys on the config > build may be contributing to the problem since sys/stat.h is ino64 and > the builder may not be. Really should not be bringing in the source > sys/ directory for any of the early host tool phases. There's some hack > patterns to bring in a limited amount of headers but in this case the > headers should be getting staged somewhere already. > Note legacy: > ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy includes; \ > > So -IWORLDTMP/legacy/sys should find the nv headers. This is already > included via: > tools/build/mk/Makefile.boot:CFLAGS+= -I${WORLDTMP}/legacy/usr/include > Which is brought in for bootstrap-tools though via: > MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" > Ahh, that explains it. I did a little bit of a dirty hack in r336026 to install the needed libnv headers with libnv- otherwise, we'd still be relying on the host libnv headers since sys/ bits don't normally get pulled in with `make includes` (from the look of it). It feels wrong to have a userland lib installing headers into ${INCLUDEDIR}/sys, but I think that's a libnv problem. This should fix the observed problem with CI for the time being. From owner-svn-src-head@freebsd.org Fri Jul 6 11:51:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 822BB10423E3; Fri, 6 Jul 2018 11:51:00 +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 3506E7BCC4; Fri, 6 Jul 2018 11:51:00 +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 15774275; Fri, 6 Jul 2018 11:51:00 +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 w66Boxtj034456; Fri, 6 Jul 2018 11:50:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66Boxi5034455; Fri, 6 Jul 2018 11:50:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201807061150.w66Boxi5034455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 6 Jul 2018 11:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336027 - head/gnu/usr.bin/binutils/libbfd X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/gnu/usr.bin/binutils/libbfd X-SVN-Commit-Revision: 336027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 11:51:00 -0000 Author: andrew Date: Fri Jul 6 11:50:59 2018 New Revision: 336027 URL: https://svnweb.freebsd.org/changeset/base/336027 Log: Teach binutils that arm64 is a 64bit architecture. This is needed to cross build from arm64 to other architectures that use binutils. Sponsored by: ABT Systems Ltd Modified: head/gnu/usr.bin/binutils/libbfd/bfd.h Modified: head/gnu/usr.bin/binutils/libbfd/bfd.h ============================================================================== --- head/gnu/usr.bin/binutils/libbfd/bfd.h Fri Jul 6 11:23:14 2018 (r336026) +++ head/gnu/usr.bin/binutils/libbfd/bfd.h Fri Jul 6 11:50:59 2018 (r336027) @@ -85,7 +85,7 @@ extern "C" { #define BFD_HOST_64BIT_LONG 0 #define BFD_HOST_64_BIT long long #define BFD_HOST_U_64_BIT unsigned long long -#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) +#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__aarch64__) #define BFD_HOST_64BIT_LONG 1 #define BFD_HOST_64_BIT long #define BFD_HOST_U_64_BIT unsigned long From owner-svn-src-head@freebsd.org Fri Jul 6 12:07:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0318D104431F; Fri, 6 Jul 2018 12:07:08 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4D2D7CCA7; Fri, 6 Jul 2018 12:07:07 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8300558E; Fri, 6 Jul 2018 12:07:07 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66C77q8043537; Fri, 6 Jul 2018 12:07:07 GMT (envelope-from daichi@FreeBSD.org) Received: (from daichi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66C76CR043533; Fri, 6 Jul 2018 12:07:06 GMT (envelope-from daichi@FreeBSD.org) Message-Id: <201807061207.w66C76CR043533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: daichi set sender to daichi@FreeBSD.org using -f From: Daichi GOTO Date: Fri, 6 Jul 2018 12:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336028 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: daichi X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 336028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 12:07:08 -0000 Author: daichi Date: Fri Jul 6 12:07:06 2018 New Revision: 336028 URL: https://svnweb.freebsd.org/changeset/base/336028 Log: Changed to eliminate the upper limit of command length displayed by "-a" and expand to match terminal width Reviewed by: eadler Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16083 Modified: head/usr.bin/top/display.c head/usr.bin/top/machine.c head/usr.bin/top/screen.c head/usr.bin/top/top.h Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Fri Jul 6 11:50:59 2018 (r336027) +++ head/usr.bin/top/display.c Fri Jul 6 12:07:06 2018 (r336028) @@ -57,9 +57,8 @@ FILE *debug; static int lmpid = 0; static int last_hi = 0; /* used in u_process and u_endscreen */ static int lastline = 0; -static int display_width = MAX_COLS; -#define lineindex(l) ((l)*display_width) +#define lineindex(l) ((l)*screen_width) /* things initialized by display_init and used thruout */ @@ -94,6 +93,9 @@ static enum { OFF, ON, ERASE } header_status = ON; static void summary_format(char *, int *, const char * const *); static void line_update(char *, char *, int, int); +static int setup_buffer_bufsiz = 0; +static char * setup_buffer(char *, int); + int x_lastpid = 10; int y_lastpid = 0; int x_loadave = 33; @@ -138,17 +140,9 @@ display_resize(void) if (lines < 0) lines = 0; - /* we don't want more than MAX_COLS columns, since the machine-dependent - modules make static allocations based on MAX_COLS and we don't want - to run off the end of their buffers */ - display_width = screen_width; - if (display_width >= MAX_COLS) - { - display_width = MAX_COLS - 1; - } /* now, allocate space for the screen buffer */ - screenbuf = calloc(lines, display_width); + screenbuf = calloc(lines, screen_width); if (screenbuf == NULL) { /* oops! */ @@ -336,7 +330,7 @@ i_timeofday(time_t *tod) } static int ltotal = 0; -static char procstates_buffer[MAX_COLS]; +static char *procstates_buffer = NULL; /* * *_procstates(total, brkdn, names) - print the process summary line @@ -350,6 +344,8 @@ i_procstates(int total, int *brkdn) { int i; + procstates_buffer = setup_buffer(procstates_buffer, 0); + /* write current number of processes and remember the value */ printf("%d %s:", total, (ps.thread) ? "threads" :"processes"); ltotal = total; @@ -372,9 +368,11 @@ i_procstates(int total, int *brkdn) void u_procstates(int total, int *brkdn) { - static char new[MAX_COLS]; + static char *new = NULL; int i; + new = setup_buffer(new, 0); + /* update number of processes only if it has changed */ if (ltotal != total) { @@ -551,11 +549,13 @@ z_cpustates(void) * for i_memory ONLY: cursor is on the previous line */ -static char memory_buffer[MAX_COLS]; +static char *memory_buffer = NULL; void i_memory(int *stats) { + memory_buffer = setup_buffer(memory_buffer, 0); + fputs("\nMem: ", stdout); lastline++; @@ -567,8 +567,10 @@ i_memory(int *stats) void u_memory(int *stats) { - static char new[MAX_COLS]; + static char *new = NULL; + new = setup_buffer(new, 0); + /* format the new line */ summary_format(new, stats, memory_names); line_update(memory_buffer, new, x_mem, y_mem); @@ -580,11 +582,13 @@ u_memory(int *stats) * Assumptions: cursor is on "lastline" * for i_arc ONLY: cursor is on the previous line */ -static char arc_buffer[MAX_COLS]; +static char *arc_buffer = NULL; void i_arc(int *stats) { + arc_buffer = setup_buffer(arc_buffer, 0); + if (arc_names == NULL) return; @@ -599,8 +603,10 @@ i_arc(int *stats) void u_arc(int *stats) { - static char new[MAX_COLS]; + static char *new = NULL; + new = setup_buffer(new, 0); + if (arc_names == NULL) return; @@ -616,11 +622,13 @@ u_arc(int *stats) * Assumptions: cursor is on "lastline" * for i_carc ONLY: cursor is on the previous line */ -static char carc_buffer[MAX_COLS]; +static char *carc_buffer = NULL; void i_carc(int *stats) { + carc_buffer = setup_buffer(carc_buffer, 0); + if (carc_names == NULL) return; @@ -635,8 +643,10 @@ i_carc(int *stats) void u_carc(int *stats) { - static char new[MAX_COLS]; + static char *new = NULL; + new = setup_buffer(new, 0); + if (carc_names == NULL) return; @@ -652,11 +662,13 @@ u_carc(int *stats) * for i_swap ONLY: cursor is on the previous line */ -static char swap_buffer[MAX_COLS]; +static char *swap_buffer = NULL; void i_swap(int *stats) { + swap_buffer = setup_buffer(swap_buffer, 0); + fputs("\nSwap: ", stdout); lastline++; @@ -668,8 +680,10 @@ i_swap(int *stats) void u_swap(int *stats) { - static char new[MAX_COLS]; + static char *new = NULL; + new = setup_buffer(new, 0); + /* format the new line */ summary_format(new, stats, swap_names); line_update(swap_buffer, new, x_swap, y_swap); @@ -689,7 +703,7 @@ u_swap(int *stats) * respect to screen updates). */ -static char next_msg[MAX_COLS + 5]; +static char *next_msg = NULL; static int msglen = 0; /* Invariant: msglen is always the length of the message currently displayed on the screen (even when next_msg doesn't contain that message). */ @@ -697,6 +711,7 @@ static int msglen = 0; void i_message(void) { + next_msg = setup_buffer(next_msg, 5); while (lastline < y_message) { @@ -736,7 +751,7 @@ trim_header(const char *text) int width; s = NULL; - width = display_width; + width = screen_width; header_length = strlen(text); if (header_length >= width) { s = strndup(text, width); @@ -807,7 +822,7 @@ i_process(int line, char *thisline) } /* truncate the line to conform to our current screen width */ - thisline[display_width] = '\0'; + thisline[screen_width] = '\0'; /* write the line out */ fputs(thisline, stdout); @@ -817,7 +832,7 @@ i_process(int line, char *thisline) p = stpcpy(base, thisline); /* zero fill the rest of it */ - memset(p, 0, display_width - (p - base)); + memset(p, 0, screen_width - (p - base)); } void @@ -831,7 +846,7 @@ u_process(int line, char *newline) bufferline = &screenbuf[lineindex(line)]; /* truncate the line to conform to our current screen width */ - newline[display_width] = '\0'; + newline[screen_width] = '\0'; /* is line higher than we went on the last display? */ if (line >= last_hi) @@ -856,7 +871,7 @@ u_process(int line, char *newline) optr = stpcpy(bufferline, newline); /* zero fill the rest of it */ - memset(optr, 0, display_width - (optr - bufferline)); + memset(optr, 0, screen_width - (optr - bufferline)); } else { @@ -1235,7 +1250,7 @@ line_update(char *old, char *new, int start, int line) } while (ch != '\0'); /* zero out the rest of the line buffer -- MUST BE DONE! */ - diff = display_width - newcol; + diff = screen_width - newcol; if (diff > 0) { memset(old, 0, diff); @@ -1326,4 +1341,32 @@ i_uptime(struct timeval *bt, time_t *tod) } printf(" up %d+%02d:%02d:%02d", days, hrs, mins, secs); } +} + +static char * +setup_buffer(char *buffer, int addlen) +{ + char *b = NULL; + + if (NULL == buffer) { + setup_buffer_bufsiz = screen_width; + b = calloc(setup_buffer_bufsiz + addlen, sizeof(char)); + } else { + if (screen_width > setup_buffer_bufsiz) { + setup_buffer_bufsiz = screen_width; + free(buffer); + b = calloc(setup_buffer_bufsiz + addlen, + sizeof(char)); + } else { + b = buffer; + } + } + + if (NULL == b) { + fprintf(stderr, "%s: can't allocate sufficient memory\n", + myname); + exit(4); + } + + return b; } Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Jul 6 11:50:59 2018 (r336027) +++ head/usr.bin/top/machine.c Fri Jul 6 12:07:06 2018 (r336028) @@ -870,7 +870,6 @@ format_next_process(struct handle * xhandle, char *(*g long p_tot, s_tot; char *cmdbuf = NULL; char **args; - const int cmdlen = 256; static struct sbuf* procbuf = NULL; /* clean up from last time. */ @@ -935,31 +934,31 @@ format_next_process(struct handle * xhandle, char *(*g break; } - cmdbuf = calloc(cmdlen + 1, 1); + cmdbuf = calloc(screen_width + 1, 1); if (cmdbuf == NULL) { - warn("calloc(%d)", cmdlen + 1); + warn("calloc(%d)", screen_width + 1); return NULL; } if (!(flags & FMT_SHOWARGS)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { - snprintf(cmdbuf, cmdlen, "%s{%s%s}", pp->ki_comm, + snprintf(cmdbuf, screen_width, "%s{%s%s}", pp->ki_comm, pp->ki_tdname, pp->ki_moretdname); } else { - snprintf(cmdbuf, cmdlen, "%s", pp->ki_comm); + snprintf(cmdbuf, screen_width, "%s", pp->ki_comm); } } else { if (pp->ki_flag & P_SYSTEM || - (args = kvm_getargv(kd, pp, cmdlen)) == NULL || + (args = kvm_getargv(kd, pp, screen_width)) == NULL || !(*args)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { - snprintf(cmdbuf, cmdlen, + snprintf(cmdbuf, screen_width, "[%s{%s%s}]", pp->ki_comm, pp->ki_tdname, pp->ki_moretdname); } else { - snprintf(cmdbuf, cmdlen, + snprintf(cmdbuf, screen_width, "[%s]", pp->ki_comm); } } else { @@ -969,7 +968,7 @@ format_next_process(struct handle * xhandle, char *(*g size_t argbuflen; size_t len; - argbuflen = cmdlen * 4; + argbuflen = screen_width * 4; argbuf = calloc(argbuflen + 1, 1); if (argbuf == NULL) { warn("calloc(%zu)", argbuflen + 1); @@ -1005,21 +1004,21 @@ format_next_process(struct handle * xhandle, char *(*g if (strcmp(cmd, pp->ki_comm) != 0) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) - snprintf(cmdbuf, cmdlen, + snprintf(cmdbuf, screen_width, "%s (%s){%s%s}", argbuf, pp->ki_comm, pp->ki_tdname, pp->ki_moretdname); else - snprintf(cmdbuf, cmdlen, + snprintf(cmdbuf, screen_width, "%s (%s)", argbuf, pp->ki_comm); } else { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) - snprintf(cmdbuf, cmdlen, + snprintf(cmdbuf, screen_width, "%s{%s%s}", argbuf, pp->ki_tdname, pp->ki_moretdname); else - strlcpy(cmdbuf, argbuf, cmdlen); + strlcpy(cmdbuf, argbuf, screen_width); } free(argbuf); } Modified: head/usr.bin/top/screen.c ============================================================================== --- head/usr.bin/top/screen.c Fri Jul 6 11:50:59 2018 (r336027) +++ head/usr.bin/top/screen.c Fri Jul 6 12:07:06 2018 (r336028) @@ -62,8 +62,7 @@ init_termcap(bool interactive) char *term_name; int status; - /* set defaults in case we aren't smart */ - screen_width = MAX_COLS; + screen_width = 0; screen_length = 0; if (!interactive) Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Fri Jul 6 11:50:59 2018 (r336027) +++ head/usr.bin/top/top.h Fri Jul 6 12:07:06 2018 (r336028) @@ -13,9 +13,6 @@ /* Number of lines of header information on the standard screen */ extern int Header_lines; -/* Maximum number of columns allowed for display */ -#define MAX_COLS 512 - /* Special atoi routine returns either a non-negative number or one of: */ #define Infinity -1 #define Invalid -2 From owner-svn-src-head@freebsd.org Fri Jul 6 12:37:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A83B61022079; Fri, 6 Jul 2018 12:37:47 +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 59FE57E171; Fri, 6 Jul 2018 12:37:47 +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 3746AA5F; Fri, 6 Jul 2018 12:37:47 +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 w66CbkIC059334; Fri, 6 Jul 2018 12:37:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66Cbkod059333; Fri, 6 Jul 2018 12:37:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807061237.w66Cbkod059333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Jul 2018 12:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336029 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 336029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 12:37:47 -0000 Author: kib Date: Fri Jul 6 12:37:46 2018 New Revision: 336029 URL: https://svnweb.freebsd.org/changeset/base/336029 Log: Style: no need for braces around single-line then clause. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D16148 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jul 6 12:07:06 2018 (r336028) +++ head/sys/vm/vm_map.c Fri Jul 6 12:37:46 2018 (r336029) @@ -3155,9 +3155,8 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs * Unwire before removing addresses from the pmap; otherwise, * unwiring will put the entries back in the pmap. */ - if (entry->wired_count != 0) { + if (entry->wired_count != 0) vm_map_entry_unwire(map, entry); - } pmap_remove(map->pmap, entry->start, entry->end); From owner-svn-src-head@freebsd.org Fri Jul 6 12:43:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 772391022A5F; Fri, 6 Jul 2018 12:43:41 +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 E75C77E701; Fri, 6 Jul 2018 12:43:40 +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 w66ChW91065159 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 6 Jul 2018 15:43:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w66ChW91065159 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w66ChW7h065158; Fri, 6 Jul 2018 15:43:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 6 Jul 2018 15:43:32 +0300 From: Konstantin Belousov To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336026 - in head: lib/libnv usr.sbin/config Message-ID: <20180706124332.GO5562@kib.kiev.ua> References: <201807061123.w66BNEtb022856@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807061123.w66BNEtb022856@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 12:43:41 -0000 On Fri, Jul 06, 2018 at 11:23:14AM +0000, Kyle Evans wrote: > Author: kevans > Date: Fri Jul 6 11:23:14 2018 > New Revision: 336026 > URL: https://svnweb.freebsd.org/changeset/base/336026 > > Log: > config(8): Fix broken ABI > > r336019 introduced ${SRCTOP}/sys to the include paths in order to pull in a > new sys/{c,}nv.h. This is wrong, because the build tree's ABI isn't > guaranteed to match what's running on the host system. > > Fix instead by removing -I${SRCTOP}/sys and installing the libnv headers > with `make -C lib/libnv includes`... this may or may not get re-worked in > the future so that a userland lib isn't installing includes from sys/. But which libnv the cross-tool config(8) is linked against, the host-provided one ? libnv which exposes the new headers interface would come into existence only for the target. Also, I do not think that you can build this library for cross-tools. From owner-svn-src-head@freebsd.org Fri Jul 6 12:44:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 968411022BFC; Fri, 6 Jul 2018 12:44:49 +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 495997E889; Fri, 6 Jul 2018 12:44:49 +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 266B2BF4; Fri, 6 Jul 2018 12:44:49 +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 w66Cingd064291; Fri, 6 Jul 2018 12:44:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66CimVq064290; Fri, 6 Jul 2018 12:44:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807061244.w66CimVq064290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Jul 2018 12:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336030 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 336030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 12:44:49 -0000 Author: kib Date: Fri Jul 6 12:44:48 2018 New Revision: 336030 URL: https://svnweb.freebsd.org/changeset/base/336030 Log: Save a call to pmap_remove() if entry cannot have any pages mapped. Due to the way rtld creates mappings for the shared objects, each dso causes unmap of at least three guard map entries. For instance, in the buildworld load, this change reduces the amount of pmap_remove() calls by 1/5. Profiled by: alc Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16148 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jul 6 12:37:46 2018 (r336029) +++ head/sys/vm/vm_map.c Fri Jul 6 12:44:48 2018 (r336030) @@ -3158,7 +3158,14 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs if (entry->wired_count != 0) vm_map_entry_unwire(map, entry); - pmap_remove(map->pmap, entry->start, entry->end); + /* + * Remove mappings for the pages, but only if the + * mappings could exist. For instance, it does not + * make sense to call pmap_remove() for guard entries. + */ + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0 || + entry->object.vm_object != NULL) + pmap_remove(map->pmap, entry->start, entry->end); /* * Delete the entry only after removing all pmap From owner-svn-src-head@freebsd.org Fri Jul 6 13:04:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6467D10250A4; Fri, 6 Jul 2018 13:04:28 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 E1E5D7FDC9; Fri, 6 Jul 2018 13:04:27 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-234-146.albq.qwest.net [67.0.234.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 7DD4E1AF637; Fri, 6 Jul 2018 05:13:55 +0000 (UTC) Subject: Re: svn commit: r336028 - head/usr.bin/top To: Daichi GOTO , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807061207.w66C76CR043533@repo.freebsd.org> From: Sean Bruno Openpgp: preference=signencrypt Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAHNN1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz7CwJQEEwEKAD4WIQToxOn4gDUE4eP0ujS95PX+ibX8tgUCWT7RQQIbAwUJBaOagAUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRC95PX+ibX8ttKTCACFKzRc56EBAlVotq02EjZP SfX+unlk6AuPBzShxqRxeK+bGYVCigrYd1M8nnskv0dEiZ5iYeND9HIxbpEyopqgpVTibA7w gBXaZ7SOEhNX1wXwg14JrralfSmPFMYni+sWegPMX/zwfAsn1z4mG1Nn44Xqo3o7CfpkMPy6 M5Bow2IDzIhEYISLR+urxs74/aHU35PLtBSDtu18914SEMDdva27MARN8mbeCDbuJVfGCPWy YHuy2t+9u2Zn5Dd+t3sBXLM9gpeaMm+4x6TNPpESygbVdh4tDdjVZ9DK/bWFg0kMgfZoaq6J l0jNsQXrZV3bzYNFbVw04pFcvA2GIJ7xzsBNBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAHCwHwEGAEKACYWIQToxOn4gDUE4eP0ujS95PX+ ibX8tgUCWT7RQQIbDAUJBaOagAAKCRC95PX+ibX8trrIB/9Pljqt/JGamD9tx4dOVmxSyFg9 z2xzgklTLuDgS73MM120mM7ao9AQUeWiSle/H0UCK7xPOzC/aeUC4oygDQKAfkkNbCNTo3+A qDjBRA8qx0e9a/QjDL+RFgD4L5kLT4tToY8T8HaBp8h03LBfk510IaI8oL/Jg7vpM3PDtJMW tUi2H+yNFmL3NfM2oBToWKLFsoP54f/eeeImrNnrlLjLHPzqS+/9apgYqX2Jwiv3tHBc4FTO GuY8VvF7BpixJs8Pc2RUuCfSyodrp1YG1kRGlXAH0cqwwr0Zmk4+7dZvtVQMCl6kS6q1+84q JwtItxS2eXSEA4NO0sQ3BXUywANh Message-ID: <75ee54a3-1436-0e4c-57a7-8585ca12039e@freebsd.org> Date: Fri, 6 Jul 2018 07:04:22 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807061207.w66C76CR043533@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NbiJt2XlrQKrRxBbdRzWfmgzJjUJNPxA7" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 13:04:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NbiJt2XlrQKrRxBbdRzWfmgzJjUJNPxA7 Content-Type: multipart/mixed; boundary="4UbMHIS7MLe7mLjHypgIAwuMj7XUk8OuN"; protected-headers="v1" From: Sean Bruno To: Daichi GOTO , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <75ee54a3-1436-0e4c-57a7-8585ca12039e@freebsd.org> Subject: Re: svn commit: r336028 - head/usr.bin/top References: <201807061207.w66C76CR043533@repo.freebsd.org> In-Reply-To: <201807061207.w66C76CR043533@repo.freebsd.org> --4UbMHIS7MLe7mLjHypgIAwuMj7XUk8OuN Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 07/06/18 06:07, Daichi GOTO wrote: > -static char next_msg[MAX_COLS + 5]; > +static char *next_msg =3D NULL; > static int msglen =3D 0; > /* Invariant: msglen is always the length of the message currently dis= played > on the screen (even when next_msg doesn't contain that message). */= gcc noticed that a later call to vsnprintf() now has some problems. /home/sbruno/bsd/wifi/fbsd_head/usr.bin/top/display.c: In function 'new_message': /home/sbruno/bsd/wifi/fbsd_head/usr.bin/top/display.c:963:31: error: argument to 'sizeof' in 'vsnprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=3Dsizeof-pointer-memaccess] vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); I think this needs to be changed Index: usr.bin/top/display.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- usr.bin/top/display.c (revision 336029) +++ usr.bin/top/display.c (working copy) @@ -960,7 +960,7 @@ va_start(args, msgfmt); /* first, format the message */ - vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); + vsnprintf(next_msg, strlen(next_msg), msgfmt, args); va_end(args); --4UbMHIS7MLe7mLjHypgIAwuMj7XUk8OuN-- --NbiJt2XlrQKrRxBbdRzWfmgzJjUJNPxA7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAls/aNZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LYf+wf/bSz4Tr7BacV5E2wdaeki8ER4rpak8sOq0+NAfytQaVu7Z1q/mq9MrzvH rUD2/FpwfpE8B5hrzS97oi75jvql7/NmHGkqOHumw1yHqR8psWTnCkufFhmMvblf 0bHBd8uq7r4g6lo0v4CfCCUqv8/nOB+kfQf64Bys+zsZ1qZPUWikjsJUtY1CerNN yq6N7ey5qtNyeYYGLU4TVan64rXDW6hPgyUU7Zb3Upfpw4N9Tuu7jxzLFWtoYueV jLGZ4izoxbi7THeSyW99rJPJi6Zb/9qNjDu58jo+hk60KHvBasLDsvOpNcq6SnFn YDJiIKSYBiqjj0e7dJ74iYShW4lyOQ== =hp0Q -----END PGP SIGNATURE----- --NbiJt2XlrQKrRxBbdRzWfmgzJjUJNPxA7-- From owner-svn-src-head@freebsd.org Fri Jul 6 13:12:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E9901025E19; Fri, 6 Jul 2018 13:12:28 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from mr22p34im-asmtp001.me.com (mr22p34im-asmtp001.me.com [17.111.211.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C06FD80506; Fri, 6 Jul 2018 13:12:27 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from process-dkim-sign-daemon.mr22p34im-asmtp001.me.com by mr22p34im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0PBG001004EBE500@mr22p34im-asmtp001.me.com>; Fri, 06 Jul 2018 13:12:20 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by mr22p34im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0PBG00KY04OD5000@mr22p34im-asmtp001.me.com>; Fri, 06 Jul 2018 13:12:20 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-07-06_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1807060147 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r336028 - head/usr.bin/top From: =?utf-8?B?5b6M6Jek5aSn5Zyw?= In-reply-to: <75ee54a3-1436-0e4c-57a7-8585ca12039e@freebsd.org> Date: Fri, 06 Jul 2018 22:12:13 +0900 Cc: Daichi GOTO , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: References: <201807061207.w66C76CR043533@repo.freebsd.org> <75ee54a3-1436-0e4c-57a7-8585ca12039e@freebsd.org> To: Sean Bruno X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 13:12:28 -0000 Surely. I think your advice is appropriate. Could you please commit? > 2018/07/06 22:04=E3=80=81Sean Bruno =E3=81=AE=E3=83=A1= =E3=83=BC=E3=83=AB: >=20 >=20 >=20 > On 07/06/18 06:07, Daichi GOTO wrote: >> -static char next_msg[MAX_COLS + 5]; >> +static char *next_msg =3D NULL; >> static int msglen =3D 0; >> /* Invariant: msglen is always the length of the message currently = displayed >> on the screen (even when next_msg doesn't contain that message). = */ >=20 > gcc noticed that a later call to vsnprintf() now has some problems. > /home/sbruno/bsd/wifi/fbsd_head/usr.bin/top/display.c: In function > 'new_message': > /home/sbruno/bsd/wifi/fbsd_head/usr.bin/top/display.c:963:31: error: > argument to 'sizeof' in 'vsnprintf' call is the same expression as the > destination; did you mean to provide an explicit length? > [-Werror=3Dsizeof-pointer-memaccess] > vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); >=20 >=20 > I think this needs to be changed >=20 > Index: usr.bin/top/display.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- usr.bin/top/display.c (revision 336029) > +++ usr.bin/top/display.c (working copy) > @@ -960,7 +960,7 @@ > va_start(args, msgfmt); >=20 > /* first, format the message */ > - vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); > + vsnprintf(next_msg, strlen(next_msg), msgfmt, args); >=20 > va_end(args); >=20 From owner-svn-src-head@freebsd.org Fri Jul 6 13:22:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2DE81026B8B; Fri, 6 Jul 2018 13:22:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42D7C80B3A; Fri, 6 Jul 2018 13:22:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 208681266; Fri, 6 Jul 2018 13:22:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66DMjuX084524; Fri, 6 Jul 2018 13:22:45 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66DMjRG084523; Fri, 6 Jul 2018 13:22:45 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807061322.w66DMjRG084523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 Jul 2018 13:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336031 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 336031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 13:22:45 -0000 Author: sbruno Date: Fri Jul 6 13:22:44 2018 New Revision: 336031 URL: https://svnweb.freebsd.org/changeset/base/336031 Log: r336028 changed next_msg to a char * from char [] of fixed size. Change 2nd argument of vsnprintf() to get the strlen of next_msg so that the appropriate size is used. Found with gcc. /usr.bin/top/display.c: In function 'new_message': /usr.bin/top/display.c:963:31: error: argument to 'sizeof' in 'vsnprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); Reviewed by: daichi Modified: head/usr.bin/top/display.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Fri Jul 6 12:44:48 2018 (r336030) +++ head/usr.bin/top/display.c Fri Jul 6 13:22:44 2018 (r336031) @@ -960,7 +960,7 @@ new_message(int type, const char *msgfmt, ...) va_start(args, msgfmt); /* first, format the message */ - vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); + vsnprintf(next_msg, strlen(next_msg), msgfmt, args); va_end(args); From owner-svn-src-head@freebsd.org Fri Jul 6 13:25:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F99E1026FA4; Fri, 6 Jul 2018 13:25:22 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFD3B80D2A; Fri, 6 Jul 2018 13:25:21 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [IPv6:2003:cd:6f1a:9700:b5c6:bf04:2e47:716d] (p200300CD6F1A9700B5C6BF042E47716D.dip0.t-ipconnect.de [IPv6:2003:cd:6f1a:9700:b5c6:bf04:2e47:716d]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id 65A35721E280D; Fri, 6 Jul 2018 15:25:18 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335979 - in head: . lib/libkvm sys/kern sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat From: Michael Tuexen In-Reply-To: <201807051313.w65DDnQJ041281@repo.freebsd.org> Date: Fri, 6 Jul 2018 15:25:17 +0200 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1C558706-A190-481A-9B5C-458B4EE0747F@macmic.franken.de> References: <201807051313.w65DDnQJ041281@repo.freebsd.org> To: Brooks Davis X-Mailer: Apple Mail (2.3445.8.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 13:25:22 -0000 > On 5. Jul 2018, at 15:13, Brooks Davis wrote: >=20 > Author: brooks > Date: Thu Jul 5 13:13:48 2018 > New Revision: 335979 > URL: https://svnweb.freebsd.org/changeset/base/335979 >=20 > Log: > Make struct xinpcb and friends word-size independent. >=20 > Replace size_t members with ksize_t (uint64_t) and pointer members > (never used as pointers in userspace, but instead as unique > idenitifiers) with kvaddr_t (uint64_t). This makes the structs > identical between 32-bit and 64-bit ABIs. >=20 > On 64-bit bit systems, the ABI is maintained. On 32-bit systems, > this is an ABI breaking change. The ABI of most of these structs > was previously broken in r315662. This also imposes a small API > change on userspace consumers who must handle kernel pointers > becoming virtual addresses. >=20 > PR: 228301 (exp-run by antoine) > Reviewed by: jtl, kib, rwatson (various versions) > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D15386 >=20 > Modified: > head/UPDATING > head/lib/libkvm/kvm.h > head/sys/kern/kern_descrip.c > head/sys/kern/uipc_socket.c > head/sys/kern/uipc_usrreq.c > head/sys/netinet/in_pcb.c > head/sys/netinet/in_pcb.h > head/sys/netinet/sctp_sysctl.c > head/sys/netinet/sctp_uio.h > head/sys/netinet/tcp_var.h > head/sys/sys/file.h > head/sys/sys/param.h > head/sys/sys/socketvar.h > head/sys/sys/types.h > head/sys/sys/unpcb.h > head/usr.bin/netstat/inet.c > head/usr.bin/netstat/unix.c > head/usr.bin/sockstat/sockstat.c >=20 > Modified: head/UPDATING > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/UPDATING Thu Jul 5 11:50:59 2018 (r335978) > +++ head/UPDATING Thu Jul 5 13:13:48 2018 (r335979) > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >=20 > +20180705: > + The ABI of syscalls used by management tools like sockstat and > + netstat has been broken to allow 32-bit binaries to work on > + 64-bit kernels without modification. These programs will need > + to match the kernel in order to function. External programs may > + require minor modifications to accommodate a change of type in > + structures from pointers to 64-bit virtual addresses. > + > 20180702: > On i386 and amd64 atomics are now inlined. Out of tree modules = using > atomics will need to be rebuilt. >=20 > Modified: head/lib/libkvm/kvm.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/lib/libkvm/kvm.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/lib/libkvm/kvm.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -61,8 +61,6 @@ typedef __ssize_t ssize_t; > #define _SSIZE_T_DECLARED > #endif >=20 > -typedef uint64_t kvaddr_t; /* An address in a = target image. */ > - > struct kvm_nlist { > const char *n_name; > unsigned char n_type; >=20 > Modified: head/sys/kern/kern_descrip.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/kern/kern_descrip.c Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/kern/kern_descrip.c Thu Jul 5 13:13:48 2018 = (r335979) > @@ -3362,10 +3362,10 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) > if ((fp =3D fdp->fd_ofiles[n].fde_file) =3D=3D = NULL) > continue; > xf.xf_fd =3D n; > - xf.xf_file =3D fp; > - xf.xf_data =3D fp->f_data; > - xf.xf_vnode =3D fp->f_vnode; > - xf.xf_type =3D fp->f_type; > + xf.xf_file =3D (kvaddr_t)fp; > + xf.xf_data =3D (kvaddr_t)fp->f_data; > + xf.xf_vnode =3D (kvaddr_t)fp->f_vnode; > + xf.xf_type =3D (kvaddr_t)fp->f_type; > xf.xf_count =3D fp->f_count; > xf.xf_msgcount =3D 0; > xf.xf_offset =3D foffset_get(fp); >=20 > Modified: head/sys/kern/uipc_socket.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/kern/uipc_socket.c Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/kern/uipc_socket.c Thu Jul 5 13:13:48 2018 = (r335979) > @@ -3985,12 +3985,12 @@ sotoxsocket(struct socket *so, struct xsocket = *xso) > { >=20 > xso->xso_len =3D sizeof *xso; > - xso->xso_so =3D so; > + xso->xso_so =3D (kvaddr_t)so; > xso->so_type =3D so->so_type; > xso->so_options =3D so->so_options; > xso->so_linger =3D so->so_linger; > xso->so_state =3D so->so_state; > - xso->so_pcb =3D so->so_pcb; > + xso->so_pcb =3D (kvaddr_t)so->so_pcb; > xso->xso_protocol =3D so->so_proto->pr_protocol; > xso->xso_family =3D so->so_proto->pr_domain->dom_family; > xso->so_timeo =3D so->so_timeo; >=20 > Modified: head/sys/kern/uipc_usrreq.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/kern/uipc_usrreq.c Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/kern/uipc_usrreq.c Thu Jul 5 13:13:48 2018 = (r335979) > @@ -1853,7 +1853,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) >=20 > if (freeunp =3D=3D 0 && unp->unp_gencnt <=3D gencnt) { > xu->xu_len =3D sizeof *xu; > - xu->xu_unpp =3D unp; > + xu->xu_unpp =3D (kvaddr_t)unp; > /* > * XXX - need more locking here to protect = against > * connect/disconnect races for SMP. > @@ -1870,10 +1870,10 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) > unp->unp_conn->unp_addr->sun_len); > else > bzero(&xu->xu_caddr, = sizeof(xu->xu_caddr)); > - xu->unp_vnode =3D unp->unp_vnode; > - xu->unp_conn =3D unp->unp_conn; > - xu->xu_firstref =3D LIST_FIRST(&unp->unp_refs); > - xu->xu_nextref =3D LIST_NEXT(unp, unp_reflink); > + xu->unp_vnode =3D (kvaddr_t)unp->unp_vnode; > + xu->unp_conn =3D (kvaddr_t)unp->unp_conn; > + xu->xu_firstref =3D = (kvaddr_t)LIST_FIRST(&unp->unp_refs); > + xu->xu_nextref =3D (kvaddr_t)LIST_NEXT(unp, = unp_reflink); > xu->unp_gencnt =3D unp->unp_gencnt; > sotoxsocket(unp->unp_socket, &xu->xu_socket); > UNP_PCB_UNLOCK(unp); >=20 > Modified: head/sys/netinet/in_pcb.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/netinet/in_pcb.c Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/netinet/in_pcb.c Thu Jul 5 13:13:48 2018 = (r335979) > @@ -2906,7 +2906,7 @@ in_pcbtoxinpcb(const struct inpcb *inp, struct = xinpcb=20 > bzero(&xi->xi_socket, sizeof(struct xsocket)); > bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo)); > xi->inp_gencnt =3D inp->inp_gencnt; > - xi->inp_ppcb =3D inp->inp_ppcb; > + xi->inp_ppcb =3D (kvaddr_t)inp->inp_ppcb; > xi->inp_flow =3D inp->inp_flow; > xi->inp_flowid =3D inp->inp_flowid; > xi->inp_flowtype =3D inp->inp_flowtype; >=20 > Modified: head/sys/netinet/in_pcb.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/netinet/in_pcb.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/netinet/in_pcb.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -366,12 +366,12 @@ struct inpcb { > */ > #ifdef _SYS_SOCKETVAR_H_ > struct xinpcb { > - size_t xi_len; /* length of this structure */ > + ksize_t xi_len; /* length of this = structure */ > struct xsocket xi_socket; /* (s,p) */ > struct in_conninfo inp_inc; /* (s,p) */ > uint64_t inp_gencnt; /* (s,p) */ > union { > - void *inp_ppcb; /* (s) netstat(1) */ > + kvaddr_t inp_ppcb; /* (s) netstat(1) */ > int64_t ph_ppcb; > }; > int64_t inp_spare64[4]; > @@ -394,10 +394,12 @@ struct xinpcb { > } __aligned(8); >=20 > struct xinpgen { > - size_t xig_len; /* length of this structure */ > + ksize_t xig_len; /* length of this structure */ > u_int xig_count; /* number of PCBs at this time = */ > + uint32_t _xig_spare32; > inp_gen_t xig_gen; /* generation count at this time = */ > so_gen_t xig_sogen; /* socket generation count this = time */ > + uint64_t _xig_spare64[4]; > } __aligned(8); > #ifdef _KERNEL > void in_pcbtoxinpcb(const struct inpcb *, struct xinpcb *); >=20 > Modified: head/sys/netinet/sctp_sysctl.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/netinet/sctp_sysctl.c Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/netinet/sctp_sysctl.c Thu Jul 5 13:13:48 2018 = (r335979) > @@ -409,7 +409,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) > xinpcb.total_recvs =3D inp->total_recvs; > xinpcb.total_nospaces =3D inp->total_nospaces; > xinpcb.fragmentation_point =3D inp->sctp_frag_point; > - xinpcb.socket =3D inp->sctp_socket; > + xinpcb.socket =3D (kvaddr_t)inp->sctp_socket; This breaks compilation on 32-bit PPC: cc -c -O -pipe -g -nostdinc -I. -I../../.. = -I../../../contrib/ck/include -I../../../contrib/libfdt -D_KERNEL = -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -msoft-float -fPIC = -fno-omit-frame-pointer -MD -MF.depend.sctp_sysctl.o -MTsctp_sysctl.o = -mno-altivec -msoft-float -ffreestanding -fwrapv -fstack-protector = -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef = -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs = -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-uninitialized = -fno-common -fms-extensions -finline-limit=3D15000 --param = inline-unit-growth=3D100 --param large-function-growth=3D1000 -Wa,-many = -std=3Diso9899:1999 -Werror ../../../netinet/sctp_sysctl.c cc1: warnings being treated as errors ../../../netinet/sctp_sysctl.c: In function = 'sctp_sysctl_handle_assoclist': ../../../netinet/sctp_sysctl.c:412: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast] *** Error code 1 Stop. make: stopped in /usr/home/tuexen/head/sys/powerpc/compile/TCP-NODEBUG Best regards Michael > so =3D inp->sctp_socket; > if ((so =3D=3D NULL) || > (!SCTP_IS_LISTENING(inp)) || >=20 > Modified: head/sys/netinet/sctp_uio.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/netinet/sctp_uio.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/netinet/sctp_uio.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -1175,14 +1175,11 @@ struct xsctp_inpcb { > uint16_t local_port; > uint16_t qlen_old; > uint16_t maxqlen_old; > - void *socket; > + uint16_t __spare16; > + kvaddr_t socket; > uint32_t qlen; > uint32_t maxqlen; > -#if defined(__LP64__) > - uint32_t extra_padding[27]; /* future */ > -#else > - uint32_t extra_padding[28]; /* future */ > -#endif > + uint32_t extra_padding[26]; /* future */ > }; >=20 > struct xsctp_tcb { >=20 > Modified: head/sys/netinet/tcp_var.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/netinet/tcp_var.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/netinet/tcp_var.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -677,7 +677,7 @@ void hhook_run_tcp_est_out(struct tcpcb *tp, > */ > #if defined(_NETINET_IN_PCB_H_) && defined(_SYS_SOCKETVAR_H_) > struct xtcpcb { > - size_t xt_len; /* length of this structure */ > + ksize_t xt_len; /* length of this structure */ > struct xinpcb xt_inp; > char xt_stack[TCP_FUNCTION_NAME_LEN_MAX]; /* (s) = */ > char xt_logid[TCP_LOG_ID_LEN]; /* (s) */ >=20 > Modified: head/sys/sys/file.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/sys/file.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/sys/file.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -209,18 +209,23 @@ struct file { > * Userland version of struct file, for sysctl > */ > struct xfile { > - size_t xf_size; /* size of struct xfile */ > + ksize_t xf_size; /* size of struct xfile */ > pid_t xf_pid; /* owning process */ > uid_t xf_uid; /* effective uid of owning process */ > int xf_fd; /* descriptor number */ > - void *xf_file; /* address of struct file */ > + int _xf_int_pad1; > + kvaddr_t xf_file; /* address of struct file */ > short xf_type; /* descriptor type */ > + short _xf_short_pad1; > int xf_count; /* reference count */ > int xf_msgcount; /* references from message queue */ > + int _xf_int_pad2; > off_t xf_offset; /* file offset */ > - void *xf_data; /* file descriptor specific data */ > - void *xf_vnode; /* vnode pointer */ > + kvaddr_t xf_data; /* file descriptor specific data */ > + kvaddr_t xf_vnode; /* vnode pointer */ > u_int xf_flag; /* flags (see fcntl.h) */ > + int _xf_int_pad3; > + int64_t _xf_int64_pad[6]; > }; >=20 > #ifdef _KERNEL >=20 > Modified: head/sys/sys/param.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/sys/param.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/sys/param.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -60,7 +60,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1200071 /* Master, propagated to newvers = */ > +#define __FreeBSD_version 1200072 /* Master, propagated to newvers = */ >=20 > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of = FreeBSD, >=20 > Modified: head/sys/sys/socketvar.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/sys/socketvar.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/sys/socketvar.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -474,13 +474,13 @@ int accept_filt_generic_mod_event(module_t = mod, int ev > * Structure to export socket from kernel to utilities, via sysctl(3). > */ > struct xsocket { > - size_t xso_len; /* length of this structure */ > + ksize_t xso_len; /* length of this structure */ > union { > - void *xso_so; /* kernel address of struct = socket */ > + kvaddr_t xso_so; /* kernel address of struct = socket */ > int64_t ph_so; > }; > union { > - void *so_pcb; /* kernel address of struct = inpcb */ > + kvaddr_t so_pcb; /* kernel address of struct = inpcb */ > int64_t ph_pcb; > }; > uint64_t so_oobmark; >=20 > Modified: head/sys/sys/types.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/sys/types.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/sys/types.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -251,6 +251,15 @@ struct cap_rights; > typedef struct cap_rights cap_rights_t; > #endif >=20 > +/* > + * Types suitable for exporting size and pointers (as virtual = addresses) > + * from the kernel independent of native word size. These should be > + * used in place of size_t and (u)intptr_t in structs which contain = such > + * types that are shared with userspace. > + */ > +typedef __uint64_t kvaddr_t; > +typedef __uint64_t ksize_t; > + > typedef __vm_offset_t vm_offset_t; > typedef __int64_t vm_ooffset_t; > typedef __vm_paddr_t vm_paddr_t; >=20 > Modified: head/sys/sys/unpcb.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/sys/unpcb.h Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/sys/sys/unpcb.h Thu Jul 5 13:13:48 2018 = (r335979) > @@ -138,12 +138,12 @@ struct unpcb { > */ > #ifdef _SYS_SOCKETVAR_H_ > struct xunpcb { > - size_t xu_len; /* length of this = structure */ > - void *xu_unpp; /* to help netstat, = fstat */ > - void *unp_vnode; /* (s) */ > - void *unp_conn; /* (s) */ > - void *xu_firstref; /* (s) */ > - void *xu_nextref; /* (s) */ > + ksize_t xu_len; /* length of this = structure */ > + kvaddr_t xu_unpp; /* to help netstat, = fstat */ > + kvaddr_t unp_vnode; /* (s) */ > + kvaddr_t unp_conn; /* (s) */ > + kvaddr_t xu_firstref; /* (s) */ > + kvaddr_t xu_nextref; /* (s) */ > unp_gen_t unp_gencnt; /* (s) */ > int64_t xu_spare64[8]; > int32_t xu_spare32[8]; > @@ -159,7 +159,7 @@ struct xunpcb { > } __aligned(8); >=20 > struct xunpgen { > - size_t xug_len; > + ksize_t xug_len; > u_int xug_count; > unp_gen_t xug_gen; > so_gen_t xug_sogen; >=20 > Modified: head/usr.bin/netstat/inet.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.bin/netstat/inet.c Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/usr.bin/netstat/inet.c Thu Jul 5 13:13:48 2018 = (r335979) > @@ -159,12 +159,12 @@ sotoxsocket(struct socket *so, struct xsocket = *xso) >=20 > bzero(xso, sizeof *xso); > xso->xso_len =3D sizeof *xso; > - xso->xso_so =3D so; > + xso->xso_so =3D (kvaddr_t)so; > xso->so_type =3D so->so_type; > xso->so_options =3D so->so_options; > xso->so_linger =3D so->so_linger; > xso->so_state =3D so->so_state; > - xso->so_pcb =3D so->so_pcb; > + xso->so_pcb =3D (kvaddr_t)so->so_pcb; > if (kread((uintptr_t)so->so_proto, &proto, sizeof(proto)) !=3D = 0) > return (-1); > xso->xso_protocol =3D proto.pr_protocol; >=20 > Modified: head/usr.bin/netstat/unix.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.bin/netstat/unix.c Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/usr.bin/netstat/unix.c Thu Jul 5 13:13:48 2018 = (r335979) > @@ -153,7 +153,7 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, = u_lon > xu.xu_len =3D sizeof xu; > KREAD(head_off, &head, sizeof(head)); > LIST_FOREACH(unp, &head, unp_link) { > - xu.xu_unpp =3D unp; > + xu.xu_unpp =3D (kvaddr_t)unp; > KREAD(unp, &unp0, sizeof (*unp)); > unp =3D &unp0; >=20 >=20 > Modified: head/usr.bin/sockstat/sockstat.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.bin/sockstat/sockstat.c Thu Jul 5 11:50:59 2018 = (r335978) > +++ head/usr.bin/sockstat/sockstat.c Thu Jul 5 13:13:48 2018 = (r335979) > @@ -108,8 +108,8 @@ struct addr { > }; >=20 > struct sock { > - void *socket; > - void *pcb; > + kvaddr_t socket; > + kvaddr_t pcb; > int shown; > int vflag; > int family; > @@ -789,8 +789,8 @@ gather_unix(int proto) > warnx("struct xunpcb size mismatch"); > goto out; > } > - if ((xup->unp_conn =3D=3D NULL && !opt_l) || > - (xup->unp_conn !=3D NULL && !opt_c)) > + if ((xup->unp_conn =3D=3D 0 && !opt_l) || > + (xup->unp_conn !=3D 0 && !opt_c)) > continue; > if ((sock =3D calloc(1, sizeof(*sock))) =3D=3D NULL) > err(1, "malloc()"); > @@ -806,8 +806,8 @@ gather_unix(int proto) > if (xup->xu_addr.sun_family =3D=3D AF_UNIX) > laddr->address =3D > *(struct sockaddr_storage *)(void = *)&xup->xu_addr; > - else if (xup->unp_conn !=3D NULL) > - *(void **)&(faddr->address) =3D xup->unp_conn; > + else if (xup->unp_conn !=3D 0) > + *(kvaddr_t*)&(faddr->address) =3D xup->unp_conn; > laddr->next =3D NULL; > faddr->next =3D NULL; > sock->laddr =3D laddr; > @@ -1008,7 +1008,7 @@ sctp_path_state(int state) > static void > displaysock(struct sock *s, int pos) > { > - void *p; > + kvaddr_t p; > int hash, first, offset; > struct addr *laddr, *faddr; > struct sock *s_tmp; > @@ -1054,8 +1054,8 @@ displaysock(struct sock *s, int pos) > break; > } > /* client */ > - p =3D *(void **)&(faddr->address); > - if (p =3D=3D NULL) { > + p =3D *(kvaddr_t*)&(faddr->address); > + if (p =3D=3D 0) { > pos +=3D xprintf("(not connected)"); > offset +=3D opt_w ? 92 : 44; > break; > @@ -1174,13 +1174,13 @@ display(void) > } > setpassent(1); > for (xf =3D xfiles, n =3D 0; n < nxfiles; ++n, ++xf) { > - if (xf->xf_data =3D=3D NULL) > + if (xf->xf_data =3D=3D 0) > continue; > if (opt_j >=3D 0 && opt_j !=3D getprocjid(xf->xf_pid)) > continue; > hash =3D (int)((uintptr_t)xf->xf_data % HASHSIZE); > for (s =3D sockhash[hash]; s !=3D NULL; s =3D s->next) { > - if ((void *)s->socket !=3D xf->xf_data) > + if (s->socket !=3D xf->xf_data) > continue; > if (!check_ports(s)) > continue; >=20 From owner-svn-src-head@freebsd.org Fri Jul 6 13:31:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 312FE10278C8; Fri, 6 Jul 2018 13:31:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C495781272; Fri, 6 Jul 2018 13:31:06 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5C67138E; Fri, 6 Jul 2018 13:31:06 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66DV6kj088610; Fri, 6 Jul 2018 13:31:06 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66DV6QI088609; Fri, 6 Jul 2018 13:31:06 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807061331.w66DV6QI088609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 Jul 2018 13:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336032 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 336032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 13:31:07 -0000 Author: sbruno Date: Fri Jul 6 13:31:06 2018 New Revision: 336032 URL: https://svnweb.freebsd.org/changeset/base/336032 Log: Remove duplicate configuration values as they are already defined in std.AR_MIPS_BASE Modified: head/sys/mips/conf/DIR-825B1 Modified: head/sys/mips/conf/DIR-825B1 ============================================================================== --- head/sys/mips/conf/DIR-825B1 Fri Jul 6 13:22:44 2018 (r336031) +++ head/sys/mips/conf/DIR-825B1 Fri Jul 6 13:31:06 2018 (r336032) @@ -45,13 +45,6 @@ nodevice ath_rate_sample nooptions INET6 -# Don't include the SCSI/CAM strings in the default build -options SCSI_NO_SENSE_STRINGS -options SCSI_NO_OP_STRINGS - -# .. And no sysctl strings -options NO_SYSCTL_DESCR - # GEOM modules device geom_map # to get access to the SPI flash partitions device geom_uzip # compressed in-memory filesystem hackery! From owner-svn-src-head@freebsd.org Fri Jul 6 13:34:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB2931028018; Fri, 6 Jul 2018 13:34:46 +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 6CD4A81662; Fri, 6 Jul 2018 13:34:46 +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 4A0C113FB; Fri, 6 Jul 2018 13:34:46 +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 w66DYkg7089743; Fri, 6 Jul 2018 13:34:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66DYk4f089742; Fri, 6 Jul 2018 13:34:46 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201807061334.w66DYk4f089742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Jul 2018 13:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336033 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 336033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 13:34:46 -0000 Author: brooks Date: Fri Jul 6 13:34:45 2018 New Revision: 336033 URL: https://svnweb.freebsd.org/changeset/base/336033 Log: One more 32-bit fix for r335979. Reported by: tuexen Modified: head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Fri Jul 6 13:31:06 2018 (r336032) +++ head/sys/netinet/sctp_sysctl.c Fri Jul 6 13:34:45 2018 (r336033) @@ -409,7 +409,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) xinpcb.total_recvs = inp->total_recvs; xinpcb.total_nospaces = inp->total_nospaces; xinpcb.fragmentation_point = inp->sctp_frag_point; - xinpcb.socket = (kvaddr_t)inp->sctp_socket; + xinpcb.socket = (kvaddr_t)(uintptr_t)inp->sctp_socket; so = inp->sctp_socket; if ((so == NULL) || (!SCTP_IS_LISTENING(inp)) || From owner-svn-src-head@freebsd.org Fri Jul 6 13:56:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DBAD102A177; Fri, 6 Jul 2018 13:56:43 +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 8B1E682732; Fri, 6 Jul 2018 13:56:42 +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 w66DuYfI082361 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 6 Jul 2018 16:56:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w66DuYfI082361 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w66DuYml082360; Fri, 6 Jul 2018 16:56:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 6 Jul 2018 16:56:34 +0300 From: Konstantin Belousov To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336031 - head/usr.bin/top Message-ID: <20180706135634.GP5562@kib.kiev.ua> References: <201807061322.w66DMjRG084523@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807061322.w66DMjRG084523@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 13:56:43 -0000 On Fri, Jul 06, 2018 at 01:22:44PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Fri Jul 6 13:22:44 2018 > New Revision: 336031 > URL: https://svnweb.freebsd.org/changeset/base/336031 > > Log: > r336028 changed next_msg to a char * from char [] of fixed size. Change > 2nd argument of vsnprintf() to get the strlen of next_msg so that the > appropriate size is used. > > Found with gcc. > > /usr.bin/top/display.c: In function 'new_message': > /usr.bin/top/display.c:963:31: error: > argument to 'sizeof' in 'vsnprintf' call is the same expression as the > destination; did you mean to provide an explicit length? > [-Werror=sizeof-pointer-memaccess] > vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); > > Reviewed by: daichi > > Modified: > head/usr.bin/top/display.c > > Modified: head/usr.bin/top/display.c > ============================================================================== > --- head/usr.bin/top/display.c Fri Jul 6 12:44:48 2018 (r336030) > +++ head/usr.bin/top/display.c Fri Jul 6 13:22:44 2018 (r336031) > @@ -960,7 +960,7 @@ new_message(int type, const char *msgfmt, ...) > va_start(args, msgfmt); > > /* first, format the message */ > - vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); > + vsnprintf(next_msg, strlen(next_msg), msgfmt, args); I highly suspect that this strlen() call returns zero, always. > > va_end(args); > From owner-svn-src-head@freebsd.org Fri Jul 6 14:49:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E731102E725 for ; Fri, 6 Jul 2018 14:49:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 9C6DB845F0 for ; Fri, 6 Jul 2018 14:49:23 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: c020520c-812b-11e8-8837-614b7c574d04 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 outbound1.ore.mailhop.org (Halon) with ESMTPSA id c020520c-812b-11e8-8837-614b7c574d04; Fri, 06 Jul 2018 14:49:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w66EnDkv026684; Fri, 6 Jul 2018 08:49:13 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1530888553.57805.8.camel@freebsd.org> Subject: Re: svn commit: r336031 - head/usr.bin/top From: Ian Lepore To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 06 Jul 2018 08:49:13 -0600 In-Reply-To: <201807061322.w66DMjRG084523@repo.freebsd.org> References: <201807061322.w66DMjRG084523@repo.freebsd.org> 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 14:49:24 -0000 On Fri, 2018-07-06 at 13:22 +0000, Sean Bruno wrote: > Author: sbruno > Date: Fri Jul6 13:22:44 2018 > New Revision: 336031 > URL: https://svnweb.freebsd.org/changeset/base/336031 > > Log: > r336028 changed next_msg to a char * from char [] of fixed size.Change > 2nd argument of vsnprintf() to get the strlen of next_msg so that the > appropriate size is used. > > Found with gcc. > > /usr.bin/top/display.c: In function 'new_message': > /usr.bin/top/display.c:963:31: error: > argument to 'sizeof' in 'vsnprintf' call is the same expression as the > destination; did you mean to provide an explicit length? > [-Werror=sizeof-pointer-memaccess] > vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); > > Reviewed by: daichi > > Modified: > head/usr.bin/top/display.c > > Modified: head/usr.bin/top/display.c > ============================================================================== > --- head/usr.bin/top/display.c Fri Jul6 12:44:48 2018 (r336030) > +++ head/usr.bin/top/display.c Fri Jul6 13:22:44 2018 (r336031) > @@ -960,7 +960,7 @@ new_message(int type, const char *msgfmt, ...) > va_start(args, msgfmt); > > /* first, format the message */ > -vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); > +vsnprintf(next_msg, strlen(next_msg), msgfmt, args); > > va_end(args); > > This fix is incorrect. The original commit that changed next_msg to a pointer is probably flawed enough to revert and redevelop rather than try a rolling set of bandaid fixes. Whenever setup_buffer() creates a new buffer it will need to store the size it allocated for use in this vsnprintf() call (and maybe other places that write directly into next_msg without calling setup_buffer to reallocate it first, I didn't look). The setup_buffer_bufsiz variable isn't quite right as-is, because it doesn't include the 'addlen' value passed to setup_buffer(). -- Ian From owner-svn-src-head@freebsd.org Fri Jul 6 15:01:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E061102F7E3; Fri, 6 Jul 2018 15:01:12 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 A73E584E02; Fri, 6 Jul 2018 15:01:11 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-234-146.albq.qwest.net [67.0.234.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 015FD1AF637; Fri, 6 Jul 2018 07:10:41 +0000 (UTC) Subject: Re: svn commit: r336031 - head/usr.bin/top To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Daichi GOTO References: <201807061322.w66DMjRG084523@repo.freebsd.org> <1530888553.57805.8.camel@freebsd.org> From: Sean Bruno Openpgp: preference=signencrypt Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAHNN1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz7CwJQEEwEKAD4WIQToxOn4gDUE4eP0ujS95PX+ibX8tgUCWT7RQQIbAwUJBaOagAUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRC95PX+ibX8ttKTCACFKzRc56EBAlVotq02EjZP SfX+unlk6AuPBzShxqRxeK+bGYVCigrYd1M8nnskv0dEiZ5iYeND9HIxbpEyopqgpVTibA7w gBXaZ7SOEhNX1wXwg14JrralfSmPFMYni+sWegPMX/zwfAsn1z4mG1Nn44Xqo3o7CfpkMPy6 M5Bow2IDzIhEYISLR+urxs74/aHU35PLtBSDtu18914SEMDdva27MARN8mbeCDbuJVfGCPWy YHuy2t+9u2Zn5Dd+t3sBXLM9gpeaMm+4x6TNPpESygbVdh4tDdjVZ9DK/bWFg0kMgfZoaq6J l0jNsQXrZV3bzYNFbVw04pFcvA2GIJ7xzsBNBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAHCwHwEGAEKACYWIQToxOn4gDUE4eP0ujS95PX+ ibX8tgUCWT7RQQIbDAUJBaOagAAKCRC95PX+ibX8trrIB/9Pljqt/JGamD9tx4dOVmxSyFg9 z2xzgklTLuDgS73MM120mM7ao9AQUeWiSle/H0UCK7xPOzC/aeUC4oygDQKAfkkNbCNTo3+A qDjBRA8qx0e9a/QjDL+RFgD4L5kLT4tToY8T8HaBp8h03LBfk510IaI8oL/Jg7vpM3PDtJMW tUi2H+yNFmL3NfM2oBToWKLFsoP54f/eeeImrNnrlLjLHPzqS+/9apgYqX2Jwiv3tHBc4FTO GuY8VvF7BpixJs8Pc2RUuCfSyodrp1YG1kRGlXAH0cqwwr0Zmk4+7dZvtVQMCl6kS6q1+84q JwtItxS2eXSEA4NO0sQ3BXUywANh Message-ID: <20e05842-cbfb-671c-5532-c57514346bf5@freebsd.org> Date: Fri, 6 Jul 2018 09:01:06 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1530888553.57805.8.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="l04QF4mS7mUZ5NP2REeAABoNUtpw6rCgr" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 15:01:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --l04QF4mS7mUZ5NP2REeAABoNUtpw6rCgr Content-Type: multipart/mixed; boundary="S2Dfyt8HaULkhmptpzK0Gnpwp2g8dL1np"; protected-headers="v1" From: Sean Bruno To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Daichi GOTO Message-ID: <20e05842-cbfb-671c-5532-c57514346bf5@freebsd.org> Subject: Re: svn commit: r336031 - head/usr.bin/top References: <201807061322.w66DMjRG084523@repo.freebsd.org> <1530888553.57805.8.camel@freebsd.org> In-Reply-To: <1530888553.57805.8.camel@freebsd.org> --S2Dfyt8HaULkhmptpzK0Gnpwp2g8dL1np Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 07/06/18 08:49, Ian Lepore wrote: > On Fri, 2018-07-06 at 13:22 +0000, Sean Bruno wrote: >> Author: sbruno >> Date: Fri Jul=C2=A0=C2=A06 13:22:44 2018 >> New Revision: 336031 >> URL: https://svnweb.freebsd.org/changeset/base/336031 >> >> Log: >> =C2=A0 r336028 changed next_msg to a char * from char [] of fixed size= =2E=C2=A0=C2=A0Change >> =C2=A0 2nd argument of vsnprintf() to get the strlen of next_msg so th= at the >> =C2=A0 appropriate size is used. >> =C2=A0=C2=A0 >> =C2=A0 Found with gcc. >> =C2=A0=C2=A0 >> =C2=A0 /usr.bin/top/display.c: In function 'new_message': >> =C2=A0 /usr.bin/top/display.c:963:31: error: >> =C2=A0 argument to 'sizeof' in 'vsnprintf' call is the same expression= as the >> =C2=A0 destination; did you mean to provide an explicit length? >> =C2=A0 [-Werror=3Dsizeof-pointer-memaccess] >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vsnprintf(next_msg, sizeof(n= ext_msg), msgfmt, args); >> =C2=A0=C2=A0 >> =C2=A0 Reviewed by: daichi >> >> Modified: >> =C2=A0 head/usr.bin/top/display.c >> >> Modified: head/usr.bin/top/display.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/usr.bin/top/display.c Fri Jul=C2=A0=C2=A06 12:44:48 2018 (r33= 6030) >> +++ head/usr.bin/top/display.c Fri Jul=C2=A0=C2=A06 13:22:44 2018 (r33= 6031) >> @@ -960,7 +960,7 @@ new_message(int type, const char *msgfmt, ...) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0va_start(args, msgfmt); >> =C2=A0 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* first, format the message */ >> -=C2=A0=C2=A0=C2=A0=C2=A0vsnprintf(next_msg, sizeof(next_msg), msgfmt,= args); >> +=C2=A0=C2=A0=C2=A0=C2=A0vsnprintf(next_msg, strlen(next_msg), msgfmt,= args); >> =C2=A0 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0va_end(args); >> =C2=A0 >> >=20 > This fix is incorrect. The original commit that changed next_msg to a > pointer is probably flawed enough to revert and redevelop rather than > try a rolling set of bandaid fixes. >=20 > Whenever setup_buffer() creates a new buffer it will need to store the > size it allocated for use in this vsnprintf() call (and maybe other > places that write directly into next_msg without calling setup_buffer > to reallocate it first, I didn't look). The setup_buffer_bufsiz > variable isn't quite right as-is, because it doesn't include the > 'addlen' value passed to setup_buffer(). >=20 > -- Ian >=20 >=20 Yeah, this isn't going well. I've been poking around in it and I can't see an quick way to do this correctly. sean --S2Dfyt8HaULkhmptpzK0Gnpwp2g8dL1np-- --l04QF4mS7mUZ5NP2REeAABoNUtpw6rCgr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAls/hDJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LZFhQgAtAzQ1F/dvMyKwUd6jJ+3Rmbq/yhgQ4P8nO593aD9Mz6taZ9GR2eCviAK Cw1FpvJy/DCdNDiOYylJbl8sneZPr0ykMUiKEk9O1KS/nyVCnBCenpd/PMbxi2MQ GIVZ0GXSH2PRyB7gmfn369g04SEhR+fGElshY0A0WTr84ah8B6fXl7KpWASYMgKz YMAFcMBGi1vkfKJv5KcftkcXO7zID2uNmukCDMh4tS7+PWJnBwR8V3Db7DUZV0Sc 1mxNS+dDVKXBbJAzB/cqupAKmIdRMu493IuA/CYxzGFOOWl8+fuG7QoULY0u8aW0 Cu1xjSfUR6Q6k+km02oaCrtvTXxx7A== =hm+D -----END PGP SIGNATURE----- --l04QF4mS7mUZ5NP2REeAABoNUtpw6rCgr-- From owner-svn-src-head@freebsd.org Fri Jul 6 15:32:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D2991031F67; Fri, 6 Jul 2018 15:32: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 7E2CC86495; Fri, 6 Jul 2018 15:32: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 w66FWPtb052843; Fri, 6 Jul 2018 08:32:25 -0700 (PDT) (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 w66FWPEN052842; Fri, 6 Jul 2018 08:32:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: <201807061013.w66ADgbJ087546@repo.freebsd.org> To: Hans Petter Selasky Date: Fri, 6 Jul 2018 08:32:25 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 15:32:29 -0000 > Author: hselasky > Date: Fri Jul 6 10:13:42 2018 > New Revision: 336025 > URL: https://svnweb.freebsd.org/changeset/base/336025 > > Log: > Make sure kernel modules built by default are portable between UP and > SMP systems by extending defined(SMP) to include defined(KLD_MODULE). > > This is a regression issue after r335873 . > > Discussed with: mmacy@ > Sponsored by: Mellanox Technologies Though this fixes the issue, it also means that now when anyone intentionally builds a UP kernel with modules they are getting SMP support in the modules and I am not sure they would want that. I know I don't. > Modified: > head/sys/amd64/include/atomic.h > head/sys/i386/include/atomic.h > > Modified: head/sys/amd64/include/atomic.h > ============================================================================== > --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 (r336024) > +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 (r336025) > @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_ > * For userland, always use lock prefixes so that the binaries will run > * on both SMP and !SMP systems. > */ > -#if defined(SMP) || !defined(_KERNEL) > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > #define MPLOCKED "lock ; " > #else > #define MPLOCKED > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, u_int v) > */ > #define OFFSETOF_MONITORBUF 0x100 > > -#if defined(SMP) > +#if defined(SMP) || defined(KLD_MODULE) > static __inline void > __storeload_barrier(void) > { > > Modified: head/sys/i386/include/atomic.h > ============================================================================== > --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 (r336024) > +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 (r336025) > @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile uint64_t *, uint64_t > * For userland, always use lock prefixes so that the binaries will run > * on both SMP and !SMP systems. > */ > -#if defined(SMP) || !defined(_KERNEL) > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > #define MPLOCKED "lock ; " > #else > #define MPLOCKED > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v) > */ > > #if defined(_KERNEL) > -#if defined(SMP) > +#if defined(SMP) || defined(KLD_MODULE) > #define __storeload_barrier() __mbk() > #else /* _KERNEL && UP */ > #define __storeload_barrier() __compiler_membar() > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jul 6 15:47:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF45110331FF for ; Fri, 6 Jul 2018 15:47:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E25986D49 for ; Fri, 6 Jul 2018 15:47:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x241.google.com with SMTP id l16-v6so17752169ita.0 for ; Fri, 06 Jul 2018 08:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=snti7yuoB4Q60Hawk++yB81jLtCiKY2tAhCyGN1XQOk=; b=GYIBYENbzZMBP+Tz3B9iDZJsUFkypMLGEyQQuR8BzumcH8+8A5oe1zb6061CGWcPzf 0Lp5LyVBoDTP++YLrqtDSYOxkDPMfH/k91GBb2m2f5bGrYXbYkpK7wF3WKoq20OXQWTB Shq6HjCu1xGAngohi8D0UeW/IXGcR6hAum8b5BHEqUU+qTLC3cfqnluF9D4n+R2VFdsp LioLo62EChEWYDtu5xwRsgNBdYlOjnZQkXM5AdVpqATATxK79j8py8SV1CTihWiY12tP VFGsWz6eFd1W1NdkW8Iidr4cyhKAi7YFhsdxKM2Stz+9wjlH9j4k1Yk+KJ+0zqIgjbnm zBlw== 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:in-reply-to:references:from :date:message-id:subject:to:cc; bh=snti7yuoB4Q60Hawk++yB81jLtCiKY2tAhCyGN1XQOk=; b=cIfQu5u6VdhWQNqVhfBoaHtjyVY8dacGhXKzZGkM1UGteiqMNd9ozFtcb2IXFgQNMV 1i9QbxiwPebeBGyHHKGxQgB2NaKf4xoV3et3UQ7wDGBbtivdGr/utCbalQ5ADV6q9K/a 0ii0Y8u5tUURok7IH++t7wA3NDNg4h/mPjNmYuxjaIFmmKqaDhNAJ1keuZxKillI/Eab bXJO4MkD0JNeCacDF2QCQzoCbnfsyFGxZnt6Cr3LYTh/8+HHOSWsfwe4nWP8AooJWBl1 QU5ahVZ54jWJon3wdwLa7DweGh1gtYw/8EemfWeYJHAPm9/ptHz0RuOXBg0a3gD2LkiD 3x4w== X-Gm-Message-State: APt69E3kGxKp9Hkl0FK5d/WNfTyTAzo9FbKg3XJSsQodO0hNbmA/GE7Y zCF0hKUH6HEQb4MfHPAxkTdpXpPPr4a/HbqSZoLzpA== X-Google-Smtp-Source: AAOMgpc4tlpUZxKODUttV1IcKVTUkQKOqTWPCFYhiw1W03scFowdBmKZmRFg1jUcgIxeza0povEwyoHGF1Xc/8bOKxE= X-Received: by 2002:a24:d0d7:: with SMTP id m206-v6mr8272286itg.1.1530892021192; Fri, 06 Jul 2018 08:47:01 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:1183:0:0:0:0:0 with HTTP; Fri, 6 Jul 2018 08:47:00 -0700 (PDT) X-Originating-IP: [74.62.67.99] In-Reply-To: <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> References: <201807061013.w66ADgbJ087546@repo.freebsd.org> <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 6 Jul 2018 09:47:00 -0600 X-Google-Sender-Auth: RTAUjBCTostenTEAO5yX6Ki-vw0 Message-ID: Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: "Rodney W. Grimes" Cc: Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 15:47:03 -0000 On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: hselasky > > Date: Fri Jul 6 10:13:42 2018 > > New Revision: 336025 > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > Log: > > Make sure kernel modules built by default are portable between UP and > > SMP systems by extending defined(SMP) to include defined(KLD_MODULE). > > > > This is a regression issue after r335873 . > > > > Discussed with: mmacy@ > > Sponsored by: Mellanox Technologies > > Though this fixes the issue, it also means that now when > anyone intentionally builds a UP kernel with modules > they are getting SMP support in the modules and I am > not sure they would want that. I know I don't. > On UP systems, these additional opcodes are harmless. They take a few extra cycles (since they lock an uncontested bus) and add a couple extra memory barriers (which will be NOPs). On MP systems, atomics now work by default. Had we not defaulted like this, all modules built outside of a kernel build env would have broken atomics. Given that (a) the overwhelming majority (99% or more) is SMP and (b) the MP code merely adds a few cycles to what's already a not-too-expensive operation, this was the right choice. It simply doesn't matter for systems that are relevant to the project today. While one could try to optimize this a little (for example, by having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to if (defined(SMP) && SMP != 0)), it's likely not going to matter enough for anybody to make the effort. UP on x86 is simply not relevant enough to optimize for it. Even in VMs, people run SMP kernels typically even when they just allocate one CPU to the VM. So while we still support the UP config, and we'll let people build optimized kernels for x86, we've flipped the switch from pessimized for SMP modules to pessimized for UP modules, which seems like quite the reasonable trade-off. Were it practical to do so, I'd suggest de-orbiting UP on x86. However, it's a lot of work for not much benefit and we'd need to invent much crazy to get there. Warner > > Modified: > > head/sys/amd64/include/atomic.h > > head/sys/i386/include/atomic.h > > > > Modified: head/sys/amd64/include/atomic.h > > ============================================================ > ================== > > --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 > (r336024) > > +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 > (r336025) > > @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE(volatile > u_##TYPE *p, u_ > > * For userland, always use lock prefixes so that the binaries will run > > * on both SMP and !SMP systems. > > */ > > -#if defined(SMP) || !defined(_KERNEL) > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > #define MPLOCKED "lock ; " > > #else > > #define MPLOCKED > > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, u_int > v) > > */ > > #define OFFSETOF_MONITORBUF 0x100 > > > > -#if defined(SMP) > > +#if defined(SMP) || defined(KLD_MODULE) > > static __inline void > > __storeload_barrier(void) > > { > > > > Modified: head/sys/i386/include/atomic.h > > ============================================================ > ================== > > --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 > (r336024) > > +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 > (r336025) > > @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile > uint64_t *, uint64_t > > * For userland, always use lock prefixes so that the binaries will run > > * on both SMP and !SMP systems. > > */ > > -#if defined(SMP) || !defined(_KERNEL) > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > #define MPLOCKED "lock ; " > > #else > > #define MPLOCKED > > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v) > > */ > > > > #if defined(_KERNEL) > > -#if defined(SMP) > > +#if defined(SMP) || defined(KLD_MODULE) > > #define __storeload_barrier() __mbk() > > #else /* _KERNEL && UP */ > > #define __storeload_barrier() __compiler_membar() > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Fri Jul 6 15:52:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA54A103390D; Fri, 6 Jul 2018 15:52:03 +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 388B087214; Fri, 6 Jul 2018 15:52:02 +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 w66Fq0aE052932; Fri, 6 Jul 2018 08:52:00 -0700 (PDT) (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 w66Fq0FX052931; Fri, 6 Jul 2018 08:52:00 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807061552.w66Fq0FX052931@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: To: Warner Losh Date: Fri, 6 Jul 2018 08:52:00 -0700 (PDT) CC: "Rodney W. Grimes" , Hans Petter Selasky , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 15:52:04 -0000 > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: hselasky > > > Date: Fri Jul 6 10:13:42 2018 > > > New Revision: 336025 > > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > > > Log: > > > Make sure kernel modules built by default are portable between UP and > > > SMP systems by extending defined(SMP) to include defined(KLD_MODULE). > > > > > > This is a regression issue after r335873 . > > > > > > Discussed with: mmacy@ > > > Sponsored by: Mellanox Technologies > > > > Though this fixes the issue, it also means that now when > > anyone intentionally builds a UP kernel with modules > > they are getting SMP support in the modules and I am > > not sure they would want that. I know I don't. > > > > > On UP systems, these additional opcodes are harmless. They take a few extra > cycles (since they lock an uncontested bus) and add a couple extra memory > barriers (which will be NOPs). On MP systems, atomics now work by default. > Had we not defaulted like this, all modules built outside of a kernel build > env would have broken atomics. Given that (a) the overwhelming majority > (99% or more) is SMP and (b) the MP code merely adds a few cycles to what's > already a not-too-expensive operation, this was the right choice. > > It simply doesn't matter for systems that are relevant to the project > today. While one could try to optimize this a little (for example, by > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to if > (defined(SMP) && SMP != 0)), it's likely not going to matter enough for > anybody to make the effort. UP on x86 is simply not relevant enough to > optimize for it. Even in VMs, people run SMP kernels typically even when > they just allocate one CPU to the VM. > > So while we still support the UP config, and we'll let people build > optimized kernels for x86, we've flipped the switch from pessimized for SMP > modules to pessimized for UP modules, which seems like quite the reasonable > trade-off. > > Were it practical to do so, I'd suggest de-orbiting UP on x86. However, > it's a lot of work for not much benefit and we'd need to invent much crazy > to get there. Trivial to fix this with +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || !defined(KLD_UP_MODULES) > > Warner > > > > > Modified: > > > head/sys/amd64/include/atomic.h > > > head/sys/i386/include/atomic.h > > > > > > Modified: head/sys/amd64/include/atomic.h > > > ============================================================ > > ================== > > > --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 > > (r336024) > > > +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 > > (r336025) > > > @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE(volatile > > u_##TYPE *p, u_ > > > * For userland, always use lock prefixes so that the binaries will run > > > * on both SMP and !SMP systems. > > > */ > > > -#if defined(SMP) || !defined(_KERNEL) > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > #define MPLOCKED "lock ; " > > > #else > > > #define MPLOCKED > > > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, u_int > > v) > > > */ > > > #define OFFSETOF_MONITORBUF 0x100 > > > > > > -#if defined(SMP) > > > +#if defined(SMP) || defined(KLD_MODULE) > > > static __inline void > > > __storeload_barrier(void) > > > { > > > > > > Modified: head/sys/i386/include/atomic.h > > > ============================================================ > > ================== > > > --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 > > (r336024) > > > +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 > > (r336025) > > > @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile > > uint64_t *, uint64_t > > > * For userland, always use lock prefixes so that the binaries will run > > > * on both SMP and !SMP systems. > > > */ > > > -#if defined(SMP) || !defined(_KERNEL) > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > #define MPLOCKED "lock ; " > > > #else > > > #define MPLOCKED > > > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v) > > > */ > > > > > > #if defined(_KERNEL) > > > -#if defined(SMP) > > > +#if defined(SMP) || defined(KLD_MODULE) > > > #define __storeload_barrier() __mbk() > > > #else /* _KERNEL && UP */ > > > #define __storeload_barrier() __compiler_membar() > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jul 6 16:22:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DE831035F61; Fri, 6 Jul 2018 16:22:27 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF7E289116; Fri, 6 Jul 2018 16:22:26 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B06952F29; Fri, 6 Jul 2018 16:22:26 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66GMQ9h075512; Fri, 6 Jul 2018 16:22:26 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66GMQiF075510; Fri, 6 Jul 2018 16:22:26 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201807061622.w66GMQiF075510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Fri, 6 Jul 2018 16:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336034 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head: share/misc usr.bin/calendar/calendars X-SVN-Commit-Revision: 336034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 16:22:27 -0000 Author: bwidawsk Date: Fri Jul 6 16:22:26 2018 New Revision: 336034 URL: https://svnweb.freebsd.org/changeset/base/336034 Log: Adding myself to committers-src.dot and calendar.freebsd Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D16154 Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Fri Jul 6 13:34:45 2018 (r336033) +++ head/share/misc/committers-src.dot Fri Jul 6 16:22:26 2018 (r336034) @@ -135,6 +135,7 @@ brueffer [label="Christian Brueffer\nbrueffer@FreeBSD. bruno [label="Bruno Ducrot\nbruno@FreeBSD.org\n2005/07/18"] bryanv [label="Bryan Venteicher\nbryanv@FreeBSD.org\n2012/11/03"] bschmidt [label="Bernhard Schmidt\nbschmidt@FreeBSD.org\n2010/02/06"] +bwidawsk [label="Ben Widawsky\nbwidawsk@FreeBSD.org\n2018/07/05"] bz [label="Bjoern A. Zeeb\nbz@FreeBSD.org\n2004/07/27"] cem [label="Conrad Meyer\ncem@FreeBSD.org\n2015/07/05"] chuck [label="Chuck Tuffli\nchuck@FreeBSD.org\n2017/09/06"] @@ -495,6 +496,7 @@ eivind -> des eivind -> rwatson emaste -> achim +emaste -> bwidawsk emaste -> dteske emaste -> kevans emaste -> markj Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Fri Jul 6 13:34:45 2018 (r336033) +++ head/usr.bin/calendar/calendars/calendar.freebsd Fri Jul 6 16:22:26 2018 (r336034) @@ -185,6 +185,7 @@ 05/11 Roman Kurakin born in Moscow, USSR, 1979 05/11 Ulrich Spoerlein born in Schesslitz, Bayern, Germany, 1981 05/13 Pete Fritchman born in Lansdale, Pennsylvania, United States, 1983 +05/13 Ben Widawsky born in New York City, New York, United States, 1982 05/14 Tatsumi Hosokawa born in Tokyo, Japan, 1968 05/14 Shigeyuku Fukushima born in Osaka, Japan, 1974 05/14 Rebecca Cran born in Cambridge, United Kingdom, 1981 From owner-svn-src-head@freebsd.org Fri Jul 6 16:23:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E95431037283; Fri, 6 Jul 2018 16:23:30 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B36D892B0; Fri, 6 Jul 2018 16:23:30 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C6532F37; Fri, 6 Jul 2018 16:23:30 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66GNUA5076382; Fri, 6 Jul 2018 16:23:30 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66GNUVT076381; Fri, 6 Jul 2018 16:23:30 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201807061623.w66GNUVT076381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Fri, 6 Jul 2018 16:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336035 - head/usr.bin/cpuset X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/usr.bin/cpuset X-SVN-Commit-Revision: 336035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 16:23:31 -0000 Author: jamie Date: Fri Jul 6 16:23:30 2018 New Revision: 336035 URL: https://svnweb.freebsd.org/changeset/base/336035 Log: Missed a bit of doc change from r335921. PR: 229266 Modified: head/usr.bin/cpuset/cpuset.1 Modified: head/usr.bin/cpuset/cpuset.1 ============================================================================== --- head/usr.bin/cpuset/cpuset.1 Fri Jul 6 16:22:26 2018 (r336034) +++ head/usr.bin/cpuset/cpuset.1 Fri Jul 6 16:23:30 2018 (r336035) @@ -52,7 +52,7 @@ .Op Fl c .Op Fl l Ar cpu-list .Op Fl n Ar policy:domain-list -.Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq +.Op Fl j Ar jail | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq .Nm .Fl g .Op Fl cir From owner-svn-src-head@freebsd.org Fri Jul 6 16:24:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 278101037437 for ; Fri, 6 Jul 2018 16:24:25 +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 CF55B8946D; Fri, 6 Jul 2018 16:24:24 +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 B102610B45D; Fri, 6 Jul 2018 12:24:23 -0400 (EDT) Subject: Re: svn commit: r336023 - in head/sys: kern netinet To: Brooks Davis , svn-src-head@freebsd.org References: <201807061003.w66A3X6Z082209@repo.freebsd.org> From: John Baldwin Message-ID: <1e5035b3-3b4e-9095-50b9-6fed7be0181e@FreeBSD.org> Date: Fri, 6 Jul 2018 09:24:22 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807061003.w66A3X6Z082209@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 06 Jul 2018 12:24:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 16:24:25 -0000 On 7/6/18 3:03 AM, Brooks Davis wrote: > Author: brooks > Date: Fri Jul 6 10:03:33 2018 > New Revision: 336023 > URL: https://svnweb.freebsd.org/changeset/base/336023 > > Log: > Correct breakage on 32-bit platforms from r335979. Do we still need the kvaddr_t casts after the uintptr_t cast? Are those only required for CHERI (and perhaps if we change the default of how uintptr_t gets converted to an int to default to the vaddr we may find we won't need them at all even on CHERI)? -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jul 6 16:26:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C9171037718; Fri, 6 Jul 2018 16:26:15 +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 BEB2E895AD; Fri, 6 Jul 2018 16:26:14 +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 9298E10AFD4; Fri, 6 Jul 2018 12:26:13 -0400 (EDT) Subject: Re: svn commit: r336027 - head/gnu/usr.bin/binutils/libbfd To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807061150.w66Boxi5034455@repo.freebsd.org> From: John Baldwin Message-ID: <6fd74b36-aa91-f01f-8926-f4d159d0d03c@FreeBSD.org> Date: Fri, 6 Jul 2018 09:26:12 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807061150.w66Boxi5034455@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 06 Jul 2018 12:26:14 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 16:26:15 -0000 On 7/6/18 4:50 AM, Andrew Turner wrote: > Author: andrew > Date: Fri Jul 6 11:50:59 2018 > New Revision: 336027 > URL: https://svnweb.freebsd.org/changeset/base/336027 > > Log: > Teach binutils that arm64 is a 64bit architecture. This is needed to cross > build from arm64 to other architectures that use binutils. > > Sponsored by: ABT Systems Ltd Perhaps this should just use __LP64__ if we are going to carry a local diff? -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jul 6 16:31:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF4451038005; Fri, 6 Jul 2018 16:31:03 +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 61440898FE; Fri, 6 Jul 2018 16:31:03 +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 4186F10AFCD; Fri, 6 Jul 2018 12:31:02 -0400 (EDT) Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: rgrimes@freebsd.org, Warner Losh References: <201807061552.w66Fq0FX052931@pdx.rh.CN85.dnsmgr.net> Cc: Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <1f87b7ba-3b59-e710-00b0-91a4b0e4e5b4@FreeBSD.org> Date: Fri, 6 Jul 2018 09:31:01 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807061552.w66Fq0FX052931@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 06 Jul 2018 12:31:02 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 16:31:03 -0000 On 7/6/18 8:52 AM, Rodney W. Grimes wrote: >> On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < >> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >> >>>> Author: hselasky >>>> Date: Fri Jul 6 10:13:42 2018 >>>> New Revision: 336025 >>>> URL: https://svnweb.freebsd.org/changeset/base/336025 >>>> >>>> Log: >>>> Make sure kernel modules built by default are portable between UP and >>>> SMP systems by extending defined(SMP) to include defined(KLD_MODULE). >>>> >>>> This is a regression issue after r335873 . >>>> >>>> Discussed with: mmacy@ >>>> Sponsored by: Mellanox Technologies >>> >>> Though this fixes the issue, it also means that now when >>> anyone intentionally builds a UP kernel with modules >>> they are getting SMP support in the modules and I am >>> not sure they would want that. I know I don't. >>> >> >> >> On UP systems, these additional opcodes are harmless. They take a few extra >> cycles (since they lock an uncontested bus) and add a couple extra memory >> barriers (which will be NOPs). On MP systems, atomics now work by default. >> Had we not defaulted like this, all modules built outside of a kernel build >> env would have broken atomics. Given that (a) the overwhelming majority >> (99% or more) is SMP and (b) the MP code merely adds a few cycles to what's >> already a not-too-expensive operation, this was the right choice. >> >> It simply doesn't matter for systems that are relevant to the project >> today. While one could try to optimize this a little (for example, by >> having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to if >> (defined(SMP) && SMP != 0)), it's likely not going to matter enough for >> anybody to make the effort. UP on x86 is simply not relevant enough to >> optimize for it. Even in VMs, people run SMP kernels typically even when >> they just allocate one CPU to the VM. >> >> So while we still support the UP config, and we'll let people build >> optimized kernels for x86, we've flipped the switch from pessimized for SMP >> modules to pessimized for UP modules, which seems like quite the reasonable >> trade-off. >> >> Were it practical to do so, I'd suggest de-orbiting UP on x86. However, >> it's a lot of work for not much benefit and we'd need to invent much crazy >> to get there. > > Trivial to fix this with > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || !defined(KLD_UP_MODULES) This is not worth it. Note that we already use LOCK always in userland which is probably far more prevalent than the use in modules. Previously atomics in modules were _function calls_ just to avoid the LOCK. Having the LOCK prefix present even on UP is probably far more efficient than a function call. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jul 6 16:49:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8397103A28E for ; Fri, 6 Jul 2018 16:49:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 570F78A7D2 for ; Fri, 6 Jul 2018 16:49:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x243.google.com with SMTP id z20-v6so11424200iol.0 for ; Fri, 06 Jul 2018 09:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=MySFb3FRJ3T9ckp2fFPCFk5gJr+ddsI/c4SDWCNMACA=; b=J1X5d/7EkLnEFStUqvG993z/a7ZdVi6Fv+MAaDEAqdwrt/RnJSep4blir9g9sW+9QW wyk8J1yz6ISYQT/pSzJTvkgmcfu8utysXqkPps6wm6lc3ABsK9BP4a7YKLXBuHzBbnNf CwLayx5jmhJ3HALQXOvVGSRQe3orJlq/YMKUFVXCtOmx/PPqe6h2BXpU2kJwSvxbjNgf gbwlWH5tuOmD13K2HtrUuMpvWndCpbLc/Y6hotpxwAbegTQGIKJPpKqHfXnkqHtlmrA4 oj3cpSY0gVeqnC2vjb5ZRJINnPMfxicWvQM/CYp1h1VaSJf5VeNC76rjeqsxxxjCBsTE 41yQ== 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:in-reply-to:references:from :date:message-id:subject:to:cc; bh=MySFb3FRJ3T9ckp2fFPCFk5gJr+ddsI/c4SDWCNMACA=; b=s3Ix6AAZMOAa79/fC8LkOguSw3pk+r8CXl5D7V/oDOY3cwpV6wcKttzz7M+FoEp8vA kPc7lKeozK5zPpgVH1/ssDC8hDZbc21gKZhSmitx2cxsY6EEGxzSGFPiSeamSZW22MEk TXQIduskL5goIR18PL9rg9vM6AxHXteJ/+GNx8JCPmb5G1ILcnJ+GZMxiV5/FEUP7eWU fCPxwVzijZU/c0yI1DEc6j4ozQZ2yVE+7TTe5A3t1tha3dBcn0XNv31f1x1Q02g7uHdL dprknbC25kMQ7UnYfCODTUo7mKPKTLHV1+90otmTZ6auy6G6HqDJKH8xzW1xi5MDw1jc EWIw== X-Gm-Message-State: APt69E0jBBev+rYwQ1JsIMoJAlS6Q3220EGpE7v3f8gL3I+2e/KC/Ivl rM3LfiH+RcSrb8IOSdmzrjFLE+LFt590BghKvXgpTw== X-Google-Smtp-Source: AAOMgpfQKbwuevpGoaB/8VLNn0vkEpVQt7nru4z9kOXL0QiVHi3HWEXzDXqXX8AAtf8ApvF2jr1hD/KWrYZKz+p0Hw0= X-Received: by 2002:a6b:d004:: with SMTP id x4-v6mr8883803ioa.299.1530895748303; Fri, 06 Jul 2018 09:49:08 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:1183:0:0:0:0:0 with HTTP; Fri, 6 Jul 2018 09:49:07 -0700 (PDT) X-Originating-IP: [74.62.67.99] In-Reply-To: <201807061552.w66Fq0FX052931@pdx.rh.CN85.dnsmgr.net> References: <201807061552.w66Fq0FX052931@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 6 Jul 2018 10:49:07 -0600 X-Google-Sender-Auth: RLZJY7kHwhHgkSutSjmm28ZYtMQ Message-ID: Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: "Rodney W. Grimes" Cc: Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 16:49:10 -0000 On Fri, Jul 6, 2018 at 9:52 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > Author: hselasky > > > > Date: Fri Jul 6 10:13:42 2018 > > > > New Revision: 336025 > > > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > > > > > Log: > > > > Make sure kernel modules built by default are portable between UP > and > > > > SMP systems by extending defined(SMP) to include > defined(KLD_MODULE). > > > > > > > > This is a regression issue after r335873 . > > > > > > > > Discussed with: mmacy@ > > > > Sponsored by: Mellanox Technologies > > > > > > Though this fixes the issue, it also means that now when > > > anyone intentionally builds a UP kernel with modules > > > they are getting SMP support in the modules and I am > > > not sure they would want that. I know I don't. > > > > > > > > > On UP systems, these additional opcodes are harmless. They take a few > extra > > cycles (since they lock an uncontested bus) and add a couple extra memory > > barriers (which will be NOPs). On MP systems, atomics now work by > default. > > Had we not defaulted like this, all modules built outside of a kernel > build > > env would have broken atomics. Given that (a) the overwhelming majority > > (99% or more) is SMP and (b) the MP code merely adds a few cycles to > what's > > already a not-too-expensive operation, this was the right choice. > > > > It simply doesn't matter for systems that are relevant to the project > > today. While one could try to optimize this a little (for example, by > > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to > if > > (defined(SMP) && SMP != 0)), it's likely not going to matter enough for > > anybody to make the effort. UP on x86 is simply not relevant enough to > > optimize for it. Even in VMs, people run SMP kernels typically even when > > they just allocate one CPU to the VM. > > > > So while we still support the UP config, and we'll let people build > > optimized kernels for x86, we've flipped the switch from pessimized for > SMP > > modules to pessimized for UP modules, which seems like quite the > reasonable > > trade-off. > > > > Were it practical to do so, I'd suggest de-orbiting UP on x86. However, > > it's a lot of work for not much benefit and we'd need to invent much > crazy > > to get there. > > Trivial to fix this with > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || > !defined(KLD_UP_MODULES) Nope. Not so trivial. Who defines KLD_UP_MODULES? And really, it's absolutely not worth it unless someone shows up with numbers to show the old 'function call to optimal routine' is actually faster than the new 'inline to slightly unoptimal code'. Since I think the function call overhead is larger than the pessmizations, I'm not sure what the fuss is about. Warner > > > > Warner > > > > > > > > Modified: > > > > head/sys/amd64/include/atomic.h > > > > head/sys/i386/include/atomic.h > > > > > > > > Modified: head/sys/amd64/include/atomic.h > > > > ============================================================ > > > ================== > > > > --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 > > > (r336024) > > > > +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 > > > (r336025) > > > > @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE( > volatile > > > u_##TYPE *p, u_ > > > > * For userland, always use lock prefixes so that the binaries will > run > > > > * on both SMP and !SMP systems. > > > > */ > > > > -#if defined(SMP) || !defined(_KERNEL) > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > > #define MPLOCKED "lock ; " > > > > #else > > > > #define MPLOCKED > > > > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, > u_int > > > v) > > > > */ > > > > #define OFFSETOF_MONITORBUF 0x100 > > > > > > > > -#if defined(SMP) > > > > +#if defined(SMP) || defined(KLD_MODULE) > > > > static __inline void > > > > __storeload_barrier(void) > > > > { > > > > > > > > Modified: head/sys/i386/include/atomic.h > > > > ============================================================ > > > ================== > > > > --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 > > > (r336024) > > > > +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 > > > (r336025) > > > > @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile > > > uint64_t *, uint64_t > > > > * For userland, always use lock prefixes so that the binaries will > run > > > > * on both SMP and !SMP systems. > > > > */ > > > > -#if defined(SMP) || !defined(_KERNEL) > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > > #define MPLOCKED "lock ; " > > > > #else > > > > #define MPLOCKED > > > > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, > u_int v) > > > > */ > > > > > > > > #if defined(_KERNEL) > > > > -#if defined(SMP) > > > > +#if defined(SMP) || defined(KLD_MODULE) > > > > #define __storeload_barrier() __mbk() > > > > #else /* _KERNEL && UP */ > > > > #define __storeload_barrier() __compiler_membar() > > > > > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Fri Jul 6 16:51:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCCAE103A594; Fri, 6 Jul 2018 16:51:36 +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 8950A8ABB8; Fri, 6 Jul 2018 16:51:36 +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 6A57F32B4; Fri, 6 Jul 2018 16:51:36 +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 w66Gpair090881; Fri, 6 Jul 2018 16:51:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66GpZOc090879; Fri, 6 Jul 2018 16:51:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807061651.w66GpZOc090879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Jul 2018 16:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336036 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 336036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 16:51:37 -0000 Author: kevans Date: Fri Jul 6 16:51:35 2018 New Revision: 336036 URL: https://svnweb.freebsd.org/changeset/base/336036 Log: kern_environment: Fix SYSINIT ordering The dynamic environment was being initialized at SI_SUB_KMEM, SI_ORDER_ANY. I added the hint-merging at SI_SUB_KMEM, SI_ORDER_ANY as well in r335998 - this can only work by coincidence. Re-do both to operate at SI_SUB_KMEM + 1, SI_ORDER_FIRST and SI_ORDER_SECOND respectively to be safe. It's sufficiently obfuscated away as to when in SU_SUB_KMEM malloc will be available, and the dynamic environment cannot be relied upon there anyways since it's initialized at SI_ORDER_ANY. Reported by: bde Discussed with: bde X-MFC-With: r335998 Modified: head/sys/kern/kern_environment.c head/sys/kern/subr_hints.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Fri Jul 6 16:23:30 2018 (r336035) +++ head/sys/kern/kern_environment.c Fri Jul 6 16:51:35 2018 (r336036) @@ -346,7 +346,7 @@ init_dynamic_kenv(void *data __unused) mtx_init(&kenv_lock, "kernel environment", NULL, MTX_DEF); dynamic_kenv = 1; } -SYSINIT(kenv, SI_SUB_KMEM, SI_ORDER_ANY, init_dynamic_kenv, NULL); +SYSINIT(kenv, SI_SUB_KMEM + 1, SI_ORDER_FIRST, init_dynamic_kenv, NULL); void freeenv(char *env) Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Fri Jul 6 16:23:30 2018 (r336035) +++ head/sys/kern/subr_hints.c Fri Jul 6 16:51:35 2018 (r336036) @@ -88,7 +88,7 @@ static_hints_to_env(void *data __unused) } /* Any time after dynamic env is setup */ -SYSINIT(hintenv, SI_SUB_KMEM, SI_ORDER_ANY, static_hints_to_env, NULL); +SYSINIT(hintenv, SI_SUB_KMEM + 1, SI_ORDER_SECOND, static_hints_to_env, NULL); /* * Checks the environment to see if we even have any hints. If it has no hints, From owner-svn-src-head@freebsd.org Fri Jul 6 16:54:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F054103AB3B; Fri, 6 Jul 2018 16:54:46 +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 A1A498AEE3; Fri, 6 Jul 2018 16:54:45 +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 w66Gshos053187; Fri, 6 Jul 2018 09:54:43 -0700 (PDT) (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 w66GshSt053186; Fri, 6 Jul 2018 09:54:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807061654.w66GshSt053186@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: <1f87b7ba-3b59-e710-00b0-91a4b0e4e5b4@FreeBSD.org> To: John Baldwin Date: Fri, 6 Jul 2018 09:54:43 -0700 (PDT) CC: rgrimes@freebsd.org, Warner Losh , Hans Petter Selasky , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 16:54:46 -0000 > On 7/6/18 8:52 AM, Rodney W. Grimes wrote: > >> On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > >> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > >>>> Author: hselasky > >>>> Date: Fri Jul 6 10:13:42 2018 > >>>> New Revision: 336025 > >>>> URL: https://svnweb.freebsd.org/changeset/base/336025 > >>>> > >>>> Log: > >>>> Make sure kernel modules built by default are portable between UP and > >>>> SMP systems by extending defined(SMP) to include defined(KLD_MODULE). > >>>> > >>>> This is a regression issue after r335873 . > >>>> > >>>> Discussed with: mmacy@ > >>>> Sponsored by: Mellanox Technologies > >>> > >>> Though this fixes the issue, it also means that now when > >>> anyone intentionally builds a UP kernel with modules > >>> they are getting SMP support in the modules and I am > >>> not sure they would want that. I know I don't. > >>> > >> > >> > >> On UP systems, these additional opcodes are harmless. They take a few extra > >> cycles (since they lock an uncontested bus) and add a couple extra memory > >> barriers (which will be NOPs). On MP systems, atomics now work by default. > >> Had we not defaulted like this, all modules built outside of a kernel build > >> env would have broken atomics. Given that (a) the overwhelming majority > >> (99% or more) is SMP and (b) the MP code merely adds a few cycles to what's > >> already a not-too-expensive operation, this was the right choice. > >> > >> It simply doesn't matter for systems that are relevant to the project > >> today. While one could try to optimize this a little (for example, by > >> having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to if > >> (defined(SMP) && SMP != 0)), it's likely not going to matter enough for > >> anybody to make the effort. UP on x86 is simply not relevant enough to > >> optimize for it. Even in VMs, people run SMP kernels typically even when > >> they just allocate one CPU to the VM. > >> > >> So while we still support the UP config, and we'll let people build > >> optimized kernels for x86, we've flipped the switch from pessimized for SMP > >> modules to pessimized for UP modules, which seems like quite the reasonable > >> trade-off. > >> > >> Were it practical to do so, I'd suggest de-orbiting UP on x86. However, > >> it's a lot of work for not much benefit and we'd need to invent much crazy > >> to get there. > > > > Trivial to fix this with > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || !defined(KLD_UP_MODULES) My add probably needs to be && !defined > > This is not worth it. Note that we already use LOCK always in userland > which is probably far more prevalent than the use in modules. > > Previously atomics in modules were _function calls_ just to avoid the LOCK. > Having the LOCK prefix present even on UP is probably far more efficient > than a function call. Which means when I compiled UP before I had nothing, and now this adds useless LOCK perfixes in place of . -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jul 6 17:27:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EC48103D767; Fri, 6 Jul 2018 17:27:12 +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 9C1978C692; Fri, 6 Jul 2018 17:27:11 +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 w66HR2vN053354; Fri, 6 Jul 2018 10:27:02 -0700 (PDT) (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 w66HR2wY053353; Fri, 6 Jul 2018 10:27:02 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807061727.w66HR2wY053353@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: To: Warner Losh Date: Fri, 6 Jul 2018 10:27:02 -0700 (PDT) CC: "Rodney W. Grimes" , Hans Petter Selasky , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 17:27:12 -0000 > On Fri, Jul 6, 2018 at 9:52 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > Author: hselasky > > > > > Date: Fri Jul 6 10:13:42 2018 > > > > > New Revision: 336025 > > > > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > > > > > > > Log: > > > > > Make sure kernel modules built by default are portable between UP > > and > > > > > SMP systems by extending defined(SMP) to include > > defined(KLD_MODULE). > > > > > > > > > > This is a regression issue after r335873 . > > > > > > > > > > Discussed with: mmacy@ > > > > > Sponsored by: Mellanox Technologies > > > > > > > > Though this fixes the issue, it also means that now when > > > > anyone intentionally builds a UP kernel with modules > > > > they are getting SMP support in the modules and I am > > > > not sure they would want that. I know I don't. > > > > > > > > > > > > > On UP systems, these additional opcodes are harmless. They take a few > > extra > > > cycles (since they lock an uncontested bus) and add a couple extra memory > > > barriers (which will be NOPs). On MP systems, atomics now work by > > default. > > > Had we not defaulted like this, all modules built outside of a kernel > > build > > > env would have broken atomics. Given that (a) the overwhelming majority > > > (99% or more) is SMP and (b) the MP code merely adds a few cycles to > > what's > > > already a not-too-expensive operation, this was the right choice. > > > > > > It simply doesn't matter for systems that are relevant to the project > > > today. While one could try to optimize this a little (for example, by > > > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to > > if > > > (defined(SMP) && SMP != 0)), it's likely not going to matter enough for > > > anybody to make the effort. UP on x86 is simply not relevant enough to > > > optimize for it. Even in VMs, people run SMP kernels typically even when > > > they just allocate one CPU to the VM. > > > > > > So while we still support the UP config, and we'll let people build > > > optimized kernels for x86, we've flipped the switch from pessimized for > > SMP > > > modules to pessimized for UP modules, which seems like quite the > > reasonable > > > trade-off. > > > > > > Were it practical to do so, I'd suggest de-orbiting UP on x86. However, > > > it's a lot of work for not much benefit and we'd need to invent much > > crazy > > > to get there. > > > > Trivial to fix this with > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || > > !defined(KLD_UP_MODULES) > > > Nope. Not so trivial. Who defines KLD_UP_MODULES? Call it SMP_KLD_MODULES, and it gets defined the same place SMP does. > > And really, it's absolutely not worth it unless someone shows up with > numbers to show the old 'function call to optimal routine' is actually > faster than the new 'inline to slightly unoptimal code'. Since I think the > function call overhead is larger than the pessmizations, I'm not sure what > the fuss is about. I have no issues with the SMP converting from function calls to inline locks, I just want to retain the exact same code I had before any of these changes, and that was A UP built system without any SMP locking. Is it too much to ask to keep what already worked? > > > > > > > > Modified: > > > > > head/sys/amd64/include/atomic.h > > > > > head/sys/i386/include/atomic.h > > > > > > > > > > Modified: head/sys/amd64/include/atomic.h > > > > > ============================================================ > > > > ================== > > > > > --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 > > > > (r336024) > > > > > +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 > > > > (r336025) > > > > > @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE( > > volatile > > > > u_##TYPE *p, u_ > > > > > * For userland, always use lock prefixes so that the binaries will > > run > > > > > * on both SMP and !SMP systems. > > > > > */ > > > > > -#if defined(SMP) || !defined(_KERNEL) > > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > > > #define MPLOCKED "lock ; " > > > > > #else > > > > > #define MPLOCKED > > > > > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, > > u_int > > > > v) > > > > > */ > > > > > #define OFFSETOF_MONITORBUF 0x100 > > > > > > > > > > -#if defined(SMP) > > > > > +#if defined(SMP) || defined(KLD_MODULE) > > > > > static __inline void > > > > > __storeload_barrier(void) > > > > > { > > > > > > > > > > Modified: head/sys/i386/include/atomic.h > > > > > ============================================================ > > > > ================== > > > > > --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 > > > > (r336024) > > > > > +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 > > > > (r336025) > > > > > @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile > > > > uint64_t *, uint64_t > > > > > * For userland, always use lock prefixes so that the binaries will > > run > > > > > * on both SMP and !SMP systems. > > > > > */ > > > > > -#if defined(SMP) || !defined(_KERNEL) > > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > > > #define MPLOCKED "lock ; " > > > > > #else > > > > > #define MPLOCKED > > > > > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, > > u_int v) > > > > > */ > > > > > > > > > > #if defined(_KERNEL) > > > > > -#if defined(SMP) > > > > > +#if defined(SMP) || defined(KLD_MODULE) > > > > > #define __storeload_barrier() __mbk() > > > > > #else /* _KERNEL && UP */ > > > > > #define __storeload_barrier() __compiler_membar() > > > > > > > > > > > > > > > > > > -- > > > > Rod Grimes > > > > rgrimes@freebsd.org > > > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jul 6 17:39:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AE6A103EBBA; Fri, 6 Jul 2018 17:39:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0B828D464; Fri, 6 Jul 2018 17:39:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE08A3E9B; Fri, 6 Jul 2018 17:39:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66Hdmxo012599; Fri, 6 Jul 2018 17:39:48 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66HdmHB012598; Fri, 6 Jul 2018 17:39:48 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201807061739.w66HdmHB012598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 6 Jul 2018 17:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336037 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 336037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 17:39:49 -0000 Author: manu Date: Fri Jul 6 17:39:48 2018 New Revision: 336037 URL: https://svnweb.freebsd.org/changeset/base/336037 Log: psci: Add \n at the end of printf Add a \n at the end of the printf if no PSCI function was found otherwise it mess up the console log. Modified: head/sys/dev/psci/psci.c Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Fri Jul 6 16:51:35 2018 (r336036) +++ head/sys/dev/psci/psci.c Fri Jul 6 17:39:48 2018 (r336037) @@ -118,7 +118,7 @@ psci_init(void *dummy) psci_callfn_t new_callfn; if (psci_find_callfn(&new_callfn) != PSCI_RETVAL_SUCCESS) { - printf("No PSCI/SMCCC call function found"); + printf("No PSCI/SMCCC call function found\n"); return; } From owner-svn-src-head@freebsd.org Fri Jul 6 17:55:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FC31040576; Fri, 6 Jul 2018 17:55:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 53DB68E785; Fri, 6 Jul 2018 17:55:47 +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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 997443CA3B1; Sat, 7 Jul 2018 03:55:36 +1000 (AEST) Date: Sat, 7 Jul 2018 03:55:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: rgrimes@freebsd.org, Warner Losh , Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: <1f87b7ba-3b59-e710-00b0-91a4b0e4e5b4@FreeBSD.org> Message-ID: <20180707031245.J2611@besplex.bde.org> References: <201807061552.w66Fq0FX052931@pdx.rh.CN85.dnsmgr.net> <1f87b7ba-3b59-e710-00b0-91a4b0e4e5b4@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=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=5aJKZOoyagWDvRgEFpYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 17:55:49 -0000 On Fri, 6 Jul 2018, John Baldwin wrote: > On 7/6/18 8:52 AM, Rodney W. Grimes wrote: >> ... >> Trivial to fix this with >> +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || !defined(KLD_UP_MODULES) > > This is not worth it. Note that we already use LOCK always in userland > which is probably far more prevalent than the use in modules. > > Previously atomics in modules were _function calls_ just to avoid the LOCK. > Having the LOCK prefix present even on UP is probably far more efficient > than a function call. No, the lock prefix is less efficient. IIRC, on very old systems (~PPro), lock prefixes cost 20 cycles in the UP case. On AthlonXP, they cost about 19 cycles, but function calls (written in C) only cost about 6 cycles. This depends on pipelining, and my test is perhaps too simple since it uses a loop where the pipelinig works especially well (it executes 2 or 3 function calls in parallel). Actually timing on AthlonXP UP: - asm loop: 2 cycles/iteration - "incl mem" in asm loop: 5.85 cycles (but with less alignment, only 3.25 cycles) - "lock; incl mem" in asm loop: 18.9 cycles - function call in C loop to C function doing "incl mem" in asm: 8.35 cycles - function call in C loop to C function doing "lock; incl mem" in asm: 24.95 cycles. Newer CPUs have better pipelining. On Haswell, this gives the strange behaviour that the function call written in C is slightly faster than inline code written in asm: Actual timing on Haswell SMP: - asm loop: 1.16 cycles/iteration - "incl mem" in asm loop: 6.95 cycles - "lock; incl mem" in asm loop: 19.00 cycles - function call in C loop to C function doing "incl mem" in asm: 6 cycles - function call in C loop to C function doing "lock; incl mem" in asm: 26.00 cycles. The C code with the function call executes: loop: call incl incl: pushl %ebp movl %ebp,%esp [lock;] incl mem leave ret incl %ebx cmpl $4080000000-1,%ebx jbe done I didn't even compile with -fframe-pointer or try clang which would do excessive unrolling. -fframe-pointer takes 3 extra instructions in incl, but these take no extra time. In non-benchmark use, there would be more args for the function call so and the scheduling would be very different so the timing might be very different. I expect the function call would be insignificantly slower except in micro-benchmarks, Bruce From owner-svn-src-head@freebsd.org Fri Jul 6 17:57:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D60861040729 for ; Fri, 6 Jul 2018 17:56:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC4F8E945 for ; Fri, 6 Jul 2018 17:56:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id j185-v6so17992224ite.1 for ; Fri, 06 Jul 2018 10:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=09fK4/RfFzq+P1jH+EuUBR3T4ZiLHFMRKvvtalx1G1U=; b=aEvqkOMft+NP+eRwGkKFmpOu47EgnTxz6QxYUR9sBcyaoRdq9TTdLjcAhKQunDonZ8 Ev/OWPxE9ZzkcXwLs0Tou/u5ykX8Gh79PS+EY4FCj0M5aoE5Ed03GMe7leYA1gVkMBv/ gaVs1gSkS3+8R4OVkHnmLYqOEovV1qbpdGVAN9bKechaKp3Y6qgXsBToiDdoYACKZCbK gwF6JuVc4MF+DipU/8dgUTneoqkh+PitS9cS2a9MA7FJeTk8aHSPDocd/9WGajMXkEvB OJrHnHOupLzovcP5U3x00hPsntBBHBwRNidSCVfA833pFJIY6/ethyiqSylUoh7JojIJ tReQ== 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=09fK4/RfFzq+P1jH+EuUBR3T4ZiLHFMRKvvtalx1G1U=; b=kJGYv+fk5s5yvPDFExJOifigMUTp2hP/yBCzlhg0h63lt6UAcVJfG1mY42oMKJUSQt euY36DUzk/oFo+igvk8vPa4mzlHO+F7KKFQ5DVGHYrKWIitQMUFKxviA69rLvVNumpr8 ohziNiOVtcTlFRaU3qSwNnu+ibddD1DoxpEBlJN31eAA80yWs0Db6+u4TIzJDOXIKCzM s9D/HNMlAWlrViC3ELM+B5kMk7ri62jhytd/p9i2ODKERFzgLELvc/AL2gXN38H5h7ze e1nA71NKHw9sl/wq2qi/aXdOppmyR7qFcqXILaV2xC8lWm0jzapUKwAvoqrONhWSq2P4 fZkQ== X-Gm-Message-State: APt69E3ipo39kPe9W9dJKLOwhM0ZsZhkurX3l6zhk2k6WZlGLEpKmvIF A9OiOngp3GLGnUCg4pNUgjWYZ5fDd/RzTkTNCs6LTA== X-Google-Smtp-Source: AAOMgpfXkwPVPO0i1k4GPHEgPdchrCsi3cQeFK+ArcIVCdrMrLe3aBiLLyxAaGOrw90cfryTOCFdX7iPxJng1T+LFMg= X-Received: by 2002:a02:a701:: with SMTP id k1-v6mr9350663jam.140.1530899818657; Fri, 06 Jul 2018 10:56:58 -0700 (PDT) MIME-Version: 1.0 References: <201807061727.w66HR2wY053353@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201807061727.w66HR2wY053353@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 6 Jul 2018 11:56:46 -0600 Message-ID: Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: "Rodney W. Grimes" Cc: Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 17:57:00 -0000 On Fri, Jul 6, 2018, 12:27 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Fri, Jul 6, 2018 at 9:52 AM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > Author: hselasky > > > > > > Date: Fri Jul 6 10:13:42 2018 > > > > > > New Revision: 336025 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > > > > > > > > > Log: > > > > > > Make sure kernel modules built by default are portable between > UP > > > and > > > > > > SMP systems by extending defined(SMP) to include > > > defined(KLD_MODULE). > > > > > > > > > > > > This is a regression issue after r335873 . > > > > > > > > > > > > Discussed with: mmacy@ > > > > > > Sponsored by: Mellanox Technologies > > > > > > > > > > Though this fixes the issue, it also means that now when > > > > > anyone intentionally builds a UP kernel with modules > > > > > they are getting SMP support in the modules and I am > > > > > not sure they would want that. I know I don't. > > > > > > > > > > > > > > > > > On UP systems, these additional opcodes are harmless. They take a few > > > extra > > > > cycles (since they lock an uncontested bus) and add a couple extra > memory > > > > barriers (which will be NOPs). On MP systems, atomics now work by > > > default. > > > > Had we not defaulted like this, all modules built outside of a kernel > > > build > > > > env would have broken atomics. Given that (a) the overwhelming > majority > > > > (99% or more) is SMP and (b) the MP code merely adds a few cycles to > > > what's > > > > already a not-too-expensive operation, this was the right choice. > > > > > > > > It simply doesn't matter for systems that are relevant to the project > > > > today. While one could try to optimize this a little (for example, by > > > > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP > to > > > if > > > > (defined(SMP) && SMP != 0)), it's likely not going to matter enough > for > > > > anybody to make the effort. UP on x86 is simply not relevant enough > to > > > > optimize for it. Even in VMs, people run SMP kernels typically even > when > > > > they just allocate one CPU to the VM. > > > > > > > > So while we still support the UP config, and we'll let people build > > > > optimized kernels for x86, we've flipped the switch from pessimized > for > > > SMP > > > > modules to pessimized for UP modules, which seems like quite the > > > reasonable > > > > trade-off. > > > > > > > > Were it practical to do so, I'd suggest de-orbiting UP on x86. > However, > > > > it's a lot of work for not much benefit and we'd need to invent much > > > crazy > > > > to get there. > > > > > > Trivial to fix this with > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || > > > !defined(KLD_UP_MODULES) > > > > > > Nope. Not so trivial. Who defines KLD_UP_MODULES? > > Call it SMP_KLD_MODULES, and it gets defined the same place SMP does. > Not so simple. SMP is defined in the config file, and winds up in one of the option files. It will be absent for stand alone builds, though. These change tweak the default yo be inlined and to include the sequence that works everywhere. > > > And really, it's absolutely not worth it unless someone shows up with > > numbers to show the old 'function call to optimal routine' is actually > > faster than the new 'inline to slightly unoptimal code'. Since I think > the > > function call overhead is larger than the pessmizations, I'm not sure > what > > the fuss is about. > > I have no issues with the SMP converting from function calls to > inline locks, I just want to retain the exact same code I had > before any of these changes, and that was A UP built system > without any SMP locking. Is it too much to ask to keep what > already worked? > This doesn't enable or disable locks in the muted sense. It just changes the atomic ops for the kernel from a function call to an inlined function. The inlining is more efficient than the call, even with the overhead added by always inlining the same stuff. It still is faster than before. And userland has done this forever... So I honestly think even UP builds are better off, even if it's not hyper optimized for UP. The lock instruction prefix is minimal overhead (a cycle I think). This is different than the mutexes we optimize for the UP cases (and which aren't affected by this change). It's really not a big deal. Warner > > > > > > > > > Modified: > > > > > > head/sys/amd64/include/atomic.h > > > > > > head/sys/i386/include/atomic.h > > > > > > > > > > > > Modified: head/sys/amd64/include/atomic.h > > > > > > ============================================================ > > > > > ================== > > > > > > --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 > > > > > (r336024) > > > > > > +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 > > > > > (r336025) > > > > > > @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE( > > > volatile > > > > > u_##TYPE *p, u_ > > > > > > * For userland, always use lock prefixes so that the binaries > will > > > run > > > > > > * on both SMP and !SMP systems. > > > > > > */ > > > > > > -#if defined(SMP) || !defined(_KERNEL) > > > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > > > > #define MPLOCKED "lock ; " > > > > > > #else > > > > > > #define MPLOCKED > > > > > > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, > > > u_int > > > > > v) > > > > > > */ > > > > > > #define OFFSETOF_MONITORBUF 0x100 > > > > > > > > > > > > -#if defined(SMP) > > > > > > +#if defined(SMP) || defined(KLD_MODULE) > > > > > > static __inline void > > > > > > __storeload_barrier(void) > > > > > > { > > > > > > > > > > > > Modified: head/sys/i386/include/atomic.h > > > > > > ============================================================ > > > > > ================== > > > > > > --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 > > > > > (r336024) > > > > > > +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 > > > > > (r336025) > > > > > > @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile > > > > > uint64_t *, uint64_t > > > > > > * For userland, always use lock prefixes so that the binaries > will > > > run > > > > > > * on both SMP and !SMP systems. > > > > > > */ > > > > > > -#if defined(SMP) || !defined(_KERNEL) > > > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > > > > #define MPLOCKED "lock ; " > > > > > > #else > > > > > > #define MPLOCKED > > > > > > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, > > > u_int v) > > > > > > */ > > > > > > > > > > > > #if defined(_KERNEL) > > > > > > -#if defined(SMP) > > > > > > +#if defined(SMP) || defined(KLD_MODULE) > > > > > > #define __storeload_barrier() __mbk() > > > > > > #else /* _KERNEL && UP */ > > > > > > #define __storeload_barrier() __compiler_membar() > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Rod Grimes > > > > > rgrimes@freebsd.org > > > > > > > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Fri Jul 6 18:09:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C92010417BB; Fri, 6 Jul 2018 18:09: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 960018F34D; Fri, 6 Jul 2018 18:09: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 w66I9Rbj053597; Fri, 6 Jul 2018 11:09:27 -0700 (PDT) (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 w66I9RVR053596; Fri, 6 Jul 2018 11:09:27 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807061809.w66I9RVR053596@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: To: Warner Losh Date: Fri, 6 Jul 2018 11:09:27 -0700 (PDT) CC: "Rodney W. Grimes" , Hans Petter Selasky , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 18:09:31 -0000 > On Fri, Jul 6, 2018, 12:27 PM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > On Fri, Jul 6, 2018 at 9:52 AM, Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > > > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > Author: hselasky > > > > > > > Date: Fri Jul 6 10:13:42 2018 > > > > > > > New Revision: 336025 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > > > > > > > > > > > Log: > > > > > > > Make sure kernel modules built by default are portable between > > UP > > > > and > > > > > > > SMP systems by extending defined(SMP) to include > > > > defined(KLD_MODULE). > > > > > > > > > > > > > > This is a regression issue after r335873 . > > > > > > > > > > > > > > Discussed with: mmacy@ > > > > > > > Sponsored by: Mellanox Technologies > > > > > > > > > > > > Though this fixes the issue, it also means that now when > > > > > > anyone intentionally builds a UP kernel with modules > > > > > > they are getting SMP support in the modules and I am > > > > > > not sure they would want that. I know I don't. > > > > > > > > > > > > > > > > > > > > > On UP systems, these additional opcodes are harmless. They take a few > > > > extra > > > > > cycles (since they lock an uncontested bus) and add a couple extra > > memory > > > > > barriers (which will be NOPs). On MP systems, atomics now work by > > > > default. > > > > > Had we not defaulted like this, all modules built outside of a kernel > > > > build > > > > > env would have broken atomics. Given that (a) the overwhelming > > majority > > > > > (99% or more) is SMP and (b) the MP code merely adds a few cycles to > > > > what's > > > > > already a not-too-expensive operation, this was the right choice. > > > > > > > > > > It simply doesn't matter for systems that are relevant to the project > > > > > today. While one could try to optimize this a little (for example, by > > > > > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP > > to > > > > if > > > > > (defined(SMP) && SMP != 0)), it's likely not going to matter enough > > for > > > > > anybody to make the effort. UP on x86 is simply not relevant enough > > to > > > > > optimize for it. Even in VMs, people run SMP kernels typically even > > when > > > > > they just allocate one CPU to the VM. > > > > > > > > > > So while we still support the UP config, and we'll let people build > > > > > optimized kernels for x86, we've flipped the switch from pessimized > > for > > > > SMP > > > > > modules to pessimized for UP modules, which seems like quite the > > > > reasonable > > > > > trade-off. > > > > > > > > > > Were it practical to do so, I'd suggest de-orbiting UP on x86. > > However, > > > > > it's a lot of work for not much benefit and we'd need to invent much > > > > crazy > > > > > to get there. > > > > > > > > Trivial to fix this with > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || > > > > !defined(KLD_UP_MODULES) > > > > > > > > > Nope. Not so trivial. Who defines KLD_UP_MODULES? > > > > Call it SMP_KLD_MODULES, and it gets defined the same place SMP does. > > > > Not so simple. SMP is defined in the config file, and winds up in one of No problem, that is where I would be defining this anyway, or in the latest case removing it and SMP for my UP kernel build. > the option files. It will be absent for stand alone builds, I am ok with that. And it would be reasonable to default to SMP. > though. These > change tweak the default yo be inlined and to include the sequence that > works everywhere. > > > > > > And really, it's absolutely not worth it unless someone shows up with > > > numbers to show the old 'function call to optimal routine' is actually > > > faster than the new 'inline to slightly unoptimal code'. Since I think > > the > > > function call overhead is larger than the pessmizations, I'm not sure > > what > > > the fuss is about. > > > > I have no issues with the SMP converting from function calls to > > inline locks, I just want to retain the exact same code I had > > before any of these changes, and that was A UP built system > > without any SMP locking. Is it too much to ask to keep what > > already worked? > > > > This doesn't enable or disable locks in the muted sense. It just changes > the atomic ops for the kernel from a function call to an inlined function. > The inlining is more efficient than the call, even with the overhead added > by always inlining the same stuff. It still is faster than before. > > And userland has done this forever... > > So I honestly think even UP builds are better off, even if it's not hyper > optimized for UP. The lock instruction prefix is minimal overhead (a cycle > I think). I do not believe, and Bruce seems to have evidence, that LOCK is not a one cycle cost. And in my head I know that it can not be that simple as it causes lots of very special things to happen in the pipeline to ensure you are locked. > This is different than the mutexes we optimize for the UP cases > (and which aren't affected by this change). It's really not a big deal. CPU's are not getting any faster, cycles are cycles, and I think we should at least investigate further before we just start making assumptions about the lock prefix being a 1 cycle cheap thing to do. > > > > > > > > > > > > Modified: > > > > > > > head/sys/amd64/include/atomic.h > > > > > > > head/sys/i386/include/atomic.h > > > > > > > > > > > > > > Modified: head/sys/amd64/include/atomic.h > > > > > > > ============================================================ > > > > > > ================== > > > > > > > --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 > > > > > > (r336024) > > > > > > > +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 > > > > > > (r336025) > > > > > > > @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE( > > > > volatile > > > > > > u_##TYPE *p, u_ > > > > > > > * For userland, always use lock prefixes so that the binaries > > will > > > > run > > > > > > > * on both SMP and !SMP systems. > > > > > > > */ > > > > > > > -#if defined(SMP) || !defined(_KERNEL) > > > > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > > > > > #define MPLOCKED "lock ; " > > > > > > > #else > > > > > > > #define MPLOCKED > > > > > > > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, > > > > u_int > > > > > > v) > > > > > > > */ > > > > > > > #define OFFSETOF_MONITORBUF 0x100 > > > > > > > > > > > > > > -#if defined(SMP) > > > > > > > +#if defined(SMP) || defined(KLD_MODULE) > > > > > > > static __inline void > > > > > > > __storeload_barrier(void) > > > > > > > { > > > > > > > > > > > > > > Modified: head/sys/i386/include/atomic.h > > > > > > > ============================================================ > > > > > > ================== > > > > > > > --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 > > > > > > (r336024) > > > > > > > +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 > > > > > > (r336025) > > > > > > > @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile > > > > > > uint64_t *, uint64_t > > > > > > > * For userland, always use lock prefixes so that the binaries > > will > > > > run > > > > > > > * on both SMP and !SMP systems. > > > > > > > */ > > > > > > > -#if defined(SMP) || !defined(_KERNEL) > > > > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > > > > > > #define MPLOCKED "lock ; " > > > > > > > #else > > > > > > > #define MPLOCKED > > > > > > > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, > > > > u_int v) > > > > > > > */ > > > > > > > > > > > > > > #if defined(_KERNEL) > > > > > > > -#if defined(SMP) > > > > > > > +#if defined(SMP) || defined(KLD_MODULE) > > > > > > > #define __storeload_barrier() __mbk() > > > > > > > #else /* _KERNEL && UP */ > > > > > > > #define __storeload_barrier() __compiler_membar() > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Rod Grimes > > > > > > rgrimes@freebsd.org > > > > > > > > > > > > > > > > > > > > -- > > > > Rod Grimes > > > > rgrimes@freebsd.org > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jul 6 18:50:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683071044CDC; Fri, 6 Jul 2018 18:50:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD1090A62; Fri, 6 Jul 2018 18:50:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBE3E4A04; Fri, 6 Jul 2018 18:50:22 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66IoMPM049467; Fri, 6 Jul 2018 18:50:22 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66IoMaQ049466; Fri, 6 Jul 2018 18:50:22 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201807061850.w66IoMaQ049466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Fri, 6 Jul 2018 18:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336038 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 336038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 18:50:23 -0000 Author: jamie Date: Fri Jul 6 18:50:22 2018 New Revision: 336038 URL: https://svnweb.freebsd.org/changeset/base/336038 Log: Change prison_add_vfs() to the more generic prison_add_allow(), which can add any dynamic allow.* or allow.*.* parameter. Also keep prison_add_vfs() as a wrapper. Differential Revision: D16146 Modified: head/sys/kern/kern_jail.c head/sys/sys/jail.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Jul 6 17:39:48 2018 (r336037) +++ head/sys/kern/kern_jail.c Fri Jul 6 18:50:22 2018 (r336038) @@ -3760,37 +3760,43 @@ SYSCTL_JAIL_PARAM(_allow_mount, , CTLTYPE_INT | CTLFLA "B", "Jail may mount/unmount jail-friendly file systems in general"); /* - * The VFS system will register jail-aware filesystems here. They each get - * a parameter allow.mount.xxxfs and a flag to check when a jailed user - * attempts to mount. + * Add a dynamic parameter allow., or allow... Return + * its associated bit in the pr_allow bitmask, or zero if the parameter was + * not created. */ -void -prison_add_vfs(struct vfsconf *vfsp) +unsigned +prison_add_allow(const char *prefix, const char *name, const char *prefix_descr, + const char *descr) { - char *allow_name, *allow_noname, *mount_allowed; struct bool_flags *bf; + struct sysctl_oid *parent; + char *allow_name, *allow_noname, *allowed; #ifndef NO_SYSCTL_DESCR - char *descr; + char *descr_deprecated; #endif unsigned allow_flag; - if (asprintf(&allow_name, M_PRISON, "allow.mount.%s", vfsp->vfc_name) < - 0 || asprintf(&allow_noname, M_PRISON, "allow.mount.no%s", - vfsp->vfc_name) < 0) { + if (prefix + ? asprintf(&allow_name, M_PRISON, "allow.%s.%s", prefix, name) + < 0 || + asprintf(&allow_noname, M_PRISON, "allow.%s.no%s", prefix, name) + < 0 + : asprintf(&allow_name, M_PRISON, "allow.%s", name) < 0 || + asprintf(&allow_noname, M_PRISON, "allow.no%s", name) < 0) { free(allow_name, M_PRISON); - return; + return 0; } /* - * See if this parameter has already beed added, i.e. if the filesystem - * was previously loaded/unloaded. + * See if this parameter has already beed added, i.e. a module was + * previously loaded/unloaded. */ mtx_lock(&prison0.pr_mtx); for (bf = pr_flag_allow; bf < pr_flag_allow + nitems(pr_flag_allow) && bf->flag != 0; bf++) { if (strcmp(bf->name, allow_name) == 0) { - vfsp->vfc_prison_flag = bf->flag; + allow_flag = bf->flag; goto no_add; } } @@ -3798,7 +3804,7 @@ prison_add_vfs(struct vfsconf *vfsp) /* * Find a free bit in prison0's pr_allow, failing if there are none * (which shouldn't happen as long as we keep track of how many - * filesystems are jail-aware). + * potential dynamic flags exist). */ for (allow_flag = 1;; allow_flag <<= 1) { if (allow_flag == 0) @@ -3815,52 +3821,73 @@ prison_add_vfs(struct vfsconf *vfsp) for (bf = pr_flag_allow; bf->flag != 0; bf++) if (bf == pr_flag_allow + nitems(pr_flag_allow)) { /* This should never happen, but is not fatal. */ + allow_flag = 0; goto no_add; } prison0.pr_allow |= allow_flag; bf->name = allow_name; bf->noname = allow_noname; bf->flag = allow_flag; - vfsp->vfc_prison_flag = allow_flag; mtx_unlock(&prison0.pr_mtx); /* * Create sysctls for the paramter, and the back-compat global * permission. */ -#ifndef NO_SYSCTL_DESCR - (void)asprintf(&descr, M_TEMP, "Jail may mount the %s file system", - vfsp->vfc_name); -#endif - (void)SYSCTL_ADD_PROC(NULL, - SYSCTL_CHILDREN(&sysctl___security_jail_param_allow_mount), - OID_AUTO, vfsp->vfc_name, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + parent = prefix + ? SYSCTL_ADD_NODE(NULL, + SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), + OID_AUTO, prefix, 0, 0, prefix_descr) + : &sysctl___security_jail_param_allow; + (void)SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(parent), OID_AUTO, + name, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_param, "B", descr); + if ((prefix + ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) + : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { #ifndef NO_SYSCTL_DESCR - free(descr, M_TEMP); + (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", + descr); #endif - if (asprintf(&mount_allowed, M_TEMP, "mount_%s_allowed", - vfsp->vfc_name) >= 0) { -#ifndef NO_SYSCTL_DESCR - (void)asprintf(&descr, M_TEMP, - "Processes in jail can mount the %s file system (deprecated)", - vfsp->vfc_name); -#endif (void)SYSCTL_ADD_PROC(NULL, - SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, - mount_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, - NULL, allow_flag, sysctl_jail_default_allow, "I", descr); + SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, + sysctl_jail_default_allow, "I", descr_deprecated); #ifndef NO_SYSCTL_DESCR - free(descr, M_TEMP); + free(descr_deprecated, M_TEMP); #endif - free(mount_allowed, M_TEMP); + free(allowed, M_TEMP); } - return; + return allow_flag; no_add: mtx_unlock(&prison0.pr_mtx); free(allow_name, M_PRISON); free(allow_noname, M_PRISON); + return allow_flag; +} + +/* + * The VFS system will register jail-aware filesystems here. They each get + * a parameter allow.mount.xxxfs and a flag to check when a jailed user + * attempts to mount. + */ +void +prison_add_vfs(struct vfsconf *vfsp) +{ +#ifdef NO_SYSCTL_DESCR + + vfsp->vfc_prison_flag = prison_add_allow("mount", vfsp->vfc_name, + NULL, NULL); +#else + char *descr; + + (void)asprintf(&descr, M_TEMP, "Jail may mount the %s file system", + vfsp->vfc_name); + vfsp->vfc_prison_flag = prison_add_allow("mount", vfsp->vfc_name, + NULL, descr); + free(descr, M_TEMP); +#endif } #ifdef RACCT Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Fri Jul 6 17:39:48 2018 (r336037) +++ head/sys/sys/jail.h Fri Jul 6 18:50:22 2018 (r336038) @@ -409,6 +409,8 @@ int prison_if(struct ucred *cred, struct sockaddr *sa) char *prison_name(struct prison *, struct prison *); int prison_priv_check(struct ucred *cred, int priv); int sysctl_jail_param(SYSCTL_HANDLER_ARGS); +unsigned prison_add_allow(const char *prefix, const char *name, + const char *prefix_descr, const char *descr); void prison_add_vfs(struct vfsconf *vfsp); void prison_racct_foreach(void (*callback)(struct racct *racct, void *arg2, void *arg3), void (*pre)(void), void (*post)(void), From owner-svn-src-head@freebsd.org Fri Jul 6 19:18:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9BC71016582; Fri, 6 Jul 2018 19:18:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B35F923A4; Fri, 6 Jul 2018 19:18:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77C0D4ED4; Fri, 6 Jul 2018 19:18:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66JIjtD065739; Fri, 6 Jul 2018 19:18:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66JIja8065738; Fri, 6 Jul 2018 19:18:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807061918.w66JIja8065738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 6 Jul 2018 19:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336041 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 336041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 19:18:46 -0000 Author: rmacklem Date: Fri Jul 6 19:18:45 2018 New Revision: 336041 URL: https://svnweb.freebsd.org/changeset/base/336041 Log: Change the pNFS server so that it does not disable a mirrored DS for an NFSERR_STALE error reported via a LayoutReturn. The current FreeBSD client can generate these errors for an operational DS while doing a recovery of a mirror after a mirrored DS has been repaired. I am not sure why these errors occur, but my best current guess is a race between the Layout Recall issued by the kernel code run from pnfsdscopymr(8) and a Read operation on the DS for the file bing copied. The errors are not fatal, since the client falls back on doing I/O through the MDS, which can do the I/O successfully as a proxy. (The fact that the MDS can do this indicates that the file does still exist on the functioning DS.) This change only affects the pNFS server and only when a client does a LayoutReturn with the NFSERR_STALE error report. Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Jul 6 19:10:11 2018 (r336040) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Jul 6 19:18:45 2018 (r336041) @@ -6750,9 +6750,10 @@ nfsrv_flexlayouterr(struct nfsrv_descript *nd, uint32_ NFSD_DEBUG(4, "flexlayouterr op=%d stat=%d\n", opnum, stat); /* - * Except for NFSERR_ACCES errors, disable the mirror. + * Except for NFSERR_ACCES and NFSERR_STALE errors, + * disable the mirror. */ - if (stat != NFSERR_ACCES) + if (stat != NFSERR_ACCES && stat != NFSERR_STALE) nfsrv_delds(devid, p); } } From owner-svn-src-head@freebsd.org Fri Jul 6 19:33:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F366102329D; Fri, 6 Jul 2018 19:33:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B517C92DC4; Fri, 6 Jul 2018 19:33:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 964825205; Fri, 6 Jul 2018 19:33:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66JXwl4075674; Fri, 6 Jul 2018 19:33:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66JXwOn075673; Fri, 6 Jul 2018 19:33:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201807061933.w66JXwOn075673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 6 Jul 2018 19:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336042 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 336042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 19:33:59 -0000 Author: np Date: Fri Jul 6 19:33:58 2018 New Revision: 336042 URL: https://svnweb.freebsd.org/changeset/base/336042 Log: cxgbe(4): Assume that any unknown flash on the card is 4MB and has 64KB sectors, instead of refusing to attach to the card. Submitted by: Casey Leedom @ Chelsio MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Jul 6 19:18:45 2018 (r336041) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Jul 6 19:33:58 2018 (r336042) @@ -7910,7 +7910,7 @@ int t4_get_flash_params(struct adapter *adapter) int ret; u32 flashid = 0; unsigned int part, manufacturer; - unsigned int density, size; + unsigned int density, size = 0; /* @@ -7949,7 +7949,7 @@ int t4_get_flash_params(struct adapter *adapter) */ manufacturer = flashid & 0xff; switch (manufacturer) { - case 0x20: { /* Micron/Numonix */ + case 0x20: /* Micron/Numonix */ /* * This Density -> Size decoding table is taken from Micron * Data Sheets. @@ -7965,17 +7965,10 @@ int t4_get_flash_params(struct adapter *adapter) case 0x20: size = 1 << 26; break; /* 64MB */ case 0x21: size = 1 << 27; break; /* 128MB */ case 0x22: size = 1 << 28; break; /* 256MB */ - - default: - CH_ERR(adapter, "Micron Flash Part has bad size, " - "ID = %#x, Density code = %#x\n", - flashid, density); - return -EINVAL; } break; - } - case 0x9d: { /* ISSI -- Integrated Silicon Solution, Inc. */ + case 0x9d: /* ISSI -- Integrated Silicon Solution, Inc. */ /* * This Density -> Size decoding table is taken from ISSI * Data Sheets. @@ -7984,17 +7977,10 @@ int t4_get_flash_params(struct adapter *adapter) switch (density) { case 0x16: size = 1 << 25; break; /* 32MB */ case 0x17: size = 1 << 26; break; /* 64MB */ - - default: - CH_ERR(adapter, "ISSI Flash Part has bad size, " - "ID = %#x, Density code = %#x\n", - flashid, density); - return -EINVAL; } break; - } - case 0xc2: { /* Macronix */ + case 0xc2: /* Macronix */ /* * This Density -> Size decoding table is taken from Macronix * Data Sheets. @@ -8003,17 +7989,10 @@ int t4_get_flash_params(struct adapter *adapter) switch (density) { case 0x17: size = 1 << 23; break; /* 8MB */ case 0x18: size = 1 << 24; break; /* 16MB */ - - default: - CH_ERR(adapter, "Macronix Flash Part has bad size, " - "ID = %#x, Density code = %#x\n", - flashid, density); - return -EINVAL; } break; - } - case 0xef: { /* Winbond */ + case 0xef: /* Winbond */ /* * This Density -> Size decoding table is taken from Winbond * Data Sheets. @@ -8022,19 +8001,19 @@ int t4_get_flash_params(struct adapter *adapter) switch (density) { case 0x17: size = 1 << 23; break; /* 8MB */ case 0x18: size = 1 << 24; break; /* 16MB */ - - default: - CH_ERR(adapter, "Winbond Flash Part has bad size, " - "ID = %#x, Density code = %#x\n", - flashid, density); - return -EINVAL; } break; } - default: - CH_ERR(adapter, "Unsupported Flash Part, ID = %#x\n", flashid); - return -EINVAL; + /* If we didn't recognize the FLASH part, that's no real issue: the + * Hardware/Software contract says that Hardware will _*ALWAYS*_ + * use a FLASH part which is at least 4MB in size and has 64KB + * sectors. The unrecognized FLASH part is likely to be much larger + * than 4MB, but that's all we really need. + */ + if (size == 0) { + CH_WARN(adapter, "Unknown Flash Part, ID = %#x, assuming 4MB\n", flashid); + size = 1 << 22; } /* From owner-svn-src-head@freebsd.org Fri Jul 6 19:44:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1068E1024500; Fri, 6 Jul 2018 19:44:50 +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 B978193481; Fri, 6 Jul 2018 19:44:49 +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 9A9B25397; Fri, 6 Jul 2018 19:44:49 +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 w66JinfO080911; Fri, 6 Jul 2018 19:44:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66JinlV080910; Fri, 6 Jul 2018 19:44:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201807061944.w66JinlV080910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 6 Jul 2018 19:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336043 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 336043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 19:44:50 -0000 Author: emaste Date: Fri Jul 6 19:44:49 2018 New Revision: 336043 URL: https://svnweb.freebsd.org/changeset/base/336043 Log: Fix arm64 linuxulator clone() argument order Linux/arm64 is CLONE_BACKWARDS - i.e., "Architecture has tls passed as the 4th argument of clone(2), not the 5th one." The linux clone() syscall has four different permutations of argument order, depending on architecture - see the #ifdef CONFIG_CLONE_BACKWARDS maze in Linux's kernel/fork.c. Sponsored by: Turing Robotic Industries Modified: head/sys/arm64/linux/syscalls.master Modified: head/sys/arm64/linux/syscalls.master ============================================================================== --- head/sys/arm64/linux/syscalls.master Fri Jul 6 19:33:58 2018 (r336042) +++ head/sys/arm64/linux/syscalls.master Fri Jul 6 19:44:49 2018 (r336043) @@ -403,8 +403,8 @@ 218 AUE_NULL STD { int linux_request_key(void); } 219 AUE_NULL STD { int linux_keyctl(void); } 220 AUE_RFORK STD { int linux_clone(l_int flags, void *stack, \ - void *parent_tidptr, void *child_tidptr, \ - void *tls); } + void *parent_tidptr, void *tls, \ + void *child_tidptr); } 221 AUE_EXECVE STD { int linux_execve(char *path, char **argp, \ char **envp); } 222 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ From owner-svn-src-head@freebsd.org Fri Jul 6 19:47:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C7EB10248F3; Fri, 6 Jul 2018 19:47:11 +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 9E19C93646; Fri, 6 Jul 2018 19:47:10 +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 7AF4B5398; Fri, 6 Jul 2018 19:47:10 +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 w66JlAKi081067; Fri, 6 Jul 2018 19:47:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66JlAeZ081064; Fri, 6 Jul 2018 19:47:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201807061947.w66JlAeZ081064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 6 Jul 2018 19:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336044 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 336044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 19:47:11 -0000 Author: emaste Date: Fri Jul 6 19:47:09 2018 New Revision: 336044 URL: https://svnweb.freebsd.org/changeset/base/336044 Log: Regen arm64 linux sysent after r336043 Modified: head/sys/arm64/linux/linux_proto.h head/sys/arm64/linux/linux_systrace_args.c Modified: head/sys/arm64/linux/linux_proto.h ============================================================================== --- head/sys/arm64/linux/linux_proto.h Fri Jul 6 19:44:49 2018 (r336043) +++ head/sys/arm64/linux/linux_proto.h Fri Jul 6 19:47:09 2018 (r336044) @@ -811,8 +811,8 @@ struct linux_clone_args { char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)]; char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)]; - char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)]; char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)]; + char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)]; }; struct linux_execve_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; Modified: head/sys/arm64/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm64/linux/linux_systrace_args.c Fri Jul 6 19:44:49 2018 (r336043) +++ head/sys/arm64/linux/linux_systrace_args.c Fri Jul 6 19:47:09 2018 (r336044) @@ -1658,8 +1658,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->flags; /* l_int */ uarg[1] = (intptr_t) p->stack; /* void * */ uarg[2] = (intptr_t) p->parent_tidptr; /* void * */ - uarg[3] = (intptr_t) p->child_tidptr; /* void * */ - uarg[4] = (intptr_t) p->tls; /* void * */ + uarg[3] = (intptr_t) p->tls; /* void * */ + uarg[4] = (intptr_t) p->child_tidptr; /* void * */ *n_args = 5; break; } From owner-svn-src-head@freebsd.org Fri Jul 6 19:48:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F5C1024C15; Fri, 6 Jul 2018 19:48:49 +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 EB53E93803; Fri, 6 Jul 2018 19:48:48 +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 CD41C5399; Fri, 6 Jul 2018 19:48:48 +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 w66JmmNq081177; Fri, 6 Jul 2018 19:48:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66Jmmw6081174; Fri, 6 Jul 2018 19:48:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807061948.w66Jmmw6081174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Jul 2018 19:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336045 - in head/sys: amd64/include i386/include sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include i386/include sys X-SVN-Commit-Revision: 336045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 19:48:49 -0000 Author: kib Date: Fri Jul 6 19:48:47 2018 New Revision: 336045 URL: https://svnweb.freebsd.org/changeset/base/336045 Log: Save a call to pmap_remove() if entry cannot have any pages mapped. Due to the way rtld creates mappings for the shared objects, each dso causes unmap of at least three guard map entries. For instance, in the buildworld load, this change reduces the amount of pmap_remove() calls by 1/5. Profiled by: alc Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16148 Modified: head/sys/amd64/include/counter.h head/sys/amd64/include/pcpu.h head/sys/i386/include/pcpu.h head/sys/sys/pcpu.h Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Fri Jul 6 19:47:09 2018 (r336044) +++ head/sys/amd64/include/counter.h Fri Jul 6 19:48:47 2018 (r336045) @@ -83,18 +83,11 @@ counter_u64_zero_inline(counter_u64_t c) static inline void counter_u64_add(counter_u64_t c, int64_t inc) { - int64_t *p; -#ifdef notyet + __asm __volatile("addq\t%1,%%gs:(%0)" : : "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc) : "memory", "cc"); -#endif - /* temporary */ - critical_enter(); - p = zpcpu_get(c); - *p += inc; - critical_exit(); } #endif /* ! __MACHINE_COUNTER_H__ */ Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Fri Jul 6 19:47:09 2018 (r336044) +++ head/sys/amd64/include/pcpu.h Fri Jul 6 19:48:47 2018 (r336045) @@ -76,8 +76,7 @@ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[216] /* be divisor of PAGE_SIZE \ - after cache alignment */ + char __pad[3288] /* pad to UMA_PCPU_ALLOC_SIZE */ #define PC_DBREG_CMD_NONE 0 #define PC_DBREG_CMD_LOAD 1 Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Fri Jul 6 19:47:09 2018 (r336044) +++ head/sys/i386/include/pcpu.h Fri Jul 6 19:48:47 2018 (r336045) @@ -80,7 +80,7 @@ caddr_t pc_pmap_eh_ptep; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[538] + char __pad[3610] #ifdef _KERNEL Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Fri Jul 6 19:47:09 2018 (r336044) +++ head/sys/sys/pcpu.h Fri Jul 6 19:48:47 2018 (r336045) @@ -185,14 +185,6 @@ struct pcpu { PCPU_MD_FIELDS; } __aligned(CACHE_LINE_SIZE); -#ifdef CTASSERT -/* - * To minimize memory waste in per-cpu UMA zones, size of struct pcpu - * should be denominator of PAGE_SIZE. - */ -CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE); -#endif - #ifdef _KERNEL STAILQ_HEAD(cpuhead, pcpu); @@ -208,6 +200,19 @@ extern struct pcpu *cpuid_to_pcpu[]; #define curvidata PCPU_GET(vidata) #define UMA_PCPU_ALLOC_SIZE PAGE_SIZE + +#ifdef CTASSERT +#if defined(__i386__) || defined(__amd64__) +/* Required for counters(9) to work on x86. */ +CTASSERT(sizeof(struct pcpu) == UMA_PCPU_ALLOC_SIZE); +#else +/* + * To minimize memory waste in per-cpu UMA zones, size of struct pcpu + * should be denominator of PAGE_SIZE. + */ +CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE); +#endif /* UMA_PCPU_ALLOC_SIZE && x86 */ +#endif /* CTASSERT */ /* Accessor to elements allocated via UMA_ZONE_PCPU zone. */ static inline void * From owner-svn-src-head@freebsd.org Fri Jul 6 19:50:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE2161024ED7; Fri, 6 Jul 2018 19:50:26 +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 A170F939BC; Fri, 6 Jul 2018 19:50:26 +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 81F83539D; Fri, 6 Jul 2018 19:50:26 +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 w66JoQ0Z081331; Fri, 6 Jul 2018 19:50:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66JoP2F081328; Fri, 6 Jul 2018 19:50:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807061950.w66JoP2F081328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Jul 2018 19:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336046 - in head/sys: amd64/include i386/include sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include i386/include sys X-SVN-Commit-Revision: 336046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 19:50:27 -0000 Author: kib Date: Fri Jul 6 19:50:25 2018 New Revision: 336046 URL: https://svnweb.freebsd.org/changeset/base/336046 Log: Revert to recommit with the proper message. Modified: head/sys/amd64/include/counter.h head/sys/amd64/include/pcpu.h head/sys/i386/include/pcpu.h head/sys/sys/pcpu.h Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Fri Jul 6 19:48:47 2018 (r336045) +++ head/sys/amd64/include/counter.h Fri Jul 6 19:50:25 2018 (r336046) @@ -83,11 +83,18 @@ counter_u64_zero_inline(counter_u64_t c) static inline void counter_u64_add(counter_u64_t c, int64_t inc) { - + int64_t *p; +#ifdef notyet __asm __volatile("addq\t%1,%%gs:(%0)" : : "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc) : "memory", "cc"); +#endif + /* temporary */ + critical_enter(); + p = zpcpu_get(c); + *p += inc; + critical_exit(); } #endif /* ! __MACHINE_COUNTER_H__ */ Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Fri Jul 6 19:48:47 2018 (r336045) +++ head/sys/amd64/include/pcpu.h Fri Jul 6 19:50:25 2018 (r336046) @@ -76,7 +76,8 @@ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[3288] /* pad to UMA_PCPU_ALLOC_SIZE */ + char __pad[216] /* be divisor of PAGE_SIZE \ + after cache alignment */ #define PC_DBREG_CMD_NONE 0 #define PC_DBREG_CMD_LOAD 1 Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Fri Jul 6 19:48:47 2018 (r336045) +++ head/sys/i386/include/pcpu.h Fri Jul 6 19:50:25 2018 (r336046) @@ -80,7 +80,7 @@ caddr_t pc_pmap_eh_ptep; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[3610] + char __pad[538] #ifdef _KERNEL Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Fri Jul 6 19:48:47 2018 (r336045) +++ head/sys/sys/pcpu.h Fri Jul 6 19:50:25 2018 (r336046) @@ -185,6 +185,14 @@ struct pcpu { PCPU_MD_FIELDS; } __aligned(CACHE_LINE_SIZE); +#ifdef CTASSERT +/* + * To minimize memory waste in per-cpu UMA zones, size of struct pcpu + * should be denominator of PAGE_SIZE. + */ +CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE); +#endif + #ifdef _KERNEL STAILQ_HEAD(cpuhead, pcpu); @@ -200,19 +208,6 @@ extern struct pcpu *cpuid_to_pcpu[]; #define curvidata PCPU_GET(vidata) #define UMA_PCPU_ALLOC_SIZE PAGE_SIZE - -#ifdef CTASSERT -#if defined(__i386__) || defined(__amd64__) -/* Required for counters(9) to work on x86. */ -CTASSERT(sizeof(struct pcpu) == UMA_PCPU_ALLOC_SIZE); -#else -/* - * To minimize memory waste in per-cpu UMA zones, size of struct pcpu - * should be denominator of PAGE_SIZE. - */ -CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE); -#endif /* UMA_PCPU_ALLOC_SIZE && x86 */ -#endif /* CTASSERT */ /* Accessor to elements allocated via UMA_ZONE_PCPU zone. */ static inline void * From owner-svn-src-head@freebsd.org Fri Jul 6 19:50:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 026881024F6A; Fri, 6 Jul 2018 19:50:46 +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 A45C093B08; Fri, 6 Jul 2018 19:50:45 +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 86E9453AE; Fri, 6 Jul 2018 19:50:45 +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 w66Jojmt081397; Fri, 6 Jul 2018 19:50:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66Joibw081390; Fri, 6 Jul 2018 19:50:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807061950.w66Joibw081390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Jul 2018 19:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336047 - in head/sys: amd64/include i386/include sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include i386/include sys X-SVN-Commit-Revision: 336047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 19:50:46 -0000 Author: kib Date: Fri Jul 6 19:50:44 2018 New Revision: 336047 URL: https://svnweb.freebsd.org/changeset/base/336047 Log: Expand x86 struct pcpus to UMA_PCPU_ALLOC_SIZE AKA PAGE_SIZE. This restores counters(9) operation. Revert r336024. Improve assert of pcpu size on x86. Reviewed by: mmacy Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D16163 Modified: head/sys/amd64/include/counter.h head/sys/amd64/include/pcpu.h head/sys/i386/include/pcpu.h head/sys/sys/pcpu.h Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Fri Jul 6 19:50:25 2018 (r336046) +++ head/sys/amd64/include/counter.h Fri Jul 6 19:50:44 2018 (r336047) @@ -83,18 +83,11 @@ counter_u64_zero_inline(counter_u64_t c) static inline void counter_u64_add(counter_u64_t c, int64_t inc) { - int64_t *p; -#ifdef notyet + __asm __volatile("addq\t%1,%%gs:(%0)" : : "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc) : "memory", "cc"); -#endif - /* temporary */ - critical_enter(); - p = zpcpu_get(c); - *p += inc; - critical_exit(); } #endif /* ! __MACHINE_COUNTER_H__ */ Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Fri Jul 6 19:50:25 2018 (r336046) +++ head/sys/amd64/include/pcpu.h Fri Jul 6 19:50:44 2018 (r336047) @@ -76,8 +76,7 @@ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[216] /* be divisor of PAGE_SIZE \ - after cache alignment */ + char __pad[3288] /* pad to UMA_PCPU_ALLOC_SIZE */ #define PC_DBREG_CMD_NONE 0 #define PC_DBREG_CMD_LOAD 1 Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Fri Jul 6 19:50:25 2018 (r336046) +++ head/sys/i386/include/pcpu.h Fri Jul 6 19:50:44 2018 (r336047) @@ -80,7 +80,7 @@ caddr_t pc_pmap_eh_ptep; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[538] + char __pad[3610] #ifdef _KERNEL Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Fri Jul 6 19:50:25 2018 (r336046) +++ head/sys/sys/pcpu.h Fri Jul 6 19:50:44 2018 (r336047) @@ -185,14 +185,6 @@ struct pcpu { PCPU_MD_FIELDS; } __aligned(CACHE_LINE_SIZE); -#ifdef CTASSERT -/* - * To minimize memory waste in per-cpu UMA zones, size of struct pcpu - * should be denominator of PAGE_SIZE. - */ -CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE); -#endif - #ifdef _KERNEL STAILQ_HEAD(cpuhead, pcpu); @@ -208,6 +200,19 @@ extern struct pcpu *cpuid_to_pcpu[]; #define curvidata PCPU_GET(vidata) #define UMA_PCPU_ALLOC_SIZE PAGE_SIZE + +#ifdef CTASSERT +#if defined(__i386__) || defined(__amd64__) +/* Required for counters(9) to work on x86. */ +CTASSERT(sizeof(struct pcpu) == UMA_PCPU_ALLOC_SIZE); +#else +/* + * To minimize memory waste in per-cpu UMA zones, size of struct pcpu + * should be denominator of PAGE_SIZE. + */ +CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE); +#endif /* UMA_PCPU_ALLOC_SIZE && x86 */ +#endif /* CTASSERT */ /* Accessor to elements allocated via UMA_ZONE_PCPU zone. */ static inline void * From owner-svn-src-head@freebsd.org Fri Jul 6 19:52:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F0D10254D6; Fri, 6 Jul 2018 19:52:45 +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 E5B5293F6B; Fri, 6 Jul 2018 19:52:44 +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 w66JqbZK064393 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 6 Jul 2018 22:52:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w66JqbZK064393 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w66Jqb4A064392; Fri, 6 Jul 2018 22:52:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 6 Jul 2018 22:52:37 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336046 - in head/sys: amd64/include i386/include sys Message-ID: <20180706195237.GS5562@kib.kiev.ua> References: <201807061950.w66JoP2F081328@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807061950.w66JoP2F081328@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 19:52:45 -0000 On Fri, Jul 06, 2018 at 07:50:25PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Jul 6 19:50:25 2018 > New Revision: 336046 > URL: https://svnweb.freebsd.org/changeset/base/336046 > > Log: > Revert to recommit with the proper message. I am sorry for the second mistake of the same sort in the day. From owner-svn-src-head@freebsd.org Fri Jul 6 20:51:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24F51102B9CD; Fri, 6 Jul 2018 20:51:44 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay106.isp.belgacom.be (mailrelay106.isp.belgacom.be [195.238.20.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37039967BD; Fri, 6 Jul 2018 20:51:43 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AVwPWWh1aCmICjfDnsmDT+DRfVm0co7zxezQtwd?= =?us-ascii?q?8ZsesWLPXxwZ3uMQTl6Ol3ixeRBMOHs6wC07KempujcFRI2YyGvnEGfc4EfD?= =?us-ascii?q?4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFA?= =?us-ascii?q?nhOgppPOT1HZPZg9iq2+yo9JDffwRFiCChbb9uMR67sRjfus4KjIV4N60/0A?= =?us-ascii?q?HJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L2?= =?us-ascii?q?81/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QKsqUj?= =?us-ascii?q?q+8ahkVB7oiD8GNzEn9mHXltdwh79frB64uhBz35LYbISTOfFjfK3SYMkaSH?= =?us-ascii?q?JPUMhRSSJPH4CyYIkBD+UOIelWoJLwp0cMoBeiGQWgGP/jxiFOi3Tr3aM6ye?= =?us-ascii?q?MhEQTe0QI+GtAOtGnfocvyNKcVSuC60qzIwi/Fb/NNxDzw75TIchEjofGIRr?= =?us-ascii?q?9+cdDRxlcxGA7Yk1uep5bpPzSP1uQCqmWW6fdrW+yoi24isQ5xoz6vy98iio?= =?us-ascii?q?nTmI0a1EvL9T5kz4ovIt24UkF7bNi5G5VTryGXL4h7T8E4T2xpuSs20KAKtJ?= =?us-ascii?q?2mcCQQ1Zgqxh3SZvqaeIaS+B3jTvyeITJgiXJgf7Kwmgi9/FC7yu35Ssm0yF?= =?us-ascii?q?FKrjdZktXUtnACyRjT6s+fR/t+5Eih3TeP1wXN5eFeJkA4j7bbK58jwr40jJ?= =?us-ascii?q?YcrUPDHijtmEroia+ZbEMk+vOy5+TgeLXmqYeQN45yig7gLqQjgs+yDOYiPg?= =?us-ascii?q?UPXmWX4/mw2b7+8UHjXblHj/47nrHcsJ/AJMQboqC5AxVS0oYm8xu/Ezam0N?= =?us-ascii?q?YcnXQcIlJFYgyIgJbyNFHVPf/0F/C/g06jkDtz3fDJIqXhAonRLnjEiLrhZq?= =?us-ascii?q?h960hFxAoo19BQ+4tYCrEfL/3pR0D8r9LYDgUnPAOq2OnnE8hy2pkZWWKVDa?= =?us-ascii?q?+TKLnSvkOQ5uIzP+mMY5cYuC3jK/gj/vLulmU5lkMEcaaz2ZsXbGu1Hvp8I0?= =?us-ascii?q?qHf3XjmcwBHnoQsgo5Vuzqh0WIUSRPaHaqQ6I8+jY7BZq9DYfZWo+hmaCO3C?= =?us-ascii?q?C+Hp1TZ2BGFkyMHmnyd4WfQPoMZjiSLdF/nTMfTriuVpUt1Ra0tA/107BnNP?= =?us-ascii?q?bb+jUEtZL/09h4//fTlR4o9Tx1CsSSzXqNQnp6nmMSWTA5wrtwoVdgxVuZ1q?= =?us-ascii?q?h4mfNYH8RJ5/xVSgc6KYLcz+tiBtDyQQLOYNOJR0y9QtWlATA8Vdwxw8UQbE?= =?us-ascii?q?ljANqilQ3M0zCtA78PmLzYTKAzp+jm2HT3Ktc19DCO+7MgilQ9CIMbO3eri6?= =?us-ascii?q?Rk+yDLC56PiUXfvID6KOIQ2jXI+33Fy2eS6hJ2Sgl1BJkiWTg0YUzNoNHw4F?= =?us-ascii?q?iKG6OvC7APHBFMxOS5Bu1NcNK/3gYOf+vqJNmLOzH5oGy3Hxvdg+rUNIc=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2DGCQCR1T9b/6i1QldUCB0BAQUBCwG?= =?us-ascii?q?DSVQOfyiMXYtVAQGCBjEBQ5Y3LoRJAoIsIjcVAQIBAQIBAQIBbBwMgjUkAYJ?= =?us-ascii?q?dAQU6HCMQCxQECSUPKh4GE4MhggMLq32IJCaBNQWIXoIkgQ+CWjWEVYV7Ao0?= =?us-ascii?q?OjEEJhgiJEY1kijWJLSKBUk0wCIMkixSFQD0wAQGPEwEB?= X-IPAS-Result: =?us-ascii?q?A2DGCQCR1T9b/6i1QldUCB0BAQUBCwGDSVQOfyiMXYtVA?= =?us-ascii?q?QGCBjEBQ5Y3LoRJAoIsIjcVAQIBAQIBAQIBbBwMgjUkAYJdAQU6HCMQCxQEC?= =?us-ascii?q?SUPKh4GE4MhggMLq32IJCaBNQWIXoIkgQ+CWjWEVYV7Ao0OjEEJhgiJEY1ki?= =?us-ascii?q?jWJLSKBUk0wCIMkixSFQD0wAQGPEwEB?= Received: from 168.181-66-87.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([87.66.181.168]) by relay.skynet.be with ESMTP; 06 Jul 2018 22:50:31 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w66KoUvU051137; Fri, 6 Jul 2018 22:50:30 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Fri, 6 Jul 2018 22:50:30 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: "Rodney W. Grimes" Cc: rgrimes@freebsd.org, Warner Losh , Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include Message-ID: <20180706225030.2e689882@kalimero.tijl.coosemans.org> In-Reply-To: <201807061809.w66I9RVR053596@pdx.rh.CN85.dnsmgr.net> References: <201807061809.w66I9RVR053596@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 20:51:44 -0000 On Fri, 6 Jul 2018 11:09:27 -0700 (PDT) "Rodney W. Grimes" wrote: > > On Fri, Jul 6, 2018, 12:27 PM Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > On Fri, Jul 6, 2018 at 9:52 AM, Rodney W. Grimes < > > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > > > > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > > > Author: hselasky > > > > > > > > Date: Fri Jul 6 10:13:42 2018 > > > > > > > > New Revision: 336025 > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > > > > > > > > > > > > > Log: > > > > > > > > Make sure kernel modules built by default are portable between > > > UP > > > > > and > > > > > > > > SMP systems by extending defined(SMP) to include > > > > > defined(KLD_MODULE). > > > > > > > > > > > > > > > > This is a regression issue after r335873 . > > > > > > > > > > > > > > > > Discussed with: mmacy@ > > > > > > > > Sponsored by: Mellanox Technologies > > > > > > > > > > > > > > Though this fixes the issue, it also means that now when > > > > > > > anyone intentionally builds a UP kernel with modules > > > > > > > they are getting SMP support in the modules and I am > > > > > > > not sure they would want that. I know I don't. > > > > > > > > > > > > > > > > > > > > > > > > > On UP systems, these additional opcodes are harmless. They take a few > > > > > extra > > > > > > cycles (since they lock an uncontested bus) and add a couple extra > > > memory > > > > > > barriers (which will be NOPs). On MP systems, atomics now work by > > > > > default. > > > > > > Had we not defaulted like this, all modules built outside of a kernel > > > > > build > > > > > > env would have broken atomics. Given that (a) the overwhelming > > > majority > > > > > > (99% or more) is SMP and (b) the MP code merely adds a few cycles to > > > > > what's > > > > > > already a not-too-expensive operation, this was the right choice. > > > > > > > > > > > > It simply doesn't matter for systems that are relevant to the project > > > > > > today. While one could try to optimize this a little (for example, by > > > > > > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP > > > to > > > > > if > > > > > > (defined(SMP) && SMP != 0)), it's likely not going to matter enough > > > for > > > > > > anybody to make the effort. UP on x86 is simply not relevant enough > > > to > > > > > > optimize for it. Even in VMs, people run SMP kernels typically even > > > when > > > > > > they just allocate one CPU to the VM. > > > > > > > > > > > > So while we still support the UP config, and we'll let people build > > > > > > optimized kernels for x86, we've flipped the switch from pessimized > > > for > > > > > SMP > > > > > > modules to pessimized for UP modules, which seems like quite the > > > > > reasonable > > > > > > trade-off. > > > > > > > > > > > > Were it practical to do so, I'd suggest de-orbiting UP on x86. > > > However, > > > > > > it's a lot of work for not much benefit and we'd need to invent much > > > > > crazy > > > > > > to get there. > > > > > > > > > > Trivial to fix this with > > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || > > > > > !defined(KLD_UP_MODULES) > > > > > > > > > > > > Nope. Not so trivial. Who defines KLD_UP_MODULES? > > > > > > Call it SMP_KLD_MODULES, and it gets defined the same place SMP does. > > > > > > > Not so simple. SMP is defined in the config file, and winds up in one of > No problem, that is where I would be defining this anyway, or in the > latest case removing it and SMP for my UP kernel build. > > > the option files. It will be absent for stand alone builds, > I am ok with that. And it would be reasonable to default to SMP. > > > though. These > > change tweak the default yo be inlined and to include the sequence that > > works everywhere. > > > > > > > > > And really, it's absolutely not worth it unless someone shows up with > > > > numbers to show the old 'function call to optimal routine' is actually > > > > faster than the new 'inline to slightly unoptimal code'. Since I think > > > the > > > > function call overhead is larger than the pessmizations, I'm not sure > > > what > > > > the fuss is about. > > > > > > I have no issues with the SMP converting from function calls to > > > inline locks, I just want to retain the exact same code I had > > > before any of these changes, and that was A UP built system > > > without any SMP locking. Is it too much to ask to keep what > > > already worked? > > > > > > > This doesn't enable or disable locks in the muted sense. It just changes > > the atomic ops for the kernel from a function call to an inlined function. > > The inlining is more efficient than the call, even with the overhead added > > by always inlining the same stuff. It still is faster than before. > > > > And userland has done this forever... > > > > So I honestly think even UP builds are better off, even if it's not hyper > > optimized for UP. The lock instruction prefix is minimal overhead (a cycle > > I think). > > I do not believe, and Bruce seems to have evidence, that LOCK is not > a one cycle cost. And in my head I know that it can not be that > simple as it causes lots of very special things to happen in the > pipeline to ensure you are locked. > > > This is different than the mutexes we optimize for the UP cases > > (and which aren't affected by this change). It's really not a big deal. > > CPU's are not getting any faster, cycles are cycles, and I think we > should at least investigate further before we just start making > assumptions about the lock prefix being a 1 cycle cheap thing to > do. Just install opt_*.h headers already. It's not just about the SMP option. The nvidia-driver ports want to know if PAE is enabled on i386. From owner-svn-src-head@freebsd.org Fri Jul 6 20:54:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15D78102BDCF for ; Fri, 6 Jul 2018 20:54:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 952F896B67 for ; Fri, 6 Jul 2018 20:54:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id r24-v6so11968012ioh.9 for ; Fri, 06 Jul 2018 13:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kdAtoEF+HxHHP4WVrPozVCaC0wQoqTqxMLIQNT8HaO0=; b=EGqaVq0cjMtUzWhUzKdhQhqRbcOhjvdDV8ATYpiTl8Wsl3GZaT7bz4miV7R5ar5YsJ dZdF4VgwxhYYVJUNoA+UKpqo3CFhXWP4K6saI0uuvhVUFObTEOkbEqfUQJJAxabFG2m4 wWnkrMmkbijeKxuWHZrmzWu0X3NJD5kVCPYevLd79jvHY2DCPmP4haND440fXSBNpZYE L5knrKLABDcvtsulOiVFFFEo/ui/F62r47+JECD1NxPVzOaI18Qby85cJD7SNiMOYots fwIBXpzJQ7kuDWozVCr+lbPQaIRkN/ymaaIPoiBN11LXPOaFJRSlblApeekuIFTw9dEC 6Hrw== 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=kdAtoEF+HxHHP4WVrPozVCaC0wQoqTqxMLIQNT8HaO0=; b=PYXlxYxC27wlANw2c7K8De/D54PFYGLhnF+V1qEn05LTMT0a6B0+nkrHVbVGWNusnb sJk+NGly15DUxSKguU3MyXstlmA+Scj/guesf5zKDa4BFOsTzAFiIWXV5QamxXRE0mFf mWXx1gNXpCaVpdbQ4jh4C2ftKibgHjv0ZNLA3MmQ9hMVMGhNO73WuWD15Vopccwh3B7w ZfjlYSK34wXitScQlMjejbfwbwWi01xjC8i47z4FwPkgFB5mq6nSCvKB0EBHff8oTJDx Lts+Fus0ZK4E8QYbRLtx/Gmj0NPVdpSvdRNwrzmmvKZvzGIV1U26Eemj38jr7kzYSo4Z uAMg== X-Gm-Message-State: AOUpUlFBWQEqoTwm6fJt3MaOJUtkiPxtyo0azTsKgqZh/JaY5ZY3LFcH YqxvWmTSIQj0j1GhDByJ/gMeX0wLt0o2SAGDcaO5Hg== X-Google-Smtp-Source: AAOMgperaN0+USAvBdfQcbAfd8QDDBhj4Vcy0bQrglBe2EXA0mCtRFIu2kHMRq2/65ZmVkmYiK6ejV1a37LjBtqJO/Q= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr3133133ioa.168.1530910443828; Fri, 06 Jul 2018 13:54:03 -0700 (PDT) MIME-Version: 1.0 References: <201807061809.w66I9RVR053596@pdx.rh.CN85.dnsmgr.net> <20180706225030.2e689882@kalimero.tijl.coosemans.org> In-Reply-To: <20180706225030.2e689882@kalimero.tijl.coosemans.org> From: Warner Losh Date: Fri, 6 Jul 2018 14:53:51 -0600 Message-ID: Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: Tijl Coosemans Cc: "Rodney W. Grimes" , "Rodney W. Grimes" , Hans Petter Selasky , 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-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 20:54:05 -0000 On Fri, Jul 6, 2018, 3:50 PM T=C4=B3l Coosemans wrote: > On Fri, 6 Jul 2018 11:09:27 -0700 (PDT) "Rodney W. Grimes" < > freebsd@pdx.rh.CN85.dnsmgr.net> wrote: > > > On Fri, Jul 6, 2018, 12:27 PM Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > On Fri, Jul 6, 2018 at 9:52 AM, Rodney W. Grimes < > > > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > > > > > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > > > > > Author: hselasky > > > > > > > > > Date: Fri Jul 6 10:13:42 2018 > > > > > > > > > New Revision: 336025 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > Make sure kernel modules built by default are portable > between > > > > UP > > > > > > and > > > > > > > > > SMP systems by extending defined(SMP) to include > > > > > > defined(KLD_MODULE). > > > > > > > > > > > > > > > > > > This is a regression issue after r335873 . > > > > > > > > > > > > > > > > > > Discussed with: mmacy@ > > > > > > > > > Sponsored by: Mellanox Technologies > > > > > > > > > > > > > > > > Though this fixes the issue, it also means that now when > > > > > > > > anyone intentionally builds a UP kernel with modules > > > > > > > > they are getting SMP support in the modules and I am > > > > > > > > not sure they would want that. I know I don't. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On UP systems, these additional opcodes are harmless. They > take a few > > > > > > extra > > > > > > > cycles (since they lock an uncontested bus) and add a couple > extra > > > > memory > > > > > > > barriers (which will be NOPs). On MP systems, atomics now wor= k > by > > > > > > default. > > > > > > > Had we not defaulted like this, all modules built outside of = a > kernel > > > > > > build > > > > > > > env would have broken atomics. Given that (a) the > overwhelming > > > > majority > > > > > > > (99% or more) is SMP and (b) the MP code merely adds a few > cycles to > > > > > > what's > > > > > > > already a not-too-expensive operation, this was the right > choice. > > > > > > > > > > > > > > It simply doesn't matter for systems that are relevant to the > project > > > > > > > today. While one could try to optimize this a little (for > example, by > > > > > > > having SMP defined to be 0 or 1, say, and changing all the > ifdef SMP > > > > to > > > > > > if > > > > > > > (defined(SMP) && SMP !=3D 0)), it's likely not going to matte= r > enough > > > > for > > > > > > > anybody to make the effort. UP on x86 is simply not relevant > enough > > > > to > > > > > > > optimize for it. Even in VMs, people run SMP kernels typicall= y > even > > > > when > > > > > > > they just allocate one CPU to the VM. > > > > > > > > > > > > > > So while we still support the UP config, and we'll let people > build > > > > > > > optimized kernels for x86, we've flipped the switch from > pessimized > > > > for > > > > > > SMP > > > > > > > modules to pessimized for UP modules, which seems like quite > the > > > > > > reasonable > > > > > > > trade-off. > > > > > > > > > > > > > > Were it practical to do so, I'd suggest de-orbiting UP on > x86. > > > > However, > > > > > > > it's a lot of work for not much benefit and we'd need to > invent much > > > > > > crazy > > > > > > > to get there. > > > > > > > > > > > > Trivial to fix this with > > > > > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) |= | > > > > > > !defined(KLD_UP_MODULES) > > > > > > > > > > > > > > > Nope. Not so trivial. Who defines KLD_UP_MODULES? > > > > > > > > Call it SMP_KLD_MODULES, and it gets defined the same place SMP doe= s. > > > > > > > > > > Not so simple. SMP is defined in the config file, and winds up in one > of > > No problem, that is where I would be defining this anyway, or in the > > latest case removing it and SMP for my UP kernel build. > > > > > the option files. It will be absent for stand alone builds, > > I am ok with that. And it would be reasonable to default to SMP. > > > > > though. These > > > change tweak the default yo be inlined and to include the sequence th= at > > > works everywhere. > > > > > > > > > > > > And really, it's absolutely not worth it unless someone shows up > with > > > > > numbers to show the old 'function call to optimal routine' is > actually > > > > > faster than the new 'inline to slightly unoptimal code'. Since I > think > > > > the > > > > > function call overhead is larger than the pessmizations, I'm not > sure > > > > what > > > > > the fuss is about. > > > > > > > > I have no issues with the SMP converting from function calls to > > > > inline locks, I just want to retain the exact same code I had > > > > before any of these changes, and that was A UP built system > > > > without any SMP locking. Is it too much to ask to keep what > > > > already worked? > > > > > > > > > > This doesn't enable or disable locks in the muted sense. It just > changes > > > the atomic ops for the kernel from a function call to an inlined > function. > > > The inlining is more efficient than the call, even with the overhead > added > > > by always inlining the same stuff. It still is faster than before. > > > > > > And userland has done this forever... > > > > > > So I honestly think even UP builds are better off, even if it's not > hyper > > > optimized for UP. The lock instruction prefix is minimal overhead (a > cycle > > > I think). > > > > I do not believe, and Bruce seems to have evidence, that LOCK is not > > a one cycle cost. And in my head I know that it can not be that > > simple as it causes lots of very special things to happen in the > > pipeline to ensure you are locked. > > > > > This is different than the mutexes we optimize for the UP cases > > > (and which aren't affected by this change). It's really not a big > deal. > > > > CPU's are not getting any faster, cycles are cycles, and I think we > > should at least investigate further before we just start making > > assumptions about the lock prefix being a 1 cycle cheap thing to > > do. > > > Just install opt_*.h headers already. It's not just about the SMP option= . > The nvidia-driver ports want to know if PAE is enabled on i386. > Sadly, I don't think it will be that simple... Warner > From owner-svn-src-head@freebsd.org Fri Jul 6 21:18:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A061102E2C5 for ; Fri, 6 Jul 2018 21:18:33 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x243.google.com (mail-yb0-x243.google.com [IPv6:2607:f8b0:4002:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF18C97B98 for ; Fri, 6 Jul 2018 21:18:32 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x243.google.com with SMTP id r3-v6so5087783ybo.4 for ; Fri, 06 Jul 2018 14:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+ErIytpWC9x+Z/Lk7y6cJc1uHpjTEXF2BUvtZHXAcw0=; b=WG65CSW6fVr7YoU+kL3ez9FOEJbW7yIhrgzZNO5JAjGD4LtHdy5X7vjlv31eHlKlud G9ZIgIismS6eoiTMmf4IxX8IH779p6jsMdtOmpuLwES0lvzB3/gODUVlIFadhewOKE2E ijWefsFFt6ghfdjmrajnSB4WipC2WqpfjyprZVMXJ1E211TJTwDk0Dy8fd+GBS51Z2qR pdElfZARmi/bvWybzLu/D4Q5QT5DB0KVWa0WX3LuGwZTPrTgX96ZSfhfkNzW5lEWkFFN qlp5EJirlVhdvK+iK7Hieq/q9abFkYiNUFIPIkwEqM2PJ1fzlzjazsvmo/FaEPfHUQ3Q PgBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+ErIytpWC9x+Z/Lk7y6cJc1uHpjTEXF2BUvtZHXAcw0=; b=iRsZds5OIXdJSY0lUp/h6LmFSRoEhD4SK518mGrqebEVNX/eVNoowXeAMCl5TOm8qg AqIrhdVE+DJpOLSDTOTY/IkhzL2KLYKZxtcpskJ666qEe4IuhG9elk0ZOU/5u8RLG/H0 CCp1mr5W9B3xBUF53bTs1lgPM+nmvbqI83CBOuJNXKVKNk7AhuZXhx1i7IttUxhPFRIa E5lDm9Zrf3TztJtNYpOOLT3dTi5kgaQT5YR1Cn5XBj/3K1D5kze9//fE/8CAXgoUC0mP tgMDYpd7f5gnQ2QwYjvbjf/8JG0w0o+PvkZLGkQxoGmnzbnVEYd5hiQf9kpL/YTVcg+m DPrQ== X-Gm-Message-State: APt69E3lLdzLcsH8DVMd2cVqGGX/asY5+1pdSVlBHX3vorSAqgRmQF7c gC2lzgw1cvmzHU+wI15zudcu5Y2OGcPoO0+qanvQqA== X-Google-Smtp-Source: AAOMgpet8Gzhksq/8+S/JhoE29xzgCN2jqwijJC1DspMLNl6RgQqLYrjZ9AyttQPf0TI4Pf5YI9+iATf3kt4GFh5l80= X-Received: by 2002:a25:6342:: with SMTP id x63-v6mr6057157ybb.371.1530911911962; Fri, 06 Jul 2018 14:18:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:b90:0:0:0:0:0 with HTTP; Fri, 6 Jul 2018 14:18:31 -0700 (PDT) In-Reply-To: <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> References: <201807061013.w66ADgbJ087546@repo.freebsd.org> <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> From: Oliver Pinter Date: Fri, 6 Jul 2018 23:18:31 +0200 Message-ID: Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: "rgrimes@freebsd.org" Cc: Hans Petter Selasky , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 21:18:33 -0000 On Friday, July 6, 2018, Rodney W. Grimes wrote: > > Author: hselasky > > Date: Fri Jul 6 10:13:42 2018 > > New Revision: 336025 > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > Log: > > Make sure kernel modules built by default are portable between UP and > > SMP systems by extending defined(SMP) to include defined(KLD_MODULE). > > > > This is a regression issue after r335873 . > > > > Discussed with: mmacy@ > > Sponsored by: Mellanox Technologies > > Though this fixes the issue, it also means that now when > anyone intentionally builds a UP kernel with modules > they are getting SMP support in the modules and I am > not sure they would want that. I know I don't. > > On linux case the lock instructions are runtime patchable. They have so called altinstruction facility, which able to detect specific conditions - in this case up vs smp - and in up case the locks are replaced with simple nops or one multi word nop when the instruction longer than 1 byte. > > Modified: > > head/sys/amd64/include/atomic.h > > head/sys/i386/include/atomic.h > > > > Modified: head/sys/amd64/include/atomic.h > > ============================================================ > ================== > > --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 > (r336024) > > +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 > (r336025) > > @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE(volatile > u_##TYPE *p, u_ > > * For userland, always use lock prefixes so that the binaries will run > > * on both SMP and !SMP systems. > > */ > > -#if defined(SMP) || !defined(_KERNEL) > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > #define MPLOCKED "lock ; " > > #else > > #define MPLOCKED > > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, u_int > v) > > */ > > #define OFFSETOF_MONITORBUF 0x100 > > > > -#if defined(SMP) > > +#if defined(SMP) || defined(KLD_MODULE) > > static __inline void > > __storeload_barrier(void) > > { > > > > Modified: head/sys/i386/include/atomic.h > > ============================================================ > ================== > > --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 > (r336024) > > +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 > (r336025) > > @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile > uint64_t *, uint64_t > > * For userland, always use lock prefixes so that the binaries will run > > * on both SMP and !SMP systems. > > */ > > -#if defined(SMP) || !defined(_KERNEL) > > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) > > #define MPLOCKED "lock ; " > > #else > > #define MPLOCKED > > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v) > > */ > > > > #if defined(_KERNEL) > > -#if defined(SMP) > > +#if defined(SMP) || defined(KLD_MODULE) > > #define __storeload_barrier() __mbk() > > #else /* _KERNEL && UP */ > > #define __storeload_barrier() __compiler_membar() > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Fri Jul 6 21:22:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C68EE102E9EC; Fri, 6 Jul 2018 21:22:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0517006A; Fri, 6 Jul 2018 21:22:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 460786375; Fri, 6 Jul 2018 21:22:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66LMpoN031759; Fri, 6 Jul 2018 21:22:51 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66LMoTW031756; Fri, 6 Jul 2018 21:22:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201807062122.w66LMoTW031756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 6 Jul 2018 21:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336050 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 336050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 21:22:52 -0000 Author: gonzo Date: Fri Jul 6 21:22:50 2018 New Revision: 336050 URL: https://svnweb.freebsd.org/changeset/base/336050 Log: ig4(4): add support for Apollo Lake I2C controllers Add PCI ids for I2C controllers on Apollo Lake platform. Also convert switch/case probe logic into a table. Reviewed by: avg Differential Revision: https://reviews.freebsd.org/D16120 Modified: head/sys/dev/ichiic/ig4_pci.c head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Fri Jul 6 21:01:52 2018 (r336049) +++ head/sys/dev/ichiic/ig4_pci.c Fri Jul 6 21:22:50 2018 (r336050) @@ -80,73 +80,63 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_SKYLAKE_I2C_3 0x9d638086 #define PCI_CHIP_SKYLAKE_I2C_4 0x9d648086 #define PCI_CHIP_SKYLAKE_I2C_5 0x9d658086 +#define PCI_CHIP_APL_I2C_0 0x5aac8086 +#define PCI_CHIP_APL_I2C_1 0x5aae8086 +#define PCI_CHIP_APL_I2C_2 0x5ab08086 +#define PCI_CHIP_APL_I2C_3 0x5ab28086 +#define PCI_CHIP_APL_I2C_4 0x5ab48086 +#define PCI_CHIP_APL_I2C_5 0x5ab68086 +#define PCI_CHIP_APL_I2C_6 0x5ab88086 +#define PCI_CHIP_APL_I2C_7 0x5aba8086 +struct ig4iic_pci_device { + uint32_t devid; + const char *desc; + enum ig4_vers version; +}; + +static struct ig4iic_pci_device ig4iic_pci_devices[] = { + { PCI_CHIP_LYNXPT_LP_I2C_1, "Intel Lynx Point-LP I2C Controller-1", IG4_HASWELL}, + { PCI_CHIP_LYNXPT_LP_I2C_2, "Intel Lynx Point-LP I2C Controller-2", IG4_HASWELL}, + { PCI_CHIP_BRASWELL_I2C_1, "Intel Braswell Serial I/O I2C Port 1", IG4_ATOM}, + { PCI_CHIP_BRASWELL_I2C_2, "Intel Braswell Serial I/O I2C Port 2", IG4_ATOM}, + { PCI_CHIP_BRASWELL_I2C_3, "Intel Braswell Serial I/O I2C Port 3", IG4_ATOM}, + { PCI_CHIP_BRASWELL_I2C_5, "Intel Braswell Serial I/O I2C Port 5", IG4_ATOM}, + { PCI_CHIP_BRASWELL_I2C_6, "Intel Braswell Serial I/O I2C Port 6", IG4_ATOM}, + { PCI_CHIP_BRASWELL_I2C_7, "Intel Braswell Serial I/O I2C Port 7", IG4_ATOM}, + { PCI_CHIP_SKYLAKE_I2C_0, "Intel Sunrise Point-LP I2C Controller-0", IG4_SKYLAKE}, + { PCI_CHIP_SKYLAKE_I2C_1, "Intel Sunrise Point-LP I2C Controller-1", IG4_SKYLAKE}, + { PCI_CHIP_SKYLAKE_I2C_2, "Intel Sunrise Point-LP I2C Controller-2", IG4_SKYLAKE}, + { PCI_CHIP_SKYLAKE_I2C_3, "Intel Sunrise Point-LP I2C Controller-3", IG4_SKYLAKE}, + { PCI_CHIP_SKYLAKE_I2C_4, "Intel Sunrise Point-LP I2C Controller-4", IG4_SKYLAKE}, + { PCI_CHIP_SKYLAKE_I2C_5, "Intel Sunrise Point-LP I2C Controller-5", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_0, "Intel Apollo Lake I2C Controller-0", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_1, "Intel Apollo Lake I2C Controller-1", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_2, "Intel Apollo Lake I2C Controller-2", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_3, "Intel Apollo Lake I2C Controller-3", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_4, "Intel Apollo Lake I2C Controller-4", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_5, "Intel Apollo Lake I2C Controller-5", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_6, "Intel Apollo Lake I2C Controller-6", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_7, "Intel Apollo Lake I2C Controller-7", IG4_SKYLAKE}, + { 0, NULL, 0 }, +}; + static int ig4iic_pci_probe(device_t dev) { ig4iic_softc_t *sc = device_get_softc(dev); + uint32_t devid; + int i; - switch(pci_get_devid(dev)) { - case PCI_CHIP_LYNXPT_LP_I2C_1: - device_set_desc(dev, "Intel Lynx Point-LP I2C Controller-1"); - sc->version = IG4_HASWELL; - break; - case PCI_CHIP_LYNXPT_LP_I2C_2: - device_set_desc(dev, "Intel Lynx Point-LP I2C Controller-2"); - sc->version = IG4_HASWELL; - break; - case PCI_CHIP_BRASWELL_I2C_1: - device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 1"); - sc->version = IG4_ATOM; - break; - case PCI_CHIP_BRASWELL_I2C_2: - device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 2"); - sc->version = IG4_ATOM; - break; - case PCI_CHIP_BRASWELL_I2C_3: - device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 3"); - sc->version = IG4_ATOM; - break; - case PCI_CHIP_BRASWELL_I2C_5: - device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 5"); - sc->version = IG4_ATOM; - break; - case PCI_CHIP_BRASWELL_I2C_6: - device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 6"); - sc->version = IG4_ATOM; - break; - case PCI_CHIP_BRASWELL_I2C_7: - device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 7"); - sc->version = IG4_ATOM; - break; - case PCI_CHIP_SKYLAKE_I2C_0: - device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-0"); - sc->version = IG4_SKYLAKE; - break; - case PCI_CHIP_SKYLAKE_I2C_1: - device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-1"); - sc->version = IG4_SKYLAKE; - break; - case PCI_CHIP_SKYLAKE_I2C_2: - device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-2"); - sc->version = IG4_SKYLAKE; - break; - case PCI_CHIP_SKYLAKE_I2C_3: - device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-3"); - sc->version = IG4_SKYLAKE; - break; - case PCI_CHIP_SKYLAKE_I2C_4: - device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-4"); - sc->version = IG4_SKYLAKE; - break; - case PCI_CHIP_SKYLAKE_I2C_5: - device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-5"); - sc->version = IG4_SKYLAKE; - break; - default: - return (ENXIO); + devid = pci_get_devid(dev); + for (i = 0; ig4iic_pci_devices[i].devid != 0; i++) { + if (ig4iic_pci_devices[i].devid == devid) { + device_set_desc(dev, ig4iic_pci_devices[i].desc); + sc->version = ig4iic_pci_devices[i].version; + return (BUS_PROBE_DEFAULT); + } } - return (BUS_PROBE_DEFAULT); + return (ENXIO); } static int Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Fri Jul 6 21:01:52 2018 (r336049) +++ head/sys/dev/ichiic/ig4_var.h Fri Jul 6 21:22:50 2018 (r336050) @@ -47,7 +47,7 @@ #define IG4_RBUFMASK (IG4_RBUFSIZE - 1) enum ig4_op { IG4_IDLE, IG4_READ, IG4_WRITE }; -enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE }; +enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE, IG4_APL }; struct ig4iic_softc { device_t dev; From owner-svn-src-head@freebsd.org Fri Jul 6 21:32:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6BFB102F726; Fri, 6 Jul 2018 21:32:22 +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 8FF31706CB; Fri, 6 Jul 2018 21:32:22 +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 058C510AFD4; Fri, 6 Jul 2018 17:32:20 -0400 (EDT) Subject: Re: svn commit: r336020 - in head/sys: amd64/include arm/include arm64/include i386/include kern mips/include powerpc/include riscv/include sparc64/include sys vm x86/acpica To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807060206.w662636M035282@repo.freebsd.org> From: John Baldwin Message-ID: <2c818e79-bcce-670c-9521-c4d171c3f5b1@FreeBSD.org> Date: Fri, 6 Jul 2018 14:32:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807060206.w662636M035282@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 06 Jul 2018 17:32:21 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 21:32:23 -0000 On 7/5/18 7:06 PM, Matt Macy wrote: > Author: mmacy > Date: Fri Jul 6 02:06:03 2018 > New Revision: 336020 > URL: https://svnweb.freebsd.org/changeset/base/336020 > > Log: > Back pcpu zone with domain correct pages > > - Change pcpu zone consumers to use a stride size of PAGE_SIZE. > (defined as UMA_PCPU_ALLOC_SIZE to make future identification easier) > > - Allocate page from the correct domain for a given cpu. > > - Don't initialize pc_domain to non-zero value if NUMA is not defined > There are some misconceptions surrounding this field. It is the > _VM_ NUMA domain and should only ever correspond to valid domain > values as understood by the VM. > > The former slab size of sizeof(struct pcpu) was somewhat arbitrary. > The new value is PAGE_SIZE because that's the smallest granularity > which the VM can allocate a slab for a given domain. If you have > fewer than PAGE_SIZE/8 counters on your system there will be some > memory wasted, but this is obviously something where you want the > cache line to be coming from the correct domain. > > Reviewed by: jeff > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D15933 So one thing about this change that confused me abit is why any of srat.c is being run at all in a non-NUMA kernel. When we reworked the NUMA options in HEAD to merge DEVICE_NUMA and VM_NUMA_ALLOC or whatever it was called into a single NUMA, my impression is that srat.c should be 'optional numa' in sys/conf/files.*. Is it just oversight that that wasn't done earlier, and should we in fact do that now? -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jul 6 22:00:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A97C310324AD; Fri, 6 Jul 2018 22:00:43 +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 31B1C717F3; Fri, 6 Jul 2018 22:00:42 +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 w66M0e3M054313; Fri, 6 Jul 2018 15:00:40 -0700 (PDT) (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 w66M0ecL054312; Fri, 6 Jul 2018 15:00:40 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807062200.w66M0ecL054312@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: To: Oliver Pinter Date: Fri, 6 Jul 2018 15:00:40 -0700 (PDT) CC: "rgrimes@freebsd.org" , Hans Petter Selasky , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 22:00:43 -0000 > On Friday, July 6, 2018, Rodney W. Grimes > wrote: > > > > Author: hselasky > > > Date: Fri Jul 6 10:13:42 2018 > > > New Revision: 336025 > > > URL: https://svnweb.freebsd.org/changeset/base/336025 > > > > > > Log: > > > Make sure kernel modules built by default are portable between UP and > > > SMP systems by extending defined(SMP) to include defined(KLD_MODULE). > > > > > > This is a regression issue after r335873 . > > > > > > Discussed with: mmacy@ > > > Sponsored by: Mellanox Technologies > > > > Though this fixes the issue, it also means that now when > > anyone intentionally builds a UP kernel with modules > > they are getting SMP support in the modules and I am > > not sure they would want that. I know I don't. > > > > > On linux case the lock instructions are runtime patchable. They have so > called altinstruction facility, which able to detect specific conditions - > in this case up vs smp - and in up case the locks are replaced with simple > nops or one multi word nop when the instruction longer than 1 byte. Thank you for this information, which lends credibilty to the fact that these LOCK instructions may not be as cheap as some think they are, as why would the Linux people bother with run time patching code if infact it was that cheap. I would not want to take that approach though. ... commit diff text deleted ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jul 6 22:01:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A8791032513; Fri, 6 Jul 2018 22:01:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE0C77193D; Fri, 6 Jul 2018 22:01:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9ECCC6861; Fri, 6 Jul 2018 22:01:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66M10EZ047505; Fri, 6 Jul 2018 22:01:00 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66M10Nl047504; Fri, 6 Jul 2018 22:01:00 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201807062201.w66M10Nl047504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 6 Jul 2018 22:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336051 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 336051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 22:01:01 -0000 Author: gonzo Date: Fri Jul 6 22:01:00 2018 New Revision: 336051 URL: https://svnweb.freebsd.org/changeset/base/336051 Log: ig4(4): Fix Apollo lake entries platform identifier Identify Apollo Lake controllers as IG4_APL and not as a IG4_SKYLAKE Reported by: rpokala@ Modified: head/sys/dev/ichiic/ig4_pci.c Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Fri Jul 6 21:22:50 2018 (r336050) +++ head/sys/dev/ichiic/ig4_pci.c Fri Jul 6 22:01:00 2018 (r336051) @@ -110,14 +110,14 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { PCI_CHIP_SKYLAKE_I2C_3, "Intel Sunrise Point-LP I2C Controller-3", IG4_SKYLAKE}, { PCI_CHIP_SKYLAKE_I2C_4, "Intel Sunrise Point-LP I2C Controller-4", IG4_SKYLAKE}, { PCI_CHIP_SKYLAKE_I2C_5, "Intel Sunrise Point-LP I2C Controller-5", IG4_SKYLAKE}, - { PCI_CHIP_APL_I2C_0, "Intel Apollo Lake I2C Controller-0", IG4_SKYLAKE}, - { PCI_CHIP_APL_I2C_1, "Intel Apollo Lake I2C Controller-1", IG4_SKYLAKE}, - { PCI_CHIP_APL_I2C_2, "Intel Apollo Lake I2C Controller-2", IG4_SKYLAKE}, - { PCI_CHIP_APL_I2C_3, "Intel Apollo Lake I2C Controller-3", IG4_SKYLAKE}, - { PCI_CHIP_APL_I2C_4, "Intel Apollo Lake I2C Controller-4", IG4_SKYLAKE}, - { PCI_CHIP_APL_I2C_5, "Intel Apollo Lake I2C Controller-5", IG4_SKYLAKE}, - { PCI_CHIP_APL_I2C_6, "Intel Apollo Lake I2C Controller-6", IG4_SKYLAKE}, - { PCI_CHIP_APL_I2C_7, "Intel Apollo Lake I2C Controller-7", IG4_SKYLAKE}, + { PCI_CHIP_APL_I2C_0, "Intel Apollo Lake I2C Controller-0", IG4_APL}, + { PCI_CHIP_APL_I2C_1, "Intel Apollo Lake I2C Controller-1", IG4_APL}, + { PCI_CHIP_APL_I2C_2, "Intel Apollo Lake I2C Controller-2", IG4_APL}, + { PCI_CHIP_APL_I2C_3, "Intel Apollo Lake I2C Controller-3", IG4_APL}, + { PCI_CHIP_APL_I2C_4, "Intel Apollo Lake I2C Controller-4", IG4_APL}, + { PCI_CHIP_APL_I2C_5, "Intel Apollo Lake I2C Controller-5", IG4_APL}, + { PCI_CHIP_APL_I2C_6, "Intel Apollo Lake I2C Controller-6", IG4_APL}, + { PCI_CHIP_APL_I2C_7, "Intel Apollo Lake I2C Controller-7", IG4_APL}, { 0, NULL, 0 }, }; From owner-svn-src-head@freebsd.org Fri Jul 6 22:07:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBFF51032EAC; Fri, 6 Jul 2018 22:07:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BEF171E5D; Fri, 6 Jul 2018 22:07:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 738DB69C9; Fri, 6 Jul 2018 22:07:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w66M7RIX052853; Fri, 6 Jul 2018 22:07:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66M7RRZ052852; Fri, 6 Jul 2018 22:07:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807062207.w66M7RRZ052852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 6 Jul 2018 22:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336052 - in head/sys/modules: uchcom ucycom X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/modules: uchcom ucycom X-SVN-Commit-Revision: 336052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 22:07:28 -0000 Author: ian Date: Fri Jul 6 22:07:26 2018 New Revision: 336052 URL: https://svnweb.freebsd.org/changeset/base/336052 Log: Set .PATH to dev/usb/serial so that these modules compile again. Modified: head/sys/modules/uchcom/Makefile head/sys/modules/ucycom/Makefile Modified: head/sys/modules/uchcom/Makefile ============================================================================== --- head/sys/modules/uchcom/Makefile Fri Jul 6 22:01:00 2018 (r336051) +++ head/sys/modules/uchcom/Makefile Fri Jul 6 22:07:26 2018 (r336052) @@ -1,7 +1,7 @@ # $FreeBSD$ S= ${SRCTOP}/sys -.PATH: $S/dev/usb +.PATH: $S/dev/usb/serial KMOD= uchcom SRCS= uchcom.c opt_usb.h device_if.h bus_if.h usbdevs.h Modified: head/sys/modules/ucycom/Makefile ============================================================================== --- head/sys/modules/ucycom/Makefile Fri Jul 6 22:01:00 2018 (r336051) +++ head/sys/modules/ucycom/Makefile Fri Jul 6 22:07:26 2018 (r336052) @@ -1,7 +1,7 @@ # $FreeBSD$ S= ${SRCTOP}/sys -.PATH: $S/dev/usb +.PATH: $S/dev/usb/serial KMOD= ucycom SRCS= ucycom.c opt_usb.h device_if.h bus_if.h usbdevs.h From owner-svn-src-head@freebsd.org Fri Jul 6 22:52:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AC371037ED9 for ; Fri, 6 Jul 2018 22:52:10 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9D1E73609 for ; Fri, 6 Jul 2018 22:52:09 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pf0-x242.google.com with SMTP id y24-v6so9476412pfe.12 for ; Fri, 06 Jul 2018 15:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=bLSWGPCZinbZ3Gslot+IPY9U8dCqhDlBF/rWuA2N8gU=; b=hwATApUZcUxOmQe98bcUoHJbdUESFZ8IxZaXX7bxcO7kNW75a3jJidsArTbbRllnlt uJLua/4Hl+TQIb2UghX4K/WDXC+z+hs15wwGZz+WFCR4s25iSm8760Vn3pd7ugkgwJCX XbW5f6amOjcUdFH5qzBUMDTs4WVbRu7l+TC0cyqP9DwNMxIIGKXkkwQ4qc8ZEQsZPmID ND9unWoFtRSYeC+N36mpzO2x+5MZQZuoGfuO0tLVUoz2gbx/GMmDZfA2WVnZVTmMGs9X 04gD77icbHQJUzUti0pnbcW+jgIZ37g+5dCkVyXilDQzvNCC2kPUmnNmNBiTeZCa8uNX Z0gw== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=bLSWGPCZinbZ3Gslot+IPY9U8dCqhDlBF/rWuA2N8gU=; b=BERf1mdjq5DCpQNSqyCZDyPazn+80Ty//AmmOqzibXBDW6snvy4QhO1Pl+eMzkjXgP wRfE7UIOWObIdNRHPIEeCKGx4M11BqcQwkMkqnzWwym5k8mjSva2BfDT8ehA5jBeg/UR eAMPIUvjj5jVml/v0rveh5cxmrCEJNNqHicOE81UMML5xDihhJ+ozeF1+TSKr5IFk1GJ CM1A60FmkzURc4sLoFhbNsTyXMeH/qwxwSsjMBoFhXRTHqXARGmkTx2/W9Z04MetQs6Z R2N1ZzChrqCbbd72ShYZLSfslzMtIB9LEtWvHrSsWiEBFRPwJ8Sh8deDgAy2poa5aRJt Wung== X-Gm-Message-State: APt69E1DCZ+jJUeOIoKKIpy2pAw04Ov2DDSgh2FQ5NwfFyhFs6jwUSnl I2kOVivCmulltOEAZ3HQy3+0Mw== X-Google-Smtp-Source: AAOMgpfBS0fOqqPQi9bUd+2Q7gtdpKDW460rw7GV8aHz/668WgLuDqEwR77WNn/ZYbIeO9LOOLGWaQ== X-Received: by 2002:a65:6491:: with SMTP id e17-v6mr10850686pgv.44.1530917528859; Fri, 06 Jul 2018 15:52:08 -0700 (PDT) Received: from rrcs-66-91-135-210.west.biz.rr.com (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210]) by smtp.gmail.com with ESMTPSA id k71-v6sm22939785pga.62.2018.07.06.15.52.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 15:52:08 -0700 (PDT) Date: Fri, 6 Jul 2018 12:49:28 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: "rgrimes@freebsd.org" cc: Oliver Pinter , Hans Petter Selasky , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: <201807062200.w66M0ecL054312@pdx.rh.CN85.dnsmgr.net> Message-ID: References: <201807062200.w66M0ecL054312@pdx.rh.CN85.dnsmgr.net> User-Agent: Alpine 2.21.999 (BSF 260 2018-02-26) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 22:52:10 -0000 On Fri, 6 Jul 2018, Rodney W. Grimes wrote: >> On Friday, July 6, 2018, Rodney W. Grimes >> wrote: >> >>>> Author: hselasky >>>> Date: Fri Jul 6 10:13:42 2018 >>>> New Revision: 336025 >>>> URL: https://svnweb.freebsd.org/changeset/base/336025 >>>> >>>> Log: >>>> Make sure kernel modules built by default are portable between UP and >>>> SMP systems by extending defined(SMP) to include defined(KLD_MODULE). >>>> >>>> This is a regression issue after r335873 . >>>> >>>> Discussed with: mmacy@ >>>> Sponsored by: Mellanox Technologies >>> >>> Though this fixes the issue, it also means that now when >>> anyone intentionally builds a UP kernel with modules >>> they are getting SMP support in the modules and I am >>> not sure they would want that. I know I don't. >>> >>> >> On linux case the lock instructions are runtime patchable. They have so >> called altinstruction facility, which able to detect specific conditions - >> in this case up vs smp - and in up case the locks are replaced with simple >> nops or one multi word nop when the instruction longer than 1 byte. > > Thank you for this information, which lends credibilty to the fact that > these LOCK instructions may not be as cheap as some think they are, > as why would the Linux people bother with run time patching code if > infact it was that cheap. This code to patch in linux dates from a time when lock was incredibly expensive and SMP was rare. On x86 of the era lock would actually assert a bus lock on the north bridge. Today lock prefix without contention is not particularly expensive, about the same as a divide, as long as the line is in cache. If it is not in cache, the memory access is an order of magnitude more expensive than the atomic. If it is contended then you have different problems. My feeling is that these days more people overestimate the cost of atomics than under estimate. It's really the _sharing_ that is expensive. Thanks, Jeff > > I would not want to take that approach though. > > ... commit diff text deleted ... > > -- > Rod Grimes rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Fri Jul 6 22:58:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1990A1038A0B for ; Fri, 6 Jul 2018 22:58:54 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89B3973AB8 for ; Fri, 6 Jul 2018 22:58:53 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pf0-x241.google.com with SMTP id q7-v6so8392190pff.2 for ; Fri, 06 Jul 2018 15:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=IxBNOVlnfd6MyMH/P/ffqJsqFyhcKsMkadqzw7sKudY=; b=BUue1FGvePEiCrrPExQeF2ERcJF85p9avBb/RA0z1jLHgyjdbDHsbtRMyhYYB+hHlW CxckQ1fKrRpwpbAs/pWoJiuiHQHDO+wgaXlfZU2jQsNBho4ofYHMy6BO4wPtMDEUxu5Q 6HYEs3yhxdzXdvvRCgfglTnqlaFAWzTeBrHyOcmxRMVyr+rSL3Khd0rbnmdMNr+vj5x9 iaRhtVw9SXBJdLW+0xa3zoJlne4H/9Q9vdpXOiwXpgUm5eK++c9TQV3RjARNqwQHhO+c Wm6tR7ocaZG24szdYlv9Ij3dbRCox7UOLgwzLtuyybPgfiV2pJxiDKweJVgJwiAA7icF 6dgA== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=IxBNOVlnfd6MyMH/P/ffqJsqFyhcKsMkadqzw7sKudY=; b=ebJIpkNqZGFJZ/b1iH/5EfmCCaCw4vigav/98YRqlYD1pSK54a4gDdYXSx+eoLwZfp I4spejqlNMySxFvDEk1hFSC1S+jlLGk3FP/YzNNUnUFJ/mzGtkVG1jL2Kr9ufM3oTIF5 C+gi7zKPhKoqN/qiKCcuF90zdki09PJKZWSaRSjqVPDfMv8IT0bSKVKHplhcuA3S3jzS p2Fbjgu+GZh2GEmrMQoE2h5t4qk1tw8RE+uDrQWB1XEos5bmgUsY//q+Ee2mJBIxIh7b Ymna8NCvv3q05Bv/KU5CAg3s7LK23jGLqY1XAbJ1BHFNtXHzTTfVYoN/g6DJsn1ucPT2 z/jg== X-Gm-Message-State: APt69E3k2l95eK58P435knr8VOmjBvEVAmTUvlpPDf2JCKDfvrEYzZaF 3BxTwDs9bD3v+bLVX94ygMmULA== X-Google-Smtp-Source: AAOMgpeTONkeiEpLnMTkI4/ZOj8wkXeSvzcCxgifA9QwPf66Vg3HTAjbixoDVp03G21321A/7Xr3Yw== X-Received: by 2002:a63:5c10:: with SMTP id q16-v6mr10858278pgb.452.1530917932605; Fri, 06 Jul 2018 15:58:52 -0700 (PDT) Received: from rrcs-66-91-135-210.west.biz.rr.com (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210]) by smtp.gmail.com with ESMTPSA id u17-v6sm41338995pfa.176.2018.07.06.15.58.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 15:58:51 -0700 (PDT) Date: Fri, 6 Jul 2018 12:56:11 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: "Rodney W. Grimes" cc: Warner Losh , Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: <201807061809.w66I9RVR053596@pdx.rh.CN85.dnsmgr.net> Message-ID: References: <201807061809.w66I9RVR053596@pdx.rh.CN85.dnsmgr.net> User-Agent: Alpine 2.21.999 (BSF 260 2018-02-26) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2547152148-1705954291-1530917773=:2934" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 22:58:54 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2547152148-1705954291-1530917773=:2934 Content-Type: text/plain; charset=US-ASCII; format=flowed On Fri, 6 Jul 2018, Rodney W. Grimes wrote: >> On Fri, Jul 6, 2018, 12:27 PM Rodney W. Grimes < >> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >> >>>> On Fri, Jul 6, 2018 at 9:52 AM, Rodney W. Grimes < >>>> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >>>> >>>>>> On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < >>>>>> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >>>>>> >>>>>>>> Author: hselasky >>>>>>>> Date: Fri Jul 6 10:13:42 2018 >>>>>>>> New Revision: 336025 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/336025 >>>>>>>> >>>>>>>> Log: >>>>>>>> Make sure kernel modules built by default are portable between >>> UP >>>>> and >>>>>>>> SMP systems by extending defined(SMP) to include >>>>> defined(KLD_MODULE). >>>>>>>> >>>>>>>> This is a regression issue after r335873 . >>>>>>>> >>>>>>>> Discussed with: mmacy@ >>>>>>>> Sponsored by: Mellanox Technologies >>>>>>> >>>>>>> Though this fixes the issue, it also means that now when >>>>>>> anyone intentionally builds a UP kernel with modules >>>>>>> they are getting SMP support in the modules and I am >>>>>>> not sure they would want that. I know I don't. >>>>>>> >>>>>> >>>>>> >>>>>> On UP systems, these additional opcodes are harmless. They take a few >>>>> extra >>>>>> cycles (since they lock an uncontested bus) and add a couple extra >>> memory >>>>>> barriers (which will be NOPs). On MP systems, atomics now work by >>>>> default. >>>>>> Had we not defaulted like this, all modules built outside of a kernel >>>>> build >>>>>> env would have broken atomics. Given that (a) the overwhelming >>> majority >>>>>> (99% or more) is SMP and (b) the MP code merely adds a few cycles to >>>>> what's >>>>>> already a not-too-expensive operation, this was the right choice. >>>>>> >>>>>> It simply doesn't matter for systems that are relevant to the project >>>>>> today. While one could try to optimize this a little (for example, by >>>>>> having SMP defined to be 0 or 1, say, and changing all the ifdef SMP >>> to >>>>> if >>>>>> (defined(SMP) && SMP != 0)), it's likely not going to matter enough >>> for >>>>>> anybody to make the effort. UP on x86 is simply not relevant enough >>> to >>>>>> optimize for it. Even in VMs, people run SMP kernels typically even >>> when >>>>>> they just allocate one CPU to the VM. >>>>>> >>>>>> So while we still support the UP config, and we'll let people build >>>>>> optimized kernels for x86, we've flipped the switch from pessimized >>> for >>>>> SMP >>>>>> modules to pessimized for UP modules, which seems like quite the >>>>> reasonable >>>>>> trade-off. >>>>>> >>>>>> Were it practical to do so, I'd suggest de-orbiting UP on x86. >>> However, >>>>>> it's a lot of work for not much benefit and we'd need to invent much >>>>> crazy >>>>>> to get there. >>>>> >>>>> Trivial to fix this with >>>>> +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) || >>>>> !defined(KLD_UP_MODULES) >>>> >>>> >>>> Nope. Not so trivial. Who defines KLD_UP_MODULES? >>> >>> Call it SMP_KLD_MODULES, and it gets defined the same place SMP does. >>> >> >> Not so simple. SMP is defined in the config file, and winds up in one of > No problem, that is where I would be defining this anyway, or in the > latest case removing it and SMP for my UP kernel build. > >> the option files. It will be absent for stand alone builds, > I am ok with that. And it would be reasonable to default to SMP. > >> though. These >> change tweak the default yo be inlined and to include the sequence that >> works everywhere. >> >>> >>>> And really, it's absolutely not worth it unless someone shows up with >>>> numbers to show the old 'function call to optimal routine' is actually >>>> faster than the new 'inline to slightly unoptimal code'. Since I think >>> the >>>> function call overhead is larger than the pessmizations, I'm not sure >>> what >>>> the fuss is about. >>> >>> I have no issues with the SMP converting from function calls to >>> inline locks, I just want to retain the exact same code I had >>> before any of these changes, and that was A UP built system >>> without any SMP locking. Is it too much to ask to keep what >>> already worked? >>> >> >> This doesn't enable or disable locks in the muted sense. It just changes >> the atomic ops for the kernel from a function call to an inlined function. >> The inlining is more efficient than the call, even with the overhead added >> by always inlining the same stuff. It still is faster than before. >> >> And userland has done this forever... >> >> So I honestly think even UP builds are better off, even if it's not hyper >> optimized for UP. The lock instruction prefix is minimal overhead (a cycle >> I think). > > I do not believe, and Bruce seems to have evidence, that LOCK is not > a one cycle cost. And in my head I know that it can not be that > simple as it causes lots of very special things to happen in the > pipeline to ensure you are locked. It is definitely not one cycle. It is a couple dozen depending on the machine. You can benchmark yourself with the attached patch. Here's two atomics in a loop with and without lock on a Zen: desktop# ./nonatomic 0 8838: 8 ns desktop# ./atomic 0 32887: 32 ns This is at ~3ghz so three instructions per-ns. Cut this in half for per-atomic cost. 12ns of overhead or 36 cycles. One of them is a fetchadd so there is extra cost associated with that. This is also worst case because the machine can't execute anything other than the atomics. If there were other instructions that didn't operate on overlapping memory addresses they could run in parallel. Jeff > >> This is different than the mutexes we optimize for the UP cases >> (and which aren't affected by this change). It's really not a big deal. > > CPU's are not getting any faster, cycles are cycles, and I think we > should at least investigate further before we just start making > assumptions about the lock prefix being a 1 cycle cheap thing to > do. > >> >>>>> >>>>>>>> Modified: >>>>>>>> head/sys/amd64/include/atomic.h >>>>>>>> head/sys/i386/include/atomic.h >>>>>>>> >>>>>>>> Modified: head/sys/amd64/include/atomic.h >>>>>>>> ============================================================ >>>>>>> ================== >>>>>>>> --- head/sys/amd64/include/atomic.h Fri Jul 6 10:10:00 2018 >>>>>>> (r336024) >>>>>>>> +++ head/sys/amd64/include/atomic.h Fri Jul 6 10:13:42 2018 >>>>>>> (r336025) >>>>>>>> @@ -132,7 +132,7 @@ void atomic_store_rel_##TYPE( >>>>> volatile >>>>>>> u_##TYPE *p, u_ >>>>>>>> * For userland, always use lock prefixes so that the binaries >>> will >>>>> run >>>>>>>> * on both SMP and !SMP systems. >>>>>>>> */ >>>>>>>> -#if defined(SMP) || !defined(_KERNEL) >>>>>>>> +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) >>>>>>>> #define MPLOCKED "lock ; " >>>>>>>> #else >>>>>>>> #define MPLOCKED >>>>>>>> @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, >>>>> u_int >>>>>>> v) >>>>>>>> */ >>>>>>>> #define OFFSETOF_MONITORBUF 0x100 >>>>>>>> >>>>>>>> -#if defined(SMP) >>>>>>>> +#if defined(SMP) || defined(KLD_MODULE) >>>>>>>> static __inline void >>>>>>>> __storeload_barrier(void) >>>>>>>> { >>>>>>>> >>>>>>>> Modified: head/sys/i386/include/atomic.h >>>>>>>> ============================================================ >>>>>>> ================== >>>>>>>> --- head/sys/i386/include/atomic.h Fri Jul 6 10:10:00 2018 >>>>>>> (r336024) >>>>>>>> +++ head/sys/i386/include/atomic.h Fri Jul 6 10:13:42 2018 >>>>>>> (r336025) >>>>>>>> @@ -143,7 +143,7 @@ void atomic_subtract_64(volatile >>>>>>> uint64_t *, uint64_t >>>>>>>> * For userland, always use lock prefixes so that the binaries >>> will >>>>> run >>>>>>>> * on both SMP and !SMP systems. >>>>>>>> */ >>>>>>>> -#if defined(SMP) || !defined(_KERNEL) >>>>>>>> +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE) >>>>>>>> #define MPLOCKED "lock ; " >>>>>>>> #else >>>>>>>> #define MPLOCKED >>>>>>>> @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, >>>>> u_int v) >>>>>>>> */ >>>>>>>> >>>>>>>> #if defined(_KERNEL) >>>>>>>> -#if defined(SMP) >>>>>>>> +#if defined(SMP) || defined(KLD_MODULE) >>>>>>>> #define __storeload_barrier() __mbk() >>>>>>>> #else /* _KERNEL && UP */ >>>>>>>> #define __storeload_barrier() __compiler_membar() >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Rod Grimes >>>>>>> rgrimes@freebsd.org >>>>>>> >>>>>>> >>>>> >>>>> -- >>>>> Rod Grimes >>>>> rgrimes@freebsd.org >>>>> >>> >>> -- >>> Rod Grimes >>> rgrimes@freebsd.org >>> > > -- > Rod Grimes rgrimes@freebsd.org > --2547152148-1705954291-1530917773=:2934 Content-Type: text/plain; charset=US-ASCII; name=atomic.c Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=atomic.c I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQojaW5j bHVkZSA8c3lzL3RpbWUuaD4NCiNpbmNsdWRlIDxzeXMvdHlwZXMuaD4NCg0K I2RlZmluZQlJVEVSCTEwMDAwMDANCg0Kc3RhdGljIF9faW5saW5lIHVfaW50 DQphdG9taWNfZmV0Y2hhZGRfaW50KHZvbGF0aWxlIHVfaW50ICpwLCB1X2lu dCB2KQ0Kew0KDQogICAgICAgIF9fYXNtIF9fdm9sYXRpbGUoDQogICAgICAg ICIgICAgICAgbG9jayB4YWRkbCAgICUwLCUxIDsgICAgICAgICAiDQogICAg ICAgICIjIGF0b21pY19mZXRjaGFkZF9pbnQiDQogICAgICAgIDogIityIiAo diksICAgICAgICAgICAgICAgICAgICAgLyogMCAqLw0KICAgICAgICAgICIr bSIgKCpwKSAgICAgICAgICAgICAgICAgICAgIC8qIDEgKi8NCiAgICAgICAg OiA6ICJjYyIpOw0KICAgICAgICByZXR1cm4gKHYpOw0KfQ0KDQpzdGF0aWMg X19pbmxpbmUgdm9pZA0KYXRvbWljX2FkZF9pbnQodm9sYXRpbGUgdV9pbnQg KnAsIHVfaW50IHYpDQp7DQoNCiAgICAgICAgX19hc20gX192b2xhdGlsZSgN CiAgICAgICAgIiAgICAgICBsb2NrIGFkZGwgICAlMCwlMSA7ICAgICAgICAg Ig0KICAgICAgICA6ICIrciIgKHYpLCAgICAgICAgICAgICAgICAgICAgIC8q IDAgKi8NCiAgICAgICAgICAiK20iICgqcCkgICAgICAgICAgICAgICAgICAg ICAvKiAxICovDQogICAgICAgIDogOiAiY2MiKTsNCn0NCg0KaW50DQptYWlu KGludCBhcmdjLCBjaGFyICoqYXJndikNCnsNCglzdHJ1Y3QgdGltZXZhbCBz dGFydCwgZW5kOw0KCXZvbGF0aWxlIGludCBmb287DQoJdWludDY0X3QgbnM7 DQoJaW50IGk7DQoNCglnZXR0aW1lb2ZkYXkoJnN0YXJ0LCBOVUxMKTsNCglm b3IgKGkgPSAwOyBpIDwgSVRFUjsgaSsrKSB7DQoJCWF0b21pY19hZGRfaW50 KCZmb28sIDEpOw0KCQlhdG9taWNfZmV0Y2hhZGRfaW50KCZmb28sIC0xKTsN Cgl9DQoJZ2V0dGltZW9mZGF5KCZlbmQsIE5VTEwpOw0KCWVuZC50dl9zZWMg LT0gc3RhcnQudHZfc2VjOw0KCWVuZC50dl91c2VjIC09IHN0YXJ0LnR2X3Vz ZWM7DQoJbnMgPSBlbmQudHZfdXNlYyAvIChJVEVSIC8gMTAwMCk7DQoJcHJp bnRmKCIlZCAlZDogJWQgbnNcbiIsIGVuZC50dl9zZWMsIGVuZC50dl91c2Vj LCBucyk7DQp9DQo= --2547152148-1705954291-1530917773=:2934-- From owner-svn-src-head@freebsd.org Fri Jul 6 23:49:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83EBA103DADB; Fri, 6 Jul 2018 23:49:18 +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 3481575780; Fri, 6 Jul 2018 23:49:18 +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 0E0317980; Fri, 6 Jul 2018 23:49:18 +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 w66NnHE1003595; Fri, 6 Jul 2018 23:49:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w66NnHPe003591; Fri, 6 Jul 2018 23:49:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201807062349.w66NnHPe003591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 Jul 2018 23:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336053 - in head: sys/arm/include sys/arm64/include tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sys/arm/include sys/arm64/include tests/sys/kern X-SVN-Commit-Revision: 336053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 23:49:18 -0000 Author: jhb Date: Fri Jul 6 23:49:17 2018 New Revision: 336053 URL: https://svnweb.freebsd.org/changeset/base/336053 Log: Export a breakpoint() function to userland for arm and arm64. Enable ptrace() tests using breakpoint() on these architectures. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D15191 Modified: head/sys/arm/include/cpufunc.h head/sys/arm64/include/cpufunc.h head/tests/sys/kern/ptrace_test.c Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Fri Jul 6 22:07:26 2018 (r336052) +++ head/sys/arm/include/cpufunc.h Fri Jul 6 23:49:17 2018 (r336053) @@ -54,7 +54,7 @@ static __inline void breakpoint(void) { - __asm(".word 0xe7ffffff"); + __asm("udf 0xffff"); } struct cpu_functions { @@ -494,6 +494,19 @@ extern int arm_dcache_align_mask; extern u_int arm_cache_level; extern u_int arm_cache_loc; extern u_int arm_cache_type[14]; + +#else /* !_KERNEL */ + +static __inline void +breakpoint(void) +{ + + /* + * This matches the instruction used by GDB for software + * breakpoints. + */ + __asm("udf 0xfdee"); +} #endif /* _KERNEL */ #endif /* _MACHINE_CPUFUNC_H_ */ Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Fri Jul 6 22:07:26 2018 (r336052) +++ head/sys/arm64/include/cpufunc.h Fri Jul 6 23:49:17 2018 (r336053) @@ -29,18 +29,18 @@ #ifndef _MACHINE_CPUFUNC_H_ #define _MACHINE_CPUFUNC_H_ -#ifdef _KERNEL - -#include - -void pan_enable(void); - static __inline void breakpoint(void) { __asm("brk #0"); } + +#ifdef _KERNEL + +#include + +void pan_enable(void); static __inline register_t dbg_disable(void) Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Fri Jul 6 22:07:26 2018 (r336052) +++ head/tests/sys/kern/ptrace_test.c Fri Jul 6 23:49:17 2018 (r336053) @@ -54,8 +54,9 @@ __FBSDID("$FreeBSD$"); /* * Architectures with a user-visible breakpoint(). */ -#if defined(__amd64__) || defined(__i386__) || defined(__mips__) || \ - defined(__riscv) || defined(__sparc64__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ + defined(__i386__) || defined(__mips__) || defined(__riscv) || \ + defined(__sparc64__) #define HAVE_BREAKPOINT #endif @@ -63,8 +64,12 @@ __FBSDID("$FreeBSD$"); * Adjust PC to skip over a breakpoint when stopped for a breakpoint trap. */ #ifdef HAVE_BREAKPOINT -#if defined(__amd64__) || defined(__i386__) +#if defined(__aarch64__) +#define SKIP_BREAK(reg) ((reg)->elr += 4) +#elif defined(__amd64__) || defined(__i386__) #define SKIP_BREAK(reg) +#elif defined(__arm__) +#define SKIP_BREAK(reg) ((reg)->r_pc += 4) #elif defined(__mips__) #define SKIP_BREAK(reg) ((reg)->r_regs[PC] += 4) #elif defined(__riscv) From owner-svn-src-head@freebsd.org Fri Jul 6 23:54:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC405103E22F; Fri, 6 Jul 2018 23:54:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (mx-int.allbsd.org [IPv6:2001:2f0:104:e002::7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gatekeeper.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA8275C67; Fri, 6 Jul 2018 23:54:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:c00:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id w66NsHiK087515 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) (Client CN "/OU=GT07882699/OU=See+20www.rapidssl.com/resources/cps+20+28c+2915/OU=Domain+20Control+20Validated+20-+20RapidSSL+28R+29/CN=*.allbsd.org", Issuer "/C=US/O=GeoTrust+20Inc./CN=RapidSSL+20SHA256+20CA+20-+20G3"); Sat, 7 Jul 2018 08:54:29 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:c00:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id w66NsCCV026658 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 7 Jul 2018 08:54:12 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:0:0:0:0:0:0:0:1]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id w66NsAoO026655; Sat, 7 Jul 2018 08:54:11 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Sat, 07 Jul 2018 08:53:53 +0900 (JST) Message-Id: <20180707.085353.1746062843251989845.hrs@allbsd.org> To: daichi@FreeBSD.org, eadler@FreeBSD.org, gnn@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336028 - head/usr.bin/top From: Hiroki Sato In-Reply-To: <201807061207.w66C76CR043533@repo.freebsd.org> References: <201807061207.w66C76CR043533@repo.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Sat_Jul__7_08_53_53_2018_274)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Fri, 06 Jul 2018 23:54:30 +0000 (UTC) X-Spam-Status: No, score=-96.9 required=13.0 tests=CONTENT_TYPE_PRESENT, QENCPTR1,RCVD_IN_AHBL,RCVD_IN_AHBL_PROXY,RCVD_IN_AHBL_SPAM,RDNS_NONE, SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mx.allbsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 23:54:43 -0000 ----Security_Multipart(Sat_Jul__7_08_53_53_2018_274)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Daichi GOTO wrote in <201807061207.w66C76CR043533@repo.freebsd.org>: da> Author: daichi da> Date: Fri Jul 6 12:07:06 2018 da> New Revision: 336028 da> URL: https://svnweb.freebsd.org/changeset/base/336028 da> da> Log: da> Changed to eliminate the upper limit of command length displayed da> by "-a" and expand to match terminal width da> da> Reviewed by: eadler da> Approved by: gnn (mentor) da> Differential Revision: https://reviews.freebsd.org/D16083 da> da> Modified: da> head/usr.bin/top/display.c da> head/usr.bin/top/machine.c da> head/usr.bin/top/screen.c da> head/usr.bin/top/top.h This change breaks displaying a prompt and messages in the interactive mode by new_message() when typing "o" or "p", for example. While r336031 fixed a warning in GCC, it does not fix the problem itself. Please fix it. I also think restructure of the buffer management is required first if we want to eliminate the column width limitation. Using sbuf(9) consistently may be better than incomplete conversion from static arrays to malloc(). -- Hiroki ----Security_Multipart(Sat_Jul__7_08_53_53_2018_274)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAltAAREACgkQTyzT2CeTzy0qZQCfRAi7K7p18TxqQkVB1+ELS+8S H4oAn0oJHlMHnedPFfEuUgHMl05hctHR =TOAO -----END PGP SIGNATURE----- ----Security_Multipart(Sat_Jul__7_08_53_53_2018_274)---- From owner-svn-src-head@freebsd.org Sat Jul 7 00:06:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9942103F354; Sat, 7 Jul 2018 00:06:07 +0000 (UTC) (envelope-from truckman@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 6509376399; Sat, 7 Jul 2018 00:06:07 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id 5880B13AFC; Sat, 7 Jul 2018 00:06:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Fri, 6 Jul 2018 17:06:03 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: Warner Losh cc: "Rodney W. Grimes" , Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: Message-ID: References: <201807061013.w66ADgbJ087546@repo.freebsd.org> <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 00:06:08 -0000 On 6 Jul, Warner Losh wrote: > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > Author: hselasky >> > Date: Fri Jul 6 10:13:42 2018 >> > New Revision: 336025 >> > URL: https://svnweb.freebsd.org/changeset/base/336025 >> > >> > Log: >> > Make sure kernel modules built by default are portable between UP and >> > SMP systems by extending defined(SMP) to include defined(KLD_MODULE). >> > >> > This is a regression issue after r335873 . >> > >> > Discussed with: mmacy@ >> > Sponsored by: Mellanox Technologies >> >> Though this fixes the issue, it also means that now when >> anyone intentionally builds a UP kernel with modules >> they are getting SMP support in the modules and I am >> not sure they would want that. I know I don't. >> > > > On UP systems, these additional opcodes are harmless. They take a few extra > cycles (since they lock an uncontested bus) and add a couple extra memory > barriers (which will be NOPs). On MP systems, atomics now work by default. > Had we not defaulted like this, all modules built outside of a kernel build > env would have broken atomics. Given that (a) the overwhelming majority > (99% or more) is SMP and (b) the MP code merely adds a few cycles to what's > already a not-too-expensive operation, this was the right choice. > > It simply doesn't matter for systems that are relevant to the project > today. While one could try to optimize this a little (for example, by > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to if > (defined(SMP) && SMP != 0)), it's likely not going to matter enough for > anybody to make the effort. UP on x86 is simply not relevant enough to > optimize for it. Even in VMs, people run SMP kernels typically even when > they just allocate one CPU to the VM. > > So while we still support the UP config, and we'll let people build > optimized kernels for x86, we've flipped the switch from pessimized for SMP > modules to pessimized for UP modules, which seems like quite the reasonable > trade-off. > > Were it practical to do so, I'd suggest de-orbiting UP on x86. However, > it's a lot of work for not much benefit and we'd need to invent much crazy > to get there. I would distinguish i386 from amd64 here. SMP is pretty rare and exotic in the i386 world. I do have one dual socket Pentium 3 machine here and even though I bought the parts for it used on eBay, it was still pretty pricey. That purchase was kind of a waste since it was shortly before the Athlon 64 X2 CPUs were released. I still have two viable 32-bit x86 machines here that get frequent usage. One runs 24x7 and has a Via C3 CPU. I started looking at migrating off this hardware. To get lower power consumption as well as ECC RAM I'd probably have to go with one of the Supermicro Atom boards. Those are pretty expensive, so I'd probably end up spending about half as much as what it cost to put together my fully-loaded Ryzen machine last summer. At that price, the payback time from the power savings is really long. This machine is mostly idle, so I really don't need more CPU power or RAM. The other machine is my Pentium-M laptop, which is mostly used for light browsing and as a vnc client when I'm on the road. Performance is acceptable for those uses. Both machines run stripped down UP kernels to avoid wasting RAM unnecessarily and to optimize CPU cycles on the laptop. A good reason for continuing UP support on x86 is to make it easy to test UP builds in the MI parts of the kernel so that we don't break things for the embedded architectures. Unfortunately "make universe" currently doesn't have any UP kernels, so I've managed to commit changes that break UP builds and not known it until I received reports of broken builds from other users. From owner-svn-src-head@freebsd.org Sat Jul 7 00:41:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9611110423A2; Sat, 7 Jul 2018 00:41:05 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4847C77CEA; Sat, 7 Jul 2018 00:41:05 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29D9B101B7; Sat, 7 Jul 2018 00:41:05 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w670f41l032262; Sat, 7 Jul 2018 00:41:04 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w670f4da032261; Sat, 7 Jul 2018 00:41:04 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201807070041.w670f4da032261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Sat, 7 Jul 2018 00:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336054 - head/sys/dev/hyperv/vmbus X-SVN-Group: head X-SVN-Commit-Author: dexuan X-SVN-Commit-Paths: head/sys/dev/hyperv/vmbus X-SVN-Commit-Revision: 336054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 00:41:05 -0000 Author: dexuan Date: Sat Jul 7 00:41:04 2018 New Revision: 336054 URL: https://svnweb.freebsd.org/changeset/base/336054 Log: hyperv: Fix boot-up after malloc() returns memory of NX by default now FreeBSD VM can't boot up on Hyper-V after the recent malloc change in r335068: Make UMA and malloc(9) return non-executable memory in most cases. The hypercall page here must be executable. Fix the boot-up issue by adding M_EXEC. PR: 229167 Sponsored by: Microsoft Modified: head/sys/dev/hyperv/vmbus/hyperv.c Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Fri Jul 6 23:49:17 2018 (r336053) +++ head/sys/dev/hyperv/vmbus/hyperv.c Sat Jul 7 00:41:04 2018 (r336054) @@ -284,7 +284,7 @@ hypercall_create(void *arg __unused) * - Assume kmem_malloc() returns properly aligned memory. */ hypercall_context.hc_addr = (void *)kmem_malloc(kernel_arena, PAGE_SIZE, - M_WAITOK); + M_EXEC | M_WAITOK); hypercall_context.hc_paddr = vtophys(hypercall_context.hc_addr); /* Get the 'reserved' bits, which requires preservation. */ From owner-svn-src-head@freebsd.org Sat Jul 7 01:45:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7CD810225BC for ; Sat, 7 Jul 2018 01:45:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 697B67B1C1 for ; Sat, 7 Jul 2018 01:45:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x241.google.com with SMTP id v71-v6so9050068itb.3 for ; Fri, 06 Jul 2018 18:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=RogtuwQSY2H0fXmOdGiLGetYo5opaRf3mJyf/GYiAkM=; b=x36uRiFzW4h4tn32+x4N+Xjnh4mOMFiE0EZmcpySEHCq+NRzYugBsif1ufMZ9sbmey QL+sZ7bdwX8HkBTw71JPbUdsAYXmTA5QwgpmXNLTU8vdygoicjFZ0Ii0VgVFS8r7oJXL N8iXNuFTrUvGO5Ote9EF/ybJziMshLl7TQCP5DsAdV/YCDJx80BRsnVt9FFXyuBcIINW zS+JsXzxwq0T1WBWMM/hkDPWPzAiSXrZHqaVpEku00beodpeC3C22bxWpFwimAZZNP7g 8Bk04h9qXAUJvoIZ00ImhT4FwqzXqIgzDU8v7h+xPvk3wIC9ZCNxnLvJnrjkIc2omcbq QQpw== 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:in-reply-to:references:from :date:message-id:subject:to:cc; bh=RogtuwQSY2H0fXmOdGiLGetYo5opaRf3mJyf/GYiAkM=; b=oWuCA642kQs0RODgJHGkw4oYEV3+dhrdoxaRC0Rq4LPAXSOsJyRkTxQO5Qjwypdt8m 2dbApgbsQ23Qw3pa5OdxRfXfU105phDqytCOXSFk/eGBElWobHgvjGBpc/7m8eG644mw Yz5DtVKJnJTJ5gXNO2YUZU9igHVPL4v2BRjRuzp7WAhMPYNL2mb4gGIAUTZK+Mjn/q6A U53aDxuUZbiM9VAXHTn+seMdlbDEIMczeTtc3q0X7oXdumM8OPjCwGfueWI5LaMvYkk/ m++G/iXHJJDAp3FCYmWPCwGb+Dyk08UReVvUeSP/BojWpBI+M12+TRfCBo6gEmfm/7/h yZEQ== X-Gm-Message-State: APt69E1jMJcNgQjZidAHGGrJlJ+kmZGGvnZ4oWaHyenq6diStWsnJcbc MkkTgSboB1ESJB0kW1nNxCdbC40z+lj2W8UpRxiBwg== X-Google-Smtp-Source: AAOMgpfu+SiPkvs0Oh0B9gtyZLkzWGzvmvwE5FtqVoun4KXsXanbM20iLG1bCJNLXZuc8Web8dtwqfZegsi9Npthv+U= X-Received: by 2002:a24:d0d7:: with SMTP id m206-v6mr9544030itg.1.1530927948531; Fri, 06 Jul 2018 18:45:48 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:1183:0:0:0:0:0 with HTTP; Fri, 6 Jul 2018 18:45:47 -0700 (PDT) X-Originating-IP: [74.62.67.99] In-Reply-To: References: <201807061013.w66ADgbJ087546@repo.freebsd.org> <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 6 Jul 2018 19:45:47 -0600 X-Google-Sender-Auth: lgYYUWdW-k0xKJqn7ZKxG-sRH3k Message-ID: Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: Don Lewis Cc: "Rodney W. Grimes" , Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 01:45:50 -0000 On Fri, Jul 6, 2018 at 6:06 PM, Don Lewis wrote: > On 6 Jul, Warner Losh wrote: > > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > >> > Author: hselasky > >> > Date: Fri Jul 6 10:13:42 2018 > >> > New Revision: 336025 > >> > URL: https://svnweb.freebsd.org/changeset/base/336025 > >> > > >> > Log: > >> > Make sure kernel modules built by default are portable between UP > and > >> > SMP systems by extending defined(SMP) to include > defined(KLD_MODULE). > >> > > >> > This is a regression issue after r335873 . > >> > > >> > Discussed with: mmacy@ > >> > Sponsored by: Mellanox Technologies > >> > >> Though this fixes the issue, it also means that now when > >> anyone intentionally builds a UP kernel with modules > >> they are getting SMP support in the modules and I am > >> not sure they would want that. I know I don't. > >> > > > > > > On UP systems, these additional opcodes are harmless. They take a few > extra > > cycles (since they lock an uncontested bus) and add a couple extra memory > > barriers (which will be NOPs). On MP systems, atomics now work by > default. > > Had we not defaulted like this, all modules built outside of a kernel > build > > env would have broken atomics. Given that (a) the overwhelming majority > > (99% or more) is SMP and (b) the MP code merely adds a few cycles to > what's > > already a not-too-expensive operation, this was the right choice. > > > > It simply doesn't matter for systems that are relevant to the project > > today. While one could try to optimize this a little (for example, by > > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to > if > > (defined(SMP) && SMP != 0)), it's likely not going to matter enough for > > anybody to make the effort. UP on x86 is simply not relevant enough to > > optimize for it. Even in VMs, people run SMP kernels typically even when > > they just allocate one CPU to the VM. > > > > So while we still support the UP config, and we'll let people build > > optimized kernels for x86, we've flipped the switch from pessimized for > SMP > > modules to pessimized for UP modules, which seems like quite the > reasonable > > trade-off. > > > > Were it practical to do so, I'd suggest de-orbiting UP on x86. However, > > it's a lot of work for not much benefit and we'd need to invent much > crazy > > to get there. > > I would distinguish i386 from amd64 here. SMP is pretty rare and exotic > in the i386 world I don't know I'd say that. There's been MP systems widely available since Pentium Pro days. They aren't in laptops, but they were fairly common in i386 land since the mid 90's, especially in server class machines. Not cheap, but not too pricy as to be uncommon.... > I do have one dual socket Pentium 3 machine here and > even though I bought the parts for it used on eBay, it was still pretty > pricey. That purchase was kind of a waste since it was shortly before > the Athlon 64 X2 CPUs were released. > > I still have two viable 32-bit x86 machines here that get frequent > usage. One runs 24x7 and has a Via C3 CPU. I started looking at > migrating off this hardware. To get lower power consumption as well as > ECC RAM I'd probably have to go with one of the Supermicro Atom boards. > Those are pretty expensive, so I'd probably end up spending about half > as much as what it cost to put together my fully-loaded Ryzen machine > last summer. At that price, the payback time from the power savings is > really long. This machine is mostly idle, so I really don't need more > CPU power or RAM. The other machine is my Pentium-M laptop, which is > mostly used for light browsing and as a vnc client when I'm on the road. > Performance is acceptable for those uses. Both machines run stripped > down UP kernels to avoid wasting RAM unnecessarily and to optimize CPU > cycles on the laptop. > > A good reason for continuing UP support on x86 is to make it easy to > test UP builds in the MI parts of the kernel so that we don't break > things for the embedded architectures. Unfortunately "make universe" > currently doesn't have any UP kernels, so I've managed to commit changes > that break UP builds and not known it until I received reports of broken > builds from other users > UP kernels have not changed. The setups that have UP kernels generally need custom ones anyway, since there's so many devices that aren't used. Those setups aren't affected by this change. You raise an interesting point, though: it hasn't been important enough to the project to include a UP kernel in CI testing we've done for years and years... Warner From owner-svn-src-head@freebsd.org Sat Jul 7 01:54:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70780102367A; Sat, 7 Jul 2018 01:54:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 237587B887; Sat, 7 Jul 2018 01:54:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF36110F07; Sat, 7 Jul 2018 01:54:45 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w671sjbt070522; Sat, 7 Jul 2018 01:54:45 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w671sjZK070521; Sat, 7 Jul 2018 01:54:45 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201807070154.w671sjZK070521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 7 Jul 2018 01:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336055 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 336055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 01:54:46 -0000 Author: jeff Date: Sat Jul 7 01:54:45 2018 New Revision: 336055 URL: https://svnweb.freebsd.org/changeset/base/336055 Log: Use the ticks since the last update to reduce hysteresis in the partpopq and contention on the vm_reserv_domain lock. This gives a roughly 8x speedup on will-it-scale fault1 on a 16 core machine. Reviewed by: alc, kib, markj Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sat Jul 7 00:41:04 2018 (r336054) +++ head/sys/vm/vm_reserv.c Sat Jul 7 01:54:45 2018 (r336055) @@ -116,6 +116,12 @@ typedef u_long popmap_t; #define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) /* + * Number of elapsed ticks before we update the LRU queue position. Used + * to reduce contention and churn on the list. + */ +#define PARTPOPSLOP 1 + +/* * Clear a bit in the population map. */ static __inline void @@ -183,6 +189,7 @@ struct vm_reserv { vm_page_t pages; /* (c) first page */ uint16_t domain; /* (c) NUMA domain. */ uint16_t popcnt; /* (r) # of pages in use */ + int lasttick; /* (r) last pop update tick. */ char inpartpopq; /* (d) */ popmap_t popmap[NPOPMAP]; /* (r) bit vector, used pages */ }; @@ -394,6 +401,7 @@ vm_reserv_insert(vm_reserv_t rv, vm_object_t object, v vm_reserv_object_lock(object); rv->pindex = pindex; rv->object = object; + rv->lasttick = ticks; LIST_INSERT_HEAD(&object->rvq, rv, objq); vm_reserv_object_unlock(object); } @@ -430,16 +438,20 @@ vm_reserv_depopulate(vm_reserv_t rv, int index) } popmap_clear(rv->popmap, index); rv->popcnt--; - vm_reserv_domain_lock(rv->domain); - if (rv->inpartpopq) { - TAILQ_REMOVE(&vm_rvq_partpop[rv->domain], rv, partpopq); - rv->inpartpopq = FALSE; + if ((unsigned)(ticks - rv->lasttick) >= PARTPOPSLOP || + rv->popcnt == 0) { + vm_reserv_domain_lock(rv->domain); + if (rv->inpartpopq) { + TAILQ_REMOVE(&vm_rvq_partpop[rv->domain], rv, partpopq); + rv->inpartpopq = FALSE; + } + if (rv->popcnt != 0) { + rv->inpartpopq = TRUE; + TAILQ_INSERT_TAIL(&vm_rvq_partpop[rv->domain], rv, partpopq); + } + vm_reserv_domain_unlock(rv->domain); + rv->lasttick = ticks; } - if (rv->popcnt != 0) { - rv->inpartpopq = TRUE; - TAILQ_INSERT_TAIL(&vm_rvq_partpop[rv->domain], rv, partpopq); - } - vm_reserv_domain_unlock(rv->domain); vmd = VM_DOMAIN(rv->domain); if (rv->popcnt == 0) { vm_reserv_remove(rv); @@ -536,6 +548,10 @@ vm_reserv_populate(vm_reserv_t rv, int index) rv, rv->domain)); popmap_set(rv->popmap, index); rv->popcnt++; + if ((unsigned)(ticks - rv->lasttick) < PARTPOPSLOP && + rv->inpartpopq && rv->popcnt != VM_LEVEL_0_NPAGES) + return; + rv->lasttick = ticks; vm_reserv_domain_lock(rv->domain); if (rv->inpartpopq) { TAILQ_REMOVE(&vm_rvq_partpop[rv->domain], rv, partpopq); From owner-svn-src-head@freebsd.org Sat Jul 7 01:58:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4AD1023CC8; Sat, 7 Jul 2018 01:58:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BCD67BACA; Sat, 7 Jul 2018 01:58:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CA3A10F0C; Sat, 7 Jul 2018 01:58:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w671wetn070738; Sat, 7 Jul 2018 01:58:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w671weiT070737; Sat, 7 Jul 2018 01:58:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201807070158.w671weiT070737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 7 Jul 2018 01:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336056 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 336056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 01:58:41 -0000 Author: jhibbits Date: Sat Jul 7 01:58:40 2018 New Revision: 336056 URL: https://svnweb.freebsd.org/changeset/base/336056 Log: Let ofw_iicbus work its magic on OPAL i2c buses. ofw_iicbus already has attachments on iichb. Rather than adding an explicit attachment onto opal_i2c, simply change the exposed name of the OPAL i2c bus to 'iichb'. Modified: head/sys/powerpc/powernv/opal_i2c.c Modified: head/sys/powerpc/powernv/opal_i2c.c ============================================================================== --- head/sys/powerpc/powernv/opal_i2c.c Sat Jul 7 01:54:45 2018 (r336055) +++ head/sys/powerpc/powernv/opal_i2c.c Sat Jul 7 01:58:40 2018 (r336056) @@ -90,6 +90,7 @@ static int opal_i2c_callback(device_t, int, caddr_t); static int opal_i2c_probe(device_t); static int opal_i2c_transfer(device_t, struct iic_msg *, uint32_t); static int i2c_opal_send_request(uint32_t, struct opal_i2c_request *); +static phandle_t opal_i2c_get_node(device_t bus, device_t dev); static device_method_t opal_i2c_methods[] = { /* Device interface */ @@ -99,6 +100,7 @@ static device_method_t opal_i2c_methods[] = { /* iicbus interface */ DEVMETHOD(iicbus_callback, opal_i2c_callback), DEVMETHOD(iicbus_transfer, opal_i2c_transfer), + DEVMETHOD(ofw_bus_get_node, opal_i2c_get_node), DEVMETHOD_END }; @@ -111,7 +113,7 @@ static device_method_t opal_i2c_methods[] = { static devclass_t opal_i2c_devclass; static driver_t opal_i2c_driver = { - "i2c", + "iichb", opal_i2c_methods, sizeof(struct opal_i2c_softc), }; @@ -244,6 +246,14 @@ opal_i2c_callback(device_t dev, int index, caddr_t dat } return (error); +} + +static phandle_t +opal_i2c_get_node(device_t bus, device_t dev) +{ + + /* Share controller node with iibus device. */ + return (ofw_bus_get_node(bus)); } DRIVER_MODULE(opal_i2c, opal_i2cm, opal_i2c_driver, opal_i2c_devclass, NULL, From owner-svn-src-head@freebsd.org Sat Jul 7 02:18:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD59C1025ED3; Sat, 7 Jul 2018 02:18:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 6364C7C702; Sat, 7 Jul 2018 02:18:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 5BDCF113D7; Sat, 7 Jul 2018 02:18:56 +0000 (UTC) Date: Sat, 7 Jul 2018 02:18:56 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336046 - in head/sys: amd64/include i386/include sys Message-ID: <20180707021856.GA80349@FreeBSD.org> References: <201807061950.w66JoP2F081328@repo.freebsd.org> <20180706195237.GS5562@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180706195237.GS5562@kib.kiev.ua> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 02:18:56 -0000 On Fri, Jul 06, 2018 at 10:52:37PM +0300, Konstantin Belousov wrote: > On Fri, Jul 06, 2018 at 07:50:25PM +0000, Konstantin Belousov wrote: > > New Revision: 336046 > > URL: https://svnweb.freebsd.org/changeset/base/336046 > > > > Log: > > Revert to recommit with the proper message. > > I am sorry for the second mistake of the same sort in the day. It would be much easier if we'd allowed "svn propedit --revprop svn:log". ./danfe From owner-svn-src-head@freebsd.org Sat Jul 7 02:31:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE7A210274F4; Sat, 7 Jul 2018 02:31:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 66B7C7CFD2; Sat, 7 Jul 2018 02:31:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 453A51164C; Sat, 7 Jul 2018 02:31:53 +0000 (UTC) Date: Sat, 7 Jul 2018 02:31:53 +0000 From: Alexey Dokuchaev To: Don Lewis Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , "Rodney W. Grimes" , Hans Petter Selasky Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include Message-ID: <20180707023153.GB80349@FreeBSD.org> References: <201807061013.w66ADgbJ087546@repo.freebsd.org> <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 02:31:53 -0000 On Fri, Jul 06, 2018 at 05:06:03PM -0700, Don Lewis wrote: > The other machine is my Pentium-M laptop, which is mostly used for light > browsing and as a VNC client when I'm on the road. Performance is > acceptable for those uses. Both machines run stripped down UP kernels to > avoid wasting RAM unnecessarily and to optimize CPU cycles on the laptop. > > [...] I've managed to commit changes that break UP builds and not known > it until I received reports of broken builds from other users. :-) That's funny: you run custom UP kernels, and yet managed to break UP builds with the breakage being unknown to you until you received reports from other users, lol. On a related note, did you measure how much (e.g. in terms of battery life) your laptop gains from using the UP kernel? Could you also share your config? I'm using Pentium-M laptop as my primary machine as well, and always eager to squeeze something more out of it. Thanks, ./danfe From owner-svn-src-head@freebsd.org Sat Jul 7 04:42:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB02F1033038; Sat, 7 Jul 2018 04:42:31 +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 39CB582467; Sat, 7 Jul 2018 04:42:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id bf37fj3RBbP3Ibf38fY2RL; Fri, 06 Jul 2018 22:42:23 -0600 X-Authority-Analysis: v=2.3 cv=P64UeBIu c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=R9QF1RCXAYgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=0SNF9felXnpvx8fNHRkA:9 a=FGpEXLuv19PSDgP7:21 a=FYxN6gWI4VtkaOeG: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 A310B123; Fri, 6 Jul 2018 21:42:20 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w674gJcQ025508; Fri, 6 Jul 2018 21:42:19 -0700 (PDT) (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 w674gJVr025505; Fri, 6 Jul 2018 21:42:19 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807070442.w674gJVr025505@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: Konstantin Belousov cc: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336031 - head/usr.bin/top In-Reply-To: Message from Konstantin Belousov of "Fri, 06 Jul 2018 16:56:34 +0300." <20180706135634.GP5562@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 06 Jul 2018 21:42:19 -0700 X-CMAE-Envelope: MS4wfBDtlnhpi1XN+09+AaktrRcCy9UzSTmX9dkF8FE1QpTZk08TyePEOGR1NhVOTnbsyyMuUJr9vCS+cXlglJtr61OYIO1LI/DoVKDeinUuIfP8RoPUHwMa rmT1iF8WF/sZn7lVl+y6PqIRmw7aShZmwhbbZPiMLaVIiR1+wBp13b6Z+SeyBh2XifK7vqiZTz69F56uLpnGvFscYgQIvuV7kJqEVjErKT3+l9X+NgHZW7A0 L6SvwPktT85WTDuYVpiSiiq34lg8Zmz8jsMixP5DXSonOS1Tqe5a5+R+6ks42owHPoxXrhqblbt08c7shb1N2A== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 04:42:32 -0000 In message <20180706135634.GP5562@kib.kiev.ua>, Konstantin Belousov writes: > On Fri, Jul 06, 2018 at 01:22:44PM +0000, Sean Bruno wrote: > > Author: sbruno > > Date: Fri Jul 6 13:22:44 2018 > > New Revision: 336031 > > URL: https://svnweb.freebsd.org/changeset/base/336031 > > > > Log: > > r336028 changed next_msg to a char * from char [] of fixed size. Change > > 2nd argument of vsnprintf() to get the strlen of next_msg so that the > > appropriate size is used. > > > > Found with gcc. > > > > /usr.bin/top/display.c: In function 'new_message': > > /usr.bin/top/display.c:963:31: error: > > argument to 'sizeof' in 'vsnprintf' call is the same expression as the > > destination; did you mean to provide an explicit length? > > [-Werror=sizeof-pointer-memaccess] > > vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); > > > > Reviewed by: daichi > > > > Modified: > > head/usr.bin/top/display.c > > > > Modified: head/usr.bin/top/display.c > > =========================================================================== > === > > --- head/usr.bin/top/display.c Fri Jul 6 12:44:48 2018 (r33603 > 0) > > +++ head/usr.bin/top/display.c Fri Jul 6 13:22:44 2018 (r33603 > 1) > > @@ -960,7 +960,7 @@ new_message(int type, const char *msgfmt, ...) > > va_start(args, msgfmt); > > > > /* first, format the message */ > > - vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); > > + vsnprintf(next_msg, strlen(next_msg), msgfmt, args); > I highly suspect that this strlen() call returns zero, always. Yes. OTOH sizeof(next_msg) won't return much useful either, as it returns the size of the pointer. > > > > > va_end(args); > > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Jul 7 05:07:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDC8F1034E5C; Sat, 7 Jul 2018 05:07:00 +0000 (UTC) (envelope-from truckman@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 71140830EC; Sat, 7 Jul 2018 05:07:00 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id 5EC1E1595D; Sat, 7 Jul 2018 05:06:59 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Fri, 6 Jul 2018 22:06:57 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: Warner Losh cc: "Rodney W. Grimes" , Hans Petter Selasky , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: Message-ID: References: <201807061013.w66ADgbJ087546@repo.freebsd.org> <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 05:07:01 -0000 On 6 Jul, Warner Losh wrote: > On Fri, Jul 6, 2018 at 6:06 PM, Don Lewis wrote: > >> On 6 Jul, Warner Losh wrote: >> > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < >> > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >> > >> >> > Author: hselasky >> >> > Date: Fri Jul 6 10:13:42 2018 >> >> > New Revision: 336025 >> >> > URL: https://svnweb.freebsd.org/changeset/base/336025 >> >> > >> >> > Log: >> >> > Make sure kernel modules built by default are portable between UP >> and >> >> > SMP systems by extending defined(SMP) to include >> defined(KLD_MODULE). >> >> > >> >> > This is a regression issue after r335873 . >> >> > >> >> > Discussed with: mmacy@ >> >> > Sponsored by: Mellanox Technologies >> >> >> >> Though this fixes the issue, it also means that now when >> >> anyone intentionally builds a UP kernel with modules >> >> they are getting SMP support in the modules and I am >> >> not sure they would want that. I know I don't. >> >> >> > >> > >> > On UP systems, these additional opcodes are harmless. They take a few >> extra >> > cycles (since they lock an uncontested bus) and add a couple extra memory >> > barriers (which will be NOPs). On MP systems, atomics now work by >> default. >> > Had we not defaulted like this, all modules built outside of a kernel >> build >> > env would have broken atomics. Given that (a) the overwhelming majority >> > (99% or more) is SMP and (b) the MP code merely adds a few cycles to >> what's >> > already a not-too-expensive operation, this was the right choice. >> > >> > It simply doesn't matter for systems that are relevant to the project >> > today. While one could try to optimize this a little (for example, by >> > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to >> if >> > (defined(SMP) && SMP != 0)), it's likely not going to matter enough for >> > anybody to make the effort. UP on x86 is simply not relevant enough to >> > optimize for it. Even in VMs, people run SMP kernels typically even when >> > they just allocate one CPU to the VM. >> > >> > So while we still support the UP config, and we'll let people build >> > optimized kernels for x86, we've flipped the switch from pessimized for >> SMP >> > modules to pessimized for UP modules, which seems like quite the >> reasonable >> > trade-off. >> > >> > Were it practical to do so, I'd suggest de-orbiting UP on x86. However, >> > it's a lot of work for not much benefit and we'd need to invent much >> crazy >> > to get there. >> >> I would distinguish i386 from amd64 here. SMP is pretty rare and exotic >> in the i386 world > > > I don't know I'd say that. There's been MP systems widely available since > Pentium Pro days. They aren't in laptops, but they were fairly common in > i386 land since the mid 90's, especially in server class machines. Not > cheap, but not too pricy as to be uncommon.... Back in the mid-90's to early 00's I was running a fairly large collection of i386-class FreeBSD servers, starting with Pentium CPUs which were mostly replaced by Pentium III's by the end. They used desktop motherboards and were all UP. They were stacked on shelves in our raised-floor computer room next to the VAX, so I consider them servers. We stopped at FreeBSD 4.x, so SMP would not have been that great anyway. The Pentium III motherboard that I purchased required the use of special Pentium III CPU chips. They were hard to find on Ebay as I recall. What is kind of funny is that the workloads I was running back in those days were mostly I/O bound. Now that CPUs have gotten so much faster and CPUs have grown so many cores, my workloads are now mostly CPU limited. From owner-svn-src-head@freebsd.org Sat Jul 7 05:08:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5739310351D5; Sat, 7 Jul 2018 05:08:57 +0000 (UTC) (envelope-from truckman@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 0A0C58335A; Sat, 7 Jul 2018 05:08:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id D95E21595E; Sat, 7 Jul 2018 05:08:55 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Fri, 6 Jul 2018 22:08:54 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include To: Alexey Dokuchaev cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , "Rodney W. Grimes" , Hans Petter Selasky Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 05:08:57 -0000 On 7 Jul, Alexey Dokuchaev wrote: > On Fri, Jul 06, 2018 at 05:06:03PM -0700, Don Lewis wrote: >> The other machine is my Pentium-M laptop, which is mostly used for light >> browsing and as a VNC client when I'm on the road. Performance is >> acceptable for those uses. Both machines run stripped down UP kernels to >> avoid wasting RAM unnecessarily and to optimize CPU cycles on the laptop. >> >> [...] I've managed to commit changes that break UP builds and not known >> it until I received reports of broken builds from other users. > > :-) That's funny: you run custom UP kernels, and yet managed to break UP > builds with the breakage being unknown to you until you received reports > from other users, lol. Yeah, definitely ironic ... The Via machine basically only gets security updates. With only 256 MB of RAM, it's probably too wimpy to self-host, and I hate to think about how long buildworld would take. I cross build releases on a more modern machine and use a custom freebsd-update to keep it up to date, with itself is a PITA. I think packaged base would be less of a hassle. The laptop gets more frequent updates and is able to self-host. Doing buildworld + buildkernel takes a really long time. It looks like my last buildworld (11-STABLE) took nearly 14 hours. This was my fastest machine for quite a while. I'm planning on doing an update this weekend in preparation for an upcoming trip. > On a related note, did you measure how much (e.g. in terms of battery > life) your laptop gains from using the UP kernel? Could you also share > your config? I'm using Pentium-M laptop as my primary machine as well, > and always eager to squeeze something more out of it. Thanks, I don't have any data for battery life. Almost all of my usage is with line power. Config file: include GENERIC nooptions SMP nodevice ahci nodevice mvs nodevice siis nodevice ahc nodevice ahd nodevice esp nodevice hptiop nodevice isp nodevice mpt nodevice mps nodevice mpr nodevice ncr nodevice sym nodevice trm nodevice adv nodevice adw nodevice aha nodevice aic nodevice bt nodevice ncv nodevice nsp nodevice stg nodevice isci nodevice ch nodevice ses nodevice ctl nodevice amr nodevice arcmsr nodevice asr nodevice ciss nodevice dpt nodevice hptmv nodevice hptnr nodevice hptrr nodevice hpt27xx nodevice iir nodevice ips nodevice mly nodevice twa nodevice tws nodevice aac nodevice aacp nodevice aacraid nodevice ida nodevice mfi nodevice mlx nodevice mrsas nodevice pmspcv nodevice pst nodevice twe nodevice nvme nodevice nvd nodevice puc nodevice bxe nodevice de nodevice em nodevice igb nodevice ixgb nodevice le nodevice ti nodevice txp nodevice vx nodevice ae nodevice age nodevice alc nodevice ale nodevice bce nodevice bfe nodevice bge nodevice cas nodevice dc nodevice et nodevice gem nodevice hme nodevice jme nodevice lge nodevice msk nodevice nge nodevice nve nodevice pcn nodevice sf nodevice sge nodevice sis nodevice sk nodevice ste nodevice stge nodevice tl nodevice tx nodevice vge nodevice vr nodevice vte nodevice wb nodevice xl nodevice cs nodevice ed nodevice ex nodevice ep nodevice fe nodevice ie nodevice sn nodevice xe nodevice bwi nodevice bwn nodevice ipw nodevice iwi nodevice iwn nodevice malo nodevice mwl nodevice ral nodevice wi nodevice wpi nodevice virtio nodevice virtio_pci nodevice vtnet nodevice virtio_blk nodevice virtio_scsi nodevice virtio_balloon nooptions HYPERV nodevice hyperv nooptions XENHVM nodevice xenpci nodevice vmx From owner-svn-src-head@freebsd.org Sat Jul 7 11:18:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB38610358A0; Sat, 7 Jul 2018 11:18:27 +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 6586070A99; Sat, 7 Jul 2018 11:18:27 +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 46DA916A38; Sat, 7 Jul 2018 11:18:27 +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 w67BIRir059181; Sat, 7 Jul 2018 11:18:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67BIRrd059180; Sat, 7 Jul 2018 11:18:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201807071118.w67BIRrd059180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Jul 2018 11:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336057 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 336057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 11:18:27 -0000 Author: tuexen Date: Sat Jul 7 11:18:26 2018 New Revision: 336057 URL: https://svnweb.freebsd.org/changeset/base/336057 Log: When initializing the TCP FO client cookie cache, take into account whether the TCP FO support is enabled or not for the client side. The code in tcp_fastopen_init() implicitly assumed that the sysctl variable V_tcp_fastopen_client_enable was initialized to 0. This was initially true, but was changed in r335610, which unmasked this bug. Thanks to Pieter de Goeje for reporting the issue on freebsd-net@ Modified: head/sys/netinet/tcp_fastopen.c Modified: head/sys/netinet/tcp_fastopen.c ============================================================================== --- head/sys/netinet/tcp_fastopen.c Sat Jul 7 01:58:40 2018 (r336056) +++ head/sys/netinet/tcp_fastopen.c Sat Jul 7 11:18:26 2018 (r336057) @@ -408,7 +408,13 @@ tcp_fastopen_init(void) TAILQ_INIT(&V_tcp_fastopen_ccache.base[i].ccb_entries); mtx_init(&V_tcp_fastopen_ccache.base[i].ccb_mtx, "tfo_ccache_bucket", NULL, MTX_DEF); - V_tcp_fastopen_ccache.base[i].ccb_num_entries = -1; /* bucket disabled */ + if (V_tcp_fastopen_client_enable) { + /* enable bucket */ + V_tcp_fastopen_ccache.base[i].ccb_num_entries = 0; + } else { + /* disable bucket */ + V_tcp_fastopen_ccache.base[i].ccb_num_entries = -1; + } V_tcp_fastopen_ccache.base[i].ccb_ccache = &V_tcp_fastopen_ccache; } @@ -824,6 +830,9 @@ sysctl_net_inet_tcp_fastopen_client_enable(SYSCTL_HAND /* enabled -> disabled */ for (i = 0; i < V_tcp_fastopen_ccache.buckets; i++) { ccb = &V_tcp_fastopen_ccache.base[i]; + KASSERT(ccb->ccb_num_entries > -1, + ("%s: ccb->ccb_num_entries %d is negative", + __func__, ccb->ccb_num_entries)); tcp_fastopen_ccache_bucket_trim(ccb, 0); } V_tcp_fastopen_client_enable = 0; From owner-svn-src-head@freebsd.org Sat Jul 7 11:39:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 437221039FDB; Sat, 7 Jul 2018 11:39:42 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from mr22p34im-asmtp002.me.com (mr22p34im-asmtp002.me.com [17.111.211.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A73BE71DC5; Sat, 7 Jul 2018 11:39:41 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from process-dkim-sign-daemon.mr22p34im-asmtp002.me.com by mr22p34im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0PBH00G00UOEWT00@mr22p34im-asmtp002.me.com>; Sat, 07 Jul 2018 11:39:40 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by mr22p34im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0PBH00MOZV1XTV40@mr22p34im-asmtp002.me.com>; Sat, 07 Jul 2018 11:39:39 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-07-07_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1807070140 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r336028 - head/usr.bin/top From: =?utf-8?B?5b6M6Jek5aSn5Zyw?= In-reply-to: <20180707.085353.1746062843251989845.hrs@allbsd.org> Date: Sat, 07 Jul 2018 20:39:33 +0900 Cc: daichi@FreeBSD.org, Eitan Adler , gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: References: <201807061207.w66C76CR043533@repo.freebsd.org> <20180707.085353.1746062843251989845.hrs@allbsd.org> To: Hiroki Sato X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 11:39:42 -0000 > 2018/07/07 8:53=E3=80=81Hiroki Sato =E3=81=AE=E3=83=A1=E3= =83=BC=E3=83=AB: >=20 > Daichi GOTO wrote > in <201807061207.w66C76CR043533@repo.freebsd.org>: >=20 > da> Author: daichi > da> Date: Fri Jul 6 12:07:06 2018 > da> New Revision: 336028 > da> URL: https://svnweb.freebsd.org/changeset/base/336028 > da> > da> Log: > da> Changed to eliminate the upper limit of command length displayed > da> by "-a" and expand to match terminal width > da> > da> Reviewed by: eadler > da> Approved by: gnn (mentor) > da> Differential Revision: https://reviews.freebsd.org/D16083 > da> > da> Modified: > da> head/usr.bin/top/display.c > da> head/usr.bin/top/machine.c > da> head/usr.bin/top/screen.c > da> head/usr.bin/top/top.h >=20 > This change breaks displaying a prompt and messages in the > interactive mode by new_message() when typing "o" or "p", for > example. While r336031 fixed a warning in GCC, it does not fix the > problem itself. Please fix it. OK. I will fix this problem first. > I also think restructure of the buffer management is required first > if we want to eliminate the column width limitation. Using sbuf(9) > consistently may be better than incomplete conversion from static > arrays to malloc(). I understand. Switching to sbuf(9) is the next step. >=20 > -- Hiroki From owner-svn-src-head@freebsd.org Sat Jul 7 11:53:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFC2B103B5B8; Sat, 7 Jul 2018 11:53:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F9B8728CB; Sat, 7 Jul 2018 11:53:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 804C0170B3; Sat, 7 Jul 2018 11:53:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67BrdX1079486; Sat, 7 Jul 2018 11:53:39 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67BrdYP079485; Sat, 7 Jul 2018 11:53:39 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201807071153.w67BrdYP079485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 7 Jul 2018 11:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336060 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 336060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 11:53:40 -0000 Author: ed Date: Sat Jul 7 11:53:39 2018 New Revision: 336060 URL: https://svnweb.freebsd.org/changeset/base/336060 Log: Allow the use of slashes in process names of RFC 3164 formatted messages. Tools such as Postfix use slashes in process names for hierarchy (postfix/qmgr). By allowing these slashes, syslogd is able to extract the process name and process ID nicely, so that they can be stored in RFC 5424 message fields. MFC after: 1 week Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Jul 7 11:39:20 2018 (r336059) +++ head/usr.sbin/syslogd/syslogd.c Sat Jul 7 11:53:39 2018 (r336060) @@ -1120,7 +1120,7 @@ parsemsg_rfc3164_app_name_procid(char **msg, const cha "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789" - "_-"); + "_-/"); if (app_name_length == 0) goto bad; m += app_name_length; From owner-svn-src-head@freebsd.org Sat Jul 7 12:28:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F181B103F159; Sat, 7 Jul 2018 12:28:17 +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 9F5287421C; Sat, 7 Jul 2018 12:28:17 +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 8138E1758E; Sat, 7 Jul 2018 12:28:17 +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 w67CSHAa094966; Sat, 7 Jul 2018 12:28:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67CSHFD094964; Sat, 7 Jul 2018 12:28:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201807071228.w67CSHFD094964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Jul 2018 12:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336061 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 336061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 12:28:18 -0000 Author: tuexen Date: Sat Jul 7 12:28:16 2018 New Revision: 336061 URL: https://svnweb.freebsd.org/changeset/base/336061 Log: Allow alternate TCP stack to populate the TCP FO client cookie cache. Without this patch, TCP FO could be used when using alternate TCP stack, but only existing entires in the TCP client cookie cache could be used. This cache was not populated by connections using alternate TCP stacks. Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Sat Jul 7 11:53:39 2018 (r336060) +++ head/sys/netinet/tcp_stacks/fastpath.c Sat Jul 7 12:28:16 2018 (r336061) @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef TCPDEBUG #include #endif /* TCPDEBUG */ @@ -1761,6 +1762,13 @@ tcp_do_segment_fastslow(struct mbuf *m, struct tcphdr if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; + if (IS_FASTOPEN(tp->t_flags)) { + if (to.to_flags & TOF_FASTOPEN) + tcp_fastopen_update_cache(tp, to.to_mss, + to.to_tfo_len, to.to_tfo_cookie); + else + tcp_fastopen_disable_path(tp); + } } /* @@ -2211,6 +2219,13 @@ tcp_do_segment_fastack(struct mbuf *m, struct tcphdr * if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; + if (IS_FASTOPEN(tp->t_flags)) { + if (to.to_flags & TOF_FASTOPEN) + tcp_fastopen_update_cache(tp, to.to_mss, + to.to_tfo_len, to.to_tfo_cookie); + else + tcp_fastopen_disable_path(tp); + } } /* Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sat Jul 7 11:53:39 2018 (r336060) +++ head/sys/netinet/tcp_stacks/rack.c Sat Jul 7 12:28:16 2018 (r336061) @@ -6656,6 +6656,13 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; + if (IS_FASTOPEN(tp->t_flags)) { + if (to.to_flags & TOF_FASTOPEN) + tcp_fastopen_update_cache(tp, to.to_mss, + to.to_tfo_len, to.to_tfo_cookie); + else + tcp_fastopen_disable_path(tp); + } } /* * At this point we are at the initial call. Here we decide From owner-svn-src-head@freebsd.org Sat Jul 7 13:35:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 817C610452B7; Sat, 7 Jul 2018 13:35:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27E5E76E63; Sat, 7 Jul 2018 13:35:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03254180B8; Sat, 7 Jul 2018 13:35:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67DZ6Bk031107; Sat, 7 Jul 2018 13:35:06 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67DZ6rl031106; Sat, 7 Jul 2018 13:35:06 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807071335.w67DZ6rl031106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 7 Jul 2018 13:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336062 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 336062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 13:35:07 -0000 Author: sbruno Date: Sat Jul 7 13:35:06 2018 New Revision: 336062 URL: https://svnweb.freebsd.org/changeset/base/336062 Log: struct ifmediareq *ifmrp is only used in the COMPAT_FREEBSD32 parts of ifioctl(). Move it inside the proper #ifdef. This was throwing a valid "Assigned but unused" warning with gcc. Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D16063 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Jul 7 12:28:16 2018 (r336061) +++ head/sys/net/if.c Sat Jul 7 13:35:06 2018 (r336062) @@ -2969,8 +2969,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s #ifdef COMPAT_FREEBSD32 caddr_t saved_data = NULL; struct ifmediareq ifmr; -#endif struct ifmediareq *ifmrp; +#endif struct ifnet *ifp; struct ifreq *ifr; int error; @@ -3016,8 +3016,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s #endif } - ifmrp = NULL; #ifdef COMPAT_FREEBSD32 + ifmrp = NULL; switch (cmd) { case SIOCGIFMEDIA32: case SIOCGIFXMEDIA32: From owner-svn-src-head@freebsd.org Sat Jul 7 13:37:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0254D1045622; Sat, 7 Jul 2018 13:37:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A68AB77128; Sat, 7 Jul 2018 13:37:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88368180C3; Sat, 7 Jul 2018 13:37:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67DbiD6031350; Sat, 7 Jul 2018 13:37:44 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67Dbif9031349; Sat, 7 Jul 2018 13:37:44 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201807071337.w67Dbif9031349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 7 Jul 2018 13:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336063 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 336063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 13:37:45 -0000 Author: sbruno Date: Sat Jul 7 13:37:44 2018 New Revision: 336063 URL: https://svnweb.freebsd.org/changeset/base/336063 Log: Wrap the declaration and assignment of "stripe" with #ifdef NUMA declarations as not all targets are NUMA aware. Found with gcc. Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D16113 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Jul 7 13:35:06 2018 (r336062) +++ head/sys/vm/uma_core.c Sat Jul 7 13:37:44 2018 (r336063) @@ -2860,7 +2860,9 @@ zone_import(uma_zone_t zone, void **bucket, int max, i { uma_slab_t slab; uma_keg_t keg; +#ifdef NUMA int stripe; +#endif int i; slab = NULL; @@ -2870,7 +2872,9 @@ zone_import(uma_zone_t zone, void **bucket, int max, i if ((slab = zone->uz_slab(zone, keg, domain, flags)) == NULL) break; keg = slab->us_keg; +#ifdef NUMA stripe = howmany(max, vm_ndomains); +#endif while (slab->us_freecount && i < max) { bucket[i++] = slab_alloc_item(keg, slab); if (keg->uk_free <= keg->uk_reserve) From owner-svn-src-head@freebsd.org Sat Jul 7 14:09:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B7271023F03; Sat, 7 Jul 2018 14:09:03 +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 C833D78731; Sat, 7 Jul 2018 14:09:02 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (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 A08952700220; Sat, 7 Jul 2018 10:08:55 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu A08952700220 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=1530972535; bh=A39a0cSiSg3PgJ+OUUt5geKDs7tyGdXQvaoqGusKYEA=; h=Subject:To:From:Date:From; b=I1vYbEV4Bz91JdDVY3b8sZ0kcBK8zjk62b8iUGEM+3hZkmhGF1wfd9TYZpf722835 pvy7atGbw5Gso2cXZ5b7CyOsHzfkc2fWEdjE198Sp7QkahOY0+7si1sniIuLCrJXtL IM0UHV8McMMwz0/9oQR0puBXQbjC7vI0vnkJmB+twJLX2m9ZeX0G6ncyYZIWPUmc+y 2X2gTh1P1wg+6qy6mLjL1gQWkhOcMOjJhX6jfZt6LgJo5JTbTeAoQz0n7tR2V1nnSC /V0mVIpT0NbroP6FJmhlo/MIbStLxuB4jNaCQnAzffnWS9N4n4ooU8taYc+1sYvL3f Ef35QvKvJAGIg== Subject: Re: svn commit: r335967 - head/sys/dev/mxge To: Rick Macklem Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201807050120.w651KP5K045633@pdx.rh.CN85.dnsmgr.net> <97ae3381-7c25-7b41-9670-84b825722f52@cs.duke.edu> From: Andrew Gallatin Message-ID: Date: Sat, 7 Jul 2018 10:08:55 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 14:09:03 -0000 On 07/05/18 17:14, Rick Macklem wrote: > Andrew Gallatin wrote: > On 7/4/18 9:20 PM, Rodney W. Grimes wrote: > [stuff snipped] >>> >>> It is using a magic constant twice, where one has a >>> derived value that is dependent on the value of the other. >>> That is bad and error prone and does not document that >>> one depends on the other. Please fix this. Or at least >>> make 65536 a #define so that it only needs changed one >>> place and clearly shows the interdependence of these >>> values. >> >> To me, 65536 is one of the few cases where the magic number is >> more meaningful than a name. But fine, if you feel that >> strongly about it, I'll change it for you. > > Btw, in general, if_hw_tsomax and if_hw_tsomaxsegsize are not > related or the same value. It just happens that they both appear > to be related to 64K in this case. (I believe this is fairly common, > since the original Microsoft "standard" used 64K as a limit, since > it was stored in 16bits.) Yes; exactly. > if_hw_tsomax is the maximum size of the entire TSO segment, > including MAC level headers (commonly 64K, due to Mircosoft... > but could be larger if the hardware guys chose to do so). Given that we do TSO like Linux, and not like MS (meaning we express the size of the pre-segmented packet using the a 16-bit value in the IPv4/IPv6 header), supporting more than 64K is not possible in FreeBSD, so I'm basically saying "nerf this constraint". MS windows does it better / different; they express the size of the pre-segmented packet in packet metadata, leaving ip->ip_len = 0. This is better, since then the pseudo hdr checksum in the template header can be re-used (with the len added) for every segment by the NIC. If you've ever seen a driver set ip->ip_len = 0, and re-calc the pseudo-hdr checksum, that's why. This is also why MS LSOv2 can support TSO of packets larger than 64K, since they're not constrained by the 16-bit value in the IP{4,6} header. The value of TSO larger than 64K is questionable at best though. Without pacing, you'd just get more packets dropped when talking across the internet.. > if_hw_tsomaxsegsize is the maximum size of contiguous memory > that a "chunk" of the TSO segment can be stored in for handling by > the driver's transmit side. Since higher And this is what I object to. TCP should not care about this. Drivers should use busdma, or otherwise be capable of chopping large contig regions down to chunks that they can handle. If a driver can really only handle 2K, then it should be having busdma give it an s/g list that is 2x as long, not having TCP call m_dupcl() 2x as often on page-sized data generated by sendfile (or more on non-x86 with larger pages). > level code such as NFS (and iSCSI, I think?) uses MCLBYTE clusters, > anything 2K or higher normally works the same. Not sure about > sosend(), but I think it also copies the data into MCLBYTE clusters? > This would change if someday jumbo mbuf clusters become the norm. > (I tried changing the NFS code to use jumbo clusters, but it would > result in fragmentation of the memory used for mbuf cluster allocation, > so I never committed it.) At least for sendfile(), vm pages are wrapped up and attached to mbufs, so you have 4K (and potentially much more on non-x86). Doesn't NFS do something similar when sending data, or do you copy into clusters? I have changes which I have not upstreamed yet which enhance mbufs to carry TLS metadata & vector of physical addresses (which I call unmapped mbufs) for sendfile and kernel TLS. As part of that, sosend (for kTLS) can allocate many pages and attach them to one mbuf. The idea (for kTLS) is that you can keep an entire TLS record (with framing information) in a single unmapped mbuf, which saves a huge amount of CPU which would be lost to cache misses doing pointer-chasing of really long mbuf chains (TLS hdrs and trailers are generally 13 and 16 bytes). The goal was to regain CPU during Netflix's transition to https streaming. However, it is unintentionally quite helpful on i386, since it reduces overhead from having to map/unmap sf_bufs. FWIW, these mbufs have been in production at Netflix for over a year, and carry a large fraction of the worlds internet traffic :) > rick > ps: And I'll admit I don't find 65536 very magic;-) > :) Drew From owner-svn-src-head@freebsd.org Sat Jul 7 14:31:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA03A10260F8; Sat, 7 Jul 2018 14:31:02 +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 5133B79D45; Sat, 7 Jul 2018 14:31:02 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (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 D32732700220; Sat, 7 Jul 2018 10:31:00 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu D32732700220 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=1530973861; bh=KmAqW2w8ohfS0Vy4s0F75F8BvYIz51vhk8D1BcKzuK0=; h=Subject:To:From:Date:From; b=kq/1zM0lucL0j0lED5Yw3dl8ltZfNObodqwofgG8lkuWespDPy9fW7o6TVZ9yAx9y T3K5DUTc4Bfx2fExzpP9/LDZvPk+jZVaI3UOezD9BFs9K+YUHS7V8pCH2p5joQfbXl yPJ5z30ExmVr5bSc6ekWFiDxS1j9BmF91OHvMQGZfLKbeCTXeuaLChQ7A299PYZLcs oNvHrZ+ghJ8WIWXAleoVUHCExFZ3hQhimS5o2eVktRH+ATI8A7I2PsJH//MPyg3liU sW/eOhOdwrXf8YuIcln2dpth/kw3SnnRI8OpwzliRKi7WW7FtK7MabkVt4ce583gR1 JC0nWQhule3Cw== Subject: Re: svn commit: r336042 - head/sys/dev/cxgbe/common To: Navdeep Parhar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807061933.w66JXwOn075673@repo.freebsd.org> From: Andrew Gallatin Message-ID: Date: Sat, 7 Jul 2018 10:31:00 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201807061933.w66JXwOn075673@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 14:31:02 -0000 On 07/06/18 15:33, Navdeep Parhar wrote: > > Log: > cxgbe(4): Assume that any unknown flash on the card is 4MB and has 64KB > sectors, instead of refusing to attach to the card. > Thank you! Drew From owner-svn-src-head@freebsd.org Sat Jul 7 15:03:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B38EE10292A5; Sat, 7 Jul 2018 15:03:00 +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 58B6E7B61C; Sat, 7 Jul 2018 15:03:00 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (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 E543F2700220; Sat, 7 Jul 2018 11:02:58 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu E543F2700220 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=1530975779; bh=Ok2uGiDbcLwBm8EpgF9UEK+3PeUKl+pSk7IvOOi5jwo=; h=Subject:From:Date:From; b=Vtt3fJs1N37W4zMVNElBy9aJ0UU6YakBAZtGp4VcvDyGlpFrtzA1XJqxCwNyG+U60 XTVJ+5aMUp2ktpDb8WxUnDfFjSI7ObuLlAybwTU2dLWimVjQhHxRmG4E+AHNTvMNvD mOrNR8Xheivy4csG/c94eNIc1sTU2QblY/h0DeDVNC3fvIGPxYII9aW0xnla75D+Gx ppd6uTo93ViXPSmBo6C+joclY2MonFLIEQ5WO3G5KDxLW0fMZJ5hHrmtrsM2p0KuD8 0NvhwPvyofZYJC4eKnAwh985gQwE58b46AGHA2G7ScOPw9oZVKnq06HMPW7f9D8R3N uWD3VybBHpusw== Subject: Re: svn commit: r335916 - head/sys/conf Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> From: Andrew Gallatin Message-ID: <51ec1e54-c940-9800-5c84-0f9b6e08895f@cs.duke.edu> Date: Sat, 7 Jul 2018 11:02:58 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:03:00 -0000 On 07/05/18 19:59, John Baldwin wrote: > You misunderstand. /usr/local/sys/modules would hold module sources so that > they can be recompiled when building a kernel without having to rebuild the > package or reinstall the package. Binary modules would continue to be > installed in /boot/modules. > This is very similar to the approach that many Linux distributions take with DKMS. The kernel sources for out-of-tree modules are kept around, and every time a kernel is installed, its new header files are used to re-compile the out-of-tree module. Similarly, when you install a package containing a kernel module, it is re-compiled and installed for every installed kernel. One thing that was tangentially brought up is that the ability to compile out-of-tree modules requires keeping the kernel-headers around. So we may need to identify all the headers that a module might need, and install them in /boot/$KERNEL/sys or some-such. This would be needed if, for example, we wanted to install a new Nvidia or Virtual Box module and have it work for older installed kernel versions too (eg, across ABI breaking changes in -current). This would certainly make life easier for people running -current. This system works quite well on Linux. For comparison, I used an Ubuntu based desktop with Nvidia graphics at a previous employers, and a FreeBSD-current desktop w/Nvidia graphics now. I've been left w/o graphics accidentally much more often on FreeBSD than I ever had been on Ubuntu, even when compiling my own kernels from git.. Drew From owner-svn-src-head@freebsd.org Sat Jul 7 15:24:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 897EE102B689; Sat, 7 Jul 2018 15:24:59 +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 EEB1B7C3D3; Sat, 7 Jul 2018 15:24:58 +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 w67FOuht057576; Sat, 7 Jul 2018 08:24:56 -0700 (PDT) (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 w67FOu0F057575; Sat, 7 Jul 2018 08:24:56 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807071524.w67FOu0F057575@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include In-Reply-To: To: Warner Losh Date: Sat, 7 Jul 2018 08:24:56 -0700 (PDT) CC: Don Lewis , "Rodney W. Grimes" , Hans Petter Selasky , 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:24:59 -0000 ... Applied the context axe ... > > > > A good reason for continuing UP support on x86 is to make it easy to > > test UP builds in the MI parts of the kernel so that we don't break > > things for the embedded architectures. Unfortunately "make universe" > > currently doesn't have any UP kernels, so I've managed to commit changes > > that break UP builds and not known it until I received reports of broken > > builds from other users > > > > UP kernels have not changed. The setups that have UP kernels generally need > custom ones anyway, since there's so many devices that aren't used. Those > setups aren't affected by this change. > > You raise an interesting point, though: it hasn't been important enough to > the project to include a UP kernel in CI testing we've done for years and > years... Should we add GENERIC-UP to atleast i386 and amd64 and include this in the universe target? Or perhaps teach LINT to also make LINT-UP? Regards, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jul 7 15:25:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BF32102B6F2; Sat, 7 Jul 2018 15:25:08 +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 9834E7C4E7; Sat, 7 Jul 2018 15:25:07 +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 6A845192CD; Sat, 7 Jul 2018 15:25:07 +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 w67FP7B9088823; Sat, 7 Jul 2018 15:25:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67FP7le088822; Sat, 7 Jul 2018 15:25:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201807071525.w67FP7le088822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 7 Jul 2018 15:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336065 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 336065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:25:08 -0000 Author: imp Date: Sat Jul 7 15:25:06 2018 New Revision: 336065 URL: https://svnweb.freebsd.org/changeset/base/336065 Log: Mention the need to update devmatch.conf Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jul 7 14:46:02 2018 (r336064) +++ head/UPDATING Sat Jul 7 15:25:06 2018 (r336065) @@ -63,6 +63,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: needed to be changed to work with it. This change was made with r335763 and requires a mergemaster / etcupdate / etc to update the installed file. +20180628: + r335753 introduced a new quoting method. However, etc/devd/devmatch.conf + needed to be changed to work with it. This change was made with r335763 + and requires a mergemaster / etcupdate / etc to update the installed file. + 20180612: r334930 changed the interface between the NFS modules, so they all need to be rebuilt. r335018 did a __FreeBSD_version bump for this. From owner-svn-src-head@freebsd.org Sat Jul 7 15:25:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE3D102B728; Sat, 7 Jul 2018 15:25: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 6FF787C5A9; Sat, 7 Jul 2018 15:25:13 +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 7B845192CE; Sat, 7 Jul 2018 15:25:12 +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 w67FPCZn088879; Sat, 7 Jul 2018 15:25:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67FPBNO088877; Sat, 7 Jul 2018 15:25:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201807071525.w67FPBNO088877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 7 Jul 2018 15:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336066 - in head/sys: compat/linsysfs dev/pci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: compat/linsysfs dev/pci X-SVN-Commit-Revision: 336066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:25:14 -0000 Author: imp Date: Sat Jul 7 15:25:11 2018 New Revision: 336066 URL: https://svnweb.freebsd.org/changeset/base/336066 Log: Create PCI_MATCH and pci_match_device Create a covenience function to match PCI device IDs. It's about 15 years overdue. Differential Revision: https://reviews.freebsd.org/D15999 Modified: head/sys/compat/linsysfs/linsysfs.c head/sys/dev/pci/pci.c head/sys/dev/pci/pcivar.h Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Sat Jul 7 15:25:06 2018 (r336065) +++ head/sys/compat/linsysfs/linsysfs.c Sat Jul 7 15:25:11 2018 (r336066) @@ -273,6 +273,7 @@ linsysfs_fill_vgapci(PFS_FILL_ARGS) return (0); } +#undef PCI_DEV #define PCI_DEV "pci" #define DRMN_DEV "drmn" static int Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sat Jul 7 15:25:06 2018 (r336065) +++ head/sys/dev/pci/pci.c Sat Jul 7 15:25:11 2018 (r336066) @@ -6244,3 +6244,39 @@ pcie_flr(device_t dev, u_int max_delay, bool force) pci_printf(&dinfo->cfg, "Transactions pending after FLR!\n"); return (true); } + +const struct pci_device_table * +pci_match_device(device_t child, const struct pci_device_table *id, size_t nelt) +{ + bool match; + uint16_t vendor, device, subvendor, subdevice, class, subclass, revid; + + vendor = pci_get_vendor(child); + device = pci_get_device(child); + subvendor = pci_get_subvendor(child); + subdevice = pci_get_subdevice(child); + class = pci_get_class(child); + subclass = pci_get_subclass(child); + revid = pci_get_revid(child); + while (nelt-- > 0) { + match = true; + if (id->match_flag_vendor) + match &= vendor == id->vendor; + if (id->match_flag_device) + match &= device == id->device; + if (id->match_flag_subvendor) + match &= subvendor == id->subvendor; + if (id->match_flag_subdevice) + match &= subdevice == id->subdevice; + if (id->match_flag_class) + match &= class == id->class_id; + if (id->match_flag_subclass) + match &= subclass == id->subclass; + if (id->match_flag_revid) + match &= revid == id->revid; + if (match) + return (id); + id++; + } + return (NULL); +} Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Sat Jul 7 15:25:06 2018 (r336065) +++ head/sys/dev/pci/pcivar.h Sat Jul 7 15:25:11 2018 (r336066) @@ -259,6 +259,66 @@ typedef struct { extern uint32_t pci_numdevs; +struct pci_device_table { +#if BYTE_ORDER == LITTLE_ENDIAN + uint16_t + match_flag_vendor:1, + match_flag_device:1, + match_flag_subvendor:1, + match_flag_subdevice:1, + match_flag_class:1, + match_flag_subclass:1, + match_flag_revid:1, + match_flag_unused:9; +#else + uint16_t + match_flag_unused:9, + match_flag_revid:1, + match_flag_subclass:1, + match_flag_class:1, + match_flag_subdevice:1, + match_flag_subvendor:1, + match_flag_device:1, + match_flag_vendor:1; +#endif + uint16_t vendor; + uint16_t device; + uint16_t subvendor; + uint16_t subdevice; + uint16_t class_id; + uint16_t subclass; + uint16_t revid; + uint16_t unused; + uintptr_t driver_data; + char *descr; +}; + +#define PCI_DEV(v, d) \ + .match_flag_vendor = 1, .vendor = (v), \ + .match_flag_device = 1, .device = (d) +#define PCI_SUBDEV(sv, sd) \ + .match_flag_subvendor = 1, .subvendor = (sv), \ + .match_flag_subdevice = 1, .subdevice = (sd) +#define PCI_CLASS(x) \ + .match_flag_class = 1, .class_id = (x) +#define PCI_SUBCLASS(x) \ + .match_flag_subclass = 1, .subclass = (x) +#define PCI_REVID(x) \ + .match_flag_revid = 1, .revid = (x) +#define PCI_DESCR(x) \ + .descr = (x) +#define PCI_PNP_STR \ + "M16:mask;U16:vendor;U16:device;U16:subvendor;U16:subdevice;" \ + "U16:class;U16:subclass;U16:revid;" +#define PCI_PNP_INFO(table) \ + MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, sizeof(table[0]), \ + sizeof(table) / sizeof(table[0])) + +const struct pci_device_table *pci_match_device(device_t child, + const struct pci_device_table *id, size_t nelt); +#define PCI_MATCH(child, table) \ + pci_match_device(child, (table), nitems(table)); + /* Only if the prerequisites are present */ #if defined(_SYS_BUS_H_) && defined(_SYS_PCIIO_H_) struct pci_devinfo { @@ -416,7 +476,7 @@ pci_get_vpd_readonly(device_t dev, const char *kw, con static __inline int pci_is_vga_ioport_range(rman_res_t start, rman_res_t end) { - + return (((start >= 0x3b0 && end <= 0x3bb) || (start >= 0x3c0 && end <= 0x3df)) ? 1 : 0); } From owner-svn-src-head@freebsd.org Sat Jul 7 15:25:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93E0E102B753; Sat, 7 Jul 2018 15:25:17 +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 4994C7C600; Sat, 7 Jul 2018 15:25:17 +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 2C4D0192CF; Sat, 7 Jul 2018 15:25:17 +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 w67FPHh1088931; Sat, 7 Jul 2018 15:25:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67FPG1w088930; Sat, 7 Jul 2018 15:25:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201807071525.w67FPG1w088930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 7 Jul 2018 15:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336067 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 336067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:25:17 -0000 Author: imp Date: Sat Jul 7 15:25:16 2018 New Revision: 336067 URL: https://svnweb.freebsd.org/changeset/base/336067 Log: Switch to using new PCI_MATCH stuff. Modified: head/sys/dev/ath/if_ath_pci.c head/sys/dev/ath/if_ath_pci_devlist.h Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Sat Jul 7 15:25:11 2018 (r336066) +++ head/sys/dev/ath/if_ath_pci.c Sat Jul 7 15:25:16 2018 (r336067) @@ -82,41 +82,12 @@ struct ath_pci_softc { void *sc_ih; /* interrupt handler */ }; -/* - * XXX eventually this should be some system level definition - * so modules will have probe/attach information like USB. - * But for now.. - */ -struct pci_device_id { - int vendor_id; - int device_id; +#define PCI_VDEVICE(v, d) \ + PCI_DEV(v,d) - int sub_vendor_id; - int sub_device_id; +#define PCI_DEVICE_SUB(v, d, sv, sd) \ + PCI_DEV(v, d), PCI_SUBDEV(v, d) - int driver_data; - - int match_populated:1; - int match_vendor_id:1; - int match_device_id:1; - int match_sub_vendor_id:1; - int match_sub_device_id:1; -}; - -#define PCI_VDEVICE(v, s) \ - .vendor_id = (v), \ - .device_id = (s), \ - .match_populated = 1, \ - .match_vendor_id = 1, \ - .match_device_id = 1 - -#define PCI_DEVICE_SUB(v, d, dv, ds) \ - .match_populated = 1, \ - .vendor_id = (v), .match_vendor_id = 1, \ - .device_id = (d), .match_device_id = 1, \ - .sub_vendor_id = (dv), .match_sub_vendor_id = 1, \ - .sub_device_id = (ds), .match_sub_device_id = 1 - #define PCI_VENDOR_ID_ATHEROS 0x168c #define PCI_VENDOR_ID_SAMSUNG 0x144d #define PCI_VENDOR_ID_AZWAVE 0x1a3b @@ -130,50 +101,6 @@ struct pci_device_id { #include "if_ath_pci_devlist.h" -/* - * Attempt to find a match for the given device in - * the given device table. - * - * Returns the device structure or NULL if no matching - * PCI device is found. - */ -static const struct pci_device_id * -ath_pci_probe_device(device_t dev, const struct pci_device_id *dev_table, int nentries) -{ - int i; - int vendor_id, device_id; - int sub_vendor_id, sub_device_id; - - vendor_id = pci_get_vendor(dev); - device_id = pci_get_device(dev); - sub_vendor_id = pci_get_subvendor(dev); - sub_device_id = pci_get_subdevice(dev); - - for (i = 0; i < nentries; i++) { - /* Don't match on non-populated (eg empty) entries */ - if (! dev_table[i].match_populated) - continue; - - if (dev_table[i].match_vendor_id && - (dev_table[i].vendor_id != vendor_id)) - continue; - if (dev_table[i].match_device_id && - (dev_table[i].device_id != device_id)) - continue; - if (dev_table[i].match_sub_vendor_id && - (dev_table[i].sub_vendor_id != sub_vendor_id)) - continue; - if (dev_table[i].match_sub_device_id && - (dev_table[i].sub_device_id != sub_device_id)) - continue; - - /* Match */ - return (&dev_table[i]); - } - - return (NULL); -} - #define BS_BAR 0x10 #define PCIR_RETRY_TIMEOUT 0x41 #define PCIR_CFG_PMCSR 0x48 @@ -244,12 +171,12 @@ ath_pci_attach(device_t dev) const struct firmware *fw = NULL; const char *buf; #endif - const struct pci_device_id *pd; + const struct pci_device_table *pd; sc->sc_dev = dev; /* Do this lookup anyway; figure out what to do with it later */ - pd = ath_pci_probe_device(dev, ath_pci_id_table, nitems(ath_pci_id_table)); + pd = PCI_MATCH(dev, ath_pci_id_table); if (pd) sc->sc_pci_devinfo = pd->driver_data; Modified: head/sys/dev/ath/if_ath_pci_devlist.h ============================================================================== --- head/sys/dev/ath/if_ath_pci_devlist.h Sat Jul 7 15:25:11 2018 (r336066) +++ head/sys/dev/ath/if_ath_pci_devlist.h Sat Jul 7 15:25:16 2018 (r336067) @@ -29,7 +29,7 @@ * $FreeBSD$ */ -static const struct pci_device_id ath_pci_id_table[] = { +static const struct pci_device_table ath_pci_id_table[] = { { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0023) }, /* PCI */ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0024) }, /* PCI-E */ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0027) }, /* PCI */ From owner-svn-src-head@freebsd.org Sat Jul 7 15:50:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC34102DE3D; Sat, 7 Jul 2018 15:50:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A07E67D666; Sat, 7 Jul 2018 15:50:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id a195-v6so20177733itd.3; Sat, 07 Jul 2018 08:50:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Ju5h/WDHAFifcGJkR8rjnerMCR0366DxP11sU0VeYgc=; b=OfHWwGH/sFB9V6LBKYShN2zG2ErEq2J9G76cixyHh9udCE8cvxDiY4NNoNZGpsSzXD 1xdEgiubzRy19o9m6mqD0wtY1tMo85drvF/We7OkJCJP5WsRAPZVG9pyy/3UQUDAunFb ReOyp1H/iXCcIMnyUG0TyGfaRSx3EpdYWJLvpYoPQauetEEaiQcTi6QjK6YUJWEIGqZE v6gDfB3xl+SpCeVjBJRo0KXOoKvsYpwBqs7SvUFUqUfPslAO5mZGgLEqhYm1rWuKMiyM B/0HpqDeK/h5EU7gz/Y583tzSr049ZYc49NqWFIWI2pBYGQ7bkgomGl6Q/w52VJxsfuE Ljaw== X-Gm-Message-State: APt69E0dLfWwsXo24ZLNMSeOMJeiXUFZ8/Kwb6U9Kt0j4FlIXT1r6sOi FOtSzwCKoInzILaApOy5N2GenpH5 X-Google-Smtp-Source: AAOMgpeo8+flP3KSdpX4AqwC0R288PSFhnhjTVPufB0Y5Zv3j/xrjrFxdfh5Nex0LFoTInFW9vgWMQ== X-Received: by 2002:a24:684d:: with SMTP id v74-v6mr11580580itb.88.1530978617769; Sat, 07 Jul 2018 08:50:17 -0700 (PDT) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id l126-v6sm4251141ioa.39.2018.07.07.08.50.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jul 2018 08:50:17 -0700 (PDT) Received: by mail-io0-f181.google.com with SMTP id z20-v6so13449843iol.0; Sat, 07 Jul 2018 08:50:17 -0700 (PDT) X-Received: by 2002:a6b:4e04:: with SMTP id c4-v6mr2369013iob.19.1530978617037; Sat, 07 Jul 2018 08:50:17 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:7e0a:0:0:0:0:0 with HTTP; Sat, 7 Jul 2018 08:50:16 -0700 (PDT) In-Reply-To: <201807071525.w67FPG1w088930@repo.freebsd.org> References: <201807071525.w67FPG1w088930@repo.freebsd.org> From: Conrad Meyer Date: Sat, 7 Jul 2018 08:50:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r336067 - head/sys/dev/ath To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:50:25 -0000 On Sat, Jul 7, 2018 at 8:25 AM, Warner Losh wrote: > Author: imp > Date: Sat Jul 7 15:25:16 2018 > New Revision: 336067 > URL: https://svnweb.freebsd.org/changeset/base/336067 > > Log: > Switch to using new PCI_MATCH stuff. > > Modified: head/sys/dev/ath/if_ath_pci.c > ============================================================================== > --- head/sys/dev/ath/if_ath_pci.c Sat Jul 7 15:25:11 2018 (r336066) > +++ head/sys/dev/ath/if_ath_pci.c Sat Jul 7 15:25:16 2018 (r336067) > @@ -82,41 +82,12 @@ struct ath_pci_softc { > ... > - int sub_vendor_id; > - int sub_device_id; > +#define PCI_DEVICE_SUB(v, d, sv, sd) \ > + PCI_DEV(v, d), PCI_SUBDEV(v, d) PCI_SUBDEV(sv, sd)? Best, Conrad From owner-svn-src-head@freebsd.org Sat Jul 7 15:54:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 822A8102E608 for ; Sat, 7 Jul 2018 15:54:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 152DE7DB42 for ; Sat, 7 Jul 2018 15:54:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id q9-v6so13442864ioj.8 for ; Sat, 07 Jul 2018 08:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1CCv2zEf79UH4rF2Ns5BxItIgKTvYfDg9E5B6WrDb0c=; b=pJja1cOew7bqdTPnMyFptz8Q3bC9MxEVqgBxB3ZV7oJ52lE3zb4MLDgsdVvvroawfx mXatJCIIL/efZoW6qQ6pCohi4WwgoqSK90wS+2ZV1Y/Umy0xf3DqP3g+d7swWlhqFllv dTW77JUXbQ6z9XYNLqc+R7aSjIzqBbttCTwbdgDfieU4JsMiAeKxW8hmi/SRIQALkho4 tpisMe2p2KipeF0qCpGGTSyrEo+NZxdO7Luc8VmA1/tjg80Va626XnNB0WbrP/7tsaHH e2MsIfzVf276MeFAvvvoAUByTwwZiM8gkAkCFZ/alSiKeqklUFNzVZSqwKzUgm6oY9RJ lW7Q== 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=1CCv2zEf79UH4rF2Ns5BxItIgKTvYfDg9E5B6WrDb0c=; b=hyZVBAfdsHW/JuikVS72/XJtx0yy5K+PPk+JWKmcKHxZIEyJGDuKT7/zcMXN26BzlE p4B/cRCnwP2wOBNXf6+ZQOLbP8o/2QS4X8YT6E1HHmR1s1y4C1/lwM5TIl62sw7WC7Vh WpIcWo0TRaXgDM8gfpsj+znNs74GZwZm30l78xUOUiUTHpAMATh5SkXW/8I0lg9086zg O2Gopw5PhUh/FNmfAfvgn/vuN+MbkCUdsBNh33jevUAOD0+9g02qJ1hKYFvTCI7CCAK+ 3PL7dbTRlP/VrgXhYmHOVpwLzJ380CHFlmrh7Zk/+9xFrpUGO2nOYlZcPJH2p4vazs1D kP4w== X-Gm-Message-State: APt69E2DoZ2EvIUJ7b1KGgIhAyfTdZA368VxF9ZT7iFLopc7TgJKghuV eqDdn7nYc0rvNeKosTJAd2SgM56kecJkW1q8HtikjA== X-Google-Smtp-Source: AAOMgpdbXKJQ8cfkyocj1es1O3M/rsQkOJWKtUD63FRLuuwM443xyHRUCoBr52jio3CP4Jpdvl2LFT63UHsXxiWn9g4= X-Received: by 2002:a6b:d40c:: with SMTP id l12-v6mr12178007iog.37.1530978859135; Sat, 07 Jul 2018 08:54:19 -0700 (PDT) MIME-Version: 1.0 References: <201807071525.w67FPG1w088930@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sat, 7 Jul 2018 09:54:07 -0600 Message-ID: Subject: Re: svn commit: r336067 - head/sys/dev/ath To: "Conrad E. Meyer" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:54:20 -0000 On Sat, Jul 7, 2018, 10:50 AM Conrad Meyer wrote: > On Sat, Jul 7, 2018 at 8:25 AM, Warner Losh wrote: > > Author: imp > > Date: Sat Jul 7 15:25:16 2018 > > New Revision: 336067 > > URL: https://svnweb.freebsd.org/changeset/base/336067 > > > > Log: > > Switch to using new PCI_MATCH stuff. > > > > Modified: head/sys/dev/ath/if_ath_pci.c > > > ============================================================================== > > --- head/sys/dev/ath/if_ath_pci.c Sat Jul 7 15:25:11 2018 > (r336066) > > +++ head/sys/dev/ath/if_ath_pci.c Sat Jul 7 15:25:16 2018 > (r336067) > > @@ -82,41 +82,12 @@ struct ath_pci_softc { > > ... > > - int sub_vendor_id; > > - int sub_device_id; > > +#define PCI_DEVICE_SUB(v, d, sv, sd) \ > > + PCI_DEV(v, d), PCI_SUBDEV(v, d) > > PCI_SUBDEV(sv, sd)? > Doh. Warner > From owner-svn-src-head@freebsd.org Sat Jul 7 15:55:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A706A102E861; Sat, 7 Jul 2018 15:55:53 +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 5C35A7DCFE; Sat, 7 Jul 2018 15:55:53 +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 3D2B5197B0; Sat, 7 Jul 2018 15:55:53 +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 w67Ftr3h004958; Sat, 7 Jul 2018 15:55:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67FtqrL004956; Sat, 7 Jul 2018 15:55:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201807071555.w67FtqrL004956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 7 Jul 2018 15:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336068 - in head/sys: dev/amdsmb modules/amdsmb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: dev/amdsmb modules/amdsmb X-SVN-Commit-Revision: 336068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:55:53 -0000 Author: imp Date: Sat Jul 7 15:55:52 2018 New Revision: 336068 URL: https://svnweb.freebsd.org/changeset/base/336068 Log: Update AMDSMB to use PCI_MATCH Differential Review: https://reviews.freebsd.org/D16172 Added: head/sys/modules/amdsmb/ head/sys/modules/amdsmb/Makefile (contents, props changed) Modified: head/sys/dev/amdsmb/amdsmb.c Modified: head/sys/dev/amdsmb/amdsmb.c ============================================================================== --- head/sys/dev/amdsmb/amdsmb.c Sat Jul 7 15:25:16 2018 (r336067) +++ head/sys/dev/amdsmb/amdsmb.c Sat Jul 7 15:55:52 2018 (r336068) @@ -125,24 +125,22 @@ struct amdsmb_softc { static int amdsmb_detach(device_t dev); +struct pci_device_table amdsmb_devs[] = { + { PCI_DEV(AMDSMB_VENDORID_AMD, AMDSMB_DEVICEID_AMD8111_SMB2), + PCI_DESCR("AMD-8111 SMBus 2.0 Controller") } +}; + static int amdsmb_probe(device_t dev) { - u_int16_t vid; - u_int16_t did; + const struct pci_device_table *tbl; - vid = pci_get_vendor(dev); - did = pci_get_device(dev); + tbl = PCI_MATCH(dev, amdsmb_devs); + if (tbl == NULL) + return (ENXIO); + device_set_desc(dev, tbl->descr); - if (vid == AMDSMB_VENDORID_AMD) { - switch(did) { - case AMDSMB_DEVICEID_AMD8111_SMB2: - device_set_desc(dev, "AMD-8111 SMBus 2.0 Controller"); - return (BUS_PROBE_DEFAULT); - } - } - - return (ENXIO); + return (BUS_PROBE_DEFAULT); } static int Added: head/sys/modules/amdsmb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/amdsmb/Makefile Sat Jul 7 15:55:52 2018 (r336068) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/amdsmb + +KMOD= amdsmb +SRCS= amdsmb.c bus_if.h device_if.h pci_if.h smbus_if.h + +.include From owner-svn-src-head@freebsd.org Sat Jul 7 15:56:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03992102E8A8; Sat, 7 Jul 2018 15:56:01 +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 E5A9A7DDB1; Sat, 7 Jul 2018 15:55:59 +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 B1F46197B1; Sat, 7 Jul 2018 15:55:58 +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 w67FtwYD005015; Sat, 7 Jul 2018 15:55:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67FtwLY005014; Sat, 7 Jul 2018 15:55:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201807071555.w67FtwLY005014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 7 Jul 2018 15:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336069 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 336069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 15:56:01 -0000 Author: imp Date: Sat Jul 7 15:55:58 2018 New Revision: 336069 URL: https://svnweb.freebsd.org/changeset/base/336069 Log: Fix PCI_SUBDEV call Modified: head/sys/dev/ath/if_ath_pci.c Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Sat Jul 7 15:55:52 2018 (r336068) +++ head/sys/dev/ath/if_ath_pci.c Sat Jul 7 15:55:58 2018 (r336069) @@ -86,7 +86,7 @@ struct ath_pci_softc { PCI_DEV(v,d) #define PCI_DEVICE_SUB(v, d, sv, sd) \ - PCI_DEV(v, d), PCI_SUBDEV(v, d) + PCI_DEV(v, d), PCI_SUBDEV(sv, sd) #define PCI_VENDOR_ID_ATHEROS 0x168c #define PCI_VENDOR_ID_SAMSUNG 0x144d From owner-svn-src-head@freebsd.org Sat Jul 7 17:07:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2590910358E0; Sat, 7 Jul 2018 17:07:59 +0000 (UTC) (envelope-from kevans@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 C936B8102F; Sat, 7 Jul 2018 17:07:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6633E1A221; Sat, 7 Jul 2018 17:07:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f169.google.com with SMTP id r13-v6so11225447ljg.10; Sat, 07 Jul 2018 10:07:58 -0700 (PDT) X-Gm-Message-State: APt69E25tAMUw6YughXk7ElugJq5yR62Wp5/4v0XSK6hIWvqV+YvuUtv lXHskF/oaJwweGnjcbZf9zmAD786skmll68mp7g= X-Google-Smtp-Source: AAOMgpcwsRyVXCDNCgCNzaZuNYBIGoPDPkdezStilX96R9lC44OMz3ZgIw5n0D+eQj/WOQgPA6ZjwCBCFCaBNyQROJo= X-Received: by 2002:a2e:5d88:: with SMTP id v8-v6mr9309509lje.137.1530983276884; Sat, 07 Jul 2018 10:07:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Sat, 7 Jul 2018 10:07:36 -0700 (PDT) In-Reply-To: <201807061123.w66BNEtb022856@repo.freebsd.org> References: <201807061123.w66BNEtb022856@repo.freebsd.org> From: Kyle Evans Date: Sat, 7 Jul 2018 12:07:36 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r336026 - in head: lib/libnv usr.sbin/config To: Bryan Drewery Cc: src-committers , Mariusz Zaborski , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 17:07:59 -0000 On Fri, Jul 6, 2018 at 6:23 AM, Kyle Evans wrote: > Author: kevans > Date: Fri Jul 6 11:23:14 2018 > New Revision: 336026 > URL: https://svnweb.freebsd.org/changeset/base/336026 > > Log: > config(8): Fix broken ABI > > r336019 introduced ${SRCTOP}/sys to the include paths in order to pull in a > new sys/{c,}nv.h. This is wrong, because the build tree's ABI isn't > guaranteed to match what's running on the host system. > > Fix instead by removing -I${SRCTOP}/sys and installing the libnv headers > with `make -C lib/libnv includes`... this may or may not get re-worked in > the future so that a userland lib isn't installing includes from sys/. > > Reported by: bdrewery > > Modified: > head/lib/libnv/Makefile > head/usr.sbin/config/Makefile > > Modified: head/lib/libnv/Makefile > ============================================================================== > --- head/lib/libnv/Makefile Fri Jul 6 10:13:42 2018 (r336025) > +++ head/lib/libnv/Makefile Fri Jul 6 11:23:14 2018 (r336026) > @@ -17,6 +17,9 @@ SRCS+= msgio.c > SRCS+= nvlist.c > SRCS+= nvpair.c > > +INCSDIR= ${INCLUDEDIR}/sys > +INCS= ${SRCTOP}/sys/sys/cnv.h ${SRCTOP}/sys/sys/nv.h > + > HAS_TESTS= > SUBDIR.${MK_TESTS}+= tests > It seems that this isn't a sustainable solution, as it creates a conflict between runtime-development and libnv-development packages as both try to install these headers from sys/. If we want to use libnv from legacy build in a bootstrap tool, though, we need lib/libnv to setup INCS correctly. Is there a better solution to either only do this if we're BOOTSTRAPPING < 1200070 and staging worldtmp or just pull these from sys/sys while still allowing them to be used in kernel as expected? From owner-svn-src-head@freebsd.org Sat Jul 7 17:25:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A050B1038A05; Sat, 7 Jul 2018 17:25:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2793D81E2A; Sat, 7 Jul 2018 17:25:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08D8B1A63B; Sat, 7 Jul 2018 17:25:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67HP9IA051880; Sat, 7 Jul 2018 17:25:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67HP9PI051878; Sat, 7 Jul 2018 17:25:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807071725.w67HP9PI051878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Jul 2018 17:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336070 - in head/sys: arm/freescale/imx modules/imx modules/imx/imx_wdog X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/freescale/imx modules/imx modules/imx/imx_wdog X-SVN-Commit-Revision: 336070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 17:25:10 -0000 Author: ian Date: Sat Jul 7 17:25:09 2018 New Revision: 336070 URL: https://svnweb.freebsd.org/changeset/base/336070 Log: Add pnp info and a module makefile for the imx_wdog watchdog driver. Added: head/sys/modules/imx/imx_wdog/ head/sys/modules/imx/imx_wdog/Makefile (contents, props changed) Modified: head/sys/arm/freescale/imx/imx_wdog.c head/sys/modules/imx/Makefile Modified: head/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- head/sys/arm/freescale/imx/imx_wdog.c Sat Jul 7 15:55:58 2018 (r336069) +++ head/sys/arm/freescale/imx/imx_wdog.c Sat Jul 7 17:25:09 2018 (r336070) @@ -209,6 +209,13 @@ imx_wdog_attach(device_t dev) sc->sc_pde_enabled = true; EVENTHANDLER_REGISTER(watchdog_list, imx_watchdog, sc, 0); + + /* + * The watchdog hardware cannot be disabled, so there's little point in + * coding up a detach() routine to carefully tear everything down, just + * make the device busy so that detach can't happen. + */ + device_busy(sc->sc_dev); return (0); } @@ -227,3 +234,4 @@ static driver_t imx_wdog_driver = { static devclass_t imx_wdog_devclass; DRIVER_MODULE(imx_wdog, simplebus, imx_wdog_driver, imx_wdog_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/modules/imx/Makefile ============================================================================== --- head/sys/modules/imx/Makefile Sat Jul 7 15:55:58 2018 (r336069) +++ head/sys/modules/imx/Makefile Sat Jul 7 17:25:09 2018 (r336070) @@ -5,5 +5,6 @@ SUBDIR = \ ../ffec \ imx_i2c \ imx_spi \ + imx_wdog \ .include Added: head/sys/modules/imx/imx_wdog/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/imx/imx_wdog/Makefile Sat Jul 7 17:25:09 2018 (r336070) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/freescale/imx + +KMOD= imx_wdog +SRCS= imx_wdog.c + +# Generated files... +SRCS+= \ + bus_if.h \ + device_if.h \ + ofw_bus_if.h \ + +.include From owner-svn-src-head@freebsd.org Sat Jul 7 17:43:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9340F103B0A3; Sat, 7 Jul 2018 17:43:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08ED682A67; Sat, 7 Jul 2018 17:43:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id v16-v6so17478178wmv.5; Sat, 07 Jul 2018 10:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZlkA9S5DTWO5zDACQaGPy4HtWY3dwi9qAyPTDP9ZIkg=; b=a1dfbj5s48YSbmANwTLh5RbwgF9Sa3mKkp1Dd1x31pQ/oVZ7D82aNbT+GeBNGxSr77 G3mFVgJSYFcknnS/Ted/gCTB+Apufh7JBKp93KFnauk1E9Vz4nTtfZIkgmKG946Mb/vp kPuwUp0lWXRBsvDg9i0p7Nil2t6l0CTuVtm8g3Uu6xHb4F1Aa/7g76xlXo8m2Zq/TEiN 0nprAXkxTHtlKoRAyJqDgutBm3aZlP3OeHNpWogOSJFfZPJ7omxj9ILr1HhjE/aYjDej J2fCAvj/iGxKCXPrhTqvqaj2M5bW3RA3Wjxq+RRuD5nILNDPykw7nt/yKbI0xThFbsya xHqQ== 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=ZlkA9S5DTWO5zDACQaGPy4HtWY3dwi9qAyPTDP9ZIkg=; b=RV/mcvQP6Cki17Lfv1of7ivMFBFP+kJ0TEs31dzr7WyniC5d755UhKWRqrPsa2rpT6 AE4zArcbYcu7KOIe8VTz6mL70oVb2TjDCsoEE1CP6WLZXHTCKHxCpC3Nlfh5f/iqxxV/ YXbYxsC6g+RRzv5WtOKnsyceMjWQvJmj7oSTvUFE3qeZcqaXxsEZlcno6+HW3MtoCG1b E70IA0hiIh+8voQYPi6eHWziC7ZBIOInwaF59UZTILSx9GzvdE+niDe7F2xzgOs5nQKk 3noiJEsDfEgprDJAoi5O1pB85TnCQpRg24QYXyNyJrGcEeiKK5i8uqmwW6Qh1nP1ExvD emqA== X-Gm-Message-State: APt69E13hSwSjxuZW/SRDPEAhIAZkRUK6vaIlVkhuv/wsvnXJIcT9aYz ysIm+DLQUMGbqem934rj4HtzhQ== X-Google-Smtp-Source: AAOMgpe+lQtbbYg9Q/3VMbiC2pctrw0lb01hKWrrRhdgDLNCX5oL+NHEH4TjjDu9PUhnL9YznlFGOA== X-Received: by 2002:a1c:3693:: with SMTP id y19-v6mr8214036wmh.71.1530985436839; Sat, 07 Jul 2018 10:43:56 -0700 (PDT) Received: from pesky (174.red-81-43-74.staticip.rima-tde.net. [81.43.74.174]) by smtp.gmail.com with ESMTPSA id d14-v6sm4427332wma.13.2018.07.07.10.43.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jul 2018 10:43:55 -0700 (PDT) Sender: Mark Johnston Date: Sat, 7 Jul 2018 13:43:51 -0400 From: Mark Johnston To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, sbruno@freebsd.org Subject: Re: svn commit: r334880 - head/sys/dev/vnic Message-ID: <20180707174351.GA95934@pesky> References: <201806091447.w59ElnpU026396@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806091447.w59ElnpU026396@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 17:43:58 -0000 On Sat, Jun 09, 2018 at 02:47:49PM +0000, Andrew Turner wrote: > Author: andrew > Date: Sat Jun 9 14:47:49 2018 > New Revision: 334880 > URL: https://svnweb.freebsd.org/changeset/base/334880 > > Log: > In the ThunderX BGX network driver we were skipping the NULL terminator > when parsing the phy type, however this is included in the length returned > by OF_getprop. To fix this stop ignoring the terminator. > > PR: 228828 > Reported by: sbruno > Sponsored by: DARPA, AFRL This seems to break vnic on packet.net ThunderXs. In particular, VF creation fails. It seems the problem in my case is that there are multiple PHY devices in the device tree, e.g., xfi@0, xfi@1. With this change, bgx_fdt_phy_name_match() fails to match against any device containing a unit address in the node name. From owner-svn-src-head@freebsd.org Sat Jul 7 19:03:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5799010428C8; Sat, 7 Jul 2018 19:03:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF32085D8B; Sat, 7 Jul 2018 19:03:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCDE61B630; Sat, 7 Jul 2018 19:03:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67J3cO7003701; Sat, 7 Jul 2018 19:03:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67J3c7w003700; Sat, 7 Jul 2018 19:03:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807071903.w67J3c7w003700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Jul 2018 19:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336072 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 336072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 19:03:39 -0000 Author: ian Date: Sat Jul 7 19:03:38 2018 New Revision: 336072 URL: https://svnweb.freebsd.org/changeset/base/336072 Log: Correctly calculate the value to put in the imx wdog countdown register. The correct value is seconds*2-1. The code was using just seconds*2, which led to being off by a half-second -- usually not a big deal, except when the value was the max (128) it overflowed so zero would get written to the countdown register, which equates to a timeout of a half second. Modified: head/sys/arm/freescale/imx/imx_wdog.c Modified: head/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- head/sys/arm/freescale/imx/imx_wdog.c Sat Jul 7 17:58:20 2018 (r336071) +++ head/sys/arm/freescale/imx/imx_wdog.c Sat Jul 7 19:03:38 2018 (r336072) @@ -118,8 +118,7 @@ imx_watchdog(void *arg, u_int cmd, int *error) sc->sc_timeout = timeout; reg = RD2(sc, WDOG_CR_REG); reg &= ~WDOG_CR_WT_MASK; - reg |= (timeout << (WDOG_CR_WT_SHIFT + 1)) & - WDOG_CR_WT_MASK; + reg |= ((2 * timeout - 1) << WDOG_CR_WT_SHIFT); WR2(sc, WDOG_CR_REG, reg | WDOG_CR_WDE); } /* Refresh counter */ From owner-svn-src-head@freebsd.org Sat Jul 7 19:10:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37BC8104322D; Sat, 7 Jul 2018 19:10:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE5B38621C; Sat, 7 Jul 2018 19:10:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0E4E1B639; Sat, 7 Jul 2018 19:10:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67JA0Rm004290; Sat, 7 Jul 2018 19:10:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67JA0FH004289; Sat, 7 Jul 2018 19:10:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807071910.w67JA0FH004289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Jul 2018 19:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336073 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 336073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 19:10:01 -0000 Author: ian Date: Sat Jul 7 19:10:00 2018 New Revision: 336073 URL: https://svnweb.freebsd.org/changeset/base/336073 Log: Add support to the imx watchdog for the FDT "timeout-sec" property, by automatically initializing the watchdog using the given value. Also, attach at BUS_PASS_TIMER to extend watchdog protection to more of the kernel init process. Modified: head/sys/arm/freescale/imx/imx_wdog.c Modified: head/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- head/sys/arm/freescale/imx/imx_wdog.c Sat Jul 7 19:03:38 2018 (r336072) +++ head/sys/arm/freescale/imx/imx_wdog.c Sat Jul 7 19:10:00 2018 (r336073) @@ -98,42 +98,52 @@ WR2(struct imx_wdog_softc *sc, bus_size_t offs, uint16 bus_write_2(sc->sc_res[MEMRES], offs, val); } +static int +imx_wdog_enable(struct imx_wdog_softc *sc, u_int timeout) +{ + uint16_t reg; + + if (timeout < 1 || timeout > 128) + return (EINVAL); + + mtx_lock(&sc->sc_mtx); + if (timeout != sc->sc_timeout) { + sc->sc_timeout = timeout; + reg = RD2(sc, WDOG_CR_REG); + reg &= ~WDOG_CR_WT_MASK; + reg |= ((2 * timeout - 1) << WDOG_CR_WT_SHIFT); + WR2(sc, WDOG_CR_REG, reg | WDOG_CR_WDE); + } + /* Refresh counter */ + WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1); + WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2); + /* Watchdog active, can disable rom-boot watchdog. */ + if (sc->sc_pde_enabled) { + sc->sc_pde_enabled = false; + reg = RD2(sc, WDOG_MCR_REG); + WR2(sc, WDOG_MCR_REG, reg & ~WDOG_MCR_PDE); + } + mtx_unlock(&sc->sc_mtx); + + return (0); +} + static void imx_watchdog(void *arg, u_int cmd, int *error) { struct imx_wdog_softc *sc; - uint16_t reg; u_int timeout; sc = arg; - mtx_lock(&sc->sc_mtx); if (cmd == 0) { if (bootverbose) device_printf(sc->sc_dev, "Can not be disabled.\n"); *error = EOPNOTSUPP; } else { timeout = (u_int)((1ULL << (cmd & WD_INTERVAL)) / 1000000000U); - if (timeout > 1 && timeout < 128) { - if (timeout != sc->sc_timeout) { - sc->sc_timeout = timeout; - reg = RD2(sc, WDOG_CR_REG); - reg &= ~WDOG_CR_WT_MASK; - reg |= ((2 * timeout - 1) << WDOG_CR_WT_SHIFT); - WR2(sc, WDOG_CR_REG, reg | WDOG_CR_WDE); - } - /* Refresh counter */ - WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1); - WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2); - /* Watchdog active, can disable rom-boot watchdog. */ - if (sc->sc_pde_enabled) { - sc->sc_pde_enabled = false; - reg = RD2(sc, WDOG_MCR_REG); - WR2(sc, WDOG_MCR_REG, reg & ~WDOG_MCR_PDE); - } + if (imx_wdog_enable(sc, timeout) == 0) *error = 0; - } } - mtx_unlock(&sc->sc_mtx); } static int @@ -175,6 +185,7 @@ static int imx_wdog_attach(device_t dev) { struct imx_wdog_softc *sc; + pcell_t timeout; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -209,6 +220,19 @@ imx_wdog_attach(device_t dev) EVENTHANDLER_REGISTER(watchdog_list, imx_watchdog, sc, 0); + /* If there is a timeout-sec property, activate the watchdog. */ + if (OF_getencprop(ofw_bus_get_node(sc->sc_dev), "timeout-sec", + &timeout, sizeof(timeout)) == sizeof(timeout)) { + if (timeout < 1 || timeout > 128) { + device_printf(sc->sc_dev, "ERROR: bad timeout-sec " + "property value %u, using 128\n", timeout); + timeout = 128; + } + imx_wdog_enable(sc, timeout); + device_printf(sc->sc_dev, "watchdog enabled using " + "timeout-sec property value %u\n", timeout); + } + /* * The watchdog hardware cannot be disabled, so there's little point in * coding up a detach() routine to carefully tear everything down, just @@ -232,5 +256,6 @@ static driver_t imx_wdog_driver = { static devclass_t imx_wdog_devclass; -DRIVER_MODULE(imx_wdog, simplebus, imx_wdog_driver, imx_wdog_devclass, 0, 0); +EARLY_DRIVER_MODULE(imx_wdog, simplebus, imx_wdog_driver, + imx_wdog_devclass, 0, 0, BUS_PASS_TIMER); SIMPLEBUS_PNP_INFO(compat_data); From owner-svn-src-head@freebsd.org Sat Jul 7 19:11:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EADFC104359E; Sat, 7 Jul 2018 19:11:43 +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 94B39865BD; Sat, 7 Jul 2018 19:11:43 +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 75F9D1B793; Sat, 7 Jul 2018 19:11:43 +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 w67JBh6F008102; Sat, 7 Jul 2018 19:11:43 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67JBhtV008101; Sat, 7 Jul 2018 19:11:43 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201807071911.w67JBhtV008101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 7 Jul 2018 19:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336074 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 336074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 19:11:44 -0000 Author: mckusick Date: Sat Jul 7 19:11:43 2018 New Revision: 336074 URL: https://svnweb.freebsd.org/changeset/base/336074 Log: Import commit from NetBSD with checkin message: Avoid Undefined Behavior in ffs_clusteracct() Change the type of 'bit' variable from int to unsigned int and use unsigned values consistently. sys/ufs/ffs/ffs_subr.c:336:10, shift exponent -1 is negative Detected with Kernel Undefined Behavior Sanitizer. Reported by Submitted by: Pedro Giffuni Modified: head/sys/ufs/ffs/ffs_subr.c Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Sat Jul 7 19:10:00 2018 (r336073) +++ head/sys/ufs/ffs/ffs_subr.c Sat Jul 7 19:11:43 2018 (r336074) @@ -473,7 +473,8 @@ ffs_clusteracct(struct fs *fs, struct cg *cgp, ufs1_da int32_t *sump; int32_t *lp; u_char *freemapp, *mapp; - int i, start, end, forw, back, map, bit; + int i, start, end, forw, back, map; + u_int bit; if (fs->fs_contigsumsize <= 0) return; @@ -495,7 +496,7 @@ ffs_clusteracct(struct fs *fs, struct cg *cgp, ufs1_da end = cgp->cg_nclusterblks; mapp = &freemapp[start / NBBY]; map = *mapp++; - bit = 1 << (start % NBBY); + bit = 1U << (start % NBBY); for (i = start; i < end; i++) { if ((map & bit) == 0) break; @@ -516,7 +517,7 @@ ffs_clusteracct(struct fs *fs, struct cg *cgp, ufs1_da end = -1; mapp = &freemapp[start / NBBY]; map = *mapp--; - bit = 1 << (start % NBBY); + bit = 1U << (start % NBBY); for (i = start; i > end; i--) { if ((map & bit) == 0) break; @@ -524,7 +525,7 @@ ffs_clusteracct(struct fs *fs, struct cg *cgp, ufs1_da bit >>= 1; } else { map = *mapp--; - bit = 1 << (NBBY - 1); + bit = 1U << (NBBY - 1); } } back = start - i; From owner-svn-src-head@freebsd.org Sat Jul 7 19:27:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B2351044DAD; Sat, 7 Jul 2018 19:27:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01B0587641; Sat, 7 Jul 2018 19:27:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6E1E1B960; Sat, 7 Jul 2018 19:27:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67JRnGW015628; Sat, 7 Jul 2018 19:27:49 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67JRnqB015627; Sat, 7 Jul 2018 19:27:49 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807071927.w67JRnqB015627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 Jul 2018 19:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336075 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 336075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 19:27:50 -0000 Author: rmacklem Date: Sat Jul 7 19:27:49 2018 New Revision: 336075 URL: https://svnweb.freebsd.org/changeset/base/336075 Log: Fix handling of the hybrid DS case for a pNFS server. After the addition of the "#mds_path" suffix for a DS specification on the "-p" nfsd option, it is possible to have a mix of DSs assigned to an MDS file system and DSs that store files for all DSs. This is what I referred to as "hybrid" above. At first, I didn't think this hybrid case would be useful, but I now believe that some system administrators may fine it useful. This patch modifies the file storage assignment algorithm so that it makes the "#mds_path" DSs take priority and the all file systems DSs are now only used for MDS file systems with no "#mds_path" DS servers. This only affects the pNFS server for this "hybrid" case. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sat Jul 7 19:11:43 2018 (r336074) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sat Jul 7 19:27:49 2018 (r336075) @@ -3848,7 +3848,7 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, NFSPROC_T *p) { struct nfsrvdscreate *dsc, *tdsc; - struct nfsdevice *ds, *mds; + struct nfsdevice *ds, *tds, *fds; struct mount *mp; struct pnfsdsfile *pf, *tpf; struct pnfsdsattr dsattr; @@ -3866,12 +3866,25 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, /* Get a DS server directory in a round-robin order. */ mirrorcnt = 1; mp = vp->v_mount; + ds = fds = NULL; NFSDDSLOCK(); - TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { - if (ds->nfsdev_nmp != NULL && (ds->nfsdev_mdsisset == 0 || - (mp->mnt_stat.f_fsid.val[0] == ds->nfsdev_mdsfsid.val[0] && - mp->mnt_stat.f_fsid.val[1] == ds->nfsdev_mdsfsid.val[1]))) - break; + /* + * Search for the first entry that handles this MDS fs, but use the + * first entry for all MDS fs's otherwise. + */ + TAILQ_FOREACH(tds, &nfsrv_devidhead, nfsdev_list) { + if (tds->nfsdev_nmp != NULL) { + if (tds->nfsdev_mdsisset == 0 && ds == NULL) + ds = tds; + else if (tds->nfsdev_mdsisset != 0 && + mp->mnt_stat.f_fsid.val[0] == + tds->nfsdev_mdsfsid.val[0] && + mp->mnt_stat.f_fsid.val[1] == + tds->nfsdev_mdsfsid.val[1]) { + ds = fds = tds; + break; + } + } } if (ds == NULL) { NFSDDSUNLOCK(); @@ -3881,17 +3894,18 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, i = dsdir[0] = ds->nfsdev_nextdir; ds->nfsdev_nextdir = (ds->nfsdev_nextdir + 1) % nfsrv_dsdirsize; dvp[0] = ds->nfsdev_dsdir[i]; - mds = TAILQ_NEXT(ds, nfsdev_list); - if (nfsrv_maxpnfsmirror > 1 && mds != NULL) { - TAILQ_FOREACH_FROM(mds, &nfsrv_devidhead, nfsdev_list) { - if (mds->nfsdev_nmp != NULL && - (mds->nfsdev_mdsisset == 0 || - (mp->mnt_stat.f_fsid.val[0] == - mds->nfsdev_mdsfsid.val[0] && + tds = TAILQ_NEXT(ds, nfsdev_list); + if (nfsrv_maxpnfsmirror > 1 && tds != NULL) { + TAILQ_FOREACH_FROM(tds, &nfsrv_devidhead, nfsdev_list) { + if (tds->nfsdev_nmp != NULL && + ((tds->nfsdev_mdsisset == 0 && fds == NULL) || + (tds->nfsdev_mdsisset != 0 && fds != NULL && + mp->mnt_stat.f_fsid.val[0] == + tds->nfsdev_mdsfsid.val[0] && mp->mnt_stat.f_fsid.val[1] == - mds->nfsdev_mdsfsid.val[1]))) { + tds->nfsdev_mdsfsid.val[1]))) { dsdir[mirrorcnt] = i; - dvp[mirrorcnt] = mds->nfsdev_dsdir[i]; + dvp[mirrorcnt] = tds->nfsdev_dsdir[i]; mirrorcnt++; if (mirrorcnt >= nfsrv_maxpnfsmirror) break; @@ -4495,7 +4509,7 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char struct nfsmount *nmp, *newnmp; struct sockaddr *sad; struct sockaddr_in *sin; - struct nfsdevice *ds, *fndds; + struct nfsdevice *ds, *tds, *fndds; struct pnfsdsfile *pf; uint32_t dsdir; int error, fhiszero, fnd, gotone, i, mirrorcnt; @@ -4563,6 +4577,7 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char /* Use the socket address to find the mount point. */ fndds = NULL; NFSDDSLOCK(); + /* Find a match for the IP address. */ TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds->nfsdev_nmp != NULL) { dvp = ds->nfsdev_dvp; @@ -4570,25 +4585,41 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char if (nmp != ds->nfsdev_nmp) printf("different2 nmp %p %p\n", nmp, ds->nfsdev_nmp); - if (nfsaddr2_match(sad, nmp->nm_nam)) + if (nfsaddr2_match(sad, nmp->nm_nam)) { fndds = ds; - else if (newnmpp != NULL && - newnmp == NULL && - (*newnmpp == NULL || - fndds == NULL) && - (ds->nfsdev_mdsisset == 0 || - (ds->nfsdev_mdsfsid.val[0] == + break; + } + } + } + if (fndds != NULL && newnmpp != NULL && + newnmp == NULL) { + /* Search for a place to make a mirror copy. */ + TAILQ_FOREACH(tds, &nfsrv_devidhead, + nfsdev_list) { + if (tds->nfsdev_nmp != NULL && + fndds != tds && + ((tds->nfsdev_mdsisset == 0 && + fndds->nfsdev_mdsisset == 0) || + (tds->nfsdev_mdsisset != 0 && + fndds->nfsdev_mdsisset != 0 && + tds->nfsdev_mdsfsid.val[0] == mp->mnt_stat.f_fsid.val[0] && - ds->nfsdev_mdsfsid.val[1] == - mp->mnt_stat.f_fsid.val[1]))) - /* - * Return a destination for the - * copy in newnmpp. Choose the - * last valid one before the - * source mirror, so it isn't - * always the first one. - */ - *newnmpp = nmp; + tds->nfsdev_mdsfsid.val[1] == + mp->mnt_stat.f_fsid.val[1]))) { + *newnmpp = tds->nfsdev_nmp; + break; + } + } + if (tds != NULL) { + /* + * Move this entry to the end of the + * list, so it won't be selected as + * easily the next time. + */ + TAILQ_REMOVE(&nfsrv_devidhead, tds, + nfsdev_list); + TAILQ_INSERT_TAIL(&nfsrv_devidhead, tds, + nfsdev_list); } } NFSDDSUNLOCK(); From owner-svn-src-head@freebsd.org Sat Jul 7 20:28:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E38C10264EF; Sat, 7 Jul 2018 20:28:40 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660062.outbound.protection.outlook.com [40.107.66.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E23FA8A687; Sat, 7 Jul 2018 20:28:39 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM (52.132.44.24) by YTOPR0101MB1114.CANPRD01.PROD.OUTLOOK.COM (52.132.50.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Sat, 7 Jul 2018 20:28:38 +0000 Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM ([fe80::7098:a543:5be8:f30e]) by YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM ([fe80::7098:a543:5be8:f30e%4]) with mapi id 15.20.0930.016; Sat, 7 Jul 2018 20:28:38 +0000 From: Rick Macklem To: Andrew Gallatin CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r335967 - head/sys/dev/mxge Thread-Topic: svn commit: r335967 - head/sys/dev/mxge Thread-Index: AQHUE/r/U9IY4eihoEW9Zacqgo0Qe6R/1L2AgAAUUoCAATWlZ4ACsWqAgABh6nU= Date: Sat, 7 Jul 2018 20:28:38 +0000 Message-ID: References: <201807050120.w651KP5K045633@pdx.rh.CN85.dnsmgr.net> <97ae3381-7c25-7b41-9670-84b825722f52@cs.duke.edu> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB1114; 7:QnqXdw3pxFxtwwWyIAveI3BH2nZLDIfC84jsPHufpcrXi2XKhd/sMhyOn+O9GkYTKbk9PNAEPbDydAckoY8He+MqPugmHR0fN4BJY1wQHTefGVzg4Ar9dnLTEEN2LauKcyk3Z9Jrs7SKF4Yy2y7TEc62dPRKzOJSRXsox3AV2v66OuMzrtwxBKN3NCgHj0LexebVaUudCpKEjzSiATTBnJXcd5toX0tcJVYCCaKJpkdo2oMZkm/wv6o3SXyIk9yB x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 22a93d87-0607-4357-6597-08d5e44838c5 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB1114; x-ms-traffictypediagnostic: YTOPR0101MB1114: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:YTOPR0101MB1114; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB1114; x-forefront-prvs: 0726B2D7A6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(366004)(376002)(39850400004)(346002)(199004)(189003)(7696005)(2900100001)(229853002)(2171002)(102836004)(53936002)(76176011)(2906002)(316002)(786003)(6506007)(14454004)(54906003)(106356001)(33656002)(4326008)(105586002)(6246003)(99286004)(93886005)(186003)(26005)(8936002)(8676002)(25786009)(86362001)(81166006)(6436002)(9686003)(55016002)(6916009)(478600001)(486006)(11346002)(476003)(74316002)(446003)(305945005)(74482002)(97736004)(256004)(5250100002)(5660300001)(5024004)(81156014)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB1114; H:YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: Fv1QlKjTHVknnwA8WoSmuZxY4yZBc8aFrmYUQOAdK8UJQ7wH9VtNQgG3tndX7UPBqSQIAMHSHsN7Q2SiRvaDWn/iDi+kH4CDn49ON33blOwdU/gyuxj2Wa6KoloMVlqdZw7uUzY7DFszZRabaKCBLobu6/nalMXGtvKRV1QEfVs8nXPt9Auf3XGqhq52vfLNlgROsTRq5WGWcMH0gzNi/L6H8XPIQ/A98TBjiqSOpmLce7vr44sjT10RIGhwhXqZ8y1QE891jkD4ZRFO3F0TBi9Mifs4ySmAQuxAAJ/1++Bif3T90/fKjQ78lEZMDe5tY1gMOnuOILRHbsZt/GIccWAAJPuYaXuDTBDbhdlb6qg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 22a93d87-0607-4357-6597-08d5e44838c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2018 20:28:38.3094 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1114 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 20:28:40 -0000 Andrew Gallatin wrote: >Given that we do TSO like Linux, and not like MS (meaning >we express the size of the pre-segmented packet using the >a 16-bit value in the IPv4/IPv6 header), supporting more >than 64K is not possible in FreeBSD, so I'm basically >saying "nerf this constraint". Well, my understanding was that the total length of the TSO segment is in the first header mbuf of the chain handed to the net driver. I thought the 16bit IP header was normally filled in with the length because certain drivers/hardware expected that. >MS windows does it better / different; they express the >size of the pre-segmented packet in packet metadata, >leaving ip->ip_len =3D 0. This is better, since >then the pseudo hdr checksum in the template header can be >re-used (with the len added) for every segment by the NIC. >If you've ever seen a driver set ip->ip_len =3D 0, and re-calc >the pseudo-hdr checksum, that's why. This is also why >MS LSOv2 can support TSO of packets larger than 64K, since they're >not constrained by the 16-bit value in the IP{4,6} header. >The value of TSO larger than 64K is questionable at best though. >Without pacing, you'd just get more packets dropped when >talking across the internet.. I think some drivers already do TSO segments greater than 64K. (It has been a while, but I recall "grep"ng for a case where if_hw_tsomax w= as set to a large value and did find one. I think it was a "vm" fake hardware driver.) I suspect the challenge is more finding out what the hardware actually expects the IP header length to be set to. If MS uses a setting of 0, I'd g= uess most newer hardware can handle that? Beyond that, this is way out of my area of exeprtise;-) > if_hw_tsomaxsegsize is the maximum size of contiguous memory > that a "chunk" of the TSO segment can be stored in for handling by > the driver's transmit side. Since higher >And this is what I object to. TCP should not care about >this. Drivers should use busdma, or otherwise be capable of >chopping large contig regions down to chunks that they can >handle. If a driver can really only handle 2K, then it should >be having busdma give it an s/g list that is 2x as long, not having >TCP call m_dupcl() 2x as often on page-sized data generated by >sendfile (or more on non-x86 with larger pages). > >> level code such as NFS (and iSCSI, I think?) uses MCLBYTE clusters, >> anything 2K or higher normally works the same. Not sure about >> sosend(), but I think it also copies the data into MCLBYTE clusters? >> This would change if someday jumbo mbuf clusters become the norm. >> (I tried changing the NFS code to use jumbo clusters, but it would >> result in fragmentation of the memory used for mbuf cluster allocation= , >> so I never committed it.) > >At least for sendfile(), vm pages are wrapped up and attached to >mbufs, so you have 4K (and potentially much more on non-x86). >Doesn't NFS do something similar when sending data, or do you copy >into clusters? Most NFS RPC messages are small and fit into a regular mbuf. I have to look at the code to see when/if it uses an mbuf cluster for those. (It has chang= ed a few times over the years.) For Read replies, it uses a chain of mbuf clusters. I suspect that it could do what sendfile does for UFS. Part of the problem is that NFS clients can = do byte aligned reads of any size, so going through the buffer cache is useful sometimes. For write requests, odd sized writes that are byte aligned can o= ften happen when a loader does its thing. For ZFS, I have no idea. I'm not a ZFS guy. For write requests, the server gets whatever the TCP layer passes up, which is normally a chain of mbufs. (For the client substitute Read/Write, since the writes are copied out of t= he buffer cache and the Read replies come up from TCP.) >I have changes which I have not upstreamed yet which enhance mbufs to >carry TLS metadata & vector of physical addresses (which I call >unmapped mbufs) for sendfile and kernel TLS. As part of that, >sosend (for kTLS) can allocate many pages and attach them to one mbuf. >The idea (for kTLS) is that you can keep an entire TLS record (with >framing information) in a single unmapped mbuf, which saves a >huge amount of CPU which would be lost to cache misses doing >pointer-chasing of really long mbuf chains (TLS hdrs and trailers >are generally 13 and 16 bytes). The goal was to regain CPU >during Netflix's transition to https streaming. However, it >is unintentionally quite helpful on i386, since it reduces >overhead from having to map/unmap sf_bufs. FWIW, these mbufs >have been in production at Netflix for over a year, and carry >a large fraction of the worlds internet traffic :) These could probably be useful for the NFS server doing read replies, since it does a VOP_READ() with a "uio" that refers to buffers (which happen to b= e mbuf cluster data areas right now). For the other cases, I'd have to look at it more closely. They do sound interesting, rick [stuff snipped]= From owner-svn-src-head@freebsd.org Sat Jul 7 20:43:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 684421027EC1; Sat, 7 Jul 2018 20:43:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1179D8B1A7; Sat, 7 Jul 2018 20:43:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6C8A1C624; Sat, 7 Jul 2018 20:43:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67Kh1g2056226; Sat, 7 Jul 2018 20:43:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67Kh1kE056224; Sat, 7 Jul 2018 20:43:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807072043.w67Kh1kE056224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Jul 2018 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336076 - head/share/man/man4/man4.arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4/man4.arm X-SVN-Commit-Revision: 336076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 20:43:02 -0000 Author: ian Date: Sat Jul 7 20:43:01 2018 New Revision: 336076 URL: https://svnweb.freebsd.org/changeset/base/336076 Log: Add a manpage for the imx5/6 watchdog driver. Added: head/share/man/man4/man4.arm/imx_wdog.4 (contents, props changed) Modified: head/share/man/man4/man4.arm/Makefile Modified: head/share/man/man4/man4.arm/Makefile ============================================================================== --- head/share/man/man4/man4.arm/Makefile Sat Jul 7 19:27:49 2018 (r336075) +++ head/share/man/man4/man4.arm/Makefile Sat Jul 7 20:43:01 2018 (r336076) @@ -4,11 +4,13 @@ PACKAGE=runtime-manuals MAN= cgem.4 \ devcfg.4 \ + imx_wdog.4 \ mge.4 \ npe.4 \ ti_adc.4 MLINKS= cgem.4 if_cgem.4 +MLINKS+= imx_wdog.4 imxwdt.4 MLINKS+= mge.4 if_mge.4 MLINKS+=npe.4 if_npe.4 Added: head/share/man/man4/man4.arm/imx_wdog.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/imx_wdog.4 Sat Jul 7 20:43:01 2018 (r336076) @@ -0,0 +1,112 @@ +.\" +.\" Copyright (c) 2018 Ian Lepore +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd July 7, 2018 +.Dt IMX_WDOG 4 +.Os +.Sh NAME +.Nm imx_wdog +.Nd device driver for the NXP i.MX5 and i.MX6 watchdog timer +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device imxwdt" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +imx_wdog_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog timer present on NXP i.MX5 and i.MX6 processors. +The i.MX watchdog hardware supports programmable timeouts ranging from +0.5 to 128 seconds, in half-second increments. +Once activated, the watchdog hardware cannot be deactivated, but the +timeout period can be changed to any valid non-zero value. +.Pp +At power-on, a special 16-second +.Sq power-down timer +mode is automatically enabled by the hardware. +It will assert the external WDOG_B signal, which may be connected to +external hardware that causes the system to reset or power-down. +The power-down timer is often reset by the boot loader (typically U-Boot). +If the power-down timer is still active at the time when the normal +watchdog is first enabled, the +.Nm +driver automatically disables it. +.Pp +The +.Nm +driver supports the FDT +.Va fsl,external-reset +property by enabling the assertion of the WDOG_B external timeout signal +when the property is present. +When running this way, the need to reset the system due to watchdog +timeout is signaled by driving the WDOG_B line low; some external +entity is expected to assert the chip's POR pin in response. +The +.Nm +driver attempts to backstop this external reset by scheduling an +interrupt to occur as well. +The interrupt handler waits 1 second for the external reset to occur, +then it triggers a normal software reset. +Note that the WDOG_B signal can be configured to use a variety of +pins on the chip. +For the +.Va fsl,external-reset +property to be effective, the signal must be connected to an appropriate +pin by the system's FDT pinctrl data. +.Pp +The +.Nm +driver supports the FDT +.Va timeout-secs +property by enabling the watchdog as soon as the driver attaches, +using the given timeout value. +This extends watchdog protection to much of the system startup process, +but it still requires that +.Xr watchdogd 4 +be configured to service the watchdog. +.Sh SEE ALSO +.Xr fdt 4 , +.Xr watchdog 4 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . From owner-svn-src-head@freebsd.org Sat Jul 7 21:08:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5409102B311; Sat, 7 Jul 2018 21:08:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1ABFC8C43A; Sat, 7 Jul 2018 21:08:50 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id buRifmhEzbP3IbuRkfZW2E; Sat, 07 Jul 2018 15:08:49 -0600 X-Authority-Analysis: v=2.3 cv=P64UeBIu c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=8nJEP1OIZ-IA:10 a=R9QF1RCXAYgA:10 a=v3ZZPjhaAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VZAjDpALnvreuzWOkZAA:9 a=wPNLvfGTeEIA:10 a=CSZHitJkNe4A:10 a=EZ7zVjnluhUA: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 5BE81252; Sat, 7 Jul 2018 14:08:45 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w67L8inJ051395; Sat, 7 Jul 2018 14:08:44 -0700 (PDT) (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 w67L8irC051381; Sat, 7 Jul 2018 14:08:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201807072108.w67L8irC051381@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?B?5b6M6Jek5aSn5Zyw?= cc: Hiroki Sato , daichi@FreeBSD.org, Eitan Adler , gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336028 - head/usr.bin/top In-Reply-To: Message from =?utf-8?B?5b6M6Jek5aSn5Zyw?= of "Sat, 07 Jul 2018 20:39:33 +0900." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Sat, 07 Jul 2018 14:08:44 -0700 X-CMAE-Envelope: MS4wfHyjYPornxyo1mUOspVRBOvxkvrWYF5DvKCSOX/d4b+eCeV0lnS2n/0dM5rsEf8soON0l1k0u8j0ApE6GqvSj+uUvfa/DT4uIVCpbKcZR/rJ1KLXWMcB cTM88aaHbfrXgvYt1G+81t9Trs8IiB+3ajYNI9tybWBCsZx8tpzLlARknc7LKV71YQeTrEXnoUMp+RTONjcU4k5ltib2QViPZBN7tmcgLW/IAsdGeKuNUW10 Rttlhk+BAt64zSORE+HO4ZbYPW/W265j6m5I0oHHncz5HaUrLDAr8hyLxPTJ3FKY2SEQRZie6wAUMw44v+hr017i/2gwzcyDchIs5oxf2yMYDUj0bQBPOGx0 yC4q33rrnb/dbM4/xNzESSpqbEaN7E57f7w8+Jd4QKz943wVw/OnUGLgpKP1VjiyCozMRH9e X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 21:08:52 -0000 In message , =?utf-8?B?5b6M6Je k5aSn5Zyw?= writes: > > > 2018/07/07 8:53、Hiroki Sato のメール: > > > > Daichi GOTO wrote > > in <201807061207.w66C76CR043533@repo.freebsd.org>: > > > > da> Author: daichi > > da> Date: Fri Jul 6 12:07:06 2018 > > da> New Revision: 336028 > > da> URL: https://svnweb.freebsd.org/changeset/base/336028 > > da> > > da> Log: > > da> Changed to eliminate the upper limit of command length displayed > > da> by "-a" and expand to match terminal width > > da> > > da> Reviewed by: eadler > > da> Approved by: gnn (mentor) > > da> Differential Revision: https://reviews.freebsd.org/D16083 > > da> > > da> Modified: > > da> head/usr.bin/top/display.c > > da> head/usr.bin/top/machine.c > > da> head/usr.bin/top/screen.c > > da> head/usr.bin/top/top.h > > > > This change breaks displaying a prompt and messages in the > > interactive mode by new_message() when typing "o" or "p", for > > example. While r336031 fixed a warning in GCC, it does not fix the > > problem itself. Please fix it. > > OK. I will fix this problem first. This should circumvent the problem until you find a more permanent fix. Index: /opt/src/svn-current/usr.bin/top/display.c =================================================================== --- /opt/src/svn-current/usr.bin/top/display.c (revision 336075) +++ /opt/src/svn-current/usr.bin/top/display.c (working copy) @@ -960,7 +960,7 @@ va_start(args, msgfmt); /* first, format the message */ - vsnprintf(next_msg, strlen(next_msg), msgfmt, args); + vsnprintf(next_msg, screen_width + 5, msgfmt, args); va_end(args); > > > > I also think restructure of the buffer management is required first > > if we want to eliminate the column width limitation. Using sbuf(9) > > consistently may be better than incomplete conversion from static > > arrays to malloc(). > > I understand. Switching to sbuf(9) is the next step. > > > > > -- Hiroki > > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Jul 7 21:14:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93989102BC45; Sat, 7 Jul 2018 21:14:06 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [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 135218CA60; Sat, 7 Jul 2018 21:14:05 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w67LDTYo047915 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 7 Jul 2018 23:13:29 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: gallatin@cs.duke.edu Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w67LDOiE010204 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 8 Jul 2018 04:13:24 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r335916 - head/sys/conf To: Andrew Gallatin References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> <51ec1e54-c940-9800-5c84-0f9b6e08895f@cs.duke.edu> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B412CEF.3020901@grosbein.net> Date: Sun, 8 Jul 2018 04:13:19 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <51ec1e54-c940-9800-5c84-0f9b6e08895f@cs.duke.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 21:14:06 -0000 07.07.2018 22:02, Andrew Gallatin wrote: > One thing that was tangentially brought up is that the ability > to compile out-of-tree modules requires keeping the kernel-headers > around. So we may need to identify all the headers that a module might > need, and install them in /boot/$KERNEL/sys or some-such. This would > be needed if, for example, we wanted to install a new Nvidia or Virtual > Box module and have it work for older installed kernel versions too > (eg, across ABI breaking changes in -current). We already have all headers in /usr/include, don't we? From owner-svn-src-head@freebsd.org Sat Jul 7 21:39:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE680102E157 for ; Sat, 7 Jul 2018 21:39:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 718558D8AE for ; Sat, 7 Jul 2018 21:39:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id 16-v6so20768080itl.5 for ; Sat, 07 Jul 2018 14:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H7OZTpWQV566bVdMTnYiR0ykqv71S8ZBmBg6MtFtGEE=; b=c9a5G4EpAXs3pSMc/8zvJdRMpF7BSglJKk6NwrqqEHNLuMFyHJrvgMFKUmm86lNjIR lrNhVAEDJnwjbgrdd+DuNsAd9LDY6p+gJC2SPj1hw7RHKhCeD2jZXt5M3DMXqzYbdtdD aiudSH/nlvQcCHnppxWFf24OIOsYPmditnpHJXS54zDyXnkZs543E2XtguSDJ6Lgkj9k 8VxHJxQBNaxQnrVA0SC2VPPKkygGI1rnYfLOOYPwfMy3GX+xuNb79HRt/UW7pcTdz/sQ pRVbamQT6zapPVHXbk163qr8NLaf+8dTotzmbMiSsu9o3bc9nXShPHIwNaJ35OYhA6ys ZD/A== 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=H7OZTpWQV566bVdMTnYiR0ykqv71S8ZBmBg6MtFtGEE=; b=sjL5I/LuKyGXDHIYxQkhGW4OowxHnMX0YYB/7PJZCsP2KSASzwEw7ZCtp0hTnKEmIq xVzxH7ZICYmC6R6Cl4DKKx0zIdrw7FwPojSeqzzrobCsSV16RzZ6oF7FDphd+toZKa9F DRFn9m46aPPV7AjzGjGtcg8hh4g0dMJVkDVctDD4Mx/tdu7Y0HO+QgCFpMbtEWK7H0G5 TgQh3vG0w9Ot3vC1H00phmjzPxkI95y/dyTK9ADZbOiYQCLcyPp+xgKv3+lc5ds65/QS EisYOoFyNJokvqgDB8HcpoCdWDUJhZwrVc++1uq5FzF+5zUGmSRHQI7x8XuBjzYooAdn rCqw== X-Gm-Message-State: APt69E10yWvbSPeBSoR/r1GCnV8ycUUbsuDZOw9YpSZAijWDS9oxIYrx hrIx7JAjjfYQ+KKP5TYEBO8kyO3NSSYLdfBQBiaW8w== X-Google-Smtp-Source: AAOMgpfYK0PmFdVwjD15qulIszap6DxuQohit+kFZ4mYpsjY26b2c/i8KzOg7sCsu82YZqTEk3xZbAM9wygjmEsNQqk= X-Received: by 2002:a02:a701:: with SMTP id k1-v6mr12713275jam.140.1530999541429; Sat, 07 Jul 2018 14:39:01 -0700 (PDT) MIME-Version: 1.0 References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> <51ec1e54-c940-9800-5c84-0f9b6e08895f@cs.duke.edu> <5B412CEF.3020901@grosbein.net> In-Reply-To: <5B412CEF.3020901@grosbein.net> From: Warner Losh Date: Sat, 7 Jul 2018 15:38:01 -0600 Message-ID: Subject: Re: svn commit: r335916 - head/sys/conf To: Eugene Grosbein Cc: Andrew Gallatin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 21:39:03 -0000 On Sat, Jul 7, 2018, 4:14 PM Eugene Grosbein wrote: > 07.07.2018 22:02, Andrew Gallatin wrote: > > > One thing that was tangentially brought up is that the ability > > to compile out-of-tree modules requires keeping the kernel-headers > > around. So we may need to identify all the headers that a module might > > need, and install them in /boot/$KERNEL/sys or some-such. This would > > be needed if, for example, we wanted to install a new Nvidia or Virtual > > Box module and have it work for older installed kernel versions too > > (eg, across ABI breaking changes in -current). > > We already have all headers in /usr/include, don't we? > Not really. We have a subset of the kernel headers that might not match the running kernel, nor be enough to build modules. Warner > From owner-svn-src-head@freebsd.org Sat Jul 7 21:49:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DF41102F135; Sat, 7 Jul 2018 21:49:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFEC28DF60; Sat, 7 Jul 2018 21:49:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CB781CFE7; Sat, 7 Jul 2018 21:49:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w67LnX3S087637; Sat, 7 Jul 2018 21:49:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w67LnUtT087621; Sat, 7 Jul 2018 21:49:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807072149.w67LnUtT087621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Jul 2018 21:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336077 - in head/share/man/man4: . man4.aarch64 man4.arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/share/man/man4: . man4.aarch64 man4.arm X-SVN-Commit-Revision: 336077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 21:49:34 -0000 Author: ian Date: Sat Jul 7 21:49:30 2018 New Revision: 336077 URL: https://svnweb.freebsd.org/changeset/base/336077 Log: Move arm- and aarch64-specific manpages into arch-specific directories. This removes a bit of the .if/.endif clutter from man4/Makefile by using the existing machinery that supports per-arch manpages. Added: head/share/man/man4/man4.aarch64/ head/share/man/man4/man4.aarch64/Makefile (contents, props changed) head/share/man/man4/man4.aarch64/rk_gpio.4 - copied unchanged from r336076, head/share/man/man4/rk_gpio.4 head/share/man/man4/man4.aarch64/rk_grf.4 - copied unchanged from r336076, head/share/man/man4/rk_grf.4 head/share/man/man4/man4.aarch64/rk_i2c.4 - copied unchanged from r336076, head/share/man/man4/rk_i2c.4 head/share/man/man4/man4.aarch64/rk_pinctrl.4 - copied unchanged from r336076, head/share/man/man4/rk_pinctrl.4 head/share/man/man4/man4.arm/aw_gpio.4 - copied unchanged from r336076, head/share/man/man4/aw_gpio.4 head/share/man/man4/man4.arm/aw_mmc.4 - copied unchanged from r336076, head/share/man/man4/aw_mmc.4 head/share/man/man4/man4.arm/aw_rtc.4 - copied unchanged from r336076, head/share/man/man4/aw_rtc.4 head/share/man/man4/man4.arm/aw_sid.4 - copied unchanged from r336076, head/share/man/man4/aw_sid.4 head/share/man/man4/man4.arm/aw_spi.4 - copied unchanged from r336076, head/share/man/man4/aw_spi.4 head/share/man/man4/man4.arm/aw_syscon.4 - copied unchanged from r336076, head/share/man/man4/aw_syscon.4 head/share/man/man4/man4.arm/bcm283x_pwm.4 - copied unchanged from r336076, head/share/man/man4/bcm283x_pwm.4 Deleted: head/share/man/man4/aw_gpio.4 head/share/man/man4/aw_mmc.4 head/share/man/man4/aw_rtc.4 head/share/man/man4/aw_sid.4 head/share/man/man4/aw_spi.4 head/share/man/man4/aw_syscon.4 head/share/man/man4/bcm283x_pwm.4 head/share/man/man4/rk_gpio.4 head/share/man/man4/rk_grf.4 head/share/man/man4/rk_i2c.4 head/share/man/man4/rk_pinctrl.4 Modified: head/share/man/man4/Makefile head/share/man/man4/man4.arm/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Jul 7 20:43:01 2018 (r336076) +++ head/share/man/man4/Makefile Sat Jul 7 21:49:30 2018 (r336077) @@ -54,7 +54,6 @@ MAN= aac.4 \ ${_aout.4} \ ${_apic.4} \ arcmsr.4 \ - ${_armv8crypto.4} \ ${_asmc.4} \ ata.4 \ ath.4 \ @@ -70,16 +69,9 @@ MAN= aac.4 \ audit.4 \ auditpipe.4 \ aue.4 \ - ${_aw_gpio.4} \ - ${_aw_mmc.4} \ - ${_aw_rtc.4} \ - ${_aw_sid.4} \ - ${_aw_spi.4} \ - ${_aw_syscon.4} \ axe.4 \ axge.4 \ bce.4 \ - ${_bcm283x_pwm.4} \ bcma.4 \ bfe.4 \ bge.4 \ @@ -444,10 +436,6 @@ MAN= aac.4 \ re.4 \ rgephy.4 \ rights.4 \ - ${_rk_gpio.4} \ - ${_rk_grf.4} \ - ${_rk_i2c.4} \ - ${_rk_pinctrl.4} \ rl.4 \ rndtest.4 \ route.4 \ @@ -762,23 +750,6 @@ MLINKS+=${_wpi.4} ${_if_wpi.4} MLINKS+=xe.4 if_xe.4 MLINKS+=xl.4 if_xl.4 -.if ${MACHINE_CPUARCH} == "aarch64" -_armv8crypto.4= armv8crypto.4 -_rk_gpio.4= rk_gpio.4 -_rk_grf.4= rk_grf.4 -_rk_i2c.4= rk_i2c.4 -_rk_pinctrl.4= rk_pinctrl.4 -.endif - -.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64" -_aw_gpio.4= aw_gpio.4 -_aw_mmc.4= aw_mmc.4 -_aw_rtc.4= aw_rtc.4 -_aw_sid.4= aw_sid.4 -_aw_spi.4= aw_spi.4 -_aw_syscon.4= aw_syscon.4 -.endif - .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _acpi_asus.4= acpi_asus.4 _acpi_asus_wmi.4= acpi_asus_wmi.4 @@ -894,10 +865,6 @@ _nvram2env.4= nvram2env.4 .if ${MACHINE_CPUARCH} == "powerpc" _nvd.4= nvd.4 _nvme.4= nvme.4 -.endif - -.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64" -_bcm283x_pwm.4= bcm283x_pwm.4 .endif .if exists(${.CURDIR}/man4.${MACHINE_CPUARCH}) Added: head/share/man/man4/man4.aarch64/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.aarch64/Makefile Sat Jul 7 21:49:30 2018 (r336077) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +PACKAGE=runtime-manuals + +.PATH: ${.CURDIR}/../man4.arm # Some manpages are common to arm and aarch64 + +MAN= \ + armv8crypto.4 \ + aw_gpio.4 \ + aw_mmc.4 \ + aw_rtc.4 \ + aw_sid.4 \ + aw_spi.4 \ + aw_syscon.4 \ + bcm283x_pwm.4 \ + rk_gpio.4 \ + rk_grf.4 \ + rk_i2c.4 \ + rk_pinctrl.4 \ + +MANSUBDIR=/aarch64 + +.include Copied: head/share/man/man4/man4.aarch64/rk_gpio.4 (from r336076, head/share/man/man4/rk_gpio.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.aarch64/rk_gpio.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/rk_gpio.4) @@ -0,0 +1,63 @@ +.\"- +.\" Copyright (c) 2018 Emmanuel Vadot +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Apr 26, 2018 +.Dt RK_GPIO 4 +.Os +.Sh NAME +.Nm rk_gpio +.Nd driver for the gpio controller on RockChip SoCs +.Sh SYNOPSIS +.Cd "options SOC_ROCKCHIP_RK3328" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the gpio controller device present +on RockChip SoC. +.Sh HARDWARE +The current version of the +.Nm +driver supports the gpio banks with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +rockchip,gpio-bank +.El +.Sh SEE ALSO +.Xr gpiobus 4 , +.Xr gpioctl 8 , +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver and manpage was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.aarch64/rk_grf.4 (from r336076, head/share/man/man4/rk_grf.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.aarch64/rk_grf.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/rk_grf.4) @@ -0,0 +1,60 @@ +.\"- +.\" Copyright (c) 2018 Emmanuel Vadot +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Apr 26, 2018 +.Dt RK_GRF 4 +.Os +.Sh NAME +.Nm rk_grf +.Nd driver for the General Register Files controller on RockChip SoCs +.Sh SYNOPSIS +.Cd "options SOC_ROCKCHIP_rk3328" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the RockChip General Register Files +system controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the GRF controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +rockchip,rk3328-grf +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver and manpage was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.aarch64/rk_i2c.4 (from r336076, head/share/man/man4/rk_i2c.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.aarch64/rk_i2c.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/rk_i2c.4) @@ -0,0 +1,64 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Emmanuel Vadot +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 14, 2018 +.Dt RK_I2C 4 +.Os +.Sh NAME +.Nm rk_i2c +.Nd driver for the i2c controller on RockChip SoCs +.Sh SYNOPSIS +.Cd "options SOC_ROCKCHIP_RK3328" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the i2c controller device present +on RockChip SoC. +.Sh HARDWARE +The current version of the +.Nm +driver supports the i2c controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +rockchip,rk3328-i2c +.El +.Sh SEE ALSO +.Xr iic 4 , +.Xr iicbus 4 , +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver and manpage was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.aarch64/rk_pinctrl.4 (from r336076, head/share/man/man4/rk_pinctrl.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.aarch64/rk_pinctrl.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/rk_pinctrl.4) @@ -0,0 +1,62 @@ +.\"- +.\" Copyright (c) 2018 Emmanuel Vadot +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Apr 26, 2018 +.Dt RK_PINCTRL 4 +.Os +.Sh NAME +.Nm rk_pinctrl +.Nd driver for the pin multiplexing on RockChip SoCs +.Sh SYNOPSIS +.Cd "options SOC_ROCKCHIP_RK3328" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the pin multiplexing device present +on RockChip SoC. +.Sh HARDWARE +The current version of the +.Nm +driver supports the pin controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +rockchip,rk3328-pinctrl +.El +.Sh SEE ALSO +.Xr fdt_pinctrl 4 , +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver and manpage was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Modified: head/share/man/man4/man4.arm/Makefile ============================================================================== --- head/share/man/man4/man4.arm/Makefile Sat Jul 7 20:43:01 2018 (r336076) +++ head/share/man/man4/man4.arm/Makefile Sat Jul 7 21:49:30 2018 (r336077) @@ -2,7 +2,15 @@ PACKAGE=runtime-manuals -MAN= cgem.4 \ +MAN= \ + aw_gpio.4 \ + aw_mmc.4 \ + aw_rtc.4 \ + aw_sid.4 \ + aw_spi.4 \ + aw_syscon.4 \ + bcm283x_pwm.4 \ + cgem.4 \ devcfg.4 \ imx_wdog.4 \ mge.4 \ Copied: head/share/man/man4/man4.arm/aw_gpio.4 (from r336076, head/share/man/man4/aw_gpio.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_gpio.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/aw_gpio.4) @@ -0,0 +1,102 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Dec 25, 2017 +.Dt AW_GPIO 4 +.Os +.Sh NAME +.Nm aw_gpio +.Nd driver for the GPIO and pin muxing functionalities on Allwinner SoC +.Sh SYNOPSIS +.Cd "device gpio" +.Cd "options SOC_ALLWINNER_A10" +.Cd "options SOC_ALLWINNER_A13" +.Cd "options SOC_ALLWINNER_A20" +.Cd "options SOC_ALLWINNER_A31" +.Cd "options SOC_ALLWINNER_A31S" +.Cd "options SOC_ALLWINNER_A33" +.Cd "options SOC_ALLWINNER_A83T" +.Cd "options SOC_ALLWINNER_H2PLUS" +.Cd "options SOC_ALLWINNER_H3" +.Cd "options SOC_ALLWINNER_A64" +.Cd "options SOC_ALLWINNER_H5" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner pin muxing and GPIO on +Allwinner SoCs. +.Sh HARDWARE +The current version of the +.Nm +driver supports the GPIO/pinmuxing controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-pinctrl +.It +allwinner,sun5i-a13-pinctrl +.It +allwinner,sun7i-a20-pinctrl +.It +allwinner,sun6i-a31-pinctrl +.It +allwinner,sun6i-a31s-pinctrl +.It +allwinner,sun6i-a31-r-pinctrl +.It +allwinner,sun6i-a33-pinctrl +.It +allwinner,sun8i-a83t-pinctrl +.It +allwinner,sun8i-a83t-r-pinctrl +.It +allwinner,sun8i-h3-pinctrl +.It +allwinner,sun50i-h5-pinctrl +.It +allwinner,sun8i-h3-r-pinctrl +.It +allwinner,sun50i-a64-pinctrl +.It +allwinner,sun50i-a64-r-pinctrl +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr gpio 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver was originally written by +.An Ganbold Tsagaankhuu Aq Mt ganbold@freebsd.org . +This manual page was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.arm/aw_mmc.4 (from r336076, head/share/man/man4/aw_mmc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_mmc.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/aw_mmc.4) @@ -0,0 +1,76 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Dec 25, 2017 +.Dt AW_MMC 4 +.Os +.Sh NAME +.Nm aw_mmc +.Nd driver for the SD/MMC controller in Allwinner SoC +.Sh SYNOPSIS +.Cd "device mmc" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner SD/MMC host controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SD/MMC controller with one of the following compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-mmc +.It +allwinner,sun5i-a13-mmc +.It +allwinner,sun7i-a20-mmc +.It +allwinner,sun50i-a64-mmc +.El +.Sh SYSCTL VARIABLES +The following read-only variables are available via +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va dev.aw_mmc.req_timeout +Request timeout in seconds (default: 10) . +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr mmc 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver was originally written by +.An Alexander Fedorov Aq Mt alexander.fedorov@rtlservice.com . +Later work and this manual page was done by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.arm/aw_rtc.4 (from r336076, head/share/man/man4/aw_rtc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_rtc.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/aw_rtc.4) @@ -0,0 +1,63 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Dec 25, 2017 +.Dt AW_RTC 4 +.Os +.Sh NAME +.Nm aw_rtc +.Nd driver for the RTC controller in Allwinner SoC +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner RTC controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the RTC controller with one of the following compatible +strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-rtc +.It +allwinner,sun7i-a20-rtc +.It +allwinner,sun6i-a31-rtc +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Vladimir Belian Aq Mt fate10@gmail.com . +This manual page was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.arm/aw_sid.4 (from r336076, head/share/man/man4/aw_sid.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_sid.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/aw_sid.4) @@ -0,0 +1,77 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 6, 2018 +.Dt AW_SID 4 +.Os +.Sh NAME +.Nm aw_sid +.Nd driver for the SID controller in Allwinner SoC +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner SID (Security ID) controller. +This controller provides root security keys that may be used as either a device +unique ID or to generate a MAC address. +.Sh HARDWARE +The +.Nm +driver supports the SID controller with one of the following compatible +strings: +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-sid +.It +allwinner,sun7i-a20-sid +.It +allwinner,sun50i-a64-sid +.It +allwinner,sun8i-a83t-sid +.It +allwinner,sun8i-h3-sid +.El +.Sh SYSCTL VARIABLES +The following read-only variables are available via +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va dev.aw_sid.rootkey +Root security key for this device. +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Jared McNeill Aq Mt jmcneill@invisible.ca . +This manual page was written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . Copied: head/share/man/man4/man4.arm/aw_spi.4 (from r336076, head/share/man/man4/aw_spi.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_spi.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/aw_spi.4) @@ -0,0 +1,58 @@ +.\"- +.\" Copyright (c) 2018 Emmanuel Vadot +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 17, 2018 +.Dt AW_SPI 4 +.Os +.Sh NAME +.Nm aw_spi +.Nd driver for the SPI controller in Allwinner SoC +.Sh SYNOPSIS +.Cd "device aw_spi" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner SPI host controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SPI controller with one of the following compatible strings: +.Pp +.Bl -bullet -compact +.It +allwinner,sun8i-h3-spi +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.arm/aw_syscon.4 (from r336076, head/share/man/man4/aw_syscon.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_syscon.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/aw_syscon.4) @@ -0,0 +1,61 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 7, 2018 +.Dt AW_SYSCON 4 +.Os +.Sh NAME +.Nm aw_syscon +.Nd driver for the system controller in Allwinner SoC +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner system controller. +This controller provides registers for tying together related functionality in a +common space. +.Nm +is required for ethernet functionality on supported devices. +.Sh HARDWARE +The +.Nm +driver supports the system controller with one of the following compatible +strings: +.Pp +.Bl -bullet -compact +.It +allwinner,sun50i-a64-system-controller +.It +allwinner,sun8i-a83t-system-controller +.It +allwinner,sun8i-h3-system-controller +.El +.Sh AUTHORS +The +.Nm +device driver was written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . Copied: head/share/man/man4/man4.arm/bcm283x_pwm.4 (from r336076, head/share/man/man4/bcm283x_pwm.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/bcm283x_pwm.4 Sat Jul 7 21:49:30 2018 (r336077, copy of r336076, head/share/man/man4/bcm283x_pwm.4) @@ -0,0 +1,97 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2017 Poul-Henning Kamp +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd January 22, 2017 +.Dt BCM283X_PWM 4 +.Os +.Sh NAME +.Nm bcm283x_pwm +.Nd bcm283x_pwm - driver for Raspberry Pi 2/3 PWM +.Sh SYNOPSIS +.Cd "kldload bcm283x_clkman" +.Cd "kldload bcm283x_pwm" +.Sh DESCRIPTION +The +.Nm +driver provides access to the PWM engine on GPIO12 of Rpi 2 and 3 hardware. +.Pp +The PWM hardware is controlled via the +.Xr sysctl 8 +interface: +.Bd -literal +dev.pwm.0.mode: 1 +dev.pwm.0.freq: 125000000 +dev.pwm.0.ratio: 2500 +dev.pwm.0.period: 10000 +dev.pwm.0.pwm_freq: 12500 +.Ed +.Bl -tag -width ".Va dev.pwm.0.mode" +.It Va dev.pwm.0.mode +Three modes exist, 0=off, 1=PWM, 2=N/M. +The N/M mode is a first order delta-sigma mode, which makes a quite +handy DAC output with a trivial RC lowpass filter. +.Pp +.It Va dev.pwm.0.freq +The input frequency to the PWM hardware in Hz. +Minmum frequency is 123 kHz, maximum frequency is 125 MHz. +.It Va dev.pwm.0.period +The period length in cycles. +In PWM mode, the output frequency will be +( +.Va dev.pwm.0.freq +/ +.Va dev.pwm.0.period . +) +In N/M mode this is the 'M' +.It Va dev.pwm.0.ratio +The "on" period in cycles. +In PWM mode, to get a 25% dutycycle, set this to 25% of +.Va dev.pwm.0.period . +In N/M mode this is the 'N' +.It Va dev.pwm.0.pwm_freq +The calculated PWM output frequency in PWM mode. +.El +.Pp +.Sh NOTES +Currently the +.Nm +driver ignores the 'status="disabled"' flag in the DTB, assuming that +if you load the driver, you want it to work. +.Sh SEE ALSO +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page were written by +.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org . From owner-svn-src-head@freebsd.org Sat Jul 7 23:35:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FA6103AC77; Sat, 7 Jul 2018 23:35:16 +0000 (UTC) (envelope-from rpokala@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 BFC2D721A2; Sat, 7 Jul 2018 23:35:15 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.4] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 241EF1C9B0; Sat, 7 Jul 2018 23:35:15 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.e.1.180613 Date: Sat, 07 Jul 2018 16:35:11 -0700 Subject: Re: svn commit: r336077 - in head/share/man/man4: . man4.aarch64 man4.arm From: Ravi Pokala To: Ian Lepore , , , Message-ID: <4521CE35-F466-4757-9539-64C6386E74CD@panasas.com> Thread-Topic: svn commit: r336077 - in head/share/man/man4: . man4.aarch64 man4.arm References: <201807072149.w67LnUtT087621@repo.freebsd.org> In-Reply-To: <201807072149.w67LnUtT087621@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 23:35:16 -0000 -----Original Message----- From: on behalf of Ian Lepore Date: 2018-07-07, Saturday at 14:49 To: , , Subject: svn commit: r336077 - in head/share/man/man4: . man4.aarch64 man4.arm > Author: ian > Date: Sat Jul 7 21:49:30 2018 > New Revision: 336077 > URL: https://svnweb.freebsd.org/changeset/base/336077 > > Log: > Move arm- and aarch64-specific manpages into arch-specific directories. > > This removes a bit of the .if/.endif clutter from man4/Makefile by using > the existing machinery that supports per-arch manpages. Hi Ian, This breaks arm64 buildworld: make[8]: make[8]: don't know how to make armv8crypto.4. Stop -Ravi (rpokala@) From owner-svn-src-head@freebsd.org Sat Jul 7 23:39:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA15B103B3A4; Sat, 7 Jul 2018 23:39:47 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [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 401067241B; Sat, 7 Jul 2018 23:39:47 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w67NdU9X049049 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 8 Jul 2018 01:39:31 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w67NdJEU011208 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 8 Jul 2018 06:39:19 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r335916 - head/sys/conf To: Warner Losh References: <201807032305.w63N5guY063293@repo.freebsd.org> <20180704142233.GB5562@kib.kiev.ua> <6e5bc5e4-052c-877f-1c36-c72e276ff045@FreeBSD.org> <20180705155417.GI5562@kib.kiev.ua> <2a5b1c50-0f50-bbe1-4fcd-b98f61d24571@FreeBSD.org> <5B3EA725.4010202@grosbein.net> <1dd03d43-6f0d-580b-fd3b-f4494da42c70@FreeBSD.org> <51ec1e54-c940-9800-5c84-0f9b6e08895f@cs.duke.edu> <5B412CEF.3020901@grosbein.net> Cc: Andrew Gallatin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B414F22.4030501@grosbein.net> Date: Sun, 8 Jul 2018 06:39:14 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 23:39:48 -0000 08.07.2018 4:38, Warner Losh wrote: > On Sat, Jul 7, 2018, 4:14 PM Eugene Grosbein > wrote: > > 07.07.2018 22:02, Andrew Gallatin wrote: > > > One thing that was tangentially brought up is that the ability > > to compile out-of-tree modules requires keeping the kernel-headers > > around. So we may need to identify all the headers that a module might > > need, and install them in /boot/$KERNEL/sys or some-such. This would > > be needed if, for example, we wanted to install a new Nvidia or Virtual > > Box module and have it work for older installed kernel versions too > > (eg, across ABI breaking changes in -current). > > We already have all headers in /usr/include, don't we? > > > Not really. We have a subset of the kernel headers that might not match the running kernel, nor be enough to build modules. They should match running kernel definitely as we do not support not syncronized kernel/world and installworld populates /usr/include. And why a subset? Don'we support old-style kernel re-build "config; make depend; make" that does not require full /usr/src tree but /usr/src/sys only?