From owner-svn-src-head@freebsd.org Sun May 14 00:38:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A9F1D61781; Sun, 14 May 2017 00:38:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id DE57B12FE; Sun, 14 May 2017 00:38:42 +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 v4E0cfnE028320; Sun, 14 May 2017 00:38:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4E0cfLN028319; Sun, 14 May 2017 00:38:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201705140038.v4E0cfLN028319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 14 May 2017 00:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318262 - head/usr.sbin/mountd X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 00:38:43 -0000 Author: rmacklem Date: Sun May 14 00:38:41 2017 New Revision: 318262 URL: https://svnweb.freebsd.org/changeset/base/318262 Log: Change the default uid/gid values for nobody/nogroup to 65534/65533. The default values found in /etc/passwd and /etc/group are 65534, 65533. In mountd.c, the defaults were -2, which was 65534 back when uid_t was 16bits. Without this patch, a file created by root on an NFS exported volume without the "-root=" export option will end up owned by uid 4**32 - 2. When discussed on freebsd-current@, it seemed that users preferred the values being changed to 65534/65533. I have not added code to acquire these values from the databases, since the mountd daemon might get "stuck" during startup waiting for a non-responsive password database server. Discussed on: freebsd-current Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Sun May 14 00:23:27 2017 (r318261) +++ head/usr.sbin/mountd/mountd.c Sun May 14 00:38:41 2017 (r318262) @@ -230,9 +230,9 @@ static char **exnames; static char **hosts = NULL; static struct xucred def_anon = { XUCRED_VERSION, - (uid_t)-2, + (uid_t)65534, 1, - { (gid_t)-2 }, + { (gid_t)65533 }, NULL }; static int force_v2 = 0; @@ -2893,8 +2893,8 @@ parsecred(char *namelist, struct xucred /* * Set up the unprivileged user. */ - cr->cr_uid = -2; - cr->cr_groups[0] = -2; + cr->cr_uid = 65534; + cr->cr_groups[0] = 65533; cr->cr_ngroups = 1; /* * Get the user's password table entry. From owner-svn-src-head@freebsd.org Sun May 14 03:35:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81EA6D61198; Sun, 14 May 2017 03:35:11 +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 4C0AFED7; Sun, 14 May 2017 03:35:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 8A37E3C5759; Sun, 14 May 2017 13:35:01 +1000 (AEST) Date: Sun, 14 May 2017 13:35:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318262 - head/usr.sbin/mountd In-Reply-To: <201705140038.v4E0cfLN028319@repo.freebsd.org> Message-ID: <20170514132052.M1020@besplex.bde.org> References: <201705140038.v4E0cfLN028319@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=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=H1DrezM2EZjF7fugAWYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 14 May 2017 03:35:11 -0000 On Sun, 14 May 2017, Rick Macklem wrote: > Log: > Change the default uid/gid values for nobody/nogroup to 65534/65533. > > The default values found in /etc/passwd and /etc/group are 65534, 65533. > In mountd.c, the defaults were -2, which was 65534 back when uid_t was 16bits. > Without this patch, a file created by root on an NFS exported volume without > the "-root=" export option will end up owned by uid 4**32 - 2. > When discussed on freebsd-current@, it seemed that users preferred the > values being changed to 65534/65533. I got used to 4294967294. The large number makes it easy to see files created by root on another system. I mostly use nfs without maproot, and create such files often using tmp directories to transfer files. > I have not added code to acquire these values from the databases, since > the mountd daemon might get "stuck" during startup waiting for a non-responsive > password database server. > > Discussed on: freebsd-current > > Modified: > head/usr.sbin/mountd/mountd.c exports(5) is not modified, so still documents -2:-2 but not the actual value of 4294967294:4294967294. It seems dangerous to change the documented default. What happens if the server only supports 16-bit (or 15-bit, or 8-bit) uids? > Modified: head/usr.sbin/mountd/mountd.c > ============================================================================== > --- head/usr.sbin/mountd/mountd.c Sun May 14 00:23:27 2017 (r318261) > +++ head/usr.sbin/mountd/mountd.c Sun May 14 00:38:41 2017 (r318262) > @@ -230,9 +230,9 @@ static char **exnames; > static char **hosts = NULL; > static struct xucred def_anon = { > XUCRED_VERSION, > - (uid_t)-2, > + (uid_t)65534, > 1, > - { (gid_t)-2 }, > + { (gid_t)65533 }, > NULL > }; > static int force_v2 = 0; The casts are now bogus. They might have been needed to avoid warnings about possible sign extension bugs... > @@ -2893,8 +2893,8 @@ parsecred(char *namelist, struct xucred > /* > * Set up the unprivileged user. > */ > - cr->cr_uid = -2; > - cr->cr_groups[0] = -2; > + cr->cr_uid = 65534; > + cr->cr_groups[0] = 65533; > cr->cr_ngroups = 1; > /* > * Get the user's password table entry. But there were no casts here, and the warnings should be the same. Bruce From owner-svn-src-head@freebsd.org Sun May 14 09:07:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA4A9D6C6C2; Sun, 14 May 2017 09:07:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9AA8D74A; Sun, 14 May 2017 09:07:14 +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 v4E97DEB036988; Sun, 14 May 2017 09:07:13 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4E97DdX036987; Sun, 14 May 2017 09:07:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <201705140907.v4E97DdX036987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 14 May 2017 09:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318263 - head/sys/dev/cxgbe X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 09:07:14 -0000 Author: np Date: Sun May 14 09:07:13 2017 New Revision: 318263 URL: https://svnweb.freebsd.org/changeset/base/318263 Log: cxgbe(4): netmap-only interrupts for a VI do not have an associated rxq or ofld_rxq and should be ignored by vi_intr_iq. MFC after: 3 days. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun May 14 00:38:41 2017 (r318262) +++ head/sys/dev/cxgbe/t4_sge.c Sun May 14 09:07:13 2017 (r318263) @@ -969,6 +969,11 @@ vi_intr_iq(struct vi_info *vi, int idx) return (&sc->sge.fwq); nintr = vi->nintr; +#ifdef DEV_NETMAP + /* Do not consider any netmap-only interrupts */ + if (vi->flags & INTR_RXQ && vi->nnmrxq > vi->nrxq) + nintr -= vi->nnmrxq - vi->nrxq; +#endif KASSERT(nintr != 0, ("%s: vi %p has no exclusive interrupts, total interrupts = %d", __func__, vi, sc->intr_count)); From owner-svn-src-head@freebsd.org Sun May 14 13:14:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45F50D6CE32; Sun, 14 May 2017 13:14:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id F20BCF02; Sun, 14 May 2017 13:14:20 +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 v4EDEK2G039114; Sun, 14 May 2017 13:14:20 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4EDEJrd039111; Sun, 14 May 2017 13:14:19 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201705141314.v4EDEJrd039111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 14 May 2017 13:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318269 - in head/bin/sh: . tests/builtins X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 13:14:21 -0000 Author: jilles Date: Sun May 14 13:14:19 2017 New Revision: 318269 URL: https://svnweb.freebsd.org/changeset/base/318269 Log: sh: Fix '-' from quoted arithmetic in case/glob pattern range. It does not make much sense to generate the '-' in a pattern bracket expression using arithmetic expansion, but it does not make sense to forbid it either. Try to avoid reprocessing the string if it is unnecessary. Added: head/bin/sh/tests/builtins/case22.0 (contents, props changed) Modified: head/bin/sh/expand.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun May 14 12:41:58 2017 (r318268) +++ head/bin/sh/expand.c Sun May 14 13:14:19 2017 (r318269) @@ -440,8 +440,15 @@ expari(const char *p, struct nodelist ** fmtstr(expdest, DIGITS(result), ARITH_FORMAT_STR, result); adj = strlen(expdest); STADJUST(adj, expdest); - if (!quoted) - reprocess(expdest - adj - stackblock(), flag, VSNORMAL, 0, dst); + /* + * If this is quoted, a '-' must not indicate a range in [...]. + * If this is not quoted, splitting may occur. + */ + if (quoted ? + result < 0 && begoff > 1 && flag & (EXP_GLOB | EXP_CASE) : + flag & EXP_SPLIT) + reprocess(expdest - adj - stackblock(), flag, VSNORMAL, quoted, + dst); return p; } Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun May 14 12:41:58 2017 (r318268) +++ head/bin/sh/tests/builtins/Makefile Sun May 14 13:14:19 2017 (r318269) @@ -41,6 +41,7 @@ ${PACKAGE}FILES+= case18.0 ${PACKAGE}FILES+= case19.0 ${PACKAGE}FILES+= case20.0 ${PACKAGE}FILES+= case21.0 +${PACKAGE}FILES+= case22.0 ${PACKAGE}FILES+= cd1.0 ${PACKAGE}FILES+= cd2.0 ${PACKAGE}FILES+= cd3.0 Added: head/bin/sh/tests/builtins/case22.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/case22.0 Sun May 14 13:14:19 2017 (r318269) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +case 5 in +[0"$((-9))"]) echo bad1 ;; +esac + +case - in +[0"$((-9))"]) ;; +*) echo bad2 ;; +esac From owner-svn-src-head@freebsd.org Sun May 14 13:21:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30453D6CF9D; Sun, 14 May 2017 13:21:35 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670083.outbound.protection.outlook.com [40.107.67.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC746139B; Sun, 14 May 2017 13:21:34 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Sun, 14 May 2017 13:21:31 +0000 Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) with mapi id 15.01.1084.026; Sun, 14 May 2017 13:21:31 +0000 From: Rick Macklem To: Bruce Evans , Rick Macklem CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r318262 - head/usr.sbin/mountd Thread-Topic: svn commit: r318262 - head/usr.sbin/mountd Thread-Index: AQHSzGMb0lgM+E2Muk292CpYffx7q6Hz0MV0 Date: Sun, 14 May 2017 13:21:31 +0000 Message-ID: References: <201705140038.v4E0cfLN028319@repo.freebsd.org>, <20170514132052.M1020@besplex.bde.org> In-Reply-To: <20170514132052.M1020@besplex.bde.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: optusnet.com.au; dkim=none (message not signed) header.d=none;optusnet.com.au; dmarc=none action=none header.from=uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTXPR01MB0189; 7:CgsXGJ4P5TGehgX5zxp73W62lxBf1829LVzKOAkfKBoBvAcgLw4XRpQFfnn6EQ6khVsiDyR6Ode6MCOny9CwZ/RvWodp/ylXdN/VKNsYVp0g2251LerD6J9kbX7y5jHNPcgM6wT92DORVx6amwoVPQn1YUU8Sdni8NV6jjYWimoupwoUWTQG4KcyNBjkqiaC+r2mKGN2CSm52Nte6zwLMJnwxKALLQt9DRn01phTRyLZ3+075cXVjRy97TMqKaWatOybqr7GbB+JFGV3cDOeR+G6hHw3f/oXIV05FtcYCU11OQp+DVqNbzS/lTRmKxtnD2gnxtkWi9+27Fy2Je08GA== x-ms-office365-filtering-correlation-id: ba827066-d2f4-40a2-ae12-08d49acc2312 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:YTXPR01MB0189; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(46150409022019)(96448707832919); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123564025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(6072148); SRVR:YTXPR01MB0189; BCL:0; PCL:0; RULEID:; SRVR:YTXPR01MB0189; x-forefront-prvs: 03077579FF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(6009001)(39840400002)(39410400002)(39400400002)(39450400003)(24454002)(377454003)(229853002)(478600001)(8676002)(6506006)(77096006)(2906002)(33656002)(55016002)(2950100002)(38730400002)(8936002)(81166006)(6436002)(6246003)(54906002)(9686003)(53936002)(50986999)(74316002)(305945005)(7696004)(102836003)(54356999)(76176999)(5660300001)(189998001)(2900100001)(86362001)(122556002)(53546009)(551544002)(25786009)(3280700002)(3660700001)(74482002)(4326008)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR01MB0189; H:YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 14 May 2017 13:21:31.7421 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR01MB0189 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 14 May 2017 13:21:35 -0000 Oh, and if the commit doesn't get reverted, I do plan on committing a change to the exports.5 man page. I just held off on that until the dust settles. I had expected more discussion on freebsd-current@ w.r.t. this, but after several days of no messages, I went ahead with what the two responders seemed to support. rick ________________________________________ From: Bruce Evans Sent: Saturday, May 13, 2017 11:35:00 PM To: Rick Macklem Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: Re: svn commit: r318262 - head/usr.sbin/mountd On Sun, 14 May 2017, Rick Macklem wrote: > Log: > Change the default uid/gid values for nobody/nogroup to 65534/65533. > > The default values found in /etc/passwd and /etc/group are 65534, 65533. > In mountd.c, the defaults were -2, which was 65534 back when uid_t was 1= 6bits. > Without this patch, a file created by root on an NFS exported volume wit= hout > the "-root=3D" export option will end up owned by uid 4**32 - 2. > When discussed on freebsd-current@, it seemed that users preferred the > values being changed to 65534/65533. I got used to 4294967294. The large number makes it easy to see files created by root on another system. I mostly use nfs without maproot, and create such files often using tmp directories to transfer files. > I have not added code to acquire these values from the databases, since > the mountd daemon might get "stuck" during startup waiting for a non-res= ponsive > password database server. > > Discussed on: freebsd-current > > Modified: > head/usr.sbin/mountd/mountd.c exports(5) is not modified, so still documents -2:-2 but not the actual value of 4294967294:4294967294. It seems dangerous to change the documente= d default. What happens if the server only supports 16-bit (or 15-bit, or 8-bit) uids? > Modified: head/usr.sbin/mountd/mountd.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/mountd/mountd.c Sun May 14 00:23:27 2017 (r3= 18261) > +++ head/usr.sbin/mountd/mountd.c Sun May 14 00:38:41 2017 (r3= 18262) > @@ -230,9 +230,9 @@ static char **exnames; > static char **hosts =3D NULL; > static struct xucred def_anon =3D { > XUCRED_VERSION, > - (uid_t)-2, > + (uid_t)65534, > 1, > - { (gid_t)-2 }, > + { (gid_t)65533 }, > NULL > }; > static int force_v2 =3D 0; The casts are now bogus. They might have been needed to avoid warnings about possible sign extension bugs... > @@ -2893,8 +2893,8 @@ parsecred(char *namelist, struct xucred > /* > * Set up the unprivileged user. > */ > - cr->cr_uid =3D -2; > - cr->cr_groups[0] =3D -2; > + cr->cr_uid =3D 65534; > + cr->cr_groups[0] =3D 65533; > cr->cr_ngroups =3D 1; > /* > * Get the user's password table entry. But there were no casts here, and the warnings should be the same. Bruce From owner-svn-src-head@freebsd.org Sun May 14 14:28:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28A9ED6C8F9; Sun, 14 May 2017 14:28:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED04B1E59; Sun, 14 May 2017 14:28:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4EERx9c068414; Sun, 14 May 2017 14:27:59 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4EERxAX068413; Sun, 14 May 2017 14:27:59 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201705141427.v4EERxAX068413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 14 May 2017 14:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318276 - head/sys/dev/usb/controller X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 14:28:01 -0000 Author: marius Date: Sun May 14 14:27:59 2017 New Revision: 318276 URL: https://svnweb.freebsd.org/changeset/base/318276 Log: Describe Intel Apollo Lake and Braswell USB 3.0 controllers. Modified: head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Sun May 14 14:21:11 2017 (r318275) +++ head/sys/dev/usb/controller/xhci_pci.c Sun May 14 14:27:59 2017 (r318276) @@ -116,6 +116,10 @@ xhci_pci_match(device_t self) case 0x9c318086: case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); + case 0x22b58086: + return ("Intel Braswell USB 3.0 controller"); + case 0x5aa88086: + return ("Intel Apollo Lake USB 3.0 controller"); case 0x8c318086: return ("Intel Lynx Point USB 3.0 controller"); case 0x8cb18086: From owner-svn-src-head@freebsd.org Sun May 14 18:47:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CFDCD6C894; Sun, 14 May 2017 18:47:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 582FAE4; Sun, 14 May 2017 18:47:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4EIlARS073017; Sun, 14 May 2017 18:47:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4EIlAdK073015; Sun, 14 May 2017 18:47:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705141847.v4EIlAdK073015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 14 May 2017 18:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318278 - head/usr.bin/localedef X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 18:47:11 -0000 Author: ngie Date: Sun May 14 18:47:09 2017 New Revision: 318278 URL: https://svnweb.freebsd.org/changeset/base/318278 Log: Mark errf _Noreturn, and mark errf and warn __printflike The _Noreturn attribute was added to placate Coverity and other static analysis tools. The __printflike attribute was added to catch issues with the calls related to printf(3) abuse. - Modify the code to facilitate the __printflike attribute addition. - Convert errf calls in to_mb(..) and to_mb_string(..) to warn(..) so the calls will return instead of exiting, as the code suggests it should. Differential Revision: D10704 MFC after: 1 month Reviewed by: pfg Sponsored by: Dell EMC Isilon Modified: head/usr.bin/localedef/localedef.c head/usr.bin/localedef/localedef.h head/usr.bin/localedef/wide.c Modified: head/usr.bin/localedef/localedef.c ============================================================================== --- head/usr.bin/localedef/localedef.c Sun May 14 17:10:55 2017 (r318277) +++ head/usr.bin/localedef/localedef.c Sun May 14 18:47:09 2017 (r318278) @@ -119,7 +119,7 @@ open_category(void) */ file = fopen(category_file(), "w"); if (file == NULL) { - errf(strerror(errno)); + errf("%s", strerror(errno)); return (NULL); } return (file); @@ -131,11 +131,11 @@ close_category(FILE *f) if (fchmod(fileno(f), 0644) < 0) { (void) fclose(f); (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); } if (fclose(f) < 0) { (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); } if (verbose) { (void) fprintf(stdout, "done.\n"); @@ -195,13 +195,13 @@ putl_category(const char *s, FILE *f) if (s && fputs(s, f) == EOF) { (void) fclose(f); (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); return (EOF); } if (fputc('\n', f) == EOF) { (void) fclose(f); (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); return (EOF); } return (0); @@ -216,7 +216,7 @@ wr_category(void *buf, size_t sz, FILE * if (fwrite(buf, sz, 1, f) < 1) { (void) fclose(f); (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); return (EOF); } return (0); @@ -331,7 +331,7 @@ main(int argc, char **argv) while ((dir = opendir(locname)) == NULL) { if ((errno != ENOENT) || (mkdir(locname, 0755) < 0)) { - errf(strerror(errno)); + errf("%s", strerror(errno)); } } (void) closedir(dir); Modified: head/usr.bin/localedef/localedef.h ============================================================================== --- head/usr.bin/localedef/localedef.h Sun May 14 17:10:55 2017 (r318277) +++ head/usr.bin/localedef/localedef.h Sun May 14 18:47:09 2017 (r318278) @@ -35,6 +35,7 @@ */ /* Common header files. */ +#include #include #include #include @@ -54,8 +55,8 @@ extern int warnings; int yylex(void); void yyerror(const char *); -void errf(const char *, ...); -void warn(const char *, ...); +_Noreturn void errf(const char *, ...) __printflike(1, 2); +void warn(const char *, ...) __printflike(1, 2); int putl_category(const char *, FILE *); int wr_category(void *, size_t, FILE *); Modified: head/usr.bin/localedef/wide.c ============================================================================== --- head/usr.bin/localedef/wide.c Sun May 14 17:10:55 2017 (r318277) +++ head/usr.bin/localedef/wide.c Sun May 14 18:47:09 2017 (r318278) @@ -598,7 +598,7 @@ to_mb(char *mb, wchar_t wc) int rv; if ((rv = _tomb(mb, wc)) < 0) { - errf(widemsg); + warn("%s", widemsg); free(widemsg); widemsg = NULL; } @@ -614,7 +614,7 @@ to_mb_string(const wchar_t *wcs) mbs = malloc((wcslen(wcs) * mb_cur_max) + 1); if (mbs == NULL) { - errf("out of memory"); + warn("out of memory"); return (NULL); } ptr = mbs; From owner-svn-src-head@freebsd.org Sun May 14 20:39:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7933D6DBE8; Sun, 14 May 2017 20:39:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 84B0EC31; Sun, 14 May 2017 20:39:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4EKd19d019389; Sun, 14 May 2017 20:39:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4EKd1MQ019388; Sun, 14 May 2017 20:39:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705142039.v4EKd1MQ019388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 14 May 2017 20:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318280 - head/usr.bin/getconf X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 20:39:02 -0000 Author: ngie Date: Sun May 14 20:39:01 2017 New Revision: 318280 URL: https://svnweb.freebsd.org/changeset/base/318280 Log: getconf: use nitems(..) to compute NWORDS instead of hardcoding the equivalent macro MFC after: 1 month Sponsored by: Dell EMC Isilon Modified: head/usr.bin/getconf/fake-gperf.awk Modified: head/usr.bin/getconf/fake-gperf.awk ============================================================================== --- head/usr.bin/getconf/fake-gperf.awk Sun May 14 20:17:50 2017 (r318279) +++ head/usr.bin/getconf/fake-gperf.awk Sun May 14 20:39:01 2017 (r318280) @@ -36,7 +36,8 @@ state == 1 { print; next; } state = 3; print "\t{ NULL, 0, 0 }"; print "};"; - print "#define\tNWORDS\t(sizeof(wordlist)/sizeof(wordlist[0]) - 1)"; + print "#include "; + print "#define\tNWORDS\t(nitems(wordlist) - 1)"; print "static const struct map *"; print "in_word_set(const char *word)"; print "{"; From owner-svn-src-head@freebsd.org Sun May 14 21:18:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA5FCD6CCE7; Sun, 14 May 2017 21:18:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id AC453298; Sun, 14 May 2017 21:18:02 +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 v4ELI1qH035278; Sun, 14 May 2017 21:18:01 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4ELI1FH035277; Sun, 14 May 2017 21:18:01 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201705142118.v4ELI1FH035277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 14 May 2017 21:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318281 - head/contrib/ipfilter/lib X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 21:18:03 -0000 Author: cy Date: Sun May 14 21:18:01 2017 New Revision: 318281 URL: https://svnweb.freebsd.org/changeset/base/318281 Log: Separate the ipfilter function/static string from the error with a colon (:) in error messages to assist the user in parsing out the error from where or which object the error message refers to. MFC after: 3 days Modified: head/contrib/ipfilter/lib/ipf_perror.c Modified: head/contrib/ipfilter/lib/ipf_perror.c ============================================================================== --- head/contrib/ipfilter/lib/ipf_perror.c Sun May 14 20:39:01 2017 (r318280) +++ head/contrib/ipfilter/lib/ipf_perror.c Sun May 14 21:18:01 2017 (r318281) @@ -10,7 +10,7 @@ ipf_perror(err, string) if (err == 0) fprintf(stderr, "%s\n", string); else - fprintf(stderr, "%s %s\n", string, ipf_strerror(err)); + fprintf(stderr, "%s: %s\n", string, ipf_strerror(err)); } int From owner-svn-src-head@freebsd.org Sun May 14 21:33:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2C24D6A20A; Sun, 14 May 2017 21:33:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77525D91; Sun, 14 May 2017 21:33:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4ELX1WB043235; Sun, 14 May 2017 21:33:01 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4ELX1kf043233; Sun, 14 May 2017 21:33:01 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201705142133.v4ELX1kf043233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 14 May 2017 21:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318282 - head/sys/dev/sdhci X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 21:33:02 -0000 Author: marius Date: Sun May 14 21:33:01 2017 New Revision: 318282 URL: https://svnweb.freebsd.org/changeset/base/318282 Log: - Unlike as in the PCI case, when attached to ACPI, Intel Bay Trail and Braswell eMMC and SDXC controllers share the same IDs. Like in the PCI case, Braswell eMMC needs the SDHCI_QUIRK_DATA_TIMEOUT_1MHZ quirk (see r311794 for the corresponding change to the sdhci(4) PCI PCI front-end), though. However, due to the shared ACPI IDs, this is trickier to do. - Intel Apollo Lake eMMC and SDXC controllers are affected by the APL18 ("Using 32-bit Addressing Mode With SD/eMMC Controller May Lead to Unpredictable System Behavior") silicon bug [1]. When this erratum hits, typically both SDHCI and XHCI controllers wedge. According to Intel, using ADMA2 with 64-bit addressing and 96-bit descriptors serves as a workaround. Until such times when sdhci(4) has ADMA2 support, flag DMA as broken for affected interfaces. This turns out to work around the problem, too, at the cost of performance. - In the sdhci(4) ACPI front-end, probe the Intel Apollo Lake eMMC and SDXC controllers, too. 1: http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/pentium-celeron-n-series-j-series-datasheet-spec-update.pdf Modified: head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Sun May 14 21:18:01 2017 (r318281) +++ head/sys/dev/sdhci/sdhci_acpi.c Sun May 14 21:33:01 2017 (r318282) @@ -57,25 +57,39 @@ static const struct sdhci_acpi_device { const char *desc; u_int quirks; } sdhci_acpi_devices[] = { - { "80860F14", 1, "Intel Bay Trail eMMC 4.5 Controller", + { "80860F14", 1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller", SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, - { "80860F14", 3, "Intel Bay Trail SDXC Controller", + { "80860F14", 3, "Intel Bay Trail/Braswell SDXC Controller", SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, - { "80860F16", 0, "Intel Bay Trail SDXC Controller", + { "80860F16", 0, "Intel Bay Trail/Braswell SDXC Controller", SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, + { "80865ACA", 0, "Intel Apollo Lake SDXC Controller", + SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ + SDHCI_QUIRK_WAIT_WHILE_BUSY | + SDHCI_QUIRK_PRESET_VALUE_BROKEN }, + { "80865ACC", 0, "Intel Apollo Lake eMMC 5.0 Controller", + SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET | + SDHCI_QUIRK_WAIT_WHILE_BUSY | + SDHCI_QUIRK_MMC_DDR52 | + SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | + SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { NULL, 0, NULL, 0} }; static char *sdhci_ids[] = { "80860F14", "80860F16", + "80865ACA", + "80865ACC", NULL }; @@ -249,6 +263,11 @@ sdhci_acpi_attach(device_t dev) return (ENOMEM); } + /* Intel Braswell eMMC 4.5.1 controller quirk */ + if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && + SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && + SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) + sc->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; sc->quirks &= ~sdhci_quirk_clear; sc->quirks |= sdhci_quirk_set; sc->slot.quirks = sc->quirks; Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Sun May 14 21:18:01 2017 (r318281) +++ head/sys/dev/sdhci/sdhci_pci.c Sun May 14 21:33:01 2017 (r318282) @@ -132,9 +132,11 @@ static const struct sdhci_device { SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x5aca8086, 0xffff, "Intel Apollo Lake SDXC Controller", + SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller", + SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | @@ -340,6 +342,7 @@ sdhci_pci_attach(device_t dev) } sc->quirks &= ~sdhci_quirk_clear; sc->quirks |= sdhci_quirk_set; + /* Some controllers need to be bumped into the right mode. */ if (sc->quirks & SDHCI_QUIRK_LOWER_FREQUENCY) sdhci_lower_frequency(dev); From owner-svn-src-head@freebsd.org Sun May 14 23:45:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5FA8D6D65E; Sun, 14 May 2017 23:45:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7936BA61; Sun, 14 May 2017 23:45:11 +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 v4ENjAC7095405; Sun, 14 May 2017 23:45:10 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4ENjAKp095404; Sun, 14 May 2017 23:45:10 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201705142345.v4ENjAKp095404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 14 May 2017 23:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318283 - head/contrib/ipfilter/lib X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 14 May 2017 23:45:11 -0000 Author: cy Date: Sun May 14 23:45:10 2017 New Revision: 318283 URL: https://svnweb.freebsd.org/changeset/base/318283 Log: As of r318281, there is no need to put a colon (:) in the message string. MFC after: 3 days X-MFC with: r318281 Modified: head/contrib/ipfilter/lib/printhash_live.c Modified: head/contrib/ipfilter/lib/printhash_live.c ============================================================================== --- head/contrib/ipfilter/lib/printhash_live.c Sun May 14 21:33:01 2017 (r318282) +++ head/contrib/ipfilter/lib/printhash_live.c Sun May 14 23:45:10 2017 (r318283) @@ -59,7 +59,7 @@ printhash_live(hp, fd, name, opts, field printed++; } if (last == 0) - ipferror(fd, "walking hash nodes:"); + ipferror(fd, "walking hash nodes"); if (printed == 0) putchar(';'); From owner-svn-src-head@freebsd.org Mon May 15 03:39:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 673BCD6D790; Mon, 15 May 2017 03:39:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1F8E01436; Mon, 15 May 2017 03:39:37 +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 v4F3daKI088636; Mon, 15 May 2017 03:39:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4F3daFF088635; Mon, 15 May 2017 03:39:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201705150339.v4F3daFF088635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 15 May 2017 03:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318284 - head/contrib/ipfilter/lib X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 03:39:37 -0000 Author: cy Date: Mon May 15 03:39:35 2017 New Revision: 318284 URL: https://svnweb.freebsd.org/changeset/base/318284 Log: Just like r318173, which was for outputting IPv6 addresses in tree pools, implement outputting of IPv6 addresses in the ippool debug list of hash type pools (ippool -l -d -t hash). Currently IPv6 in ippool tree type pool handling is mostly implemented. This continues theseries of commits to remediate ippool. This will be MFCed with a yet to be committed series of fixes to ippool after it has been fully remediated. PR: 218433 Modified: head/contrib/ipfilter/lib/printhashnode.c Modified: head/contrib/ipfilter/lib/printhashnode.c ============================================================================== --- head/contrib/ipfilter/lib/printhashnode.c Sun May 14 23:45:10 2017 (r318283) +++ head/contrib/ipfilter/lib/printhashnode.c Mon May 15 03:39:35 2017 (r318284) @@ -35,18 +35,47 @@ printhashnode(iph, ipep, copyfunc, opts, } printf("\n"); } else if ((opts & OPT_DEBUG) != 0) { - PRINTF("\t%d\tAddress: %s", hv, - inet_ntoa(ipe.ipe_addr.in4)); - printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr); - PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref, - ipe.ipe_group); +#ifdef AF_INET6 + if (ipe.ipe_family == AF_INET6) { + char buf[INET6_ADDRSTRLEN + 1]; + const char *str; + + buf[0] = '\0'; + str = inet_ntop(AF_INET6, &ipe.ipe_addr.in6, + buf, sizeof(buf) - 1); + if (str == NULL) + str = "???"; + PRINTF("\t%d\tAddress: %s", hv, str); + printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr); + PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref, + ipe.ipe_group); +#ifdef USE_QUAD_T + PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n", + ipe.ipe_hits, ipe.ipe_bytes); +#else + PRINTF("\tHits: %lu\tBytes: %lu\n", + ipe.ipe_hits, ipe.ipe_bytes); +#endif /* USE_QUAD_T */ + } else if (ipe.ipe_family == AF_INET) { +#else + if (ipe.ipe_family == AF_INET) { +#endif /* AF_INET6 */ + PRINTF("\t%d\tAddress: %s", hv, + inet_ntoa(ipe.ipe_addr.in4)); + printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr); + PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref, + ipe.ipe_group); #ifdef USE_QUAD_T - PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n", - ipe.ipe_hits, ipe.ipe_bytes); + PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n", + ipe.ipe_hits, ipe.ipe_bytes); #else - PRINTF("\tHits: %lu\tBytes: %lu\n", - ipe.ipe_hits, ipe.ipe_bytes); -#endif + PRINTF("\tHits: %lu\tBytes: %lu\n", + ipe.ipe_hits, ipe.ipe_bytes); +#endif /* USE_QUAD_T */ + } else { + PRINTF("\tAddress: family: %d\n", + ipe.ipe_family); + } } else { putchar(' '); printip(ipe.ipe_family, (u_32_t *)&ipe.ipe_addr.in4_addr); From owner-svn-src-head@freebsd.org Mon May 15 10:02:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8B3FD6DDC1; Mon, 15 May 2017 10:02:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id 66FE5802; Mon, 15 May 2017 10:02:46 +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 v4FA2jdk045124; Mon, 15 May 2017 10:02:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FA2jqi045123; Mon, 15 May 2017 10:02:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705151002.v4FA2jqi045123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 May 2017 10:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318285 - head/sys/kern X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 10:02:46 -0000 Author: kib Date: Mon May 15 10:02:45 2017 New Revision: 318285 URL: https://svnweb.freebsd.org/changeset/base/318285 Log: mnt_vnode_next_active: use conventional lock order when trylock fails. Previously, when the VI_TRYLOCK failed, we would spin under the mutex that protects the vnode active list until we either succeeded or noticed that we had hogged the CPU. Since we were violating the lock order, this would guarantee that we would become a hog under any deadlock condition (e.g. a race with vdrop(9) on the same vnode). In the presence of many concurrent threads in sync(2) or vdrop etc, the victim could hang for a long time. Now, avoid spinning by dropping and reacquiring the locks in the conventional lock order when the trylock fails. This requires a dance with the vnode hold count. Submitted by: Tom Rix Tested by: pho Differential revision: https://reviews.freebsd.org/D10692 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon May 15 03:39:35 2017 (r318284) +++ head/sys/kern/vfs_subr.c Mon May 15 10:02:45 2017 (r318285) @@ -5362,6 +5362,84 @@ mnt_vnode_markerfree_active(struct vnode *mvp = NULL; } +/* + * Relock the mp mount vnode list lock with the vp vnode interlock in the + * conventional lock order during mnt_vnode_next_active iteration. + * + * On entry, the mount vnode list lock is held and the vnode interlock is not. + * The list lock is dropped and reacquired. On success, both locks are held. + * On failure, the mount vnode list lock is held but the vnode interlock is + * not, and the procedure may have yielded. + */ +static bool +mnt_vnode_next_active_relock(struct vnode *mvp, struct mount *mp, + struct vnode *vp) +{ + const struct vnode *tmp; + bool held, ret; + + VNASSERT(mvp->v_mount == mp && mvp->v_type == VMARKER && + TAILQ_NEXT(mvp, v_actfreelist) != NULL, mvp, + ("%s: bad marker", __func__)); + VNASSERT(vp->v_mount == mp && vp->v_type != VMARKER, vp, + ("%s: inappropriate vnode", __func__)); + ASSERT_VI_UNLOCKED(vp, __func__); + mtx_assert(&mp->mnt_listmtx, MA_OWNED); + + ret = false; + + TAILQ_REMOVE(&mp->mnt_activevnodelist, mvp, v_actfreelist); + TAILQ_INSERT_BEFORE(vp, mvp, v_actfreelist); + + /* + * Use a hold to prevent vp from disappearing while the mount vnode + * list lock is dropped and reacquired. Normally a hold would be + * acquired with vhold(), but that might try to acquire the vnode + * interlock, which would be a LOR with the mount vnode list lock. + */ + held = vfs_refcount_acquire_if_not_zero(&vp->v_holdcnt); + mtx_unlock(&mp->mnt_listmtx); + if (!held) + goto abort; + VI_LOCK(vp); + if (!vfs_refcount_release_if_not_last(&vp->v_holdcnt)) { + vdropl(vp); + goto abort; + } + mtx_lock(&mp->mnt_listmtx); + + /* + * Determine whether the vnode is still the next one after the marker, + * excepting any other markers. If the vnode has not been doomed by + * vgone() then the hold should have ensured that it remained on the + * active list. If it has been doomed but is still on the active list, + * don't abort, but rather skip over it (avoid spinning on doomed + * vnodes). + */ + tmp = mvp; + do { + tmp = TAILQ_NEXT(tmp, v_actfreelist); + } while (tmp != NULL && tmp->v_type == VMARKER); + if (tmp != vp) { + mtx_unlock(&mp->mnt_listmtx); + VI_UNLOCK(vp); + goto abort; + } + + ret = true; + goto out; +abort: + maybe_yield(); + mtx_lock(&mp->mnt_listmtx); +out: + if (ret) + ASSERT_VI_LOCKED(vp, __func__); + else + ASSERT_VI_UNLOCKED(vp, __func__); + mtx_assert(&mp->mnt_listmtx, MA_OWNED); + return (ret); +} + static struct vnode * mnt_vnode_next_active(struct vnode **mvp, struct mount *mp) { @@ -5371,22 +5449,19 @@ mnt_vnode_next_active(struct vnode **mvp KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); restart: vp = TAILQ_NEXT(*mvp, v_actfreelist); - TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); while (vp != NULL) { if (vp->v_type == VMARKER) { vp = TAILQ_NEXT(vp, v_actfreelist); continue; } - if (!VI_TRYLOCK(vp)) { - if (mp_ncpus == 1 || should_yield()) { - TAILQ_INSERT_BEFORE(vp, *mvp, v_actfreelist); - mtx_unlock(&mp->mnt_listmtx); - pause("vnacti", 1); - mtx_lock(&mp->mnt_listmtx); - goto restart; - } - continue; - } + /* + * Try-lock because this is the wrong lock order. If that does + * not succeed, drop the mount vnode list lock and try to + * reacquire it and the vnode interlock in the right order. + */ + if (!VI_TRYLOCK(vp) && + !mnt_vnode_next_active_relock(*mvp, mp, vp)) + goto restart; KASSERT(vp->v_type != VMARKER, ("locked marker %p", vp)); KASSERT(vp->v_mount == mp || vp->v_mount == NULL, ("alien vnode on the active list %p %p", vp, mp)); @@ -5396,6 +5471,7 @@ restart: VI_UNLOCK(vp); vp = nvp; } + TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); /* Check if we are done */ if (vp == NULL) { From owner-svn-src-head@freebsd.org Mon May 15 10:10:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B39BCD6DF52; Mon, 15 May 2017 10:10:12 +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 31502A58; Mon, 15 May 2017 10:10:12 +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 v4FA9xrT076856 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 May 2017 13:09:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4FA9xrT076856 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4FA9xNY076855; Mon, 15 May 2017 13:09:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 May 2017 13:09:59 +0300 From: Konstantin Belousov To: Ryan Libby Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318285 - head/sys/kern Message-ID: <20170515100959.GB1622@kib.kiev.ua> References: <201705151002.v4FA2jqi045123@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201705151002.v4FA2jqi045123@repo.freebsd.org> User-Agent: Mutt/1.8.2 (2017-04-18) 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.23 Precedence: list List-Id: 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, 15 May 2017 10:10:12 -0000 On Mon, May 15, 2017 at 10:02:45AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon May 15 10:02:45 2017 > New Revision: 318285 > URL: https://svnweb.freebsd.org/changeset/base/318285 > > Log: > mnt_vnode_next_active: use conventional lock order when trylock fails. > > Previously, when the VI_TRYLOCK failed, we would spin under the mutex > that protects the vnode active list until we either succeeded or > noticed that we had hogged the CPU. Since we were violating the lock > order, this would guarantee that we would become a hog under any > deadlock condition (e.g. a race with vdrop(9) on the same vnode). In > the presence of many concurrent threads in sync(2) or vdrop etc, the > victim could hang for a long time. > > Now, avoid spinning by dropping and reacquiring the locks in the > conventional lock order when the trylock fails. This requires a dance > with the vnode hold count. > > Submitted by: Tom Rix This must be Ryan Libby , I am sorry. > Tested by: pho > Differential revision: https://reviews.freebsd.org/D10692 From owner-svn-src-head@freebsd.org Mon May 15 13:14:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A79FD6DA69; Mon, 15 May 2017 13:14:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4C25712BF; Mon, 15 May 2017 13:14:14 +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 v4FDED11022482; Mon, 15 May 2017 13:14:13 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FDEDlF022481; Mon, 15 May 2017 13:14:13 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201705151314.v4FDEDlF022481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 15 May 2017 13:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318287 - head/sys/fs/nfsclient X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 13:14:14 -0000 Author: rmacklem Date: Mon May 15 13:14:13 2017 New Revision: 318287 URL: https://svnweb.freebsd.org/changeset/base/318287 Log: Make nfscl_mtofh() return ENXIO when *nfhpp == NULL. r317272 introduced a case where nfscl_mtofh() could return 0 when *nfhpp is NULL. This patch makes it return ENXIO for this case. MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Mon May 15 13:05:02 2017 (r318286) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Mon May 15 13:14:13 2017 (r318287) @@ -475,6 +475,7 @@ nfscl_mtofh(struct nfsrv_descript *nd, s if (*++tl != 0) { nd->nd_flag |= ND_NOMOREDATA; flag = 0; + error = ENXIO; /* Return ENXIO so *nfhpp isn't used. */ } } if (flag) { From owner-svn-src-head@freebsd.org Mon May 15 15:18:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A560D6D53F; Mon, 15 May 2017 15:18:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0486E1757; Mon, 15 May 2017 15:18:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FFIb02073132; Mon, 15 May 2017 15:18:37 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FFIbRJ073131; Mon, 15 May 2017 15:18:37 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201705151518.v4FFIbRJ073131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 15 May 2017 15:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318294 - head X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 15:18:38 -0000 Author: gjb Date: Mon May 15 15:18:36 2017 New Revision: 318294 URL: https://svnweb.freebsd.org/changeset/base/318294 Log: Correct the URL to instructions for updated system sources. MFC after: 3 days Submitted by: schaiba gmail com PR: 219303 Sponsored by: The FreeBSD Foundation Modified: head/README Modified: head/README ============================================================================== --- head/README Mon May 15 14:41:47 2017 (r318293) +++ head/README Mon May 15 15:18:36 2017 (r318294) @@ -81,4 +81,4 @@ usr.sbin System administration commands. For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see: - http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html + https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-src.html From owner-svn-src-head@freebsd.org Mon May 15 16:53:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83751D6E6DA; Mon, 15 May 2017 16:53:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 4723A198; Mon, 15 May 2017 16:53:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FGr2Lq016291; Mon, 15 May 2017 16:53:02 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FGr2Pj016290; Mon, 15 May 2017 16:53:02 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201705151653.v4FGr2Pj016290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 15 May 2017 16:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318297 - head/sys/dev/e1000 X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 16:53:03 -0000 Author: tsoome Date: Mon May 15 16:53:02 2017 New Revision: 318297 URL: https://svnweb.freebsd.org/changeset/base/318297 Log: e1000api: misleading-indentation Two blocks in e1000_ich8lan.c are misaligned, causing noise with some compilers (gcc 6). Reviewed by: imp, erj Differential Revision: https://reviews.freebsd.org/D10741 Modified: head/sys/dev/e1000/e1000_ich8lan.c Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Mon May 15 15:28:01 2017 (r318296) +++ head/sys/dev/e1000/e1000_ich8lan.c Mon May 15 16:53:02 2017 (r318297) @@ -1496,24 +1496,24 @@ s32 e1000_disable_ulp_lpt_lp(struct e100 ret_val = e1000_read_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, &phy_reg); if (ret_val) goto release; - phy_reg &= ~(I218_ULP_CONFIG1_IND | - I218_ULP_CONFIG1_STICKY_ULP | - I218_ULP_CONFIG1_RESET_TO_SMBUS | - I218_ULP_CONFIG1_WOL_HOST | - I218_ULP_CONFIG1_INBAND_EXIT | - I218_ULP_CONFIG1_EN_ULP_LANPHYPC | - I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST | - I218_ULP_CONFIG1_DISABLE_SMB_PERST); - e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); - - /* Commit ULP changes by starting auto ULP configuration */ - phy_reg |= I218_ULP_CONFIG1_START; - e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); - - /* Clear Disable SMBus Release on PERST# in MAC */ - mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM7); - mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST; - E1000_WRITE_REG(hw, E1000_FEXTNVM7, mac_reg); + phy_reg &= ~(I218_ULP_CONFIG1_IND | + I218_ULP_CONFIG1_STICKY_ULP | + I218_ULP_CONFIG1_RESET_TO_SMBUS | + I218_ULP_CONFIG1_WOL_HOST | + I218_ULP_CONFIG1_INBAND_EXIT | + I218_ULP_CONFIG1_EN_ULP_LANPHYPC | + I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST | + I218_ULP_CONFIG1_DISABLE_SMB_PERST); + e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); + + /* Commit ULP changes by starting auto ULP configuration */ + phy_reg |= I218_ULP_CONFIG1_START; + e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); + + /* Clear Disable SMBus Release on PERST# in MAC */ + mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM7); + mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST; + E1000_WRITE_REG(hw, E1000_FEXTNVM7, mac_reg); release: hw->phy.ops.release(hw); @@ -1556,13 +1556,13 @@ static s32 e1000_check_for_copper_link_i if (!mac->get_link_status) return E1000_SUCCESS; - /* First we want to see if the MII Status Register reports - * link. If so, then we want to get the current speed/duplex - * of the PHY. - */ - ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link); - if (ret_val) - return ret_val; + /* First we want to see if the MII Status Register reports + * link. If so, then we want to get the current speed/duplex + * of the PHY. + */ + ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link); + if (ret_val) + return ret_val; if (hw->mac.type == e1000_pchlan) { ret_val = e1000_k1_gig_workaround_hv(hw, link); From owner-svn-src-head@freebsd.org Mon May 15 17:14:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D27FBD6ECC5; Mon, 15 May 2017 17:14:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id ADDCB10A6; Mon, 15 May 2017 17:14:54 +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 v4FHErT0025525; Mon, 15 May 2017 17:14:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FHEr2m025524; Mon, 15 May 2017 17:14:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705151714.v4FHEr2m025524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 May 2017 17:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318298 - head/lib/libc/stdlib X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 17:14:54 -0000 Author: kib Date: Mon May 15 17:14:53 2017 New Revision: 318298 URL: https://svnweb.freebsd.org/changeset/base/318298 Log: Fix several buffer overflows in realpath(3). - The statement "left_len -= s - left;" does not take the slash into account if one was found. This results in the invariant "left[left_len] == '\0'" being violated (and possible buffer overflows). The patch replaces the variable "s" with a size_t "next_token_len" for more clarity. - "slen" from readlink(2) can be 0 when encountering empty symlinks. Then, further down, "symlink[slen - 1]" underflows the buffer. When slen == 0, realpath(3) should probably return ENOENT (http://austingroupbugs.net/view.php?id=825, https://lwn.net/Articles/551224/). Some other minor issues: - The condition "resolved_len >= PATH_MAX" cannot be true. - Similarly, "s - left >= sizeof(next_token)" cannot be true, as long as "sizeof(next_token) >= sizeof(left)". - Return ENAMETOOLONG when a resolved symlink from readlink(2) is too long for the symlink buffer (instead of just truncating it). - "resolved_len > 1" below the call to readlink(2) is always true as "strlcat(resolved, next_token, PATH_MAX);" always results in a string of length > 1. Also, "resolved[resolved_len - 1] = '\0';" is not needed; there can never be a trailing slash here. - The truncation check for "strlcat(symlink, left, sizeof(symlink));" should be against "sizeof(symlink)" (the third argument to strlcat) instead of "sizeof(left)". Submitted by: Jan Kokemц╪ller PR: 219154 MFC after: 2 weeks Modified: head/lib/libc/stdlib/realpath.c Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Mon May 15 16:53:02 2017 (r318297) +++ head/lib/libc/stdlib/realpath.c Mon May 15 17:14:53 2017 (r318298) @@ -51,10 +51,11 @@ char * realpath(const char * __restrict path, char * __restrict resolved) { struct stat sb; - char *p, *q, *s; - size_t left_len, resolved_len; + char *p, *q; + size_t left_len, resolved_len, next_token_len; unsigned symlinks; - int m, slen; + int m; + ssize_t slen; char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; if (path == NULL) { @@ -109,18 +110,19 @@ realpath(const char * __restrict path, c * and its length. */ p = strchr(left, '/'); - s = p ? p : left + left_len; - if (s - left >= sizeof(next_token)) { - if (m) - free(resolved); - errno = ENAMETOOLONG; - return (NULL); + + next_token_len = p ? p - left : left_len; + memcpy(next_token, left, next_token_len); + next_token[next_token_len] = '\0'; + + if (p != NULL) { + left_len -= next_token_len + 1; + memmove(left, p + 1, left_len + 1); + } else { + left[0] = '\0'; + left_len = 0; } - memcpy(next_token, left, s - left); - next_token[s - left] = '\0'; - left_len -= s - left; - if (p != NULL) - memmove(left, s + 1, left_len + 1); + if (resolved[resolved_len - 1] != '/') { if (resolved_len + 1 >= PATH_MAX) { if (m) @@ -173,19 +175,25 @@ realpath(const char * __restrict path, c errno = ELOOP; return (NULL); } - slen = readlink(resolved, symlink, sizeof(symlink) - 1); - if (slen < 0) { + slen = readlink(resolved, symlink, sizeof(symlink)); + if (slen <= 0 || slen >= sizeof(symlink)) { if (m) free(resolved); + if (slen < 0) { + /* keep errno from readlink(2) call */ + } else if (slen == 0) { + errno = ENOENT; + } else { + errno = ENAMETOOLONG; + } return (NULL); } symlink[slen] = '\0'; if (symlink[0] == '/') { resolved[1] = 0; resolved_len = 1; - } else if (resolved_len > 1) { + } else { /* Strip the last path component. */ - resolved[resolved_len - 1] = '\0'; q = strrchr(resolved, '/') + 1; *q = '\0'; resolved_len = q - resolved; @@ -209,7 +217,7 @@ realpath(const char * __restrict path, c } left_len = strlcat(symlink, left, sizeof(symlink)); - if (left_len >= sizeof(left)) { + if (left_len >= sizeof(symlink)) { if (m) free(resolved); errno = ENAMETOOLONG; From owner-svn-src-head@freebsd.org Mon May 15 17:29:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9096D6D180; Mon, 15 May 2017 17:29:02 +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 B3CB11A1B; Mon, 15 May 2017 17:29:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3CEC610A82E; Mon, 15 May 2017 13:29:01 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: Ngie Cooper , "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk Date: Mon, 15 May 2017 10:13:13 -0700 Message-ID: <2229085.lB46rKsq7o@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 15 May 2017 13:29:01 -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.23 Precedence: list List-Id: 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, 15 May 2017 17:29:03 -0000 On Saturday, May 13, 2017 10:39:15 AM Warner Losh wrote: > >> - It's really easy to screw up a mergemaster call if you edit the files, and install the stock version which removes the edits. > > > > Also, programmatically removing the entries means you have to bake the metadata into etc/Makefile, which is already complicated enough as-is. > > Why do you care about removing them at all? They are no-ops if the > files don't exist. Why not just always install all these files is > where I'm going with this... I think this is actually the bigger question. I think it is perfectly sensible to support conf.d/* files for ports to use and as a way to manage logs for application logs on an appliance, etc. However, this shuffling is a bit of a merge nightmare for anyone using mergemaster or etcupdate, and the biggest cost is that newsyslog will create a one-line file in /var/log for entries with 'C'. -- John Baldwin From owner-svn-src-head@freebsd.org Mon May 15 17:34:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90313D6D677; Mon, 15 May 2017 17:34: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 mx1.freebsd.org (Postfix) with ESMTPS id 6D3FB22B; Mon, 15 May 2017 17:34: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 v4FHYHtp035246; Mon, 15 May 2017 17:34:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FHYHPv035245; Mon, 15 May 2017 17:34:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705151734.v4FHYHPv035245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 May 2017 17:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318299 - head/lib/libc/stdlib X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 17:34:18 -0000 Author: kib Date: Mon May 15 17:34:17 2017 New Revision: 318299 URL: https://svnweb.freebsd.org/changeset/base/318299 Log: Simplify cleanup on failure in realpath(3). If realpath() allocated memory for result and failed, the memory is freed in each place where return is performed. More, the function needs to track the allocation status, to not free user-supplied buffer. Consolidate the memory handling in the wrapper, freeing the buffer if the actual worker failed. Reviewed by: emaste (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D10670 Modified: head/lib/libc/stdlib/realpath.c Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Mon May 15 17:14:53 2017 (r318298) +++ head/lib/libc/stdlib/realpath.c Mon May 15 17:34:17 2017 (r318299) @@ -47,32 +47,16 @@ __FBSDID("$FreeBSD$"); * components. Returns (resolved) on success, or (NULL) on failure, * in which case the path which caused trouble is left in (resolved). */ -char * -realpath(const char * __restrict path, char * __restrict resolved) +static char * +realpath1(const char *path, char *resolved) { struct stat sb; char *p, *q; size_t left_len, resolved_len, next_token_len; unsigned symlinks; - int m; ssize_t slen; char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; - if (path == NULL) { - errno = EINVAL; - return (NULL); - } - if (path[0] == '\0') { - errno = ENOENT; - return (NULL); - } - if (resolved == NULL) { - resolved = malloc(PATH_MAX); - if (resolved == NULL) - return (NULL); - m = 1; - } else - m = 0; symlinks = 0; if (path[0] == '/') { resolved[0] = '/'; @@ -83,20 +67,14 @@ realpath(const char * __restrict path, c left_len = strlcpy(left, path + 1, sizeof(left)); } else { if (getcwd(resolved, PATH_MAX) == NULL) { - if (m) - free(resolved); - else { - resolved[0] = '.'; - resolved[1] = '\0'; - } + resolved[0] = '.'; + resolved[1] = '\0'; return (NULL); } resolved_len = strlen(resolved); left_len = strlcpy(left, path, sizeof(left)); } if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) { - if (m) - free(resolved); errno = ENAMETOOLONG; return (NULL); } @@ -125,8 +103,6 @@ realpath(const char * __restrict path, c if (resolved[resolved_len - 1] != '/') { if (resolved_len + 1 >= PATH_MAX) { - if (m) - free(resolved); errno = ENAMETOOLONG; return (NULL); } @@ -158,27 +134,18 @@ realpath(const char * __restrict path, c */ resolved_len = strlcat(resolved, next_token, PATH_MAX); if (resolved_len >= PATH_MAX) { - if (m) - free(resolved); errno = ENAMETOOLONG; return (NULL); } - if (lstat(resolved, &sb) != 0) { - if (m) - free(resolved); + if (lstat(resolved, &sb) != 0) return (NULL); - } if (S_ISLNK(sb.st_mode)) { if (symlinks++ > MAXSYMLINKS) { - if (m) - free(resolved); errno = ELOOP; return (NULL); } slen = readlink(resolved, symlink, sizeof(symlink)); if (slen <= 0 || slen >= sizeof(symlink)) { - if (m) - free(resolved); if (slen < 0) { /* keep errno from readlink(2) call */ } else if (slen == 0) { @@ -207,8 +174,6 @@ realpath(const char * __restrict path, c if (p != NULL) { if (symlink[slen - 1] != '/') { if (slen + 1 >= sizeof(symlink)) { - if (m) - free(resolved); errno = ENAMETOOLONG; return (NULL); } @@ -218,16 +183,12 @@ realpath(const char * __restrict path, c left_len = strlcat(symlink, left, sizeof(symlink)); if (left_len >= sizeof(symlink)) { - if (m) - free(resolved); errno = ENAMETOOLONG; return (NULL); } } left_len = strlcpy(left, symlink, sizeof(left)); } else if (!S_ISDIR(sb.st_mode) && p != NULL) { - if (m) - free(resolved); errno = ENOTDIR; return (NULL); } @@ -241,3 +202,29 @@ realpath(const char * __restrict path, c resolved[resolved_len - 1] = '\0'; return (resolved); } + +char * +realpath(const char * __restrict path, char * __restrict resolved) +{ + char *m, *res; + + if (path == NULL) { + errno = EINVAL; + return (NULL); + } + if (path[0] == '\0') { + errno = ENOENT; + return (NULL); + } + if (resolved != NULL) { + m = NULL; + } else { + m = resolved = malloc(PATH_MAX); + if (resolved == NULL) + return (NULL); + } + res = realpath1(path, resolved); + if (res == NULL) + free(m); + return (res); +} From owner-svn-src-head@freebsd.org Mon May 15 17:43:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919DDD6DD23 for ; Mon, 15 May 2017 17:43:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 2C654E77 for ; Mon, 15 May 2017 17:43:37 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 005dc5f5-3996-11e7-b96e-2378c10e3beb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 005dc5f5-3996-11e7-b96e-2378c10e3beb; Mon, 15 May 2017 17:43:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4FHhLUd001587; Mon, 15 May 2017 11:43:21 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1494870201.59865.103.camel@freebsd.org> Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk From: Ian Lepore To: John Baldwin , Warner Losh Cc: Ngie Cooper , "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Mon, 15 May 2017 11:43:21 -0600 In-Reply-To: <2229085.lB46rKsq7o@ralph.baldwin.cx> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> 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.23 Precedence: list List-Id: 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, 15 May 2017 17:43:38 -0000 On Mon, 2017-05-15 at 10:13 -0700, John Baldwin wrote: > On Saturday, May 13, 2017 10:39:15 AM Warner Losh wrote: > > > > > > > > > > > > > - It's really easy to screw up a mergemaster call if you edit > > > > the files, and install the stock version which removes the > > > > edits. > > > Also, programmatically removing the entries means you have to > > > bake the metadata into etc/Makefile, which is already complicated > > > enough as-is. > > Why do you care about removing them at all? They are no-ops if the > > files don't exist. Why not just always install all these files is > > where I'm going with this... > I think this is actually the bigger question.  I think it is > perfectly > sensible to support conf.d/* files for ports to use and as a way to > manage logs for application logs on an appliance, etc.  However, this > shuffling is a bit of a merge nightmare for anyone using mergemaster > or etcupdate, and the biggest cost is that newsyslog will create a > one-line file in /var/log for entries with 'C'. > That's only a good argument for keeping the lines in the monolithic file if those lines will be ignored when a file in the .conf.d directory provides conflicting config.  Otherwise my embedded product that drops different rules for rotating /var/log/messages into .conf.d STILL has to programmatically edit the monolithic file to remove the standard rule(s). -- Ian From owner-svn-src-head@freebsd.org Mon May 15 17:47:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E713D6E012; Mon, 15 May 2017 17:47:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 D2C1B138D; Mon, 15 May 2017 17:47:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x244.google.com with SMTP id o12so12304835iod.2; Mon, 15 May 2017 10:47:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=eJ0Gs7spmmlOLPK4RVCjlIW8YYmI6O8MgRMrPW11qfg=; b=lXEI+D8lEg2JI2xdmtPQLGnj0ULDKKv+3bRJgDl72cyb0wCHm4kXpeYVAVuTgtsgBE AtlJdUarEL9igjm7SGl4EcEopWPmRsk/XnGBqJIrEOjEGnVZ72RDLO3o1SvEhQZ5zLIw /WLiibZOy3AVmMt8qhdDaY/V6cxjFNOYuHhj5QYonFddPskZuVx2b4SwWgwzILeA/eTe KruHwIuPkeh/v9LC+M0go7kCSQkj4WlmutrIw6y/EZZFslM8S5uu84JwenJ6RnPi7hgn LdHArlbbID4/4SEfYUjTkGFyYRKX300/qWKoKryYkRDvLS0wUPqm9tMB3MFF0n6lts1r tMFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=eJ0Gs7spmmlOLPK4RVCjlIW8YYmI6O8MgRMrPW11qfg=; b=N63ia7rMVY1+R+5YlYfUqZhz8WqWvRIpRrjL9jnUFo3LS2h4hNGZ7OcOyYTZeTRwqb jYfYGkWB3aDRdJ6HJ+9om/pTPDB//hlSiRKCsCaBNPolqrD5nv5KbC2W/h5dibikAk40 JjN1zDBJ+axGolzppOr5qVj1u8gG6aTuZkbI+U6kNqnG4Hv0UVEfSIyRCaYn7AQTHJy3 CStTnuatKJg5wnr8LvbwTrX1TTPWPLpaI4n35cGNsfiQv7gjRIJqKpOetykVNSNJ0Slz T2ETu2QJtwq3rCeku63UtxuT7qM6JPv+oLUMGIXOEG70KYamLn6J5BhB6s7ZG79lUO+k Qh4Q== X-Gm-Message-State: AODbwcCR6n7SY7Gbc9mAvX0U7p0JUsfUs9cQ8tlYK3InlvDIISXjL31i RoxZxl83dpzFJw== X-Received: by 10.107.205.71 with SMTP id d68mr6517373iog.155.1494870434227; Mon, 15 May 2017 10:47:14 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id n42sm5403141ioi.4.2017.05.15.10.47.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 May 2017 10:47:13 -0700 (PDT) Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_048ED5CE-CDA4-4314-B0C7-3D519B240C80"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <1494870201.59865.103.camel@freebsd.org> Date: Mon, 15 May 2017 10:47:11 -0700 Cc: John Baldwin , Warner Losh , "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <0B1B76CF-9CC4-422B-8356-AE425413850B@gmail.com> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 17:47:15 -0000 --Apple-Mail=_048ED5CE-CDA4-4314-B0C7-3D519B240C80 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 15, 2017, at 10:43, Ian Lepore wrote: =E2=80=A6 > That's only a good argument for keeping the lines in the monolithic > file if those lines will be ignored when a file in the .conf.d > directory provides conflicting config. Otherwise my embedded product > that drops different rules for rotating /var/log/messages into .conf.d > STILL has to programmatically edit the monolithic file to remove the > standard rule(s). Bingo. This is part of the reason why I did this, apart from = being selfish in not wanting to handle a handful of unnecessary entries = in newsyslog/syslogd on all of my systems where I set these knobs to no. Literally all I did was `dd+p` in vim in the new files. I didn=E2=80=99t = add or subtract any overall entries. Thanks, -Ngie --Apple-Mail=_048ED5CE-CDA4-4314-B0C7-3D519B240C80 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZGemfAAoJEPWDqSZpMIYVY6UP/0sbKOIV5XS5DAHqw3M1gfar ypOus0HiyFEKEMQwJiZ42F2Z/lc4Sa7vNhTUfp8vk4z+VShPiNuvfFDseB5e2C8G B6hzSjWKrwjy004a98aAhxC33AGLeKXcpE/iZPYUYNqTwp7VjT6/3TPLB7WRod8w hIAeaSeWXCVnaV1oh0g4arbEg5qPKP6IJt51eFQ1alcOgl+eT5zBupyqyymsQ6hP /QWLe9GyqS/Bp2ofxvewMmF9l/QyZReRwuzJfPjom0e/hS2wClMjWL8aJ2XPzw6l KoznRDFPLzlfMY5NPlD6fiYxxhjVVcH+H/zr2nftqk3jSbq/0yfRHw0Go7HRUA9u N3cVY1F7ub0qCutaB8W3H+r+LE1Q4edJoXDubKdkNiCFrCV2vx4Xov4uHseHCYgL 16P7X8IvTk5C7F8FscMT5Oxy8SjhwJ5VDxIWLEzNdBtH9rb87aj7nxgdYSr+GlMg sCTvzrmmvpmC5pCunUNKi5CnfSMUFhQPj9SWXixWLzM8ZxRGUUSNgxmKIQdm5nSU 8FPyfzJWPK3ygQe8bJY/9qRaPbZ+eIlJ0GDg05I7nMkky0X8nUGN+q5wYVYvHYFy Z9aYcHDpxCzWgaxphl7tatwqO+iomtf8viQLOhvH9kp+CCxFOsAMS6XB9quKAO9j tqA9lqsVKANbCB/zLXkv =MdFF -----END PGP SIGNATURE----- --Apple-Mail=_048ED5CE-CDA4-4314-B0C7-3D519B240C80-- From owner-svn-src-head@freebsd.org Mon May 15 17:51:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC7E3D6E2AB; Mon, 15 May 2017 17:51: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 mx1.freebsd.org (Postfix) with ESMTPS id 700001AF6; Mon, 15 May 2017 17:51: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 v4FHp2VM042817; Mon, 15 May 2017 17:51:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FHp2gO042812; Mon, 15 May 2017 17:51:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705151751.v4FHp2gO042812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 May 2017 17:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318302 - in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 17:51:03 -0000 Author: emaste Date: Mon May 15 17:51:01 2017 New Revision: 318302 URL: https://svnweb.freebsd.org/changeset/base/318302 Log: bsdgrep: don't allow negative -A / -B / -C Previously, when given a negative -A/-B/-C argument bsdgrep would overflow the respective context flag(s) and exhibited surprising behavior. Fix this by removing unsignedness of Aflag/Bflag and erroring out if we're given a value < 0. Also adjust the type used to track 'tail' context in procfile() so that it accurately reflects the Aflag value rather than overflowing and losing trailing context. This also fixes an inconsistency previously existing between -n and -C "n" behavior. They are now both limited to LLONG_MAX, to be consistent. Add some test cases to make sure grep errors out properly for both negative context values as well as non-numeric context values rather than giving bogus matches. Submitted by: Kyle Evans Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10675 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/queue.c head/usr.bin/grep/util.c Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Mon May 15 17:48:58 2017 (r318301) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Mon May 15 17:51:01 2017 (r318302) @@ -517,6 +517,28 @@ grep_nomatch_flags_body() atf_check -o empty grep -q -A 1 -e "B" test1 atf_check -o empty grep -q -C 1 -e "B" test1 } + +atf_test_case badcontext +badcontext_head() +{ + atf_set "descr" "Check for handling of invalid context arguments" +} +badcontext_body() +{ + printf "A\nB\nC\n" > test1 + + atf_check -s not-exit:0 -e ignore grep -A "-1" "B" test1 + + atf_check -s not-exit:0 -e ignore grep -B "-1" "B" test1 + + atf_check -s not-exit:0 -e ignore grep -C "-1" "B" test1 + + atf_check -s not-exit:0 -e ignore grep -A "B" "B" test1 + + atf_check -s not-exit:0 -e ignore grep -B "B" "B" test1 + + atf_check -s not-exit:0 -e ignore grep -C "B" "B" test1 +} # End FreeBSD atf_init_test_cases() @@ -551,5 +573,6 @@ atf_init_test_cases() atf_add_test_case egrep_sanity atf_add_test_case grep_sanity atf_add_test_case grep_nomatch_flags + atf_add_test_case badcontext # End FreeBSD } Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Mon May 15 17:48:58 2017 (r318301) +++ head/usr.bin/grep/grep.c Mon May 15 17:51:01 2017 (r318302) @@ -108,8 +108,8 @@ struct epat *dpattern, *fpattern; char re_error[RE_ERROR_BUF + 1]; /* Command-line flags */ -unsigned long long Aflag; /* -A x: print x lines trailing each match */ -unsigned long long Bflag; /* -B x: print x lines leading each match */ +long long Aflag; /* -A x: print x lines trailing each match */ +long long Bflag; /* -B x: print x lines leading each match */ bool Hflag; /* -H: always print file name */ bool Lflag; /* -L: only show names of files with no matches */ bool bflag; /* -b: show block numbers for each match */ @@ -351,7 +351,7 @@ main(int argc, char *argv[]) char **aargv, **eargv, *eopts; char *ep; const char *pn; - unsigned long long l; + long long l; unsigned int aargc, eargc, i; int c, lastc, needpattern, newarg, prevoptind; @@ -438,10 +438,11 @@ main(int argc, char *argv[]) case '5': case '6': case '7': case '8': case '9': if (newarg || !isdigit(lastc)) Aflag = 0; - else if (Aflag > LLONG_MAX / 10) { + else if (Aflag > LLONG_MAX / 10 - 1) { errno = ERANGE; err(2, NULL); } + Aflag = Bflag = (Aflag * 10) + (c - '0'); break; case 'C': @@ -454,14 +455,17 @@ main(int argc, char *argv[]) /* FALLTHROUGH */ case 'B': errno = 0; - l = strtoull(optarg, &ep, 10); - if (((errno == ERANGE) && (l == ULLONG_MAX)) || - ((errno == EINVAL) && (l == 0))) + l = strtoll(optarg, &ep, 10); + if (errno == ERANGE || errno == EINVAL) err(2, NULL); else if (ep[0] != '\0') { errno = EINVAL; err(2, NULL); + } else if (l < 0) { + errno = EINVAL; + err(2, "context argument must be non-negative"); } + if (c == 'A') Aflag = l; else if (c == 'B') Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Mon May 15 17:48:58 2017 (r318301) +++ head/usr.bin/grep/grep.h Mon May 15 17:51:01 2017 (r318302) @@ -115,7 +115,7 @@ extern bool Eflag, Fflag, Gflag, Hflag, bflag, cflag, hflag, iflag, lflag, mflag, nflag, oflag, qflag, sflag, vflag, wflag, xflag; extern bool dexclude, dinclude, fexclude, finclude, lbflag, nullflag; -extern unsigned long long Aflag, Bflag; +extern long long Aflag, Bflag; extern long long mcount; extern long long mlimit; extern char fileeol; Modified: head/usr.bin/grep/queue.c ============================================================================== --- head/usr.bin/grep/queue.c Mon May 15 17:48:58 2017 (r318301) +++ head/usr.bin/grep/queue.c Mon May 15 17:51:01 2017 (r318302) @@ -49,7 +49,7 @@ struct qentry { }; static STAILQ_HEAD(, qentry) queue = STAILQ_HEAD_INITIALIZER(queue); -static unsigned long long count; +static long long count; static struct qentry *dequeue(void); Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Mon May 15 17:48:58 2017 (r318301) +++ head/usr.bin/grep/util.c Mon May 15 17:51:01 2017 (r318302) @@ -196,11 +196,12 @@ int procfile(const char *fn) { struct parsec pc; + long long tail; struct file *f; struct stat sb; struct str *ln; mode_t s; - int c, last_outed, t, tail; + int c, last_outed, t; bool doctx, printmatch, same_file; if (strcmp(fn, "-") == 0) { From owner-svn-src-head@freebsd.org Mon May 15 17:54:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D22F5D6E890; Mon, 15 May 2017 17:54:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FCAB201; Mon, 15 May 2017 17:54:37 +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 v4FHsax1045570; Mon, 15 May 2017 17:54:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FHsaxM045569; Mon, 15 May 2017 17:54:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705151754.v4FHsaxM045569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 May 2017 17:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318303 - head/lib/libc/stdlib X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 17:54:37 -0000 Author: kib Date: Mon May 15 17:54:36 2017 New Revision: 318303 URL: https://svnweb.freebsd.org/changeset/base/318303 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libc/stdlib/realpath.c Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Mon May 15 17:51:01 2017 (r318302) +++ head/lib/libc/stdlib/realpath.c Mon May 15 17:54:36 2017 (r318303) @@ -89,7 +89,7 @@ realpath1(const char *path, char *resolv */ p = strchr(left, '/'); - next_token_len = p ? p - left : left_len; + next_token_len = p != NULL ? p - left : left_len; memcpy(next_token, left, next_token_len); next_token[next_token_len] = '\0'; @@ -112,10 +112,9 @@ realpath1(const char *path, char *resolv if (next_token[0] == '\0') { /* Handle consequential slashes. */ continue; - } - else if (strcmp(next_token, ".") == 0) + } else if (strcmp(next_token, ".") == 0) { continue; - else if (strcmp(next_token, "..") == 0) { + } else if (strcmp(next_token, "..") == 0) { /* * Strip the last path component except when we have * single "/" @@ -146,13 +145,12 @@ realpath1(const char *path, char *resolv } slen = readlink(resolved, symlink, sizeof(symlink)); if (slen <= 0 || slen >= sizeof(symlink)) { - if (slen < 0) { - /* keep errno from readlink(2) call */ - } else if (slen == 0) { + if (slen < 0) + ; /* keep errno from readlink(2) call */ + else if (slen == 0) errno = ENOENT; - } else { + else errno = ENAMETOOLONG; - } return (NULL); } symlink[slen] = '\0'; From owner-svn-src-head@freebsd.org Mon May 15 17:57:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA696D6E916; Mon, 15 May 2017 17:57: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 mx1.freebsd.org (Postfix) with ESMTPS id 79D7D3DC; Mon, 15 May 2017 17:57: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 v4FHv9Kk045922; Mon, 15 May 2017 17:57:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FHv9Fk045921; Mon, 15 May 2017 17:57:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705151757.v4FHv9Fk045921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 May 2017 17:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318304 - head/lib/libc/gen X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 17:57:10 -0000 Author: emaste Date: Mon May 15 17:57:09 2017 New Revision: 318304 URL: https://svnweb.freebsd.org/changeset/base/318304 Log: getusershell: don't write past end of line buffer reading local shells _local_initshells did not reset cp to the beginning of the line buffer for every iteration that it called fgets(3), leading to writing past the end of line with fairly long /etc/shells or excessively long line lengths. Correct this by properly resetting cp. PR: 192528 Submitted by: Kyle Evans Reviewed by: cem, jilles Differential Revision: https://reviews.freebsd.org/D10690 Modified: head/lib/libc/gen/getusershell.c Modified: head/lib/libc/gen/getusershell.c ============================================================================== --- head/lib/libc/gen/getusershell.c Mon May 15 17:54:36 2017 (r318303) +++ head/lib/libc/gen/getusershell.c Mon May 15 17:57:09 2017 (r318304) @@ -115,8 +115,8 @@ _local_initshells(void *rv, void *cb_dat if ((fp = fopen(_PATH_SHELLS, "re")) == NULL) return NS_UNAVAIL; - cp = line; - while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { + while (fgets(line, MAXPATHLEN + 1, fp) != NULL) { + cp = line; while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; if (*cp == '#' || *cp == '\0') @@ -124,7 +124,7 @@ _local_initshells(void *rv, void *cb_dat sp = cp; while (!isspace(*cp) && *cp != '#' && *cp != '\0') cp++; - *cp++ = '\0'; + *cp = '\0'; sl_add(sl, strdup(sp)); } (void)fclose(fp); From owner-svn-src-head@freebsd.org Mon May 15 18:02:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A29DD6EB5B; Mon, 15 May 2017 18:02:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 46F21C2B; Mon, 15 May 2017 18:02:14 +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 v4FI2DNg047027; Mon, 15 May 2017 18:02:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FI2DIl047012; Mon, 15 May 2017 18:02:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705151802.v4FI2DIl047012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 May 2017 18:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318305 - head/tools/build/options X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 18:02:14 -0000 Author: emaste Date: Mon May 15 18:02:13 2017 New Revision: 318305 URL: https://svnweb.freebsd.org/changeset/base/318305 Log: makeman: reword description, based on feedback from wblock Modified: head/tools/build/options/makeman Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Mon May 15 17:57:09 2017 (r318304) +++ head/tools/build/options/makeman Mon May 15 18:02:13 2017 (r318305) @@ -3,15 +3,15 @@ # This file is in the public domain. # $FreeBSD$ # -# This script is used to create the src.conf.5 man page, using template text -# contained herein and the contents of the WITH_* and WITHOUT_* files in the -# same directory. Each WITH_* and WITHOUT_* file documents the effect of the +# This script creates the src.conf.5 man page using template text contained +# herein and the contents of the WITH_* and WITHOUT_* files in the same +# directory. Each WITH_* and WITHOUT_* file documents the effect of the # /etc/src.conf knob with the same name. # -# This script invokes "make showconfig" for each supported architecture in -# order to determine, for each option, whether the default setting is always -# WITH, always WITHOUT, or is architecture-dependent. It also determines -# and describes dependencies between options. +# For each supported architecture, "make showconfig" is invoked to determine +# the default setting of every option: always WITH_, always WITHOUT_, or +# architecture-dependent WITH_/WITHOUT_. It also determines and describes +# dependencies between options. # # Usage: # From owner-svn-src-head@freebsd.org Mon May 15 18:18:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72DEED6E5CC; Mon, 15 May 2017 18:18:34 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3D07E1A53; Mon, 15 May 2017 18:18:34 +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 v4FIIXRL055078; Mon, 15 May 2017 18:18:33 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FIIXaO055077; Mon, 15 May 2017 18:18:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201705151818.v4FIIXaO055077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 15 May 2017 18:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318307 - head/sys/dev/cxgbe X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 18:18:34 -0000 Author: np Date: Mon May 15 18:18:32 2017 New Revision: 318307 URL: https://svnweb.freebsd.org/changeset/base/318307 Log: cxgbe(4): Avoid an out of bounds access when an attempt to unbind a tx queue from a traffic class fails. Reported by: x ksi MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon May 15 18:07:57 2017 (r318306) +++ head/sys/dev/cxgbe/t4_sge.c Mon May 15 18:18:32 2017 (r318307) @@ -5323,7 +5323,7 @@ sysctl_tc(SYSCTL_HANDLER_ARGS) tc->refcount--; } txq->tc_idx = tc_idx; - } else { + } else if (tc_idx != -1) { tc = &pi->sched_params->cl_rl[tc_idx]; MPASS(tc->refcount > 0); tc->refcount--; From owner-svn-src-head@freebsd.org Mon May 15 18:24:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD97D6E8BD; Mon, 15 May 2017 18:24:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::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 E41DB155; Mon, 15 May 2017 18:24:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x241.google.com with SMTP id 12so12323172iol.1; Mon, 15 May 2017 11:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=6e8pj8sYPp7zyI2IZflyhshTyti/kZO4zhiSXc2bUIE=; b=dUeLq/DNPA0ayEzzXw4i97DiL9qtwhA0pJniqgCzkeV2/xrxaNjXAP1/f7Xsxu2woV HMwXEQJLrhfCJzTrqH0Ge60bdYUMANA3G90r7XlsGHAV2OzpCqY22WCO63ct0gK3owpx B3k7radgImtV1b3r4fsPx75dy1xDP2nY8MSTCwdGqB+IpO1MJiktmlQysoOwdnSDhJS1 DhgdlKNomlPpWD0vhGG5pa7I0SW792uqeVo6n3bbS+vTMoaJzEWYQDKFTt6BGMpbK/t3 fk39D/5Zg5d9ODJ+gHBxUknFrsrl55Ibx5sOGXC5QyoCTYhTb5ETByrKTexuGqHfj2O2 3FYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=6e8pj8sYPp7zyI2IZflyhshTyti/kZO4zhiSXc2bUIE=; b=fsK1BYdo7sRGoroiNbIt5PPSvhGpJ7+T1xvp6tu744SNuMB3LTHaOIqkPD6ntORFCm IJVahRmcQ9IfwNdS0oa+GGyCjl3vsIRuzjlskLEJ4qGDENTFb5lDVANpbsOGo58E7+5S VDs+PpPe17CaJ7dCuKmei4elkTS+usydtCKg5+iupU0fnr6LbfX/cNEi7bTWUv68UeOc wZxBJui8/V0ddu2CKw0S/Iig0dNriWFYsxww6NsOrLomI3vq/9mDUZpC6jKgHiZ4gKRG sO3UreShz4RnnO6SKSzqOQp3h9tkMruATtr24ajXVEanMDOBnj1v8wxGjziGh5JapBGt X50g== X-Gm-Message-State: AODbwcB5RRfAxxcVO2p34y2oWaEvBgMAWskhw+5ytQlgU++/dyCDwE6e cic8eK7a5n1Ukw== X-Received: by 10.107.41.193 with SMTP id p184mr6705145iop.211.1494872654323; Mon, 15 May 2017 11:24:14 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c10sm5421430ioj.48.2017.05.15.11.24.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 May 2017 11:24:13 -0700 (PDT) Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_079F2EEA-844F-442B-8099-418FC0674678"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <0B1B76CF-9CC4-422B-8356-AE425413850B@gmail.com> Date: Mon, 15 May 2017 11:24:12 -0700 Cc: John Baldwin , Warner Losh , "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <60A3FDE1-F68E-49D5-972F-A0C8993E0FEE@gmail.com> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <0B1B76CF-9CC4-422B-8356-AE425413850B@gmail.com> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 18:24:15 -0000 --Apple-Mail=_079F2EEA-844F-442B-8099-418FC0674678 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 15, 2017, at 10:47, Ngie Cooper (yaneurabeya) = wrote: >=20 >=20 >> On May 15, 2017, at 10:43, Ian Lepore wrote: >=20 > =E2=80=A6 >=20 >> That's only a good argument for keeping the lines in the monolithic >> file if those lines will be ignored when a file in the .conf.d >> directory provides conflicting config. Otherwise my embedded product >> that drops different rules for rotating /var/log/messages into = .conf.d >> STILL has to programmatically edit the monolithic file to remove the >> standard rule(s). >=20 > Bingo. This is part of the reason why I did this, apart from = being selfish in not wanting to handle a handful of unnecessary entries = in newsyslog/syslogd on all of my systems where I set these knobs to no. > Literally all I did was `dd+p` in vim in the new files. I didn=E2=80=99t= add or subtract any overall entries. And for context, we (Isilon) run newsyslog more frequently than upstream = (sometimes every couple minutes, sometimes multiple times an hour/day), = attributing to unnecessary creation and modification of log files (like = this) that we (Isilon) don=E2=80=99t care about at all, which causes = other potential issues with root media wear, potential for filesystem = corruption, reduced number of available inodes/space because it = allocates at least the frag size for a file, etc. Plus with the number of entries we have in syslog.conf (an order of = magnitude larger than upstream), having to walk a linked list to = evaluate how to handle messages when putting them out in log files does = tend to add up with all of the logging we do on our appliances (which is = considerably more chatty than I=E2=80=99ve seen other appliance vendors = that I=E2=80=99ve worked for). Thanks, -Ngie --Apple-Mail=_079F2EEA-844F-442B-8099-418FC0674678 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZGfJMAAoJEPWDqSZpMIYVmgEP/R/ysZiFHgtONDs4m76Eyeue UuKcusElG+sg2SKTe/V2a6HDaEgoa57A6HDxNzQ34KvOmiDvAord1B6oqeAEPkZx a1dAknhsLun9yLD2eGJWeoqm5jhl8HBUW8dV+Y7L4r9zKBb/c3b50742FAzKXtg/ 4JddGGWe7SRw4fZiIFxi6MR7b3K1h93CuN5m00uXflkJL5sfisv+ZBF2aXAzulB8 Sj8O3C6aCdRGi3xCQbUmR6tx8eg8DlZ/yaUtWaHBd8HaDVYcuptnn6i2qKQann7V WY/iRbfBGRNUQ01HTnunEt/wAwoRIhmnv2HO6wmhrfdM1kttuMGZU76BmNBZisnU shVe0luZACW0rFlOPW7aLh2HSQsQJq7zXLmv4w5pgcH+0mxH7ud3Sf9tU8kF1KVj +nt6n1b80A66NR0elYmrw64zrfQAA0radI9pvt6jgJ29qRwSbo9CDbvl1Fl05DkB Mxe1hSO7SpCxW8NreNaJMD4DeRbJ5q4rcVZHQPo6vpBXbSUPdvbS3R3oc1jfRHG8 95VObJYqXjnwo6Hb1y/DLG4OV8kj8sBNsckCd8NYub61BdiCBcZ+dfCzNVnmh7Ki xoXXJpXYyU2Rq59n9UyvbhEeSzmoYySVlhsagol6YXUKMjjhUUBZ0ae5gaCZTb0D +qjnmTNlAFj5rHLJ5odB =RwyB -----END PGP SIGNATURE----- --Apple-Mail=_079F2EEA-844F-442B-8099-418FC0674678-- From owner-svn-src-head@freebsd.org Mon May 15 18:46:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81D5CD6E165; Mon, 15 May 2017 18:46: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 40E621990; Mon, 15 May 2017 18:46: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 5F8D87CD3; Mon, 15 May 2017 18:46:06 +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 32CAA64F8; Mon, 15 May 2017 18:46:05 +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 ULcu2vk0LUEL; Mon, 15 May 2017 18:46:01 +0000 (UTC) Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4A80D64F2 To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201705130310.v4D3ApUl085738@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <029ada53-e5fe-7abf-99ee-5227a623a171@FreeBSD.org> Date: Mon, 15 May 2017 11:45:38 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201705130310.v4D3ApUl085738@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QNbD5nOmiMhMh3DIm8ATfvtUOhEEgee94" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 18:46:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QNbD5nOmiMhMh3DIm8ATfvtUOhEEgee94 Content-Type: multipart/mixed; boundary="75URoF019homcg4NIP5s101p6xJVsFLmQ"; protected-headers="v1" From: Bryan Drewery To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <029ada53-e5fe-7abf-99ee-5227a623a171@FreeBSD.org> Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk References: <201705130310.v4D3ApUl085738@repo.freebsd.org> In-Reply-To: <201705130310.v4D3ApUl085738@repo.freebsd.org> --75URoF019homcg4NIP5s101p6xJVsFLmQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/12/2017 8:10 PM, Ngie Cooper wrote: > Author: ngie > Date: Sat May 13 03:10:50 2017 > New Revision: 318250 > URL: https://svnweb.freebsd.org/changeset/base/318250 >=20 > Log: > Handle the logfiles in newsyslog and syslogd conditionally, based on > src.conf(5) knobs > =20 > This will allow consumers of FreeBSD to use the unmodified configurat= ion > files out of the box more than previously. > =20 > Both newsyslog.conf and syslog.conf: > - /var/log/lpd-errs (MK_LPR !=3D no) > - /var/log/ppp.log (MK_PPP !=3D no) > - /var/log/xferlog (MK_FTP !=3D no) > =20 > newsyslog.conf: > - /var/log/amd.log (MK_AMD !=3D no) > - /var/log/pflog (MK_PF !=3D no) > - /var/log/sendmail.st (MK_SENDMAIL !=3D no) > =20 > MFC after: 3 weeks > Sponsored by: Dell EMC Isilon >=20 > Added: > head/etc/newsyslog.conf.d/amd.conf (contents, props changed) > head/etc/newsyslog.conf.d/ftp.conf (contents, props changed) > head/etc/newsyslog.conf.d/lpr.conf (contents, props changed) > head/etc/newsyslog.conf.d/pf.conf (contents, props changed) > head/etc/newsyslog.conf.d/ppp.conf (contents, props changed) > head/etc/newsyslog.conf.d/sendmail.conf (contents, props changed) > head/etc/syslog.d/ > head/etc/syslog.d/Makefile (contents, props changed) > head/etc/syslog.d/ftp.conf (contents, props changed) > head/etc/syslog.d/lpr.conf (contents, props changed) > head/etc/syslog.d/ppp.conf (contents, props changed) > Modified: > head/etc/Makefile > head/etc/newsyslog.conf > head/etc/newsyslog.conf.d/Makefile > head/etc/syslog.conf > head/tools/build/mk/OptionalObsoleteFiles.inc +1 --=20 Regards, Bryan Drewery --75URoF019homcg4NIP5s101p6xJVsFLmQ-- --QNbD5nOmiMhMh3DIm8ATfvtUOhEEgee94 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 iQEcBAEBAgAGBQJZGfdcAAoJEDXXcbtuRpfP1aQH+wSLvmwPH2Fa+RzWNO5vYT0B xztj2ovXHD0yrpW8AGrTVIiQrM9P1bhSUSZ1VfzRyDxLhZIZ6q3r9oiOdaA3RoTg mvrpF1sBdewYmkVCn2NRjuvq6UsHCviRSRpNW5FEI3uphwJ6/o9nq4PkOJUO+JZT Z45eUhhmpE1Rjeq9iT4UDnWMBMQg/I1zkm0pE/biflU5PGsAM2aAj/c0yvfXzlUk 8H3j15/fFdFqW/gyN9OOUEKpILMCeIpbmRqcGJIiBafqKckbl4Ih/HCA81mLKcYl AB58q9Ydsunp9VPCuTIxiPkrW38v8j0Sr4QNhkLIn6EdYz+BWHdM1L4W+fx+gLQ= =5GT5 -----END PGP SIGNATURE----- --QNbD5nOmiMhMh3DIm8ATfvtUOhEEgee94-- From owner-svn-src-head@freebsd.org Mon May 15 18:47:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E86D6E224; Mon, 15 May 2017 18:47:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14ED51B0F; Mon, 15 May 2017 18:47:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FIlQGZ069988; Mon, 15 May 2017 18:47:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FIlQln069987; Mon, 15 May 2017 18:47:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705151847.v4FIlQln069987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 May 2017 18:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318312 - head/libexec/rtld-elf X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 18:47:27 -0000 Author: kib Date: Mon May 15 18:47:25 2017 New Revision: 318312 URL: https://svnweb.freebsd.org/changeset/base/318312 Log: Fix the AT_EXECFD functionality. If the mapped object is linked at specific address, we must obey it. If AT_EXECFD is not used, only in-kernel ELF image activator needed to keep the mapping address, since only binaries are linked at the fixed address, and binaries are mapped by kernel in this case. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D10701 Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Mon May 15 18:41:12 2017 (r318311) +++ head/libexec/rtld-elf/map_object.c Mon May 15 18:47:25 2017 (r318312) @@ -193,6 +193,8 @@ map_object(int fd, const char *path, con base_flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE; if (npagesizes > 1 && round_page(segs[0]->p_filesz) >= pagesizes[1]) base_flags |= MAP_ALIGNED_SUPER; + if (base_vaddr != 0) + base_flags |= MAP_FIXED | MAP_EXCL; mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0); if (mapbase == (caddr_t) -1) { From owner-svn-src-head@freebsd.org Mon May 15 18:48:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95615D6E2B5; Mon, 15 May 2017 18:48:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 70D521D2F; Mon, 15 May 2017 18:48:59 +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 v4FImwC7070222; Mon, 15 May 2017 18:48:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FImwMW070221; Mon, 15 May 2017 18:48:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705151848.v4FImwMW070221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 May 2017 18:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318313 - head/libexec/rtld-elf X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 18:48:59 -0000 Author: kib Date: Mon May 15 18:48:58 2017 New Revision: 318313 URL: https://svnweb.freebsd.org/changeset/base/318313 Log: Make ld-elf.so.1 directly executable. Check if passed phdr is actually phdr of the interpreter itself, and decide that this is the case of direct execution. In this case, the binary to activate is specified in the argv[1]. After opening it, shift down on-stack structure with argv, env and aux vectors to emulate execution of the binary and not of the interpreter. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D10701 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon May 15 18:47:25 2017 (r318312) +++ head/libexec/rtld-elf/rtld.c Mon May 15 18:48:58 2017 (r318313) @@ -339,13 +339,14 @@ _LD(const char *var) func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) { - Elf_Auxinfo *aux, *auxp, *aux_info[AT_COUNT]; + Elf_Auxinfo *aux, *auxp, *auxpf, *aux_info[AT_COUNT]; Objlist_Entry *entry; Obj_Entry *last_interposer, *obj, *preload_tail; const Elf_Phdr *phdr; Objlist initlist; RtldLockState lockstate; - char **argv, *argv0, **env, *kexecpath, *library_path_rpath; + Elf_Addr *argcp; + char **argv, *argv0, **env, **envp, *kexecpath, *library_path_rpath; caddr_t imgentry; char buf[MAXPATHLEN]; int argc, fd, i, mib[2], phnum; @@ -359,6 +360,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ */ /* Find the auxiliary vector on the stack. */ + argcp = sp; argc = *sp++; argv = (char **) sp; sp += argc + 1; /* Skip over arguments and NULL terminator */ @@ -410,6 +412,57 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ md_abi_variant_hook(aux_info); + fd = -1; + if (aux_info[AT_EXECFD] != NULL) { + fd = aux_info[AT_EXECFD]->a_un.a_val; + } else { + assert(aux_info[AT_PHDR] != NULL); + phdr = (const Elf_Phdr *)aux_info[AT_PHDR]->a_un.a_ptr; + if (phdr == obj_rtld.phdr) { + dbg("opening main program in direct exec mode"); + if (argc >= 2) { + argv0 = argv[1]; + fd = open(argv0, O_RDONLY | O_CLOEXEC | O_VERIFY); + if (fd == -1) { + rtld_printf("Opening %s: %s\n", argv0, + rtld_strerror(errno)); + rtld_die(); + } + + /* + * For direct exec mode, argv[0] is the interpreter + * name, we must remove it and shift arguments left by + * 1 before invoking binary main. Since stack layout + * places environment pointers and aux vectors right + * after the terminating NULL, we must shift + * environment and aux as well. + * XXX Shift will be > 1 when options are implemented. + */ + do { + *argv = *(argv + 1); + argv++; + } while (*argv != NULL); + *argcp -= 1; + main_argc = argc - 1; + environ = env = envp = argv; + do { + *envp = *(envp + 1); + envp++; + } while (*envp != NULL); + aux = auxp = (Elf_Auxinfo *)envp; + auxpf = (Elf_Auxinfo *)(envp + 1); + for (;; auxp++, auxpf++) { + *auxp = *auxpf; + if (auxp->a_type == AT_NULL) + break; + } + } else { + rtld_printf("no binary\n"); + rtld_die(); + } + } + } + ld_bind_now = getenv(_LD("BIND_NOW")); /* @@ -470,8 +523,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ * Load the main program, or process its program header if it is * already loaded. */ - if (aux_info[AT_EXECFD] != NULL) { /* Load the main program. */ - fd = aux_info[AT_EXECFD]->a_un.a_val; + if (fd != -1) { /* Load the main program. */ dbg("loading main program"); obj_main = map_object(fd, argv0, NULL); close(fd); @@ -492,7 +544,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ rtld_die(); } - if (aux_info[AT_EXECPATH] != NULL) { + if (aux_info[AT_EXECPATH] != NULL && fd == -1) { kexecpath = aux_info[AT_EXECPATH]->a_un.a_ptr; dbg("AT_EXECPATH %p %s", kexecpath, kexecpath); if (kexecpath[0] == '/') @@ -504,7 +556,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ else obj_main->path = xstrdup(buf); } else { - dbg("No AT_EXECPATH"); + dbg("No AT_EXECPATH or direct exec"); obj_main->path = xstrdup(argv0); } dbg("obj_main path %s", obj_main->path); From owner-svn-src-head@freebsd.org Mon May 15 18:51:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFD4ED6E609 for ; Mon, 15 May 2017 18:51:49 +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 B174935B for ; Mon, 15 May 2017 18:51:49 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 9db9ad73-399f-11e7-bfb5-0d159cd3c324 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 9db9ad73-399f-11e7-bfb5-0d159cd3c324; Mon, 15 May 2017 18:52:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4FIpfXJ001778; Mon, 15 May 2017 12:51:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1494874301.59865.116.camel@freebsd.org> Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk From: Ian Lepore To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Mon, 15 May 2017 12:51:41 -0600 In-Reply-To: <60A3FDE1-F68E-49D5-972F-A0C8993E0FEE@gmail.com> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <0B1B76CF-9CC4-422B-8356-AE425413850B@gmail.com> <60A3FDE1-F68E-49D5-972F-A0C8993E0FEE@gmail.com> Content-Type: text/plain; charset="windows-1251" 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.23 Precedence: list List-Id: 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, 15 May 2017 18:51:49 -0000 On Mon, 2017-05-15 at 11:24 -0700, Ngie Cooper (yaneurabeya) wrote: > > > > On May 15, 2017, at 10:47, Ngie Cooper (yaneurabeya) > mail.com> wrote: > > > > > > > > > > On May 15, 2017, at 10:43, Ian Lepore wrote: > > … > > > > > > > > That's only a good argument for keeping the lines in the > > > monolithic > > > file if those lines will be ignored when a file in the .conf.d > > > directory provides conflicting config.  Otherwise my embedded > > > product > > > that drops different rules for rotating /var/log/messages into > > > .conf.d > > > STILL has to programmatically edit the monolithic file to remove > > > the > > > standard rule(s). > > Bingo. This is part of the reason why I did this, apart from > > being selfish in not wanting to handle a handful of unnecessary > > entries in newsyslog/syslogd on all of my systems where I set these > > knobs to no. > > Literally all I did was `dd+p` in vim in the new files. I didn’t > > add or subtract any overall entries. > And for context, we (Isilon) run newsyslog more frequently than > upstream (sometimes every couple minutes, sometimes multiple times an > hour/day), attributing to unnecessary creation and modification of > log files (like this) that we (Isilon) don’t care about at all, which > causes other potential issues with root media wear, potential for > filesystem corruption, reduced number of available inodes/space > because it allocates at least the frag size for a file, etc. > We also run log rotation frequently (every 5 minutes) on our embedded systems.  That was super-important back when we logged to a ram filesystem, then newsyslog would rotate and compress from there to sdcard.  Now we just log to sdcard because when something goes wrong it's almost always the end of the log that has the clues (unless something triggers runaway log spewage) and we often lost it. A local modification we still apply to our syslogd allows you to specify in syslog.conf that for any given file, syslogd itself should limit the size of that file if the rotation doesn't take care of it soon enough.  That was important to prevent filling up a ram filesystem with runaway logging.  Now it's a feature we don't use much, but before I throw it overboard I thought I'd mention it here in case others have any use for it... The way the feature worked was you could put at the end of a line in syslog.conf "R nnnnK" -- the 'R' had a historical meaning that's now lost, so we bacronymed it to mean "Recycle" -- when the log grows to nnnnK in size, the last 32K of the file becomes a circular buffer that continually gets rewritten until a normal file rotation happens.  If something triggers runaway logging, the hope is that that event got captured somewhere before the final 32k of the file, so you still have some clues for postmortem analysis. -- Ian From owner-svn-src-head@freebsd.org Mon May 15 18:52:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D96AD6E6B2; Mon, 15 May 2017 18:52:37 +0000 (UTC) (envelope-from danfe@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 5084C7C8; Mon, 15 May 2017 18:52:37 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 775042EA; Mon, 15 May 2017 18:52:36 +0000 (UTC) Date: Mon, 15 May 2017 18:52:36 +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: r318313 - head/libexec/rtld-elf Message-ID: <20170515185236.GB1637@FreeBSD.org> References: <201705151848.v4FImwMW070221@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201705151848.v4FImwMW070221@repo.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 18:52:37 -0000 On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov wrote: > New Revision: 318313 > URL: https://svnweb.freebsd.org/changeset/base/318313 > > Log: > Make ld-elf.so.1 directly executable. Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x /bin/chmod would now be possible on FreeBSD as well? Does this have any security implications? ./danfe From owner-svn-src-head@freebsd.org Mon May 15 19:00:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 966A1D6E7CA; Mon, 15 May 2017 19:00:37 +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 122409CF; Mon, 15 May 2017 19:00:36 +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 v4FJ0UKb095174 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 May 2017 22:00:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4FJ0UKb095174 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4FJ0Uwt095172; Mon, 15 May 2017 22:00:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 May 2017 22:00:30 +0300 From: Konstantin Belousov To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515190030.GG1622@kib.kiev.ua> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515185236.GB1637@FreeBSD.org> User-Agent: Mutt/1.8.2 (2017-04-18) 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.23 Precedence: list List-Id: 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, 15 May 2017 19:00:37 -0000 On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov wrote: > > New Revision: 318313 > > URL: https://svnweb.freebsd.org/changeset/base/318313 > > > > Log: > > Make ld-elf.so.1 directly executable. > > Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x > /bin/chmod would now be possible on FreeBSD as well? Yes. > Does this have any security implications? What do you mean ? From owner-svn-src-head@freebsd.org Mon May 15 19:06:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA6E5D6ECAF; Mon, 15 May 2017 19:06:12 +0000 (UTC) (envelope-from danfe@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 CD182110F; Mon, 15 May 2017 19:06:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 03C3176F; Mon, 15 May 2017 19:06:11 +0000 (UTC) Date: Mon, 15 May 2017 19:06:11 +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: r318313 - head/libexec/rtld-elf Message-ID: <20170515190611.GA16258@FreeBSD.org> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515190030.GG1622@kib.kiev.ua> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:06:13 -0000 On Mon, May 15, 2017 at 10:00:30PM +0300, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: > > On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov wrote: > > > New Revision: 318313 > > > URL: https://svnweb.freebsd.org/changeset/base/318313 > > > > > > Log: > > > Make ld-elf.so.1 directly executable. > ... > > Does this have any security implications? > > What do you mean ? I don't know, but was thinking of something like "this change makes X and Z scenarios now possible; if you're worried about this you might want to chmod -x /libexec/ld-elf.so.1 to restore previous behavior". BTW, would chmod -x /libexec/ld-elf.so.1 break anything from now on? If you cannot think of anything like this (specific), sorry for the noise, you can ignore me. ./danfe From owner-svn-src-head@freebsd.org Mon May 15 19:08:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54512D6ED2F for ; Mon, 15 May 2017 19:08:58 +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 30AC412D8 for ; Mon, 15 May 2017 19:08:57 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 064bb700-39a2-11e7-bfb5-0d159cd3c324 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 064bb700-39a2-11e7-bfb5-0d159cd3c324; Mon, 15 May 2017 19:09:31 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4FJ8tIF001821; Mon, 15 May 2017 13:08:55 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1494875335.59865.118.camel@freebsd.org> Subject: Re: svn commit: r318313 - head/libexec/rtld-elf From: Ian Lepore To: Konstantin Belousov , Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 15 May 2017 13:08:55 -0600 In-Reply-To: <20170515190030.GG1622@kib.kiev.ua> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> 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.23 Precedence: list List-Id: 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, 15 May 2017 19:08:58 -0000 On Mon, 2017-05-15 at 22:00 +0300, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: > > > > On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov > > wrote: > > > > > > New Revision: 318313 > > > URL: https://svnweb.freebsd.org/changeset/base/318313 > > > > > > Log: > > >   Make ld-elf.so.1 directly executable. > > Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod > > +x > > /bin/chmod would now be possible on FreeBSD as well? > Yes. > > > > > Does this have any security implications? > What do you mean ? > Well, for example, it seems like it would allow anyone to execute a binary even if the sysadmin had set it to -x specifically to prevent people from running it. -- Ian From owner-svn-src-head@freebsd.org Mon May 15 19:09:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88BB0D6ED9C; Mon, 15 May 2017 19:09:47 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (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 6FE0D1475; Mon, 15 May 2017 19:09:47 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from [10.11.0.121] (webassign-to-rtp-ip-asr-gw.ncren.net [128.109.111.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 99A74239591; Mon, 15 May 2017 15:09:40 -0400 (EDT) Subject: Re: svn commit: r318313 - head/libexec/rtld-elf To: Alexey Dokuchaev , Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> From: Nikolai Lifanov Message-ID: <6c327032-9eb5-2b0a-39ed-2140144a5a0d@FreeBSD.org> Date: Mon, 15 May 2017 15:09:33 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170515185236.GB1637@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4jFhDCnXjCGIA4r2h2RwG5GItMfrDGXwK" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:09:47 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4jFhDCnXjCGIA4r2h2RwG5GItMfrDGXwK Content-Type: multipart/mixed; boundary="cMpwKJqLw1EeQM8G9Ki0XhbWAxoJffejv"; protected-headers="v1" From: Nikolai Lifanov To: Alexey Dokuchaev , Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <6c327032-9eb5-2b0a-39ed-2140144a5a0d@FreeBSD.org> Subject: Re: svn commit: r318313 - head/libexec/rtld-elf References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> In-Reply-To: <20170515185236.GB1637@FreeBSD.org> --cMpwKJqLw1EeQM8G9Ki0XhbWAxoJffejv Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05/15/2017 14:52, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov wrote: >> New Revision: 318313 >> URL: https://svnweb.freebsd.org/changeset/base/318313 >> >> Log: >> Make ld-elf.so.1 directly executable. >=20 > Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x > /bin/chmod would now be possible on FreeBSD as well? Does this have > any security implications? >=20 > ./danfe This is a use case for fixing accidentally hosed /bin/chmod binary and not some sort of an escalation thing. You will need to be root to do this. Likewise, with working chmod binary, you should be able to mark binaries with write access executable. - Nikolai Lifanov --cMpwKJqLw1EeQM8G9Ki0XhbWAxoJffejv-- --4jFhDCnXjCGIA4r2h2RwG5GItMfrDGXwK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKoBAEBCgCSFiEE5oT6TcuaWvG5gtjzZ6sv56ecR0UFAlkZ/O1fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU2 ODRGQTREQ0I5QTVBRjFCOTgyRDhGMzY3QUIyRkU3QTc5QzQ3NDUUHGxpZmFub3ZA ZnJlZWJzZC5vcmcACgkQZ6sv56ecR0W13Q/8CTQVVfCNYpoKQchzQUQXsRR1rQCH PjyJSn2kOa4qn8inAxDwI9AYkr5P+p9W3bQKq6lnjRrTqR/cxn5QziXsM2X58eTD yzLWKfUm3ynCuOIyeSL/6ggl0m7Iyh6tVQeP45ftG+ZUflpKtNSS37FS7vYVsnlJ cjWcQ5QQjbxwBMxqtegzzbvCcsbwYHjtRiByNxGfDN2TvVpRX4fBwvMaSN6ZWcZz isLlbNyEGozfenPlDO/RiuH8zq/caL0JHZxvwhNZveSJyzfO0Comw07suTA5VCLR A6h+sTSD79YtfoP1YYUeg8DzOEYFU403/dFOZQBhBe4MVWxLc7yvPeO1E0kABUm2 MFI+X+vwLxFSGQG07sTQY9txjPlFFEhomMypDdKMJqh0jgC0apZdpKhDb2bU/Mbu f9OtNNlJ6y24OZGHx4pxKm88xMtjOL876bpsxzbzYqxX3B7fxUEf6R8jxOKuMVlq 3qRy2XjB4ZpCa2g5/+xS+DH1/qmXjRAgW1C8UD/Y3XM17f9lwUPGoooVl3SHazYc 5ZlNamFiQhBYbl80GAZ7+SVki3kW7z1nC3qnVD7nSovQzwD0wKTmGEalTFi0VyTv P8H2cTzDlSDKcLHMAVL2ltVKDq6A6L18y1D9AqONlmuwQ9vFycrFb/YqnIZC6lAo Bpq+tmUSNrVWJUc= =Xg2P -----END PGP SIGNATURE----- --4jFhDCnXjCGIA4r2h2RwG5GItMfrDGXwK-- From owner-svn-src-head@freebsd.org Mon May 15 19:13:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C77DD6E026; Mon, 15 May 2017 19:13:03 +0000 (UTC) (envelope-from danfe@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 2DFFF19D3; Mon, 15 May 2017 19:13:03 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 52BDBB26; Mon, 15 May 2017 19:13:02 +0000 (UTC) Date: Mon, 15 May 2017 19:13:02 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515191302.GA28684@FreeBSD.org> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1494875335.59865.118.camel@freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:13:03 -0000 On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > On Mon, 2017-05-15 at 22:00 +0300, Konstantin Belousov wrote: > > On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: > > > Does this have any security implications? > > > > What do you mean ? > > Well, for example, it seems like it would allow anyone to execute a > binary even if the sysadmin had set it to -x specifically to prevent > people from running it. Right, that was something I was subconsciously worried of but could not word it in timely fashion. Thanks Ian. ./danfe From owner-svn-src-head@freebsd.org Mon May 15 19:13:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 344C3D6E085 for ; Mon, 15 May 2017 19:13:20 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::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 E4B9B1AF4 for ; Mon, 15 May 2017 19:13:19 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x232.google.com with SMTP id f55so56599779qta.3 for ; Mon, 15 May 2017 12:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZBN7P75CCyKstEABDytULiQ/0uQWMw/t1TXPbRUdxiw=; b=dmLbujS8L5YbhAWbRgAUUfOGaTkhVBAThCd78S4QqFqrY/CcG8fek8a9amICCMOIYy ZxsYkBbE8b2gBBjRfQhadQoW+ENEtZ77hlTtgQbqd0zCeVoFMLJv0V7kZ9OC+1AMTl2V fI7dNx2AMrKgsYTVe357BHApUPMXS8xM+PiolWGKJ0fj6CnwK4jXyK4BcEI+mNI5Ciai jZZ93CXDKbiIVRG6PSCZHHACtTcZ7mOfkSgImpqgonbSeY8cPL+VkEvXu9r+6e3tInu/ bTGQV5TFPESa7ns1rdX6hXV17bboDoyH5IxVNXypUtofWcMq/GGAWEDrPyw9u9j6C2if 4kvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZBN7P75CCyKstEABDytULiQ/0uQWMw/t1TXPbRUdxiw=; b=IYpkZgjipDm9e0K0aHH/V9u202yk7j0xUPo7tVD9NnxbpeRGJhd0sy72pWKj4smEIi UCGaJBEmFeiE5aX+BSCZsLL1WinjD5aWlvQOcEPwqDu0BP51KmoO6quFltH/OU+TyEfg gGpOT1Kl6MZffyByS5SMT8mODDvwOSygH+/Bzn9/wVVjMKoK89dzRWhUPtNJ+Ip50/nt /7Pib2Ro7w6vI0pZwFWfu8TYTN6zmB3mQy/QNmiNtQi7z4x5UUCePkKMr6OqNvqhEAkd uHfYjq4tFoG7C+HqXJ6BYAABdh+ynogN8Rob7ESVKXTDmHuZ3AggP2ejkkQNEcfe58JZ /G9Q== X-Gm-Message-State: AODbwcAYDEQ1bsCmuaK3GVrNJcW+a/nVPn/I5umid+6/jApy6bAF499A SkJA1iy2GWAdZL8+ X-Received: by 10.200.36.66 with SMTP id d2mr7994059qtd.9.1494875599042; Mon, 15 May 2017 12:13:19 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id x139sm9112833qkx.20.2017.05.15.12.13.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 May 2017 12:13:18 -0700 (PDT) Date: Mon, 15 May 2017 15:13:16 -0400 From: Shawn Webb To: Ian Lepore Cc: Konstantin Belousov , Alexey Dokuchaev , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515191316.jjtxiynrh3jvo5sz@mutt-hbsd> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5io3g6j2hynitzvc" Content-Disposition: inline In-Reply-To: <1494875335.59865.118.camel@freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170306 (1.8.0) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:13:20 -0000 --5io3g6j2hynitzvc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > On Mon, 2017-05-15 at 22:00 +0300, Konstantin Belousov wrote: > > On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: > > >=20 > > > On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov > > > wrote: > > > >=20 > > > > New Revision: 318313 > > > > URL: https://svnweb.freebsd.org/changeset/base/318313 > > > >=20 > > > > Log: > > > > ? Make ld-elf.so.1 directly executable. > > > Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod > > > +x > > > /bin/chmod would now be possible on FreeBSD as well? > > Yes. > >=20 > > >=20 > > > Does this have any security implications? > > What do you mean ? > >=20 >=20 > Well, for example, it seems like it would allow anyone to execute a > binary even if the sysadmin had set it to -x specifically to prevent > people from running it. It additionally subverts application whitelisting schemes where all dependent shared objects (even the rtld) are checked (such is the case with Integriforce in HardenedBSD). Since even the rtld is checked, an attacker can now bypass the application whitelisting scheme by running: /libexec/ld-elf.so.1 /path/to/previously/disallowed/executable Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --5io3g6j2hynitzvc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlkZ/ckACgkQaoRlj1JF bu5B2w/+IwXqXEF1TEazfzGVK6C4+f9WoK12qRISJlVF7hGVFQ1Sk0Hbac4P3Mb0 +5WXXb4XFzYLCk8bXWUgO0rJdyVKmkeRQhQ0dREXUoSBOPZDbVk3/rTprlwiv3I5 dj2m3b012zcW7D3py3P/LwVztsw6WQ4EaIkgnYax4QT0YdOJP0vwRmVCHPegro47 F2Aw0zuAKY+Cjau7y/Act8aEZ7Vu5yaOeruKtJi7HaLCugq5JXd0zWuiwVZhZhaT NkOx0Rl+fEyZK8LuZ3v9yWCzjV4FmdYHB54ZzpNwCgIl6+a3LKgfV1DP36/CKacg TsGmSbv8vSDBIBJCq1lH/l+EWJb5qq+pk56bcbFEQs3bagtieD/yrrarM6hGIZir l2qJOAX7uRhR0uH7eofN6nKd5Sjdm6KymcBER6XLNBAciNsTK/VsAihtf7akD4w0 JX8OGBgBye+lBaAfk6f2swB8eUmwsdG+asX6brevF1Jh4L/M7QeJbYxVMV/1/L9/ NBBaKgDGPyyQYrfQQpu5heaZ7+ec/TdUaeV61+vJ8sKNCCyGJh/MoJGVAwjmgUaj 1mNvmv9CGSyk9nuoQXj/KkpWIa2F/SDHu2toO2wvgJmoP61tDC1yARCnL91aPDrE 5jEKCR3mMfjhfYwQuBuusBAsGHyuZslJFirXsPCrmynBPzZI4XI= =ipty -----END PGP SIGNATURE----- --5io3g6j2hynitzvc-- From owner-svn-src-head@freebsd.org Mon May 15 19:14:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76177D6E10D; Mon, 15 May 2017 19:14:27 +0000 (UTC) (envelope-from jonathan@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 557571CAF; Mon, 15 May 2017 19:14:27 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from [134.153.0.231] (unknown [127.0.1.132]) by freefall.freebsd.org (Postfix) with ESMTP id 1146ED62; Mon, 15 May 2017 19:14:26 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) From: "Jonathan Anderson" To: "Ian Lepore" Cc: "Konstantin Belousov" , "Alexey Dokuchaev" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Date: Mon, 15 May 2017 16:44:25 -0230 Message-ID: In-Reply-To: <1494875335.59865.118.camel@freebsd.org> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (1.9.6r5347) Content-Type: text/plain; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:14:27 -0000 On 15 May 2017, at 16:38, Ian Lepore wrote: > On Mon, 2017-05-15 at 22:00 +0300, Konstantin Belousov wrote: >> On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: >>> >>> Does this have any security implications? >> What do you mean ? >> > > Well, for example, it seems like it would allow anyone to execute a > binary even if the sysadmin had set it to -x specifically to prevent > people from running it. You can already execute "non-executable" binaries using the `exec` shell built-in: ``` $ cp /bin/sh . $ chmod -x sh $ exec sh ``` Jon -- Jonathan Anderson jonathan@FreeBSD.org From owner-svn-src-head@freebsd.org Mon May 15 19:18:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B08D6E23D; Mon, 15 May 2017 19:18:25 +0000 (UTC) (envelope-from jonathan@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 DB27D1F9C; Mon, 15 May 2017 19:18:24 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from [134.153.0.231] (unknown [127.0.1.132]) by freefall.freebsd.org (Postfix) with ESMTP id 961DBFD1; Mon, 15 May 2017 19:18:23 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) From: "Jonathan Anderson" To: "Ian Lepore" Cc: "Konstantin Belousov" , "Alexey Dokuchaev" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Date: Mon, 15 May 2017 16:48:23 -0230 Message-ID: <1F314B80-B5EC-4384-AAF0-1F3D477ADC3B@FreeBSD.org> In-Reply-To: References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (1.9.6r5347) Content-Type: text/plain; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:18:25 -0000 On 15 May 2017, at 16:44, Jonathan Anderson wrote: > You can already execute "non-executable" binaries using the `exec` > shell built-in: > > ``` > $ cp /bin/sh . > $ chmod -x sh > $ exec sh > ``` Er, oops: I ought to have said, you can execute non-executable binaries by copying and marking them `+x`: ``` $ cp /bin/sh . $ chmod +x sh $ ./sh ``` (please ignore the bit about `exec`, that's from another mental thread) Jon -- Jonathan Anderson jonathan@FreeBSD.org From owner-svn-src-head@freebsd.org Mon May 15 19:21:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 556FFD6E426; Mon, 15 May 2017 19:21:37 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (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 3439B37B; Mon, 15 May 2017 19:21:36 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from [10.11.0.121] (webassign-to-rtp-ip-asr-gw.ncren.net [128.109.111.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 66181239431; Mon, 15 May 2017 15:21:35 -0400 (EDT) Subject: Re: svn commit: r318313 - head/libexec/rtld-elf To: Jonathan Anderson , Ian Lepore Cc: Konstantin Belousov , svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <1F314B80-B5EC-4384-AAF0-1F3D477ADC3B@FreeBSD.org> From: Nikolai Lifanov Message-ID: <3daaaf74-3dd2-dcc9-03fb-5f6a7ccb991e@FreeBSD.org> Date: Mon, 15 May 2017 15:21:27 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1F314B80-B5EC-4384-AAF0-1F3D477ADC3B@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="evothQLhOmJxo4EGjAttsLC0JAW86keK7" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:21:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --evothQLhOmJxo4EGjAttsLC0JAW86keK7 Content-Type: multipart/mixed; boundary="liucOQl8k9dOaIMtmTUw6V6DGK2jCxrlX"; protected-headers="v1" From: Nikolai Lifanov To: Jonathan Anderson , Ian Lepore Cc: Konstantin Belousov , svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Message-ID: <3daaaf74-3dd2-dcc9-03fb-5f6a7ccb991e@FreeBSD.org> Subject: Re: svn commit: r318313 - head/libexec/rtld-elf References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <1F314B80-B5EC-4384-AAF0-1F3D477ADC3B@FreeBSD.org> In-Reply-To: <1F314B80-B5EC-4384-AAF0-1F3D477ADC3B@FreeBSD.org> --liucOQl8k9dOaIMtmTUw6V6DGK2jCxrlX Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05/15/2017 15:18, Jonathan Anderson wrote: > On 15 May 2017, at 16:44, Jonathan Anderson wrote: >=20 >> You can already execute "non-executable" binaries using the `exec` >> shell built-in: >> >> ``` >> $ cp /bin/sh . >> $ chmod -x sh >> $ exec sh >> ``` >=20 > Er, oops: I ought to have said, you can execute non-executable binaries= > by copying and marking them `+x`: >=20 > ``` > $ cp /bin/sh . > $ chmod +x sh > $ ./sh > ``` >=20 > (please ignore the bit about `exec`, that's from another mental thread)= >=20 >=20 > Jon And the default install doesn't mount /tmp noexec ... - Nikolai Lifanov --liucOQl8k9dOaIMtmTUw6V6DGK2jCxrlX-- --evothQLhOmJxo4EGjAttsLC0JAW86keK7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKoBAEBCgCSFiEE5oT6TcuaWvG5gtjzZ6sv56ecR0UFAlkZ/7hfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU2 ODRGQTREQ0I5QTVBRjFCOTgyRDhGMzY3QUIyRkU3QTc5QzQ3NDUUHGxpZmFub3ZA ZnJlZWJzZC5vcmcACgkQZ6sv56ecR0W21A/9Hgu1QZSENQYz5Pjl5mrvYxjHyGPl VfZC2dA9u3XIGCI2s7Coemw/59JpZ7ecsmbObBZEGL4MzNn/P3iHUU03CdyTsLek /xu3ls/I7ri+haKZsEkVBC8A12nzB2ldvlX2TWWqsixmrLTS91q7LxtRyPGTfbZJ YEwFYCRetbye2Mk/mzomfNymqCaOY4Tvq1X6rB/4ikjbbpYTG/Qxkzf1irYSTYll CBFOMt3UsJmy/f8mqNwps5TuW/Ce16btG3lsEaf6wHP+nY2Dg9CoOLxSYBdIlou3 g2tICUydkUdCcGFVUNNzt67uETVcZkW/4lpIsKrD1gsz0JhllRZZeffLNPHmw6Yf uQgYKlL7xUoravCRbaI6DeNZi6nS/IyJuPB2b6CGG1Rk0jpA8P24t/UKTRb548Sc DGm5+sIX3ZPH78vLViyjgO37pNwwq2iefRzVqHlMg1BUEkGoGk0Q9zckxQeg4BZc Ob89nl5jTyGq+Qe6eHouzC/8YWnUTT9+RqljDHmk9aHGv2heE9orzIQggaO9MprF XuI8rfch9gnx7C0S5SBzttri9Ka0pNGcoinaLesjt5ZFO/bANo+VzjV/6DX8bCH7 d08NjVmZGknfYa+XI2IbYX+g82s30ZMEpGjrRHS8uMbSNvt6u2WD3R/m5oy5pAV9 y7FFU17AZ80ZANs= =i5xV -----END PGP SIGNATURE----- --evothQLhOmJxo4EGjAttsLC0JAW86keK7-- From owner-svn-src-head@freebsd.org Mon May 15 19:23:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1492D6E4BB; Mon, 15 May 2017 19:23:27 +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 D2092838; Mon, 15 May 2017 19:23:27 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 03394125F; Mon, 15 May 2017 19:23:27 +0000 (UTC) Date: Mon, 15 May 2017 19:23:26 +0000 From: Alexey Dokuchaev To: Nikolai Lifanov Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515192326.GB28684@FreeBSD.org> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <6c327032-9eb5-2b0a-39ed-2140144a5a0d@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6c327032-9eb5-2b0a-39ed-2140144a5a0d@FreeBSD.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:23:28 -0000 On Mon, May 15, 2017 at 03:09:33PM -0400, Nikolai Lifanov wrote: > On 05/15/2017 14:52, Alexey Dokuchaev wrote: > > Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x > > /bin/chmod would now be possible on FreeBSD as well? Does this have > > any security implications? > > This is a use case for fixing accidentally hosed /bin/chmod binary and > not some sort of an escalation thing. You will need to be root to do > this. Because /bin/chmod is owned by root, not because /libexec/ld-elf.so.1 is limiting execution to root only, or is it (I might have missed uid check in that patch [1], but at a quick glance I didn't see it). On a living system, there are plenty of other ways to restore missing +x on /bin/chmod as long as you can call chmod(2), from simple Python script down to manually crafting small binary in hex. > Likewise, with working chmod binary, you should be able to mark > binaries with write access executable. Well, it's not just about chmod(1), this opens what can be a can of worms and I want to know how big it is. ./danfe [1] Idea for security.bsd.ld_elf_exec_root_only sysctl(8)? From owner-svn-src-head@freebsd.org Mon May 15 19:25:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5014D6E54B; Mon, 15 May 2017 19:25:21 +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 850729A2; Mon, 15 May 2017 19:25:21 +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 9A4CE1388; Mon, 15 May 2017 19:25:20 +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 D141F6600; Mon, 15 May 2017 19:25:19 +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 SIK0wDQicQOx; Mon, 15 May 2017 19:25:16 +0000 (UTC) Subject: Re: svn commit: r318313 - head/libexec/rtld-elf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8BE2265FB To: Konstantin Belousov , Alexey Dokuchaev References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> Date: Mon, 15 May 2017 12:25:20 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170515190030.GG1622@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FIBNq4MPs9g7XO3idsWtoeOkCiNO9wVti" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:25:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FIBNq4MPs9g7XO3idsWtoeOkCiNO9wVti Content-Type: multipart/mixed; boundary="cTJXegGkWXd4O3fHPXOudkouWIhUkFfcI"; protected-headers="v1" From: Bryan Drewery To: Konstantin Belousov , Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> Subject: Re: svn commit: r318313 - head/libexec/rtld-elf References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> In-Reply-To: <20170515190030.GG1622@kib.kiev.ua> --cTJXegGkWXd4O3fHPXOudkouWIhUkFfcI Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 5/15/2017 12:00 PM, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: >> On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov wrote: >>> New Revision: 318313 >>> URL: https://svnweb.freebsd.org/changeset/base/318313 >>> >>> Log: >>> Make ld-elf.so.1 directly executable. >> >> Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x= >> /bin/chmod would now be possible on FreeBSD as well? > Yes. >=20 >> Does this have any security implications? > What do you mean ? >=20 I think for 3rd-party distributions it may be a problem. At the very least it needs to be communicated clearly in release notes or UPDATING. Consider a downstream vendor who has support for signed binary executions. If rtld allows a backdoor around exec(2) to run an unsigned binary, that could be a problem for them. It is on them to add support to exec(2) to validate the special case of execing rtld with an argument, or to just disable the feature in rtld from this commit. --=20 Regards, Bryan Drewery --cTJXegGkWXd4O3fHPXOudkouWIhUkFfcI-- --FIBNq4MPs9g7XO3idsWtoeOkCiNO9wVti 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 iQEcBAEBAgAGBQJZGgCgAAoJEDXXcbtuRpfPXWAH/2Mi0uu/VhoCi+cTZaUwphAo OPFx6XFHODSG2DtSAuQgVKVjZWP2AP+kmqKkuHpyGARsuTVqjJyDu2YMKkd2OBS7 Ap53emckAzi/LFqQ46bianJWQzx9HJrSmvCxqMJzzBHKNa154OAh4TFtQMGBVwtc rQY6GIYDSir3ASTasHJrYtbFSaSG1olSHj5WWBMveoQHwzAlZ0Y17OOWF1IMxyIr jnTPx8W4nLVHbCuZsydoSNMqv7vw/aN1fJZZBKvGzbIxKWEAhBcKxE6jhVpKBeEd pdrXhFI6wgj4C6X0SZ1hIJL0QAsoIVW1/sGIFDzpqSq2vFVOajCclmf4p+mQEYA= =FUZz -----END PGP SIGNATURE----- --FIBNq4MPs9g7XO3idsWtoeOkCiNO9wVti-- From owner-svn-src-head@freebsd.org Mon May 15 19:25:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16544D6E5AF; Mon, 15 May 2017 19:25:36 +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 1446BA6F; Mon, 15 May 2017 19:25:34 +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 v4FJPTca000765 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 May 2017 22:25:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4FJPTca000765 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4FJPTMq000764; Mon, 15 May 2017 22:25:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 May 2017 22:25:29 +0300 From: Konstantin Belousov To: Ian Lepore Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515192529.GH1622@kib.kiev.ua> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1494875335.59865.118.camel@freebsd.org> User-Agent: Mutt/1.8.2 (2017-04-18) 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.23 Precedence: list List-Id: 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, 15 May 2017 19:25:36 -0000 On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > Well, for example, it seems like it would allow anyone to execute a > binary even if the sysadmin had set it to -x specifically to prevent > people from running it. The direct mode does not (and cannot) honor set{u,g}id modes of the executable, so any binary run this way would only exercise the existing power of the user which did it. The most advanced explanation that I was given in private was among the lines: "if you have an environment where users can upload content to a shared server, but have no access to chmod(2), no compilers, no scripting languages, etc." The person then admitted that (s)he does not consider it as an actual concern. If somebody is worried about this or similar scenario, I might add too restrictive check, e.g. requiring u+x if user is owner, g+x is primary user group is the group of file, and o+x otherwise. This would be strict subset of the normal unix checks and ACL would be also ignored. Still I am not convinced. From owner-svn-src-head@freebsd.org Mon May 15 19:29:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6552D6E6FF; Mon, 15 May 2017 19:29:50 +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 22FFCD06; Mon, 15 May 2017 19:29:49 +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 v4FJTi3Y001723 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 May 2017 22:29:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4FJTi3Y001723 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4FJTitU001722; Mon, 15 May 2017 22:29:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 May 2017 22:29:44 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515192944.GI1622@kib.kiev.ua> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> User-Agent: Mutt/1.8.2 (2017-04-18) 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.23 Precedence: list List-Id: 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, 15 May 2017 19:29:50 -0000 On Mon, May 15, 2017 at 12:25:20PM -0700, Bryan Drewery wrote: > On 5/15/2017 12:00 PM, Konstantin Belousov wrote: > > On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: > >> On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov wrote: > >>> New Revision: 318313 > >>> URL: https://svnweb.freebsd.org/changeset/base/318313 > >>> > >>> Log: > >>> Make ld-elf.so.1 directly executable. > >> > >> Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x > >> /bin/chmod would now be possible on FreeBSD as well? > > Yes. > > > >> Does this have any security implications? > > What do you mean ? > > > > I think for 3rd-party distributions it may be a problem. At the very > least it needs to be communicated clearly in release notes or UPDATING. > > Consider a downstream vendor who has support for signed binary > executions. If rtld allows a backdoor around exec(2) to run an unsigned > binary, that could be a problem for them. It is on them to add support > to exec(2) to validate the special case of execing rtld with an > argument, or to just disable the feature in rtld from this commit. Note the undocumented O_VERIFY flag in open(2) from the patch. This is very vendor-ish addition to request veriexec (?). From owner-svn-src-head@freebsd.org Mon May 15 19:29:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE96ED6E71E; Mon, 15 May 2017 19:29:54 +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 C7495D18; Mon, 15 May 2017 19:29:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 885A210A7B9; Mon, 15 May 2017 15:29:53 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: Warner Losh , Ngie Cooper , "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk Date: Mon, 15 May 2017 12:22:50 -0700 Message-ID: <4703731.Pl02uSWy7k@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <1494870201.59865.103.camel@freebsd.org> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 15 May 2017 15:29:53 -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.23 Precedence: list List-Id: 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, 15 May 2017 19:29:55 -0000 On Monday, May 15, 2017 11:43:21 AM Ian Lepore wrote: > On Mon, 2017-05-15 at 10:13 -0700, John Baldwin wrote: > > On Saturday, May 13, 2017 10:39:15 AM Warner Losh wrote: > > > > > > > > > > > > > > > > > - It's really easy to screw up a mergemaster call if you edit > > > > > the files, and install the stock version which removes the > > > > > edits. > > > > Also, programmatically removing the entries means you have to > > > > bake the metadata into etc/Makefile, which is already complicated > > > > enough as-is. > > > Why do you care about removing them at all? They are no-ops if the > > > files don't exist. Why not just always install all these files is > > > where I'm going with this... > > I think this is actually the bigger question. I think it is > > perfectly > > sensible to support conf.d/* files for ports to use and as a way to > > manage logs for application logs on an appliance, etc. However, this > > shuffling is a bit of a merge nightmare for anyone using mergemaster > > or etcupdate, and the biggest cost is that newsyslog will create a > > one-line file in /var/log for entries with 'C'. > > > > That's only a good argument for keeping the lines in the monolithic > file if those lines will be ignored when a file in the .conf.d > directory provides conflicting config. Otherwise my embedded product > that drops different rules for rotating /var/log/messages into .conf.d > STILL has to programmatically edit the monolithic file to remove the > standard rule(s). Now you have to programmatically edit the file in conf.d/foo. However, by this argument the monolithic conf file shouldn't even exist. The current approach is a half-way mix with the worst of both models it seems. Also, _you_ could just splat an empty /etc/newsyslog.conf file on your appliance and create a bunch of conf.d/foo files if that is easier for you to use on an appliance. The files we ship in a release aren't really tailored for an appliance (I've yet to see an appliance that doesn't use a FooBSD with local patches). OTOH, the existing setup is probably simpler to manage for an out-of-the-box install. I'm also suprised you don't manage the newsyslog.conf file yourself rather than trying to edit and merge in upstream changes? That is, I can see a few approaches: 1) Keep your real newsyslog.conf / syslogd.conf files in your FooBSD's VCS and when newsyslog.conf changes upstream you merge that in the way you normally merge changes. 2) Move the "vendor" newsyslog.conf out entirely and install your own versions of these files either as a monolithic assembled by config management rules or a bunch of conf.d/foo files (here I would probably opt for separate files). However, your approach doesn't seem to describe either of these since this commit doesn't impact those work flows (if 1), you would have already made any local changes you need and if anything merging this commit gives you the kind of merge conflicts people will get on the next mergemaster / etcupdate for non-appliance boxes, or if 2) you ignore these files) -- John Baldwin From owner-svn-src-head@freebsd.org Mon May 15 19:32:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3582DD6E893; Mon, 15 May 2017 19:32: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 E72B11418; Mon, 15 May 2017 19:32: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 DC9CE19E0; Mon, 15 May 2017 19:32: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 DBE036F5C; Mon, 15 May 2017 19:32: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 iH6KTe2_rRBX; Mon, 15 May 2017 19:31:59 +0000 (UTC) Subject: Re: svn commit: r318313 - head/libexec/rtld-elf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 0FD5966B4 To: Konstantin Belousov References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> <20170515192944.GI1622@kib.kiev.ua> Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <0b218455-d104-04be-d133-285f81d93456@FreeBSD.org> Date: Mon, 15 May 2017 12:32:02 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170515192944.GI1622@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FFLTjE6i9bxfXR2VegpjnuIwKpGNemOk6" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:32:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FFLTjE6i9bxfXR2VegpjnuIwKpGNemOk6 Content-Type: multipart/mixed; boundary="frbo5V5UHc3GFGXi1RewG7rIUQqtDnV22"; protected-headers="v1" From: Bryan Drewery To: Konstantin Belousov Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0b218455-d104-04be-d133-285f81d93456@FreeBSD.org> Subject: Re: svn commit: r318313 - head/libexec/rtld-elf References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> <20170515192944.GI1622@kib.kiev.ua> In-Reply-To: <20170515192944.GI1622@kib.kiev.ua> --frbo5V5UHc3GFGXi1RewG7rIUQqtDnV22 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 5/15/2017 12:29 PM, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 12:25:20PM -0700, Bryan Drewery wrote: >> On 5/15/2017 12:00 PM, Konstantin Belousov wrote: >>> On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: >>>> On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov wrote:= >>>>> New Revision: 318313 >>>>> URL: https://svnweb.freebsd.org/changeset/base/318313 >>>>> >>>>> Log: >>>>> Make ld-elf.so.1 directly executable. >>>> >>>> Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod = +x >>>> /bin/chmod would now be possible on FreeBSD as well? >>> Yes. >>> >>>> Does this have any security implications? >>> What do you mean ? >>> >> >> I think for 3rd-party distributions it may be a problem. At the very >> least it needs to be communicated clearly in release notes or UPDATING= =2E >> >> Consider a downstream vendor who has support for signed binary >> executions. If rtld allows a backdoor around exec(2) to run an unsign= ed >> binary, that could be a problem for them. It is on them to add suppor= t >> to exec(2) to validate the special case of execing rtld with an >> argument, or to just disable the feature in rtld from this commit. >=20 > Note the undocumented O_VERIFY flag in open(2) from the patch. > This is very vendor-ish addition to request veriexec (?). >=20 Ah nice. --=20 Regards, Bryan Drewery --frbo5V5UHc3GFGXi1RewG7rIUQqtDnV22-- --FFLTjE6i9bxfXR2VegpjnuIwKpGNemOk6 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 iQEcBAEBAgAGBQJZGgIyAAoJEDXXcbtuRpfPdnwH/2VQ2VMruk95NA49BgiHdEht /3/JhEHZfzLUjDlddARy5EqvILWP3TqNFgqpxKTAxxEea4KtOtBQaWUN6BVpz3x0 OkX/RlnWutl47vXf1u3sza+aJI5zjTxLBbzjCsrZclhrniVD7FdpROO751mk5KHZ 5uAKdurlQ6FKtiHr1n/nofti4/Bi/LGXKZC652a85cqmteZxcbvuEbeDbI0xuWEE l0hUBwuJLVxGmhk2GJ0d+t6xT4dFEkrhtiNb9Fjlx9uzHppTbNbdQhIF5QWRwdyh fCvQBMm/kLTgZEo5qPg6T3GViQl/8WOrQTBQ9XY8IgWZ+T4cDPmR+9kaeFjCduM= =cXXj -----END PGP SIGNATURE----- --FFLTjE6i9bxfXR2VegpjnuIwKpGNemOk6-- From owner-svn-src-head@freebsd.org Mon May 15 19:32:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7810D6E8F2; Mon, 15 May 2017 19:32:27 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 9973615C8; Mon, 15 May 2017 19:32:27 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FJWQEa092470; Mon, 15 May 2017 19:32:26 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FJWQ16092469; Mon, 15 May 2017 19:32:26 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201705151932.v4FJWQ16092469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Mon, 15 May 2017 19:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318314 - head/lib/libc/sys X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 19:32:27 -0000 Author: stevek Date: Mon May 15 19:32:26 2017 New Revision: 318314 URL: https://svnweb.freebsd.org/changeset/base/318314 Log: Add information to open(2) man page about the O_VERIFY flag. Reviewed by: bjk wblock Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Modified: head/lib/libc/sys/open.2 Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Mon May 15 18:48:58 2017 (r318313) +++ head/lib/libc/sys/open.2 Mon May 15 19:32:26 2017 (r318314) @@ -141,6 +141,7 @@ O_NOCTTY ignored O_TTY_INIT ignored O_DIRECTORY error if file is not a directory O_CLOEXEC set FD_CLOEXEC upon open +O_VERIFY verify the contents of the file .Ed .Pp Opening a file with @@ -259,6 +260,15 @@ may be used to set .Dv FD_CLOEXEC flag for the newly returned file descriptor. .Pp +.Dv O_VERIFY +may be used to indicate to the kernel that the contents of the file should +be verified before allowing the open to proceed. +The details of what +.Dq verified +means is implementation specific. +The run-time linker (rtld) uses this flag to ensure shared objects have +been verified before operating on them. +.Pp If successful, .Fn open returns a non-negative integer, termed a file descriptor. From owner-svn-src-head@freebsd.org Mon May 15 19:36:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 544CCD6EB1A; Mon, 15 May 2017 19:36:10 +0000 (UTC) (envelope-from danfe@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 2FF9E17F5; Mon, 15 May 2017 19:36:10 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 53E301C64; Mon, 15 May 2017 19:36:09 +0000 (UTC) Date: Mon, 15 May 2017 19:36:09 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515193609.GC28684@FreeBSD.org> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515192529.GH1622@kib.kiev.ua> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:36:10 -0000 On Mon, May 15, 2017 at 10:25:29PM +0300, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > > Well, for example, it seems like it would allow anyone to execute a > > binary even if the sysadmin had set it to -x specifically to prevent > > people from running it. > > The direct mode does not (and cannot) honor set{u,g}id modes of the > executable, so any binary run this way would only exercise the existing > power of the user which did it. > > The most advanced explanation that I was given in private was among > the lines: "if you have an environment where users can upload content > to a shared server, but have no access to chmod(2), no compilers, no > scripting languages, etc." The person then admitted that (s)he does not > consider it as an actual concern. Would this now allow executing binaries (with or without +x bit) from filesystems mounted with -o noexec? ./danfe From owner-svn-src-head@freebsd.org Mon May 15 19:37:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1E2CD6EBAC; Mon, 15 May 2017 19:37:17 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (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 7D8E71971; Mon, 15 May 2017 19:37:17 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from [10.11.0.121] (webassign-to-rtp-ip-asr-gw.ncren.net [128.109.111.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id CD720239591; Mon, 15 May 2017 15:37:15 -0400 (EDT) Subject: Re: svn commit: r318313 - head/libexec/rtld-elf To: Bryan Drewery , Konstantin Belousov Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> <20170515192944.GI1622@kib.kiev.ua> <0b218455-d104-04be-d133-285f81d93456@FreeBSD.org> From: Nikolai Lifanov Message-ID: Date: Mon, 15 May 2017 15:37:09 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <0b218455-d104-04be-d133-285f81d93456@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wxpbxHpui1EHqFIxTKLwQm0W5e7lPaDEp" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:37:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wxpbxHpui1EHqFIxTKLwQm0W5e7lPaDEp Content-Type: multipart/mixed; boundary="L2P74aJ3UV0PVmaSOjNsF8arptAjATXCA"; protected-headers="v1" From: Nikolai Lifanov To: Bryan Drewery , Konstantin Belousov Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Message-ID: Subject: Re: svn commit: r318313 - head/libexec/rtld-elf References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> <20170515192944.GI1622@kib.kiev.ua> <0b218455-d104-04be-d133-285f81d93456@FreeBSD.org> In-Reply-To: <0b218455-d104-04be-d133-285f81d93456@FreeBSD.org> --L2P74aJ3UV0PVmaSOjNsF8arptAjATXCA Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05/15/2017 15:32, Bryan Drewery wrote: > On 5/15/2017 12:29 PM, Konstantin Belousov wrote: >> On Mon, May 15, 2017 at 12:25:20PM -0700, Bryan Drewery wrote: >>> On 5/15/2017 12:00 PM, Konstantin Belousov wrote: >>>> On Mon, May 15, 2017 at 06:52:36PM +0000, Alexey Dokuchaev wrote: >>>>> On Mon, May 15, 2017 at 06:48:58PM +0000, Konstantin Belousov wrote= : >>>>>> New Revision: 318313 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/318313 >>>>>> >>>>>> Log: >>>>>> Make ld-elf.so.1 directly executable. >>>>> >>>>> Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod= +x >>>>> /bin/chmod would now be possible on FreeBSD as well? >>>> Yes. >>>> >>>>> Does this have any security implications? >>>> What do you mean ? >>>> >>> >>> I think for 3rd-party distributions it may be a problem. At the very >>> least it needs to be communicated clearly in release notes or UPDATIN= G. >>> >>> Consider a downstream vendor who has support for signed binary >>> executions. If rtld allows a backdoor around exec(2) to run an unsig= ned >>> binary, that could be a problem for them. It is on them to add suppo= rt >>> to exec(2) to validate the special case of execing rtld with an >>> argument, or to just disable the feature in rtld from this commit. >> >> Note the undocumented O_VERIFY flag in open(2) from the patch. >> This is very vendor-ish addition to request veriexec (?). >> >=20 > Ah nice. >=20 Note, this already does the right thing with noexec filesystems: # zfs create -o mountpoint=3D/mnt -o exec=3Doff tank/TEST # cp /bin/sh /mnt/ # /mnt/sh /mnt/sh: Permission denied. # /libexec/ld-elf.so.1 /mnt/sh /mnt/sh: mmap of data failed: Permission denied - Nikolai Lifanov --L2P74aJ3UV0PVmaSOjNsF8arptAjATXCA-- --wxpbxHpui1EHqFIxTKLwQm0W5e7lPaDEp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKoBAEBCgCSFiEE5oT6TcuaWvG5gtjzZ6sv56ecR0UFAlkaA2VfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU2 ODRGQTREQ0I5QTVBRjFCOTgyRDhGMzY3QUIyRkU3QTc5QzQ3NDUUHGxpZmFub3ZA ZnJlZWJzZC5vcmcACgkQZ6sv56ecR0VWPg/+Nn3OU1exF6WEhB7owrUnjU726A3R fJmkbgueDgPPqUGI5cktj1/FwG+C8iZsN25FL9CYAjDYUhkk1hEFOWMrY5aQl3qo N6gDe1FfoM8bbrrhNk21VnelPkNWfnh0Xr3Jd213HkKMxtCR1kGLri0fShnv3sqM TqrREVNSAZ1wVHVuudtv8+UAPco6rQ80owzPP+5vVeiMeRssSVNnM9NQKZ8D8UpI gCRshG8G4TeDbLcW7MZGzUNJ7RR+rxJrhJqtBzGrCjc7W8coTLHdRz3Ab4yJfNFg ST+/Ey8w/NXYJJXE46bhQoP7//KHrp6j5maj9qCEW+g+Y4fbnFJetfwoDcQdKMUs ag/4f6So+Cvn9MfM71S2iOl8iUJqYT9X6X2bXLW4qjlHVYtAgVebQzLqRKwodQAT yaoV41PG4bs9BfSEkXqM7bBJprJbLyohlkNOXMclg/n3pbXX7+nvQ4uBzk3vIEF7 cT0x1YNf+5NST9qPHGzw0xA+addQhB7u73hIApWxn864H+/n6XLikKmNDdHt6C7B fVGllzrQwhLAuirz3B1SLFg3d+4JqNbFmW+5Cji8iCoSeVQyKYVmc1xtf3uq7Ug6 6coz/hLkao2oZqH5FpSeAJCKPcnU3qRJ+B9I7aNc1iVjeyokeNWmK2f0/oXbScQy 1jKXcOcN+2Cir2U= =Rl6+ -----END PGP SIGNATURE----- --wxpbxHpui1EHqFIxTKLwQm0W5e7lPaDEp-- From owner-svn-src-head@freebsd.org Mon May 15 19:37:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 417ABD6EC17; Mon, 15 May 2017 19:37:44 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (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 2007F1AC9; Mon, 15 May 2017 19:37:44 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from [10.11.0.121] (webassign-to-rtp-ip-asr-gw.ncren.net [128.109.111.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 6651D239431; Mon, 15 May 2017 15:37:43 -0400 (EDT) Subject: Re: svn commit: r318313 - head/libexec/rtld-elf To: Alexey Dokuchaev , Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> <20170515193609.GC28684@FreeBSD.org> From: Nikolai Lifanov Message-ID: Date: Mon, 15 May 2017 15:37:42 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170515193609.GC28684@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uOHMxvRmxjSE6aXADTnL36hrp0cTlkFVj" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:37:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uOHMxvRmxjSE6aXADTnL36hrp0cTlkFVj Content-Type: multipart/mixed; boundary="hoRJptTirN5Wea25lBaCMtmJ3ldXQq2ni"; protected-headers="v1" From: Nikolai Lifanov To: Alexey Dokuchaev , Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore Message-ID: Subject: Re: svn commit: r318313 - head/libexec/rtld-elf References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> <20170515193609.GC28684@FreeBSD.org> In-Reply-To: <20170515193609.GC28684@FreeBSD.org> --hoRJptTirN5Wea25lBaCMtmJ3ldXQq2ni Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05/15/2017 15:36, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 10:25:29PM +0300, Konstantin Belousov wrote: >> On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: >>> Well, for example, it seems like it would allow anyone to execute a >>> binary even if the sysadmin had set it to -x specifically to prevent >>> people from running it. >> >> The direct mode does not (and cannot) honor set{u,g}id modes of the >> executable, so any binary run this way would only exercise the existin= g >> power of the user which did it. >> >> The most advanced explanation that I was given in private was among >> the lines: "if you have an environment where users can upload content >> to a shared server, but have no access to chmod(2), no compilers, no >> scripting languages, etc." The person then admitted that (s)he does no= t >> consider it as an actual concern. >=20 > Would this now allow executing binaries (with or without +x bit) from > filesystems mounted with -o noexec? >=20 > ./danfe No: # zfs create -o mountpoint=3D/mnt -o exec=3Doff tank/TEST # cp /bin/sh /mnt/ # /mnt/sh /mnt/sh: Permission denied. # /libexec/ld-elf.so.1 /mnt/sh /mnt/sh: mmap of data failed: Permission denied - Nikolai Lifanov --hoRJptTirN5Wea25lBaCMtmJ3ldXQq2ni-- --uOHMxvRmxjSE6aXADTnL36hrp0cTlkFVj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKoBAEBCgCSFiEE5oT6TcuaWvG5gtjzZ6sv56ecR0UFAlkaA4ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU2 ODRGQTREQ0I5QTVBRjFCOTgyRDhGMzY3QUIyRkU3QTc5QzQ3NDUUHGxpZmFub3ZA ZnJlZWJzZC5vcmcACgkQZ6sv56ecR0U5phAAmRmHq9fmuJTe5tMECuYmixKCCnj6 kvNIU7kY2ZV4Um8UqISKEZHmpEDd8pJf288gkIGG06UPsrOwWWU/VJ8XIuF8bjii pVV4SMzW2aY4P6qKf1COHc1oFuhkrdZj6R9FsxOqdpyRwRk+79/DOG/6YcWXAK4f kb/4ylKnBbxPNmAWc96m6WD6n/b/Sn15ael4M80d/JJNMmzOik25AvUJIsCDVJFT 1jPmegEm2nh7hbiiqQSP86FbBbYy0+Z48imnsKyiw87V16/bu73jPRmJHnr7xnD/ nyElKNsJIfwKgRVcGEybCw1oKtT7jFikvUeJdVGmoLeS/LWAkp376Ll4LdHoqDIG aqub7XshH4qglivxl2qmuUsjXhYLegY2x0LZzYQ218UCTXRvLs6uUcseTE9r/shi NyEei3t68Cm1m7NZFJ1q9M5ceMcoa9QmseMEos6kX0A8SFK9ZCT1WBm1WxZAzyYG rPfXBLNSFxTciQLPHoHoCZZu1vYClhtLg2lPpBsIVWX3s2kBlDdJgJDMA6yey//g oUyWEmcRF3XkqMLNmCzH2CL7BcJ/IR9N3KF+ACY5IhMFhDzkO9ZUYNHlhcR9Dgsu NjlHppkcmrqBN7PdHcA1dAfuW1YwYfBFkkOayEoj6PMVzyZklvoYKL8Z4mvTfvtg LQAv3WBx8GMInyk= =35s1 -----END PGP SIGNATURE----- --uOHMxvRmxjSE6aXADTnL36hrp0cTlkFVj-- From owner-svn-src-head@freebsd.org Mon May 15 19:40:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 676E2D6ECDB; Mon, 15 May 2017 19:40:11 +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 47A9E1D56; Mon, 15 May 2017 19:40:11 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 701D420AE; Mon, 15 May 2017 19:40:10 +0000 (UTC) Date: Mon, 15 May 2017 19:40:10 +0000 From: Alexey Dokuchaev To: Nikolai Lifanov Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515194010.GD28684@FreeBSD.org> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> <20170515193609.GC28684@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:40:11 -0000 On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: > On 05/15/2017 15:36, Alexey Dokuchaev wrote: > > On Mon, May 15, 2017 at 10:25:29PM +0300, Konstantin Belousov wrote: > >> ... > >> The most advanced explanation that I was given in private was among > >> the lines: "if you have an environment where users can upload content > >> to a shared server, but have no access to chmod(2), no compilers, no > >> scripting languages, etc." The person then admitted that (s)he does not > >> consider it as an actual concern. > > > > Would this now allow executing binaries (with or without +x bit) from > > filesystems mounted with -o noexec? > > No: > > # zfs create -o mountpoint=/mnt -o exec=off tank/TEST > # cp /bin/sh /mnt/ > # /mnt/sh > /mnt/sh: Permission denied. > # /libexec/ld-elf.so.1 /mnt/sh > /mnt/sh: mmap of data failed: Permission denied Good, thanks for conducting this test Nikolai. ./danfe From owner-svn-src-head@freebsd.org Mon May 15 19:40:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0E1DD6EE8D; Mon, 15 May 2017 19:40:54 +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 217A81F10; Mon, 15 May 2017 19:40:53 +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 v4FJenI3004804 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 May 2017 22:40:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4FJenI3004804 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4FJenlb004803; Mon, 15 May 2017 22:40:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 May 2017 22:40:49 +0300 From: Konstantin Belousov To: Nikolai Lifanov Cc: Alexey Dokuchaev , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515194049.GJ1622@kib.kiev.ua> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> <20170515193609.GC28684@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) 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.23 Precedence: list List-Id: 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, 15 May 2017 19:40:54 -0000 On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: > On 05/15/2017 15:36, Alexey Dokuchaev wrote: > > On Mon, May 15, 2017 at 10:25:29PM +0300, Konstantin Belousov wrote: > >> On Mon, May 15, 2017 at 01:08:55PM -0600, Ian Lepore wrote: > >>> Well, for example, it seems like it would allow anyone to execute a > >>> binary even if the sysadmin had set it to -x specifically to prevent > >>> people from running it. > >> > >> The direct mode does not (and cannot) honor set{u,g}id modes of the > >> executable, so any binary run this way would only exercise the existing > >> power of the user which did it. > >> > >> The most advanced explanation that I was given in private was among > >> the lines: "if you have an environment where users can upload content > >> to a shared server, but have no access to chmod(2), no compilers, no > >> scripting languages, etc." The person then admitted that (s)he does not > >> consider it as an actual concern. > > > > Would this now allow executing binaries (with or without +x bit) from > > filesystems mounted with -o noexec? > > > > ./danfe > > No: > > # zfs create -o mountpoint=/mnt -o exec=off tank/TEST > # cp /bin/sh /mnt/ > # /mnt/sh > /mnt/sh: Permission denied. > # /libexec/ld-elf.so.1 /mnt/sh > /mnt/sh: mmap of data failed: Permission denied This is due to r313967 | kib | 2017-02-19 22:51:04 +0200 (Sun, 19 Feb 2017) | 24 lines Apply noexec mount option for mmap(PROT_EXEC). From owner-svn-src-head@freebsd.org Mon May 15 19:42:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 300B2D6E04D; Mon, 15 May 2017 19:42:24 +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 0CCD87B6; Mon, 15 May 2017 19:42:24 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 344C82503; Mon, 15 May 2017 19:42:23 +0000 (UTC) Date: Mon, 15 May 2017 19:42:23 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: Nikolai Lifanov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515194223.GE28684@FreeBSD.org> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> <20170515193609.GC28684@FreeBSD.org> <20170515194049.GJ1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515194049.GJ1622@kib.kiev.ua> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:42:24 -0000 On Mon, May 15, 2017 at 10:40:49PM +0300, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: > > On 05/15/2017 15:36, Alexey Dokuchaev wrote: > > > ... > > > Would this now allow executing binaries (with or without +x bit) from > > > filesystems mounted with -o noexec? > > > > No: > > > > # zfs create -o mountpoint=/mnt -o exec=off tank/TEST > > # cp /bin/sh /mnt/ > > # /mnt/sh > > /mnt/sh: Permission denied. > > # /libexec/ld-elf.so.1 /mnt/sh > > /mnt/sh: mmap of data failed: Permission denied > > This is due to > r313967 | kib | 2017-02-19 22:51:04 +0200 (Sun, 19 Feb 2017) | 24 lines > Apply noexec mount option for mmap(PROT_EXEC). Nice, good to know that. ./danfe From owner-svn-src-head@freebsd.org Mon May 15 19:52:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FE8D6E302; Mon, 15 May 2017 19:52: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 44FD3E5F; Mon, 15 May 2017 19:52:41 +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 v4FJqaVl007300 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 May 2017 22:52:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4FJqaVl007300 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4FJqaQm007299; Mon, 15 May 2017 22:52:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 May 2017 22:52:36 +0300 From: Konstantin Belousov To: Alexey Dokuchaev Cc: Nikolai Lifanov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515195236.GK1622@kib.kiev.ua> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> <20170515193609.GC28684@FreeBSD.org> <20170515194049.GJ1622@kib.kiev.ua> <20170515194223.GE28684@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515194223.GE28684@FreeBSD.org> User-Agent: Mutt/1.8.2 (2017-04-18) 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.23 Precedence: list List-Id: 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, 15 May 2017 19:52:42 -0000 On Mon, May 15, 2017 at 07:42:23PM +0000, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 10:40:49PM +0300, Konstantin Belousov wrote: > > On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: > > > On 05/15/2017 15:36, Alexey Dokuchaev wrote: > > > > ... > > > > Would this now allow executing binaries (with or without +x bit) from > > > > filesystems mounted with -o noexec? > > > > > > No: > > > > > > # zfs create -o mountpoint=/mnt -o exec=off tank/TEST > > > # cp /bin/sh /mnt/ > > > # /mnt/sh > > > /mnt/sh: Permission denied. > > > # /libexec/ld-elf.so.1 /mnt/sh > > > /mnt/sh: mmap of data failed: Permission denied > > > > This is due to > > r313967 | kib | 2017-02-19 22:51:04 +0200 (Sun, 19 Feb 2017) | 24 lines > > Apply noexec mount option for mmap(PROT_EXEC). > > Nice, good to know that. [Replying to random mail in thread] I tried this on an up to date latest Fedora installation: [kostik@sandy ~]$ cp /bin/ls /tmp [kostik@sandy ~]$ chmod a-x /tmp/ls [kostik@sandy ~]$ /lib64/ld-linux-x86-64.so.2 /tmp/ls Dropbox intel tmp work I am not sure about one detail, the /tmp/ls file has some security context on it, but I do not believe that it may affect the outcome of the experiment. Please correct me if I am wrong. From owner-svn-src-head@freebsd.org Mon May 15 19:55:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81819D6E3C6; Mon, 15 May 2017 19:55:25 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (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 6151210C8; Mon, 15 May 2017 19:55:25 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from [10.11.0.121] (webassign-to-rtp-ip-asr-gw.ncren.net [128.109.111.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 971A7239431; Mon, 15 May 2017 15:55:23 -0400 (EDT) Subject: Re: svn commit: r318313 - head/libexec/rtld-elf To: Konstantin Belousov , Alexey Dokuchaev Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> <20170515193609.GC28684@FreeBSD.org> <20170515194049.GJ1622@kib.kiev.ua> <20170515194223.GE28684@FreeBSD.org> <20170515195236.GK1622@kib.kiev.ua> From: Nikolai Lifanov Message-ID: <78f83a15-86b0-763f-a122-5344b90c0e17@FreeBSD.org> Date: Mon, 15 May 2017 15:55:15 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170515195236.GK1622@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GHd0lrCCF0cpSSiIcr28B8a7aQdQ4wfIk" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 19:55:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GHd0lrCCF0cpSSiIcr28B8a7aQdQ4wfIk Content-Type: multipart/mixed; boundary="vCPRM0dSJ6FVFnw2D991D7ghMjfI05VMD"; protected-headers="v1" From: Nikolai Lifanov To: Konstantin Belousov , Alexey Dokuchaev Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore Message-ID: <78f83a15-86b0-763f-a122-5344b90c0e17@FreeBSD.org> Subject: Re: svn commit: r318313 - head/libexec/rtld-elf References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <1494875335.59865.118.camel@freebsd.org> <20170515192529.GH1622@kib.kiev.ua> <20170515193609.GC28684@FreeBSD.org> <20170515194049.GJ1622@kib.kiev.ua> <20170515194223.GE28684@FreeBSD.org> <20170515195236.GK1622@kib.kiev.ua> In-Reply-To: <20170515195236.GK1622@kib.kiev.ua> --vCPRM0dSJ6FVFnw2D991D7ghMjfI05VMD Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05/15/2017 15:52, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 07:42:23PM +0000, Alexey Dokuchaev wrote: >> On Mon, May 15, 2017 at 10:40:49PM +0300, Konstantin Belousov wrote: >>> On Mon, May 15, 2017 at 03:37:42PM -0400, Nikolai Lifanov wrote: >>>> On 05/15/2017 15:36, Alexey Dokuchaev wrote: >>>>> ... >>>>> Would this now allow executing binaries (with or without +x bit) fr= om >>>>> filesystems mounted with -o noexec? >>>> >>>> No: >>>> >>>> # zfs create -o mountpoint=3D/mnt -o exec=3Doff tank/TEST >>>> # cp /bin/sh /mnt/ >>>> # /mnt/sh >>>> /mnt/sh: Permission denied. >>>> # /libexec/ld-elf.so.1 /mnt/sh >>>> /mnt/sh: mmap of data failed: Permission denied >>> >>> This is due to >>> r313967 | kib | 2017-02-19 22:51:04 +0200 (Sun, 19 Feb 2017) | 24 lin= es >>> Apply noexec mount option for mmap(PROT_EXEC). >> >> Nice, good to know that. >=20 > [Replying to random mail in thread] >=20 > I tried this on an up to date latest Fedora installation: > [kostik@sandy ~]$ cp /bin/ls /tmp > [kostik@sandy ~]$ chmod a-x /tmp/ls > [kostik@sandy ~]$ /lib64/ld-linux-x86-64.so.2 /tmp/ls > Dropbox intel tmp work >=20 > I am not sure about one detail, the /tmp/ls file has some security cont= ext > on it, but I do not believe that it may affect the outcome of the exper= iment. > Please correct me if I am wrong. >=20 This is because /tmp is exec. On Linux it does the same thing: # mount -t tmpfs none -o noexec,mode=3D1777 /mnt # cp /bin/bash /mnt/ # /lib64/ld-linux-x86-64.so.2 /mnt/bash /mnt/bash: error while loading shared libraries: /mnt/bash: failed to map segment from shared object: Operation not permitted - Nikolai Lifanov --vCPRM0dSJ6FVFnw2D991D7ghMjfI05VMD-- --GHd0lrCCF0cpSSiIcr28B8a7aQdQ4wfIk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKoBAEBCgCSFiEE5oT6TcuaWvG5gtjzZ6sv56ecR0UFAlkaB6NfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU2 ODRGQTREQ0I5QTVBRjFCOTgyRDhGMzY3QUIyRkU3QTc5QzQ3NDUUHGxpZmFub3ZA ZnJlZWJzZC5vcmcACgkQZ6sv56ecR0WAaQ/8CWEpIDWPtbhWsb143JM9kZGheHb4 DM36ywJLSEuZYX9jOBw0iL1GRmc1qpfWJkFNQt1MrAmzMihgoMzQqMEi43V9frAM rTX1oKNOz11bN0XB+SzGvTeJnPYEYbolaDITGgwOVtQ/ixkiSzFAZw3kXhlV4UUy kTQmJnnBpVHP54dFgjBFYXxNJcrJIm/kC8Q652ruxpU4QbYM6rZmDR85k2iNPf3l MI7ke1M/2M9ZvPDjYZNEgMv6hBPDT44D8/ZfZyDK+T9Pqb+cH2hnuKu25W83Fmzt /5JcGfJo0E7oLnm7Z3bgezN9USISgDL4vJriLAX4GGq0IiNrCn3tbwBXGwtbqPy2 wTIFsyeoGc4ZJZh5Pe571weamrMbgZ95wsPz/elAvf/uTQrmeiH5R2CgPNNhKnLQ 73K78UL+23EaeXGliwnsVjReUqWahARZzoDIy2eQtkhuiGuLOSAngCrbgzPOIygh M5+iuaxrWZP/DVaS/Ie7XzJDd7Rg/A70Hn77YfErO70REA9vVqdI9Svb7i5ZQP1M n5bWKqN+aY6zvdjrF0pirX4d/gq8Ad1+SS5TYnhru9+NCx5GU7hw9nBSq+tRhmtt o2TBaa/AqIdsOGY5w8nes1JN1bFzEmtCYK9fVV/q2ol1o25DQYFaFPuJk0BvkO5q Fti/73umfs/mlpg= =kCFJ -----END PGP SIGNATURE----- --GHd0lrCCF0cpSSiIcr28B8a7aQdQ4wfIk-- From owner-svn-src-head@freebsd.org Mon May 15 19:58:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EED5AD6E4FB; Mon, 15 May 2017 19:58:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 BEFE212DE; Mon, 15 May 2017 19:58:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FJw1IL001174; Mon, 15 May 2017 19:58:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FJw1jn001173; Mon, 15 May 2017 19:58:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705151958.v4FJw1jn001173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 15 May 2017 19:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318315 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 19:58:03 -0000 Author: ngie Date: Mon May 15 19:58:01 2017 New Revision: 318315 URL: https://svnweb.freebsd.org/changeset/base/318315 Log: lib/libc/gen/realpath_test: make check result from getcwd(3) This is being done to avoid dereferencing a NULL pointer via strlcat, obscuring the underlying issue with the getcwd(3) call. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libc/gen/t_realpath.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_realpath.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_realpath.c Mon May 15 19:32:26 2017 (r318314) +++ head/contrib/netbsd-tests/lib/libc/gen/t_realpath.c Mon May 15 19:58:01 2017 (r318315) @@ -34,6 +34,9 @@ __RCSID("$NetBSD: t_realpath.c,v 1.2 201 #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -122,8 +125,15 @@ ATF_TC_BODY(realpath_symlink, tc) char resb[MAXPATHLEN] = { 0 }; int fd; +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(getcwd(path, sizeof(path)) != NULL, + "getcwd(path) failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(getcwd(slnk, sizeof(slnk)) != NULL, + "getcwd(slnk) failed: %s", strerror(errno)); +#else (void)getcwd(path, sizeof(path)); (void)getcwd(slnk, sizeof(slnk)); +#endif (void)strlcat(path, "/realpath", sizeof(path)); (void)strlcat(slnk, "/symbolic", sizeof(slnk)); From owner-svn-src-head@freebsd.org Mon May 15 20:00:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665A2D6E5DE; Mon, 15 May 2017 20:00:56 +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 483E2151D; Mon, 15 May 2017 20:00:55 +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 v4FK0nS1054534; Mon, 15 May 2017 13:00:49 -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 v4FK0meq054533; Mon, 15 May 2017 13:00:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201705152000.v4FK0meq054533@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r318313 - head/libexec/rtld-elf In-Reply-To: <20170515192326.GB28684@FreeBSD.org> To: Alexey Dokuchaev Date: Mon, 15 May 2017 13:00:48 -0700 (PDT) CC: Nikolai Lifanov , Konstantin Belousov , 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.23 Precedence: list List-Id: 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, 15 May 2017 20:00:56 -0000 > On Mon, May 15, 2017 at 03:09:33PM -0400, Nikolai Lifanov wrote: > > On 05/15/2017 14:52, Alexey Dokuchaev wrote: > > > Does it mean that old Linux' trick of /lib/ld-linux.so.2 /bin/chmod +x > > > /bin/chmod would now be possible on FreeBSD as well? Does this have > > > any security implications? > > > > This is a use case for fixing accidentally hosed /bin/chmod binary and > > not some sort of an escalation thing. You will need to be root to do > > this. > > Because /bin/chmod is owned by root, not because /libexec/ld-elf.so.1 is > limiting execution to root only, or is it (I might have missed uid check > in that patch [1], but at a quick glance I didn't see it). > > On a living system, there are plenty of other ways to restore missing > +x on /bin/chmod as long as you can call chmod(2), from simple Python > script down to manually crafting small binary in hex. Simple tool to get out of this is use of install(8) to "install" your broken chmod to another file with proper modes. And if you lost that one you could use mtree(8) with a easily crafted input file. > > Likewise, with working chmod binary, you should be able to mark > > binaries with write access executable. > > Well, it's not just about chmod(1), this opens what can be a can of worms > and I want to know how big it is. Big.. very very big... and painted Blue! > ./danfe > > [1] Idea for security.bsd.ld_elf_exec_root_only sysctl(8)? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 15 20:11:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E33CD6E941 for ; Mon, 15 May 2017 20:11:56 +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 7FCC31D60 for ; Mon, 15 May 2017 20:11:56 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d205ac75-39aa-11e7-bfb5-0d159cd3c324 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id d205ac75-39aa-11e7-bfb5-0d159cd3c324; Mon, 15 May 2017 20:12:29 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4FKBr7s002029; Mon, 15 May 2017 14:11:53 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1494879113.59865.129.camel@freebsd.org> Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk From: Ian Lepore To: John Baldwin Cc: Warner Losh , Ngie Cooper , "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Mon, 15 May 2017 14:11:53 -0600 In-Reply-To: <4703731.Pl02uSWy7k@ralph.baldwin.cx> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <4703731.Pl02uSWy7k@ralph.baldwin.cx> 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.23 Precedence: list List-Id: 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, 15 May 2017 20:11:56 -0000 On Mon, 2017-05-15 at 12:22 -0700, John Baldwin wrote: > On Monday, May 15, 2017 11:43:21 AM Ian Lepore wrote: > > > > On Mon, 2017-05-15 at 10:13 -0700, John Baldwin wrote: > > > > > > On Saturday, May 13, 2017 10:39:15 AM Warner Losh wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - It's really easy to screw up a mergemaster call if you > > > > > > edit > > > > > > the files, and install the stock version which removes the > > > > > > edits. > > > > > Also, programmatically removing the entries means you have to > > > > > bake the metadata into etc/Makefile, which is already > > > > > complicated > > > > > enough as-is. > > > > Why do you care about removing them at all? They are no-ops if > > > > the > > > > files don't exist. Why not just always install all these files > > > > is > > > > where I'm going with this... > > > I think this is actually the bigger question.  I think it is > > > perfectly > > > sensible to support conf.d/* files for ports to use and as a way > > > to > > > manage logs for application logs on an appliance, etc.  However, > > > this > > > shuffling is a bit of a merge nightmare for anyone using > > > mergemaster > > > or etcupdate, and the biggest cost is that newsyslog will create > > > a > > > one-line file in /var/log for entries with 'C'. > > > > > That's only a good argument for keeping the lines in the monolithic > > file if those lines will be ignored when a file in the .conf.d > > directory provides conflicting config.  Otherwise my embedded > > product > > that drops different rules for rotating /var/log/messages into > > .conf.d > > STILL has to programmatically edit the monolithic file to remove > > the > > standard rule(s). > Now you have to programmatically edit the file in > conf.d/foo.  However, > by this argument the monolithic conf file shouldn't even exist.  The > current approach is a half-way mix with the worst of both models it > seems. > Programmatically editing a single file containing only config for a single component typically means just rewriting the entire file with your new contents.  In particular, you don't need to attempt to preserve other information, the format of which you may not even know, including free-form comments and who knows what-else. > Also, _you_ could just splat an empty /etc/newsyslog.conf file on > your > appliance and create a bunch of conf.d/foo files if that is easier > for > you to use on an appliance.  The files we ship in a release aren't > really > tailored for an appliance (I've yet to see an appliance that doesn't > use > a FooBSD with local patches).  OTOH, the existing setup is probably > simpler to manage for an out-of-the-box install. > > I'm also suprised you don't manage the newsyslog.conf file yourself > rather than trying to edit and merge in upstream changes?  That is, I > can see a few approaches: > You seem to be picturing some sort of etcupdate kind of thing.  I'm more talking about a GUI or other config-management tool within an embedded product that has to edit or rewrite configuration on the fly based on user choices. Of course, separate files does also simplify the update process, for the most part.  If a new subsystem is added in a new freebsd release, I have zero work to do to upgrade a system in the field if that new subsystem just drops a new file into a .conf.d directory.  If it has new entries in a monolithic file, then I do have to do some sort of merge/edit operation. > 1) Keep your real newsyslog.conf / syslogd.conf files in your > FooBSD's >    VCS and when newsyslog.conf changes upstream you merge that in the >    way you normally merge changes. > > 2) Move the "vendor" newsyslog.conf out entirely and install your own >    versions of these files either as a monolithic assembled by config >    management rules or a bunch of conf.d/foo files (here I would > probably >    opt for separate files). > > However, your approach doesn't seem to describe either of these since > this commit doesn't impact those work flows (if 1), you would have > already > made any local changes you need and if anything merging this commit > gives > you the kind of merge conflicts people will get on the next > mergemaster / > etcupdate for non-appliance boxes, or if 2) you ignore these files) > This seems to be an argument for everyone doing for themselves the operation of splitting the distributed monolithic file into finer grained files, and re-performing that operation (or at least the analysis part of it) on every update. In general a lot of this feels like "I only needed 6 big config files to control my whole system in 1988, and so I should only need those same 6 files now."  Sure, all us old-timers have the finger memory for editing rc.conf and syslog.conf and so on, but how often do you crack open syslog.conf with the plan of editing 12 different lines in it at once?  Because the main objection to .conf.d directories seems to be that there are more files to edit, and that just doesn't feel like a big problem in actual daily use. -- Ian From owner-svn-src-head@freebsd.org Mon May 15 20:18:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D007D6EC96; Mon, 15 May 2017 20:18:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7A2CACF; Mon, 15 May 2017 20:18:15 +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 v4FKIETu009427; Mon, 15 May 2017 20:18:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FKIE99009425; Mon, 15 May 2017 20:18:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705152018.v4FKIE99009425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 May 2017 20:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318316 - head/usr.bin/uniq X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 20:18:15 -0000 Author: emaste Date: Mon May 15 20:18:14 2017 New Revision: 318316 URL: https://svnweb.freebsd.org/changeset/base/318316 Log: uniq: allow -c to be used with -d or -u Bring in some bits from NetBSD and lift the restriction in uniq(1) that -c cannot be used with the -d and -u options. This restriction seems unnecessary and is supported at least by GNU, OpenBSD, and NetBSD. Lift the restriction and simplify the show() logic a little bit to maintain functionality when -c is provided with -d/-u. Also with this change, -d and -u are now actually a mutually exclusive, albeit valid, combination. Given that they both indicate opposite behavior, uniq(1) will no longer output anything if both -d and -u are supplied. This is in line with NetBSD as well as GNU. Adjust the man page and usage() to reflect that -c is its own standalone option. PR: 200553 Submitted by: Kyle Evans Reviewed by: cem, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10694 Modified: head/usr.bin/uniq/uniq.1 head/usr.bin/uniq/uniq.c Modified: head/usr.bin/uniq/uniq.1 ============================================================================== --- head/usr.bin/uniq/uniq.1 Mon May 15 19:58:01 2017 (r318315) +++ head/usr.bin/uniq/uniq.1 Mon May 15 20:18:14 2017 (r318316) @@ -31,7 +31,7 @@ .\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 17, 2009 +.Dd May 15, 2017 .Dt UNIQ 1 .Os .Sh NAME @@ -39,7 +39,8 @@ .Nd report or filter out repeated lines in a file .Sh SYNOPSIS .Nm -.Op Fl c | Fl d | Fl u +.Op Fl c +.Op Fl d | Fl u .Op Fl i .Op Fl f Ar num .Op Fl s Ar chars Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Mon May 15 19:58:01 2017 (r318315) +++ head/usr.bin/uniq/uniq.c Mon May 15 20:18:14 2017 (r318316) @@ -129,13 +129,6 @@ main (int argc, char *argv[]) argc -= optind; argv += optind; - /* If no flags are set, default is -d -u. */ - if (cflag) { - if (dflag || uflag) - usage(); - } else if (!dflag && !uflag) - dflag = uflag = 1; - if (argc > 2) usage(); @@ -182,9 +175,6 @@ main (int argc, char *argv[]) } tprev = convert(prevline); - if (!cflag && uflag && dflag) - show(ofp, prevline); - tthis = NULL; while (getline(&thisline, &thisbuflen, ifp) >= 0) { if (tthis != NULL) @@ -200,8 +190,7 @@ main (int argc, char *argv[]) if (comp) { /* If different, print; set previous to new value. */ - if (cflag || !dflag || !uflag) - show(ofp, prevline); + show(ofp, prevline); p = prevline; b1 = prevbuflen; prevline = thisline; @@ -209,8 +198,6 @@ main (int argc, char *argv[]) if (tprev != NULL) free(tprev); tprev = tthis; - if (!cflag && uflag && dflag) - show(ofp, prevline); thisline = p; thisbuflen = b1; tthis = NULL; @@ -220,8 +207,7 @@ main (int argc, char *argv[]) } if (ferror(ifp)) err(1, "%s", ifn); - if (cflag || !dflag || !uflag) - show(ofp, prevline); + show(ofp, prevline); exit(0); } @@ -286,9 +272,11 @@ static void show(FILE *ofp, const char *str) { + if ((dflag && repeats == 0) || (uflag && repeats > 0)) + return; if (cflag) (void)fprintf(ofp, "%4d %s", repeats + 1, str); - if ((dflag && repeats) || (uflag && !repeats)) + else (void)fprintf(ofp, "%s", str); } @@ -351,6 +339,6 @@ static void usage(void) { (void)fprintf(stderr, -"usage: uniq [-c | -d | -u] [-i] [-f fields] [-s chars] [input [output]]\n"); +"usage: uniq [-c] [-d | -u] [-i] [-f fields] [-s chars] [input [output]]\n"); exit(1); } From owner-svn-src-head@freebsd.org Mon May 15 20:20:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED5E5D6EE0D for ; Mon, 15 May 2017 20:20:07 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 896BB64A for ; Mon, 15 May 2017 20:20:07 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: e05c9caa-39ab-11e7-b96e-2378c10e3beb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id e05c9caa-39ab-11e7-b96e-2378c10e3beb; Mon, 15 May 2017 20:20:03 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4FKJukI002046; Mon, 15 May 2017 14:19:56 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1494879596.59865.131.camel@freebsd.org> Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk From: Ian Lepore To: John Baldwin Cc: Warner Losh , Ngie Cooper , "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Mon, 15 May 2017 14:19:56 -0600 In-Reply-To: <1494879113.59865.129.camel@freebsd.org> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <4703731.Pl02uSWy7k@ralph.baldwin.cx> <1494879113.59865.129.camel@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.23 Precedence: list List-Id: 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, 15 May 2017 20:20:08 -0000 On Mon, 2017-05-15 at 14:11 -0600, Ian Lepore wrote: > On Mon, 2017-05-15 at 12:22 -0700, John Baldwin wrote: > > > > On Monday, May 15, 2017 11:43:21 AM Ian Lepore wrote: > > > > > > [...] > > > > Also, _you_ could just splat an empty /etc/newsyslog.conf file on > > your > > appliance and create a bunch of conf.d/foo files if that is easier > > for > > you to use on an appliance.  The files we ship in a release aren't > > really > > tailored for an appliance (I've yet to see an appliance that doesn't > > use > > a FooBSD with local patches).  OTOH, the existing setup is probably > > simpler to manage for an out-of-the-box install. > > > > I'm also suprised you don't manage the newsyslog.conf file yourself > > rather than trying to edit and merge in upstream changes?  That is, I > > can see a few approaches: > > > You seem to be picturing some sort of etcupdate kind of thing.  I'm > more talking about a GUI or other config-management tool within an > embedded product that has to edit or rewrite configuration on the fly > based on user choices. > > Of course, separate files does also simplify the update process, for > the most part.  If a new subsystem is added in a new freebsd release, I > have zero work to do to upgrade a system in the field if that new > subsystem just drops a new file into a .conf.d directory.  If it has > new entries in a monolithic file, then I do have to do some sort of > merge/edit operation. > And just to be clear here, I'm talking about running some kind of merge/edit on the live system being updated in the field, not as part of importing a newer freebsd snapshot into our VCS. -- Ian From owner-svn-src-head@freebsd.org Mon May 15 20:28:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89AD9D6E116; Mon, 15 May 2017 20:28:54 +0000 (UTC) (envelope-from danfe@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 6849CCE7; Mon, 15 May 2017 20:28:54 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 9260A3565; Mon, 15 May 2017 20:28:53 +0000 (UTC) Date: Mon, 15 May 2017 20:28:53 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: John Baldwin , src-committers , Warner Losh , "svn-src-all@freebsd.org" , Ngie Cooper , "svn-src-head@freebsd.org" , Ngie Cooper , "Rodney W. Grimes" Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk Message-ID: <20170515202853.GA88899@FreeBSD.org> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <4703731.Pl02uSWy7k@ralph.baldwin.cx> <1494879113.59865.129.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1494879113.59865.129.camel@freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 20:28:54 -0000 On Mon, May 15, 2017 at 02:11:53PM -0600, Ian Lepore wrote: > ... > In general a lot of this feels like "I only needed 6 big config files > to control my whole system in 1988, and so I should only need those > same 6 files now." Yup; doesn't it feel good? (That's one of our selling points BTW.) > Sure, all us old-timers have the finger memory for editing rc.conf and > syslog.conf and so on, but how often do you crack open syslog.conf with > the plan of editing 12 different lines in it at once? Actually I don't want to open it [newsyslog.conf] at all, and on desktop, where odd things are noticed quickly, default rotation is good enough. I might want to edit it on server to e.g. keep at least one year worth of logs, and when I do, I'd rather edit one file instead of half-dozen. > Because the main objection to .conf.d directories seems to be that > there are more files to edit, and that just doesn't feel like a big > problem in actual daily use. Well, it kind of is. Keeping in mind "same 6 files" is a big helper; for the base you can be sure you won't forget anything accidentally. It is not that easy for ports for obvious reasons, but then again: we are talking about the base only here. ./danfe From owner-svn-src-head@freebsd.org Mon May 15 20:41:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89C00D6E562; Mon, 15 May 2017 20:41:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 429381624; Mon, 15 May 2017 20:41:30 +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 v4FKfTRm019133; Mon, 15 May 2017 20:41:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FKfTd8019132; Mon, 15 May 2017 20:41:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705152041.v4FKfTd8019132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 May 2017 20:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318317 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 20:41:30 -0000 Author: emaste Date: Mon May 15 20:41:29 2017 New Revision: 318317 URL: https://svnweb.freebsd.org/changeset/base/318317 Log: bsdgrep: add more tests for different binary flags The existing 'binary' test in netbsd-tests/ does a basic check of the default treatment for binary behavior, but not much more than that. Given some opportunity for breakage recently that did not trigger any failures, add some tests to cover the three different binary file behaviors (a, -I, -U) and their --binary-files= equivalent values. Submitted by: Kyle Evans Reviewed by: cem, ngie Differential Revision: https://reviews.freebsd.org/D10620 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Mon May 15 20:18:14 2017 (r318316) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Mon May 15 20:41:29 2017 (r318317) @@ -539,6 +539,41 @@ badcontext_body() atf_check -s not-exit:0 -e ignore grep -C "B" "B" test1 } + +atf_test_case binary_flags +binary_flags_head() +{ + atf_set "descr" "Check output for binary flags (-a, -I, -U, --binary-files)" +} +binary_flags_body() +{ + printf "A\000B\000C" > test1 + printf "A\n\000B\n\000C" > test2 + binmatchtext="Binary file test1 matches\n" + + # Binaries not treated as text (default, -U) + atf_check -o inline:"${binmatchtext}" grep 'B' test1 + atf_check -o inline:"${binmatchtext}" grep 'B' -C 1 test1 + + atf_check -o inline:"${binmatchtext}" grep -U 'B' test1 + atf_check -o inline:"${binmatchtext}" grep -U 'B' -C 1 test1 + + # Binary, -a, no newlines + atf_check -o inline:"A\000B\000C\n" grep -a 'B' test1 + atf_check -o inline:"A\000B\000C\n" grep -a 'B' -C 1 test1 + + # Binary, -a, newlines + atf_check -o inline:"\000B\n" grep -a 'B' test2 + atf_check -o inline:"A\n\000B\n\000C\n" grep -a 'B' -C 1 test2 + + # Binary files ignored + atf_check -s exit:1 grep -I 'B' test2 + + # --binary-files equivalence + atf_check -o inline:"${binmatchtext}" grep --binary-files=binary 'B' test1 + atf_check -o inline:"A\000B\000C\n" grep --binary-files=text 'B' test1 + atf_check -s exit:1 grep --binary-files=without-match 'B' test2 +} # End FreeBSD atf_init_test_cases() @@ -573,6 +608,7 @@ atf_init_test_cases() atf_add_test_case egrep_sanity atf_add_test_case grep_sanity atf_add_test_case grep_nomatch_flags + atf_add_test_case binary_flags atf_add_test_case badcontext # End FreeBSD } From owner-svn-src-head@freebsd.org Mon May 15 20:49:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70188D6E6A6 for ; Mon, 15 May 2017 20:49:34 +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 5095119C7 for ; Mon, 15 May 2017 20:49:34 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 1399cc5d-39b0-11e7-bfb5-0d159cd3c324 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 1399cc5d-39b0-11e7-bfb5-0d159cd3c324; Mon, 15 May 2017 20:50:07 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4FKnU9H002102; Mon, 15 May 2017 14:49:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1494881370.59865.140.camel@freebsd.org> Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk From: Ian Lepore To: Alexey Dokuchaev Cc: John Baldwin , src-committers , Warner Losh , "svn-src-all@freebsd.org" , Ngie Cooper , "svn-src-head@freebsd.org" , Ngie Cooper , "Rodney W. Grimes" Date: Mon, 15 May 2017 14:49:30 -0600 In-Reply-To: <20170515202853.GA88899@FreeBSD.org> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <4703731.Pl02uSWy7k@ralph.baldwin.cx> <1494879113.59865.129.camel@freebsd.org> <20170515202853.GA88899@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.23 Precedence: list List-Id: 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, 15 May 2017 20:49:34 -0000 On Mon, 2017-05-15 at 20:28 +0000, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 02:11:53PM -0600, Ian Lepore wrote: > > > > ... > > In general a lot of this feels like "I only needed 6 big config > > files > > to control my whole system in 1988, and so I should only need those > > same 6 files now." > Yup; doesn't it feel good?  (That's one of our selling points BTW.) > > > > > Sure, all us old-timers have the finger memory for editing rc.conf > > and > > syslog.conf and so on, but how often do you crack open syslog.conf > > with > > the plan of editing 12 different lines in it at once? > Actually I don't want to open it [newsyslog.conf] at all, and on > desktop, > where odd things are noticed quickly, default rotation is good > enough. > I might want to edit it on server to e.g. keep at least one year > worth of > logs, and when I do, I'd rather edit one file instead of half-dozen. > > > > > Because the main objection to .conf.d directories seems to be that > > there are more files to edit, and that just doesn't feel like a big > > problem in actual daily use. > Well, it kind of is.  Keeping in mind "same 6 files" is a big helper; > for the base you can be sure you won't forget anything accidentally. > It is not that easy for ports for obvious reasons, but then again: we > are talking about the base only here. > What you're talking about is how YOU view and use base.  That's fine, except that obviously it's only a tiny subset of how all freebsd users view and use base. Besides how I view things as someone who has to create and maintain complex embedded systems with freebsd, as a simple user of freebsd I would much prefer to edit syslog.conf.d/mail than search around in a big syslog.conf file for lines pertaining to mail logging. You acknowledge that the situation is different for ports, so does that mean your objections go away when base becomes packaged and faces the same installation and update issues that packaged ports do?  Because I was under the impression that's coming pretty soon. -- Ian > ./danfe > From owner-svn-src-head@freebsd.org Mon May 15 20:52:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F8CCD6E88C; Mon, 15 May 2017 20:52: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 mx1.freebsd.org (Postfix) with ESMTPS id 2E7131DD3; Mon, 15 May 2017 20:52: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 v4FKqiuw025651; Mon, 15 May 2017 20:52:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FKqiHV025648; Mon, 15 May 2017 20:52:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705152052.v4FKqiHV025648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 May 2017 20:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318318 - in head/sys: amd64/acpica amd64/amd64 x86/acpica X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 20:52:45 -0000 Author: kib Date: Mon May 15 20:52:43 2017 New Revision: 318318 URL: https://svnweb.freebsd.org/changeset/base/318318 Log: Ensure that resume path on amd64 only accesses page tables for normal operation after processor is configured to allow all required features. In particular, NX must be enabled in EFER, otherwise load of page table element with nx bit set causes reserved bit page fault. Since malloc uses direct mapping for small allocations, in particular for the suspension pcbs, and DMAP is nx after r316767, this commit tripped fault on resume path. Restore complete state of EFER while wakeup code is still executing with custom page table, before calling resumectx, instead of trying to guess which features might be needed before resumectx restored EFER on its own. Bisected and tested by: trasz Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/amd64/cpu_switch.S head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Mon May 15 20:41:29 2017 (r318317) +++ head/sys/amd64/acpica/acpi_wakecode.S Mon May 15 20:52:43 2017 (r318318) @@ -156,11 +156,12 @@ wakeup_32: /* * Enable EFER.LME so that we get long mode when all the prereqs are * in place. In this case, it turns on when CR0_PG is finally enabled. - * Pick up a few other EFER bits that we'll use need we're here. + * Also it picks up a few other EFER bits that we'll use need we're + * here, like SYSCALL and NX enable. */ movl $MSR_EFER, %ecx - rdmsr - orl $EFER_LME | EFER_SCE, %eax + movl wakeup_efer - wakeup_start(%ebx), %eax + movl wakeup_efer + 4 - wakeup_start(%ebx), %edx wrmsr /* @@ -276,6 +277,8 @@ wakeup_pcb: .quad 0 wakeup_ret: .quad 0 +wakeup_efer: + .quad 0 wakeup_gdt: .word 0 .quad 0 Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Mon May 15 20:41:29 2017 (r318317) +++ head/sys/amd64/amd64/cpu_switch.S Mon May 15 20:52:43 2017 (r318318) @@ -396,7 +396,7 @@ ENTRY(resumectx) movl 4 + PCB_KGSBASE(%rdi),%edx wrmsr - /* Restore EFER. */ + /* Restore EFER one more time. */ movl $MSR_EFER,%ecx movl PCB_EFER(%rdi),%eax wrmsr Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Mon May 15 20:41:29 2017 (r318317) +++ head/sys/x86/acpica/acpi_wakeup.c Mon May 15 20:52:43 2017 (r318318) @@ -223,7 +223,9 @@ acpi_sleep_machdep(struct acpi_softc *sc WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); -#ifndef __amd64__ +#ifdef __amd64__ + WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); +#else WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); #endif WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); From owner-svn-src-head@freebsd.org Mon May 15 21:09:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95275D6EE3C; Mon, 15 May 2017 21:09:23 +0000 (UTC) (envelope-from danfe@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 717A28EC; Mon, 15 May 2017 21:09:23 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8AAAA403D; Mon, 15 May 2017 21:09:22 +0000 (UTC) Date: Mon, 15 May 2017 21:09:22 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: John Baldwin , src-committers , Warner Losh , "svn-src-all@freebsd.org" , Ngie Cooper , "svn-src-head@freebsd.org" , Ngie Cooper , "Rodney W. Grimes" Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk Message-ID: <20170515210922.GA26702@FreeBSD.org> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <4703731.Pl02uSWy7k@ralph.baldwin.cx> <1494879113.59865.129.camel@freebsd.org> <20170515202853.GA88899@FreeBSD.org> <1494881370.59865.140.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1494881370.59865.140.camel@freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 21:09:23 -0000 On Mon, May 15, 2017 at 02:49:30PM -0600, Ian Lepore wrote: > ... > You acknowledge that the situation is different for ports, so does that > mean your objections go away when base becomes packaged and faces the > same installation and update issues that packaged ports do? Because I > was under the impression that's coming pretty soon. The reason it is different for ports is because we cannot know up-front what software might user have installed and ergo what logs should be rotated by newsyslog(8). For the base, we know these pieces (albeit packaging the base could probably benefit from the same generic approach, if we ever start to support 3rd-party "base" packages). ./danfe From owner-svn-src-head@freebsd.org Mon May 15 21:14:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4312AD6C143; Mon, 15 May 2017 21:14:50 +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 02F48E2D; Mon, 15 May 2017 21:14:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id EDAD910A7DB; Mon, 15 May 2017 17:14:47 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: Warner Losh , Ngie Cooper , "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk Date: Mon, 15 May 2017 14:14:29 -0700 Message-ID: <1767029.V8VxJpCATJ@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <1494879113.59865.129.camel@freebsd.org> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <4703731.Pl02uSWy7k@ralph.baldwin.cx> <1494879113.59865.129.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 15 May 2017 17:14:48 -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.23 Precedence: list List-Id: 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, 15 May 2017 21:14:50 -0000 On Monday, May 15, 2017 02:11:53 PM Ian Lepore wrote: > On Mon, 2017-05-15 at 12:22 -0700, John Baldwin wrote: > > Also, _you_ could just splat an empty /etc/newsyslog.conf file on > > your > > appliance and create a bunch of conf.d/foo files if that is easier > > for > > you to use on an appliance. The files we ship in a release aren't > > really > > tailored for an appliance (I've yet to see an appliance that doesn't > > use > > a FooBSD with local patches). OTOH, the existing setup is probably > > simpler to manage for an out-of-the-box install. > > > > I'm also suprised you don't manage the newsyslog.conf file yourself > > rather than trying to edit and merge in upstream changes? That is, I > > can see a few approaches: > > > > You seem to be picturing some sort of etcupdate kind of thing. I'm > more talking about a GUI or other config-management tool within an > embedded product that has to edit or rewrite configuration on the fly > based on user choices. > > Of course, separate files does also simplify the update process, for > the most part. If a new subsystem is added in a new freebsd release, I > have zero work to do to upgrade a system in the field if that new > subsystem just drops a new file into a .conf.d directory. If it has > new entries in a monolithic file, then I do have to do some sort of > merge/edit operation. But given that the new system now supports both approaches, why wouldn't you always split it up in your product? > > 1) Keep your real newsyslog.conf / syslogd.conf files in your > > FooBSD's > > VCS and when newsyslog.conf changes upstream you merge that in the > > way you normally merge changes. > > > > 2) Move the "vendor" newsyslog.conf out entirely and install your own > > versions of these files either as a monolithic assembled by config > > management rules or a bunch of conf.d/foo files (here I would > > probably > > opt for separate files). > > > > However, your approach doesn't seem to describe either of these since > > this commit doesn't impact those work flows (if 1), you would have > > already > > made any local changes you need and if anything merging this commit > > gives > > you the kind of merge conflicts people will get on the next > > mergemaster / > > etcupdate for non-appliance boxes, or if 2) you ignore these files) > > > > This seems to be an argument for everyone doing for themselves the > operation of splitting the distributed monolithic file into finer > grained files, and re-performing that operation (or at least the > analysis part of it) on every update. s/everbody/appliance vendors/. Not everyone is your use case (nor mine). That said, I would think that the current approach is still the worst of both worlds for you. Now you have a single file you need to edit in some cases and in other cases you generate the single foo.conf file. I don't see why you wouldn't always want to split things up in your product and on the rare chance that the big file changes upstream you alter the default broken-out file in your FooBSD (especially given how rarely these files change). > In general a lot of this feels like "I only needed 6 big config files > to control my whole system in 1988, and so I should only need those > same 6 files now." Sure, all us old-timers have the finger memory for > editing rc.conf and syslog.conf and so on, but how often do you crack > open syslog.conf with the plan of editing 12 different lines in it at > once? Because the main objection to .conf.d directories seems to be > that there are more files to edit, and that just doesn't feel like a > big problem in actual daily use. To be clear, I _don't_ object to conf.d directories and I'm happy to have the tools support both types of configurations. I object to employing a half-way mix of both styles in a way that breaks POLA and causes merge headaches for existing users that are applying these changes as upgrades to existing systems. -- John Baldwin From owner-svn-src-head@freebsd.org Mon May 15 21:28:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CEFD6CA67; Mon, 15 May 2017 21:28:12 +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 5FE4B18C5; Mon, 15 May 2017 21:28:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 89B9F4697; Mon, 15 May 2017 21:28:11 +0000 (UTC) Date: Mon, 15 May 2017 21:28:11 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: John Baldwin , src-committers , Warner Losh , "svn-src-all@freebsd.org" , Ngie Cooper , "svn-src-head@freebsd.org" , Ngie Cooper , "Rodney W. Grimes" Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk Message-ID: <20170515212811.GB26702@FreeBSD.org> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <4703731.Pl02uSWy7k@ralph.baldwin.cx> <1494879113.59865.129.camel@freebsd.org> <20170515202853.GA88899@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515202853.GA88899@FreeBSD.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 21:28:12 -0000 On Mon, May 15, 2017 at 08:28:53PM +0000, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 02:11:53PM -0600, Ian Lepore wrote: > > ... > > Sure, all us old-timers have the finger memory for editing rc.conf and > > syslog.conf and so on, but how often do you crack open syslog.conf with > > the plan of editing 12 different lines in it at once? > > Actually I don't want to open it [newsyslog.conf] at all, and on desktop, > where odd things are noticed quickly, default rotation is good enough. > I might want to edit it on server to e.g. keep at least one year worth of > logs, and when I do, I'd rather edit one file instead of half-dozen. Thinking of it, it occurred to me that some simple inheritance mechanism that would allow one to set (and centrally maintain) default "mode/count/ size/when/flags" in /etc/newsyslog.conf, without having to touch every individual /etc/newsyslog.conf.d/foo.conf (while allowing per-log and per- mode/count/size/when/flags override) could address most of the expressed concerns so far. I just hope it does not smell like sysd too much, because oh boy, please no. ./danfe From owner-svn-src-head@freebsd.org Mon May 15 21:44:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A023D6E18E; Mon, 15 May 2017 21:44:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5836B7DB; Mon, 15 May 2017 21:44:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FLiet1046126; Mon, 15 May 2017 21:44:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FLieu1046125; Mon, 15 May 2017 21:44:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201705152144.v4FLieu1046125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 May 2017 21:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318319 - head/sys/cddl/dev/profile X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 21:44:41 -0000 Author: markj Date: Mon May 15 21:44:40 2017 New Revision: 318319 URL: https://svnweb.freebsd.org/changeset/base/318319 Log: Ensure that profile and tick probes provide a non-zero PC value. The idle thread may process callouts while reloading the timer in cpu_activeclock(). In this case, provide a representative value, &cpu_idle, instead of 0 for args[0] so that the active thread can be more easily identified from the probe. This addresses intermittent failures of the profile-n/tst.argtest.d test. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D10651 Modified: head/sys/cddl/dev/profile/profile.c Modified: head/sys/cddl/dev/profile/profile.c ============================================================================== --- head/sys/cddl/dev/profile/profile.c Mon May 15 20:52:43 2017 (r318318) +++ head/sys/cddl/dev/profile/profile.c Mon May 15 21:44:40 2017 (r318319) @@ -266,37 +266,43 @@ sbt_to_nsec(sbintime_t sbt) } static void -profile_fire(void *arg) +profile_probe(profile_probe_t *prof, hrtime_t late) { - profile_probe_percpu_t *pcpu = arg; - profile_probe_t *prof = pcpu->profc_probe; - hrtime_t late; + struct thread *td; struct trapframe *frame; uintfptr_t pc, upc; -#ifdef illumos - late = gethrtime() - pcpu->profc_expected; -#else - late = sbt_to_nsec(sbinuptime() - pcpu->profc_expected); -#endif - - pc = 0; - upc = 0; + td = curthread; + pc = upc = 0; /* - * td_intr_frame can be unset if this is a catch up event - * after waking up from idle sleep. - * This can only happen on a CPU idle thread. + * td_intr_frame can be unset if this is a catch-up event upon waking up + * from idle sleep. This can only happen on a CPU idle thread. Use a + * representative arg0 value in this case so that one of the probe + * arguments is non-zero. */ - frame = curthread->td_intr_frame; + frame = td->td_intr_frame; if (frame != NULL) { if (TRAPF_USERMODE(frame)) upc = TRAPF_PC(frame); else pc = TRAPF_PC(frame); - } + } else if (TD_IS_IDLETHREAD(td)) + pc = (uintfptr_t)&cpu_idle; + dtrace_probe(prof->prof_id, pc, upc, late, 0, 0); +} +static void +profile_fire(void *arg) +{ + profile_probe_percpu_t *pcpu = arg; + profile_probe_t *prof = pcpu->profc_probe; + hrtime_t late; + + late = sbt_to_nsec(sbinuptime() - pcpu->profc_expected); + + profile_probe(prof, late); pcpu->profc_expected += pcpu->profc_interval; callout_schedule_sbt_curcpu(&pcpu->profc_cyclic, pcpu->profc_expected, 0, C_DIRECT_EXEC | C_ABSOLUTE); @@ -306,26 +312,8 @@ static void profile_tick(void *arg) { profile_probe_t *prof = arg; - struct trapframe *frame; - uintfptr_t pc, upc; - - pc = 0; - upc = 0; - - /* - * td_intr_frame can be unset if this is a catch up event - * after waking up from idle sleep. - * This can only happen on a CPU idle thread. - */ - frame = curthread->td_intr_frame; - if (frame != NULL) { - if (TRAPF_USERMODE(frame)) - upc = TRAPF_PC(frame); - else - pc = TRAPF_PC(frame); - } - dtrace_probe(prof->prof_id, pc, upc, 0, 0, 0); + profile_probe(prof, 0); prof->prof_expected += prof->prof_interval; callout_schedule_sbt(&prof->prof_cyclic, prof->prof_expected, 0, C_DIRECT_EXEC | C_ABSOLUTE); From owner-svn-src-head@freebsd.org Mon May 15 21:50:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17694D6E416; Mon, 15 May 2017 21:50:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 DD139C16; Mon, 15 May 2017 21:50:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FLoZfb046567; Mon, 15 May 2017 21:50:35 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FLoYBJ046563; Mon, 15 May 2017 21:50:34 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201705152150.v4FLoYBJ046563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 15 May 2017 21:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318320 - head/lib/libstand X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 21:50:36 -0000 Author: tsoome Date: Mon May 15 21:50:34 2017 New Revision: 318320 URL: https://svnweb.freebsd.org/changeset/base/318320 Log: loader: add ip layer code into libstand Implement simple separate ip module and fragment re-assembly. The work is based on send and receive previously implemented in udp.c, moved to ip.c and added the ip fragment re-assembly. This change allows to specify larger tftp or nfs payload, such as: tftp.blksize=4096 or nfs.read_size=4096 Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10631 Added: head/lib/libstand/ip.c (contents, props changed) Modified: head/lib/libstand/Makefile head/lib/libstand/net.h head/lib/libstand/udp.c Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Mon May 15 21:44:40 2017 (r318319) +++ head/lib/libstand/Makefile Mon May 15 21:50:34 2017 (r318320) @@ -141,7 +141,7 @@ SRCS+= closeall.c dev.c ioctl.c nullfs.c fstat.c close.c lseek.c open.c read.c write.c readdir.c # network routines -SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c +SRCS+= arp.c ether.c ip.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c # network info services: SRCS+= bootp.c rarp.c bootparam.c Added: head/lib/libstand/ip.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libstand/ip.c Mon May 15 21:50:34 2017 (r318320) @@ -0,0 +1,422 @@ +/* + * Copyright (c) 1992 Regents of the University of California. + * All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * The send and receive functions were originally implemented in udp.c and + * moved here. Also it is likely some more cleanup can be done, especially + * once we will implement the support for tcp. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "stand.h" +#include "net.h" + +typedef STAILQ_HEAD(ipqueue, ip_queue) ip_queue_t; +struct ip_queue { + void *ipq_pkt; + struct ip *ipq_hdr; + STAILQ_ENTRY(ip_queue) ipq_next; +}; + +/* + * Fragment re-assembly queue. + */ +struct ip_reasm { + struct in_addr ip_src; + struct in_addr ip_dst; + uint16_t ip_id; + uint8_t ip_proto; + uint8_t ip_ttl; + size_t ip_total_size; + ip_queue_t ip_queue; + void *ip_pkt; + struct ip *ip_hdr; + STAILQ_ENTRY(ip_reasm) ip_next; +}; + +STAILQ_HEAD(ire_list, ip_reasm) ire_list = STAILQ_HEAD_INITIALIZER(ire_list); + +/* Caller must leave room for ethernet and ip headers in front!! */ +ssize_t +sendip(struct iodesc *d, void *pkt, size_t len, uint8_t proto) +{ + ssize_t cc; + struct ip *ip; + u_char *ea; + +#ifdef NET_DEBUG + if (debug) { + printf("sendip: proto: %x d=%p called.\n", proto, (void *)d); + if (d) { + printf("saddr: %s:%d", + inet_ntoa(d->myip), ntohs(d->myport)); + printf(" daddr: %s:%d\n", + inet_ntoa(d->destip), ntohs(d->destport)); + } + } +#endif + + ip = (struct ip *)pkt - 1; + len += sizeof(*ip); + + bzero(ip, sizeof(*ip)); + + ip->ip_v = IPVERSION; /* half-char */ + ip->ip_hl = sizeof(*ip) >> 2; /* half-char */ + ip->ip_len = htons(len); + ip->ip_p = proto; /* char */ + ip->ip_ttl = IPDEFTTL; /* char */ + ip->ip_src = d->myip; + ip->ip_dst = d->destip; + ip->ip_sum = in_cksum(ip, sizeof(*ip)); /* short, but special */ + + if (ip->ip_dst.s_addr == INADDR_BROADCAST || ip->ip_src.s_addr == 0 || + netmask == 0 || SAMENET(ip->ip_src, ip->ip_dst, netmask)) + ea = arpwhohas(d, ip->ip_dst); + else + ea = arpwhohas(d, gateip); + + cc = sendether(d, ip, len, ea, ETHERTYPE_IP); + if (cc == -1) + return (-1); + if (cc != len) + panic("sendip: bad write (%zd != %zd)", cc, len); + return (cc - sizeof(*ip)); +} + +static void +ip_reasm_free(struct ip_reasm *ipr) +{ + struct ip_queue *ipq; + + while ((ipq = STAILQ_FIRST(&ipr->ip_queue)) != NULL) { + STAILQ_REMOVE_HEAD(&ipr->ip_queue, ipq_next); + free(ipq->ipq_pkt); + free(ipq); + } + free(ipr->ip_pkt); + free(ipr); +} + +static int +ip_reasm_add(struct ip_reasm *ipr, void *pkt, struct ip *ip) +{ + struct ip_queue *ipq, *prev, *p; + + if ((ipq = calloc(1, sizeof (*ipq))) == NULL) + return (1); + + ipq->ipq_pkt = pkt; + ipq->ipq_hdr = ip; + + prev = NULL; + STAILQ_FOREACH(p, &ipr->ip_queue, ipq_next) { + if ((ntohs(p->ipq_hdr->ip_off) & IP_OFFMASK) < + (ntohs(ip->ip_off) & IP_OFFMASK)) { + prev = p; + continue; + } + if (prev == NULL) + break; + + STAILQ_INSERT_AFTER(&ipr->ip_queue, prev, ipq, ipq_next); + return (0); + } + STAILQ_INSERT_HEAD(&ipr->ip_queue, ipq, ipq_next); + return (0); +} + +/* + * Receive a IP packet and validate it is for us. + */ +static ssize_t +readipv4(struct iodesc *d, void **pkt, void **payload, time_t tleft, + uint8_t proto) +{ + ssize_t n; + size_t hlen; + struct ether_header *eh; + struct ip *ip; + struct udphdr *uh; + uint16_t etype; /* host order */ + char *ptr; + struct ip_reasm *ipr; + struct ip_queue *ipq, *last; + +#ifdef NET_DEBUG + if (debug) + printf("readip: called\n"); +#endif + + ip = NULL; + ptr = NULL; + n = readether(d, (void **)&ptr, (void **)&ip, tleft, &etype); + if (n == -1 || n < sizeof(*ip) + sizeof(*uh)) { + free(ptr); + return (-1); + } + + /* Ethernet address checks now in readether() */ + + /* Need to respond to ARP requests. */ + if (etype == ETHERTYPE_ARP) { + struct arphdr *ah = (void *)ip; + if (ah->ar_op == htons(ARPOP_REQUEST)) { + /* Send ARP reply */ + arp_reply(d, ah); + } + free(ptr); + errno = EAGAIN; /* Call me again. */ + return (-1); + } + + if (etype != ETHERTYPE_IP) { +#ifdef NET_DEBUG + if (debug) + printf("readip: not IP. ether_type=%x\n", etype); +#endif + free(ptr); + return (-1); + } + + /* Check ip header */ + if (ip->ip_v != IPVERSION || + ip->ip_p != proto) { /* half char */ +#ifdef NET_DEBUG + if (debug) { + printf("readip: IP version or proto. ip_v=%d ip_p=%d\n", + ip->ip_v, ip->ip_p); + } +#endif + free(ptr); + return (-1); + } + + hlen = ip->ip_hl << 2; + if (hlen < sizeof(*ip) || + in_cksum(ip, hlen) != 0) { +#ifdef NET_DEBUG + if (debug) + printf("readip: short hdr or bad cksum.\n"); +#endif + free(ptr); + return (-1); + } + if (n < ntohs(ip->ip_len)) { +#ifdef NET_DEBUG + if (debug) + printf("readip: bad length %d < %d.\n", + (int)n, ntohs(ip->ip_len)); +#endif + free(ptr); + return (-1); + } + if (d->myip.s_addr && ip->ip_dst.s_addr != d->myip.s_addr) { +#ifdef NET_DEBUG + if (debug) { + printf("readip: bad saddr %s != ", inet_ntoa(d->myip)); + printf("%s\n", inet_ntoa(ip->ip_dst)); + } +#endif + free(ptr); + return (-1); + } + + /* Unfragmented packet. */ + if ((ntohs(ip->ip_off) & IP_MF) == 0 && + (ntohs(ip->ip_off) & IP_OFFMASK) == 0) { + uh = (struct udphdr *)((uintptr_t)ip + sizeof (*ip)); + /* If there were ip options, make them go away */ + if (hlen != sizeof(*ip)) { + bcopy(((u_char *)ip) + hlen, uh, uh->uh_ulen - hlen); + ip->ip_len = htons(sizeof(*ip)); + n -= hlen - sizeof(*ip); + } + + n = (n > (ntohs(ip->ip_len) - sizeof(*ip))) ? + ntohs(ip->ip_len) - sizeof(*ip) : n; + *pkt = ptr; + *payload = (void *)((uintptr_t)ip + sizeof(*ip)); + return (n); + } + + STAILQ_FOREACH(ipr, &ire_list, ip_next) { + if (ipr->ip_src.s_addr == ip->ip_src.s_addr && + ipr->ip_dst.s_addr == ip->ip_dst.s_addr && + ipr->ip_id == ip->ip_id && + ipr->ip_proto == ip->ip_p) + break; + } + + /* Allocate new reassembly entry */ + if (ipr == NULL) { + if ((ipr = calloc(1, sizeof (*ipr))) == NULL) { + free(ptr); + return (-1); + } + + ipr->ip_src = ip->ip_src; + ipr->ip_dst = ip->ip_dst; + ipr->ip_id = ip->ip_id; + ipr->ip_proto = ip->ip_p; + ipr->ip_ttl = MAXTTL; + STAILQ_INIT(&ipr->ip_queue); + STAILQ_INSERT_TAIL(&ire_list, ipr, ip_next); + } + + if (ip_reasm_add(ipr, ptr, ip) != 0) { + STAILQ_REMOVE(&ire_list, ipr, ip_reasm, ip_next); + free(ipr); + free(ptr); + return (-1); + } + + if ((ntohs(ip->ip_off) & IP_MF) == 0) { + ipr->ip_total_size = (8 * (ntohs(ip->ip_off) & IP_OFFMASK)); + ipr->ip_total_size += n + sizeof (*ip); + ipr->ip_total_size += sizeof (struct ether_header); + + ipr->ip_pkt = malloc(ipr->ip_total_size + 2); + if (ipr->ip_pkt == NULL) { + STAILQ_REMOVE(&ire_list, ipr, ip_reasm, ip_next); + ip_reasm_free(ipr); + return (-1); + } + } + + /* + * If we do not have re-assembly buffer ipr->ip_pkt, we are still + * missing fragments, so just restart the read. + */ + if (ipr->ip_pkt == NULL) { + errno = EAGAIN; + return (-1); + } + + /* + * Walk the packet list in reassembly queue, if we got all the + * fragments, build the packet. + */ + n = 0; + last = NULL; + STAILQ_FOREACH(ipq, &ipr->ip_queue, ipq_next) { + if ((ntohs(ipq->ipq_hdr->ip_off) & IP_OFFMASK) != n / 8) { + errno = EAGAIN; + return (-1); + } + + n += ntohs(ipq->ipq_hdr->ip_len) - (ipq->ipq_hdr->ip_hl << 2); + last = ipq; + } + if ((ntohs(last->ipq_hdr->ip_off) & IP_MF) != 0) { + errno = EAGAIN; + return (-1); + } + + ipq = STAILQ_FIRST(&ipr->ip_queue); + /* Fabricate ethernet header */ + eh = (struct ether_header *)((uintptr_t)ipr->ip_pkt + 2); + bcopy((void *)((uintptr_t)ipq->ipq_pkt + 2), eh, sizeof (*eh)); + + /* Fabricate IP header */ + ipr->ip_hdr = (struct ip *)((uintptr_t)eh + sizeof (*eh)); + bcopy(ipq->ipq_hdr, ipr->ip_hdr, sizeof (*ipr->ip_hdr)); + ipr->ip_hdr->ip_hl = sizeof (*ipr->ip_hdr) >> 2; + ipr->ip_hdr->ip_len = htons(n); + ipr->ip_hdr->ip_sum = 0; + ipr->ip_hdr->ip_sum = in_cksum(ipr->ip_hdr, sizeof (*ipr->ip_hdr)); + + n = 0; + ptr = (char *)((uintptr_t)ipr->ip_hdr + sizeof (*ipr->ip_hdr)); + STAILQ_FOREACH(ipq, &ipr->ip_queue, ipq_next) { + char *data; + size_t len; + + hlen = ipq->ipq_hdr->ip_hl << 2; + len = ntohs(ipq->ipq_hdr->ip_len) - hlen; + data = (char *)((uintptr_t)ipq->ipq_hdr + hlen); + + bcopy(data, ptr + n, len); + n += len; + } + + *pkt = ipr->ip_pkt; + ipr->ip_pkt = NULL; /* Avoid free from ip_reasm_free() */ + *payload = ptr; + + /* Clean up the reassembly list */ + while ((ipr = STAILQ_FIRST(&ire_list)) != NULL) { + STAILQ_REMOVE_HEAD(&ire_list, ip_next); + ip_reasm_free(ipr); + } + return (n); +} + +/* + * Receive a IP packet. + */ +ssize_t +readip(struct iodesc *d, void **pkt, void **payload, time_t tleft, + uint8_t proto) +{ + time_t t; + ssize_t ret = -1; + + t = getsecs(); + while ((getsecs() - t) < tleft) { + errno = 0; + ret = readipv4(d, pkt, payload, tleft, proto); + if (errno != EAGAIN) + break; + } + return (ret); +} Modified: head/lib/libstand/net.h ============================================================================== --- head/lib/libstand/net.h Mon May 15 21:44:40 2017 (r318319) +++ head/lib/libstand/net.h Mon May 15 21:50:34 2017 (r318320) @@ -108,6 +108,8 @@ ssize_t sendether(struct iodesc *d, void u_char *dea, int etype); ssize_t readether(struct iodesc *, void **, void **, time_t, uint16_t *); +ssize_t sendip(struct iodesc *, void *, size_t, uint8_t); +ssize_t readip(struct iodesc *, void **, void **, time_t, uint8_t); ssize_t sendudp(struct iodesc *, void *, size_t); ssize_t readudp(struct iodesc *, void **, void **, time_t); ssize_t sendrecv(struct iodesc *, Modified: head/lib/libstand/udp.c ============================================================================== --- head/lib/libstand/udp.c Mon May 15 21:44:40 2017 (r318319) +++ head/lib/libstand/udp.c Mon May 15 21:50:34 2017 (r318320) @@ -62,9 +62,8 @@ ssize_t sendudp(struct iodesc *d, void *pkt, size_t len) { ssize_t cc; - struct ip *ip; + struct udpiphdr *ui; struct udphdr *uh; - u_char *ea; #ifdef NET_DEBUG if (debug) { @@ -78,52 +77,31 @@ sendudp(struct iodesc *d, void *pkt, siz } #endif - uh = (struct udphdr *)pkt - 1; - ip = (struct ip *)uh - 1; - len += sizeof(*ip) + sizeof(*uh); - - bzero(ip, sizeof(*ip) + sizeof(*uh)); + ui = (struct udpiphdr *)pkt - 1; + bzero(ui, sizeof(*ui)); - ip->ip_v = IPVERSION; /* half-char */ - ip->ip_hl = sizeof(*ip) >> 2; /* half-char */ - ip->ip_len = htons(len); - ip->ip_p = IPPROTO_UDP; /* char */ - ip->ip_ttl = IPDEFTTL; /* char */ - ip->ip_src = d->myip; - ip->ip_dst = d->destip; - ip->ip_sum = in_cksum(ip, sizeof(*ip)); /* short, but special */ + uh = (struct udphdr *)pkt - 1; + len += sizeof(*uh); uh->uh_sport = d->myport; uh->uh_dport = d->destport; - uh->uh_ulen = htons(len - sizeof(*ip)); + uh->uh_ulen = htons(len); -#ifndef UDP_NO_CKSUM - { - struct udpiphdr *ui; - struct ip tip; + ui->ui_pr = IPPROTO_UDP; + ui->ui_len = uh->uh_ulen; + ui->ui_src = d->myip; + ui->ui_dst = d->destip; - /* Calculate checksum (must save and restore ip header) */ - tip = *ip; - ui = (struct udpiphdr *)ip; - bzero(&ui->ui_x1, sizeof(ui->ui_x1)); - ui->ui_len = uh->uh_ulen; - uh->uh_sum = in_cksum(ui, len); - *ip = tip; - } +#ifndef UDP_NO_CKSUM + uh->uh_sum = in_cksum(ui, len + sizeof (struct ip)); #endif - if (ip->ip_dst.s_addr == INADDR_BROADCAST || ip->ip_src.s_addr == 0 || - netmask == 0 || SAMENET(ip->ip_src, ip->ip_dst, netmask)) - ea = arpwhohas(d, ip->ip_dst); - else - ea = arpwhohas(d, gateip); - - cc = sendether(d, ip, len, ea, ETHERTYPE_IP); + cc = sendip(d, uh, len, IPPROTO_UDP); if (cc == -1) return (-1); if (cc != len) panic("sendudp: bad write (%zd != %zd)", cc, len); - return (cc - (sizeof(*ip) + sizeof(*uh))); + return (cc - sizeof(*uh)); } /* @@ -133,10 +111,7 @@ ssize_t readudp(struct iodesc *d, void **pkt, void **payload, time_t tleft) { ssize_t n; - size_t hlen; - struct ip *ip; struct udphdr *uh; - uint16_t etype; /* host order */ void *ptr; #ifdef NET_DEBUG @@ -144,84 +119,14 @@ readudp(struct iodesc *d, void **pkt, vo printf("readudp: called\n"); #endif - ip = NULL; + uh = NULL; ptr = NULL; - n = readether(d, &ptr, (void **)&ip, tleft, &etype); - if (n == -1 || n < sizeof(*ip) + sizeof(*uh)) { + n = readip(d, &ptr, (void **)&uh, tleft, IPPROTO_UDP); + if (n == -1 || n < sizeof(*uh) || n != ntohs(uh->uh_ulen)) { free(ptr); return (-1); } - /* Ethernet address checks now in readether() */ - - /* Need to respond to ARP requests. */ - if (etype == ETHERTYPE_ARP) { - struct arphdr *ah = (void *)ip; - if (ah->ar_op == htons(ARPOP_REQUEST)) { - /* Send ARP reply */ - arp_reply(d, ah); - } - free(ptr); - return (-1); - } - - if (etype != ETHERTYPE_IP) { -#ifdef NET_DEBUG - if (debug) - printf("readudp: not IP. ether_type=%x\n", etype); -#endif - free(ptr); - return (-1); - } - - /* Check ip header */ - if (ip->ip_v != IPVERSION || - ip->ip_p != IPPROTO_UDP) { /* half char */ -#ifdef NET_DEBUG - if (debug) - printf("readudp: IP version or not UDP. ip_v=%d ip_p=%d\n", ip->ip_v, ip->ip_p); -#endif - free(ptr); - return (-1); - } - - hlen = ip->ip_hl << 2; - if (hlen < sizeof(*ip) || - in_cksum(ip, hlen) != 0) { -#ifdef NET_DEBUG - if (debug) - printf("readudp: short hdr or bad cksum.\n"); -#endif - free(ptr); - return (-1); - } - if (n < ntohs(ip->ip_len)) { -#ifdef NET_DEBUG - if (debug) - printf("readudp: bad length %d < %d.\n", - (int)n, ntohs(ip->ip_len)); -#endif - free(ptr); - return (-1); - } - if (d->myip.s_addr && ip->ip_dst.s_addr != d->myip.s_addr) { -#ifdef NET_DEBUG - if (debug) { - printf("readudp: bad saddr %s != ", inet_ntoa(d->myip)); - printf("%s\n", inet_ntoa(ip->ip_dst)); - } -#endif - free(ptr); - return (-1); - } - - uh = (struct udphdr *)((uintptr_t)ip + sizeof (*ip)); - /* If there were ip options, make them go away */ - if (hlen != sizeof(*ip)) { - bcopy(((u_char *)ip) + hlen, uh, uh->uh_ulen - hlen); - ip->ip_len = htons(sizeof(*ip)); - n -= hlen - sizeof(*ip); - } if (uh->uh_dport != d->myport) { #ifdef NET_DEBUG if (debug) @@ -235,16 +140,13 @@ readudp(struct iodesc *d, void **pkt, vo #ifndef UDP_NO_CKSUM if (uh->uh_sum) { struct udpiphdr *ui; + struct ip *ip; struct ip tip; n = ntohs(uh->uh_ulen) + sizeof(*ip); - if (n > RECV_SIZE - ETHER_SIZE) { - printf("readudp: huge packet, udp len %d\n", (int)n); - free(ptr); - return (-1); - } /* Check checksum (must save and restore ip header) */ + ip = (struct ip *)uh - 1; tip = *ip; ui = (struct udpiphdr *)ip; bzero(&ui->ui_x1, sizeof(ui->ui_x1)); From owner-svn-src-head@freebsd.org Mon May 15 21:58:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7C05D6E680; Mon, 15 May 2017 21:58:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA8E10BC; Mon, 15 May 2017 21:58:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FLwbGP050499; Mon, 15 May 2017 21:58:37 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FLwagA050493; Mon, 15 May 2017 21:58:36 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201705152158.v4FLwagA050493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 15 May 2017 21:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318321 - head/sys/netinet X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 21:58:38 -0000 Author: glebius Date: Mon May 15 21:58:36 2017 New Revision: 318321 URL: https://svnweb.freebsd.org/changeset/base/318321 Log: Reduce in_pcbinfo_init() by two params. No users supply any flags to this function (they used to say UMA_ZONE_NOFREE), so flag parameter goes away. The zone_fini parameter also goes away. Previously no protocols (except divert) supplied zone_fini function, so inpcb locks were leaked with slabs. This was okay while zones were allocated with UMA_ZONE_NOFREE flag, but now this is a leak. Fix that by suppling inpcb_fini() function as fini method for all inpcb zones. Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon May 15 21:50:34 2017 (r318320) +++ head/sys/netinet/in_pcb.c Mon May 15 21:58:36 2017 (r318321) @@ -212,14 +212,25 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_A */ /* + * Different protocols initialize their inpcbs differently - giving + * different name to the lock. But they all are disposed the same. + */ +static void +inpcb_fini(void *mem, int size) +{ + struct inpcb *inp = mem; + + INP_LOCK_DESTROY(inp); +} + +/* * Initialize an inpcbinfo -- we should be able to reduce the number of * arguments in time. */ void in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char *name, struct inpcbhead *listhead, int hash_nelements, int porthash_nelements, - char *inpcbzone_name, uma_init inpcbzone_init, uma_fini inpcbzone_fini, - uint32_t inpcbzone_flags, u_int hashfields) + char *inpcbzone_name, uma_init inpcbzone_init, u_int hashfields) { INP_INFO_LOCK_INIT(pcbinfo, name); @@ -239,8 +250,7 @@ in_pcbinfo_init(struct inpcbinfo *pcbinf in_pcbgroup_init(pcbinfo, hashfields, hash_nelements); #endif pcbinfo->ipi_zone = uma_zcreate(inpcbzone_name, sizeof(struct inpcb), - NULL, NULL, inpcbzone_init, inpcbzone_fini, UMA_ALIGN_PTR, - inpcbzone_flags); + NULL, NULL, inpcbzone_init, inpcb_fini, UMA_ALIGN_PTR, 0); uma_zone_set_max(pcbinfo->ipi_zone, maxsockets); uma_zone_set_warning(pcbinfo->ipi_zone, "kern.ipc.maxsockets limit reached"); Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon May 15 21:50:34 2017 (r318320) +++ head/sys/netinet/in_pcb.h Mon May 15 21:58:36 2017 (r318321) @@ -690,7 +690,7 @@ VNET_DECLARE(int, ipport_tcpallocs); void in_pcbinfo_destroy(struct inpcbinfo *); void in_pcbinfo_init(struct inpcbinfo *, const char *, struct inpcbhead *, - int, int, char *, uma_init, uma_fini, uint32_t, u_int); + int, int, char *, uma_init, u_int); int in_pcbbind_check_bindmulti(const struct inpcb *ni, const struct inpcb *oi); Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Mon May 15 21:50:34 2017 (r318320) +++ head/sys/netinet/ip_divert.c Mon May 15 21:58:36 2017 (r318321) @@ -141,14 +141,6 @@ div_inpcb_init(void *mem, int size, int } static void -div_inpcb_fini(void *mem, int size) -{ - struct inpcb *inp = mem; - - INP_LOCK_DESTROY(inp); -} - -static void div_init(void) { @@ -158,7 +150,7 @@ div_init(void) * place for hashbase == NULL. */ in_pcbinfo_init(&V_divcbinfo, "div", &V_divcb, 1, 1, "divcb", - div_inpcb_init, div_inpcb_fini, 0, IPI_HASHFIELDS_NONE); + div_inpcb_init, IPI_HASHFIELDS_NONE); } static void Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Mon May 15 21:50:34 2017 (r318320) +++ head/sys/netinet/raw_ip.c Mon May 15 21:58:36 2017 (r318321) @@ -210,7 +210,7 @@ rip_init(void) { in_pcbinfo_init(&V_ripcbinfo, "rip", &V_ripcb, INP_PCBHASH_RAW_SIZE, - 1, "ripcb", rip_inpcb_init, NULL, 0, IPI_HASHFIELDS_NONE); + 1, "ripcb", rip_inpcb_init, IPI_HASHFIELDS_NONE); EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, NULL, EVENTHANDLER_PRI_ANY); } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon May 15 21:50:34 2017 (r318320) +++ head/sys/netinet/tcp_subr.c Mon May 15 21:58:36 2017 (r318321) @@ -647,7 +647,7 @@ tcp_init(void) hashsize); } in_pcbinfo_init(&V_tcbinfo, "tcp", &V_tcb, hashsize, hashsize, - "tcp_inpcb", tcp_inpcb_init, NULL, 0, IPI_HASHFIELDS_4TUPLE); + "tcp_inpcb", tcp_inpcb_init, IPI_HASHFIELDS_4TUPLE); /* * These have to be type stable for the benefit of the timers. Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon May 15 21:50:34 2017 (r318320) +++ head/sys/netinet/udp_usrreq.c Mon May 15 21:58:36 2017 (r318321) @@ -203,8 +203,7 @@ udp_init(void) * a 4-tuple, flip this to 4-tuple. */ in_pcbinfo_init(&V_udbinfo, "udp", &V_udb, UDBHASHSIZE, UDBHASHSIZE, - "udp_inpcb", udp_inpcb_init, NULL, 0, - IPI_HASHFIELDS_2TUPLE); + "udp_inpcb", udp_inpcb_init, IPI_HASHFIELDS_2TUPLE); V_udpcb_zone = uma_zcreate("udpcb", sizeof(struct udpcb), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); uma_zone_set_max(V_udpcb_zone, maxsockets); @@ -218,8 +217,8 @@ udplite_init(void) { in_pcbinfo_init(&V_ulitecbinfo, "udplite", &V_ulitecb, UDBHASHSIZE, - UDBHASHSIZE, "udplite_inpcb", udplite_inpcb_init, NULL, - 0, IPI_HASHFIELDS_2TUPLE); + UDBHASHSIZE, "udplite_inpcb", udplite_inpcb_init, + IPI_HASHFIELDS_2TUPLE); } /* From owner-svn-src-head@freebsd.org Mon May 15 22:25:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5ACCD6EF83 for ; Mon, 15 May 2017 22:25:43 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 512E9359 for ; Mon, 15 May 2017 22:25:42 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 6b474f28-39bd-11e7-b96e-2378c10e3beb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 6b474f28-39bd-11e7-b96e-2378c10e3beb; Mon, 15 May 2017 22:25:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4FMPVxU002277; Mon, 15 May 2017 16:25:31 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1494887131.59865.172.camel@freebsd.org> Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk From: Ian Lepore To: Alexey Dokuchaev Cc: John Baldwin , src-committers , Warner Losh , "svn-src-all@freebsd.org" , Ngie Cooper , "svn-src-head@freebsd.org" , Ngie Cooper , "Rodney W. Grimes" Date: Mon, 15 May 2017 16:25:31 -0600 In-Reply-To: <20170515210922.GA26702@FreeBSD.org> References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net> <2229085.lB46rKsq7o@ralph.baldwin.cx> <1494870201.59865.103.camel@freebsd.org> <4703731.Pl02uSWy7k@ralph.baldwin.cx> <1494879113.59865.129.camel@freebsd.org> <20170515202853.GA88899@FreeBSD.org> <1494881370.59865.140.camel@freebsd.org> <20170515210922.GA26702@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.23 Precedence: list List-Id: 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, 15 May 2017 22:25:43 -0000 On Mon, 2017-05-15 at 21:09 +0000, Alexey Dokuchaev wrote: > On Mon, May 15, 2017 at 02:49:30PM -0600, Ian Lepore wrote: > > > > ... > > You acknowledge that the situation is different for ports, so does that > > mean your objections go away when base becomes packaged and faces the > > same installation and update issues that packaged ports do?  Because I > > was under the impression that's coming pretty soon. > The reason it is different for ports is because we cannot know up-front what > software might user have installed and ergo what logs should be rotated by > newsyslog(8).  For the base, we know these pieces (albeit packaging the base > could probably benefit from the same generic approach, if we ever start to > support 3rd-party "base" packages). > > ./danfe > The same is true of packaged base -- the user may have installed a subset of the base system.  No need to configure ftp log stuff if ftp didn't get installed.  Likewise for ntp, mail, news, everything that has its own syslog facility code. And really, while syslog config started this thread, most of what I've been saying is more widely related to my initial comment:  moving from monolithic to per-subsystem/object/whatever config files has been the freebsd trend for a while.  That's not just for syslog rotation, that's for rc config and jail config and pam (maybe where the trend started?) and devd and periodic jobs and so on. Most of these things support both a single file and individual files, so nobody is forced to change all at once, but it does seem natural that the existing base code evolve towards the newer mechanism.  When it makes sense to still have the original file and only split out parts of it to individual files, it might also make sense to drop a comment into the original file to let old-timers know they should go looking in the newer directory for additional entries. Or it might makes sense to say: no half measures for a given configuration scheme, if some items are to be split out to separate files, then everything should be split, so that before the next major release there is only a monolithic file, or a directory full of fine- grained config, but not a mix.  I'm not advocating for that necessarily, just thinking out loud really. -- Ian From owner-svn-src-head@freebsd.org Mon May 15 22:30:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5012AD6E0B5; Mon, 15 May 2017 22:30:23 +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 32010952; Mon, 15 May 2017 22:30:23 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 5A77959D3; Mon, 15 May 2017 22:30:22 +0000 (UTC) Date: Mon, 15 May 2017 22:30:22 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org Cc: Nikolai Lifanov , Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r318313 - head/libexec/rtld-elf Message-ID: <20170515223022.GA91860@FreeBSD.org> References: <20170515192326.GB28684@FreeBSD.org> <201705152000.v4FK0meq054533@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201705152000.v4FK0meq054533@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 22:30:23 -0000 On Mon, May 15, 2017 at 01:00:48PM -0700, Rodney W. Grimes wrote: > > On Mon, May 15, 2017 at 03:09:33PM -0400, Nikolai Lifanov wrote: > > > On 05/15/2017 14:52, Alexey Dokuchaev wrote: > > ... > > Because /bin/chmod is owned by root, not because /libexec/ld-elf.so.1 is > > limiting execution to root only, or is it (I might have missed uid check > > in that patch [1], but at a quick glance I didn't see it). > > > > On a living system, there are plenty of other ways to restore missing > > +x on /bin/chmod as long as you can call chmod(2), from simple Python > > script down to manually crafting small binary in hex. > > Simple tool to get out of this is use of install(8) to "install" your > broken chmod to another file with proper modes. And if you lost that > one you could use mtree(8) with a easily crafted input file. Right. Like I've said, there are plenty of ways. In the mean time... While we've been somewhat calmed by r313967, which had secured us from consequences of running binaries from filesystems mounted with -o noexec, few questions had remained unanswered so far: - Would doing chmod -x /libexec/ld-elf.so.1 break anything from now on? - Does it make sense to implement something like [1]? - Could original "MFC after: 2 weeks" be extended a bit to give more time to gather enough feedback? I don't see the need for the rush. ./danfe > > [1] Idea for security.bsd.ld_elf_exec_root_only sysctl(8)? From owner-svn-src-head@freebsd.org Mon May 15 22:52:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8531ED6EB43; Mon, 15 May 2017 22:52:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 5F5B21B4A; Mon, 15 May 2017 22:52:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FMqQGv073747; Mon, 15 May 2017 22:52:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FMqPCd073742; Mon, 15 May 2017 22:52:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705152252.v4FMqPCd073742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 15 May 2017 22:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318325 - in head: etc/mtree usr.bin/procstat usr.bin/procstat/tests X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 22:52:27 -0000 Author: ngie Date: Mon May 15 22:52:25 2017 New Revision: 318325 URL: https://svnweb.freebsd.org/changeset/base/318325 Log: Start writing up some basic feature tests for procstat These tests query a running process for information related to the -b, -c, -e, and -f flags; the -f testcase is largely stubbed out, pending additional work to determine a good, deterministic descriptor. Core file test support is coming soon--it requires a bit more effort due to the fact that: - coredumps can be disabled (kern.coredump=0). - corefiles can be put in different directories than the current directory, or be named something other than `.core` (`kern.corefile`). MFC after: 2 months Sponsored by: Dell EMC Isilon Added: head/usr.bin/procstat/tests/ head/usr.bin/procstat/tests/Makefile (contents, props changed) head/usr.bin/procstat/tests/procstat_test.sh (contents, props changed) head/usr.bin/procstat/tests/while1.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/procstat/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon May 15 22:51:22 2017 (r318324) +++ head/etc/mtree/BSD.tests.dist Mon May 15 22:52:25 2017 (r318325) @@ -650,6 +650,8 @@ .. printf .. + procstat + .. sdiff .. sed Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Mon May 15 22:51:22 2017 (r318324) +++ head/usr.bin/procstat/Makefile Mon May 15 22:52:25 2017 (r318325) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= procstat MAN= procstat.1 SRCS= procstat.c \ @@ -20,4 +22,8 @@ SRCS= procstat.c \ LIBADD+= procstat xo util sbuf +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.bin/procstat/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/tests/Makefile Mon May 15 22:52:25 2017 (r318325) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= procstat_test + +PROGS+= while1 + +BINDIR= ${TESTSDIR} + +.include Added: head/usr.bin/procstat/tests/procstat_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/tests/procstat_test.sh Mon May 15 22:52:25 2017 (r318325) @@ -0,0 +1,140 @@ +# +# Copyright (c) 2017 Ngie Cooper +# 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# + +MAX_TRIES=20 +PROG_PID= +PROG_PATH=$(atf_get_srcdir)/while1 + +SP='[[:space:]]' + +start_program() +{ + echo "Starting program in background" + PROG_COMM=while1 + PROG_PATH=$(atf_get_srcdir)/$PROG_COMM + + $PROG_PATH $* & + PROG_PID=$! + try=0 + while [ $try -lt $MAX_TRIES ] && ! kill -0 $PROG_PID; do + sleep 0.5 + : $(( try += 1 )) + done + if [ $try -ge $MAX_TRIES ]; then + atf_fail "Polled for program start $MAX_TRIES tries and failed" + fi +} + +atf_test_case binary_info +binary_info_head() +{ + atf_set "descr" "Checks -b support" +} +binary_info_body() +{ + start_program bogus-arg + + line_format="$SP*%s$SP+%s$SP+%s$SP+%s$SP*" + header_re=$(printf "$line_format" "PID" "COMM" "OSREL" "PATH") + line_re=$(printf "$line_format" $PROG_PID $PROG_COMM "[[:digit:]]+" "$PROG_PATH") + + atf_check -o save:procstat.out procstat -b $PROG_PID + + atf_check -o match:"$header_re" head -n 1 procstat.out + atf_check -o match:"$line_re" tail -n 1 procstat.out +} + +atf_test_case command_line_arguments +command_line_arguments_head() +{ + atf_set "descr" "Checks -c support" +} +command_line_arguments_body() +{ + arguments="my arguments" + + start_program $arguments + + line_format="$SP*%s$SP+%s$SP+%s$SP*" + header_re=$(printf "$line_format" "PID" "COMM" "ARGS") + line_re=$(printf "$line_format" $PROG_PID "$PROG_COMM" "$PROG_PATH $arguments") + + atf_check -o save:procstat.out procstat -c $PROG_PID + atf_check -o match:"$header_re" head -n 1 procstat.out + atf_check -o match:"$line_re" tail -n 1 procstat.out +} + +atf_test_case environment +environment_head() +{ + atf_set "descr" "Checks -e support" +} +environment_body() +{ + var="MY_VARIABLE=foo" + eval "export $var" + + start_program my arguments + + line_format="$SP*%s$SP+%s$SP+%s$SP*" + header_re=$(printf "$line_format" "PID" "COMM" "ENVIRONMENT") + line_re=$(printf "$line_format" $PROG_PID $PROG_COMM ".*$var.*") + + atf_check -o save:procstat.out procstat -e $PROG_PID + + atf_check -o match:"$header_re" head -n 1 procstat.out + atf_check -o match:"$line_re" tail -n 1 procstat.out +} + +atf_test_case file_descriptor +file_descriptor_head() +{ + atf_set "descr" "Checks -f support" +} +file_descriptor_body() +{ + start_program my arguments + + line_format="$SP*%s$SP+%s$SP+%s$SP+%s$SP+%s$SP+%s$SP+%s$SP+%s$SP+%s$SP%s$SP*" + header_re=$(printf "$line_format" "PID" "COMM" "FD" "T" "V" "FLAGS" "REF" "OFFSET" "PRO" "NAME") + # XXX: write a more sensible feature test + line_re=$(printf "$line_format" $PROG_PID $PROG_COMM ".+" ".+" ".+" ".+" ".+" ".+" ".+" ".+") + + atf_check -o save:procstat.out procstat -f $PROG_PID + + atf_check -o match:"$header_re" head -n 1 procstat.out + atf_check -o match:"$line_re" awk 'NR > 1' procstat.out +} + +atf_init_test_cases() +{ + atf_add_test_case binary_info + atf_add_test_case command_line_arguments + atf_add_test_case environment + atf_add_test_case file_descriptor +} Added: head/usr.bin/procstat/tests/while1.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/tests/while1.c Mon May 15 22:52:25 2017 (r318325) @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2017 Ngie Cooper + * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__RCSID("$FreeBSD$"); + +#include +#include + +int +main(void) +{ + + for (;;) + usleep(100); + exit(1); +} From owner-svn-src-head@freebsd.org Mon May 15 23:12:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DCFED6EF36; Mon, 15 May 2017 23:12:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 DED7765B; Mon, 15 May 2017 23:12:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FNC4DS084210; Mon, 15 May 2017 23:12:04 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FNC4EQ084209; Mon, 15 May 2017 23:12:04 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201705152312.v4FNC4EQ084209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 15 May 2017 23:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318326 - head/sys/dev/vt X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 15 May 2017 23:12:06 -0000 Author: jkim Date: Mon May 15 23:12:04 2017 New Revision: 318326 URL: https://svnweb.freebsd.org/changeset/base/318326 Log: - Revert r317171. [1] - Fix overlapping corners and fix an off-by-one bug. MFC after: 3 days Requested by: emaste [1] Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon May 15 22:52:25 2017 (r318325) +++ head/sys/dev/vt/vt_core.c Mon May 15 23:12:04 2017 (r318326) @@ -1150,30 +1150,33 @@ vt_mark_mouse_position_as_dirty(struct v #endif static void -vt_set_border(struct vt_device *vd, term_color_t c) +vt_set_border(struct vt_device *vd, const term_rect_t *area, + const term_color_t c) { - term_rect_t *tarea = &vd->vd_curwindow->vw_draw_area; - int x, y; + vd_drawrect_t *drawrect = vd->vd_driver->vd_drawrect; - /* Top bar. */ - for (y = 0; y < tarea->tr_begin.tp_row; y++) - for (x = 0; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - - for (y = tarea->tr_begin.tp_row; y < tarea->tr_end.tp_row; y++) { - /* Left bar. */ - for (x = 0; x < tarea->tr_begin.tp_col; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - - /* Right bar. */ - for (x = tarea->tr_end.tp_col; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - } - - /* Bottom bar. */ - for (y = tarea->tr_end.tp_row; y < vd->vd_height; y++) - for (x = 0; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); + if (drawrect == NULL) + return; + + /* Top bar */ + if (area->tr_begin.tp_row > 0) + drawrect(vd, 0, 0, vd->vd_width - 1, + area->tr_begin.tp_row - 1, 1, c); + + /* Left bar */ + if (area->tr_begin.tp_col > 0) + drawrect(vd, 0, area->tr_begin.tp_row, + area->tr_begin.tp_col - 1, area->tr_end.tp_row - 1, 1, c); + + /* Right bar */ + if (area->tr_end.tp_col < vd->vd_width) + drawrect(vd, area->tr_end.tp_col, area->tr_begin.tp_row, + vd->vd_width - 1, area->tr_end.tp_row - 1, 1, c); + + /* Bottom bar */ + if (area->tr_end.tp_row < vd->vd_height) + drawrect(vd, 0, area->tr_end.tp_row, vd->vd_width - 1, + vd->vd_height - 1, 1, c); } static int @@ -1241,7 +1244,7 @@ vt_flush(struct vt_device *vd) if (vd->vd_flags & VDF_INVALID) { vd->vd_flags &= ~VDF_INVALID; - vt_set_border(vd, TC_BLACK); + vt_set_border(vd, &vw->vw_draw_area, TC_BLACK); vt_termrect(vd, vf, &tarea); if (vt_draw_logo_cpus) vtterm_draw_cpu_logos(vd); From owner-svn-src-head@freebsd.org Mon May 15 23:49:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F1A9D6EC58; Mon, 15 May 2017 23:49:27 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.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 DEFD41966; Mon, 15 May 2017 23:49:26 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.15.2/8.15.2) with ESMTP id v4FNJTcE031993; Tue, 16 May 2017 02:19:29 +0300 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Tue, 16 May 2017 02:19:29 +0300 (MSK) From: Maxim Konovalov To: "Stephen J. Kiernan" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318314 - head/lib/libc/sys In-Reply-To: <201705151932.v4FJWQ16092469@repo.freebsd.org> Message-ID: References: <201705151932.v4FJWQ16092469@repo.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 May 2017 23:49:27 -0000 Hi Stephen, On Mon, 15 May 2017, 19:32-0000, Stephen J. Kiernan wrote: > Author: stevek > Date: Mon May 15 19:32:26 2017 > New Revision: 318314 > URL: https://svnweb.freebsd.org/changeset/base/318314 > > Log: > Add information to open(2) man page about the O_VERIFY flag. > > Reviewed by: bjk wblock > Approved by: sjg (mentor) > Obtained from: Juniper Networks, Inc. > > Modified: > head/lib/libc/sys/open.2 > It is also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219262 -- Maxim Konovalov From owner-svn-src-head@freebsd.org Tue May 16 00:25:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3806D6CBB8; Tue, 16 May 2017 00:25:10 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0104.outbound.protection.outlook.com [104.47.42.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4300B124C; Tue, 16 May 2017 00:25:09 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wFTvkcos6CxBGgqUMD/cVhR22QWJXz96XYFDHAbXpjo=; b=PuKJgf1gifuaIvJHRmwcfLqX2+Gg48Fk7Xpr9rG19E+ASX5lhPddAygGl2kX1rZ3+L04lexQpy63HSEXyHl2oGqM5VmpVNFskPHEXAx/bGU7a3VhY1XtOSL86HHCVoW/qwwQwu4Jue6m5dZ35ZFvtC81uZx0ogoMpF0YQyfb0ic= Received: from MWHPR05CA0002.namprd05.prod.outlook.com (10.168.242.140) by SN1PR05MB1983.namprd05.prod.outlook.com (10.162.132.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.7; Tue, 16 May 2017 00:25:08 +0000 Received: from DM3NAM05FT023.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by MWHPR05CA0002.outlook.office365.com (2603:10b6:300:59::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.8 via Frontend Transport; Tue, 16 May 2017 00:25:08 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.12) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=fail action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from p-emfe01a-sac.jnpr.net (66.129.239.12) by DM3NAM05FT023.mail.protection.outlook.com (10.152.98.133) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256) id 15.1.1075.12 via Frontend Transport; Tue, 16 May 2017 00:25:07 +0000 Received: from p-mailhub01.juniper.net (10.160.2.17) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 15 May 2017 17:24:57 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id v4G0OuFZ008584; Mon, 15 May 2017 17:24:56 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id CCA2E38551F; Mon, 15 May 2017 17:24:56 -0700 (PDT) To: Konstantin Belousov CC: Bryan Drewery , Alexey Dokuchaev , , , , Subject: Re: svn commit: r318313 - head/libexec/rtld-elf In-Reply-To: <20170515192944.GI1622@kib.kiev.ua> References: <201705151848.v4FImwMW070221@repo.freebsd.org> <20170515185236.GB1637@FreeBSD.org> <20170515190030.GG1622@kib.kiev.ua> <2493cfd2-1fab-d4cd-523c-0bd7413b1c86@FreeBSD.org> <20170515192944.GI1622@kib.kiev.ua> Comments: In-reply-to: Konstantin Belousov message dated "Mon, 15 May 2017 22:29:44 +0300." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <34494.1494894296.1@kaos.jnpr.net> Date: Mon, 15 May 2017 17:24:56 -0700 Message-ID: <34495.1494894296@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39400400002)(39850400002)(39410400002)(39450400003)(39840400002)(39860400002)(2980300002)(24454002)(189002)(199003)(9170700003)(76176999)(5660300001)(50986999)(4326008)(356003)(23726003)(39060400002)(189998001)(81166006)(2906002)(2810700001)(229853002)(1411001)(47776003)(53416004)(107886003)(8936002)(6916009)(2950100002)(105596002)(7696004)(8676002)(106466001)(50226002)(305945005)(110136004)(6246003)(86362001)(6266002)(55016002)(93886004)(38730400002)(478600001)(97756001)(50466002)(77096006)(53936002)(117636001)(54906002)(7126002)(9686003)(46406003)(76506005)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR05MB1983; H:p-emfe01a-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM05FT023; 1:Dy+l1IS46yjT37GwMT7i43K+Ja18gDeBigNH/Q266LKGvpc9WS+iKsIJfToQod9cQxgise+rDNKBRwmmAjlxR+obgC0zlhep8oEfNs0EIaR9H4nfYcm1pWFywngu/qTD1irUoqvOxcYHpe2JX/7IOzXd66SQ/rOzdVBb1ObnfDFOJ3r/8sb4obY42vbk2sAp3sdPTsrsFufpkmEgbmls4vX6TlTxt15kt7TdKw+BWzFV8iJHiWSEIj588oCzOAQpEF3prSnkkXd/T5qtdKow9IkkpXro9eDITHRtscgFF/Xnmeta67E6gZHRvztDlv2GHYdoBvhAxehWiY4MkyGzOY1VB9ExGq4W9jQj/hQxLdz3XX/jTAJY7BJksVqG+qDvWlBoPIXO4Deu4E6GnNgFJwSx/gHbLmNEeVVaQrajgu5L//vmaP+EAx3M64giNiIWINoijjNpO2nq3OsyL7EbGlTObEqcfv1JtLpIZqnTbypvv2AHoETlN7iyk+aACaOhO1DSgzYOoonmlrZjiOt60Ft2WRk3hw1OIiSedC1T6M/i3QfW91/kOXarUeX+mQ0j23K3fBzNjg11X4RVYxAO2AgJazx0NQE70B+bk4SZARk= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d33e29c-3f42-482c-28a3-08d49bf201d0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:SN1PR05MB1983; X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1983; 3:6RuifCOrxGycwQoetoi72ciIm15fyCmrQV7R+deZ0gHIyThz5SbKcrdMwNARUSjdmJaN2tXKH3bMES0KkrcPVFTKZugbJsMbFoCJj9JCU847OB7vS10ht0Pq0CJz0E/DtsPyPmkg/NNLwvAVhiF4a0SDnmkT00ugatMEMe/IesFr8T5Rf/XUQZgzaDym16dA7q8SjIucU7KB/Hvph5xpmGcfl3p9Qb8A8xl9DUK9pbcaYuc+ykYefY+KcvJzyv3cbedpoCTWgrjPBzKGiOAfH1rf7WPEVaUearzkBDqksE4k0Cc6Xa46beUAi79DrWu/blv1Fm8ReIWHS1jyHuQDqELd6cfTUE/Vbs1mJyRixmsdZuqLUBrvtHhHiKo+Z1hClG93Wyu9VAFSSjkUZ/bzZethMxvJcfWWXgkpk29wOktEdBa0PRuagJvrSoAkO7nSaD35z0vKs6RAW30C6HaGjjjRObAz13C87fZOsKDZ95ewCqOXA9A1Sh1StMk70Vd8 X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1983; 25:63WA72C2QweEBpYMNBNq/NYx2Z2KIIb1ZeWDdjvehQ671meGUkJn6wJe417cF67zT7KHC5iSqOJbvthHYCNaRoxLA15pKZCk0C0pMq3GxN2VRh7VgSq0Vr6Jzg4DS65XopXdCChWPkFx+KMwX5MKhk9f9Wo175ROpFQ5UoIMoUVDmMUDNrrbb0AUSieqFAvvkvXpHiduHn02JYz3UBmUCyFasrD4CMFmI4NqZIO+mm06AVvOhiV0K7kR+qLcf4/yXBTU0qJxXj8Y8zZgJY86XqyEEfkBK0h+sUdHWqqnKPAHHx79JjXrR3D9Qvu9ibLsG13/xgoBK6L2IJOCDC8Wz8q2SXrUYSzJgtpdO0sd+cGmRjkrN9oUbh+KmWCiyTExhx9uK/yl2+rKo5BMlSU/Mtssct6F2Wnm1xWLVWcoar3A9itGlVDQ+lr66q84CjUgTYPTvSGZcSWdAya67XV8YK3g0+iRIr/vbhm+TCQAbqw=; 31:Nlbjyn+H9IcoVWyK1gjcS8QzqH5dohQ5eOVvdqTWcTgrdmzsPs/OY7GW0WMXvXqx5wWefZL21v0FuN8i5TBk97I3VvnbCACqHokR0F6woi7QxyLkXmXxuKrJq6/B88ZZsr+zurl+bud3rdIHHJLMb7sLXekDKrCOz7pfPEITNiAXNbXU1Ytf08pa4+9k+nDdnEFNCxK9PqiAJSyXQoSSHswzm8xh+gGRkupvZwAk5dAWB0CPaNIs8TFGBl2I7AveCHIwgwC9/B/neOIXGsrTXA== X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1983; 20:ZsFIdiIAGwwywbOTEkdgk2hFCyonl2moSExPhQeqlbGLpbWenmOOA/2CRXMaIBnSRQwhK0yKDRrE1u2D+XH3UN13DM2bApvRE2oA0uBKfKqkLzpzTzjuG2VQgY2b5yGhPrnmPP7NaaQRCpT1iuXl+yRzj+3xVgubWicBQtRXZBvPbgbXhyc4IEF8a2lW+/q74bQcRR6TSP6eLtNX+sbwgLSJ10AdFlhyOZ7MXxcTLHqnUnii8g/Dh8YW5AuU4hWmmzaTWcfEmO7L4R5pCfcIeoqgyss9l3Skc0RyFjnvaicd7zRFTlGkm9W3Ugt4TF459xsnP9cFzXI8LO5x+uyJs+nC5KVXHK2TuO55Ypi4OWMwImjz9fmJG3QW/kMIHB1HfNqcRnBCpLtHJD+YSIXsydc/jxDgSobESwkXaDj9tIOJzrIBHWvRrpyJj7bYoVkhMk7dSxSgjGuFv6maLBcnR3YIXKX12DlnY5MXvqQsQ3P6gs7rZRmELu+KJGzawbMB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13023025)(13018025)(13024025)(5005006)(8121501046)(13015025)(13017025)(3002001)(93006095)(93003095)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123558100)(6072148); SRVR:SN1PR05MB1983; BCL:0; PCL:0; RULEID:; SRVR:SN1PR05MB1983; X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1983; 4:jCzdcAKu/TstMHC1FjZerwClLd1ZNuJmmnhAjSVB9wrLBMmWvObrhmlhOuPiZko/DQ0Vi9tO1hPJfSWLLugWsSWzIwDBKhD1seogd0C/ONvvjalDMu9AGawad/tt6j3uG2SZhekLfLPaoocjJXWshroBmjPou1oHUR1aWwKyaL+WKt2AQ6vXokmLSJpjxk74/yMHMdWujJ/BYJvaNFbcN2yFTvv5+Ibt9Q1+zFHm7Rxr8Kyk6Kgq2uynzuEclJwuOO4/J2G80b5oJKQ8VX98sAwzKIhLpHXSwqVcq47SVfTKKmCXOtg8VDoyUdQsTfp4are/0p6tF7U9PTd54FOzznD1doRmkdKaObOu+SqdZ8ca5x5ytyE6z967HNdxpGLZZcKM1HDBGA1vWqQKUsaBaTef8l14vzGabbrSdB0/4d0m00f903FAQdMwrPVm3jLJLMPUFsdB+Ek9kjxYHty7WKSA1ElsFPOkRDJuXxMp0V294P9BqDQx0EBAULTll2ACut5Svd0/22euoXkKzJ4jnMk7l8euxjO7pJ+I1FWDrX+udivbX58UXLLod11Jo+zxHGWebm1RVXTiNXTRL7g3sSFRaxUKLvq2MT4fHLNGDYmzrtz3WunTfV88s8Ilu7+lcJt5KWdRf2fRpgI64WPGf/GqvVx8bQFeGQebEo6i5/JZP63On75S3oNgBS4qecar7gqsqUtU4oAdHzs9eqF6sFpqdJ/JiY4vrz0s28i/ouwEm7AMvuudvc8QdU/6QMJXr+9VSaCUAdLaj8smHCB5BtIo+eFZocaurZFwFnxHotY/pvZsP8kRlLVFqacmysKIUPWbGBqTcnRT6sIpgkVk7fyXrj7I5sGLXC9DKFBJgeD+D+fSMkmWXXgiW4ApY3Fy+mFp1Ocin5732reXepbRhQ== X-Forefront-PRVS: 03094A4065 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR05MB1983; 23:yvC1/bVzZmy64S369p1aBZpY9nOSq1boqPxViKJN5?= =?us-ascii?Q?yh0DjH2qTihLKGLaeVEEyTdyhaBDtuSg55U7FYFqO95Qrf5p80z3c9DNVjPN?= =?us-ascii?Q?zeWgJPEXExbBpQBVVj2+Ja6K/ZuIjlw5c1XlUexmwyeQKFbPlGFqEtUc7Iu8?= =?us-ascii?Q?zFqGdvrI1YdnN0NY67L/9Pv5OyEXTO3f+MMns4XiXhZHdKzgkLV82NZMiDoY?= =?us-ascii?Q?R9+DW4WtPSe8cb57mTntJfqT497mtc5MTpyJFftDlDQ4KDunJU8mWlU55vSl?= =?us-ascii?Q?5GJbaOruysF8iQpciMmD1OuoJnyZVP9oo9BFFVP5gomxtcdcFM9wdsRgojGY?= =?us-ascii?Q?4asA5fuqz1osFxnKcnYHlwXSerMmiLBG+4obVon6DPsZZweRGQABvAjmP2wM?= =?us-ascii?Q?rjOiCDYw7Ivt1vubXvo5tfhlxwfBppiEVCjyK7o49J0VxcWuDdf8hMOPNMzU?= =?us-ascii?Q?f0SvBmPL5sx/LiKWrs9MbMEWcrN0LZ2Y/9EL8p4zeccpy48T32Ktc3PQdZej?= =?us-ascii?Q?iHchOA66+bFgbK+PdPKciqtwwotrSILEP4JLfDZcyIVteRe09Fqa8OtCH3Z/?= =?us-ascii?Q?CPDvWIosjC4ZG9sRk0e3z/M4zWccDoGv3BSuS5/No6WO6RHtu/FpY8/smWC/?= =?us-ascii?Q?spqxlYe6rk9M+La+sl+uA9a86ix4xTzhXzKuR1Zgoxm0dqsKSFjE48OjQlwP?= =?us-ascii?Q?BJ1mklmEwKQsZesk59xprdn9nTqeM0G/vaP1tRgQp1+onD8bg1gUEipK7ZzZ?= =?us-ascii?Q?S7pHhfBqPuqizSbJC9gRjYTPaHc+Ls08vey35ij8AEZHi1ffdqfLRW/EhBiv?= =?us-ascii?Q?XZIUHxDY00vVfbPHfY5LwdFCjc6CKKVYU4Te2dKoUrlBlA7SsEoRWve/rHqr?= =?us-ascii?Q?d0QDWj3IsoW5MmChojxTq3KrD2mhG9wUTI2sAojNGbtNqu8nlArqyzaEbigL?= =?us-ascii?Q?MVJiKpbGcw+qQtxC4DkwBdzUg04fNXMR5/+8X2rWoKlamESQXZpBN9DuXgAc?= =?us-ascii?Q?OM5NIuvRdbKbrKM3P4mzfiu9jwbCYC4QdsfMGJ9YDg5fshexDy3sNIexqzbZ?= =?us-ascii?Q?XlrzDvbFKyC/mJpjcnSGvc7kMiLJhmetZslOnR8sK5DbmArLi3wukFguqFih?= =?us-ascii?Q?nV6UwPgj347oUKfo4XHw2FqqCR67kyyWpN4ZExAlY+6fxO0iKSFk2pItXSCG?= =?us-ascii?Q?Lsi3cwTH8OD3jpyH0qiwcg3wbQvYihK47phCQFBMUdwsCPOPZOo2abrkgcGU?= =?us-ascii?Q?rHUXYsff9GWyHnyPbBYP7mWPHLh8vULB3AfnUO1l3uTtewUt+kkBlF+11nl3?= =?us-ascii?Q?Ln+IVJZIYSKqiQvRwnnX8SGJeDC6mVf0xkjZeOcctr0dsggUpOkkUYo4LvW0?= =?us-ascii?Q?AkwEQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1983; 6:UC9Ulboa7uG5vgqk2YVtDBssRh4S3tdhFhFiSd7T+9rl2U9AtBxkFm1GzzlgPnUrH+TmyHhYW+She0uYIOmWemLHwV3PMjz5xkFBZZi08j8m3zddehB4JiDQDEqgcoTmCsMAVBbam9BEasqUybwHf7JkJj6C7CeG3irTCk24Z/LdNM6NOJ5HOsiODzx1I9ahE/wK1bgspWr1x5Kzmsu9P9f96EtNbe149o6420DKFi0namEsD2RG0gYlcWWlZb+p+dZxayAWtDZWAbX2/E1G/GlvTiXRCAxaceEzNxMYouT+iD9KNbcbnVAImf03NU80AadfpvFaTge3iR9N9ss2VUWwgOT3avv5VzdpIPR/AEVXPg5eU1rQvKhWOfvN7Fbu5XA5I83gUeCsZtr/6Gn5GziynUV0JV2Z711B2AojnDTZw6toEymyPFN0LqDnt4rES3ZGtN8Vkggaxw3y/xIH2j3D7yd/w32YijjixykUsXkEtCviQpb/oVSSMLEHeneOdATo0JscEc1mRRiiQD4tVzpSBjVYlPI1JDcgGEtX9GE=; 5:71TBfmKeDHpjzyf85LThxbDNsXjsqPWDT3499aqQDmwTwTeK2T+ORTamqSdmtohLj0hcV1WNVgf87NuPr1sIEQxG6GnvdyyKrL+VoYqenqDs436YMoVP3pNEQBzsbS+n0PYjWYJ/0JZO8E43DD12zA==; 24:1NRiADSoVafDvWIGtBUKbycj0U7ZeUGfj+aEW39vqj9jBWva18XkglDOpr0iCwJ4xPsKQOl8GtrwiKu/XO0ykeRCp2CLsQnO9Pw4wpFvdmU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1983; 7:wG0uG0pRoFveZw0OCFq0zF5a68D2SHYahuNRTQ/mMM2710yPaTHqYYIrlkXBGuukMm0CcOg9NgMdRS/VLUuKhJfcibKwMdYrWev1+F0+QYFU5lxggRJXSQqiC10I4sw5LOEZzdElVom8ACCp/M8/nEeqlipM+NL16lXYCghckugE4zh9J6LM/U6YDxlgdgI4Tlnwqtwq7/Uuyi+fJRth55zaEGvwwRWoXH2frE+ZKzVpnuK4RMNUUfrxNacDj5AoRw9GUGKZ9mWra6SnW2EAaHfbTICvy4moyZWHopq9kuKx6Oq6G5R+WYDZ4eK6e7h1CIGxyRwCUhacRrKxbNdY4w== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2017 00:25:07.3646 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[p-emfe01a-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR05MB1983 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 May 2017 00:25:10 -0000 Konstantin Belousov wrote: > > Consider a downstream vendor who has support for signed binary > > executions. If rtld allows a backdoor around exec(2) to run an unsigned > > binary, that could be a problem for them. It is on them to add support > > to exec(2) to validate the special case of execing rtld with an > > argument, or to just disable the feature in rtld from this commit. > > Note the undocumented O_VERIFY flag in open(2) from the patch. > This is very vendor-ish addition to request veriexec (?). Yep, we make rtld use O_VERIFY so that it will not load/link anything which is unsigned. From owner-svn-src-head@freebsd.org Tue May 16 02:48:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA4B9D6F84A; Tue, 16 May 2017 02:48:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id AB186F44; Tue, 16 May 2017 02:48:47 +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 v4G2mk1n068886; Tue, 16 May 2017 02:48:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4G2mkKb068885; Tue, 16 May 2017 02:48:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201705160248.v4G2mkKb068885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 16 May 2017 02:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318333 - head/contrib/ipfilter/tools X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 02:48:48 -0000 Author: cy Date: Tue May 16 02:48:46 2017 New Revision: 318333 URL: https://svnweb.freebsd.org/changeset/base/318333 Log: Implement ippool command line IPv6 address parse support (for the -i option). PR: 218433 Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Tue May 16 02:23:54 2017 (r318332) +++ head/contrib/ipfilter/tools/ippool.c Tue May 16 02:48:46 2017 (r318333) @@ -1030,45 +1030,80 @@ int setnodeaddr(int type, int role, void *ptr, char *arg) { struct in_addr mask; + sa_family_t family; char *s; - s = strchr(arg, '/'); - if (s == NULL) - mask.s_addr = 0xffffffff; - else if (strchr(s, '.') == NULL) { - if (ntomask(AF_INET, atoi(s + 1), &mask.s_addr) != 0) - return -1; + if (strchr(arg, ':') == NULL) { + family = AF_INET; + s = strchr(arg, '/'); + if (s == NULL) + mask.s_addr = 0xffffffff; + else if (strchr(s, '.') == NULL) { + if (ntomask(AF_INET, atoi(s + 1), &mask.s_addr) != 0) + return -1; + } else { + mask.s_addr = inet_addr(s + 1); + } + if (s != NULL) + *s = '\0'; } else { - mask.s_addr = inet_addr(s + 1); + family = AF_INET6; + + /* XXX for now we use mask for IPv6 prefix length */ + /* XXX mask should be a union with prefix */ + /* XXX Currently address handling is sloppy. */ + + if ((s = strchr(arg, '/')) == NULL) + mask.s_addr = 128; + else + mask.s_addr = atoi(s + 1); } - if (s != NULL) - *s = '\0'; if (type == IPLT_POOL) { ip_pool_node_t *node = ptr; + node->ipn_addr.adf_family = family; + #ifdef USE_INET6 - if (node->ipn_addr.adf_family == AF_INET) + if (node->ipn_addr.adf_family == AF_INET) { #endif node->ipn_addr.adf_len = offsetof(addrfamily_t, adf_addr) + sizeof(struct in_addr); + node->ipn_addr.adf_addr.in4.s_addr = inet_addr(arg); #ifdef USE_INET6 - else + } else { node->ipn_addr.adf_len = offsetof(addrfamily_t, adf_addr) + sizeof(struct in6_addr); + inet_pton(AF_INET6, arg, + &node->ipn_addr.adf_addr.in6.s6_addr); + } #endif - node->ipn_addr.adf_addr.in4.s_addr = inet_addr(arg); node->ipn_mask.adf_len = node->ipn_addr.adf_len; node->ipn_mask.adf_addr.in4.s_addr = mask.s_addr; } else if (type == IPLT_HASH) { iphtent_t *node = ptr; - node->ipe_addr.in4.s_addr = inet_addr(arg); - node->ipe_mask.in4.s_addr = mask.s_addr; - node->ipe_family = AF_INET; - node->ipe_unit = role; + node->ipe_family = family; + node->ipe_unit = role; + +#ifdef USE_INET6 + if (node->ipe_family == AF_INET) { +#endif + node->ipe_addr.in4.s_addr = inet_addr(arg); + node->ipe_mask.in4.s_addr = mask.s_addr; +#ifdef USE_INET6 + } else { + inet_pton(AF_INET6, arg, + &node->ipe_addr.in6.__u6_addr.__u6_addr32); + node->ipe_mask.in6.__u6_addr.__u6_addr32[0] = + mask.s_addr; + node->ipe_mask.in6.__u6_addr.__u6_addr32[1] = + node->ipe_mask.in6.__u6_addr.__u6_addr32[2] = + node->ipe_mask.in6.__u6_addr.__u6_addr32[3] = 0; + } +#endif } return 0; From owner-svn-src-head@freebsd.org Tue May 16 03:12:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2440D6FA0F; Tue, 16 May 2017 03:12:52 +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 mx1.freebsd.org (Postfix) with ESMTPS id A3F51166; Tue, 16 May 2017 03:12:52 +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 v4G3CpYu081468; Tue, 16 May 2017 03:12:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4G3CpWN081467; Tue, 16 May 2017 03:12:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201705160312.v4G3CpWN081467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 May 2017 03:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318334 - head/targets/pseudo/clang X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 03:12:52 -0000 Author: bdrewery Date: Tue May 16 03:12:51 2017 New Revision: 318334 URL: https://svnweb.freebsd.org/changeset/base/318334 Log: Enable llvm-objdump by default per r310775 Modified: head/targets/pseudo/clang/Makefile.depend Modified: head/targets/pseudo/clang/Makefile.depend ============================================================================== --- head/targets/pseudo/clang/Makefile.depend Tue May 16 02:48:46 2017 (r318333) +++ head/targets/pseudo/clang/Makefile.depend Tue May 16 03:12:51 2017 (r318334) @@ -9,6 +9,7 @@ DIRDEPS = \ share/doc/llvm/clang \ usr.bin/clang/clang \ usr.bin/clang/clang-tblgen \ + usr.bin/clang/llvm-objdump \ usr.bin/clang/llvm-tblgen \ .if ${MK_LLDB} == "yes" @@ -38,7 +39,6 @@ DIRDEPS+= \ usr.bin/clang/llvm-mc \ usr.bin/clang/llvm-modextract \ usr.bin/clang/llvm-nm \ - usr.bin/clang/llvm-objdump \ usr.bin/clang/llvm-pdbdump \ usr.bin/clang/llvm-profdata \ usr.bin/clang/llvm-rtdyld \ From owner-svn-src-head@freebsd.org Tue May 16 03:31:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D5BED6F65E; Tue, 16 May 2017 03:31:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 142C3104A; Tue, 16 May 2017 03:31:51 +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 v4G3Vovm087430; Tue, 16 May 2017 03:31:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4G3VnhK087426; Tue, 16 May 2017 03:31:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201705160331.v4G3VnhK087426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 16 May 2017 03:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318335 - in head/sys/powerpc: include powerpc X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 03:31:51 -0000 Author: jhibbits Date: Tue May 16 03:31:49 2017 New Revision: 318335 URL: https://svnweb.freebsd.org/changeset/base/318335 Log: Correct pa argument type for pmap_kenter_attr() Physical addresses are vm_paddr_t, not vm_offset_t. This can make a difference when sizeof(vm_offset_t) != sizeof(vm_paddr_t). Modified: head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/bus_machdep.c head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Tue May 16 03:12:51 2017 (r318334) +++ head/sys/powerpc/include/pmap.h Tue May 16 03:31:49 2017 (r318335) @@ -251,7 +251,7 @@ extern struct pmap kernel_pmap_store; void pmap_bootstrap(vm_offset_t, vm_offset_t); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); -void pmap_kenter_attr(vm_offset_t va, vm_offset_t pa, vm_memattr_t); +void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, vm_memattr_t); void pmap_kremove(vm_offset_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t); Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Tue May 16 03:12:51 2017 (r318334) +++ head/sys/powerpc/powerpc/bus_machdep.c Tue May 16 03:31:49 2017 (r318335) @@ -105,8 +105,9 @@ bs_gen_map(bus_addr_t addr, bus_size_t s void bs_remap_earlyboot(void) { + vm_paddr_t pa, spa; + vm_offset_t va; int i; - vm_offset_t pa, spa, va; vm_memattr_t ma; for (i = 0; i < earlyboot_map_idx; i++) { Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Tue May 16 03:12:51 2017 (r318334) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Tue May 16 03:31:49 2017 (r318335) @@ -495,7 +495,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p } void -pmap_kenter_attr(vm_offset_t va, vm_offset_t pa, vm_memattr_t ma) +pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, vm_memattr_t ma) { CTR4(KTR_PMAP, "%s(%#x, %#x, %#x)", __func__, va, pa, ma); From owner-svn-src-head@freebsd.org Tue May 16 04:47:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88665D6FFA5; Tue, 16 May 2017 04:47:52 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 490791F28; Tue, 16 May 2017 04:47:52 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4G4lpgB018175; Tue, 16 May 2017 04:47:51 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4G4lpJd018173; Tue, 16 May 2017 04:47:51 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201705160447.v4G4lpJd018173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 16 May 2017 04:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318336 - head/sys/arm/mv X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 04:47:52 -0000 Author: loos Date: Tue May 16 04:47:50 2017 New Revision: 318336 URL: https://svnweb.freebsd.org/changeset/base/318336 Log: Add the SDHCI Address Decoder registers and routines for ARMADA 38X. Tested on: ClearFog Pro Reviewed by: Marcin Wojtas Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D10601 Modified: head/sys/arm/mv/mv_common.c head/sys/arm/mv/mvwin.h Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Tue May 16 03:31:49 2017 (r318335) +++ head/sys/arm/mv/mv_common.c Tue May 16 04:47:50 2017 (r318336) @@ -82,6 +82,7 @@ static int decode_win_usb3_valid(void); static int decode_win_eth_valid(void); static int decode_win_pcie_valid(void); static int decode_win_sata_valid(void); +static int decode_win_sdhci_valid(void); static int decode_win_idma_valid(void); static int decode_win_xor_valid(void); @@ -95,6 +96,7 @@ static void decode_win_usb3_setup(u_long static void decode_win_eth_setup(u_long); static void decode_win_sata_setup(u_long); static void decode_win_ahci_setup(u_long); +static void decode_win_sdhci_setup(u_long); static void decode_win_idma_setup(u_long); static void decode_win_xor_setup(u_long); @@ -105,6 +107,7 @@ static void decode_win_eth_dump(u_long b static void decode_win_idma_dump(u_long base); static void decode_win_xor_dump(u_long base); static void decode_win_ahci_dump(u_long base); +static void decode_win_sdhci_dump(u_long); static int fdt_get_ranges(const char *, void *, int, int *, int *); #ifdef SOC_MV_ARMADA38X @@ -138,6 +141,7 @@ static struct soc_node_spec soc_nodes[] { "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump }, { "marvell,armada-380-xhci", &decode_win_usb3_setup, &decode_win_usb3_dump }, { "marvell,armada-380-ahci", &decode_win_ahci_setup, &decode_win_ahci_dump }, + { "marvell,armada-380-sdhci", &decode_win_sdhci_setup, &decode_win_sdhci_dump }, { "mrvl,sata", &decode_win_sata_setup, NULL }, { "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump }, { "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump }, @@ -568,7 +572,8 @@ soc_decode_win(void) if (!decode_win_cpu_valid() || !decode_win_usb_valid() || !decode_win_eth_valid() || !decode_win_idma_valid() || !decode_win_pcie_valid() || !decode_win_sata_valid() || - !decode_win_xor_valid() || !decode_win_usb3_valid()) + !decode_win_xor_valid() || !decode_win_usb3_valid() || + !decode_win_sdhci_valid()) return (EINVAL); decode_win_cpu_setup(); @@ -659,6 +664,11 @@ WIN_REG_BASE_IDX_RD(win_sata, sz, MV_WIN WIN_REG_BASE_IDX_WR(win_sata, sz, MV_WIN_SATA_SIZE); #endif +WIN_REG_BASE_IDX_RD(win_sdhci, cr, MV_WIN_SDHCI_CTRL); +WIN_REG_BASE_IDX_RD(win_sdhci, br, MV_WIN_SDHCI_BASE); +WIN_REG_BASE_IDX_WR(win_sdhci, cr, MV_WIN_SDHCI_CTRL); +WIN_REG_BASE_IDX_WR(win_sdhci, br, MV_WIN_SDHCI_BASE); + #ifndef SOC_MV_DOVE WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) @@ -2073,6 +2083,60 @@ decode_win_sata_valid(void) return (decode_win_can_cover_ddr(MV_WIN_SATA_MAX)); } +static void +decode_win_sdhci_setup(u_long base) +{ + uint32_t cr, br; + int i, j; + + for (i = 0; i < MV_WIN_SDHCI_MAX; i++) { + win_sdhci_cr_write(base, i, 0); + win_sdhci_br_write(base, i, 0); + } + + for (i = 0; i < MV_WIN_DDR_MAX; i++) + if (ddr_is_active(i)) { + br = ddr_base(i); + cr = (((ddr_size(i) - 1) & + (IO_WIN_SIZE_MASK << IO_WIN_SIZE_SHIFT)) | + (ddr_attr(i) << IO_WIN_ATTR_SHIFT) | + (ddr_target(i) << IO_WIN_TGT_SHIFT) | + IO_WIN_ENA_MASK); + + /* Use the first available SDHCI window */ + for (j = 0; j < MV_WIN_SDHCI_MAX; j++) { + if (win_sdhci_cr_read(base, j) & IO_WIN_ENA_MASK) + continue; + + win_sdhci_cr_write(base, j, cr); + win_sdhci_br_write(base, j, br); + break; + } + } +} + +static void +decode_win_sdhci_dump(u_long base) +{ + int i; + + for (i = 0; i < MV_WIN_SDHCI_MAX; i++) + printf("SDHCI window#%d: c 0x%08x, b 0x%08x\n", i, + win_sdhci_cr_read(base, i), win_sdhci_br_read(base, i)); +} + +static int +decode_win_sdhci_valid(void) +{ + +#ifdef SOC_MV_ARMADA38X + return (decode_win_can_cover_ddr(MV_WIN_SDHCI_MAX)); +#endif + + /* Satisfy platforms not equipped with this controller. */ + return (1); +} + /************************************************************************** * FDT parsing routines. **************************************************************************/ Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Tue May 16 03:31:49 2017 (r318335) +++ head/sys/arm/mv/mvwin.h Tue May 16 04:47:50 2017 (r318336) @@ -296,6 +296,10 @@ #define MV_WIN_SATA_MAX 4 #endif +#define MV_WIN_SDHCI_CTRL(n) (0x8 * (n) + 0x4080) +#define MV_WIN_SDHCI_BASE(n) (0x8 * (n) + 0x4084) +#define MV_WIN_SDHCI_MAX 8 + #if defined(SOC_MV_ARMADA38X) #define MV_BOOTROM_MEM_ADDR 0xFFF00000 #define MV_BOOTROM_WIN_SIZE 0xF From owner-svn-src-head@freebsd.org Tue May 16 05:10:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 713DFD6ECE4; Tue, 16 May 2017 05:10:17 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 334C81246; Tue, 16 May 2017 05:10:17 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4G5AGHk026026; Tue, 16 May 2017 05:10:16 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4G5AGVG026023; Tue, 16 May 2017 05:10:16 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201705160510.v4G5AGVG026023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 16 May 2017 05:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318337 - in head/sys: arm/conf arm/mv/armada38x dev/sdhci X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 05:10:17 -0000 Author: loos Date: Tue May 16 05:10:15 2017 New Revision: 318337 URL: https://svnweb.freebsd.org/changeset/base/318337 Log: Add the Marvell SDHCI controller to the list of supported devices in sdhci_fdt. Enable the SDHCI controller, bus and devices on ARMADA38X kernel. Tested on: ClearFog Pro Reviewed by: Marcin Wojtas Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D10606 Modified: head/sys/arm/conf/ARMADA38X head/sys/arm/mv/armada38x/files.armada38x head/sys/dev/sdhci/sdhci_fdt.c Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Tue May 16 04:47:50 2017 (r318336) +++ head/sys/arm/conf/ARMADA38X Tue May 16 05:10:15 2017 (r318337) @@ -63,6 +63,11 @@ device scbus device pass device da +# MMC/SD/SDIO Card slot support +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # mmc/sd host controller + # SATA device ahci Modified: head/sys/arm/mv/armada38x/files.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/files.armada38x Tue May 16 04:47:50 2017 (r318336) +++ head/sys/arm/mv/armada38x/files.armada38x Tue May 16 05:10:15 2017 (r318337) @@ -8,3 +8,4 @@ arm/mv/armada38x/armada38x_mp.c optional arm/mv/armada38x/pmsu.c standard arm/mv/armada38x/rtc.c standard arm/mv/armada38x/armada38x_pl310.c optional pl310 +dev/sdhci/sdhci_fdt.c optional sdhci Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Tue May 16 04:47:50 2017 (r318336) +++ head/sys/dev/sdhci/sdhci_fdt.c Tue May 16 05:10:15 2017 (r318337) @@ -57,7 +57,17 @@ __FBSDID("$FreeBSD$"); #include "mmcbr_if.h" #include "sdhci_if.h" -#define MAX_SLOTS 6 +#define MAX_SLOTS 6 +#define SDHCI_FDT_ARMADA38X 1 +#define SDHCI_FDT_GENERIC 2 +#define SDHCI_FDT_XLNX_ZY7 3 + +static struct ofw_compat_data compat_data[] = { + { "marvell,armada-380-sdhci", SDHCI_FDT_ARMADA38X }, + { "sdhci_generic", SDHCI_FDT_GENERIC }, + { "xlnx,zy7_sdhci", SDHCI_FDT_XLNX_ZY7 }, + { NULL, 0 } +}; struct sdhci_fdt_softc { device_t dev; /* Controller device */ @@ -181,13 +191,21 @@ sdhci_fdt_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "sdhci_generic")) { + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { + case SDHCI_FDT_ARMADA38X: + sc->quirks = SDHCI_QUIRK_BROKEN_AUTO_STOP; + device_set_desc(dev, "ARMADA38X SDHCI controller"); + break; + case SDHCI_FDT_GENERIC: device_set_desc(dev, "generic fdt SDHCI controller"); - } else if (ofw_bus_is_compatible(dev, "xlnx,zy7_sdhci")) { + break; + case SDHCI_FDT_XLNX_ZY7: sc->quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; device_set_desc(dev, "Zynq-7000 generic fdt SDHCI controller"); - } else + break; + default: return (ENXIO); + } node = ofw_bus_get_node(dev); From owner-svn-src-head@freebsd.org Tue May 16 13:27:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FBD5D6CEA7; Tue, 16 May 2017 13:27:46 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 07C4FFDC; Tue, 16 May 2017 13:27:45 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GDRjbR029554; Tue, 16 May 2017 13:27:45 GMT (envelope-from jonathan@FreeBSD.org) Received: (from jonathan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GDRj63029553; Tue, 16 May 2017 13:27:45 GMT (envelope-from jonathan@FreeBSD.org) Message-Id: <201705161327.v4GDRj63029553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jonathan set sender to jonathan@FreeBSD.org using -f From: Jonathan Anderson Date: Tue, 16 May 2017 13:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318352 - head/libexec/rtld-elf X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 13:27:46 -0000 Author: jonathan Date: Tue May 16 13:27:44 2017 New Revision: 318352 URL: https://svnweb.freebsd.org/changeset/base/318352 Log: Rename rtld's parse_libdir to parse_integer. This is a more accurate name, as the integer doesn't have to be a library directory descriptor. It is also a prerequisite for more argument parsing coming in the near future (e.g., parsing explicit binary descriptors). Reviewed by: kib MFC after: 2 weeks Sponsored by: NSERC Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue May 16 11:52:27 2017 (r318351) +++ head/libexec/rtld-elf/rtld.c Tue May 16 13:27:44 2017 (r318352) @@ -115,7 +115,7 @@ static void objlist_push_head(Objlist *, static void objlist_push_tail(Objlist *, Obj_Entry *); static void objlist_put_after(Objlist *, Obj_Entry *, Obj_Entry *); static void objlist_remove(Objlist *, Obj_Entry *); -static int parse_libdir(const char *); +static int parse_integer(const char *); static void *path_enumerate(const char *, path_enum_proc, void *); static void release_object(Obj_Entry *); static int relocate_object_dag(Obj_Entry *root, bool bind_now, @@ -3033,9 +3033,12 @@ search_library_pathfds(const char *name, envcopy = xstrdup(path); for (fdstr = strtok_r(envcopy, ":", &last_token); fdstr != NULL; fdstr = strtok_r(NULL, ":", &last_token)) { - dirfd = parse_libdir(fdstr); - if (dirfd < 0) + dirfd = parse_integer(fdstr); + if (dirfd < 0) { + _rtld_error("failed to parse directory FD: '%s'", + fdstr); break; + } fd = __sys_openat(dirfd, name, O_RDONLY | O_CLOEXEC | O_VERIFY); if (fd >= 0) { *fdp = fd; @@ -5236,29 +5239,27 @@ symlook_init_from_req(SymLook *dst, cons * Parse a file descriptor number without pulling in more of libc (e.g. atoi). */ static int -parse_libdir(const char *str) +parse_integer(const char *str) { static const int RADIX = 10; /* XXXJA: possibly support hex? */ const char *orig; - int fd; + int n; char c; orig = str; - fd = 0; + n = 0; for (c = *str; c != '\0'; c = *++str) { if (c < '0' || c > '9') return (-1); - fd *= RADIX; - fd += c - '0'; + n *= RADIX; + n += c - '0'; } /* Make sure we actually parsed something. */ - if (str == orig) { - _rtld_error("failed to parse directory FD from '%s'", str); + if (str == orig) return (-1); - } - return (fd); + return (n); } /* From owner-svn-src-head@freebsd.org Tue May 16 14:21:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 188DFD6EAF9; Tue, 16 May 2017 14:21:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id E8E47B91; Tue, 16 May 2017 14:21:38 +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 v4GELbDj057964; Tue, 16 May 2017 14:21:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GELbL8057958; Tue, 16 May 2017 14:21:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201705161421.v4GELbL8057958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 16 May 2017 14:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318353 - in head/sys: arm/arm arm64/arm64 mips/mips x86/x86 X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 14:21:39 -0000 Author: hselasky Date: Tue May 16 14:21:37 2017 New Revision: 318353 URL: https://svnweb.freebsd.org/changeset/base/318353 Log: Avoid use of contiguous memory allocations in busdma when possible. This patch improves the boundary checks in busdma to allow more cases using the regular page based kernel memory allocator. Especially in the case of having a non-zero boundary in the parent DMA tag. For example AMD64 based platforms set the PCI DMA tag boundary to PCI_DMA_BOUNDARY, 4GB, which before this patch caused contiguous memory allocations to be preferred when allocating more than PAGE_SIZE bytes. Even if the required alignment was less than PAGE_SIZE bytes. This patch also fixes the nsegments check for using kmem_alloc_attr() when the maximum segment size is less than PAGE_SIZE bytes. Updated some comments describing the code in question. Differential Revision: https://reviews.freebsd.org/D10645 Reviewed by: kib, jhb, gallatin, scottl MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/arm/arm/busdma_machdep-v4.c head/sys/arm/arm/busdma_machdep-v6.c head/sys/arm64/arm64/busdma_bounce.c head/sys/mips/mips/busdma_machdep.c head/sys/x86/x86/busdma_bounce.c Modified: head/sys/arm/arm/busdma_machdep-v4.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v4.c Tue May 16 13:27:44 2017 (r318352) +++ head/sys/arm/arm/busdma_machdep-v4.c Tue May 16 14:21:37 2017 (r318353) @@ -736,8 +736,10 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi if (bufzone != NULL && dmat->alignment <= bufzone->size && !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) { *vaddr = uma_zalloc(bufzone->umazone, mflags); - } else if (dmat->nsegments >= btoc(dmat->maxsize) && - dmat->alignment <= PAGE_SIZE && dmat->boundary == 0) { + } else if (dmat->nsegments >= + howmany(dmat->maxsize, MIN(dmat->maxsegsz, PAGE_SIZE)) && + dmat->alignment <= PAGE_SIZE && + (dmat->boundary % PAGE_SIZE) == 0) { *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->maxsize, mflags, 0, dmat->lowaddr, memattr); } else { Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Tue May 16 13:27:44 2017 (r318352) +++ head/sys/arm/arm/busdma_machdep-v6.c Tue May 16 14:21:37 2017 (r318353) @@ -779,7 +779,9 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi * (the allocator aligns buffers to their size boundaries). * - There's no need to handle lowaddr/highaddr exclusion zones. * else allocate non-contiguous pages if... - * - The page count that could get allocated doesn't exceed nsegments. + * - The page count that could get allocated doesn't exceed + * nsegments also when the maximum segment size is less + * than PAGE_SIZE. * - The alignment constraint isn't larger than a page boundary. * - There are no boundary-crossing constraints. * else allocate a block of contiguous pages because one or more of the @@ -788,8 +790,10 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi if (bufzone != NULL && dmat->alignment <= bufzone->size && !exclusion_bounce(dmat)) { *vaddr = uma_zalloc(bufzone->umazone, mflags); - } else if (dmat->nsegments >= btoc(dmat->maxsize) && - dmat->alignment <= PAGE_SIZE && dmat->boundary == 0) { + } else if (dmat->nsegments >= + howmany(dmat->maxsize, MIN(dmat->maxsegsz, PAGE_SIZE)) && + dmat->alignment <= PAGE_SIZE && + (dmat->boundary % PAGE_SIZE) == 0) { *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->maxsize, mflags, 0, dmat->lowaddr, memattr); } else { Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Tue May 16 13:27:44 2017 (r318352) +++ head/sys/arm64/arm64/busdma_bounce.c Tue May 16 14:21:37 2017 (r318353) @@ -461,22 +461,35 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm (*mapp)->flags = DMAMAP_FROM_DMAMEM; /* - * XXX: - * (dmat->alignment <= dmat->maxsize) is just a quick hack; the exact - * alignment guarantees of malloc need to be nailed down, and the - * code below should be rewritten to take that into account. + * Allocate the buffer from the malloc(9) allocator if... + * - It's small enough to fit into a single power of two sized bucket. + * - The alignment is less than or equal to the maximum size + * - The low address requirement is fulfilled. + * else allocate non-contiguous pages if... + * - The page count that could get allocated doesn't exceed + * nsegments also when the maximum segment size is less + * than PAGE_SIZE. + * - The alignment constraint isn't larger than a page boundary. + * - There are no boundary-crossing constraints. + * else allocate a block of contiguous pages because one or more of the + * constraints is something that only the contig allocator can fulfill. * - * In the meantime, we'll warn the user if malloc gets it wrong. + * NOTE: The (dmat->common.alignment <= dmat->maxsize) check + * below is just a quick hack. The exact alignment guarantees + * of malloc(9) need to be nailed down, and the code below + * should be rewritten to take that into account. + * + * In the meantime warn the user if malloc gets it wrong. */ if ((dmat->common.maxsize <= PAGE_SIZE) && (dmat->common.alignment <= dmat->common.maxsize) && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); - } else if (dmat->common.nsegments >= btoc(dmat->common.maxsize) && + } else if (dmat->common.nsegments >= + howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && dmat->common.alignment <= PAGE_SIZE && - (dmat->common.boundary == 0 || - dmat->common.boundary >= dmat->common.lowaddr)) { + (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Tue May 16 13:27:44 2017 (r318352) +++ head/sys/mips/mips/busdma_machdep.c Tue May 16 14:21:37 2017 (r318353) @@ -690,7 +690,9 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi * (the allocator aligns buffers to their size boundaries). * - There's no need to handle lowaddr/highaddr exclusion zones. * else allocate non-contiguous pages if... - * - The page count that could get allocated doesn't exceed nsegments. + * - The page count that could get allocated doesn't exceed + * nsegments also when the maximum segment size is less + * than PAGE_SIZE. * - The alignment constraint isn't larger than a page boundary. * - There are no boundary-crossing constraints. * else allocate a block of contiguous pages because one or more of the @@ -699,8 +701,10 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi if (bufzone != NULL && dmat->alignment <= bufzone->size && !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) { vaddr = uma_zalloc(bufzone->umazone, mflags); - } else if (dmat->nsegments >= btoc(dmat->maxsize) && - dmat->alignment <= PAGE_SIZE && dmat->boundary == 0) { + } else if (dmat->nsegments >= + howmany(dmat->maxsize, MIN(dmat->maxsegsz, PAGE_SIZE)) && + dmat->alignment <= PAGE_SIZE && + (dmat->boundary % PAGE_SIZE) == 0) { vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->maxsize, mflags, 0, dmat->lowaddr, memattr); } else { Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue May 16 13:27:44 2017 (r318352) +++ head/sys/x86/x86/busdma_bounce.c Tue May 16 14:21:37 2017 (r318353) @@ -396,23 +396,36 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm else attr = VM_MEMATTR_DEFAULT; - /* - * XXX: - * (dmat->alignment <= dmat->maxsize) is just a quick hack; the exact - * alignment guarantees of malloc need to be nailed down, and the - * code below should be rewritten to take that into account. + /* + * Allocate the buffer from the malloc(9) allocator if... + * - It's small enough to fit into a single power of two sized bucket. + * - The alignment is less than or equal to the maximum size + * - The low address requirement is fulfilled. + * else allocate non-contiguous pages if... + * - The page count that could get allocated doesn't exceed + * nsegments also when the maximum segment size is less + * than PAGE_SIZE. + * - The alignment constraint isn't larger than a page boundary. + * - There are no boundary-crossing constraints. + * else allocate a block of contiguous pages because one or more of the + * constraints is something that only the contig allocator can fulfill. + * + * NOTE: The (dmat->common.alignment <= dmat->maxsize) check + * below is just a quick hack. The exact alignment guarantees + * of malloc(9) need to be nailed down, and the code below + * should be rewritten to take that into account. * - * In the meantime, we'll warn the user if malloc gets it wrong. + * In the meantime warn the user if malloc gets it wrong. */ if ((dmat->common.maxsize <= PAGE_SIZE) && (dmat->common.alignment <= dmat->common.maxsize) && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); - } else if (dmat->common.nsegments >= btoc(dmat->common.maxsize) && + } else if (dmat->common.nsegments >= + howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && dmat->common.alignment <= PAGE_SIZE && - (dmat->common.boundary == 0 || - dmat->common.boundary >= dmat->common.lowaddr)) { + (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, From owner-svn-src-head@freebsd.org Tue May 16 16:20:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53FB3D70713; Tue, 16 May 2017 16:20:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 23BB81FE2; Tue, 16 May 2017 16:20:24 +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 v4GGKNMq007161; Tue, 16 May 2017 16:20:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GGKNvs007160; Tue, 16 May 2017 16:20:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201705161620.v4GGKNvs007160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 16 May 2017 16:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318354 - head/sys/amd64/amd64 X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 16:20:24 -0000 Author: cem Date: Tue May 16 16:20:22 2017 New Revision: 318354 URL: https://svnweb.freebsd.org/changeset/base/318354 Log: Correct page frame mask constant used in pmap_change_attr_locked This was introduced in r290156. It's present in 11.0, but not any 10.x release unless someone decided to MFC it. It affects ordinary pages right above the DMAP limit, which is effectively system memory rounded up to a 1 GB (3rd level superpage) boundary (or up to a minimum of 4 GB, on small systems). Reported by: vangyzen Reviewed by: kib, alc Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D4030 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue May 16 14:21:37 2017 (r318353) +++ head/sys/amd64/amd64/pmap.c Tue May 16 16:20:22 2017 (r318354) @@ -6691,7 +6691,7 @@ pmap_change_attr_locked(vm_offset_t va, changed = TRUE; } if (tmpva >= VM_MIN_KERNEL_ADDRESS && - (*pte & PG_PS_FRAME) < dmaplimit) { + (*pte & PG_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pte & PG_FRAME; From owner-svn-src-head@freebsd.org Tue May 16 16:35:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E55D70D94; Tue, 16 May 2017 16:35:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::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 B2809F44; Tue, 16 May 2017 16:35:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id h64so17253889pge.3; Tue, 16 May 2017 09:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=M5rDAUjt54kGgZ5ND17eI9dq2Uyn9WP0/KFat5TlO1Q=; b=g8K+nV3FZSm0tGv07pL2Ujz7ItiF36h/MT3+CEcqEnwA+q1pxNs2M6eWeusLzNOPZZ gdDn+joPuQK7LSRJj7s7CbVeGuyKYjkxxnIGGg5qtYd/lRNriP2Ha3ARR5Yd6mDVlada 7tfHrzkWoOV3Q53w+MvLhHntGuPW+HBkMzUkRTkOSRs5YaopBbVoVy5SbEAjPdXxteN7 pbTe82A2RTjVTvyUDHf+NZ/UbqyuTxQTtS0gOn2joM314saNUIZrfO9PvpfWWzHYwkTI FeSOirOU+0lwV4CakEx0D+sLLf7z1Es7k9Vry6GkdQ3ziLL3VSlgUWeR64a8MSmvEAax GnxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=M5rDAUjt54kGgZ5ND17eI9dq2Uyn9WP0/KFat5TlO1Q=; b=NNLseX+4WN6SIhiGn0/8O60jMyq4fuPMVGxA5TCU3QAlD5cR8DSYgt92qF6AfvUCLK QpCbkwd3ZIsSI7TE0F+xiKm7rnwDdlsSNeTZxAbsxU1808rdfkltakOKUgpOhRDW7fh3 iKCWmV4MwE3BDmjTYgLPz73grEXgbtWdXZEaxfEj7OWUry0773SeOz3fBa1Je23kPem+ u5XQsGK4FdqdX6gRyiZNpDo8H1+mxgBa4sQb+ypPcHzFfEAMQv82rOOVG6TJlBGkYUkp HKZAP9FYJ2C5rZhTiIerMeRxM3UIcQeXRPbbidhAF+c1ov+ukyllrEvOAFjpajIs6Ttb Dhcg== X-Gm-Message-State: AODbwcC3Pne/Wu45aQQ+ns/TFZRP6DrCePSJSukrUCNLSDD+vY5rn9jl 4rwABxaZIUQwpJX0a5w= X-Received: by 10.98.193.129 with SMTP id i123mr13398102pfg.203.1494952541953; Tue, 16 May 2017 09:35:41 -0700 (PDT) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id f193sm24718127pgc.54.2017.05.16.09.35.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 May 2017 09:35:41 -0700 (PDT) From: "Ngie Cooper (yaneurabeya)" Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_0EF24AAB-420A-4E62-84A9-0ECFAEBA3E8B"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r318354 - head/sys/amd64/amd64 Date: Tue, 16 May 2017 09:35:40 -0700 In-Reply-To: <201705161620.v4GGKNvs007160@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Conrad Meyer References: <201705161620.v4GGKNvs007160@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 May 2017 16:35:43 -0000 --Apple-Mail=_0EF24AAB-420A-4E62-84A9-0ECFAEBA3E8B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 16, 2017, at 9:20 AM, Conrad Meyer wrote: >=20 > Author: cem > Date: Tue May 16 16:20:22 2017 > New Revision: 318354 > URL: https://svnweb.freebsd.org/changeset/base/318354 >=20 > Log: > Correct page frame mask constant used in pmap_change_attr_locked >=20 > This was introduced in r290156. It's present in 11.0, but not any = 10.x > release unless someone decided to MFC it. Hi Conrad, It wasn=E2=80=99t MFCed according to = https://svnweb.freebsd.org/base/stable/10/sys/amd64/amd64/pmap.c = , so = that=E2=80=99s ok. Could you please MFC this change since you understand it/made = it? Thank you, -Ngie --Apple-Mail=_0EF24AAB-420A-4E62-84A9-0ECFAEBA3E8B 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----- iQIcBAEBCgAGBQJZGypdAAoJEPWDqSZpMIYVg0AP/RaN/J0uG3pCy+Oepu/IGXcS 1ukBZrKTgB1PKwqwGBl8PogcEFeFJGdeL5T7ElrQiyr9fohodZ1qTHa4w/7ONAKr FUd+88sNjSPyxB3cxG67UX6rhezwIqPvsM9/WJPxTWRdnY5GUhCDYNHDXNjKMkpa zR9+AsKzZ3YeBRkAZ5FS79ZOE5MVmnBfhP4YS8To41XAlWRH/R8zp4fP8eChrnh5 MnIUQgAjJWT7T3W4VNANfivz4dak0PPfVqGMAU45rmSL5rQTPpDf+5wKGIOag95A Fz9gCvOsgW7YcTqcL79f10gqujvMGcx0iUTFfKHoPujdab5ldnuNjQOJa83GNt7y TutXANM3HtQodzBx98Q71Yj7Of144h2mhrOlyAKOcr8QG3nABZVWhwr2cwCx6IVX 9Bx1KsCPgwNrOvanS0sMGM45CvKN+mG050wCvC4G1woyVJsEvkeOOs6XgXBc88OJ 73MoW56XszK9bQyeyy2m7TaTa5uLLGzMGdC61kFUiWxMvuQtgkgLuvUI8w0foaF2 iSTDtv+RZH/+zOj/wi7TAlIuh1CgY2vkhNvvrOCmDF38MFg5RXT0oBUhM4PD0uy5 1eUK1w94u6OetpUOn5QpVEhJAV/f+9wsfb3uc6VoG3Fixe8sVgjnp5XhTIWEz9yH PTK9QBQh8xpngSZtJ+kT =DiDb -----END PGP SIGNATURE----- --Apple-Mail=_0EF24AAB-420A-4E62-84A9-0ECFAEBA3E8B-- From owner-svn-src-head@freebsd.org Tue May 16 17:04:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F15BD6DB1B; Tue, 16 May 2017 17:04:52 +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 mx1.freebsd.org (Postfix) with ESMTPS id D49215E2; Tue, 16 May 2017 17:04:51 +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 v4GH4o15027480; Tue, 16 May 2017 17:04:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GH4ou7027476; Tue, 16 May 2017 17:04:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705161704.v4GH4ou7027476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 16 May 2017 17:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318355 - head/sbin/newfs_msdos X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 17:04:52 -0000 Author: emaste Date: Tue May 16 17:04:50 2017 New Revision: 318355 URL: https://svnweb.freebsd.org/changeset/base/318355 Log: newfs_msdos: add -T (timestamp) option for reproducible builds This includes some whitespace and minor bug fixes relative to NetBSD, which will be submitted upstream at the conclusion of the makefs msdos update. NetBSD revs: mkfs_msdos.c 1.11 mkfs_msdos.h 1.4 newfs_msdos.8 1.22 newfs_msdos.c 1.44 Submitted by: Siva Mahadevan Reviewed by: emaste Obtained from: NetBSD Sponsored by: The FreeBSD Foundation Modified: head/sbin/newfs_msdos/mkfs_msdos.c head/sbin/newfs_msdos/mkfs_msdos.h head/sbin/newfs_msdos/newfs_msdos.8 head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Tue May 16 16:20:22 2017 (r318354) +++ head/sbin/newfs_msdos/mkfs_msdos.c Tue May 16 17:04:50 2017 (r318355) @@ -566,9 +566,17 @@ mkfs_msdos(const char *fname, const char } print_bpb(&bpb); if (!o.no_create) { - gettimeofday(&tv, NULL); - now = tv.tv_sec; - tm = localtime(&now); + if (o.timestamp_set) { + tv.tv_sec = now = o.timestamp; + tv.tv_usec = 0; + tm = gmtime(&now); + } else { + gettimeofday(&tv, NULL); + now = tv.tv_sec; + tm = localtime(&now); + } + + if (!(img = malloc(bpb.bpbBytesPerSec))) { warn(NULL); goto done; Modified: head/sbin/newfs_msdos/mkfs_msdos.h ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.h Tue May 16 16:20:22 2017 (r318354) +++ head/sbin/newfs_msdos/mkfs_msdos.h Tue May 16 17:04:50 2017 (r318355) @@ -42,6 +42,7 @@ AOPT('L', const char *, volume_label, -1 AOPT('N', bool, no_create, -2, "Don't create filesystem, print params only") \ AOPT('O', const char *, OEM_string, -1, "OEM string") \ AOPT('S', uint16_t, bytes_per_sector, 1, "Bytes per sector") \ +AOPT('T', time_t, timestamp, 0, "Timestamp") \ AOPT('a', uint32_t, sectors_per_fat, 1, "Sectors per FAT") \ AOPT('b', uint32_t, block_size, 1, "Block size") \ AOPT('c', uint8_t, sectors_per_cluster, 1, "Sectors per cluster") \ @@ -61,6 +62,7 @@ struct msdos_options { #define AOPT(_opt, _type, _name, _min, _desc) _type _name; ALLOPTS #undef AOPT + uint32_t timestamp_set:1; uint32_t volume_id_set:1; uint32_t media_descriptor_set:1; uint32_t hidden_sectors_set:1; Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Tue May 16 16:20:22 2017 (r318354) +++ head/sbin/newfs_msdos/newfs_msdos.8 Tue May 16 17:04:50 2017 (r318355) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2015 +.Dd May 16, 2017 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -55,6 +55,7 @@ .Op Fl o Ar hidden .Op Fl r Ar reserved .Op Fl s Ar total +.Op Fl T Ar timestamp .Op Fl u Ar track-size .Ar special .Op Ar disktype @@ -159,6 +160,12 @@ Number of hidden sectors. Number of reserved sectors. .It Fl s Ar total File system size. +.It Fl T Ar timestamp +Specify a timestamp to be used for filesystem creation so that +it can be consistent for reproducible builds. +The timestamp can be a pathname (where the timestamps are derived from +that file) or an integer value interpreted +as the number of seconds since the Epoch. .It Fl u Ar track-size Number of sectors per track. .El Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Tue May 16 16:20:22 2017 (r318354) +++ head/sbin/newfs_msdos/newfs_msdos.c Tue May 16 17:04:50 2017 (r318355) @@ -31,7 +31,7 @@ static const char rcsid[] = #endif /* not lint */ #include - +#include #include #include #include @@ -51,13 +51,30 @@ static u_int argtou(const char *, u_int, static off_t argtooff(const char *, const char *); static void usage(void); +static time_t +get_tstamp(const char *b) +{ + struct stat st; + char *eb; + long long l; + + if (stat(b, &st) != -1) + return (time_t)st.st_mtime; + + errno = 0; + l = strtoll(b, &eb, 0); + if (b == eb || *eb || errno) + errx(EXIT_FAILURE, "Can't parse timestamp '%s'", b); + return (time_t)l; +} + /* * Construct a FAT12, FAT16, or FAT32 file system. */ int main(int argc, char *argv[]) { - static const char opts[] = "@:NB:C:F:I:L:O:S:a:b:c:e:f:h:i:k:m:n:o:r:s:u:"; + static const char opts[] = "@:NB:C:F:I:L:O:S:a:b:c:e:f:h:i:k:m:n:o:r:s:T:u:"; struct msdos_options o; const char *fname, *dtype; char buf[MAXPATHLEN]; @@ -142,6 +159,10 @@ main(int argc, char *argv[]) case 's': o.size = argto4(optarg, 1, "file system size"); break; + case 'T': + o.timestamp_set = 1; + o.timestamp = get_tstamp(optarg); + break; case 'u': o.sectors_per_track = argto2(optarg, 1, "sectors/track"); break; From owner-svn-src-head@freebsd.org Tue May 16 17:35:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3582D703C2; Tue, 16 May 2017 17:35:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 727C717CF; Tue, 16 May 2017 17:35:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GHZ5lf039527; Tue, 16 May 2017 17:35:05 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GHZ5fe039525; Tue, 16 May 2017 17:35:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201705161735.v4GHZ5fe039525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 16 May 2017 17:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318356 - in head: lib/libstand sys/boot/i386/pxeldr X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 17:35:06 -0000 Author: tsoome Date: Tue May 16 17:35:05 2017 New Revision: 318356 URL: https://svnweb.freebsd.org/changeset/base/318356 Log: libstand: increase nfs max read size to 16k With ip fragment reassembly implemented, it makes sense to allow larger nfs reads. Note due to loader heap size limit, we do not want to set too large maximum read size. Also we do not change default read size. Reviewed by: bcr, allanjude Differential Revision: https://reviews.freebsd.org/D10754 Modified: head/lib/libstand/nfs.c head/sys/boot/i386/pxeldr/pxeboot.8 Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Tue May 16 17:04:50 2017 (r318355) +++ head/lib/libstand/nfs.c Tue May 16 17:35:05 2017 (r318356) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #define NFS_DEBUGxx #define NFSREAD_MIN_SIZE 1024 -#define NFSREAD_MAX_SIZE 4096 +#define NFSREAD_MAX_SIZE 16384 /* NFSv3 definitions */ #define NFS_V3MAXFHSIZE 64 Modified: head/sys/boot/i386/pxeldr/pxeboot.8 ============================================================================== --- head/sys/boot/i386/pxeldr/pxeboot.8 Tue May 16 17:04:50 2017 (r318355) +++ head/sys/boot/i386/pxeldr/pxeboot.8 Tue May 16 17:35:05 2017 (r318356) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2000 +.Dd May 16, 2017 .Dt PXEBOOT 8 .Os .Sh NAME @@ -91,7 +91,7 @@ This may be changed by setting the .Va nfs.read_size variable in .Pa /boot/loader.conf . -Valid values range from 1024 to 4096 bytes. +Valid values range from 1024 to 16384 bytes. .Pp In all other respects, .Nm From owner-svn-src-head@freebsd.org Tue May 16 18:05:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4CD5D70C9B; Tue, 16 May 2017 18:05:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id B51B1C14; Tue, 16 May 2017 18:05:35 +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 v4GI5YLQ051853; Tue, 16 May 2017 18:05:34 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GI5Yv1051852; Tue, 16 May 2017 18:05:34 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201705161805.v4GI5Yv1051852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 16 May 2017 18:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318359 - head/sys/dev/bnxt X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 18:05:36 -0000 Author: sbruno Date: Tue May 16 18:05:34 2017 New Revision: 318359 URL: https://svnweb.freebsd.org/changeset/base/318359 Log: Add version tag to the driver. Start at version 1.0.0.0 Submitted by: bhargava.marreddy@broadcom.com Reviewed by: venkatkumar.duvvuru@broadcom.com Differential Revision: https://reviews.freebsd.org/D10616 Modified: head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Tue May 16 17:51:30 2017 (r318358) +++ head/sys/dev/bnxt/if_bnxt.c Tue May 16 18:05:34 2017 (r318359) @@ -287,7 +287,8 @@ static driver_t bnxt_iflib_driver = { * iflib shared context */ -char bnxt_driver_version[] = "FreeBSD base"; +#define BNXT_DRIVER_VERSION "1.0.0.0" +char bnxt_driver_version[] = BNXT_DRIVER_VERSION; extern struct if_txrx bnxt_txrx; static struct if_shared_ctx bnxt_sctx_init = { .isc_magic = IFLIB_MAGIC, From owner-svn-src-head@freebsd.org Tue May 16 18:29:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B2AD7064C; Tue, 16 May 2017 18:29:16 +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 8EF361E48; Tue, 16 May 2017 18:29:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 02DDB10A7B9; Tue, 16 May 2017 14:29:06 -0400 (EDT) From: John Baldwin To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317732 - head/usr.bin/truss Date: Tue, 16 May 2017 11:28:59 -0700 Message-ID: <1678847.Pdl09MfElI@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201705030923.v439NEWv072629@repo.freebsd.org> References: <201705030923.v439NEWv072629@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 16 May 2017 14:29:06 -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.23 Precedence: list List-Id: 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, 16 May 2017 18:29:16 -0000 On Wednesday, May 03, 2017 09:23:14 AM Michael Tuexen wrote: > Author: tuexen > Date: Wed May 3 09:23:13 2017 > New Revision: 317732 > URL: https://svnweb.freebsd.org/changeset/base/317732 > > Log: > Decode the third argument of socket(). This is not quite right for sockets that aren't PF_INET. Probably this warrants a const char *sysdecode_socket_protocol(int domain, int protocol) that honors the domain in deciding what protocol value to output. For now this could just handle PF_INET: const char * sysdecode_socket_protocol(int domain, int protocol) { switch (domain) { case PF_INET: return (lookup_value(sockipproto, protocol)); default: return (NULL)); } Then use this in truss. The socket option stuff currently hardcodes IP protocols and levels only because we don't have a good way of obtaining the domain of an existing socket in a target process. For socket()'s protocol argument though we readily have the domain available. At some point in the future we might address the socket option issue by caching the domain argument when sockets are created in a table, and for truss when attaching to an existing process using the kinfo_file interface to learn about existing sockets, but that's not entirely trivial. -- John Baldwin From owner-svn-src-head@freebsd.org Tue May 16 18:39:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94065D7098C; Tue, 16 May 2017 18:39:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63634982; Tue, 16 May 2017 18:39:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GIdNY1067346; Tue, 16 May 2017 18:39:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GIdNr0067345; Tue, 16 May 2017 18:39:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201705161839.v4GIdNr0067345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 May 2017 18:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318360 - head/sys/sys X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 18:39:24 -0000 Author: jhb Date: Tue May 16 18:39:23 2017 New Revision: 318360 URL: https://svnweb.freebsd.org/changeset/base/318360 Log: Fix p_endcopy. For p_endcopy to work correctly, it must be the name of the next element in struct proc after the end of the copy region, not the name of the last element in the copy region. Currently, the last element (p_elf_flags) is not being copied. In addition, the p_xexit and p_xsig fields should not be copied on fork, so move them out of the copy region. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D10677 Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue May 16 18:05:34 2017 (r318359) +++ head/sys/sys/proc.h Tue May 16 18:39:23 2017 (r318360) @@ -624,13 +624,13 @@ struct proc { pid_t p_reapsubtree; /* (e) Pid of the direct child of the reaper which spawned our subtree. */ - u_int p_xexit; /* (c) Exit code. */ - u_int p_xsig; /* (c) Stop/kill sig. */ uint16_t p_elf_machine; /* (x) ELF machine type */ uint64_t p_elf_flags; /* (x) ELF flags */ - /* End area that is copied on creation. */ -#define p_endcopy p_elf_flags +#define p_endcopy p_xexit + + u_int p_xexit; /* (c) Exit code. */ + u_int p_xsig; /* (c) Stop/kill sig. */ struct pgrp *p_pgrp; /* (c + e) Pointer to process group. */ struct knlist *p_klist; /* (c) Knotes attached to this proc. */ int p_numthreads; /* (c) Number of threads. */ From owner-svn-src-head@freebsd.org Tue May 16 18:42:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 731A9D70C16; Tue, 16 May 2017 18:42:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A2A014C0; Tue, 16 May 2017 18:42:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GIgjxL071100; Tue, 16 May 2017 18:42:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GIgj6J071098; Tue, 16 May 2017 18:42:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201705161842.v4GIgj6J071098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 May 2017 18:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318363 - in head/contrib: atf/atf-c/detail netbsd-tests/lib/libc/sys X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 18:42:46 -0000 Author: jhb Date: Tue May 16 18:42:44 2017 New Revision: 318363 URL: https://svnweb.freebsd.org/changeset/base/318363 Log: Skip tests depending on coredumps if coredumps are disabled via kern.coredump. The kern.coredump sysctl can be set to 0 to disable coredumps. Skip the 'status_coredump' and 'wait6_coredumped' tests if this sysctl is set to 0 rather than reporting a failure. Submitted by: brooks Reviewed by: ngie Obtained from: CheriBSD Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10665 Modified: head/contrib/atf/atf-c/detail/process_test.c head/contrib/netbsd-tests/lib/libc/sys/t_wait.c Modified: head/contrib/atf/atf-c/detail/process_test.c ============================================================================== --- head/contrib/atf/atf-c/detail/process_test.c Tue May 16 18:42:07 2017 (r318362) +++ head/contrib/atf/atf-c/detail/process_test.c Tue May 16 18:42:44 2017 (r318363) @@ -26,6 +26,9 @@ #include "atf-c/detail/process.h" #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -667,6 +670,14 @@ ATF_TC_BODY(status_coredump, tc) atf_tc_skip("Cannot unlimit the core file size; check limits " "manually"); +#ifdef __FreeBSD__ + int coredump_enabled; + size_t ce_len = sizeof(coredump_enabled); + if (sysctlbyname("kern.coredump", &coredump_enabled, &ce_len, NULL, + 0) == 0 && !coredump_enabled) + atf_tc_skip("Coredumps disabled"); +#endif + const int rawstatus = fork_and_wait_child(child_sigquit); atf_process_status_t s; RE(atf_process_status_init(&s, rawstatus)); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_wait.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_wait.c Tue May 16 18:42:07 2017 (r318362) +++ head/contrib/netbsd-tests/lib/libc/sys/t_wait.c Tue May 16 18:42:44 2017 (r318363) @@ -31,6 +31,10 @@ #include __RCSID("$NetBSD: t_wait.c,v 1.8 2017/01/13 19:28:55 christos Exp $"); +#ifdef __FreeBSD__ +#include +#include +#endif #include #include @@ -147,6 +151,14 @@ ATF_TC_BODY(wait6_coredumped, tc) pid_t pid; static const struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY }; +#ifdef __FreeBSD__ + int coredump_enabled; + size_t ce_len = sizeof(coredump_enabled); + if (sysctlbyname("kern.coredump", &coredump_enabled, &ce_len, NULL, + 0) == 0 && !coredump_enabled) + atf_tc_skip("Coredumps disabled"); +#endif + switch (pid = fork()) { case 0: ATF_REQUIRE(setrlimit(RLIMIT_CORE, &rl) == 0); From owner-svn-src-head@freebsd.org Tue May 16 18:47:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6E76D70CBD; Tue, 16 May 2017 18:47:16 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7997816FC; Tue, 16 May 2017 18:47:03 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GIkudr071279; Tue, 16 May 2017 18:46:56 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GIkuTS071275; Tue, 16 May 2017 18:46:56 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201705161846.v4GIkuTS071275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Tue, 16 May 2017 18:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318364 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/tests/gettext/saved contrib/libxo/xo lib/lib... X-SVN-Group: head 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.23 Precedence: list List-Id: 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, 16 May 2017 18:47:16 -0000 Author: phil Date: Tue May 16 18:46:56 2017 New Revision: 318364 URL: https://svnweb.freebsd.org/changeset/base/318364 Log: Import libxo-0.7.2; add xo_options.7. Submitted by: phil Reviewed by: sjg Approved by: sjg (mentor) Added: head/contrib/libxo/libxo/xo_options.7 - copied unchanged from r318362, vendor/Juniper/libxo/dist/libxo/xo_options.7 Modified: head/contrib/libxo/configure.ac head/contrib/libxo/doc/Makefile.am head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/doc/libxo.txt head/contrib/libxo/libxo/Makefile.am head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo.h head/contrib/libxo/libxo/xo_buf.h head/contrib/libxo/libxo/xo_encoder.c head/contrib/libxo/libxo/xo_format.5 head/contrib/libxo/libxo/xo_syslog.c head/contrib/libxo/tests/core/saved/test_01.E.out head/contrib/libxo/tests/core/saved/test_01.J.out head/contrib/libxo/tests/core/saved/test_01.JP.out head/contrib/libxo/tests/core/saved/test_01.X.out head/contrib/libxo/tests/core/saved/test_01.XP.out head/contrib/libxo/tests/core/saved/test_10.X.out head/contrib/libxo/tests/core/saved/test_10.XP.out head/contrib/libxo/tests/core/saved/test_11.X.out head/contrib/libxo/tests/core/saved/test_11.XP.out head/contrib/libxo/tests/core/test_01.c head/contrib/libxo/tests/gettext/saved/gt_01.J.out head/contrib/libxo/tests/gettext/saved/gt_01.JP.out head/contrib/libxo/xo/xo.c head/lib/libxo/Makefile head/lib/libxo/add.man head/lib/libxo/xo_config.h head/usr.bin/xo/Makefile Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Tue May 16 18:42:44 2017 (r318363) +++ head/contrib/libxo/configure.ac Tue May 16 18:46:56 2017 (r318364) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.6.3], [phil@juniper.net]) +AC_INIT([libxo], [0.7.2], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. @@ -20,7 +20,6 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PROG_CC -AM_PROG_AR AC_PROG_INSTALL AC_CONFIG_MACRO_DIR([m4]) AC_PROG_LN_S @@ -135,6 +134,21 @@ if test "$GETTEXT_ENABLE" != "no"; then AC_MSG_RESULT([$HAVE_GETTEXT]) fi + + if test "$HAVE_GETTEXT" != "yes"; then + GETTEXT_PREFIX=/usr/local + AC_MSG_CHECKING([gettext in ${GETTEXT_PREFIX}]) + + _save_cflags="$CFLAGS" + CFLAGS="$CFLAGS -I${GETTEXT_PREFIX}/include -L${GETTEXT_PREFIX}/lib -Werror -lintl" + AC_LINK_IFELSE([AC_LANG_SOURCE([[#include ] + [int main() {char *cp = dgettext(NULL, "xx"); return 0; }]])], + [HAVE_GETTEXT=yes], + [HAVE_GETTEXT=no]) + CFLAGS="$_save_cflags" + + AC_MSG_RESULT([$HAVE_GETTEXT]) + fi fi if test "$HAVE_GETTEXT" = "yes"; then @@ -278,6 +292,13 @@ AC_ARG_ENABLE([debug], AC_MSG_RESULT([$LIBXO_DEBUG]) AM_CONDITIONAL([LIBXO_DEBUG], [test "$LIBXO_DEBUG" != "no"]) +AC_MSG_CHECKING([whether to use int return codes]) +AC_ARG_ENABLE([int-return-codes], + [ --enable-int-return-codes Use int return codes (instead of ssize_t)], + [USE_INT_RETURN_CODES=yes; AC_DEFINE([USE_INT_RETURN_CODES], [1], [Use int return codes])], + [USE_INT_RETURN_CODES=no]) +AC_MSG_RESULT([$USE_INT_RETURN_CODES]) + AC_MSG_CHECKING([whether to build with text-only rendering]) AC_ARG_ENABLE([text-only], [ --enable-text-only Turn on text-only rendering], Modified: head/contrib/libxo/doc/Makefile.am ============================================================================== --- head/contrib/libxo/doc/Makefile.am Tue May 16 18:42:44 2017 (r318363) +++ head/contrib/libxo/doc/Makefile.am Tue May 16 18:46:56 2017 (r318364) @@ -61,9 +61,9 @@ xolint.txt: ${top_srcdir}/xolint/xolint. CLEANFILES = \ xolint.txt \ ${INPUT}.xml \ -${INPUT}.txt \ ${INPUT}.fxml \ -${INPUT}.html +${OUTPUT}.txt \ +${OUTPUT}.html else doc docs: @${ECHO} "The 'oxtradoc' tool is not installed; see libslax.org" Modified: head/contrib/libxo/doc/libxo-manual.html ============================================================================== --- head/contrib/libxo/doc/libxo-manual.html Tue May 16 18:42:44 2017 (r318363) +++ head/contrib/libxo/doc/libxo-manual.html Tue May 16 18:46:56 2017 (r318364) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "May 2016"; + content: "May 2017"; } @top-center { @@ -22009,7 +22009,7 @@ jQuery(function ($) { -May 28, 2016 +May 15, 2017

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

@@ -22271,36 +22271,40 @@ jQuery(function ($) {
  • 3.1.4   
    -xo_set_style @@ -23879,7 +23883,7 @@ jQuery(function ($) {

    For strings, the 'h' and 'l' modifiers affect the interpretation of the bytes pointed to argument. The default '%s' string is a 'char *' pointer to a string encoded as UTF-8. Since UTF-8 is compatible with ASCII data, a normal 7-bit ASCII string can be used. '%ls' expects a 'wchar_t *' pointer to a wide-character string, encoded as a 32-bit Unicode values. '%hs' expects a 'char *' pointer to a multi-byte string encoded with the current locale, as given by the LC_CTYPE, LANG, or LC_ALL environment varibles. The first of this list of variables is used and if none of the variables are set, the locale defaults to "UTF‑8".

    libxo will convert these arguments as needed to either UTF-8 (for XML, JSON, and HTML styles) or locale-based strings for display in text style.

    -   xo_emit("Alll strings are utf-8 content {:tag/%ls}",
    +   xo_emit("All strings are utf-8 content {:tag/%ls}",
                L"except for wide strings");
     	    

    "%S" is equivalent to "%ls".

    @@ -24316,6 +24320,14 @@ jQuery(function ($) { + + + + + + + + @@ -24377,7 +24389,7 @@ jQuery(function ($) { - + @@ -24402,6 +24414,19 @@ jQuery(function ($) {
    Enable "Do The Right Thing" mode
    flushFlush after every libxo function call
    flush-lineFlush after every line (line-buffered)
    html Emit HTML output
    underscoresReplace XML-friendly "-"s with JSON friendly "_"s eReplace XML-friendly "-"s with JSON friendly "_"s
    units

    The brief options are detailed in Section 3.4.6.

    +

    Most of these option are simple and direct, but some require additional details:

    +

    +
      +
    • "flush‑line" performs line buffering, even when the output is not directed to a TTY device.
    • +
    • "info" generates additional data for HTML, encoded in attributes using names that state with "data‑".
    • +
    • "keys" adds a "key" attribute for XML output to indicate that a leaf is an identifier for the list member.
    • +
    • "no‑humanize"avoids "humanizing" numeric output (see humanize_number(3) for details).
    • +
    • "no‑locale" instructs libxo to avoid translating output to the current locale.
    • +
    • "no‑retain" disables the ability of libxo to internally retain "compiled" information about formatting strings.
    • +
    • "underscores" can be used with JSON output to change XML-friendly names with dashes into JSON-friendly name with underscores.
    • +
    • "warn" allows libxo to emit warnings on stderr when application code make incorrect calls.
    • +
    • "warn‑xml" causes those warnings to be placed in XML inside the output.
    • +

    @@ -24443,8 +24468,9 @@ jQuery(function ($) {
  • Section 3.1.2
  • Section 3.1.3
  • Section 3.1.4
  • -
  • Section 3.1.5
  • -
  • Section 3.1.6
  • +
  • Section 3.1.5
  • +
  • Section 3.1.6
  • +
  • Section 3.1.7
  • @@ -24460,7 +24486,7 @@ jQuery(function ($) { xo_handle_t *xop = xo_create(XO_STYLE_JSON, XOF_WARN); .... xo_emit_h(xop, "testing\n"); -

    See also Section 3.1.4.1 and Section 3.1.5.1.

    +

    See also Section 3.1.5.1 and Section 3.1.6.1.

    @@ -24499,18 +24525,31 @@ jQuery(function ($) {

    To use the default handle, pass a NULL handle:

         xo_set_style(NULL, XO_STYLE_XML);
    -	    

    Section Contents:

    +

    +
    +

    +
    +3.1.5 
    +xo_get_style +

    +

    To find the current style, use the xo_get_style() function:

    +
    +    xo_style_t xo_get_style(xo_handle_t *xop);
    +	    

    To use the default handle, pass a NULL handle:

    +
    +    style = xo_get_style(NULL);
    +	    

    Section Contents:

    -

    +

    +3.1.5.1 

    Output Styles (XO_STYLE_*) -

    The libxo functions accept a set of output styles:

    +

    The libxo functions accept a set of output styles:

    @@ -24537,45 +24576,45 @@ jQuery(function ($) {
    Flag
    -

    +

    +3.1.5.2 

    xo_set_style_name -

    The xo_set_style_name() can be used to set the style based on a name encoded as a string:

    -
    +

    The xo_set_style_name() can be used to set the style based on a name encoded as a string:

    +
         int xo_set_style_name (xo_handle_t *xop, const char *style);
    -	    

    The name can be any of the styles: "text", "xml", "json", or "html".

    -
    +	    

    The name can be any of the styles: "text", "xml", "json", or "html".

    +
         EXAMPLE:
             xo_set_style_name(NULL, "html");
     	    
    -

    +

    -3.1.5 
    +3.1.6 

    xo_set_flags -

    To set the flags, use the xo_set_flags() function:

    -
    +

    To set the flags, use the xo_set_flags() function:

    +
         void xo_set_flags(xo_handle_t *xop, unsigned flags);
    -	    

    To use the default handle, pass a NULL handle:

    -
    +	    

    To use the default handle, pass a NULL handle:

    +
         xo_set_style(NULL, XO_STYLE_XML);
    -	    

    Section Contents:

    +

    Section Contents:

    -

    +

    +3.1.6.1 

    Flags (XOF_*) -

    The set of valid flags include:

    +

    The set of valid flags include:

    @@ -24648,12 +24687,12 @@ jQuery(function ($) {
    Flag
    -

    The XOF_CLOSE_FP flag will trigger the call of the close_func (provided via xo_set_writer()) when the handle is destroyed.

    -

    The XOF_COLOR flag enables color and effects in output regardless of output device, while the XOF_COLOR_ALLOWED flag allows color and effects only if the output device is a terminal.

    -

    The XOF_PRETTY flag requests 'pretty printing', which will trigger the addition of indentation and newlines to enhance the readability of XML, JSON, and HTML output. Text output is not affected.

    -

    The XOF_WARN flag requests that warnings will trigger diagnostic output (on standard error) when the library notices errors during operations, or with arguments to functions. Without warnings enabled, such conditions are ignored.

    -

    Warnings allow developers to debug their interaction with libxo. The function "xo_failure" can used as a breakpoint for a debugger, regardless of whether warnings are enabled.

    -

    If the style is XO_STYLE_HTML, the following additional flags can be used:

    +

    The XOF_CLOSE_FP flag will trigger the call of the close_func (provided via xo_set_writer()) when the handle is destroyed.

    +

    The XOF_COLOR flag enables color and effects in output regardless of output device, while the XOF_COLOR_ALLOWED flag allows color and effects only if the output device is a terminal.

    +

    The XOF_PRETTY flag requests 'pretty printing', which will trigger the addition of indentation and newlines to enhance the readability of XML, JSON, and HTML output. Text output is not affected.

    +

    The XOF_WARN flag requests that warnings will trigger diagnostic output (on standard error) when the library notices errors during operations, or with arguments to functions. Without warnings enabled, such conditions are ignored.

    +

    Warnings allow developers to debug their interaction with libxo. The function "xo_failure" can used as a breakpoint for a debugger, regardless of whether warnings are enabled.

    +

    If the style is XO_STYLE_HTML, the following additional flags can be used:

    @@ -24670,9 +24709,9 @@ jQuery(function ($) {
    Flag
    -

    The XOF_XPATH flag enables the emission of XPath expressions detailing the hierarchy of XML elements used to encode the data field, if the XPATH style of output were requested.

    -

    The XOF_INFO flag encodes additional informational fields for HTML output. See Section 3.4.4 for details.

    -

    If the style is XO_STYLE_XML, the following additional flags can be used:

    +

    The XOF_XPATH flag enables the emission of XPath expressions detailing the hierarchy of XML elements used to encode the data field, if the XPATH style of output were requested.

    +

    The XOF_INFO flag encodes additional informational fields for HTML output. See Section 3.4.4 for details.

    +

    If the style is XO_STYLE_XML, the following additional flags can be used:

    @@ -24683,43 +24722,43 @@ jQuery(function ($) {
    FlagFlag 'key' fields for xml
    -

    The XOF_KEYS flag adds 'key' attribute to the XML encoding for field definitions that use the 'k' modifier. The key attribute has the value "key":

    -
    +

    The XOF_KEYS flag adds 'key' attribute to the XML encoding for field definitions that use the 'k' modifier. The key attribute has the value "key":

    +
         xo_emit("{k:name}", item);
     
       XML:
           <name key="key">truck</name>
     	    
    -

    +

    +3.1.6.2 

    xo_clear_flags -

    The xo_clear_flags() function turns off the given flags in a specific handle.

    -
    +

    The xo_clear_flags() function turns off the given flags in a specific handle.

    +
         void xo_clear_flags (xo_handle_t *xop, xo_xof_flags_t flags);
     	    
    -

    +

    +3.1.6.3 

    xo_set_options -

    The xo_set_options() function accepts a comma-separated list of styles and flags and enables them for a specific handle.

    -
    +

    The xo_set_options() function accepts a comma-separated list of styles and flags and enables them for a specific handle.

    +
         int xo_set_options (xo_handle_t *xop, const char *input);
    -	    

    The options are identical to those listed in Section 2.4.

    +

    The options are identical to those listed in Section 2.4.

    -

    +

    -3.1.6 
    +3.1.7 

    xo_destroy -

    The xo_destroy function releases a handle and any resources it is using. Calling xo_destroy with a NULL handle will release any resources associated with the default handle.

    -
    +

    The xo_destroy function releases a handle and any resources it is using. Calling xo_destroy with a NULL handle will release any resources associated with the default handle.

    +
         void xo_destroy(xo_handle_t *xop);
     	    
    @@ -24730,7 +24769,7 @@ jQuery(function ($) { Emitting Content (xo_emit)

    The following functions are used to emit output:

    -
    +
         int xo_emit (const char *fmt, ...);
         int xo_emit_h (xo_handle_t *xop, const char *fmt, ...);
         int xo_emit_hv (xo_handle_t *xop, const char *fmt, va_list vap);
    @@ -24750,7 +24789,7 @@ jQuery(function ($) {
     Single Field Emitting Functions (xo_emit_field)
     
     

    The following functions can also make output, but only make a single field at a time:

    -
    +
         int xo_emit_field_hv (xo_handle_t *xop, const char *rolmod,
                       const char *contents, const char *fmt, 
                       const char *efmt, va_list vap);
    @@ -24762,7 +24801,7 @@ jQuery(function ($) {
         int xo_emit_field (const char *rolmod, const char *contents,
                      const char *fmt, const char *efmt, ...);
     	    

    These functions are intended to avoid the scenario where one would otherwise need to compose a format descriptors using snprintf(). The individual parts of the format descriptor are passed in distinctly.

    -
    +
         xo_emit("T", "Host name is ", NULL, NULL);
         xo_emit("V", "host-name", NULL, NULL, host-name);
     	    
    @@ -24773,14 +24812,14 @@ jQuery(function ($) { Attributes (xo_attr)

    The xo_attr() function emits attributes for the XML output style.

    -
    +
         int xo_attr (const char *name, const char *fmt, ...);
         int xo_attr_h (xo_handle_t *xop, const char *name, 
                        const char *fmt, ...);
         int xo_attr_hv (xo_handle_t *xop, const char *name, 
                        const char *fmt, va_list vap);
     	    

    The name parameter give the name of the attribute to be encoded. The fmt parameter gives a printf-style format string used to format the value of the attribute using any remaining arguments, or the vap parameter passed to xo_attr_hv().

    -
    +
         EXAMPLE:
           xo_attr("seconds", "%ld", (unsigned long) login_time);
           struct tm *tmp = localtime(login_time);
    @@ -24798,7 +24837,7 @@ jQuery(function ($) {
     Flushing Output (xo_flush)
     
     

    libxo buffers data, both for performance and consistency, but also to allow some advanced features to work properly. At various times, the caller may wish to flush any data buffered within the library. The xo_flush() call is used for this:

    -
    +
         void xo_flush (void);
         void xo_flush_h (xo_handle_t *xop);
     	    

    Calling xo_flush also triggers the flush function associated with the handle. For the default handle, this is equivalent to "fflush(stdio);".

    @@ -24810,7 +24849,7 @@ jQuery(function ($) { Finishing Output (xo_finish)

    When the program is ready to exit or close a handle, a call to xo_finish() is required. This flushes any buffered data, closes open libxo constructs, and completes any pending operations.

    -
    +
         int xo_finish (void);
         int xo_finish_h (xo_handle_t *xop);
         void xo_finish_atexit (void);
    @@ -24826,7 +24865,7 @@ jQuery(function ($) {
     
     

    libxo represents to types of hierarchy: containers and lists. A container appears once under a given parent where a list contains instances that can appear multiple times. A container is used to hold related fields and to give the data organization and scope.

    To create a container, use the xo_open_container and xo_close_container functions:

    -
    +
         int xo_open_container (const char *name);
         int xo_open_container_h (xo_handle_t *xop, const char *name);
         int xo_open_container_hd (xo_handle_t *xop, const char *name);
    @@ -24840,7 +24879,7 @@ jQuery(function ($) {
     

    The close functions with the "_d" suffix are used in "Do The Right Thing" mode, where the name of the open containers, lists, and instances are maintained internally by libxo to allow the caller to avoid keeping track of the open container name.

    Use the XOF_WARN flag to generate a warning if the name given on the close does not match the current open container.

    For TEXT and HTML output, containers are not rendered into output text, though for HTML they are used when the XOF_XPATH flag is set.

    -
    +
         EXAMPLE:
            xo_open_container("system");
            xo_emit("The host name is {:host-name}\n", hn);
    @@ -24857,7 +24896,7 @@ jQuery(function ($) {
     
     

    Lists are sequences of instances of homogeneous data objects. Two distinct levels of calls are needed to represent them in our output styles. Calls must be made to open and close a list, and for each instance of data in that list, calls must be make to open and close that instance.

    The name given to all calls must be identical, and it is strongly suggested that the name be singular, not plural, as a matter of style and usage expectations.

    -
    +
         EXAMPLE:
             xo_open_list("user");
             for (i = 0; i < num_users; i++) {
    @@ -24926,7 +24965,7 @@ jQuery(function ($) {
     Parsing Command-line Arguments (xo_parse_args)
     
     

    The xo_parse_args() function is used to process a program's arguments. libxo-specific options are processed and removed from the argument list so the calling application does not need to process them. If successful, a new value for argc is returned. On failure, a message it emitted and -1 is returned.

    -
    +
         argc = xo_parse_args(argc, argv);
         if (argc < 0)
             exit(EXIT_FAILURE);
    @@ -24939,7 +24978,7 @@ jQuery(function ($) {
     xo_set_program
     
     

    The xo_set_program function sets name of the program as reported by functions like xo_failure, xo_warn, xo_err, etc. The program name is initialized by xo_parse_args, but subsequent calls to xo_set_program can override this value.

    -
    +
         xo_set_program(argv[0]);
     	    

    Note that the value is not copied, so the memory passed to xo_set_program (and xo_parse_args) must be maintained by the caller.

    @@ -24950,7 +24989,7 @@ jQuery(function ($) { xo_set_version

    The xo_set_version function records a version number to be emitted as part of the data for encoding styles (XML and JSON). This version number is suitable for tracking changes in the content, allowing a user of the data to discern which version of the data model is in use.

    -
    +
          void xo_set_version (const char *version);
          void xo_set_version_h (xo_handle_t *xop, const char *version);
     	    
    @@ -24963,7 +25002,7 @@ jQuery(function ($) {

    HTML data can include additional information in attributes that begin with "data‑". To enable this, three things must occur:

    First the application must build an array of xo_info_t structures, one per tag. The array must be sorted by name, since libxo uses a binary search to find the entry that matches names from format instructions.

    Second, the application must inform libxo about this information using the xo_set_info() call:

    -
    +
         typedef struct xo_info_s {
             const char *xi_name;    /* Name of the element */
             const char *xi_type;    /* Type of field */
    @@ -24973,7 +25012,7 @@ jQuery(function ($) {
         void xo_set_info (xo_handle_t *xop, xo_info_t *infop, int count);
     	    

    Like other libxo calls, passing NULL for the handle tells libxo to use the default handle.

    If the count is -1, libxo will count the elements of infop, but there must be an empty element at the end. More typically, the number is known to the application:

    -
    +
         xo_info_t info[] = {
             { "in-stock", "number", "Number of items in stock" },
             { "name", "string", "Name of the item" },
    @@ -24986,7 +25025,7 @@ jQuery(function ($) {
         xo_set_info(NULL, info, info_count);
     	    

    Third, the emission of info must be triggered with the XOF_INFO flag using either the xo_set_flags() function or the "‑‑libxo=info" command line argument.

    The type and help values, if present, are emitted as the "data‑type" and "data‑help" attributes:

    -
    +
       <div class="data" data-tag="sku" data-type="string" 
            data-help="Stock Keeping Unit">GRO-000-533</div>
     	    
    @@ -24997,7 +25036,7 @@ jQuery(function ($) { Memory Allocation

    The xo_set_allocator function allows libxo to be used in environments where the standard realloc() and free() functions are not available.

    -
    +
         void xo_set_allocator (xo_realloc_func_t realloc_func,
                                xo_free_func_t free_func);
     	    

    realloc_func should expect the same arguments as realloc(3) and return a pointer to memory following the same convention. free_func will receive the same argument as free(3) and should release it, as appropriate for the environment.

    @@ -25079,10 +25118,10 @@ jQuery(function ($) {

    For example, warnings can be enabled by:

    -
    +
         % env LIBXO_OPTIONS=W my-app
     	    

    Complete HTML output can be generated with:

    -
    +
         % env LIBXO_OPTIONS=HXI my-app
     	    

    Since environment variables are inherited, child processes will have the same options, which may be undesirable, making the use of the "‑‑libxo" option is preferable in most situations.

    @@ -25093,7 +25132,7 @@ jQuery(function ($) { Errors, Warnings, and Messages

    Many programs make use of the standard library functions err() and warn() to generate errors and warnings for the user. libxo wants to pass that information via the current output style, and provides compatible functions to allow this:

    -
    +
         void xo_warn (const char *fmt, ...);
         void xo_warnx (const char *fmt, ...);
         void xo_warn_c (int code, const char *fmt, ...);
    @@ -25109,7 +25148,7 @@ jQuery(function ($) {
         void xo_message_hcv (xo_handle_t *xop, int code, 
                              const char *fmt, va_list vap);
     	    

    These functions display the program name, a colon, a formatted message based on the arguments, and then optionally a colon and an error message associated with either "errno" or the "code" parameter.

    -
    +
         EXAMPLE:
             if (open(filename, O_RDONLY) < 0)
                 xo_err(1, "cannot open file '%s'", filename);
    @@ -25121,7 +25160,7 @@ jQuery(function ($) {
     xo_error
     
     

    The xo_error function can be used for generic errors that should be reported over the handle, rather than to stderr. The xo_error function behaves like xo_err for TEXT and HTML output styles, but puts the error into XML or JSON elements:

    -
    +
         EXAMPLE::
             xo_error("Does not %s", "compute");
         XML::
    @@ -25136,7 +25175,7 @@ jQuery(function ($) {
     xo_no_setlocale
     
     

    libxo automatically initializes the locale based on setting of the environment variables LC_CTYPE, LANG, and LC_ALL. The first of this list of variables is used and if none of the variables, the locale defaults to "UTF‑8". The caller may wish to avoid this behavior, and can do so by calling the xo_no_setlocale() function.

    -
    +
         void xo_no_setlocale (void);
     	    
    @@ -25152,7 +25191,7 @@ jQuery(function ($) {

    https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers

    Use the Section 3.5.3.5() function to set the Enterprise ID, as needed.

    The message name should follow the conventions in Section 8.1.3, as should the fields within the message.

    -
    +
         /* Both of these calls are optional */
         xo_set_syslog_enterprise_id(32473);
         xo_open_log("my-program", 0, LOG_DAEMON);
    @@ -25180,7 +25219,7 @@ jQuery(function ($) {
     Priority, Facility, and Flags
     
     

    The xo_syslog, xo_vsyslog, and xo_open_log functions accept a set of flags which provide the priority of the message, the source facility, and some additional features. These values are OR'd together to create a single integer argument:

    -
    +
         xo_syslog(LOG_ERR | LOG_AUTH, "login-failed",
                  "Login failed; user '{:user}' from host '{:address}'",
                  user, addr);
    @@ -25325,7 +25364,7 @@ jQuery(function ($) {
     
     

    Use the xo_syslog function to generate syslog messages by calling it with a log priority and facility, a message name, a format string, and a set of arguments. The priority/facility argument are discussed above, as is the message name.

    The format string follows the same conventions as xo_emit's format string, with each field being rendered as an SD-PARAM pair.

    -
    +
         xo_syslog(LOG_ERR, "poofd-missing-file",
                   "'{:filename}' not found: {:error/%m}", filename);
     
    @@ -25354,7 +25393,7 @@ jQuery(function ($) {
     xo_vsyslog
     
     

    xo_vsyslog is identical in function to xo_syslog, but takes the set of arguments using a va_list.

    -
    +
         void my_log (const char *name, const char *fmt, ...)
         {
             va_list vap;
    @@ -25370,7 +25409,7 @@ jQuery(function ($) {
     xo_open_log
     
     

    xo_open_log functions similar to openlog(3), allowing customization of the program name, the log facility number, and the additional option flags described in Section 3.5.1.

    -
    +
         void
         xo_open_log (const char *ident, int logopt, int facility);
     	    
    @@ -25381,7 +25420,7 @@ jQuery(function ($) { xo_close_log

    xo_close_log functions similar to closelog(3), closing the log file and releasing any associated resources.

    -
    +
         void
         xo_close_log (void);
     	    
    @@ -25392,7 +25431,7 @@ jQuery(function ($) { xo_set_logmask

    xo_set_logmask function similar to setlogmask(3), restricting the set of generated log event to those whose associated bit is set in maskpri. Use LOG_MASK(pri) to find the appropriate bit, or LOG_UPTO(toppri) to create a mask for all priorities up to and including toppri.

    -
    +
         int
         xo_set_logmask (int maskpri);
     
    @@ -25407,7 +25446,7 @@ jQuery(function ($) {
     
     

    Use the xo_set_syslog_enterprise_id to supply a platform- or application-specific enterprise id. This value is used in any future syslog messages.

    Ideally, the operating system should supply a default value via the "kern.syslog.enterprise_id" sysctl value. Lacking that, the application should provide a suitable value.

    -
    +
         void
         xo_set_syslog_enterprise_id (unsigned short eid);
     	    

    Enterprise IDs are administered by IANA, the Internet Assigned Number Authority. The complete list is EIDs on their web site:

    @@ -25449,7 +25488,7 @@ jQuery(function ($) { Loading Encoders

    Encoders can be registered statically or discovered dynamically. Applications can choose to call the xo_encoder_register() function to explicitly register encoders, but more typically they are built as shared libraries, placed in the libxo/extensions directory, and loaded based on name. libxo looks for a file with the name of the encoder and an extension of ".enc". This can be a file or a symlink to the shared library file that supports the encoder.

    -
    +
         % ls -1 lib/libxo/extensions/*.enc
         lib/libxo/extensions/cbor.enc
         lib/libxo/extensions/test.enc
    @@ -25461,7 +25500,7 @@ jQuery(function ($) {
     Encoder Initialization
     
     

    Each encoder must export a symbol used to access the library, which must have the following signature:

    -
    +
         int xo_encoder_library_init (XO_ENCODER_INIT_ARGS);
     	    

    XO_ENCODER_INIT_ARGS is a macro defined in xo_encoder.h that defines an argument called "arg", a pointer of the type xo_encoder_init_args_t. This structure contains two fields:

    @@ -25566,7 +25605,7 @@ jQuery(function ($) {

    The "xo" utility allows command line access to the functionality of the libxo library. Using "xo", shell scripts can emit XML, JSON, and HTML using the same commands that emit text output.

    The style of output can be selected using a specific option: "‑X" for XML, "‑J" for JSON, "‑H" for HTML, or "‑T" for TEXT, which is the default. The "--style <style>" option can also be used. The LIBXO_OPTIONS environment variable can also be used to set the style, as well as other flags.

    The "xo" utility accepts a format string suitable for xo_emit() and a set of zero or more arguments used to supply data for that string.

    -
    +
         xo "The {k:name} weighs {:weight/%d} pounds.\n" fish 6
     
       TEXT:
    @@ -25586,7 +25625,7 @@ jQuery(function ($) {
           <div class="text"> pounds.</div>
         </div>
     	    

    The "--wrap <path>" option can be used to wrap emitted content in a specific hierarchy. The path is a set of hierarchical names separated by the '/' character.

    -
    +
         xo --wrap top/a/b/c '{:tag}' value
     
       XML:
    @@ -25610,7 +25649,7 @@ jQuery(function ($) {
           }
         }
     	    

    The "--open <path>" and "--close <path>" can be used to emit hierarchical information without the matching close and open tag. This allows a shell script to emit open tags, data, and then close tags. The "‑‑depth" option may be used to set the depth for indentation. The "‑‑leading‑xpath" may be used to prepend data to the XPath values used for HTML output style.

    -
    +
         #!/bin/sh
         xo --open top/data
         xo --depth 2 '{tag}' value
    @@ -25639,7 +25678,7 @@ jQuery(function ($) {
     Command Line Options
     
     

    Usage: xo [options] format [fields]

    -
    +
       --close <path>        Close tags for the given path
       --depth <num>         Set the depth for pretty printing
       --help                Display this help text
    @@ -25663,7 +25702,7 @@ jQuery(function ($) {
     4.2 
     Example
     
    -
    +
       % xo 'The {:product} is {:status}\n' stereo "in route"
       The stereo is in route
       % ./xo/xo -p -X 'The {:product} is {:status}\n' stereo "in route"
    @@ -25721,7 +25760,7 @@ jQuery(function ($) {
     
     
     

    The output message will contain the source filename and line number, the class of the message, the message, and, if -p is given, the line that contains the error:

    -
    +
         % xolint.pl -t xolint.c
         xolint.c: 16: error: anchor format should be "%d"
         16         xo_emit("{[:/%s}");
    @@ -25789,7 +25828,7 @@ jQuery(function ($) {
     
     
     
    -
    +
         EXAMPLE:
             % xopo -s "There are {:count/%u} {:event/%.6s} events\n"
             There are {:count} {:event} events\n
    @@ -25848,7 +25887,7 @@ jQuery(function ($) {
     Did the complex semantics of format strings evolve over time?
     
     

    The history is both long and short: libxo's functionality is based on what JUNOS does in a data modeling language called ODL (output definition language). In JUNOS, all subcomponents generate XML, which is feed to the CLI, where data from the ODL files tell is how to render that XML into text. ODL might had a set of tags like:

    -
    +
          tag docsis-state {
              help "State of the DOCSIS interface";
              type string;
    @@ -25927,7 +25966,7 @@ jQuery(function ($) {
     
    Reuse existing field names
    Nothing's worse than writing expressions like:
    -
    +
         if ($src1/process[pid == $pid]/name == 
             $src2/proc-table/proc-list
                        /proc-entry[process-id == $pid]/proc-name) {
    @@ -25988,10 +26027,10 @@ jQuery(function ($) {
     'A percent sign appearing in text is a literal'
     
     

    The message "A percent sign appearing in text is a literal" can be caused by code like:

    -
    +
         xo_emit("cost: %d", cost);
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{L:cost}: {:cost/%d}", cost);
     	    

    This can be a bit surprising and could be a field that was not properly converted to a libxo-style format string.

    @@ -26002,10 +26041,10 @@ jQuery(function ($) { 'Unknown long name for role/modifier'

    The message "Unknown long name for role/modifier" can be caused by code like:

    -
    +
         xo_emit("{,humanization:value}", value);
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{,humanize:value}", value);
     	    

    The hn-* modifiers (hn-decimal, hn-space, hn-1000) are only valid for fields with the {h:} modifier.

    @@ -26017,10 +26056,10 @@ jQuery(function ($) {

    The message "Last character before field definition is a field type" can be caused by code like:

    A common typo:

    -
    +
         xo_emit("{T:Min} T{:Max}");
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{T:Min} {T:Max}");
     	    

    Twiddling the "{" and the field role is a common typo.

    @@ -26031,10 +26070,10 @@ jQuery(function ($) { 'Encoding format uses different number of arguments'

    The message "Encoding format uses different number of arguments" can be caused by code like:

    -
    +
         xo_emit("{:name/%6.6s %%04d/%s}", name, number);
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{:name/%6.6s %04d/%s-%d}", name, number);
     	    

    Both format should consume the same number of arguments off the stack

    @@ -26045,10 +26084,10 @@ jQuery(function ($) { 'Only one field role can be used'

    The message "Only one field role can be used" can be caused by code like:

    -
    +
         xo_emit("{LT:Max}");
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{T:Max}");
     	    
    @@ -26058,10 +26097,10 @@ jQuery(function ($) { 'Potential missing slash after C, D, N, L, or T with format'

    The message "Potential missing slash after C, D, N, L, or T with format" can be caused by code like:

    -
    +
         xo_emit("{T:%6.6s}\n", "Max");
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{T:/%6.6s}\n", "Max");
     	    

    The "%6.6s" will be a literal, not a field format. While it's possibly valid, it's likely a missing "/".

    @@ -26072,7 +26111,7 @@ jQuery(function ($) { 'An encoding format cannot be given (roles: DNLT)'

    The message "An encoding format cannot be given (roles: DNLT)" can be caused by code like:

    -
    +
         xo_emit("{T:Max//%s}", "Max");
     	    

    Fields with the C, D, N, L, and T roles are not emitted in the 'encoding' style (JSON, XML), so an encoding format would make no sense.

    @@ -26083,7 +26122,7 @@ jQuery(function ($) { 'Format cannot be given when content is present (roles: CDLN)'

    The message "Format cannot be given when content is present (roles: CDLN)" can be caused by code like:

    -
    +
         xo_emit("{N:Max/%6.6s}", "Max");
     	    

    Fields with the C, D, L, or N roles can't have both static literal content ("{L:Label}") and a format ("{L:/%s}"). This error will also occur when the content has a backslash in it, like "{N:Type of I/O}"; backslashes should be escaped, like "{N:Type of I\\/O}". Note the double backslash, one for handling 'C' strings, and one for libxo.

    @@ -26094,10 +26133,10 @@ jQuery(function ($) { 'Field has color without fg- or bg- (role: C)'

    The message "Field has color without fg- or bg- (role: C)" can be caused by code like:

    -
    +
         xo_emit("{C:green}{:foo}{C:}", x);
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{C:fg-green}{:foo}{C:}", x);
     	    

    Colors must be prefixed by either "fg‑" or "bg‑".

    @@ -26108,10 +26147,10 @@ jQuery(function ($) { 'Field has invalid color or effect (role: C)'

    The message "Field has invalid color or effect (role: C)" can be caused by code like:

    -
    +
         xo_emit("{C:fg-purple,bold}{:foo}{C:gween}", x);
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{C:fg-red,bold}{:foo}{C:fg-green}", x);
     	    

    The list of colors and effects are limited. The set of colors includes default, black, red, green, yellow, blue, magenta, cyan, and white, which must be prefixed by either "fg‑" or "bg‑". Effects are limited to bold, no-bold, underline, no-underline, inverse, no-inverse, normal, and reset. Values must be separated by commas.

    @@ -26122,10 +26161,10 @@ jQuery(function ($) { 'Field has humanize modifier but no format string'

    The message "Field has humanize modifier but no format string" can be caused by code like:

    -
    +
         xo_emit("{h:value}", value);
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{h:value/%d}", value);
     	    

    Humanization is only value for numbers, which are not likely to use the default format ("%s").

    @@ -26136,10 +26175,10 @@ jQuery(function ($) { 'Field has hn-* modifier but not 'h' modifier'

    The message "Field has hn-* modifier but not 'h' modifier" can be caused by code like:

    -
    +
         xo_emit("{,hn-1000:value}", value);
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{h,hn-1000:value}", value);
     	    

    The hn-* modifiers (hn-decimal, hn-space, hn-1000) are only valid for fields with the {h:} modifier.

    @@ -26150,10 +26189,10 @@ jQuery(function ($) { 'Value field must have a name (as content)")'

    The message "Value field must have a name (as content)")" can be caused by code like:

    -
    +
         xo_emit("{:/%s}", "value");
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{:tag-name/%s}", "value");
     	    

    The field name is used for XML and JSON encodings. These tags names are static and must appear directly in the field descriptor.

    @@ -26164,10 +26203,10 @@ jQuery(function ($) { 'Use hyphens, not underscores, for value field name'

    The message "Use hyphens, not underscores, for value field name" can be caused by code like:

    -
    +
         xo_emit("{:no_under_scores}", "bad");
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{:no-under-scores}", "bad");
     	    

    Use of hyphens is traditional in XML, and the XOF_UNDERSCORES flag can be used to generate underscores in JSON, if desired. But the raw field name should use hyphens.

    @@ -26178,10 +26217,10 @@ jQuery(function ($) { 'Value field name cannot start with digit'

    The message "Value field name cannot start with digit" can be caused by code like:

    -
    +
         xo_emit("{:10-gig/}");
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{:ten-gig/}");
     	    

    XML element names cannot start with a digit.

    @@ -26192,10 +26231,10 @@ jQuery(function ($) { 'Value field name should be lower case'

    The message "Value field name should be lower case" can be caused by code like:

    -
    +
         xo_emit("{:WHY-ARE-YOU-SHOUTING}", "NO REASON");
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{:why-are-you-shouting}", "no reason");
     	    

    Lower case is more civilized. Even TLAs should be lower case to avoid scenarios where the differences between "XPath" and "Xpath" drive your users crazy. Lower case rules the seas.

    @@ -26206,10 +26245,10 @@ jQuery(function ($) { 'Value field name should be longer than two characters'

    The message "Value field name should be longer than two characters" can be caused by code like:

    -
    +
         xo_emit("{:x}", "mumble");
     	    

    This code should be replaced with code like:

    -
    +
         xo_emit("{:something-meaningful}", "mumble");
     	    

    Field names should be descriptive, and it's hard to be descriptive in less than two characters. Consider your users and try to make something more useful. Note that this error often occurs when the field type is placed after the colon ("{:T/%20s}"), instead of before it ("{T:/20s}").

    @@ -26220,10 +26259,10 @@ jQuery(function ($) { 'Value field name contains invalid character'

    The message "Value field name contains invalid character" can be caused by code like:

    -
    +
         xo_emit("{:cost-in-$$/%u}", 15);
     	    

    This code should be replaced with code like:

    -
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-head@freebsd.org  Tue May 16 19:03:27 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3503D70480;
     Tue, 16 May 2017 19:03:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id 768A1A4;
     Tue, 16 May 2017 19:03:27 +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 v4GJ3Qdf080041;
     Tue, 16 May 2017 19:03:26 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GJ3Qll080040;
     Tue, 16 May 2017 19:03:26 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705161903.v4GJ3Qll080040@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Tue, 16 May 2017 19:03:26 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318366 - head/sbin/newfs_msdos
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 19:03:27 -0000
    
    Author: emaste
    Date: Tue May 16 19:03:26 2017
    New Revision: 318366
    URL: https://svnweb.freebsd.org/changeset/base/318366
    
    Log:
      newfs_msdos: clarify description of -T (timestamp) option
      
      Submitted by:	Siva Mahadevan 
      Reported by:	Daniel Shahaf 
      Reviewed by:	emaste
      Sponsored by:	The FreeBSD Foundation
    
    Modified:
      head/sbin/newfs_msdos/newfs_msdos.8
    
    Modified: head/sbin/newfs_msdos/newfs_msdos.8
    ==============================================================================
    --- head/sbin/newfs_msdos/newfs_msdos.8	Tue May 16 18:54:25 2017	(r318365)
    +++ head/sbin/newfs_msdos/newfs_msdos.8	Tue May 16 19:03:26 2017	(r318366)
    @@ -38,10 +38,11 @@
     .Op Fl B Ar boot
     .Op Fl C Ar create-size
     .Op Fl F Ar FAT-type
    -.Op Fl I Ar VolumeId
    +.Op Fl I Ar VolumeID
     .Op Fl L Ar label
     .Op Fl O Ar OEM
     .Op Fl S Ar sector-size
    +.Op Fl T Ar timestamp
     .Op Fl a Ar FAT-size
     .Op Fl b Ar block-size
     .Op Fl c Ar cluster-size
    @@ -55,7 +56,6 @@
     .Op Fl o Ar hidden
     .Op Fl r Ar reserved
     .Op Fl s Ar total
    -.Op Fl T Ar timestamp
     .Op Fl u Ar track-size
     .Ar special
     .Op Ar disktype
    @@ -118,6 +118,14 @@ The default is
     Number of bytes per sector.
     Acceptable values are powers of 2
     in the range 512 through 32768, inclusive.
    +.It Fl T Ar timestamp
    +Create the filesystem as though the current time is
    +.Ar timestamp .
    +The default filesystem volume ID is derived from the time.
    +.Ar timestamp
    +can be a pathname (where the timestamp is derived from
    +that file) or an integer value interpreted
    +as the number of seconds since the Epoch.
     .It Fl a Ar FAT-size
     Number of sectors per FAT.
     .It Fl b Ar block-size
    @@ -160,17 +168,11 @@ Number of hidden sectors.
     Number of reserved sectors.
     .It Fl s Ar total
     File system size.
    -.It Fl T Ar timestamp
    -Specify a timestamp to be used for filesystem creation so that
    -it can be consistent for reproducible builds.
    -The timestamp can be a pathname (where the timestamps are derived from
    -that file) or an integer value interpreted
    -as the number of seconds since the Epoch.
     .It Fl u Ar track-size
     Number of sectors per track.
     .El
     .Sh NOTES
    -If some parameters (e.g. size, number of sectors, etc.) are not specified
    +If some parameters (e.g., size, number of sectors, etc.) are not specified
     through options or disktype, the program tries to generate them automatically.
     In particular, the size is determined as the device or file size minus the
     offset specified with the
    
    From owner-svn-src-head@freebsd.org  Tue May 16 19:53:40 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 580C9D70A96;
     Tue, 16 May 2017 19:53:40 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1107A3E9;
     Tue, 16 May 2017 19:53:40 +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 v4GJrdEr001574;
     Tue, 16 May 2017 19:53:39 GMT (envelope-from kib@FreeBSD.org)
    Received: (from kib@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GJrdmU001573;
     Tue, 16 May 2017 19:53:39 GMT (envelope-from kib@FreeBSD.org)
    Message-Id: <201705161953.v4GJrdmU001573@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
     using -f
    From: Konstantin Belousov 
    Date: Tue, 16 May 2017 19:53:39 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318380 - head/libexec/rtld-elf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 19:53:40 -0000
    
    Author: kib
    Date: Tue May 16 19:53:38 2017
    New Revision: 318380
    URL: https://svnweb.freebsd.org/changeset/base/318380
    
    Log:
      Pretend that there is some security when executing in direct mode.
      
      Do not allow direct exec if we the process is suid. Try to follow Unix
      permission checks for DACs, ignore ACLs.
      
      Reviewed by:	emaste
      Sponsored by:	The FreeBSD Foundation
      MFC after:	2 weeks
      Differential revision:	https://reviews.freebsd.org/D10750
    
    Modified:
      head/libexec/rtld-elf/rtld.c
    
    Modified: head/libexec/rtld-elf/rtld.c
    ==============================================================================
    --- head/libexec/rtld-elf/rtld.c	Tue May 16 19:48:07 2017	(r318379)
    +++ head/libexec/rtld-elf/rtld.c	Tue May 16 19:53:38 2017	(r318380)
    @@ -345,12 +345,14 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
         const Elf_Phdr *phdr;
         Objlist initlist;
         RtldLockState lockstate;
    +    struct stat st;
         Elf_Addr *argcp;
         char **argv, *argv0, **env, **envp, *kexecpath, *library_path_rpath;
         caddr_t imgentry;
         char buf[MAXPATHLEN];
         int argc, fd, i, mib[2], phnum;
         size_t len;
    +    bool dir_enable;
     
         /*
          * On entry, the dynamic linker itself has not been relocated yet.
    @@ -419,6 +421,11 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
     	assert(aux_info[AT_PHDR] != NULL);
     	phdr = (const Elf_Phdr *)aux_info[AT_PHDR]->a_un.a_ptr;
     	if (phdr == obj_rtld.phdr) {
    +	    if (!trust) {
    +		rtld_printf("Tainted process refusing to run binary %s\n",
    +		  argv0);
    +		rtld_die();
    +	    }
     	    dbg("opening main program in direct exec mode");
     	    if (argc >= 2) {
     		argv0 = argv[1];
    @@ -428,6 +435,37 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
     		      rtld_strerror(errno));
     		    rtld_die();
     		}
    +		if (fstat(fd, &st) == -1) {
    +		    rtld_printf("Stat %s: %s\n", argv0,
    +		      rtld_strerror(errno));
    +		    rtld_die();
    +		}
    +
    +		/*
    +		 * Rough emulation of the permission checks done by
    +		 * execve(2), only Unix DACs are checked, ACLs are
    +		 * ignored.  Preserve the semantic of disabling owner
    +		 * to execute if owner x bit is cleared, even if
    +		 * others x bit is enabled.
    +		 * mmap(2) does not allow to mmap with PROT_EXEC if
    +		 * binary' file comes from noexec mount.  We cannot
    +		 * set VV_TEXT on the binary.
    +		 */
    +		dir_enable = false;
    +		if (st.st_uid == geteuid()) {
    +		    if ((st.st_mode & S_IXUSR) != 0)
    +			dir_enable = true;
    +		} else if (st.st_gid == getegid()) {
    +		    if ((st.st_mode & S_IXGRP) != 0)
    +			dir_enable = true;
    +		} else if ((st.st_mode & S_IXOTH) != 0) {
    +		    dir_enable = true;
    +		}
    +		if (!dir_enable) {
    +		    rtld_printf("No execute permission for binary %s\n",
    +		      argv0);
    +		    rtld_die();
    +		}
     
     		/*
     		 * For direct exec mode, argv[0] is the interpreter
    
    From owner-svn-src-head@freebsd.org  Tue May 16 20:08:56 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41967D70DCE;
     Tue, 16 May 2017 20:08:56 +0000 (UTC)
     (envelope-from tuexen@freebsd.org)
    Received: from drew.franken.de (drew.ipv6.franken.de
     [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client CN "*.franken.de",
     Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK))
     by mx1.freebsd.org (Postfix) with ESMTPS id 0C95BDD9;
     Tue, 16 May 2017 20:08:56 +0000 (UTC)
     (envelope-from tuexen@freebsd.org)
    Received: from [IPv6:2003:cd:6bc9:d100:a4e8:994e:c9c6:cc3d]
     (p200300CD6BC9D100A4E8994EC9C6CC3D.dip0.t-ipconnect.de
     [IPv6:2003:cd:6bc9:d100:a4e8:994e:c9c6:cc3d])
     (Authenticated sender: macmic)
     by mail-n.franken.de (Postfix) with ESMTPSA id 85C18721E2825;
     Tue, 16 May 2017 22:08:51 +0200 (CEST)
    Content-Type: text/plain; charset=us-ascii
    Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
    Subject: Re: svn commit: r317732 - head/usr.bin/truss
    From: Michael Tuexen 
    In-Reply-To: <1678847.Pdl09MfElI@ralph.baldwin.cx>
    Date: Tue, 16 May 2017 22:08:50 +0200
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Content-Transfer-Encoding: quoted-printable
    Message-Id: <6E31B0EF-74B4-4D9A-8126-1161AEF4F3CE@freebsd.org>
    References: <201705030923.v439NEWv072629@repo.freebsd.org>
     <1678847.Pdl09MfElI@ralph.baldwin.cx>
    To: John Baldwin 
    X-Mailer: Apple Mail (2.3273)
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 20:08:56 -0000
    
    > On 16. May 2017, at 20:28, John Baldwin  wrote:
    >=20
    > On Wednesday, May 03, 2017 09:23:14 AM Michael Tuexen wrote:
    >> Author: tuexen
    >> Date: Wed May  3 09:23:13 2017
    >> New Revision: 317732
    >> URL: https://svnweb.freebsd.org/changeset/base/317732
    >>=20
    >> Log:
    >>  Decode the third argument of socket().
    >=20
    > This is not quite right for sockets that aren't PF_INET.  Probably =
    this
    > warrants a const char *sysdecode_socket_protocol(int domain, int =
    protocol)
    > that honors the domain in deciding what protocol value to output.  For =
    now
    > this could just handle PF_INET:
    >=20
    > const char *
    > sysdecode_socket_protocol(int domain, int protocol)
    > {
    >=20
    >    switch (domain) {
    >        case PF_INET:
    >            return (lookup_value(sockipproto, protocol));
    >        default:
    >            return (NULL));
    > }
    >=20
    > Then use this in truss.
    Yes, you are right. Will fix this tomorrow.
    
    Best regards
    Michael
    >=20
    > The socket option stuff currently hardcodes IP protocols and levels =
    only
    > because we don't have a good way of obtaining the domain of an =
    existing
    > socket in a target process.  For socket()'s protocol argument though =
    we
    > readily have the domain available.
    >=20
    > At some point in the future we might address the socket option issue =
    by
    > caching the domain argument when sockets are created in a table, and =
    for
    > truss when attaching to an existing process using the kinfo_file =
    interface to
    > learn about existing sockets, but that's not entirely trivial.
    >=20
    > --=20
    > John Baldwin
    
    
    From owner-svn-src-head@freebsd.org  Tue May 16 21:34:42 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38328D70543;
     Tue, 16 May 2017 21:34:42 +0000 (UTC)
     (envelope-from davidcs@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 029FD1DCE;
     Tue, 16 May 2017 21:34:41 +0000 (UTC)
     (envelope-from davidcs@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GLYfLc043046;
     Tue, 16 May 2017 21:34:41 GMT (envelope-from davidcs@FreeBSD.org)
    Received: (from davidcs@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GLYe8d043042;
     Tue, 16 May 2017 21:34:40 GMT (envelope-from davidcs@FreeBSD.org)
    Message-Id: <201705162134.v4GLYe8d043042@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: davidcs set sender to
     davidcs@FreeBSD.org using -f
    From: David C Somayajulu 
    Date: Tue, 16 May 2017 21:34:40 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318382 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 21:34:42 -0000
    
    Author: davidcs
    Date: Tue May 16 21:34:40 2017
    New Revision: 318382
    URL: https://svnweb.freebsd.org/changeset/base/318382
    
    Log:
      1. Move Rx Processing to fp_taskqueue(). With this CPU utilization for processing interrupts drops to around 1% for 100G and under 1% for other speeds.
      2. Use sysctls for TRACE_LRO_CNT and TRACE_TSO_PKT_LEN
      3. remove unused mtx tx_lock
      4. bind taskqueue kernel thread to the appropriate cpu core
      5. when tx_ring is full, stop further transmits till at least 1/16th of the Tx Ring is empty. In our case 1K entries. Also if there are rx_pkts to process, put the taskqueue thread to sleep for 100ms, before enabling interrupts.
      6. Use rx_pkt_threshold of 128.
      
      MFC after:3 days
    
    Modified:
      head/sys/dev/qlnx/qlnxe/qlnx_def.h
      head/sys/dev/qlnx/qlnxe/qlnx_os.c
      head/sys/dev/qlnx/qlnxe/qlnx_os.h
      head/sys/modules/qlnx/qlnxe/Makefile
    
    Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h
    ==============================================================================
    --- head/sys/dev/qlnx/qlnxe/qlnx_def.h	Tue May 16 19:54:47 2017	(r318381)
    +++ head/sys/dev/qlnx/qlnxe/qlnx_def.h	Tue May 16 21:34:40 2017	(r318382)
    @@ -191,6 +191,7 @@ struct qlnx_fastpath {
     	struct mtx		tx_mtx;
     	char			tx_mtx_name[32];
     	struct buf_ring		*tx_br;
    +	uint32_t		tx_ring_full;
     
     	struct task		fp_task;
     	struct taskqueue	*fp_taskqueue;
    @@ -364,6 +365,8 @@ struct qlnx_host {
     	/* debug */
     
     	uint32_t                dbg_level;
    +	uint32_t                dbg_trace_lro_cnt;
    +	uint32_t                dbg_trace_tso_pkt_len;
     	uint32_t                dp_level;
     	uint32_t                dp_module;
     
    @@ -386,7 +389,6 @@ struct qlnx_host {
     
     	/* tx related */
     	struct callout		tx_callout;
    -	struct mtx		tx_lock;
     	uint32_t		txr_idx;
     
     	/* rx related */
    
    Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c
    ==============================================================================
    --- head/sys/dev/qlnx/qlnxe/qlnx_os.c	Tue May 16 19:54:47 2017	(r318381)
    +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c	Tue May 16 21:34:40 2017	(r318382)
    @@ -382,16 +382,77 @@ qlnx_fp_taskqueue(void *context, int pen
             struct ifnet		*ifp;
             struct mbuf		*mp;
             int			ret;
    +	int			lro_enable, tc;
    +	int			rx_int = 0, total_rx_count = 0;
    +	struct thread		*cthread;
     
             fp = context;
     
             if (fp == NULL)
                     return;
     
    +	cthread = curthread;
    +
    +	thread_lock(cthread);
    +
    +	if (!sched_is_bound(cthread))
    +		sched_bind(cthread, fp->rss_id);
    +
    +	thread_unlock(cthread);
    +
             ha = (qlnx_host_t *)fp->edev;
     
             ifp = ha->ifp;
     
    +	lro_enable = ha->ifp->if_capenable & IFCAP_LRO;
    +
    +	rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
    +
    +	if (rx_int) {
    +		fp->rx_pkts += rx_int;
    +		total_rx_count += rx_int;
    +	}
    +
    +#ifdef QLNX_SOFT_LRO
    +	{
    +		struct lro_ctrl *lro;
    +
    +		lro = &fp->rxq->lro;
    +
    +		if (lro_enable && total_rx_count) {
    +
    +#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
    +
    +			if (ha->dbg_trace_lro_cnt) {
    +				if (lro->lro_mbuf_count & ~1023)
    +					fp->lro_cnt_1024++;
    +				else if (lro->lro_mbuf_count & ~511)
    +					fp->lro_cnt_512++;
    +				else if (lro->lro_mbuf_count & ~255)
    +					fp->lro_cnt_256++;
    +				else if (lro->lro_mbuf_count & ~127)
    +					fp->lro_cnt_128++;
    +				else if (lro->lro_mbuf_count & ~63)
    +					fp->lro_cnt_64++;
    +			}
    +			tcp_lro_flush_all(lro);
    +
    +#else
    +			struct lro_entry *queued;
    +
    +			while ((!SLIST_EMPTY(&lro->lro_active))) {
    +				queued = SLIST_FIRST(&lro->lro_active);
    +				SLIST_REMOVE_HEAD(&lro->lro_active, next);
    +				tcp_lro_flush(lro, queued);
    +			}
    +#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
    +		}
    +	}
    +#endif /* #ifdef QLNX_SOFT_LRO */
    +
    +	ecore_sb_update_sb_idx(fp->sb_info);
    +	rmb();
    +
             mtx_lock(&fp->tx_mtx);
     
             if (((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
    @@ -401,13 +462,19 @@ qlnx_fp_taskqueue(void *context, int pen
                     goto qlnx_fp_taskqueue_exit;
             }
     
    -        (void)qlnx_tx_int(ha, fp, fp->txq[0]);
    +	for (tc = 0; tc < ha->num_tc; tc++) {
    +		(void)qlnx_tx_int(ha, fp, fp->txq[tc]);
    +	}
     
             mp = drbr_peek(ifp, fp->tx_br);
     
             while (mp != NULL) {
     
    -                ret = qlnx_send(ha, fp, &mp);
    +		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
    +			ret = qlnx_send(ha, fp, &mp);
    +		} else {
    +			ret = -1;
    +		}
     
                     if (ret) {
     
    @@ -428,14 +495,28 @@ qlnx_fp_taskqueue(void *context, int pen
                             fp->tx_pkts_processed++;
                     }
     
    +		if (fp->tx_ring_full)
    +			break;
    +
                     mp = drbr_peek(ifp, fp->tx_br);
             }
     
    -        (void)qlnx_tx_int(ha, fp, fp->txq[0]);
    +	for (tc = 0; tc < ha->num_tc; tc++) {
    +		(void)qlnx_tx_int(ha, fp, fp->txq[tc]);
    +	}
     
             mtx_unlock(&fp->tx_mtx);
     
     qlnx_fp_taskqueue_exit:
    +	if (rx_int) {
    +		if (fp->fp_taskqueue != NULL)
    +			taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task);
    +	} else {
    +		if (fp->tx_ring_full) {
    +			qlnx_mdelay(__func__, 100);
    +		}
    +		ecore_sb_ack(fp->sb_info, IGU_INT_ENABLE, 1);
    +	}
     
             QL_DPRINT2(ha, (ha->pci_dev, "%s: exit ret = %d\n", __func__, ret));
             return;
    @@ -504,7 +585,9 @@ qlnx_drain_fp_taskqueues(qlnx_host_t *ha
                     fp = &ha->fp_array[i];
     
     		if (fp->fp_taskqueue != NULL) {
    +			QLNX_UNLOCK(ha);
     			taskqueue_drain(fp->fp_taskqueue, &fp->fp_task);
    +			QLNX_LOCK(ha);
     		}
     	}
     	return;
    @@ -540,7 +623,6 @@ qlnx_pci_attach(device_t dev)
             ha->pci_dev = dev;
     
     	mtx_init(&ha->hw_lock, "qlnx_hw_lock", MTX_NETWORK_LOCK, MTX_DEF);
    -        mtx_init(&ha->tx_lock, "qlnx_tx_lock", MTX_NETWORK_LOCK, MTX_DEF);
     
             ha->flags.lock_init = 1;
     
    @@ -944,7 +1026,6 @@ qlnx_release(qlnx_host_t *ha)
                     pci_release_msi(dev);
     
             if (ha->flags.lock_init) {
    -                mtx_destroy(&ha->tx_lock);
                     mtx_destroy(&ha->hw_lock);
             }
     
    @@ -1226,7 +1307,6 @@ qlnx_add_fp_stats_sysctls(qlnx_host_t *h
     			CTLFLAG_RD, &ha->fp_array[i].err_tx_cons_idx_conflict,
     			"err_tx_cons_idx_conflict");
     
    -#ifdef QLNX_TRACE_LRO_CNT
     		SYSCTL_ADD_QUAD(ctx, node_children,
     			OID_AUTO, "lro_cnt_64",
     			CTLFLAG_RD, &ha->fp_array[i].lro_cnt_64,
    @@ -1251,7 +1331,6 @@ qlnx_add_fp_stats_sysctls(qlnx_host_t *h
     			OID_AUTO, "lro_cnt_1024",
     			CTLFLAG_RD, &ha->fp_array[i].lro_cnt_1024,
     			"lro_cnt_1024");
    -#endif /* #ifdef QLNX_TRACE_LRO_CNT */
     
     		/* Rx Related */
     
    @@ -1710,6 +1789,18 @@ qlnx_add_sysctls(qlnx_host_t *ha)
                     OID_AUTO, "dp_level", CTLFLAG_RW,
                     &ha->dp_level, ha->dp_level, "DP Level");
     
    +        ha->dbg_trace_lro_cnt = 0;
    +        SYSCTL_ADD_UINT(ctx, children,
    +                OID_AUTO, "dbg_trace_lro_cnt", CTLFLAG_RW,
    +                &ha->dbg_trace_lro_cnt, ha->dbg_trace_lro_cnt,
    +		"Trace LRO Counts");
    +
    +        ha->dbg_trace_tso_pkt_len = 0;
    +        SYSCTL_ADD_UINT(ctx, children,
    +                OID_AUTO, "dbg_trace_tso_pkt_len", CTLFLAG_RW,
    +                &ha->dbg_trace_tso_pkt_len, ha->dbg_trace_tso_pkt_len,
    +		"Trace TSO packet lengths");
    +
             ha->dp_module = 0;
             SYSCTL_ADD_UINT(ctx, children,
                     OID_AUTO, "dp_module", CTLFLAG_RW,
    @@ -1755,7 +1846,7 @@ qlnx_add_sysctls(qlnx_host_t *ha)
                     &ha->tx_coalesce_usecs, ha->tx_coalesce_usecs,
     		"tx_coalesce_usecs");
     
    -	ha->rx_pkt_threshold = 32;
    +	ha->rx_pkt_threshold = 128;
             SYSCTL_ADD_UINT(ctx, children,
                     OID_AUTO, "rx_pkt_threshold", CTLFLAG_RW,
                     &ha->rx_pkt_threshold, ha->rx_pkt_threshold,
    @@ -2162,7 +2253,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     			ifp->if_mtu = ifr->ifr_mtu;
     			ha->max_frame_size =
     				ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
    -			if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) {
    +			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
     				qlnx_init_locked(ha);
     			}
     
    @@ -2178,7 +2269,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     		QLNX_LOCK(ha);
     
     		if (ifp->if_flags & IFF_UP) {
    -			if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) {
    +			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
     				if ((ifp->if_flags ^ ha->if_flags) &
     					IFF_PROMISC) {
     					ret = qlnx_set_promisc(ha);
    @@ -2712,6 +2803,16 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     	tx_data_bd	= NULL;
     
     	txq = fp->txq[0];
    +
    +	if (fp->tx_ring_full) {
    +		elem_left = ecore_chain_get_elem_left(&txq->tx_pbl);
    +
    +		if (elem_left < (TX_RING_SIZE >> 4)) 
    +			return (-1);
    +		else 
    +			fp->tx_ring_full = 0;
    +	}
    +
     	idx = txq->sw_tx_prod;
     
     	map = txq->sw_tx_ring[idx].map;
    @@ -2720,20 +2821,18 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     	ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs,
     			BUS_DMA_NOWAIT);
     
    -#ifdef QLNX_TRACE_TSO_PKT_LEN
    -
    -	if (!fp->tx_tso_min_pkt_len) {
    -		fp->tx_tso_min_pkt_len = m_head->m_pkthdr.len;
    -		fp->tx_tso_min_pkt_len = m_head->m_pkthdr.len;
    -	} else {
    -		if (fp->tx_tso_min_pkt_len > m_head->m_pkthdr.len)
    +	if (ha->dbg_trace_tso_pkt_len) {
    +		if (!fp->tx_tso_min_pkt_len) {
     			fp->tx_tso_min_pkt_len = m_head->m_pkthdr.len;
    -		if (fp->tx_tso_max_pkt_len < m_head->m_pkthdr.len)
    -			fp->tx_tso_max_pkt_len = m_head->m_pkthdr.len;
    +			fp->tx_tso_min_pkt_len = m_head->m_pkthdr.len;
    +		} else {
    +			if (fp->tx_tso_min_pkt_len > m_head->m_pkthdr.len)
    +				fp->tx_tso_min_pkt_len = m_head->m_pkthdr.len;
    +			if (fp->tx_tso_max_pkt_len < m_head->m_pkthdr.len)
    +				fp->tx_tso_max_pkt_len = m_head->m_pkthdr.len;
    +		}
     	}
     
    -#endif /* #ifdef QLNX_TRACE_TSO_PKT_LEN */
    -
     	if (m_head->m_pkthdr.csum_flags & CSUM_TSO)
     		offset = qlnx_tcp_offset(ha, m_head);
     
    @@ -2815,14 +2914,12 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     
     	QL_ASSERT(ha, (nsegs != 0), ("qlnx_send: empty packet"));
     
    -#ifdef QLNX_TRACE_TSO_PKT_LEN
    -
    -	if (nsegs < QLNX_FP_MAX_SEGS)
    -		fp->tx_pkts[(nsegs - 1)]++;
    -	else
    -		fp->tx_pkts[(QLNX_FP_MAX_SEGS - 1)]++; 
    -
    -#endif /* #ifdef QLNX_TRACE_TSO_PKT_LEN */
    +	if (ha->dbg_trace_tso_pkt_len) {
    +		if (nsegs < QLNX_FP_MAX_SEGS)
    +			fp->tx_pkts[(nsegs - 1)]++;
    +		else
    +			fp->tx_pkts[(QLNX_FP_MAX_SEGS - 1)]++; 
    +	}
     
     	if ((nsegs + QLNX_TX_ELEM_RESERVE) >
     		(int)(elem_left = ecore_chain_get_elem_left(&txq->tx_pbl))) {
    @@ -2843,6 +2940,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     				__func__, nsegs, elem_left, fp->rss_id));
     
     			fp->err_tx_nsegs_gt_elem_left++;
    +			fp->tx_ring_full = 1;
     			ha->storm_stats_enable = 1;
     			return (ENOBUFS);
     		}
    @@ -3051,15 +3149,13 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     
     	first_bd->data.nbds = nbd;
     
    -#ifdef QLNX_TRACE_TSO_PKT_LEN
    -
    -	if (fp->tx_tso_max_nsegs < nsegs)
    -		fp->tx_tso_max_nsegs = nsegs;
    -
    -	if ((nsegs < fp->tx_tso_min_nsegs) || (!fp->tx_tso_min_nsegs))
    -		fp->tx_tso_min_nsegs = nsegs;
    +	if (ha->dbg_trace_tso_pkt_len) {
    +		if (fp->tx_tso_max_nsegs < nsegs)
    +			fp->tx_tso_max_nsegs = nsegs;
     
    -#endif /* #ifdef QLNX_TRACE_TSO_PKT_LEN */
    +		if ((nsegs < fp->tx_tso_min_nsegs) || (!fp->tx_tso_min_nsegs))
    +			fp->tx_tso_min_nsegs = nsegs;
    +	}
     
     	txq->sw_tx_ring[idx].nsegs = nsegs;
     	txq->sw_tx_prod = (txq->sw_tx_prod + 1) & (TX_RING_SIZE - 1);
    @@ -4188,11 +4284,9 @@ qlnx_fp_isr(void *arg)
             qlnx_ivec_t		*ivec = arg;
             qlnx_host_t		*ha;
             struct qlnx_fastpath	*fp = NULL;
    -        int			idx, lro_enable, tc;
    -        int			rx_int = 0, total_rx_count = 0;
    +        int			idx;
     
             ha = ivec->ha;
    -        lro_enable = ha->ifp->if_capenable & IFCAP_LRO;
     
             if (ha->state != QLNX_STATE_OPEN) {
                     return;
    @@ -4214,73 +4308,8 @@ qlnx_fp_isr(void *arg)
                     ha->err_fp_null++;
             } else {
                     ecore_sb_ack(fp->sb_info, IGU_INT_DISABLE, 0);
    -
    -                do {
    -                        for (tc = 0; tc < ha->num_tc; tc++) {
    -                                if (mtx_trylock(&fp->tx_mtx)) {
    -                                        qlnx_tx_int(ha, fp, fp->txq[tc]);
    -                                        mtx_unlock(&fp->tx_mtx);
    -                                }
    -                        }
    -
    -                        rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold,
    -                                        lro_enable);
    -
    -                        if (rx_int) {
    -                                fp->rx_pkts += rx_int;
    -				total_rx_count += rx_int;
    -			}
    -
    -                } while (rx_int);
    -
    -
    -#ifdef QLNX_SOFT_LRO
    -                {
    -                        struct lro_ctrl *lro;
    -
    -                        lro = &fp->rxq->lro;
    -
    -                        if (lro_enable && total_rx_count) {
    -
    -#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
    -
    -#ifdef QLNX_TRACE_LRO_CNT
    -				if (lro->lro_mbuf_count & ~1023)
    -					fp->lro_cnt_1024++;
    -				else if (lro->lro_mbuf_count & ~511)
    -					fp->lro_cnt_512++;
    -				else if (lro->lro_mbuf_count & ~255)
    -					fp->lro_cnt_256++;
    -				else if (lro->lro_mbuf_count & ~127)
    -					fp->lro_cnt_128++;
    -				else if (lro->lro_mbuf_count & ~63)
    -					fp->lro_cnt_64++;
    -#endif /* #ifdef QLNX_TRACE_LRO_CNT */
    -
    -                                tcp_lro_flush_all(lro);
    -
    -#else
    -                                struct lro_entry *queued;
    -
    -                                while ((!SLIST_EMPTY(&lro->lro_active))) {
    -                                        queued = SLIST_FIRST(&lro->lro_active);
    -                                        SLIST_REMOVE_HEAD(&lro->lro_active, \
    -						next);
    -                                        tcp_lro_flush(lro, queued);
    -                                }
    -#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
    -                        }
    -                }
    -#endif /* #ifdef QLNX_SOFT_LRO */
    -
    -                if (fp->fp_taskqueue != NULL)
    -                        taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task);
    -
    -                ecore_sb_update_sb_idx(fp->sb_info);
    -                rmb();
    -                ecore_sb_ack(fp->sb_info, IGU_INT_ENABLE, 1);
    -
    -                return;
    +		if (fp->fp_taskqueue != NULL)
    +			taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task);
             }
     
             return;
    @@ -5150,6 +5179,8 @@ qlnx_init_fp(qlnx_host_t *ha)
     		snprintf(fp->name, sizeof(fp->name), "%s-fp-%d", qlnx_name_str,
     			rss_id);
     
    +		fp->tx_ring_full = 0;
    +
     		/* reset all the statistics counters */
     
     		fp->tx_pkts_processed = 0;
    
    Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.h
    ==============================================================================
    --- head/sys/dev/qlnx/qlnxe/qlnx_os.h	Tue May 16 19:54:47 2017	(r318381)
    +++ head/sys/dev/qlnx/qlnxe/qlnx_os.h	Tue May 16 21:34:40 2017	(r318382)
    @@ -92,6 +92,7 @@
     #include 
     #include 
     #include 
    +#include 
     
     static __inline int qlnx_ms_to_hz(int ms)
     {
    @@ -138,10 +139,6 @@ MALLOC_DECLARE(M_QLNXBUF);
     #define QLNX_LOCK(ha)		mtx_lock(&ha->hw_lock)
     #define QLNX_UNLOCK(ha)		mtx_unlock(&ha->hw_lock)
     
    - 
    -#define QLNX_TX_LOCK(ha)	mtx_lock(&ha->tx_lock);
    -#define QLNX_TX_UNLOCK(ha)	mtx_unlock(&ha->tx_lock);
    -
     /*
      * structure encapsulating a DMA buffer
      */
    
    Modified: head/sys/modules/qlnx/qlnxe/Makefile
    ==============================================================================
    --- head/sys/modules/qlnx/qlnxe/Makefile	Tue May 16 19:54:47 2017	(r318381)
    +++ head/sys/modules/qlnx/qlnxe/Makefile	Tue May 16 21:34:40 2017	(r318382)
    @@ -65,8 +65,6 @@ CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi
     #CFLAGS += -DQLNX_SOFT_LRO
     #CFLAGS += -DQLNX_QSORT_LRO
     #CFLAGS += -DQLNX_MAX_COALESCE
    -#CFLAGS += -DQLNX_TRACE_LRO_CNT
    -#CFLAGS += -DQLNX_TRACE_TSO_PKT_LEN
     
     
     .include 
    
    From owner-svn-src-head@freebsd.org  Tue May 16 21:46:32 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 018DED70864;
     Tue, 16 May 2017 21:46:32 +0000 (UTC)
     (envelope-from davidcs@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 98927790;
     Tue, 16 May 2017 21:46:31 +0000 (UTC)
     (envelope-from davidcs@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GLkUZh047018;
     Tue, 16 May 2017 21:46:30 GMT (envelope-from davidcs@FreeBSD.org)
    Received: (from davidcs@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GLkUMQ047015;
     Tue, 16 May 2017 21:46:30 GMT (envelope-from davidcs@FreeBSD.org)
    Message-Id: <201705162146.v4GLkUMQ047015@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: davidcs set sender to
     davidcs@FreeBSD.org using -f
    From: David C Somayajulu 
    Date: Tue, 16 May 2017 21:46:30 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318383 - head/sys/dev/qlnx/qlnxe
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 21:46:32 -0000
    
    Author: davidcs
    Date: Tue May 16 21:46:30 2017
    New Revision: 318383
    URL: https://svnweb.freebsd.org/changeset/base/318383
    
    Log:
      QL_DPRINT macro modfied to handle multiple args; print line#.
      
      Submitted by:Shminderjit.Singh@cavium.com
      MFC after:3 days
    
    Modified:
      head/sys/dev/qlnx/qlnxe/qlnx_def.h
      head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c
      head/sys/dev/qlnx/qlnxe/qlnx_os.c
    
    Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h
    ==============================================================================
    --- head/sys/dev/qlnx/qlnxe/qlnx_def.h	Tue May 16 21:34:40 2017	(r318382)
    +++ head/sys/dev/qlnx/qlnxe/qlnx_def.h	Tue May 16 21:46:30 2017	(r318383)
    @@ -483,35 +483,141 @@ typedef struct qlnx_host qlnx_host_t;
     
     #ifdef QLNX_DEBUG
     
    -#define QL_DPRINT1(ha, x)       if (ha->dbg_level & 0x0001) device_printf x
    -#define QL_DPRINT2(ha, x)       if (ha->dbg_level & 0x0002) device_printf x
    -#define QL_DPRINT3(ha, x)       if (ha->dbg_level & 0x0004) device_printf x
    -#define QL_DPRINT4(ha, x)       if (ha->dbg_level & 0x0008) device_printf x
    -#define QL_DPRINT5(ha, x)       if (ha->dbg_level & 0x0010) device_printf x
    -#define QL_DPRINT6(ha, x)       if (ha->dbg_level & 0x0020) device_printf x
    -#define QL_DPRINT7(ha, x)       if (ha->dbg_level & 0x0040) device_printf x
    -#define QL_DPRINT8(ha, x)       if (ha->dbg_level & 0x0080) device_printf x
    -#define QL_DPRINT9(ha, x)       if (ha->dbg_level & 0x0100) device_printf x
    -#define QL_DPRINT11(ha, x)      if (ha->dbg_level & 0x0400) device_printf x
    -#define QL_DPRINT12(ha, x)      if (ha->dbg_level & 0x0800) device_printf x
    -#define QL_DPRINT13(ha, x)      if (ha->dbg_level & 0x1000) device_printf x
    -#define QL_DPRINT14(ha, x)      if (ha->dbg_level & 0x2000) device_printf x
    +#define QL_DPRINT1(ha, x, ...) 					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0001) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT2(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0002) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT3(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0004) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT4(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0008) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT5(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0010) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT6(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0020) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT7(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0040) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT8(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0080) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT9(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0100) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT11(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0400) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT12(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x0800) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
    +#define QL_DPRINT13(ha, x, ...)					\
    +	do { 							\
    +		if ((ha)->dbg_level & 0x1000) {			\
    +			device_printf ((ha)->pci_dev,		\
    +				"[%s:%d]" x,			\
    +				__func__, __LINE__,		\
    +				## __VA_ARGS__);		\
    +		}						\
    +	} while (0)
    +
     
     #else
     
    -#define QL_DPRINT1(ha, x)
    -#define QL_DPRINT2(ha, x)
    -#define QL_DPRINT3(ha, x)
    -#define QL_DPRINT4(ha, x)
    -#define QL_DPRINT5(ha, x)
    -#define QL_DPRINT6(ha, x)
    -#define QL_DPRINT7(ha, x)
    -#define QL_DPRINT8(ha, x)
    -#define QL_DPRINT9(ha, x)
    -#define QL_DPRINT11(ha, x)
    -#define QL_DPRINT12(ha, x)
    -#define QL_DPRINT13(ha, x)
    -#define QL_DPRINT14(ha, x)
    +#define QL_DPRINT1(ha, x, ...)
    +#define QL_DPRINT2(ha, x, ...)
    +#define QL_DPRINT3(ha, x, ...)
    +#define QL_DPRINT4(ha, x, ...)
    +#define QL_DPRINT5(ha, x, ...)
    +#define QL_DPRINT6(ha, x, ...)
    +#define QL_DPRINT7(ha, x, ...)
    +#define QL_DPRINT8(ha, x, ...)
    +#define QL_DPRINT9(ha, x, ...)
    +#define QL_DPRINT11(ha, x, ...)
    +#define QL_DPRINT12(ha, x, ...)
    +#define QL_DPRINT13(ha, x, ...)
     
     #endif /* #ifdef QLNX_DEBUG */
     
    
    Modified: head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c
    ==============================================================================
    --- head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c	Tue May 16 21:34:40 2017	(r318382)
    +++ head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c	Tue May 16 21:46:30 2017	(r318383)
    @@ -121,8 +121,7 @@ qlnx_grc_dump(qlnx_host_t *ha, uint32_t 
     	p_ptt = ecore_ptt_acquire(p_hwfn);
     
     	if (!p_ptt) {
    -		QL_DPRINT1(ha, (ha->pci_dev, "%s : ecore_ptt_acquire failed\n",
    -			__func__));
    +		QL_DPRINT1(ha,"ecore_ptt_acquire failed\n");
     		return (rval);
     	}
     
    @@ -133,9 +132,8 @@ qlnx_grc_dump(qlnx_host_t *ha, uint32_t 
     	 	rval = 0;	
     		ha->grcdump_taken = 1;
     	} else
    -		QL_DPRINT1(ha, (ha->pci_dev,
    -			"%s : ecore_dbg_grc_dump failed [%d, 0x%x]\n",
    -			__func__, hwfn_index, rval));
    +		QL_DPRINT1(ha,"ecore_dbg_grc_dump failed [%d, 0x%x]\n",
    +			   hwfn_index, rval);
     
     	ecore_ptt_release(p_hwfn, p_ptt);
     
    @@ -177,8 +175,7 @@ qlnx_get_grc_dump(qlnx_host_t *ha, qlnx_
     
     		grcdump->grcdump_dwords[i] = dwords;
     
    -		QL_DPRINT1(ha, (ha->pci_dev, "%s: grcdump_dwords[%d] = 0x%x\n",
    -			__func__, i, dwords));
    +		QL_DPRINT1(ha,"grcdump_dwords[%d] = 0x%x\n", i, dwords);
     
     		rval = copyout(ha->grcdump[i], grcdump->grcdump[i],
     				ha->grcdump_size[i]);
    @@ -213,8 +210,7 @@ qlnx_idle_chk(qlnx_host_t *ha, uint32_t 
     	p_ptt = ecore_ptt_acquire(p_hwfn);
     
     	if (!p_ptt) {
    -		QL_DPRINT1(ha, (ha->pci_dev,
    -			"%s : ecore_ptt_acquire failed\n", __func__));
    +		QL_DPRINT1(ha,"ecore_ptt_acquire failed\n");
     		return (rval);
     	}
     
    @@ -225,9 +221,8 @@ qlnx_idle_chk(qlnx_host_t *ha, uint32_t 
     	 	rval = 0;	
     		ha->idle_chk_taken = 1;
     	} else
    -		QL_DPRINT1(ha, (ha->pci_dev,
    -			"%s : ecore_dbg_idle_chk_dump failed [%d, 0x%x]\n",
    -			__func__, hwfn_index, rval));
    +		QL_DPRINT1(ha,"ecore_dbg_idle_chk_dump failed [%d, 0x%x]\n",
    +			   hwfn_index, rval);
     
     	ecore_ptt_release(p_hwfn, p_ptt);
     
    @@ -271,8 +266,7 @@ qlnx_get_idle_chk(qlnx_host_t *ha, qlnx_
     		
     		idle_chk->idle_chk_dwords[i] = dwords;
     
    -		QL_DPRINT1(ha, (ha->pci_dev, "%s: idle_chk_dwords[%d] = 0x%x\n",
    -			__func__, i, dwords));
    +		QL_DPRINT1(ha,"idle_chk_dwords[%d] = 0x%x\n", i, dwords);
     
                    	rval = copyout(ha->idle_chk[i], idle_chk->idle_chk[i],
     				ha->idle_chk_size[i]);
    @@ -299,9 +293,8 @@ qlnx_get_trace_cmd_size(qlnx_host_t *ha,
             p_ptt = ecore_ptt_acquire(p_hwfn);
     
             if (!p_ptt) {
    -                QL_DPRINT1(ha, (ha->pci_dev,
    -			"%s: ecore_ptt_acquire [%d, 0x%x]failed\n",
    -                        __func__, hwfn_index, cmd));
    +                QL_DPRINT1(ha, "ecore_ptt_acquire [%d, 0x%x]failed\n",
    +                           hwfn_index, cmd);
                     return (0);
             }
     
    @@ -334,8 +327,7 @@ qlnx_get_trace_cmd_size(qlnx_host_t *ha,
     	}
     
             if (rval != DBG_STATUS_OK) {
    -                QL_DPRINT1(ha, (ha->pci_dev, "%s : cmd = 0x%x failed [0x%x]\n",
    -                        __func__, cmd, rval));
    +                QL_DPRINT1(ha,"cmd = 0x%x failed [0x%x]\n", cmd, rval);
     		num_dwords = 0;
             }
     
    @@ -369,9 +361,8 @@ qlnx_get_trace(qlnx_host_t *ha, int hwfn
     
     	buffer = qlnx_zalloc(trace->size[hwfn_index]);
     	if (buffer == NULL) { 
    -                QL_DPRINT1(ha, (ha->pci_dev,
    -			"%s: qlnx_zalloc [%d, 0x%x]failed\n",
    -                        __func__, hwfn_index, trace->cmd));
    +                QL_DPRINT1(ha,"qlnx_zalloc [%d, 0x%x]failed\n",
    +                           hwfn_index, trace->cmd);
                     return (ENXIO);
     	}
     	ecore_dbg_set_app_ver(ecore_dbg_get_fw_func_ver());
    @@ -380,9 +371,8 @@ qlnx_get_trace(qlnx_host_t *ha, int hwfn
             p_ptt = ecore_ptt_acquire(p_hwfn);
     
             if (!p_ptt) {
    -                QL_DPRINT1(ha, (ha->pci_dev,
    -			"%s: ecore_ptt_acquire [%d, 0x%x]failed\n",
    -                        __func__, hwfn_index, trace->cmd));
    +                QL_DPRINT1(ha, "ecore_ptt_acquire [%d, 0x%x]failed\n",
    +                           hwfn_index, trace->cmd);
                     return (ENXIO);
             }
     
    @@ -420,8 +410,7 @@ qlnx_get_trace(qlnx_host_t *ha, int hwfn
     	}
     
             if (rval != DBG_STATUS_OK) {
    -                QL_DPRINT1(ha, (ha->pci_dev, "%s : cmd = 0x%x failed [0x%x]\n",
    -                        __func__, trace->cmd, rval));
    +                QL_DPRINT1(ha,"cmd = 0x%x failed [0x%x]\n", trace->cmd, rval);
     		num_dwords = 0;
             }
     
    @@ -609,21 +598,18 @@ qlnx_write_nvram(qlnx_host_t *ha, qlnx_n
     
     	ret = copyin(nvram->data, buf, nvram->data_len);
     
    -	QL_DPRINT9(ha,
    -		(ha->pci_dev, "%s: issue cmd = 0x%x data = %p "
    -		" data_len = 0x%x ret = 0x%x exit\n", __func__,
    -		cmd, nvram->data, nvram->data_len, ret));
    +	QL_DPRINT9(ha, "issue cmd = 0x%x data = %p \
    +		 data_len = 0x%x ret = 0x%x exit\n",
    +		cmd, nvram->data, nvram->data_len, ret);
     
     	if (ret == 0) {
     		ret = ecore_mcp_nvm_write(&ha->cdev, cmd,
     			nvram->offset, buf, nvram->data_len);
     	}
     
    -	QL_DPRINT9(ha,
    -		(ha->pci_dev, "%s: cmd = 0x%x data = %p "
    -		" data_len = 0x%x resp = 0x%x ret = 0x%x exit\n",
    -		__func__, cmd, nvram->data, nvram->data_len,
    -		ha->cdev.mcp_nvm_resp, ret));
    +	QL_DPRINT9(ha, "cmd = 0x%x data = %p \
    +		 data_len = 0x%x resp = 0x%x ret = 0x%x exit\n",
    +		cmd, nvram->data, nvram->data_len, ha->cdev.mcp_nvm_resp, ret);
     
     	free(buf, M_QLNXBUF);
     
    @@ -644,10 +630,9 @@ qlnx_read_nvram(qlnx_host_t *ha, qlnx_nv
     	ret = ecore_mcp_nvm_read(&ha->cdev, nvram->offset, buf,
     		nvram->data_len);
     
    -	QL_DPRINT9(ha, (ha->pci_dev, "%s: data = %p data_len = 0x%x "
    -		" resp = 0x%x ret = 0x%x exit\n", __func__,
    -		nvram->data, nvram->data_len,
    -		ha->cdev.mcp_nvm_resp, ret));
    +	QL_DPRINT9(ha, " data = %p data_len = 0x%x \
    +		 resp = 0x%x ret = 0x%x exit\n",
    +		nvram->data, nvram->data_len, ha->cdev.mcp_nvm_resp, ret);
     
     	if (ret == 0) {
     		ret = copyout(buf, nvram->data, nvram->data_len);
    @@ -672,10 +657,9 @@ qlnx_get_nvram_resp(qlnx_host_t *ha, qln
     
     	ret = ecore_mcp_nvm_resp(&ha->cdev, buf);
     
    -	QL_DPRINT9(ha, (ha->pci_dev, "%s: data = %p data_len = 0x%x "
    -		" resp = 0x%x ret = 0x%x exit\n", __func__,
    -		nvram->data, nvram->data_len,
    -		ha->cdev.mcp_nvm_resp, ret));
    +	QL_DPRINT9(ha, "data = %p data_len = 0x%x \
    +		 resp = 0x%x ret = 0x%x exit\n",
    +		nvram->data, nvram->data_len, ha->cdev.mcp_nvm_resp, ret);
     
     	if (ret == 0) {
     		ret = copyout(buf, nvram->data, nvram->data_len);
    @@ -708,28 +692,25 @@ qlnx_nvram(qlnx_host_t *ha, qlnx_nvram_t
     	case QLNX_NVRAM_CMD_SET_SECURE_MODE:
     		ret = ecore_mcp_nvm_set_secure_mode(&ha->cdev, nvram->offset);
     
    -		QL_DPRINT9(ha, (ha->pci_dev,
    -			"%s: QLNX_NVRAM_CMD_SET_SECURE_MODE "
    -			" resp = 0x%x ret = 0x%x exit\n", __func__,
    -			ha->cdev.mcp_nvm_resp, ret));
    +		QL_DPRINT9(ha, "QLNX_NVRAM_CMD_SET_SECURE_MODE \
    +			 resp = 0x%x ret = 0x%x exit\n",
    +			 ha->cdev.mcp_nvm_resp, ret);
     		break;
     
     	case QLNX_NVRAM_CMD_DEL_FILE:
     		ret = ecore_mcp_nvm_del_file(&ha->cdev, nvram->offset);
     
    -		QL_DPRINT9(ha, (ha->pci_dev,
    -			"%s: QLNX_NVRAM_CMD_DEL_FILE "
    -			" resp = 0x%x ret = 0x%x exit\n", __func__,
    -			ha->cdev.mcp_nvm_resp, ret));
    +		QL_DPRINT9(ha, "QLNX_NVRAM_CMD_DEL_FILE \
    +			 resp = 0x%x ret = 0x%x exit\n",
    +			ha->cdev.mcp_nvm_resp, ret);
     		break;
     
     	case QLNX_NVRAM_CMD_PUT_FILE_BEGIN:
     		ret = ecore_mcp_nvm_put_file_begin(&ha->cdev, nvram->offset);
     
    -		QL_DPRINT9(ha, (ha->pci_dev,
    -			"%s: QLNX_NVRAM_CMD_PUT_FILE_BEGIN "
    -			" resp = 0x%x ret = 0x%x exit\n", __func__,
    -			ha->cdev.mcp_nvm_resp, ret));
    +		QL_DPRINT9(ha, "QLNX_NVRAM_CMD_PUT_FILE_BEGIN \
    +			 resp = 0x%x ret = 0x%x exit\n",
    +			ha->cdev.mcp_nvm_resp, ret);
     		break;
     
     	case QLNX_NVRAM_CMD_GET_NVRAM_RESP:
    
    Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c
    ==============================================================================
    --- head/sys/dev/qlnx/qlnxe/qlnx_os.c	Tue May 16 21:34:40 2017	(r318382)
    +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c	Tue May 16 21:46:30 2017	(r318383)
    @@ -303,7 +303,7 @@ qlnx_sp_intr(void *arg)
     
     	ha = (qlnx_host_t *)p_hwfn->p_dev;
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__));
    +	QL_DPRINT2(ha, "enter\n");
     
     	for (i = 0; i < ha->cdev.num_hwfns; i++) {
     		if (&ha->cdev.hwfns[i] == p_hwfn) {
    @@ -311,7 +311,7 @@ qlnx_sp_intr(void *arg)
     			break;
     		}
     	}
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__));
    +	QL_DPRINT2(ha, "exit\n");
     	
     	return;
     }
    @@ -353,8 +353,7 @@ qlnx_create_sp_taskqueues(qlnx_host_t *h
     		taskqueue_start_threads(&ha->sp_taskqueue[i], 1, PI_NET, "%s",
     			tq_name);
     
    -		QL_DPRINT1(ha, (ha->pci_dev, "%s: %p\n", __func__,
    -			ha->sp_taskqueue[i]));
    +		QL_DPRINT1(ha, "%p\n", ha->sp_taskqueue[i]);
     	}
     
     	return (0);
    @@ -518,7 +517,7 @@ qlnx_fp_taskqueue_exit:
     		ecore_sb_ack(fp->sb_info, IGU_INT_ENABLE, 1);
     	}
     
    -        QL_DPRINT2(ha, (ha->pci_dev, "%s: exit ret = %d\n", __func__, ret));
    +        QL_DPRINT2(ha, "exit ret = %d\n", ret);
             return;
     }
     
    @@ -548,8 +547,7 @@ qlnx_create_fp_taskqueues(qlnx_host_t *h
     		taskqueue_start_threads(&fp->fp_taskqueue, 1, PI_NET, "%s",
     			tq_name);
     
    -		QL_DPRINT1(ha, (ha->pci_dev, "%s: %p\n", __func__,
    -			fp->fp_taskqueue));
    +		QL_DPRINT1(ha, "%p\n",fp->fp_taskqueue);
     	}
     
     	return (0);
    @@ -711,15 +709,14 @@ qlnx_pci_attach(device_t dev)
     	else
     		ha->num_rss = ha->msix_count - ha->cdev.num_hwfns;
     
    -	QL_DPRINT1(ha, (dev, "%s:\n\t\t\tpci_reg [%p, 0x%08x 0x%08x]"
    +	QL_DPRINT1(ha, "\n\t\t\tpci_reg [%p, 0x%08x 0x%08x]"
     		"\n\t\t\tdbells [%p, 0x%08x 0x%08x]"
     		"\n\t\t\tmsix [%p, 0x%08x 0x%08x 0x%x 0x%x]"
     		"\n\t\t\t[ncpus = %d][num_rss = 0x%x] [num_tc = 0x%x]\n",
    -		__func__, ha->pci_reg, rsrc_len_reg,
    +		 ha->pci_reg, rsrc_len_reg,
     		ha->reg_rid, ha->pci_dbells, rsrc_len_dbells, ha->dbells_rid,
     		ha->msix_bar, rsrc_len_msix, ha->msix_rid, pci_msix_count(dev),
    -		ha->msix_count, mp_ncpus, ha->num_rss, ha->num_tc));
    -
    +		ha->msix_count, mp_ncpus, ha->num_rss, ha->num_tc);
             if (pci_alloc_msix(dev, &ha->msix_count)) {
                     device_printf(dev, "%s: pci_alloc_msix[%d] failed\n", __func__,
                             ha->msix_count);
    @@ -755,9 +752,9 @@ qlnx_pci_attach(device_t dev)
     			goto qlnx_pci_attach_err;
     		}
     
    -		QL_DPRINT1(ha, (dev, "%s: p_hwfn [%p] sp_irq_rid %d"
    -			" sp_irq %p sp_handle %p\n", __func__, p_hwfn,
    -			ha->sp_irq_rid[i], ha->sp_irq[i], ha->sp_handle[i]));
    +		QL_DPRINT1(ha, "p_hwfn [%p] sp_irq_rid %d"
    +			" sp_irq %p sp_handle %p\n", p_hwfn,
    +			ha->sp_irq_rid[i], ha->sp_irq[i], ha->sp_handle[i]);
     
     	}
     
    @@ -800,8 +797,8 @@ qlnx_pci_attach(device_t dev)
     			goto qlnx_pci_attach_err;
     
     		ha->grcdump_size[i] = ha->grcdump_size[i] << 2;
    -		QL_DPRINT1(ha, (dev, "grcdump_size[%d] = 0x%08x\n",
    -			i, ha->grcdump_size[i]));
    +		QL_DPRINT1(ha, "grcdump_size[%d] = 0x%08x\n",
    +			i, ha->grcdump_size[i]);
     
     		ha->grcdump[i] = qlnx_zalloc(ha->grcdump_size[i]);
     		if (ha->grcdump[i] == NULL) {
    @@ -815,8 +812,8 @@ qlnx_pci_attach(device_t dev)
     			goto qlnx_pci_attach_err;
     
     		ha->idle_chk_size[i] = ha->idle_chk_size[i] << 2;
    -		QL_DPRINT1(ha, (dev, "idle_chk_size[%d] = 0x%08x\n",
    -			i, ha->idle_chk_size[i]));
    +		QL_DPRINT1(ha, "idle_chk_size[%d] = 0x%08x\n",
    +			i, ha->idle_chk_size[i]);
     
     		ha->idle_chk[i] = qlnx_zalloc(ha->idle_chk_size[i]);
     
    @@ -855,8 +852,8 @@ qlnx_pci_attach(device_t dev)
     		FW_MAJOR_VERSION, FW_MINOR_VERSION, FW_REVISION_VERSION,
     		FW_ENGINEERING_VERSION);
     
    -	QL_DPRINT1(ha, (dev, "%s: STORM_FW version %s MFW version %s\n",
    -		__func__, ha->stormfw_ver, ha->mfw_ver));
    +	QL_DPRINT1(ha, "STORM_FW version %s MFW version %s\n",
    +		 ha->stormfw_ver, ha->mfw_ver);
     
     	qlnx_init_ifnet(dev, ha);
     
    @@ -874,7 +871,7 @@ qlnx_pci_attach_err0:
                     goto qlnx_pci_attach_err;
             }
     
    -	QL_DPRINT2(ha, (dev, "%s: success\n", __func__));
    +	QL_DPRINT2(ha, "success\n");
     
             return (0);
     
    @@ -958,7 +955,7 @@ qlnx_release(qlnx_host_t *ha)
     
             dev = ha->pci_dev;
     
    -	QL_DPRINT2(ha, (dev, "%s: enter\n", __func__));
    +	QL_DPRINT2(ha, "enter\n");
     
     	for (i = 0; i < QLNX_MAX_HW_FUNCS; i++) {
     		if (ha->idle_chk[i] != NULL) {
    @@ -1041,7 +1038,7 @@ qlnx_release(qlnx_host_t *ha)
                     (void) bus_release_resource(dev, SYS_RES_MEMORY, ha->msix_rid,
                                     ha->msix_bar);
     
    -	QL_DPRINT2(ha, (dev, "%s: exit\n", __func__));
    +	QL_DPRINT2(ha, "exit\n");
     	return;
     }
     
    @@ -1053,14 +1050,14 @@ qlnx_trigger_dump(qlnx_host_t *ha)
     	if (ha->ifp != NULL)
     		ha->ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING);
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: start\n", __func__));
    +	QL_DPRINT2(ha, "enter\n");
     
     	for (i = 0; i < ha->cdev.num_hwfns; i++) {
     		qlnx_grc_dump(ha, &ha->grcdump_dwords[i], i);
     		qlnx_idle_chk(ha, &ha->idle_chk_dwords[i], i);
     	}
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: end\n", __func__));
    +	QL_DPRINT2(ha, "exit\n");
     
     	return;
     }
    @@ -1779,12 +1776,11 @@ qlnx_add_sysctls(qlnx_host_t *ha)
     		"\tpersonality = 6 => Default in Shared Memory\n");
     
             ha->dbg_level = 0;
    -
             SYSCTL_ADD_UINT(ctx, children,
                     OID_AUTO, "debug", CTLFLAG_RW,
                     &ha->dbg_level, ha->dbg_level, "Debug Level");
     
    -        ha->dp_level = 0;
    +        ha->dp_level = 0x01;
             SYSCTL_ADD_UINT(ctx, children,
                     OID_AUTO, "dp_level", CTLFLAG_RW,
                     &ha->dp_level, ha->dp_level, "DP Level");
    @@ -1999,7 +1995,7 @@ qlnx_init_ifnet(device_t dev, qlnx_host_
     
             ifmedia_set(&ha->media, (IFM_ETHER | IFM_AUTO));
     
    -        QL_DPRINT2(ha, (dev, "%s: exit\n", __func__));
    +        QL_DPRINT2(ha, "exit\n");
     
             return;
     }
    @@ -2009,6 +2005,8 @@ qlnx_init_locked(qlnx_host_t *ha)
     {
     	struct ifnet	*ifp = ha->ifp;
     
    +	QL_DPRINT1(ha, "Driver Initialization start \n");
    +
     	qlnx_stop(ha);
     
     	if (qlnx_load(ha) == 0) {
    @@ -2026,13 +2024,13 @@ qlnx_init(void *arg)
     
     	ha = (qlnx_host_t *)arg;
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__));
    +	QL_DPRINT2(ha, "enter\n");
     
     	QLNX_LOCK(ha);
     	qlnx_init_locked(ha);
     	QLNX_UNLOCK(ha);
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__));
    +	QL_DPRINT2(ha, "exit\n");
     
     	return;
     }
    @@ -2221,8 +2219,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     
     	switch (cmd) {
     	case SIOCSIFADDR:
    -		QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFADDR (0x%lx)\n",
    -			__func__, cmd));
    +		QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx)\n", cmd);
     
     		if (ifa->ifa_addr->sa_family == AF_INET) {
     			ifp->if_flags |= IFF_UP;
    @@ -2231,10 +2228,8 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     				qlnx_init_locked(ha);
     				QLNX_UNLOCK(ha);
     			}
    -			QL_DPRINT4(ha, (ha->pci_dev,
    -				"%s: SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n",
    -				__func__, cmd,
    -				ntohl(IA_SIN(ifa)->sin_addr.s_addr)));
    +			QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n",
    +				   cmd, ntohl(IA_SIN(ifa)->sin_addr.s_addr));
     
     			arp_ifinit(ifp, ifa);
     		} else {
    @@ -2243,8 +2238,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     		break;
     
     	case SIOCSIFMTU:
    -		QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFMTU (0x%lx)\n",
    -			__func__, cmd));
    +		QL_DPRINT4(ha, "SIOCSIFMTU (0x%lx)\n", cmd);
     
     		if (ifr->ifr_mtu > QLNX_MAX_MTU) {
     			ret = EINVAL;
    @@ -2263,8 +2257,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     		break;
     
     	case SIOCSIFFLAGS:
    -		QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFFLAGS (0x%lx)\n",
    -			__func__, cmd));
    +		QL_DPRINT4(ha, "SIOCSIFFLAGS (0x%lx)\n", cmd);
     
     		QLNX_LOCK(ha);
     
    @@ -2292,8 +2285,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     		break;
     
     	case SIOCADDMULTI:
    -		QL_DPRINT4(ha, (ha->pci_dev,
    -			"%s: %s (0x%lx)\n", __func__, "SIOCADDMULTI", cmd));
    +		QL_DPRINT4(ha, "%s (0x%lx)\n", "SIOCADDMULTI", cmd);
     
     		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
     			if (qlnx_set_multi(ha, 1))
    @@ -2302,8 +2294,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     		break;
     
     	case SIOCDELMULTI:
    -		QL_DPRINT4(ha, (ha->pci_dev,
    -			"%s: %s (0x%lx)\n", __func__, "SIOCDELMULTI", cmd));
    +		QL_DPRINT4(ha, "%s (0x%lx)\n", "SIOCDELMULTI", cmd);
     
     		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
     			if (qlnx_set_multi(ha, 0))
    @@ -2313,9 +2304,8 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     
     	case SIOCSIFMEDIA:
     	case SIOCGIFMEDIA:
    -		QL_DPRINT4(ha, (ha->pci_dev,
    -			"%s: SIOCSIFMEDIA/SIOCGIFMEDIA (0x%lx)\n",
    -			__func__, cmd));
    +		QL_DPRINT4(ha, "SIOCSIFMEDIA/SIOCGIFMEDIA (0x%lx)\n", cmd);
    +
     		ret = ifmedia_ioctl(ifp, ifr, &ha->media, cmd);
     		break;
     
    @@ -2323,8 +2313,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     		
     		mask = ifr->ifr_reqcap ^ ifp->if_capenable;
     
    -		QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFCAP (0x%lx)\n",
    -			__func__, cmd));
    +		QL_DPRINT4(ha, "SIOCSIFCAP (0x%lx)\n", cmd);
     
     		if (mask & IFCAP_HWCSUM)
     			ifp->if_capenable ^= IFCAP_HWCSUM;
    @@ -2367,8 +2356,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     		p_ptt = ecore_ptt_acquire(p_hwfn);
     
     		if (!p_ptt) {
    -			QL_DPRINT1(ha, (ha->pci_dev, "%s :"
    -				" ecore_ptt_acquire failed\n", __func__));
    +			QL_DPRINT1(ha, "ecore_ptt_acquire failed\n");
     			ret = -1;
     			break;
     		}
    @@ -2386,20 +2374,19 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd
     
     		ret = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
     
    -		QL_DPRINT8(ha, (ha->pci_dev, "SIOCGI2C copyout ret = %d"
    -			" len = %d addr = 0x%02x offset = 0x%04x"
    -			" data[0..7]=0x%02x 0x%02x 0x%02x 0x%02x 0x%02x"
    -			" 0x%02x 0x%02x 0x%02x\n",
    +		QL_DPRINT8(ha, "SIOCGI2C copyout ret = %d \
    +			 len = %d addr = 0x%02x offset = 0x%04x \
    +			 data[0..7]=0x%02x 0x%02x 0x%02x 0x%02x 0x%02x \
    +			 0x%02x 0x%02x 0x%02x\n",
     			ret, i2c.len, i2c.dev_addr, i2c.offset,
     			i2c.data[0], i2c.data[1], i2c.data[2], i2c.data[3],
    -			i2c.data[4], i2c.data[5], i2c.data[6], i2c.data[7]));
    +			i2c.data[4], i2c.data[5], i2c.data[6], i2c.data[7]);
     		break;
     	}
     #endif /* #if (__FreeBSD_version >= 1100101) */
     
     	default:
    -		QL_DPRINT4(ha, (ha->pci_dev, "%s: default (0x%lx)\n",
    -			__func__, cmd));
    +		QL_DPRINT4(ha, "default (0x%lx)\n", cmd);
     		ret = ether_ioctl(ifp, cmd, data);
     		break;
     	}
    @@ -2416,14 +2403,14 @@ qlnx_media_change(struct ifnet *ifp)
     
     	ha = (qlnx_host_t *)ifp->if_softc;
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__));
    +	QL_DPRINT2(ha, "enter\n");
     
     	ifm = &ha->media;
     
     	if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
     		ret = EINVAL;
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__));
    +	QL_DPRINT2(ha, "exit\n");
     
     	return (ret);
     }
    @@ -2435,7 +2422,7 @@ qlnx_media_status(struct ifnet *ifp, str
     
     	ha = (qlnx_host_t *)ifp->if_softc;
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__));
    +	QL_DPRINT2(ha, "enter\n");
     
     	ifmr->ifm_status = IFM_AVALID;
     	ifmr->ifm_active = IFM_ETHER;
    @@ -2451,8 +2438,7 @@ qlnx_media_status(struct ifnet *ifp, str
     				(IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE);
     	}
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: exit (%s)\n", __func__,
    -		(ha->link_up ? "link_up" : "link_down")));
    +	QL_DPRINT2(ha, "exit (%s)\n", (ha->link_up ? "link_up" : "link_down"));
     
     	return;
     }
    @@ -2478,20 +2464,19 @@ qlnx_free_tx_pkt(qlnx_host_t *ha, struct
     
     		QL_RESET_ERR_INJECT(ha, QL_ERR_INJCT_TX_INT_MBUF_NULL);
     
    -		QL_DPRINT1(ha, (ha->pci_dev, "%s: (mp == NULL) "
    +		QL_DPRINT1(ha, "(mp == NULL) "
     			" tx_idx = 0x%x"
     			" ecore_prod_idx = 0x%x"
     			" ecore_cons_idx = 0x%x"
     			" hw_bd_cons = 0x%x"
     			" txq_db_last = 0x%x"
     			" elem_left = 0x%x\n",
    -			__func__,
     			fp->rss_id,
     			ecore_chain_get_prod_idx(&txq->tx_pbl),
     			ecore_chain_get_cons_idx(&txq->tx_pbl),
     			le16toh(*txq->hw_cons_ptr),
     			txq->tx_db.raw,
    -			ecore_chain_get_elem_left(&txq->tx_pbl)));
    +			ecore_chain_get_elem_left(&txq->tx_pbl));
     
     		fp->err_tx_free_pkt_null++;
     
    @@ -2552,20 +2537,20 @@ qlnx_tx_int(qlnx_host_t *ha, struct qlnx
     
     			QL_RESET_ERR_INJECT(ha, QL_ERR_INJCT_TX_INT_DIFF);
     
    -			QL_DPRINT1(ha, (ha->pci_dev, "%s: (diff = 0x%x) "
    +			QL_DPRINT1(ha, "(diff = 0x%x) "
     				" tx_idx = 0x%x"
     				" ecore_prod_idx = 0x%x"
     				" ecore_cons_idx = 0x%x"
     				" hw_bd_cons = 0x%x"
     				" txq_db_last = 0x%x"
     				" elem_left = 0x%x\n",
    -				__func__, diff,
    +				diff,
     				fp->rss_id,
     				ecore_chain_get_prod_idx(&txq->tx_pbl),
     				ecore_chain_get_cons_idx(&txq->tx_pbl),
     				le16toh(*txq->hw_cons_ptr),
     				txq->tx_db.raw,
    -				ecore_chain_get_elem_left(&txq->tx_pbl)));
    +				ecore_chain_get_elem_left(&txq->tx_pbl));
     
     			fp->err_tx_cons_idx_conflict++;
     
    @@ -2587,7 +2572,7 @@ qlnx_transmit(struct ifnet *ifp, struct 
             struct qlnx_fastpath	*fp;
             int			rss_id = 0, ret = 0;
     
    -        QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__));
    +        QL_DPRINT2(ha, "enter\n");
     
     #if __FreeBSD_version >= 1100000
             if (M_HASHTYPE_GET(mp) != M_HASHTYPE_NONE)
    @@ -2615,7 +2600,7 @@ qlnx_transmit(struct ifnet *ifp, struct 
     
     qlnx_transmit_exit:
     
    -        QL_DPRINT2(ha, (ha->pci_dev, "%s: exit ret = %d\n", __func__, ret));
    +        QL_DPRINT2(ha, "exit ret = %d\n", ret);
             return ret;
     }
     
    @@ -2629,7 +2614,7 @@ qlnx_qflush(struct ifnet *ifp)
     
     	ha = (qlnx_host_t *)ifp->if_softc;
     
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__));
    +	QL_DPRINT2(ha, "enter\n");
     
     	for (rss_id = 0; rss_id < ha->num_rss; rss_id++) {
     
    @@ -2648,7 +2633,7 @@ qlnx_qflush(struct ifnet *ifp)
     			mtx_unlock(&fp->tx_mtx);
     		}
     	}
    -	QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__));
    +	QL_DPRINT2(ha, "exit\n");
     
     	return;
     }
    @@ -2792,7 +2777,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     	uint32_t		nbds_in_hdr = 0;
     	uint32_t		offset = 0;
     
    -	QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__));
    +	QL_DPRINT8(ha, "enter\n");
     
     	if (!ha->link_up)
     		return (-1);
    @@ -2844,8 +2829,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     
     		struct mbuf *m;
     
    -		QL_DPRINT8(ha, (ha->pci_dev, "%s: EFBIG [%d]\n", __func__,
    -			m_head->m_pkthdr.len));
    +		QL_DPRINT8(ha, "EFBIG [%d]\n", m_head->m_pkthdr.len);
     
     		fp->tx_defrag++;
     
    @@ -2855,9 +2839,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     			fp->tx_pkts_freed++;
     			m_freem(m_head);
     			*m_headp = NULL;
    -			QL_DPRINT1(ha, (ha->pci_dev,
    -				"%s: m_defrag() = NULL [%d]\n",
    -				__func__, ret));
    +			QL_DPRINT1(ha, "m_defrag() = NULL [%d]\n", ret);
     			return (ENOBUFS);
     		}
     
    @@ -2869,9 +2851,9 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     
     			fp->err_tx_defrag_dmamap_load++;
     
    -			QL_DPRINT1(ha, (ha->pci_dev,
    -				"%s: bus_dmamap_load_mbuf_sg failed0[%d, %d]\n",
    -				__func__, ret, m_head->m_pkthdr.len));
    +			QL_DPRINT1(ha,
    +				"bus_dmamap_load_mbuf_sg failed0 [%d, %d]\n",
    +				ret, m_head->m_pkthdr.len);
     
     			fp->tx_pkts_freed++;
     			m_freem(m_head);
    @@ -2885,9 +2867,9 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     
     			fp->err_tx_non_tso_max_seg++;
     
    -			QL_DPRINT1(ha, (ha->pci_dev,
    -				"%s: (%d) nsegs too many for non-TSO[%d, %d]\n",
    -				__func__, ret, nsegs, m_head->m_pkthdr.len));
    +			QL_DPRINT1(ha,
    +				"(%d) nsegs too many for non-TSO [%d, %d]\n",
    +				ret, nsegs, m_head->m_pkthdr.len);
     
     			fp->tx_pkts_freed++;
     			m_freem(m_head);
    @@ -2902,10 +2884,8 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     
     		fp->err_tx_dmamap_load++;
     
    -		QL_DPRINT1(ha, (ha->pci_dev,
    -			"%s: bus_dmamap_load_mbuf_sg failed1[%d, %d]\n",
    -			__func__, ret, m_head->m_pkthdr.len));
    -
    +		QL_DPRINT1(ha, "bus_dmamap_load_mbuf_sg failed1 [%d, %d]\n",
    +			   ret, m_head->m_pkthdr.len);
     		fp->tx_pkts_freed++;
     		m_freem(m_head);
     		*m_headp = NULL;
    @@ -2924,9 +2904,9 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     	if ((nsegs + QLNX_TX_ELEM_RESERVE) >
     		(int)(elem_left = ecore_chain_get_elem_left(&txq->tx_pbl))) {
     
    -		QL_DPRINT1(ha, (ha->pci_dev, "%s: (%d, 0x%x) insuffient BDs"
    -			"in chain[%d] trying to free packets\n",
    -			__func__, nsegs, elem_left, fp->rss_id));
    +		QL_DPRINT1(ha, "(%d, 0x%x) insuffient BDs"
    +			" in chain[%d] trying to free packets\n",
    +			nsegs, elem_left, fp->rss_id);
     
     		fp->tx_nsegs_gt_elem_left++;
     
    @@ -2935,9 +2915,9 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     		if ((nsegs + QLNX_TX_ELEM_RESERVE) > (int)(elem_left =
     			ecore_chain_get_elem_left(&txq->tx_pbl))) {
     
    -			QL_DPRINT1(ha, (ha->pci_dev,
    -				"%s: (%d, 0x%x) insuffient BDs in chain[%d]\n",
    -				__func__, nsegs, elem_left, fp->rss_id));
    +			QL_DPRINT1(ha,
    +				"(%d, 0x%x) insuffient BDs in chain[%d]\n",
    +				nsegs, elem_left, fp->rss_id);
     
     			fp->err_tx_nsegs_gt_elem_left++;
     			fp->tx_ring_full = 1;
    @@ -3165,7 +3145,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f
     
     	qlnx_txq_doorbell_wr32(ha, txq->doorbell_addr, txq->tx_db.raw);
        
    -	QL_DPRINT8(ha, (ha->pci_dev, "%s: exit\n", __func__));
    +	QL_DPRINT8(ha, "exit\n");
     	return (0);
     }
     
    @@ -3185,6 +3165,8 @@ qlnx_stop(qlnx_host_t *ha)
     	 * propagate the if_drv_flags
     	 * state to each tx thread
     	 */
    +        QL_DPRINT1(ha, "QLNX STATE = %d\n",ha->state);
    +
     	if (ha->state == QLNX_STATE_OPEN) {
             	for (i = 0; i < ha->num_rss; i++) {
     			struct qlnx_fastpath *fp = &ha->fp_array[i];
    @@ -3277,8 +3259,7 @@ qlnx_rx_jumbo_chain(qlnx_host_t *ha, str
                     mp = sw_rx_data->data;
     
     		if (mp == NULL) {
    -                	QL_DPRINT1(ha, (ha->pci_dev, "%s: mp = NULL\n",
    -				__func__));
    +                	QL_DPRINT1(ha, "mp = NULL\n");
     			fp->err_rx_mp_null++;
             		rxq->sw_rx_cons  =
     				(rxq->sw_rx_cons + 1) & (RX_RING_SIZE - 1);
    @@ -3293,10 +3274,8 @@ qlnx_rx_jumbo_chain(qlnx_host_t *ha, str
     
                     if (qlnx_alloc_rx_buffer(ha, rxq) != 0) {
     
    -                        QL_DPRINT1(ha, (ha->pci_dev,
    -				"%s: New buffer allocation failed, dropping"
    -				" incoming packet and reusing its buffer\n",
    -				__func__));
    +                        QL_DPRINT1(ha, "New buffer allocation failed, dropping"
    +				" incoming packet and reusing its buffer\n");
     
                             qlnx_reuse_rx_data(rxq);
                             fp->err_rx_alloc_errors++;
    @@ -3356,29 +3335,29 @@ qlnx_tpa_start(qlnx_host_t *ha,
     	dev = ha->pci_dev;
     	agg_index = cqe->tpa_agg_index;
     
    -        QL_DPRINT7(ha, (dev, "%s[%d]: enter\n "
    -                "\t type = 0x%x\n"
    -                "\t bitfields = 0x%x\n"
    -                "\t seg_len = 0x%x\n"
    -                "\t pars_flags = 0x%x\n"
    -                "\t vlan_tag = 0x%x\n"
    -                "\t rss_hash = 0x%x\n"
    -                "\t len_on_first_bd = 0x%x\n"
    -                "\t placement_offset = 0x%x\n"
    -                "\t tpa_agg_index = 0x%x\n"
    -                "\t header_len = 0x%x\n"
    -                "\t ext_bd_len_list[0] = 0x%x\n"
    -                "\t ext_bd_len_list[1] = 0x%x\n"
    -                "\t ext_bd_len_list[2] = 0x%x\n"
    -                "\t ext_bd_len_list[3] = 0x%x\n"
    -                "\t ext_bd_len_list[4] = 0x%x\n",
    -                __func__, fp->rss_id, cqe->type, cqe->bitfields, cqe->seg_len,
    +        QL_DPRINT7(ha, "[rss_id = %d]: enter\n \
    +                \t type = 0x%x\n \
    +                \t bitfields = 0x%x\n \
    +                \t seg_len = 0x%x\n \
    +                \t pars_flags = 0x%x\n \
    +                \t vlan_tag = 0x%x\n \
    +                \t rss_hash = 0x%x\n \
    +                \t len_on_first_bd = 0x%x\n \
    +                \t placement_offset = 0x%x\n \
    +                \t tpa_agg_index = 0x%x\n \
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-head@freebsd.org  Tue May 16 21:54:52 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFEEED70AF3;
     Tue, 16 May 2017 21:54:52 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8B3ADD35;
     Tue, 16 May 2017 21:54:52 +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 v4GLspSX050919;
     Tue, 16 May 2017 21:54:51 GMT (envelope-from jilles@FreeBSD.org)
    Received: (from jilles@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GLspGF050916;
     Tue, 16 May 2017 21:54:51 GMT (envelope-from jilles@FreeBSD.org)
    Message-Id: <201705162154.v4GLspGF050916@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jilles set sender to
     jilles@FreeBSD.org using -f
    From: Jilles Tjoelker 
    Date: Tue, 16 May 2017 21:54:51 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318385 - head/bin/sh
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 21:54:52 -0000
    
    Author: jilles
    Date: Tue May 16 21:54:51 2017
    New Revision: 318385
    URL: https://svnweb.freebsd.org/changeset/base/318385
    
    Log:
      sh: Simplify output buffering.
      
      Similarly to how STPUTC was changed, change struct output to store the
      pointer just past the end of the available space instead of the size of the
      available space, so after writing a character it is only necessary to
      increment a pointer and not to decrement a counter.
    
    Modified:
      head/bin/sh/eval.c
      head/bin/sh/output.c
      head/bin/sh/output.h
    
    Modified: head/bin/sh/eval.c
    ==============================================================================
    --- head/bin/sh/eval.c	Tue May 16 21:50:29 2017	(r318384)
    +++ head/bin/sh/eval.c	Tue May 16 21:54:51 2017	(r318385)
    @@ -1080,8 +1080,8 @@ evalcommand(union node *cmd, int flags, 
     #endif
     		mode = (cmdentry.u.index == EXECCMD)? 0 : REDIR_PUSH;
     		if (flags == EV_BACKCMD) {
    -			memout.nleft = 0;
     			memout.nextc = memout.buf;
    +			memout.bufend = memout.buf;
     			memout.bufsize = 64;
     			mode |= REDIR_BACKQ;
     		}
    @@ -1134,8 +1134,11 @@ cmddone:
     			exitshell(exitstatus);
     		if (flags == EV_BACKCMD) {
     			backcmd->buf = memout.buf;
    -			backcmd->nleft = memout.nextc - memout.buf;
    +			backcmd->nleft = memout.buf != NULL ?
    +			    memout.nextc - memout.buf : 0;
     			memout.buf = NULL;
    +			memout.nextc = NULL;
    +			memout.bufend = NULL;
     		}
     		if (cmdentry.u.index != EXECCMD)
     			popredir();
    
    Modified: head/bin/sh/output.c
    ==============================================================================
    --- head/bin/sh/output.c	Tue May 16 21:50:29 2017	(r318384)
    +++ head/bin/sh/output.c	Tue May 16 21:54:51 2017	(r318385)
    @@ -71,9 +71,9 @@ __FBSDID("$FreeBSD$");
     
     static int doformat_wr(void *, const char *, int);
     
    -struct output output = {NULL, 0, NULL, OUTBUFSIZ, 1, 0};
    -struct output errout = {NULL, 0, NULL, 256, 2, 0};
    -struct output memout = {NULL, 0, NULL, 0, MEM_OUT, 0};
    +struct output output = {NULL, NULL, NULL, OUTBUFSIZ, 1, 0};
    +struct output errout = {NULL, NULL, NULL, 256, 2, 0};
    +struct output memout = {NULL, NULL, NULL, 0, MEM_OUT, 0};
     struct output *out1 = &output;
     struct output *out2 = &errout;
     
    @@ -214,20 +214,19 @@ emptyoutbuf(struct output *dest)
     		INTOFF;
     		dest->buf = ckmalloc(dest->bufsize);
     		dest->nextc = dest->buf;
    -		dest->nleft = dest->bufsize;
    +		dest->bufend = dest->buf + dest->bufsize;
     		INTON;
     	} else if (dest->fd == MEM_OUT) {
    -		offset = dest->bufsize;
    +		offset = dest->nextc - dest->buf;
     		INTOFF;
     		dest->bufsize <<= 1;
     		dest->buf = ckrealloc(dest->buf, dest->bufsize);
    -		dest->nleft = dest->bufsize - offset;
    +		dest->bufend = dest->buf + dest->bufsize;
     		dest->nextc = dest->buf + offset;
     		INTON;
     	} else {
     		flushout(dest);
     	}
    -	dest->nleft--;
     }
     
     
    @@ -248,7 +247,6 @@ flushout(struct output *dest)
     	if (xwrite(dest->fd, dest->buf, dest->nextc - dest->buf) < 0)
     		dest->flags |= OUTPUT_ERR;
     	dest->nextc = dest->buf;
    -	dest->nleft = dest->bufsize;
     }
     
     
    @@ -258,8 +256,9 @@ freestdout(void)
     	INTOFF;
     	if (output.buf) {
     		ckfree(output.buf);
    +		output.nextc = NULL;
     		output.buf = NULL;
    -		output.nleft = 0;
    +		output.bufend = NULL;
     	}
     	INTON;
     }
    
    Modified: head/bin/sh/output.h
    ==============================================================================
    --- head/bin/sh/output.h	Tue May 16 21:50:29 2017	(r318384)
    +++ head/bin/sh/output.h	Tue May 16 21:54:51 2017	(r318385)
    @@ -40,7 +40,7 @@
     
     struct output {
     	char *nextc;
    -	int nleft;
    +	char *bufend;
     	char *buf;
     	int bufsize;
     	short fd;
    @@ -75,7 +75,7 @@ void fmtstr(char *, int, const char *, .
     void doformat(struct output *, const char *, va_list) __printflike(2, 0);
     int xwrite(int, const char *, int);
     
    -#define outc(c, file)	(--(file)->nleft < 0? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c)))
    +#define outc(c, file)	((file)->nextc == (file)->bufend ? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c)))
     #define out1c(c)	outc(c, out1);
     #define out2c(c)	outcslow(c, out2);
     
    
    From owner-svn-src-head@freebsd.org  Tue May 16 23:15:41 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA40AD70300;
     Tue, 16 May 2017 23:15:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 8D0B31A02;
     Tue, 16 May 2017 23:15:41 +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 v4GNFe0s083437;
     Tue, 16 May 2017 23:15:40 GMT (envelope-from jhb@FreeBSD.org)
    Received: (from jhb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GNFehn083436;
     Tue, 16 May 2017 23:15:40 GMT (envelope-from jhb@FreeBSD.org)
    Message-Id: <201705162315.v4GNFehn083436@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
     using -f
    From: John Baldwin 
    Date: Tue, 16 May 2017 23:15:40 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318386 - head/share/man/man7
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 23:15:41 -0000
    
    Author: jhb
    Date: Tue May 16 23:15:40 2017
    New Revision: 318386
    URL: https://svnweb.freebsd.org/changeset/base/318386
    
    Log:
      Note that the first release of FreeBSD/alpha was 3.2.
      
      Alpha is explicitly mentioned in the release announcements beginning with
      3.2.
    
    Modified:
      head/share/man/man7/arch.7
    
    Modified: head/share/man/man7/arch.7
    ==============================================================================
    --- head/share/man/man7/arch.7	Tue May 16 21:54:51 2017	(r318385)
    +++ head/share/man/man7/arch.7	Tue May 16 23:15:40 2017	(r318386)
    @@ -26,7 +26,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd May 5, 2017
    +.Dd May 16, 2017
     .Dt ARCH 7
     .Os
     .Sh NAME
    @@ -90,7 +90,7 @@ architectures, the final release.
     .Pp
     .Bl -column -offset indent "Sy Architecture" "Sy Initial Release" "Sy Final Release"
     .It Sy Architecture Ta Sy Initial Release Ta Sy Final Release
    -.It alpha       Ta 3.x   Ta 6.4
    +.It alpha       Ta 3.2   Ta 6.4
     .It amd64       Ta 5.1
     .It arm         Ta 6.0
     .It armeb       Ta 8.0
    
    From owner-svn-src-head@freebsd.org  Tue May 16 23:18:52 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F4C1D70393;
     Tue, 16 May 2017 23:18:52 +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 mx1.freebsd.org (Postfix) with ESMTPS id F3D471B98;
     Tue, 16 May 2017 23:18:51 +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 v4GNIpV5083573;
     Tue, 16 May 2017 23:18:51 GMT (envelope-from jhb@FreeBSD.org)
    Received: (from jhb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GNIpeq083572;
     Tue, 16 May 2017 23:18:51 GMT (envelope-from jhb@FreeBSD.org)
    Message-Id: <201705162318.v4GNIpeq083572@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
     using -f
    From: John Baldwin 
    Date: Tue, 16 May 2017 23:18:50 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318387 - head/sys/dev/cxgbe
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 23:18:52 -0000
    
    Author: jhb
    Date: Tue May 16 23:18:50 2017
    New Revision: 318387
    URL: https://svnweb.freebsd.org/changeset/base/318387
    
    Log:
      Add support for child devices that aren't ports.
      
      Invoke any identify routines of child drivers during attach before attaching
      children, and delete any remaining devices after deleting ports.
      
      MFC after:	1 month
      Sponsored by:	Chelsio Communications
    
    Modified:
      head/sys/dev/cxgbe/t4_main.c
    
    Modified: head/sys/dev/cxgbe/t4_main.c
    ==============================================================================
    --- head/sys/dev/cxgbe/t4_main.c	Tue May 16 23:15:40 2017	(r318386)
    +++ head/sys/dev/cxgbe/t4_main.c	Tue May 16 23:18:50 2017	(r318387)
    @@ -1186,6 +1186,12 @@ t4_attach(device_t dev)
     		goto done;
     	}
     
    +	rc = bus_generic_probe(dev);
    +	if (rc != 0) {
    +		device_printf(dev, "failed to probe child drivers: %d\n", rc);
    +		goto done;
    +	}
    +
     	rc = bus_generic_attach(dev);
     	if (rc != 0) {
     		device_printf(dev,
    @@ -1339,6 +1345,8 @@ t4_detach_common(device_t dev)
     		}
     	}
     
    +	device_delete_children(dev);
    +
     	if (sc->flags & FULL_INIT_DONE)
     		adapter_full_uninit(sc);
     
    
    From owner-svn-src-head@freebsd.org  Tue May 16 23:31:53 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF67ED707D5;
     Tue, 16 May 2017 23:31:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 8270734F;
     Tue, 16 May 2017 23:31:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GNVqke090501;
     Tue, 16 May 2017 23:31:52 GMT (envelope-from jhb@FreeBSD.org)
    Received: (from jhb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GNVqRj090497;
     Tue, 16 May 2017 23:31:52 GMT (envelope-from jhb@FreeBSD.org)
    Message-Id: <201705162331.v4GNVqRj090497@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
     using -f
    From: John Baldwin 
    Date: Tue, 16 May 2017 23:31:52 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318388 - in head: share/man/man9 sys/kern sys/sys
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 16 May 2017 23:31:53 -0000
    
    Author: jhb
    Date: Tue May 16 23:31:52 2017
    New Revision: 318388
    URL: https://svnweb.freebsd.org/changeset/base/318388
    
    Log:
      Add sglist_append_sglist().
      
      This function permits a range of one scatter/gather list to be appended to
      another sglist.  This can be used to construct a scatter/gather list that
      reorders or duplicates ranges from one or more existing scatter/gather
      lists.
      
      Sponsored by:	Chelsio Communications
    
    Modified:
      head/share/man/man9/Makefile
      head/share/man/man9/sglist.9
      head/sys/kern/subr_sglist.c
      head/sys/sys/sglist.h
    
    Modified: head/share/man/man9/Makefile
    ==============================================================================
    --- head/share/man/man9/Makefile	Tue May 16 23:18:50 2017	(r318387)
    +++ head/share/man/man9/Makefile	Tue May 16 23:31:52 2017	(r318388)
    @@ -1572,6 +1572,7 @@ MLINKS+=sglist.9 sglist_alloc.9 \
     	sglist.9 sglist_append_bio.9 \
     	sglist.9 sglist_append_mbuf.9 \
     	sglist.9 sglist_append_phys.9 \
    +	sglist.9 sglist_append_sglist.9 \
     	sglist.9 sglist_append_uio.9 \
     	sglist.9 sglist_append_user.9 \
     	sglist.9 sglist_append_vmpages.9 \
    
    Modified: head/share/man/man9/sglist.9
    ==============================================================================
    --- head/share/man/man9/sglist.9	Tue May 16 23:18:50 2017	(r318387)
    +++ head/share/man/man9/sglist.9	Tue May 16 23:31:52 2017	(r318388)
    @@ -26,7 +26,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd January 12, 2014
    +.Dd May 16, 2017
     .Dt SGLIST 9
     .Os
     .Sh NAME
    @@ -36,6 +36,7 @@
     .Nm sglist_append_bio ,
     .Nm sglist_append_mbuf ,
     .Nm sglist_append_phys ,
    +.Nm sglist_append_sglist ,
     .Nm sglist_append_uio ,
     .Nm sglist_append_user ,
     .Nm sglist_append_vmpages ,
    @@ -67,6 +68,8 @@
     .Ft int
     .Fn sglist_append_phys "struct sglist *sg" "vm_paddr_t paddr" "size_t len"
     .Ft int
    +.Fn sglist_append_sglist "struct sglist *sg" "struct sglist *source" "size_t offset" "size_t len"
    +.Ft int
     .Fn sglist_append_uio "struct sglist *sg" "struct uio *uio"
     .Ft int
     .Fn sglist_append_user "struct sglist *sg" "void *buf" "size_t len" "struct thread *td"
    @@ -252,6 +255,20 @@ and is
     bytes long.
     .Pp
     The
    +.Nm sglist_append_sglist
    +function appends physical address ranges described by the scatter/gather list
    +.Fa source
    +to the scatter/gather list
    +.Fa sg .
    +The physical address ranges start at offset
    +.Fa offset
    +within
    +.Fa source
    +and continue for
    +.Fa len
    +bytes.
    +.Pp
    +The
     .Nm sglist_append_uio
     function appends the physical address ranges described by a
     .Xr uio 9
    
    Modified: head/sys/kern/subr_sglist.c
    ==============================================================================
    --- head/sys/kern/subr_sglist.c	Tue May 16 23:18:50 2017	(r318387)
    +++ head/sys/kern/subr_sglist.c	Tue May 16 23:31:52 2017	(r318388)
    @@ -413,6 +413,49 @@ sglist_append_user(struct sglist *sg, vo
     }
     
     /*
    + * Append a subset of an existing scatter/gather list 'source' to a
    + * the scatter/gather list 'sg'.  If there are insufficient segments,
    + * then this fails with EFBIG.
    + */
    +int
    +sglist_append_sglist(struct sglist *sg, struct sglist *source, size_t offset,
    +    size_t length)
    +{
    +	struct sgsave save;
    +	struct sglist_seg *ss;
    +	size_t seglen;
    +	int error, i;
    +
    +	if (sg->sg_maxseg == 0 || length == 0)
    +		return (EINVAL);
    +	SGLIST_SAVE(sg, save);
    +	error = EINVAL;
    +	ss = &sg->sg_segs[sg->sg_nseg - 1];
    +	for (i = 0; i < source->sg_nseg; i++) {
    +		if (offset >= source->sg_segs[i].ss_len) {
    +			offset -= source->sg_segs[i].ss_len;
    +			continue;
    +		}
    +		seglen = source->sg_segs[i].ss_len - offset;
    +		if (seglen > length)
    +			seglen = length;
    +		error = _sglist_append_range(sg, &ss,
    +		    source->sg_segs[i].ss_paddr + offset, seglen);
    +		if (error)
    +			break;
    +		offset = 0;
    +		length -= seglen;
    +		if (length == 0)
    +			break;
    +	}
    +	if (length != 0)
    +		error = EINVAL;
    +	if (error)
    +		SGLIST_RESTORE(sg, save);
    +	return (error);
    +}
    +
    +/*
      * Append the segments that describe a single uio to a scatter/gather
      * list.  If there are insufficient segments, then this fails with
      * EFBIG.
    
    Modified: head/sys/sys/sglist.h
    ==============================================================================
    --- head/sys/sys/sglist.h	Tue May 16 23:18:50 2017	(r318387)
    +++ head/sys/sys/sglist.h	Tue May 16 23:31:52 2017	(r318388)
    @@ -88,6 +88,8 @@ int	sglist_append_bio(struct sglist *sg,
     int	sglist_append_mbuf(struct sglist *sg, struct mbuf *m0);
     int	sglist_append_phys(struct sglist *sg, vm_paddr_t paddr,
     	    size_t len);
    +int	sglist_append_sglist(struct sglist *sg, struct sglist *source,
    +	    size_t offset, size_t length);
     int	sglist_append_uio(struct sglist *sg, struct uio *uio);
     int	sglist_append_user(struct sglist *sg, void *buf, size_t len,
     	    struct thread *td);
    
    From owner-svn-src-head@freebsd.org  Wed May 17 00:18:43 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECE8BD6D30F;
     Wed, 17 May 2017 00:18:43 +0000 (UTC)
     (envelope-from yaneurabeya@gmail.com)
    Received: from mail-pg0-x236.google.com (mail-pg0-x236.google.com
     [IPv6:2607:f8b0:400e:c05::236])
     (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 B914C16FB;
     Wed, 17 May 2017 00:18:43 +0000 (UTC)
     (envelope-from yaneurabeya@gmail.com)
    Received: by mail-pg0-x236.google.com with SMTP id u28so83902992pgn.1;
     Tue, 16 May 2017 17:18:43 -0700 (PDT)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
     h=subject:mime-version:from:in-reply-to:date:cc:message-id:references
     :to; bh=qwaUPid/suTagBeQcLlC8wiQSKvQPfxxj+wvXROAMKo=;
     b=hRukyZHrCNQECbOLkc00qC2WLYj02Nihmm9rY2xBxOQ0iCMAymAnzWiFbEkXyQA571
     jFuUadQACV9+NHsV78Kwg3k6XqGl7N9XCHoVHfyuSdRUk4WfqJmmBWmG1fTHq0fAzSvQ
     Dh1fkzmWhyErNUE6Gu+1dNGkNEki5tnb+U+5aTFwLKJth1Z0KpkjNteS8v/lYKVld4de
     N5JwYDJTvaPsNniST8y6jwah9CaOoCA/iybV2+n+PEEGBSemKePGQukmEP4mIgANouZE
     pQQGEXfD2JS+Z3Gtw6mB1Fr9Rg7c9M77rmqIpjyD35LpY+5NyyMX13xTom6YrD76Ej8Z
     M2Ag==
    X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
     d=1e100.net; s=20161025;
     h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc
     :message-id:references:to;
     bh=qwaUPid/suTagBeQcLlC8wiQSKvQPfxxj+wvXROAMKo=;
     b=ua9CDXSdMAwMkUyWcBwSArYy2MI0OHdnx+vBbKJaU3iX02DeYg78QbYqNFvbPdIU6g
     MzrGLorFLJilY8lx3NMfbnc81mpieh2QYxW0lbN/3AOhRl5+/4zFswuIJYuLxe96bcsQ
     8TivvSwV1MOzropu2bGF9+8D/PrknvD0Xe6Si7apYKWnhrOaq8nCE1in4lvKdlhQ+UA2
     xbwOVBLjBwJLwjA0SFT0lD16ejlFm/7FPpdA29aIIDiqAngTJbC6Ok7jqIFQ4yoevV9o
     SOXk0XtJkJNRS9m3zexUoWzY1aSeXtL+SzAhCtyQlWn24GH+Fw1xts4vmJIXVLxcJUyE
     LUAg==
    X-Gm-Message-State: AODbwcCxlJTaCPMGEdFyUfFPQp91BcQtXIXQquKvYhKmae2eJiv+PmKp
     0nKupT9GojrPsA0UpJA=
    X-Received: by 10.99.1.85 with SMTP id 82mr734669pgb.164.1494980323134;
     Tue, 16 May 2017 17:18:43 -0700 (PDT)
    Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net.
     [73.19.52.228])
     by smtp.gmail.com with ESMTPSA id w30sm311140pge.45.2017.05.16.17.18.41
     (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
     Tue, 16 May 2017 17:18:42 -0700 (PDT)
    Subject: Re: svn commit: r318364 - in head: contrib/libxo contrib/libxo/doc
     contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved
     contrib/libxo/tests/gettext/saved contrib/libxo/xo lib/lib...
    Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
    Content-Type: multipart/signed;
     boundary="Apple-Mail=_D9DA0645-2E96-4BCD-B1FE-AE6360BAA2E6";
     protocol="application/pgp-signature"; micalg=pgp-sha512
    X-Pgp-Agent: GPGMail
    From: "Ngie Cooper (yaneurabeya)" 
    In-Reply-To: <201705161846.v4GIkuTS071275@repo.freebsd.org>
    Date: Tue, 16 May 2017 17:18:40 -0700
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Message-Id: 
    References: <201705161846.v4GIkuTS071275@repo.freebsd.org>
    To: Phil Shafer 
    X-Mailer: Apple Mail (2.3124)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 17 May 2017 00:18:44 -0000
    
    
    --Apple-Mail=_D9DA0645-2E96-4BCD-B1FE-AE6360BAA2E6
    Content-Transfer-Encoding: 7bit
    Content-Type: text/plain;
    	charset=us-ascii
    
    
    > On May 16, 2017, at 11:46, Phil Shafer  wrote:
    > 
    > Author: phil
    > Date: Tue May 16 18:46:56 2017
    > New Revision: 318364
    > URL: https://svnweb.freebsd.org/changeset/base/318364
    > 
    > Log:
    >  Import libxo-0.7.2; add xo_options.7.
    > 
    >  Submitted by:	phil
    >  Reviewed by:	sjg
    >  Approved by:	sjg (mentor)
    
    Relnotes: yes
    
    Also, what does this upgrade entail, in terms of new features/risk?
    
    Thanks,
    -Ngie
    
    --Apple-Mail=_D9DA0645-2E96-4BCD-B1FE-AE6360BAA2E6
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment;
    	filename=signature.asc
    Content-Type: application/pgp-signature;
    	name=signature.asc
    Content-Description: Message signed with OpenPGP using GPGMail
    
    -----BEGIN PGP SIGNATURE-----
    Comment: GPGTools - https://gpgtools.org
    
    iQIcBAEBCgAGBQJZG5bgAAoJEPWDqSZpMIYVbHMP/ioSQzCX1rr80SSmcntluq4W
    +jGDy2QVifToVo0yhYCN9N/k5B/FfM6zvKUtg907QeaSU1VecVNm8GfZr8C3zfgy
    dcEP310LiIM+ctjgaOLgwsEjjmr20NaFHfD4Eam/uYjWkohNH0DXX5qcelvmd+/s
    0A+J9LaU6BlOiVvHSITFiSLL1EkTz74xuFEmx1j7OURJQ+KhFWhaOS6tNb3f+wKT
    ss/ICjX4jbL7551gHL0EjcEkssoV58xOZTrE0ywBzUypV3D+NK2FOcGhJMwNSsx4
    V5pCvXvoQnn8BKPY5J7/4ivzsawhmz2o/Hi/JCb8aCipSx2DyyOB3GK6c8RZZCdU
    5GD1OxCBmxZGQ2FThjrkBIFCvC5j2vpf88hoeZdRUxrB2Aq43Aq8dWC8AWcRIAOr
    3vdS6xit7UBThUvJNGt7GQwiCIP2sAR+HwjZiK442MSmLj86J6RA/fYYd7L5D+c7
    tX2WYibsULUw/eCsUexZcxXGKXngqgPgv95bOQilaNdQX/ZgNqfFdTkvYvdnVcTi
    mE49RXc+t1eDxZtocV4VPXRJreYJ71pjndMzu7VubDfFsbv2ufhqwPBCGOFFlkAm
    LHiAlV/nGQDwbPYTQCA1996oMX9TUgPkOerDx6Xs3LiU9EdcaZfv6j2CTr4dYUFm
    OH3thGx4+NP9CNZX96QK
    =0CNf
    -----END PGP SIGNATURE-----
    
    --Apple-Mail=_D9DA0645-2E96-4BCD-B1FE-AE6360BAA2E6--
    
    From owner-svn-src-head@freebsd.org  Wed May 17 00:34:39 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9792DD6DB85;
     Wed, 17 May 2017 00:34:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 34037361;
     Wed, 17 May 2017 00:34:39 +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 v4H0YcWh015848;
     Wed, 17 May 2017 00:34:38 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4H0YY0k015810;
     Wed, 17 May 2017 00:34:34 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705170034.v4H0YY0k015810@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Wed, 17 May 2017 00:34:34 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318389 - in head/sys: amd64/amd64 arm/arm arm/include
     crypto/des ddb dev/cs dev/ixgb dev/lge dev/mse dev/my dev/pcn dev/ppbus
     dev/ppc dev/qlxgb dev/qlxgbe dev/qlxge dev/rl dev/sound/pc...
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 00:34:39 -0000
    
    Author: emaste
    Date: Wed May 17 00:34:34 2017
    New Revision: 318389
    URL: https://svnweb.freebsd.org/changeset/base/318389
    
    Log:
      Remove register keyword from sys/ and ANSIfy prototypes
      
      A long long time ago the register keyword told the compiler to store
      the corresponding variable in a CPU register, but it is not relevant
      for any compiler used in the FreeBSD world today.
      
      ANSIfy related prototypes while here.
      
      Reviewed by:	cem, jhb
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D10193
    
    Modified:
      head/sys/amd64/amd64/sys_machdep.c
      head/sys/amd64/amd64/vm_machdep.c
      head/sys/arm/arm/sys_machdep.c
      head/sys/arm/arm/vm_machdep.c
      head/sys/arm/include/atomic-v4.h
      head/sys/crypto/des/des_enc.c
      head/sys/crypto/des/des_setkey.c
      head/sys/ddb/db_access.c
      head/sys/ddb/db_output.c
      head/sys/ddb/db_sym.c
      head/sys/dev/cs/if_cs.c
      head/sys/dev/ixgb/if_ixgb.c
      head/sys/dev/lge/if_lge.c
      head/sys/dev/mse/mse_isa.c
      head/sys/dev/my/if_my.c
      head/sys/dev/pcn/if_pcn.c
      head/sys/dev/ppbus/immio.c
      head/sys/dev/ppbus/vpoio.c
      head/sys/dev/ppc/ppc.c
      head/sys/dev/qlxgb/qla_os.c
      head/sys/dev/qlxgbe/ql_os.c
      head/sys/dev/qlxge/qls_os.c
      head/sys/dev/rl/if_rl.c
      head/sys/dev/sound/pci/fm801.c
      head/sys/dev/speaker/spkr.c
      head/sys/dev/tl/if_tl.c
      head/sys/dev/usb/usb_busdma.c
      head/sys/dev/wb/if_wb.c
      head/sys/dev/xl/if_xl.c
      head/sys/fs/fifofs/fifo_vnops.c
      head/sys/fs/nandfs/nandfs_vnops.c
      head/sys/i386/i386/in_cksum.c
      head/sys/i386/i386/k6_mem.c
      head/sys/i386/i386/sys_machdep.c
      head/sys/i386/i386/vm_machdep.c
      head/sys/i386/ibcs2/ibcs2_misc.c
      head/sys/i386/ibcs2/ibcs2_other.c
      head/sys/i386/ibcs2/ibcs2_signal.c
      head/sys/i386/ibcs2/ibcs2_socksys.c
      head/sys/i386/isa/ccbque.h
      head/sys/i386/isa/elink.c
      head/sys/kern/inflate.c
      head/sys/kern/kern_clock.c
      head/sys/kern/kern_exec.c
      head/sys/kern/kern_prot.c
      head/sys/kern/kern_resource.c
      head/sys/kern/kern_sig.c
      head/sys/kern/kern_timeout.c
      head/sys/kern/kern_xxx.c
      head/sys/kern/sched_4bsd.c
      head/sys/kern/sysv_msg.c
      head/sys/kern/vfs_export.c
      head/sys/kern/vfs_mount.c
      head/sys/kern/vfs_syscalls.c
      head/sys/kern/vfs_vnops.c
      head/sys/libkern/zlib.c
      head/sys/mips/cavium/cryptocteon/cavium_crypto.c
      head/sys/mips/mips/vm_machdep.c
      head/sys/net/altq/altq_rio.c
      head/sys/net/altq/altq_rmclass.h
      head/sys/net/bpf_filter.c
      head/sys/net/if_llatbl.c
      head/sys/net/if_media.c
      head/sys/net/slcompress.c
      head/sys/netinet/in.c
      head/sys/netinet/in_cksum.c
      head/sys/netinet/ip_icmp.c
      head/sys/netinet6/in6_pcb.c
      head/sys/netinet6/raw_ip6.c
      head/sys/netipsec/ipsec_mbuf.c
      head/sys/rpc/clnt.h
      head/sys/sparc64/include/pcpu.h
    
    Modified: head/sys/amd64/amd64/sys_machdep.c
    ==============================================================================
    --- head/sys/amd64/amd64/sys_machdep.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/amd64/amd64/sys_machdep.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -169,9 +169,7 @@ update_gdt_fsbase(struct thread *td, uin
     }
     
     int
    -sysarch(td, uap)
    -	struct thread *td;
    -	register struct sysarch_args *uap;
    +sysarch(struct thread *td, struct sysarch_args *uap)
     {
     	int error = 0;
     	struct pcb *pcb = curthread->td_pcb;
    
    Modified: head/sys/amd64/amd64/vm_machdep.c
    ==============================================================================
    --- head/sys/amd64/amd64/vm_machdep.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/amd64/amd64/vm_machdep.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -148,13 +148,9 @@ alloc_fpusave(int flags)
      * ready to run and return to user mode.
      */
     void
    -cpu_fork(td1, p2, td2, flags)
    -	register struct thread *td1;
    -	register struct proc *p2;
    -	struct thread *td2;
    -	int flags;
    +cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
     {
    -	register struct proc *p1;
    +	struct proc *p1;
     	struct pcb *pcb2;
     	struct mdproc *mdp1, *mdp2;
     	struct proc_ldt *pldt;
    
    Modified: head/sys/arm/arm/sys_machdep.c
    ==============================================================================
    --- head/sys/arm/arm/sys_machdep.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/arm/arm/sys_machdep.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -188,9 +188,7 @@ arm32_get_tp(struct thread *td, void *ar
     }
     
     int
    -sysarch(td, uap)
    -	struct thread *td;
    -	register struct sysarch_args *uap;
    +sysarch(struct thread *td, struct sysarch_args *uap)
     {
     	int error;
     
    
    Modified: head/sys/arm/arm/vm_machdep.c
    ==============================================================================
    --- head/sys/arm/arm/vm_machdep.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/arm/arm/vm_machdep.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -93,8 +93,7 @@ uint32_t initial_fpscr = VFPSCR_DN | VFP
      * ready to run and return to user mode.
      */
     void
    -cpu_fork(register struct thread *td1, register struct proc *p2,
    -    struct thread *td2, int flags)
    +cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
     {
     	struct pcb *pcb2;
     	struct trapframe *tf;
    
    Modified: head/sys/arm/include/atomic-v4.h
    ==============================================================================
    --- head/sys/arm/include/atomic-v4.h	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/arm/include/atomic-v4.h	Wed May 17 00:34:34 2017	(r318389)
    @@ -299,7 +299,7 @@ atomic_clear_32(volatile uint32_t *addre
     static __inline u_int32_t
     atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval)
     {
    -	register int done, ras_start = ARM_RAS_START;
    +	int done, ras_start = ARM_RAS_START;
     
     	__asm __volatile("1:\n"
     	    "adr	%1, 1b\n"
    
    Modified: head/sys/crypto/des/des_enc.c
    ==============================================================================
    --- head/sys/crypto/des/des_enc.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/crypto/des/des_enc.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -69,14 +69,14 @@ extern	const DES_LONG des_SPtrans[8][64]
     
     void des_encrypt1(DES_LONG *data, des_key_schedule ks, int enc)
     {
    -	register DES_LONG l,r,t,u;
    +	DES_LONG l,r,t,u;
     #ifdef DES_PTR
    -	register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
    +	const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
     #endif
     #ifndef DES_UNROLL
    -	register int i;
    +	int i;
     #endif
    -	register DES_LONG *s;
    +	DES_LONG *s;
     
     	r=data[0];
     	l=data[1];
    @@ -167,14 +167,14 @@ void des_encrypt1(DES_LONG *data, des_ke
     
     void des_encrypt2(DES_LONG *data, des_key_schedule ks, int enc)
     {
    -	register DES_LONG l,r,t,u;
    +	DES_LONG l,r,t,u;
     #ifdef DES_PTR
    -	register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
    +	const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
     #endif
     #ifndef DES_UNROLL
    -	register int i;
    +	int i;
     #endif
    -	register DES_LONG *s;
    +	DES_LONG *s;
     
     	r=data[0];
     	l=data[1];
    @@ -259,7 +259,7 @@ void des_encrypt2(DES_LONG *data, des_ke
     void des_encrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2,
     	     des_key_schedule ks3)
     {
    -	register DES_LONG l,r;
    +	DES_LONG l,r;
     
     	l=data[0];
     	r=data[1];
    @@ -279,7 +279,7 @@ void des_encrypt3(DES_LONG *data, des_ke
     void des_decrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2,
     	     des_key_schedule ks3)
     {
    -	register DES_LONG l,r;
    +	DES_LONG l,r;
     
     	l=data[0];
     	r=data[1];
    
    Modified: head/sys/crypto/des/des_setkey.c
    ==============================================================================
    --- head/sys/crypto/des/des_setkey.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/crypto/des/des_setkey.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -172,10 +172,10 @@ int des_set_key_checked(des_cblock *key,
     void des_set_key_unchecked(des_cblock *key, des_key_schedule schedule)
     {
     	static int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
    -	register DES_LONG c,d,t,s,t2;
    -	register const unsigned char *in;
    -	register DES_LONG *k;
    -	register int i;
    +	DES_LONG c,d,t,s,t2;
    +	const unsigned char *in;
    +	DES_LONG *k;
    +	int i;
     
     	k = &schedule->ks.deslong[0];
     	in = &(*key)[0];
    
    Modified: head/sys/ddb/db_access.c
    ==============================================================================
    --- head/sys/ddb/db_access.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/ddb/db_access.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -57,8 +57,8 @@ db_expr_t
     db_get_value(db_addr_t addr, int size, bool is_signed)
     {
     	char		data[sizeof(u_int64_t)];
    -	register db_expr_t value;
    -	register int	i;
    +	db_expr_t	value;
    +	int		i;
     
     	if (db_read_bytes(addr, size, data) != 0) {
     		db_printf("*** error reading from address %llx ***\n",
    @@ -87,7 +87,7 @@ void
     db_put_value(db_addr_t addr, int size, db_expr_t value)
     {
     	char		data[sizeof(int)];
    -	register int	i;
    +	int		i;
     
     #if	BYTE_MSF
     	for (i = size - 1; i >= 0; i--)
    
    Modified: head/sys/ddb/db_output.c
    ==============================================================================
    --- head/sys/ddb/db_output.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/ddb/db_output.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -92,7 +92,7 @@ static void	db_pager(void);
     void
     db_force_whitespace(void)
     {
    -	register int last_print, next_tab;
    +	int last_print, next_tab;
     
     	last_print = db_last_non_space;
     	while (last_print < db_output_position) {
    @@ -355,7 +355,7 @@ db_iprintf(const char *fmt,...)
     	char bufr[DDB_BUFR_SIZE];
     #endif
     	struct dbputchar_arg dca;
    -	register int i;
    +	int i;
     	va_list listp;
     
     	for (i = db_indent; i >= 8; i -= 8)
    
    Modified: head/sys/ddb/db_sym.c
    ==============================================================================
    --- head/sys/ddb/db_sym.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/ddb/db_sym.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -286,10 +286,10 @@ static c_db_sym_t
     db_lookup(const char *symstr)
     {
     	c_db_sym_t sp;
    -	register int i;
    +	int i;
     	int symtab_start = 0;
     	int symtab_end = db_nsymtab;
    -	register const char *cp;
    +	const char *cp;
     
     	/*
     	 * Look for, remove, and remember any symbol table specifier.
    @@ -343,8 +343,8 @@ static bool
     db_symbol_is_ambiguous(c_db_sym_t sym)
     {
     	const char	*sym_name;
    -	register int	i;
    -	register bool	found_once = false;
    +	int		i;
    +	bool		found_once = false;
     
     	if (!db_qualify_ambiguous_names)
     		return (false);
    @@ -367,10 +367,9 @@ db_symbol_is_ambiguous(c_db_sym_t sym)
     c_db_sym_t
     db_search_symbol(db_addr_t val, db_strategy_t strategy, db_expr_t *offp)
     {
    -	register
     	unsigned int	diff;
     	size_t		newdiff;
    -	register int	i;
    +	int		i;
     	c_db_sym_t	ret = C_DB_SYM_NULL, sym;
     
     	newdiff = diff = val;
    
    Modified: head/sys/dev/cs/if_cs.c
    ==============================================================================
    --- head/sys/dev/cs/if_cs.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/cs/if_cs.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -1038,7 +1038,7 @@ cs_setmode(struct cs_softc *sc)
     }
     
     static int
    -cs_ioctl(register struct ifnet *ifp, u_long command, caddr_t data)
    +cs_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
     {
     	struct cs_softc *sc=ifp->if_softc;
     	struct ifreq *ifr = (struct ifreq *)data;
    
    Modified: head/sys/dev/ixgb/if_ixgb.c
    ==============================================================================
    --- head/sys/dev/ixgb/if_ixgb.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/ixgb/if_ixgb.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -1777,7 +1777,7 @@ static int
     ixgb_get_buf(int i, struct adapter * adapter,
     	     struct mbuf * nmp)
     {
    -	struct mbuf *mp = nmp;
    +	struct mbuf    *mp = nmp;
     	struct ixgb_buffer *rx_buffer;
     	struct ifnet   *ifp;
     	bus_addr_t      paddr;
    
    Modified: head/sys/dev/lge/if_lge.c
    ==============================================================================
    --- head/sys/dev/lge/if_lge.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/lge/if_lge.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -216,7 +216,7 @@ lge_eeprom_getword(sc, addr, dest)
     	int			addr;
     	u_int16_t		*dest;
     {
    -	register int		i;
    +	int			i;
     	u_int32_t		val;
     
     	CSR_WRITE_4(sc, LGE_EECTL, LGE_EECTL_CMD_READ|
    @@ -413,7 +413,7 @@ static void
     lge_reset(sc)
     	struct lge_softc	*sc;
     {
    -	register int		i;
    +	int			i;
     
     	LGE_SETBIT(sc, LGE_MODE1, LGE_MODE1_SETRST_CTL0|LGE_MODE1_SOFTRST);
     
    @@ -756,7 +756,7 @@ lge_alloc_jumbo_mem(sc)
     	struct lge_softc	*sc;
     {
     	caddr_t			ptr;
    -	register int		i;
    +	int			i;
     	struct lge_jpool_entry   *entry;
     
     	/* Grab a big chunk o' storage. */
    @@ -1524,7 +1524,7 @@ static void
     lge_stop(sc)
     	struct lge_softc	*sc;
     {
    -	register int		i;
    +	int			i;
     	struct ifnet		*ifp;
     
     	LGE_LOCK_ASSERT(sc);
    
    Modified: head/sys/dev/mse/mse_isa.c
    ==============================================================================
    --- head/sys/dev/mse/mse_isa.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/mse/mse_isa.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -309,7 +309,7 @@ mse_disablelogi(struct resource *port)
     static void
     mse_getlogi(struct resource *port, int *dx, int *dy, int *but)
     {
    -	register char x, y;
    +	char x, y;
     
     	bus_write_1(port, MSE_PORTC, MSE_HOLD | MSE_RXLOW);
     	x = bus_read_1(port, MSE_PORTA);
    
    Modified: head/sys/dev/my/if_my.c
    ==============================================================================
    --- head/sys/dev/my/if_my.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/my/if_my.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -751,7 +751,7 @@ my_setcfg(struct my_softc * sc, int bmcr
     static void
     my_reset(struct my_softc * sc)
     {
    -	register int    i;
    +	int    i;
     
     	MY_LOCK_ASSERT(sc);
     	MY_SETBIT(sc, MY_BCR, MY_SWR);
    @@ -1717,7 +1717,7 @@ my_watchdog(void *arg)
     static void
     my_stop(struct my_softc * sc)
     {
    -	register int    i;
    +	int    i;
     	struct ifnet   *ifp;
     
     	MY_LOCK_ASSERT(sc);
    
    Modified: head/sys/dev/pcn/if_pcn.c
    ==============================================================================
    --- head/sys/dev/pcn/if_pcn.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/pcn/if_pcn.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -1453,7 +1453,7 @@ pcn_watchdog(struct pcn_softc *sc)
     static void
     pcn_stop(struct pcn_softc *sc)
     {
    -	register int		i;
    +	int			i;
     	struct ifnet		*ifp;
     
     	PCN_LOCK_ASSERT(sc);
    
    Modified: head/sys/dev/ppbus/immio.c
    ==============================================================================
    --- head/sys/dev/ppbus/immio.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/ppbus/immio.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -674,10 +674,10 @@ imm_do_scsi(struct vpoio_data *vpo, int 
     		int *ret)
     {
     	device_t ppbus = device_get_parent(vpo->vpo_dev);
    -	register char r;
    +	char r;
     	char l, h = 0;
     	int len, error = 0, not_connected = 0;
    -	register int k;
    +	int k;
     	int negociated = 0;
     
     	/*
    
    Modified: head/sys/dev/ppbus/vpoio.c
    ==============================================================================
    --- head/sys/dev/ppbus/vpoio.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/ppbus/vpoio.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -680,10 +680,10 @@ vpoio_do_scsi(struct vpoio_data *vpo, in
     		int *ret)
     {
     	device_t ppbus = device_get_parent(vpo->vpo_dev);
    -	register char r;
    +	char r;
     	char l, h = 0;
     	int len, error = 0;
    -	register int k;
    +	int k;
     
     	/*
     	 * enter disk state, allocate the ppbus
    
    Modified: head/sys/dev/ppc/ppc.c
    ==============================================================================
    --- head/sys/dev/ppc/ppc.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/ppc/ppc.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -285,7 +285,7 @@ ppc_detect_port(struct ppc_data *ppc)
     static void
     ppc_reset_epp_timeout(struct ppc_data *ppc)
     {
    -	register char r;
    +	char r;
     
     	r = r_str(ppc);
     	w_str(ppc, r | 0x1);
    @@ -1321,10 +1321,10 @@ ppc_exec_microseq(device_t dev, struct p
     	int i, iter, len;
     	int error;
     
    -	register int reg;
    -	register char mask;
    -	register int accum = 0;
    -	register char *ptr = NULL;
    +	int reg;
    +	char mask;
    +	int accum = 0;
    +	char *ptr = NULL;
     
     	struct ppb_microseq *stack = NULL;
     
    
    Modified: head/sys/dev/qlxgb/qla_os.c
    ==============================================================================
    --- head/sys/dev/qlxgb/qla_os.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/qlxgb/qla_os.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -1401,7 +1401,7 @@ int
     qla_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp,
     	uint32_t jumbo)
     {
    -	register struct mbuf *mp = nmp;
    +	struct mbuf *mp = nmp;
     	struct ifnet   *ifp;
     	int             ret = 0;
     	uint32_t	offset;
    
    Modified: head/sys/dev/qlxgbe/ql_os.c
    ==============================================================================
    --- head/sys/dev/qlxgbe/ql_os.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/qlxgbe/ql_os.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -1797,7 +1797,7 @@ qla_free_rcv_bufs(qla_host_t *ha)
     int
     ql_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp)
     {
    -	register struct mbuf *mp = nmp;
    +	struct mbuf *mp = nmp;
     	struct ifnet   		*ifp;
     	int            		ret = 0;
     	uint32_t		offset;
    
    Modified: head/sys/dev/qlxge/qls_os.c
    ==============================================================================
    --- head/sys/dev/qlxge/qls_os.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/qlxge/qls_os.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -1396,7 +1396,7 @@ qls_alloc_rcv_bufs(qla_host_t *ha)
     int
     qls_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp)
     {
    -	register struct mbuf *mp = nmp;
    +	struct mbuf *mp = nmp;
     	struct ifnet   		*ifp;
     	int            		ret = 0;
     	uint32_t		offset;
    
    Modified: head/sys/dev/rl/if_rl.c
    ==============================================================================
    --- head/sys/dev/rl/if_rl.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/rl/if_rl.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -276,7 +276,7 @@ DRIVER_MODULE(miibus, rl, miibus_driver,
     static void
     rl_eeprom_putbyte(struct rl_softc *sc, int addr)
     {
    -	register int		d, i;
    +	int			d, i;
     
     	d = addr | sc->rl_eecmd_read;
     
    @@ -303,7 +303,7 @@ rl_eeprom_putbyte(struct rl_softc *sc, i
     static void
     rl_eeprom_getword(struct rl_softc *sc, int addr, uint16_t *dest)
     {
    -	register int		i;
    +	int			i;
     	uint16_t		word = 0;
     
     	/* Enter EEPROM access mode. */
    @@ -561,7 +561,7 @@ rl_rxfilter(struct rl_softc *sc)
     static void
     rl_reset(struct rl_softc *sc)
     {
    -	register int		i;
    +	int			i;
     
     	RL_LOCK_ASSERT(sc);
     
    @@ -1912,7 +1912,7 @@ rl_watchdog(struct rl_softc *sc)
     static void
     rl_stop(struct rl_softc *sc)
     {
    -	register int		i;
    +	int			i;
     	struct ifnet		*ifp = sc->rl_ifp;
     
     	RL_LOCK_ASSERT(sc);
    
    Modified: head/sys/dev/sound/pci/fm801.c
    ==============================================================================
    --- head/sys/dev/sound/pci/fm801.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/sound/pci/fm801.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -394,7 +394,7 @@ fm801ch_setspeed(kobj_t obj, void *data,
     {
     	struct fm801_chinfo *ch = data;
     	struct fm801_info *fm801 = ch->parent;
    -	register int i;
    +	int i;
     
     
     	for (i = 0; i < 10 && fm801_rates[i].limit <= speed; i++) ;
    
    Modified: head/sys/dev/speaker/spkr.c
    ==============================================================================
    --- head/sys/dev/speaker/spkr.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/speaker/spkr.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -201,7 +201,7 @@ playinit()
     static void
     playtone(int pitch, int value, int sustain)
     {
    -	register int sound, silence, snum = 1, sdenom = 1;
    +	int sound, silence, snum = 1, sdenom = 1;
     
     	/* this weirdness avoids floating-point arithmetic */
     	for (; sustain; sustain--) {
    @@ -243,7 +243,7 @@ playstring(char *cp, size_t slen)
     				{v = v * 10 + (*++cp - '0'); slen--;}
     	for (; slen--; cp++) {
     		int sustain, timeval, tempo;
    -		register char c = toupper(*cp);
    +		char c = toupper(*cp);
     
     #ifdef DEBUG
     		(void) printf("playstring: %c (%x)\n", c, c);
    
    Modified: head/sys/dev/tl/if_tl.c
    ==============================================================================
    --- head/sys/dev/tl/if_tl.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/tl/if_tl.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -534,7 +534,7 @@ static u_int8_t tl_eeprom_putbyte(sc, by
     	struct tl_softc		*sc;
     	int			byte;
     {
    -	register int		i, ack = 0;
    +	int			i, ack = 0;
     
     	/*
     	 * Make sure we're in TX mode.
    @@ -579,7 +579,7 @@ static u_int8_t tl_eeprom_getbyte(sc, ad
     	int			addr;
     	u_int8_t		*dest;
     {
    -	register int		i;
    +	int			i;
     	u_int8_t		byte = 0;
     	device_t		tl_dev = sc->tl_dev;
     
    @@ -2199,7 +2199,7 @@ static void
     tl_stop(sc)
     	struct tl_softc		*sc;
     {
    -	register int		i;
    +	int			i;
     	struct ifnet		*ifp;
     
     	TL_LOCK_ASSERT(sc);
    
    Modified: head/sys/dev/usb/usb_busdma.c
    ==============================================================================
    --- head/sys/dev/usb/usb_busdma.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/usb/usb_busdma.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -232,7 +232,7 @@ struct usb_m_copy_in_arg {
     static int
     usbd_m_copy_in_cb(void *arg, void *src, uint32_t count)
     {
    -	register struct usb_m_copy_in_arg *ua = arg;
    +	struct usb_m_copy_in_arg *ua = arg;
     
     	usbd_copy_in(ua->cache, ua->dst_offset, src, count);
     	ua->dst_offset += count;
    
    Modified: head/sys/dev/wb/if_wb.c
    ==============================================================================
    --- head/sys/dev/wb/if_wb.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/wb/if_wb.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -256,7 +256,7 @@ wb_eeprom_putbyte(sc, addr)
     	struct wb_softc		*sc;
     	int			addr;
     {
    -	register int		d, i;
    +	int			d, i;
     
     	d = addr | WB_EECMD_READ;
     
    @@ -286,7 +286,7 @@ wb_eeprom_getword(sc, addr, dest)
     	int			addr;
     	u_int16_t		*dest;
     {
    -	register int		i;
    +	int			i;
     	u_int16_t		word = 0;
     
     	/* Enter EEPROM access mode. */
    @@ -507,7 +507,7 @@ static void
     wb_reset(sc)
     	struct wb_softc		*sc;
     {
    -	register int		i;
    +	int			i;
     	struct mii_data		*mii;
     	struct mii_softc	*miisc;
     
    @@ -1574,7 +1574,7 @@ static void
     wb_stop(sc)
     	struct wb_softc		*sc;
     {
    -	register int		i;
    +	int			i;
     	struct ifnet		*ifp;
     
     	WB_LOCK_ASSERT(sc);
    
    Modified: head/sys/dev/xl/if_xl.c
    ==============================================================================
    --- head/sys/dev/xl/if_xl.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/dev/xl/if_xl.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -353,7 +353,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme
     static void
     xl_wait(struct xl_softc *sc)
     {
    -	register int		i;
    +	int			i;
     
     	for (i = 0; i < XL_TIMEOUT; i++) {
     		if ((CSR_READ_2(sc, XL_STATUS) & XL_STAT_CMDBUSY) == 0)
    @@ -836,7 +836,7 @@ xl_setmode(struct xl_softc *sc, int medi
     static void
     xl_reset(struct xl_softc *sc)
     {
    -	register int		i;
    +	int			i;
     
     	XL_LOCK_ASSERT(sc);
     
    @@ -3153,7 +3153,7 @@ xl_watchdog(struct xl_softc *sc)
     static void
     xl_stop(struct xl_softc *sc)
     {
    -	register int		i;
    +	int			i;
     	struct ifnet		*ifp = sc->xl_ifp;
     
     	XL_LOCK_ASSERT(sc);
    
    Modified: head/sys/fs/fifofs/fifo_vnops.c
    ==============================================================================
    --- head/sys/fs/fifofs/fifo_vnops.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/fs/fifofs/fifo_vnops.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -313,7 +313,7 @@ int
     fifo_printinfo(vp)
     	struct vnode *vp;
     {
    -	register struct fifoinfo *fip = vp->v_fifoinfo;
    +	struct fifoinfo *fip = vp->v_fifoinfo;
     
     	if (fip == NULL){
     		printf(", NULL v_fifoinfo");
    
    Modified: head/sys/fs/nandfs/nandfs_vnops.c
    ==============================================================================
    --- head/sys/fs/nandfs/nandfs_vnops.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/fs/nandfs/nandfs_vnops.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -129,8 +129,8 @@ nandfs_reclaim(struct vop_reclaim_args *
     static int
     nandfs_read(struct vop_read_args *ap)
     {
    -	register struct vnode *vp = ap->a_vp;
    -	register struct nandfs_node *node = VTON(vp);
    +	struct vnode *vp = ap->a_vp;
    +	struct nandfs_node *node = VTON(vp);
     	struct nandfs_device *nandfsdev = node->nn_nandfsdev;
     	struct uio *uio = ap->a_uio;
     	struct buf *bp;
    
    Modified: head/sys/i386/i386/in_cksum.c
    ==============================================================================
    --- head/sys/i386/i386/in_cksum.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/i386/i386/in_cksum.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -263,9 +263,9 @@ in_cksum_skip(m, len, skip)
     	int len;
     	int skip;
     {
    -	register u_short *w;
    -	register unsigned sum = 0;
    -	register int mlen = 0;
    +	u_short *w;
    +	unsigned sum = 0;
    +	int mlen = 0;
     	int byte_swapped = 0;
     	union { char	c[2]; u_short	s; } su;
     
    
    Modified: head/sys/i386/i386/k6_mem.c
    ==============================================================================
    --- head/sys/i386/i386/k6_mem.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/i386/i386/k6_mem.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -78,7 +78,7 @@ static __inline int
     k6_mrmake(struct mem_range_desc *desc, u_int32_t *mtrr)
     {
     	u_int32_t len = 0, wc, uc;
    -	register int bit;
    +	int bit;
     
     	if (desc->mr_base &~ 0xfffe0000)
     		return (EINVAL);
    
    Modified: head/sys/i386/i386/sys_machdep.c
    ==============================================================================
    --- head/sys/i386/i386/sys_machdep.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/i386/i386/sys_machdep.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -98,9 +98,7 @@ struct sysarch_args {
     #endif
     
     int
    -sysarch(td, uap)
    -	struct thread *td;
    -	register struct sysarch_args *uap;
    +sysarch(struct thread *td, struct sysarch_args *uap)
     {
     	int error;
     	union descriptor *lp;
    
    Modified: head/sys/i386/i386/vm_machdep.c
    ==============================================================================
    --- head/sys/i386/i386/vm_machdep.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/i386/i386/vm_machdep.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -166,7 +166,7 @@ alloc_fpusave(int flags)
     void
     cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
     {
    -	register struct proc *p1;
    +	struct proc *p1;
     	struct pcb *pcb2;
     	struct mdproc *mdp2;
     
    
    Modified: head/sys/i386/ibcs2/ibcs2_misc.c
    ==============================================================================
    --- head/sys/i386/ibcs2/ibcs2_misc.c	Tue May 16 23:31:52 2017	(r318388)
    +++ head/sys/i386/ibcs2/ibcs2_misc.c	Wed May 17 00:34:34 2017	(r318389)
    @@ -93,9 +93,7 @@ __FBSDID("$FreeBSD$");
     #include 
     
     int
    -ibcs2_ulimit(td, uap)
    -	struct thread *td;
    -	struct ibcs2_ulimit_args *uap;
    +ibcs2_ulimit(struct thread *td, struct ibcs2_ulimit_args *uap)
     {
     	struct rlimit rl;
     	int error;
    @@ -134,9 +132,7 @@ ibcs2_ulimit(td, uap)
     #define IBCS2_WSTOPPED       0177
     #define IBCS2_STOPCODE(sig)  ((sig) << 8 | IBCS2_WSTOPPED)
     int
    -ibcs2_wait(td, uap)
    -	struct thread *td;
    -	struct ibcs2_wait_args *uap;
    +ibcs2_wait(struct thread *td, struct ibcs2_wait_args *uap)
     {
     	int error, options, status;
     	int *statusp;
    @@ -185,9 +181,7 @@ ibcs2_wait(td, uap)
     }
     
     int
    -ibcs2_execv(td, uap)
    -	struct thread *td;
    -	struct ibcs2_execv_args *uap;
    +ibcs2_execv(struct thread *td, struct ibcs2_execv_args *uap)
     {
     	struct image_args eargs;
     	struct vmspace *oldvmspace;
    @@ -210,9 +204,7 @@ ibcs2_execv(td, uap)
     }
     
     int
    -ibcs2_execve(td, uap) 
    -        struct thread *td;
    -        struct ibcs2_execve_args *uap;
    +ibcs2_execve(struct thread *td, struct ibcs2_execve_args *uap)
     {
     	struct image_args eargs;
     	struct vmspace *oldvmspace;
    @@ -236,9 +228,7 @@ ibcs2_execve(td, uap) 
     }
     
     int
    -ibcs2_umount(td, uap)
    -	struct thread *td;
    -	struct ibcs2_umount_args *uap;
    +ibcs2_umount(struct thread *td, struct ibcs2_umount_args *uap)
     {
     	struct unmount_args um;
     
    @@ -248,9 +238,7 @@ ibcs2_umount(td, uap)
     }
     
     int
    -ibcs2_mount(td, uap)
    -	struct thread *td;
    -	struct ibcs2_mount_args *uap;
    +ibcs2_mount(struct thread *td, struct ibcs2_mount_args *uap)
     {
     #ifdef notyet
     	int oflags = uap->flags, nflags, error;
    @@ -321,15 +309,13 @@ ibcs2_mount(td, uap)
      */
     
     int
    -ibcs2_getdents(td, uap)
    -	struct thread *td;
    -	register struct ibcs2_getdents_args *uap;
    -{
    -	register struct vnode *vp;
    -	register caddr_t inp, buf;	/* BSD-format */
    -	register int len, reclen;	/* BSD-format */
    -	register caddr_t outp;		/* iBCS2-format */
    -	register int resid;		/* iBCS2-format */
    +ibcs2_getdents(struct thread *td, struct ibcs2_getdents_args *uap)
    +{
    +	struct vnode *vp;
    +	caddr_t inp, buf;		/* BSD-format */
    +	int len, reclen;		/* BSD-format */
    +	caddr_t outp;			/* iBCS2-format */
    +	int resid;			/* iBCS2-format */
     	cap_rights_t rights;
     	struct file *fp;
     	struct uio auio;
    @@ -475,15 +461,13 @@ out:
     }
     
     int
    -ibcs2_read(td, uap)
    -	struct thread *td;
    -	struct ibcs2_read_args *uap;
    -{
    -	register struct vnode *vp;
    -	register caddr_t inp, buf;	/* BSD-format */
    -	register int len, reclen;	/* BSD-format */
    -	register caddr_t outp;		/* iBCS2-format */
    -	register int resid;		/* iBCS2-format */
    +ibcs2_read(struct thread *td, struct ibcs2_read_args *uap)
    +{
    +	struct vnode *vp;
    +	caddr_t inp, buf;		/* BSD-format */
    +	int len, reclen;		/* BSD-format */
    +	caddr_t outp;			/* iBCS2-format */
    +	int resid;			/* iBCS2-format */
     	cap_rights_t rights;
     	struct file *fp;
     	struct uio auio;
    @@ -640,9 +624,7 @@ out:
     }
     
     int
    -ibcs2_mknod(td, uap)
    -	struct thread *td;
    -	struct ibcs2_mknod_args *uap;
    +ibcs2_mknod(struct thread *td, struct ibcs2_mknod_args *uap)
     {
     	char *path;
     	int error;
    @@ -660,9 +642,7 @@ ibcs2_mknod(td, uap)
     }
     
     int
    -ibcs2_getgroups(td, uap)
    -	struct thread *td;
    -	struct ibcs2_getgroups_args *uap;
    +ibcs2_getgroups(struct thread *td, struct ibcs2_getgroups_args *uap)
     {
     	struct ucred *cred;
     	ibcs2_gid_t *iset;
    @@ -690,9 +670,7 @@ out:
     }
     
     int
    -ibcs2_setgroups(td, uap)
    -	struct thread *td;
    -	struct ibcs2_setgroups_args *uap;
    +ibcs2_setgroups(struct thread *td, struct ibcs2_setgroups_args *uap)
     {
     	ibcs2_gid_t *iset;
     	gid_t *gp;
    @@ -722,9 +700,7 @@ out:
     }
     
     int
    -ibcs2_setuid(td, uap)
    -	struct thread *td;
    -	struct ibcs2_setuid_args *uap;
    +ibcs2_setuid(struct thread *td, struct ibcs2_setuid_args *uap)
     {
     	struct setuid_args sa;
     
    @@ -733,9 +709,7 @@ ibcs2_setuid(td, uap)
     }
     
     int
    -ibcs2_setgid(td, uap)
    -	struct thread *td;
    -	struct ibcs2_setgid_args *uap;
    +ibcs2_setgid(struct thread *td, struct ibcs2_setgid_args *uap)
     {
     	struct setgid_args sa;
     
    @@ -744,9 +718,7 @@ ibcs2_setgid(td, uap)
     }
     
     int
    -ibcs2_time(td, uap)
    -	struct thread *td;
    -	struct ibcs2_time_args *uap;
    +ibcs2_time(struct thread *td, struct ibcs2_time_args *uap)
     {
     	struct timeval tv;
     
    @@ -760,9 +732,7 @@ ibcs2_time(td, uap)
     }
     
     int
    -ibcs2_pathconf(td, uap)
    -	struct thread *td;
    -	struct ibcs2_pathconf_args *uap;
    +ibcs2_pathconf(struct thread *td, struct ibcs2_pathconf_args *uap)
     {
     	char *path;
     	int error;
    @@ -775,18 +745,14 @@ ibcs2_pathconf(td, uap)
     }
     
     int
    -ibcs2_fpathconf(td, uap)
    -	struct thread *td;
    -	struct ibcs2_fpathconf_args *uap;
    +ibcs2_fpathconf(struct thread *td, struct ibcs2_fpathconf_args *uap)
     {
     	uap->name++;	/* iBCS2 _PC_* defines are offset by one */
             return sys_fpathconf(td, (struct fpathconf_args *)uap);
     }
     
     int
    -ibcs2_sysconf(td, uap)
    -	struct thread *td;
    -	struct ibcs2_sysconf_args *uap;
    +ibcs2_sysconf(struct thread *td, struct ibcs2_sysconf_args *uap)
     {
     	int mib[2], value, len, error;
     
    @@ -845,9 +811,7 @@ ibcs2_sysconf(td, uap)
     }
     
     int
    -ibcs2_alarm(td, uap)
    -	struct thread *td;
    -	struct ibcs2_alarm_args *uap;
    +ibcs2_alarm(struct thread *td, struct ibcs2_alarm_args *uap)
     {
     	struct itimerval itv, oitv;
     	int error;
    @@ -865,9 +829,7 @@ ibcs2_alarm(td, uap)
     }
     
     int
    -ibcs2_times(td, uap)
    -	struct thread *td;
    -	struct ibcs2_times_args *uap;
    +ibcs2_times(struct thread *td, struct ibcs2_times_args *uap)
     {
     	struct rusage ru;
     	struct timeval t;
    @@ -895,9 +857,7 @@ ibcs2_times(td, uap)
     }
     
     int
    -ibcs2_stime(td, uap)
    -	struct thread *td;
    -	struct ibcs2_stime_args *uap;
    +ibcs2_stime(struct thread *td, struct ibcs2_stime_args *uap)
     {
     	struct timeval tv;
     	long secs;
    @@ -915,9 +875,7 @@ ibcs2_stime(td, uap)
     }
     
     int
    -ibcs2_utime(td, uap)
    -	struct thread *td;
    -	struct ibcs2_utime_args *uap;
    +ibcs2_utime(struct thread *td, struct ibcs2_utime_args *uap)
     {
     	struct ibcs2_utimbuf ubuf;
     	struct timeval tbuf[2], *tp;
    @@ -944,9 +902,7 @@ ibcs2_utime(td, uap)
     }
     
     int
    -ibcs2_nice(td, uap)
    -	struct thread *td;
    -	struct ibcs2_nice_args *uap;
    +ibcs2_nice(struct thread *td, struct ibcs2_nice_args *uap)
     {
     	int error;
     	struct setpriority_args sa;
    @@ -965,9 +921,7 @@ ibcs2_nice(td, uap)
      */
     
     int
    -ibcs2_pgrpsys(td, uap)
    -	struct thread *td;
    -	struct ibcs2_pgrpsys_args *uap;
    +ibcs2_pgrpsys(struct thread *td, struct ibcs2_pgrpsys_args *uap)
     {
     	struct proc *p = td->td_proc;
     	switch (uap->type) {
    @@ -1012,9 +966,7 @@ ibcs2_pgrpsys(td, uap)
      */
     
     int
    -ibcs2_plock(td, uap)
    -	struct thread *td;
    -	struct ibcs2_plock_args *uap;
    +ibcs2_plock(struct thread *td, struct ibcs2_plock_args *uap)
     {
     	int error;
     #define IBCS2_UNLOCK	0
    @@ -1044,9 +996,7 @@ ibcs2_plock(td, uap)
     }
     
     int
    -ibcs2_uadmin(td, uap)
    -	struct thread *td;
    -	struct ibcs2_uadmin_args *uap;
    +ibcs2_uadmin(struct thread *td, struct ibcs2_uadmin_args *uap)
     {
     #define SCO_A_REBOOT        1
     #define SCO_A_SHUTDOWN      2
    @@ -1093,9 +1043,7 @@ ibcs2_uadmin(td, uap)
     }
     
     int
    -ibcs2_sysfs(td, uap)
    -	struct thread *td;
    -	struct ibcs2_sysfs_args *uap;
    +ibcs2_sysfs(struct thread *td, struct ibcs2_sysfs_args *uap)
     {
     #define IBCS2_GETFSIND        1
     #define IBCS2_GETFSTYP        2
    @@ -1111,9 +1059,7 @@ ibcs2_sysfs(td, uap)
     }
     
     int
    -ibcs2_unlink(td, uap)
    -	struct thread *td;
    -	struct ibcs2_unlink_args *uap;
    +ibcs2_unlink(struct thread *td, struct ibcs2_unlink_args *uap)
     {
     	char *path;
     	int error;
    @@ -1125,9 +1071,7 @@ ibcs2_unlink(td, uap)
     }
     
     int
    -ibcs2_chdir(td, uap)
    -	struct thread *td;
    -	struct ibcs2_chdir_args *uap;
    +ibcs2_chdir(struct thread *td, struct ibcs2_chdir_args *uap)
     {
     	char *path;
     	int error;
    @@ -1139,9 +1083,7 @@ ibcs2_chdir(td, uap)
     }
     
     int
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-head@freebsd.org  Wed May 17 01:17:58 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAD95D7026E;
     Wed, 17 May 2017 01:17:58 +0000 (UTC)
     (envelope-from phil@juniper.net)
    Received: from NAM03-DM3-obe.outbound.protection.outlook.com
     (mail-dm3nam03on0108.outbound.protection.outlook.com [104.47.41.108])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))
     (Client CN "mail.protection.outlook.com",
     Issuer "Microsoft IT SSL SHA2" (verified OK))
     by mx1.freebsd.org (Postfix) with ESMTPS id 61A35909;
     Wed, 17 May 2017 01:17:57 +0000 (UTC)
     (envelope-from phil@juniper.net)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net;
     s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version;
     bh=cWPThBL76Qrl6qCnYyEnnMG0GSuQ1gIAAGWIN+RHKmQ=;
     b=d996OfG4U6Rp83WMgzTjeMpldzX/VcC5Tdduskp6I/cbRswDRIAcDZtgAonhVRHIyI2vF5RnDXT8WfxKQXsirjOy1DFJCINeHL+DfoD1eHwNDIzqxYYHQA5sjsoG3YfnPdRgkENoG9yq2O7azU2MHZaXBfmYrEjHr8e9QBHKzCg=
    Received: from BLUPR05CA0072.namprd05.prod.outlook.com (10.141.20.42) by
     CY1PR0501MB1306.namprd05.prod.outlook.com (10.160.226.11) with Microsoft SMTP
     Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id
     15.1.1101.8; Wed, 17 May 2017 01:17:56 +0000
    Received: from BY2NAM05FT009.eop-nam05.prod.protection.outlook.com
     (2a01:111:f400:7e52::209) by BLUPR05CA0072.outlook.office365.com
     (2a01:111:e400:855::42) with Microsoft SMTP Server (version=TLS1_2,
     cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.8 via
     Frontend Transport; Wed, 17 May 2017 01:17:56 +0000
    Authentication-Results: spf=softfail (sender IP is 66.129.239.12)
     smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed)
     header.d=none;freebsd.org; dmarc=fail action=none header.from=juniper.net;
    Received-SPF: SoftFail (protection.outlook.com: domain of transitioning
     juniper.net discourages use of 66.129.239.12 as permitted sender)
    Received: from p-emfe01a-sac.jnpr.net (66.129.239.12) by
     BY2NAM05FT009.mail.protection.outlook.com (10.152.100.146) with Microsoft
     SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256)
     id 15.1.1075.12 via Frontend Transport; Wed, 17 May 2017 01:17:55 +0000
    Received: from p-mailhub01.juniper.net (10.160.2.17) by p-emfe01a-sac.jnpr.net
     (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3;
     Tue, 16 May 2017 18:17:39 -0700
    Received: from idle.juniper.net (idleski.juniper.net [172.25.4.26])	by
     p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id v4H1HcIF005066; Tue, 16
     May 2017 18:17:38 -0700	(envelope-from phil@juniper.net)
    Received: from idle.juniper.net (localhost [127.0.0.1])	by idle.juniper.net
     (8.14.4/8.14.3) with ESMTP id v4H1HUAm077333; Tue, 16 May 2017 21:17:31 -0400
     (EDT)	(envelope-from phil@idle.juniper.net)
    Message-ID: <201705170117.v4H1HUAm077333@idle.juniper.net>
    To: "Ngie Cooper (yaneurabeya)" 
    CC: Phil Shafer , ,
     , 
    Subject: Re: svn commit: r318364 - in head: contrib/libxo contrib/libxo/doc
     contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved
     contrib/libxo/tests/gettext/saved contrib/libxo/xo lib/lib...
    In-Reply-To: 
    Date: Tue, 16 May 2017 21:17:29 -0400
    From: Phil Shafer 
    MIME-Version: 1.0
    Content-Type: text/plain
    X-EOPAttributedMessage: 0
    X-MS-Office365-Filtering-HT: Tenant
    X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI;
     SFV:NSPM;
     SFS:(10019020)(6009001)(39850400002)(39840400002)(39860400002)(39400400002)(39450400003)(39410400002)(2980300002)(189002)(199003)(9170700003)(7126002)(105596002)(50986999)(6916009)(5003940100001)(2906002)(2810700001)(54356999)(53416004)(305945005)(7696004)(356003)(478600001)(4326008)(2950100002)(189998001)(229853002)(966005)(5660300001)(6246003)(47776003)(110136004)(38730400002)(77096006)(6306002)(53936002)(8276002)(50466002)(1076002)(48376002)(39060400002)(81166006)(8936002)(76506005)(1411001)(106466001)(8676002)(86362001)(54906002);
     DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0501MB1306; H:p-emfe01a-sac.jnpr.net; FPR:;
     SPF:SoftFail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; 
    X-Microsoft-Exchange-Diagnostics: 1; BY2NAM05FT009;
     1:hg14gyYh8XJH0EpFqLGLwcefAGW3tjqvJZTkxfVSzY3WX9ytAnPlDgZc5QQAs5YjmB5bSFGkZ/QbaXQWc/qh7uSxd920zSaOFQYaSnfV2R3VnwAme4zSxeojO2Sd01u2Lht0JSvNt65mnm6Bp5lUsuQPwVS5pYwDq8tG+v5/ES+pJTN5hQ4PdtDBovBXphTN8P4wiWZN6BM62Yul1NcyDPjDZgG3tNWI8Cu53RMDMa5Ggj9sDjsiuzIttqfE0iatWZgQHp8kT8kcH/L/83sZIY5RQ92ysAA+sym35b2JAXfmjNM/Ii9uapandxc3iRg63TbdgG+6MzEoPIS7QbCVIJbsaxRU6XNI666/4dho8yHH0ZvcUDmB3vOkQbeys2UbX0M7WU/9vai6g/xlvlWEx2F09GE0dn3a0NftzzHpsb/hcI2J7N2NTgaZPiowoSfLnZpREh/fHcWmNFHyYK7k3v2r6qNUBsNOZv2pn0kqN18YIx0kZEpicGTZmYjTkRmxLAfHnKoqAj3axUQTrjJVIIU6lKyTEOBxNf7FUDjKbVEJ9zyNXaWxTePi/MkloU/q2UdyoAOK6sr/A6S/ebsTBIVBu86PXKzi/si20FHpMXs=
    X-MS-PublicTrafficType: Email
    X-MS-TrafficTypeDiagnostic: CY1PR0501MB1306:
    X-MS-Office365-Filtering-Correlation-Id: 914e1373-e202-4c5c-33f7-08d49cc28c5e
    X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0;
     RULEID:(22001)(2017030254075)(201703131423075)(201703031133081);
     SRVR:CY1PR0501MB1306; 
    X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1306;
     3:rkwvgBMHF+gNxyqV46gx83Y9ZNtS7m9WcsXlkxQ7QskSP8ycD2NXHaU2a/P1HvG1pSpWyQf9PFKmZ5W4nwCu3imnziry9TfNFWVu6thuoWc/HRLYd49FcuFozlEyOh1rtXSrC5odwHLRI1xHHsLIHwViX0gZf7mBtFPoRij8n7CQDNnqnDQ9/sWIejv8Fgl447ZiqV2dMdA5ZAZigGmYnL42pUAZP5DIa/6+h4EtBTY88EPSmM8yVNNFCB6ryTCIb0iO36wuOFXB3ET9InsW8XKF88z6QCMhjtR6eb/gxiBHm2nMgB3Bvw/x7MVZYILbJasWNABw+JQLYY+RQXbTBMntkQfYSPUJDGxMV2/98BR4QyHDNYHp5WEjTYupRz0Vk/Vm5E6859ggmOXnKr57FiHI+uJDsffo5UUJT4CPgqB3YN+ZVqzEUfX8azG3C4Bok/w4ymEEgqO/evOBz+dSww==
    X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1306;
     25:ea4hL9LqPAAMb737vpoJoy8Gn8OG2yGFiMgu6NBezAxf36orol+xMyEj3QS51wTs2X+ZmBvUzUYQ4pUn61PfpZtR93ShtFVAtm0TGLMKsw+HbY4FELNwXjXlF1kR3ba6Z/cgVGPd3U3mAo0X0ZaHM87npYg15rxcI+fIFpxLaVEIuiflE/6+wQ8ggKWC+aMQVnXFrEViUryD1pNinXqu5PL7Ydz3zgu7hibawnvOsJjKvj4pKCiPUEhmLN4ZOI1Ars02wCk5OZIZRBkfHwFN4azP7P1MzitH83RyMZGmZg4zNUxj7adBDxfVLuxZiGDyFtK8o1Jh4OzkC8o5dgp61IWzilopNM62ChdKWMGSfa/0MtUxrzRf/o5fvTzjv4SRv4OBGvgecaX2Lzi02Frv9yp8b3SBtCmg+yUqOjwpEO1p2g3VSx4PXS7nY+vVGgBt/xNu3+ir7zul9916ZTs9vz4bATORMwNzcZKxWsyjXtA=;
     31:JHE6KMLuOB7qT7D5EsPbjijoDyDlqovOPLY00MlZGQUh5zfj5StHJnLpphTNiqEzos8Le7aT3eREwnmTe3T8davCeUaPPlvLlc8F35lGagH0EyZBEauH9uJhmamrJSt21cJvXAkz8wxIBndT8Fy84B7aZ+3gZ569vv5DXGLzA6hSxJB9UpJWOyTDWr7wNDu1stNhWVm+VE7MjuCpo1t7M0ZSa6ZxBwRStNrg0GxxSRYL0E8RsgEyZRNACqVyHHlfFre8zjWCLb0BNNUYzMRsEg==
    X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1306;
     20:wUyZeU3kyeYb9ZwIAmNP4RPyrvR1yxjI9Oz+hVL2tIHvEECJhJxGBejkP5FFE1GTS/z2z86VSUyocalx7yLU9DW053UBWZ72PsHrQny+qzvzSLeyOiwN7tLnBzLR4kBuZaeM34R0z+raEvjE12pNWd8G4sm2aDj7uAxaEQQHyNYiEGMO5UDZ86MshxfGnojlkukcJIJJ7HugAEJfoSjcdc4rkgYn0WaVP8skl3M77Dd0lCWeNqhMXSNNkNr2fz7DJgl2gLtE7Pdsi3/MsJjiO6+5VbE1osx3sI7fa3OsdJvfvYnW4Gl+gOqKasFlD82ZQur7aGzfN6hMjMp98aoTyc4SYLyW5LuryCzBWkNwKmztYkoBN9o9uhlu4iofqO5FTJNXvzSIyX88rDRObvxul5Z7Ys1OMVL41DYbvcJPdJ0TkK4ICpI8YlM2y06pWINn/oS65C3dKdff0kGSVmj0q2G3j0sgLcJ4W6NRmHc47ROssBPHSZ8PJ0uuXD93yhOG
    X-Microsoft-Antispam-PRVS: 
    X-Exchange-Antispam-Report-Test: UriScan:(56005881305849);
    X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
     RULEID:(6040450)(601004)(2401047)(5005006)(13017025)(8121501046)(13023025)(13024025)(13018025)(13015025)(10201501046)(93006095)(93003095)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(6072148);
     SRVR:CY1PR0501MB1306; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0501MB1306; 
    X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1306;
     4:uiw/UnOqxefS3TUKP5iw1+eCZiltSHsgRxs9Juy6+RLGOv32hswDR80ndq/u/Lcfs6m1tcq9HHFH61x8xxwakNrUlf5Mvq5C8esOpLS+WfUm6CDExULCQJXrb9/dogfZQ5SY+KdLIHJ9W7b2IWVezT+kU1LrSswgygFGPb/xtbbmYyMupAmY7izuA94gdQolJOBX5vUl4GAtJQk6KvXq5fzqvzmDX29/jny6V4sJUru2IEtu3qfhXUWbdhuG6XvuAsxrON+QCt/VLdR4D14UdyIs8ACjXxEmO3X4PGFSyASNsUBRYuBTsCdbHRZhO1S2Xc+rkWkIgfP+slC0w3xYmytWN8bOq5MT6VbYwhTGW4GAix6i38xrW1IlvUW7gxmL5M941ocdHF5pJZsci5hwhkLVCoZYUtz1JLiT08WbO6OVOlxwXLjxyh4RJxQ41jSknh5sd+ZIsG5CIMHKNXouiI/LopmqpI8ZiI1GmkhMVGMQjL/vbtxHBVkdGc+5AVMhFvPffIEyczFw3D7i/kqcmDHhgMhC9Ocu4r4dGuOqem1Ky1pwDM1kPRDMrv1B8Ggt1sDQ61nXVIbQpFjbSyX50GfbcZZkG2pHbYL8Ef7tBwz+LoRjAvY6H4OljAIL/2Z8YYrEgVi666sMiyPBYXm3oDkYhMSJIrSZhjmURlQzEyCbtGUKpqmuNcECw+cq8UwahzQYs+cZ4C2MN2G8jI2JBPPBhqe++KLDUwlpz3CXHcCkQtv32mvqmockc3gHtR6My6gmlhjAr5q2jxaPrB4yXVwvlM1PjK8EQ/7okKIL1eRflnHTDbbWh2v8gRS0Hu620AyXM7j/F8+jWjPPZfWfUcyyuu9VnhPrDRgD7MKXtoNmas41KI/8Y0gum2LICfnbolSU+AR1D9fnwSxkAlZ4CQ5gLJVXelX6woauVA8mJ5SUoF0JXDeuBVI2KBpzLOHD
    X-Forefront-PRVS: 0310C78181
    X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0501MB1306;
     23:O+pilDO5gkiyxdtsHYgMIHg+88D3mitwS6StjHU?=
     =?us-ascii?Q?BXufs7xfs/u1fGRXptGkCE2SjQAF+JJjAbRlfAELtzNm9JfUgK+W59GTYg9O?=
     =?us-ascii?Q?WMacSePHLmvDSNJRJDlirPjGGU6ixnw+BDrI8agvhricOgYxNb4ghuGASRZA?=
     =?us-ascii?Q?+jtz6H9wiQZPFC7u1uyXR8iQxlmWA2P8dL9vay3UsyLzWrLO6A0xVf2SmVyg?=
     =?us-ascii?Q?67f4XOyl7Gomxz7lx6c6JcDWksbGcdosbgAqvQoE7FKn0+6utuACmckUmXbt?=
     =?us-ascii?Q?sU4krj7fxEuNjFj4/CmRsGCIP7E3fM0/mehLWJHVMd9g7DxZrH5B89cBmPsG?=
     =?us-ascii?Q?KFX9fcpoQtYQynyM0luBfytnf5qPRI4WB+9IKPR6tZDU84qo2Nv7TvRI2lBH?=
     =?us-ascii?Q?DK/E+4p9MJFKy8WG2c+isVwPOxVJ6RL6nB5p/EIbpv8Hiq2S1JC3/CeFZ3iA?=
     =?us-ascii?Q?IX2Kp/FByIKcwRHNllPVv1Ly8TkligfVOAEV+PGKIDkjYHs1jEukrsH8uD30?=
     =?us-ascii?Q?0+chfTOFYEhyWmAk9tr1zWAOqhSeRLyE4J/3DDQ6IujTYY6lGazGHvHVOgBQ?=
     =?us-ascii?Q?Q7g81KdlqC4Kgj3kNMGkOULzkgAw/nUupEC0VdMYjrpqJnMWWYvzLCcxX6mi?=
     =?us-ascii?Q?AGMWkYOh1+Lv7aymqAXImriTkvROm5erSqp6F70lervN1AbX/0Khf5w27Osr?=
     =?us-ascii?Q?nccJJaQa4A4sSHfKw8uGbPALndFCL25oHwJ0x3C4F8Ei+YxVsNzKS7vj7twl?=
     =?us-ascii?Q?HXRF+ZPT6j//qnV/IFBLXfYaEhZw0WSlphUU//Cfl+qlkK+YVY0A16mL6kGR?=
     =?us-ascii?Q?XlaI1jjAIo4jkV1KfIQfFrr9DJT7kuBxHKF8WJeuR9oumBpfmu5wTObD2+oZ?=
     =?us-ascii?Q?BKxPooEGkM1T/6MPBJmpMU6GsRFjia0vAFSGRAFTpK+sKqmExIU/bDA1voId?=
     =?us-ascii?Q?m3ZVnovztb/obGdvSiatBBbLte5Acla8PX+VUHAQuZkp/j8Vdj68HmR/MRXo?=
     =?us-ascii?Q?TeeWErq+lojiMOv8FOKjmspqDW4mB1g8fll24yFV0S2pEBxVBjlNUdFPkQPN?=
     =?us-ascii?Q?GS43PUo5NRJJOw7cTkexwPuonVOJuttJUfxIv/Z6Tb4f/w5rFdkZp7HdmXz6?=
     =?us-ascii?Q?KbmMKfm8cEcqyHGB6q80likPp9Y22IgP7L0atdl7wQLECn1AoIvBgP/S2ZwT?=
     =?us-ascii?Q?SPK2QG2Zu427FPyK8EhUEVbUH16xevYo5lRv+Syy0rdRQa5THH3Cf4sfvkQ?=
     =?us-ascii?Q?=3D=3D?=
    X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1306;
     6:zQRACGzaunwzImwotO336gwz2nmqAiVn0wGUTUcrNxuPuV0VvE5PO0BzqzRvKnyTXsl1g3sFgmpyxDe3AgiCUAN1xmgwOfaR9OFISAow0hhQ82VyA1Xgj5YVCglnuuB1xblXXN4FmRGlZXCbYh2RZOYyScVK1he0+UMS2JG0Gwb6r0hwdA7jXQ07fkreJWHfmtybzpC7+RfbE/4dywFPYJ42jJSEdqLmZpGFvu1cC/2N+UB25fRspCf/rAHY81k8qaWqExMa0w9yfNBrxmffvUC99QQ3yXQCZcb/ac2DwRCrikR1xZHlHYinzKE5Sn305yZnuSZ+8XWLdDzdoHnRfnIWbuGjVZZpeeZ4LCa7bAnJIzXOLxsgaikPQtJLBV6CBKpyoDK6lj+1IPF3VY2uzF8avbMUkKHszBcvWK4/1/LQnZkRJTuwOcl2kqA+uFc1Z6rJnF3yCqLHncHSeAuRnnBJ23Ne6rdPRtm63MveCbjIdK+QV+NONBCJIFZCb+pLWKiwhQxyNo0uR9TN7Q5qp5Lk5z0+vYT3lM+zgQy7u80=;
     5:Oq2/gBUFFUlHgGee+NrTeoq8pQL/xbxVpdoR0KrxBIA+JOy2tjTYmvDWvNhaQA8GPRrh+TIxxwb633bqtxpag8xtGBHZCtpUzAlHaT5dFgUdnSiIA6w4QXSWnw1Zgdf6z3bbG0cEp3WZUbun+2OQ9w==;
     24:7nkn2aEcVgd4h6Z5s9qF+EWQJVzRARu7jdQg5bGjXBiTgbGkJToN9uY7rfQEwAe2y4gMTmyQRRqbXGWdHqEPI1vrxpexnPMm95JBSsOR3PM=
    SpamDiagnosticOutput: 1:99
    SpamDiagnosticMetadata: NSPM
    X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1306;
     7:EKR9tG8hHth2YSfuNC7XnuHL9hJWUxr20UEcqJsQYFTwt7ka9U02RX+qa9MYfaNwgtCoUMQYxD069DCuc35/CKdq1ztF6McrO8RLEkClGgmj6GbSwuBs+ykJHqN7MMUdpfuIm0nmyT5OXJUuDIq9N24RAXpSMcFMJrhyWNPCL8nt6EvOkj/EN/zn/1VGzNCOx8TsdKwwCaVAjbwASdwnV57nq7GevGOrN+zeBC1iucZbxWAUVXExxxBFQVtPdU1WGmCS3PLAYqAomtYiLj6uTArCQMGVLeF12Aa94Nh0jwkSk+XlcXMYiUBz6i4gIm43Ic/RJnmxWpFq1dRzTGEZ/A==
    X-OriginatorOrg: juniper.net
    X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2017 01:17:55.7153 (UTC)
    X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4
    X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12];
     Helo=[p-emfe01a-sac.jnpr.net]
    X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
    X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1306
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 17 May 2017 01:17:58 -0000
    
    "Ngie Cooper (yaneurabeya)" writes:
    >> URL: https://svnweb.freebsd.org/changeset/base/318364
    >Relnotes: yes
    >Also, what does this upgrade entail, in terms of new features/risk?
    
    It's all documentation and minor fixes (213478, 204651).  There is
    also a fix for using "int"s to keep buffer offsets (#55 on github).
    No user-visible changes.
    
    Thanks,
     Phil
    
    From owner-svn-src-head@freebsd.org  Wed May 17 04:32:48 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D416D70D5E;
     Wed, 17 May 2017 04:32:48 +0000 (UTC)
     (envelope-from melounmichal@gmail.com)
    Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com
     [IPv6:2a00:1450:400c:c09::244])
     (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 C690F1738;
     Wed, 17 May 2017 04:32:47 +0000 (UTC)
     (envelope-from melounmichal@gmail.com)
    Received: by mail-wm0-x244.google.com with SMTP id v4so685386wmb.2;
     Tue, 16 May 2017 21:32:47 -0700 (PDT)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
     h=from:reply-to:subject:to:references:message-id:date:user-agent
     :mime-version:in-reply-to:content-language:content-transfer-encoding;
     bh=ZENQJIlgHoB2u6+W8TE+cBpqarNK+KU8/4M0GBa7bu8=;
     b=pMiLyn5nrSVK8FMyIOf1EF14NmYfCl+Dmhi1sqFyqMR3CnYT/jgOI5otBp+0n/ceQM
     ronz+4FVUX7UZHjnQ+My0Mc6w+ZFXiTLksR1kqqwgz47BLHpQ22WKD/Teyia60upZT83
     cDI68hOBQDfT5+JLOaZpk6JJU3H3tnLqgBBHP3tUVOBjy9v4bGftXtzpOlTKSHXK3M/O
     eDr+QiwCY5TIY+ENoGU8aBdEjCK/DDUeiirZCrpILZ9UDsiCzAYytYn59FjHUoOeIyls
     wCjP9Yq/iIGXTnN/RQxlJyWePpVaaZ7YDrBFXMjiLLFIgle9FcgZCwMxWsxRuGVGFsdq
     l2LQ==
    X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
     d=1e100.net; s=20161025;
     h=x-gm-message-state:from:reply-to:subject:to:references:message-id
     :date:user-agent:mime-version:in-reply-to:content-language
     :content-transfer-encoding;
     bh=ZENQJIlgHoB2u6+W8TE+cBpqarNK+KU8/4M0GBa7bu8=;
     b=RF3W3o0Y9ysnmHPv6hnLHPgW63f3CLHjgtOToKjZk2/iXcgc+9PB38eu/OP1fYGARX
     gdEHKd5eiLmInKBHmfokl3jvxYVQP6MuROoNv6RoOu/K/6NCrgbvi5SM9lNGtiig+En2
     e56LyQfXuB5IRG82G53bM6X/tbc6Xpyn6cRZq38oyM91M7+O3BEJzwOxMn6fZBrsjL7I
     Iwil2LIELDID1NPdenToz1r5XOZZTrHWMtanUB17yGmZAWLPN68w123i86aXG6FJnIjN
     KXpqA78VmQRLa23vbSm5nZm1CeOQp3s8hUIAeN7TRTo7SRyoWyTFjyIhu32+EuHUONoy
     MJww==
    X-Gm-Message-State: AODbwcB5uan31rZheSM5juqPHc7K/4qbCbUD5aCUQUR02i5UPDF8IuQc
     znBYk6/L/pggZMwbzKE=
    X-Received: by 10.28.154.86 with SMTP id c83mr9605806wme.94.1494995565761;
     Tue, 16 May 2017 21:32:45 -0700 (PDT)
    Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100])
     by smtp.gmail.com with ESMTPSA id j126sm1538374wmd.29.2017.05.16.21.32.44
     (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
     Tue, 16 May 2017 21:32:45 -0700 (PDT)
    From: Michal Meloun 
    X-Google-Original-From: Michal Meloun 
    Reply-To: mmel@freebsd.org
    Subject: Re: svn commit: r318336 - head/sys/arm/mv
    To: Luiz Otavio O Souza , src-committers@freebsd.org,
     svn-src-all@freebsd.org, svn-src-head@freebsd.org
    References: <201705160447.v4G4lpJd018173@repo.freebsd.org>
    Message-ID: 
    Date: Wed, 17 May 2017 06:32:48 +0200
    User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
     Thunderbird/52.1.0
    MIME-Version: 1.0
    In-Reply-To: <201705160447.v4G4lpJd018173@repo.freebsd.org>
    Content-Type: text/plain; charset=utf-8
    Content-Language: en-US
    Content-Transfer-Encoding: 7bit
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 17 May 2017 04:32:48 -0000
    
    
    
    On 16.05.2017 6:47, Luiz Otavio O Souza wrote:
    > Author: loos
    > Date: Tue May 16 04:47:50 2017
    > New Revision: 318336
    > URL: https://svnweb.freebsd.org/changeset/base/318336
    > 
    > Log:
    >   Add the SDHCI Address Decoder registers and routines for ARMADA 38X.
    >   
    >   Tested on:	ClearFog Pro
    >   Reviewed by:	Marcin Wojtas 
    >   Sponsored by:	Rubicon Communications, LLC (Netgate)
    >   Differential Revision:	https://reviews.freebsd.org/D10601
    > 
    This commit breaks many of ARMv6 kernels. ARMADAXP, DB-78XXX,
    DB-88F5XXX, DB-88F6XXX, TS7800, LINT.
    
    Michal
    
    
    > Modified:
    >   head/sys/arm/mv/mv_common.c
    >   head/sys/arm/mv/mvwin.h
    > 
    > Modified: head/sys/arm/mv/mv_common.c
    > ==============================================================================
    > --- head/sys/arm/mv/mv_common.c	Tue May 16 03:31:49 2017	(r318335)
    > +++ head/sys/arm/mv/mv_common.c	Tue May 16 04:47:50 2017	(r318336)
    > @@ -82,6 +82,7 @@ static int decode_win_usb3_valid(void);
    >  static int decode_win_eth_valid(void);
    >  static int decode_win_pcie_valid(void);
    >  static int decode_win_sata_valid(void);
    > +static int decode_win_sdhci_valid(void);
    >  
    >  static int decode_win_idma_valid(void);
    >  static int decode_win_xor_valid(void);
    > @@ -95,6 +96,7 @@ static void decode_win_usb3_setup(u_long
    >  static void decode_win_eth_setup(u_long);
    >  static void decode_win_sata_setup(u_long);
    >  static void decode_win_ahci_setup(u_long);
    > +static void decode_win_sdhci_setup(u_long);
    >  
    >  static void decode_win_idma_setup(u_long);
    >  static void decode_win_xor_setup(u_long);
    > @@ -105,6 +107,7 @@ static void decode_win_eth_dump(u_long b
    >  static void decode_win_idma_dump(u_long base);
    >  static void decode_win_xor_dump(u_long base);
    >  static void decode_win_ahci_dump(u_long base);
    > +static void decode_win_sdhci_dump(u_long);
    >  
    >  static int fdt_get_ranges(const char *, void *, int, int *, int *);
    >  #ifdef SOC_MV_ARMADA38X
    > @@ -138,6 +141,7 @@ static struct soc_node_spec soc_nodes[] 
    >  	{ "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump },
    >  	{ "marvell,armada-380-xhci", &decode_win_usb3_setup, &decode_win_usb3_dump },
    >  	{ "marvell,armada-380-ahci", &decode_win_ahci_setup, &decode_win_ahci_dump },
    > +	{ "marvell,armada-380-sdhci", &decode_win_sdhci_setup, &decode_win_sdhci_dump },
    >  	{ "mrvl,sata", &decode_win_sata_setup, NULL },
    >  	{ "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump },
    >  	{ "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump },
    > @@ -568,7 +572,8 @@ soc_decode_win(void)
    >  	if (!decode_win_cpu_valid() || !decode_win_usb_valid() ||
    >  	    !decode_win_eth_valid() || !decode_win_idma_valid() ||
    >  	    !decode_win_pcie_valid() || !decode_win_sata_valid() ||
    > -	    !decode_win_xor_valid() || !decode_win_usb3_valid())
    > +	    !decode_win_xor_valid() || !decode_win_usb3_valid() ||
    > +	    !decode_win_sdhci_valid())
    >  		return (EINVAL);
    >  
    >  	decode_win_cpu_setup();
    > @@ -659,6 +664,11 @@ WIN_REG_BASE_IDX_RD(win_sata, sz, MV_WIN
    >  WIN_REG_BASE_IDX_WR(win_sata, sz, MV_WIN_SATA_SIZE);
    >  #endif
    >  
    > +WIN_REG_BASE_IDX_RD(win_sdhci, cr, MV_WIN_SDHCI_CTRL);
    > +WIN_REG_BASE_IDX_RD(win_sdhci, br, MV_WIN_SDHCI_BASE);
    > +WIN_REG_BASE_IDX_WR(win_sdhci, cr, MV_WIN_SDHCI_CTRL);
    > +WIN_REG_BASE_IDX_WR(win_sdhci, br, MV_WIN_SDHCI_BASE);
    > +
    >  #ifndef SOC_MV_DOVE
    >  WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE)
    >  WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE)
    > @@ -2073,6 +2083,60 @@ decode_win_sata_valid(void)
    >  	return (decode_win_can_cover_ddr(MV_WIN_SATA_MAX));
    >  }
    >  
    > +static void
    > +decode_win_sdhci_setup(u_long base)
    > +{
    > +	uint32_t cr, br;
    > +	int i, j;
    > +
    > +	for (i = 0; i < MV_WIN_SDHCI_MAX; i++) {
    > +		win_sdhci_cr_write(base, i, 0);
    > +		win_sdhci_br_write(base, i, 0);
    > +	}
    > +
    > +	for (i = 0; i < MV_WIN_DDR_MAX; i++)
    > +		if (ddr_is_active(i)) {
    > +			br = ddr_base(i);
    > +			cr = (((ddr_size(i) - 1) &
    > +			    (IO_WIN_SIZE_MASK << IO_WIN_SIZE_SHIFT)) |
    > +			    (ddr_attr(i) << IO_WIN_ATTR_SHIFT) |
    > +			    (ddr_target(i) << IO_WIN_TGT_SHIFT) |
    > +			    IO_WIN_ENA_MASK);
    > +
    > +			/* Use the first available SDHCI window */
    > +			for (j = 0; j < MV_WIN_SDHCI_MAX; j++) {
    > +				if (win_sdhci_cr_read(base, j) & IO_WIN_ENA_MASK)
    > +					continue;
    > +
    > +				win_sdhci_cr_write(base, j, cr);
    > +				win_sdhci_br_write(base, j, br);
    > +				break;
    > +			}
    > +		}
    > +}
    > +
    > +static void
    > +decode_win_sdhci_dump(u_long base)
    > +{
    > +	int i;
    > +
    > +	for (i = 0; i < MV_WIN_SDHCI_MAX; i++)
    > +		printf("SDHCI window#%d: c 0x%08x, b 0x%08x\n", i,
    > +		    win_sdhci_cr_read(base, i), win_sdhci_br_read(base, i));
    > +}
    > +
    > +static int
    > +decode_win_sdhci_valid(void)
    > +{
    > +
    > +#ifdef SOC_MV_ARMADA38X
    > +	return (decode_win_can_cover_ddr(MV_WIN_SDHCI_MAX));
    > +#endif
    > +
    > +	/* Satisfy platforms not equipped with this controller. */
    > +	return (1);
    > +}
    > +
    >  /**************************************************************************
    >   * FDT parsing routines.
    >   **************************************************************************/
    > 
    > Modified: head/sys/arm/mv/mvwin.h
    > ==============================================================================
    > --- head/sys/arm/mv/mvwin.h	Tue May 16 03:31:49 2017	(r318335)
    > +++ head/sys/arm/mv/mvwin.h	Tue May 16 04:47:50 2017	(r318336)
    > @@ -296,6 +296,10 @@
    >  #define	MV_WIN_SATA_MAX			4
    >  #endif
    >  
    > +#define	MV_WIN_SDHCI_CTRL(n)		(0x8 * (n) + 0x4080)
    > +#define	MV_WIN_SDHCI_BASE(n)		(0x8 * (n) + 0x4084)
    > +#define	MV_WIN_SDHCI_MAX		8
    > +
    >  #if defined(SOC_MV_ARMADA38X)
    >  #define	MV_BOOTROM_MEM_ADDR	0xFFF00000
    >  #define	MV_BOOTROM_WIN_SIZE	0xF
    > 
    
    From owner-svn-src-head@freebsd.org  Wed May 17 08:38:42 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id D44A9D71AC2;
     Wed, 17 May 2017 08:38:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9B7EC251;
     Wed, 17 May 2017 08:38:42 +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 v4H8cf0a019574;
     Wed, 17 May 2017 08:38:41 GMT (envelope-from trasz@FreeBSD.org)
    Received: (from trasz@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4H8cfZU019573;
     Wed, 17 May 2017 08:38:41 GMT (envelope-from trasz@FreeBSD.org)
    Message-Id: <201705170838.v4H8cfZU019573@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: trasz set sender to
     trasz@FreeBSD.org using -f
    From: Edward Tomasz Napierala 
    Date: Wed, 17 May 2017 08:38:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318398 - head/sys/amd64/include
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 08:38:42 -0000
    
    Author: trasz
    Date: Wed May 17 08:38:41 2017
    New Revision: 318398
    URL: https://svnweb.freebsd.org/changeset/base/318398
    
    Log:
      Bump default MAXTSIZ (kern.maxtsiz) from 128MB to 32GB. The old limit
      prevents one from running eg clang built with debug; the new one is
      arbitrary (equal to MAXDSIZ) and... well, should be quite future-proof.
      
      Same fix might be applicable to other 64 bit architectures; I'll ask
      their respective maintainers to make sure it won't break anything.
      
      Reviewed by:	kib
      MFC after:	2 weeks
      Sponsored by:	DARPA, AFRL
      Differential Revision:	https://reviews.freebsd.org/D10758
    
    Modified:
      head/sys/amd64/include/vmparam.h
    
    Modified: head/sys/amd64/include/vmparam.h
    ==============================================================================
    --- head/sys/amd64/include/vmparam.h	Wed May 17 05:53:25 2017	(r318397)
    +++ head/sys/amd64/include/vmparam.h	Wed May 17 08:38:41 2017	(r318398)
    @@ -52,7 +52,7 @@
     /*
      * Virtual memory related constants, all in bytes
      */
    -#define	MAXTSIZ		(128UL*1024*1024)	/* max text size */
    +#define	MAXTSIZ		(32768UL*1024*1024)	/* max text size */
     #ifndef DFLDSIZ
     #define	DFLDSIZ		(32768UL*1024*1024)	/* initial data size limit */
     #endif
    
    From owner-svn-src-head@freebsd.org  Wed May 17 09:04:10 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B3FDD703B9;
     Wed, 17 May 2017 09:04:10 +0000 (UTC) (envelope-from ae@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 3D55212CF;
     Wed, 17 May 2017 09:04:10 +0000 (UTC) (envelope-from ae@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4H949jF032896;
     Wed, 17 May 2017 09:04:09 GMT (envelope-from ae@FreeBSD.org)
    Received: (from ae@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4H949lY032895;
     Wed, 17 May 2017 09:04:09 GMT (envelope-from ae@FreeBSD.org)
    Message-Id: <201705170904.v4H949lY032895@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
     using -f
    From: "Andrey V. Elsukov" 
    Date: Wed, 17 May 2017 09:04:09 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318399 - head/sys/netinet
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 09:04:10 -0000
    
    Author: ae
    Date: Wed May 17 09:04:09 2017
    New Revision: 318399
    URL: https://svnweb.freebsd.org/changeset/base/318399
    
    Log:
      Set M_BCAST and M_MCAST flags on mbuf sent via divert socket.
      
      r290383 has changed how mbufs sent by divert socket are handled.
      Previously they are always handled by slow path processing in ip_input().
      Now ip_tryforward() is invoked from ip_input() before in_broadcast() check.
      Since diverted packet lost all mbuf flags, it passes the broadcast check
      in ip_tryforward() due to missing M_BCAST flag. In the result the broadcast
      packet is forwarded to the wire instead of be consumed by network stack.
      
      Add in_broadcast() check to the div_output() function. And restore the
      M_BCAST flag if destination address is broadcast for the given network
      interface.
      
      PR:		209491
      MFC after:	1 week
    
    Modified:
      head/sys/netinet/ip_divert.c
    
    Modified: head/sys/netinet/ip_divert.c
    ==============================================================================
    --- head/sys/netinet/ip_divert.c	Wed May 17 08:38:41 2017	(r318398)
    +++ head/sys/netinet/ip_divert.c	Wed May 17 09:04:09 2017	(r318399)
    @@ -481,6 +481,14 @@ div_output(struct socket *so, struct mbu
     		/* Send packet to input processing via netisr */
     		switch (ip->ip_v) {
     		case IPVERSION:
    +			/*
    +			 * Restore M_BCAST flag when destination address is
    +			 * broadcast. It is expected by ip_tryforward().
    +			 */
    +			if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)))
    +				m->m_flags |= M_MCAST;
    +			else if (in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif))
    +				m->m_flags |= M_BCAST;
     			netisr_queue_src(NETISR_IP, (uintptr_t)so, m);
     			break;
     #ifdef INET6
    
    From owner-svn-src-head@freebsd.org  Wed May 17 10:56:23 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2F9BD71349;
     Wed, 17 May 2017 10:56:23 +0000 (UTC) (envelope-from ae@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id A53BFE14;
     Wed, 17 May 2017 10:56:23 +0000 (UTC) (envelope-from ae@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HAuMjg078813;
     Wed, 17 May 2017 10:56:22 GMT (envelope-from ae@FreeBSD.org)
    Received: (from ae@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HAuMOV078812;
     Wed, 17 May 2017 10:56:22 GMT (envelope-from ae@FreeBSD.org)
    Message-Id: <201705171056.v4HAuMOV078812@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
     using -f
    From: "Andrey V. Elsukov" 
    Date: Wed, 17 May 2017 10:56:22 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318400 - head/sbin/ipfw
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 10:56:23 -0000
    
    Author: ae
    Date: Wed May 17 10:56:22 2017
    New Revision: 318400
    URL: https://svnweb.freebsd.org/changeset/base/318400
    
    Log:
      Allow zero port specification in table entries with type flow.
      
      PR:		217620
      MFC after:	1 week
    
    Modified:
      head/sbin/ipfw/tables.c
    
    Modified: head/sbin/ipfw/tables.c
    ==============================================================================
    --- head/sbin/ipfw/tables.c	Wed May 17 09:04:09 2017	(r318399)
    +++ head/sbin/ipfw/tables.c	Wed May 17 10:56:22 2017	(r318400)
    @@ -1260,16 +1260,14 @@ tentry_fill_key_type(char *arg, ipfw_obj
     			if ((p = strchr(arg, ',')) != NULL)
     				*p++ = '\0';
     
    -			if ((port = htons(strtol(arg, NULL, 10))) == 0) {
    +			port = htons(strtol(arg, &pp, 10));
    +			if (*pp != '\0') {
     				if ((sent = getservbyname(arg, NULL)) == NULL)
     					errx(EX_DATAERR, "Unknown service: %s",
     					    arg);
    -				else
    -					key = sent->s_port;
    +				port = sent->s_port;
     			}
    -			
     			tfe->sport = port;
    -
     			arg = p;
     		}
     
    @@ -1304,16 +1302,14 @@ tentry_fill_key_type(char *arg, ipfw_obj
     			if ((p = strchr(arg, ',')) != NULL)
     				*p++ = '\0';
     
    -			if ((port = htons(strtol(arg, NULL, 10))) == 0) {
    +			port = htons(strtol(arg, &pp, 10));
    +			if (*pp != '\0') {
     				if ((sent = getservbyname(arg, NULL)) == NULL)
     					errx(EX_DATAERR, "Unknown service: %s",
     					    arg);
    -				else
    -					key = sent->s_port;
    +				port = sent->s_port;
     			}
    -			
     			tfe->dport = port;
    -
     			arg = p;
     		}
     
    
    From owner-svn-src-head@freebsd.org  Wed May 17 13:22:14 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7796D70B41;
     Wed, 17 May 2017 13:22:14 +0000 (UTC)
     (envelope-from jpaetzel@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 B4A12155;
     Wed, 17 May 2017 13:22:14 +0000 (UTC)
     (envelope-from jpaetzel@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HDMDtL039016;
     Wed, 17 May 2017 13:22:13 GMT (envelope-from jpaetzel@FreeBSD.org)
    Received: (from jpaetzel@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HDMDCx039015;
     Wed, 17 May 2017 13:22:13 GMT (envelope-from jpaetzel@FreeBSD.org)
    Message-Id: <201705171322.v4HDMDCx039015@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to
     jpaetzel@FreeBSD.org using -f
    From: Josh Paetzel 
    Date: Wed, 17 May 2017 13:22:13 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318401 - head/sys/dev/tws
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 13:22:15 -0000
    
    Author: jpaetzel
    Date: Wed May 17 13:22:13 2017
    New Revision: 318401
    URL: https://svnweb.freebsd.org/changeset/base/318401
    
    Log:
      Increase the number of LUNs this hardware can support.
      
      Experimentally we know this value works, but the hardware
      may support an even higher value.
      
      PR:	213876
      Reported by:	J.Catrysse@proximedia.be
      MFC after:	1 week
    
    Modified:
      head/sys/dev/tws/tws.h
    
    Modified: head/sys/dev/tws/tws.h
    ==============================================================================
    --- head/sys/dev/tws/tws.h	Wed May 17 10:56:22 2017	(r318400)
    +++ head/sys/dev/tws/tws.h	Wed May 17 13:22:13 2017	(r318401)
    @@ -67,7 +67,7 @@ extern int tws_queue_depth;
     
     #define TWS_DRIVER_VERSION_STRING "10.80.00.005"
     #define TWS_MAX_NUM_UNITS             65 
    -#define TWS_MAX_NUM_LUNS              16
    +#define TWS_MAX_NUM_LUNS              32
     #define TWS_MAX_IRQS                  2
     #define TWS_SCSI_INITIATOR_ID         66
     #define TWS_MAX_IO_SIZE               0x20000 /* 128kB */
    
    From owner-svn-src-head@freebsd.org  Wed May 17 15:13:02 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB64CD5CA65;
     Wed, 17 May 2017 15:13:02 +0000 (UTC)
     (envelope-from loos@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 78570266;
     Wed, 17 May 2017 15:13:02 +0000 (UTC)
     (envelope-from loos@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HFD16E084703;
     Wed, 17 May 2017 15:13:01 GMT (envelope-from loos@FreeBSD.org)
    Received: (from loos@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HFD1A3084702;
     Wed, 17 May 2017 15:13:01 GMT (envelope-from loos@FreeBSD.org)
    Message-Id: <201705171513.v4HFD1A3084702@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: loos set sender to
     loos@FreeBSD.org using -f
    From: Luiz Otavio O Souza 
    Date: Wed, 17 May 2017 15:13:01 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318404 - head/sys/arm/mv
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 15:13:02 -0000
    
    Author: loos
    Date: Wed May 17 15:13:01 2017
    New Revision: 318404
    URL: https://svnweb.freebsd.org/changeset/base/318404
    
    Log:
      Move the IO Window Control Register defines out of the ARMADA38X ifdef.
      
      Fixes the build of Marvell kernels (other than ARMADA38X) after r318336.
      
      Reported by:	mmel
    
    Modified:
      head/sys/arm/mv/mvwin.h
    
    Modified: head/sys/arm/mv/mvwin.h
    ==============================================================================
    --- head/sys/arm/mv/mvwin.h	Wed May 17 14:35:21 2017	(r318403)
    +++ head/sys/arm/mv/mvwin.h	Wed May 17 15:13:01 2017	(r318404)
    @@ -305,18 +305,6 @@
     #define	MV_BOOTROM_WIN_SIZE	0xF
     #define	MV_CPU_SUBSYS_REGS_LEN	0x100
     
    -/* IO Window Control Register fields */
    -#define	IO_WIN_SIZE_SHIFT	16
    -#define	IO_WIN_SIZE_MASK	0xFFFF
    -#define	IO_WIN_ATTR_SHIFT	8
    -#define	IO_WIN_ATTR_MASK	0xFF
    -#define	IO_WIN_TGT_SHIFT	4
    -#define	IO_WIN_TGT_MASK		0xF
    -#define	IO_WIN_SYNC_SHIFT	1
    -#define	IO_WIN_SYNC_MASK	0x1
    -#define	IO_WIN_ENA_SHIFT	0
    -#define	IO_WIN_ENA_MASK		0x1
    -
     #define	IO_WIN_9_CTRL_OFFSET	0x98
     #define	IO_WIN_9_BASE_OFFSET	0x9C
     
    @@ -329,6 +317,18 @@
     #define	MV_SYNC_BARRIER_CTRL_ALL	0xFFFF
     #endif
     
    +/* IO Window Control Register fields */
    +#define	IO_WIN_SIZE_SHIFT	16
    +#define	IO_WIN_SIZE_MASK	0xFFFF
    +#define	IO_WIN_ATTR_SHIFT	8
    +#define	IO_WIN_ATTR_MASK	0xFF
    +#define	IO_WIN_TGT_SHIFT	4
    +#define	IO_WIN_TGT_MASK		0xF
    +#define	IO_WIN_SYNC_SHIFT	1
    +#define	IO_WIN_SYNC_MASK	0x1
    +#define	IO_WIN_ENA_SHIFT	0
    +#define	IO_WIN_ENA_MASK		0x1
    +
     #define WIN_REG_IDX_RD(pre,reg,off,base)					\
     	static __inline uint32_t						\
     	pre ## _ ## reg ## _read(int i)						\
    
    From owner-svn-src-head@freebsd.org  Wed May 17 15:52:06 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 502F2D7060A;
     Wed, 17 May 2017 15:52:06 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 BCFAA1A20;
     Wed, 17 May 2017 15:52:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HFq4BR098954;
     Wed, 17 May 2017 15:52:04 GMT (envelope-from zbb@FreeBSD.org)
    Received: (from zbb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HFq4AI098952;
     Wed, 17 May 2017 15:52:04 GMT (envelope-from zbb@FreeBSD.org)
    Message-Id: <201705171552.v4HFq4AI098952@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org
     using -f
    From: Zbigniew Bodek 
    Date: Wed, 17 May 2017 15:52:04 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318405 - head/sys/arm/mv
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 15:52:06 -0000
    
    Author: zbb
    Date: Wed May 17 15:52:04 2017
    New Revision: 318405
    URL: https://svnweb.freebsd.org/changeset/base/318405
    
    Log:
      Fix USB3.0 decoding windows on Armada38x
      
      Set correct offset for MBUS windows configuration in
      USB3.0 interface.
      
      Submitted by: Marcin Wojtas 
      Obtained from: Semihalf
      Sponsored by: Stormshield
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10721
    
    Modified:
      head/sys/arm/mv/mvwin.h
    
    Modified: head/sys/arm/mv/mvwin.h
    ==============================================================================
    --- head/sys/arm/mv/mvwin.h	Wed May 17 15:13:01 2017	(r318404)
    +++ head/sys/arm/mv/mvwin.h	Wed May 17 15:52:04 2017	(r318405)
    @@ -220,8 +220,8 @@
     #define MV_WIN_USB_BASE(n)		(0x10 * (n) + 0x324)
     #define MV_WIN_USB_MAX			4
     
    -#define	MV_WIN_USB3_CTRL(n)		(0x8 * (n))
    -#define	MV_WIN_USB3_BASE(n)		(0x8 * (n) + 0x4)
    +#define	MV_WIN_USB3_CTRL(n)		(0x8 * (n) + 0x4000)
    +#define	MV_WIN_USB3_BASE(n)		(0x8 * (n) + 0x4004)
     #define	MV_WIN_USB3_MAX			8
     
     #define MV_WIN_ETH_BASE(n)		(0x8 * (n) + 0x200)
    
    From owner-svn-src-head@freebsd.org  Wed May 17 15:53:15 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23214D707D7;
     Wed, 17 May 2017 15:53:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 E7D951C18;
     Wed, 17 May 2017 15:53:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HFrDNx001243;
     Wed, 17 May 2017 15:53:13 GMT (envelope-from zbb@FreeBSD.org)
    Received: (from zbb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HFrDU9001242;
     Wed, 17 May 2017 15:53:13 GMT (envelope-from zbb@FreeBSD.org)
    Message-Id: <201705171553.v4HFrDU9001242@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org
     using -f
    From: Zbigniew Bodek 
    Date: Wed, 17 May 2017 15:53:13 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318406 - head/sys/arm/mv
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 15:53:15 -0000
    
    Author: zbb
    Date: Wed May 17 15:53:13 2017
    New Revision: 318406
    URL: https://svnweb.freebsd.org/changeset/base/318406
    
    Log:
      Parse EHCI windows on Marvell platforms
      
      Add missing compatibility string to allow proper
      window configuration for EHCI devices.
      
      Submitted by: Wojciech Macek 
      Obtained from: Semihalf
      Sponsored by: Stormshield
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10722
    
    Modified:
      head/sys/arm/mv/mv_common.c
    
    Modified: head/sys/arm/mv/mv_common.c
    ==============================================================================
    --- head/sys/arm/mv/mv_common.c	Wed May 17 15:52:04 2017	(r318405)
    +++ head/sys/arm/mv/mv_common.c	Wed May 17 15:53:13 2017	(r318406)
    @@ -139,6 +139,7 @@ struct soc_node_spec {
     static struct soc_node_spec soc_nodes[] = {
     	{ "mrvl,ge", &decode_win_eth_setup, &decode_win_eth_dump },
     	{ "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump },
    +	{ "marvell,orion-ehci", &decode_win_usb_setup, &decode_win_usb_dump },
     	{ "marvell,armada-380-xhci", &decode_win_usb3_setup, &decode_win_usb3_dump },
     	{ "marvell,armada-380-ahci", &decode_win_ahci_setup, &decode_win_ahci_dump },
     	{ "marvell,armada-380-sdhci", &decode_win_sdhci_setup, &decode_win_sdhci_dump },
    
    From owner-svn-src-head@freebsd.org  Wed May 17 15:54:34 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 759D0D7085C;
     Wed, 17 May 2017 15:54:34 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 47D121D98;
     Wed, 17 May 2017 15:54:34 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HFsXde001327;
     Wed, 17 May 2017 15:54:33 GMT (envelope-from zbb@FreeBSD.org)
    Received: (from zbb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HFsXEG001326;
     Wed, 17 May 2017 15:54:33 GMT (envelope-from zbb@FreeBSD.org)
    Message-Id: <201705171554.v4HFsXEG001326@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org
     using -f
    From: Zbigniew Bodek 
    Date: Wed, 17 May 2017 15:54:33 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318407 - head/sys/arm/mv
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 15:54:34 -0000
    
    Author: zbb
    Date: Wed May 17 15:54:33 2017
    New Revision: 318407
    URL: https://svnweb.freebsd.org/changeset/base/318407
    
    Log:
      Enable proper parsing of nested simlpe-buses on Marvell platforms
      
      OF_finddevice doesn't find the "simple-bus" node, which is problematic
      for Marvell platforms, using nested buses in Device Tree, like
      Armada 38x SoC.
      
      Submitted by: Arnaud Ysmal 
      Obtained from: Stormshield
      Sponsored by: Stormshield
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10719
    
    Modified:
      head/sys/arm/mv/mv_common.c
    
    Modified: head/sys/arm/mv/mv_common.c
    ==============================================================================
    --- head/sys/arm/mv/mv_common.c	Wed May 17 15:53:13 2017	(r318406)
    +++ head/sys/arm/mv/mv_common.c	Wed May 17 15:54:33 2017	(r318407)
    @@ -2280,11 +2280,12 @@ moveon:
     static int
     fdt_win_setup(void)
     {
    -	phandle_t node, child;
    +	phandle_t node, child, sb;
     	struct soc_node_spec *soc_node;
     	u_long size, base;
     	int err, i;
     
    +	sb = 0;
     	node = OF_finddevice("/");
     	if (node == -1)
     		panic("fdt_win_setup: no root node");
    @@ -2326,7 +2327,7 @@ fdt_win_setup(void)
     		 */
     		child = OF_peer(child);
     		if ((child == 0) && (node == OF_finddevice("/"))) {
    -			node = fdt_find_compatible(node, "simple-bus", 0);
    +			sb = node = fdt_find_compatible(node, "simple-bus", 0);
     			if (node == 0)
     				return (ENXIO);
     			child = OF_child(node);
    @@ -2336,7 +2337,7 @@ fdt_win_setup(void)
     		 * it is present) and its children. This node also have
     		 * "simple-bus" compatible.
     		 */
    -		if ((child == 0) && (node == OF_finddevice("simple-bus"))) {
    +		if ((child == 0) && (node == sb)) {
     			node = fdt_find_compatible(node, "simple-bus", 0);
     			if (node == 0)
     				return (0);
    
    From owner-svn-src-head@freebsd.org  Wed May 17 15:56:11 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 464A8D7090B;
     Wed, 17 May 2017 15:56:11 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 134C11F32;
     Wed, 17 May 2017 15:56:10 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HFuAfO001445;
     Wed, 17 May 2017 15:56:10 GMT (envelope-from zbb@FreeBSD.org)
    Received: (from zbb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HFuAHg001444;
     Wed, 17 May 2017 15:56:10 GMT (envelope-from zbb@FreeBSD.org)
    Message-Id: <201705171556.v4HFuAHg001444@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org
     using -f
    From: Zbigniew Bodek 
    Date: Wed, 17 May 2017 15:56:10 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318408 - head/sys/arm/mv
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 15:56:11 -0000
    
    Author: zbb
    Date: Wed May 17 15:56:09 2017
    New Revision: 318408
    URL: https://svnweb.freebsd.org/changeset/base/318408
    
    Log:
      Correct MPIC order of attachment
      
      If MPIC happens to be a slave interrupt controller (as on Armada38x),
      it should be attached after primary interrupt controller.
      Thus BUS_PASS_ORDER_LATE was added to default BUS_PASS_INTERRUPT.
      
      This change doesn't affect the cases when MPIC is standalone IC.
      
      Submitted by:  Bartosz Szczepanek 
      Obtained from: Semihalf
      Sponsored by:  Stormshield, Netgate
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10715
    
    Modified:
      head/sys/arm/mv/mpic.c
    
    Modified: head/sys/arm/mv/mpic.c
    ==============================================================================
    --- head/sys/arm/mv/mpic.c	Wed May 17 15:54:33 2017	(r318407)
    +++ head/sys/arm/mv/mpic.c	Wed May 17 15:56:09 2017	(r318408)
    @@ -398,7 +398,7 @@ static driver_t mv_mpic_driver = {
     static devclass_t mv_mpic_devclass;
     
     EARLY_DRIVER_MODULE(mpic, simplebus, mv_mpic_driver, mv_mpic_devclass, 0, 0,
    -    BUS_PASS_INTERRUPT);
    +    BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
     
     #ifndef INTRNG
     int
    
    From owner-svn-src-head@freebsd.org  Wed May 17 15:57:16 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3325BD70990;
     Wed, 17 May 2017 15:57:16 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 001D8F6;
     Wed, 17 May 2017 15:57:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HFvE7D001531;
     Wed, 17 May 2017 15:57:14 GMT (envelope-from zbb@FreeBSD.org)
    Received: (from zbb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HFvEoS001530;
     Wed, 17 May 2017 15:57:14 GMT (envelope-from zbb@FreeBSD.org)
    Message-Id: <201705171557.v4HFvEoS001530@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org
     using -f
    From: Zbigniew Bodek 
    Date: Wed, 17 May 2017 15:57:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318409 - head/sys/arm/mv
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 15:57:16 -0000
    
    Author: zbb
    Date: Wed May 17 15:57:14 2017
    New Revision: 318409
    URL: https://svnweb.freebsd.org/changeset/base/318409
    
    Log:
      Fix registration of MPIC driver
      
      Submitted by:  Michal Mazur 
      Obtained from: Semihalf
      Sponsored by:  Netgate
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10717
    
    Modified:
      head/sys/arm/mv/mpic.c
    
    Modified: head/sys/arm/mv/mpic.c
    ==============================================================================
    --- head/sys/arm/mv/mpic.c	Wed May 17 15:56:09 2017	(r318408)
    +++ head/sys/arm/mv/mpic.c	Wed May 17 15:57:14 2017	(r318409)
    @@ -273,6 +273,9 @@ mv_mpic_attach(device_t dev)
     		bus_release_resources(dev, mv_mpic_spec, sc->mpic_res);
     		return (ENXIO);
     	}
    +
    +	OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev);
    +
     	if (intr_pic_register(dev, OF_xref_from_device(dev)) == NULL) {
     		device_printf(dev, "could not register PIC\n");
     		bus_release_resources(dev, mv_mpic_spec, sc->mpic_res);
    
    From owner-svn-src-head@freebsd.org  Wed May 17 15:58:40 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0B9CD70A66;
     Wed, 17 May 2017 15:58:40 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 7DAE42F1;
     Wed, 17 May 2017 15:58:40 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HFwd9O001622;
     Wed, 17 May 2017 15:58:39 GMT (envelope-from zbb@FreeBSD.org)
    Received: (from zbb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HFwde0001621;
     Wed, 17 May 2017 15:58:39 GMT (envelope-from zbb@FreeBSD.org)
    Message-Id: <201705171558.v4HFwde0001621@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org
     using -f
    From: Zbigniew Bodek 
    Date: Wed, 17 May 2017 15:58:39 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318410 - head/sys/dev/etherswitch/e6000sw
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 15:58:40 -0000
    
    Author: zbb
    Date: Wed May 17 15:58:39 2017
    New Revision: 318410
    URL: https://svnweb.freebsd.org/changeset/base/318410
    
    Log:
      Fix broken malloc in e6000sw
      
      Malloc should always return something when M_WAITOK flag is used,
      but keep this code and change flag to M_NOWAIT as it is under a lock
      (allows for possible future change). Free ifnet structure to avoid
      memory leak on failure.
      
      Submitted by:  Zbigniew Bodek 
      Obtained from: Semihalf
      Sponsored by:  Stormshield
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10711
    
    Modified:
      head/sys/dev/etherswitch/e6000sw/e6000sw.c
    
    Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c
    ==============================================================================
    --- head/sys/dev/etherswitch/e6000sw/e6000sw.c	Wed May 17 15:57:14 2017	(r318409)
    +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c	Wed May 17 15:58:39 2017	(r318410)
    @@ -321,9 +321,11 @@ e6000sw_init_interface(e6000sw_softc_t *
     	sc->ifp[port]->if_softc = sc;
     	sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST |
     	    IFF_DRV_RUNNING | IFF_SIMPLEX;
    -	sc->ifname[port] = malloc(strlen(name) + 1, M_E6000SW, M_WAITOK);
    -	if (sc->ifname[port] == NULL)
    +	sc->ifname[port] = malloc(strlen(name) + 1, M_E6000SW, M_NOWAIT);
    +	if (sc->ifname[port] == NULL) {
    +		if_free(sc->ifp[port]);
     		return (ENOMEM);
    +	}
     	memcpy(sc->ifname[port], name, strlen(name) + 1);
     	if_initname(sc->ifp[port], sc->ifname[port], port);
     
    
    From owner-svn-src-head@freebsd.org  Wed May 17 15:59:46 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFC85D70AF9;
     Wed, 17 May 2017 15:59:46 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 9CD4C69C;
     Wed, 17 May 2017 15:59:46 +0000 (UTC) (envelope-from zbb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HFxjnT001702;
     Wed, 17 May 2017 15:59:45 GMT (envelope-from zbb@FreeBSD.org)
    Received: (from zbb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HFxjWq001701;
     Wed, 17 May 2017 15:59:45 GMT (envelope-from zbb@FreeBSD.org)
    Message-Id: <201705171559.v4HFxjWq001701@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org
     using -f
    From: Zbigniew Bodek 
    Date: Wed, 17 May 2017 15:59:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318411 - head/sys/dev/etherswitch/e6000sw
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 15:59:46 -0000
    
    Author: zbb
    Date: Wed May 17 15:59:45 2017
    New Revision: 318411
    URL: https://svnweb.freebsd.org/changeset/base/318411
    
    Log:
      Add missing unlock in e6000sw driver
      
      This patch adds missing unlock on attach failure.
      
      Submitted by:  Zbigniew Bodek 
      Obtained from: Semihalf
      Sponsored by:  Stormshield
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10712
    
    Modified:
      head/sys/dev/etherswitch/e6000sw/e6000sw.c
    
    Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c
    ==============================================================================
    --- head/sys/dev/etherswitch/e6000sw/e6000sw.c	Wed May 17 15:58:39 2017	(r318410)
    +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c	Wed May 17 15:59:45 2017	(r318411)
    @@ -425,6 +425,7 @@ e6000sw_attach(device_t dev)
     	return (0);
     
     out_fail:
    +	E6000SW_UNLOCK(sc);
     	e6000sw_detach(dev);
     
     	return (err);
    
    From owner-svn-src-head@freebsd.org  Wed May 17 16:32:25 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA0B2D71541;
     Wed, 17 May 2017 16:32:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id AC0431A85;
     Wed, 17 May 2017 16:32:25 +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 v4HGWOdV016964;
     Wed, 17 May 2017 16:32:24 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HGWO8Y016963;
     Wed, 17 May 2017 16:32:24 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705171632.v4HGWO8Y016963@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Wed, 17 May 2017 16:32:24 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318412 - head/sys/sparc64/include
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 16:32:26 -0000
    
    Author: emaste
    Date: Wed May 17 16:32:24 2017
    New Revision: 318412
    URL: https://svnweb.freebsd.org/changeset/base/318412
    
    Log:
      fix sparc64 build by restoring 'register' in pcpu.h
      
      Reported by:	jhb
      Sponsored by:	The FreeBSD Foundation
    
    Modified:
      head/sys/sparc64/include/pcpu.h
    
    Modified: head/sys/sparc64/include/pcpu.h
    ==============================================================================
    --- head/sys/sparc64/include/pcpu.h	Wed May 17 15:59:45 2017	(r318411)
    +++ head/sys/sparc64/include/pcpu.h	Wed May 17 16:32:24 2017	(r318412)
    @@ -71,8 +71,8 @@ extern void *dpcpu0;
     struct pcb;
     struct pcpu;
     
    -struct pcb *curpcb __asm__(__XSTRING(PCB_REG));
    -struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG));
    +register struct pcb *curpcb __asm__(__XSTRING(PCB_REG));
    +register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG));
     
     #define	get_pcpu()		(pcpup)
     #define	PCPU_GET(member)	(pcpup->pc_ ## member)
    
    From owner-svn-src-head@freebsd.org  Wed May 17 19:34:37 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB32AD71759;
     Wed, 17 May 2017 19:34:37 +0000 (UTC)
     (envelope-from adrian@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 C6792D4;
     Wed, 17 May 2017 19:34:37 +0000 (UTC)
     (envelope-from adrian@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HJYadh094805;
     Wed, 17 May 2017 19:34:36 GMT (envelope-from adrian@FreeBSD.org)
    Received: (from adrian@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HJYaBj094804;
     Wed, 17 May 2017 19:34:36 GMT (envelope-from adrian@FreeBSD.org)
    Message-Id: <201705171934.v4HJYaBj094804@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: adrian set sender to
     adrian@FreeBSD.org using -f
    From: Adrian Chadd 
    Date: Wed, 17 May 2017 19:34:36 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318413 - head/sys/net80211
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 19:34:38 -0000
    
    Author: adrian
    Date: Wed May 17 19:34:36 2017
    New Revision: 318413
    URL: https://svnweb.freebsd.org/changeset/base/318413
    
    Log:
      [net80211] initial VHT radiotap implementation defines from upstream radiotap.
    
    Modified:
      head/sys/net80211/ieee80211_radiotap.h
    
    Modified: head/sys/net80211/ieee80211_radiotap.h
    ==============================================================================
    --- head/sys/net80211/ieee80211_radiotap.h	Wed May 17 16:32:24 2017	(r318412)
    +++ head/sys/net80211/ieee80211_radiotap.h	Wed May 17 19:34:36 2017	(r318413)
    @@ -178,6 +178,30 @@ struct ieee80211_radiotap_header {
      *      finally the maximum regulatory transmit power cap in .5 dBm
      *      units.  This property supersedes IEEE80211_RADIOTAP_CHANNEL
      *      and only one of the two should be present.
    + * IEEE80211_RADIOTAP_RX_FLAGS          guint16       bitmap
    + *
    + *     Properties of received frames. See flags defined below.
    + *
    + * IEEE80211_RADIOTAP_TX_FLAGS          guint16       bitmap
    + *
    + *     Properties of transmitted frames. See flags defined below.
    + *
    + * IEEE80211_RADIOTAP_RTS_RETRIES       u8           data
    + *
    + *     Number of rts retries a transmitted frame used.
    + *
    + * IEEE80211_RADIOTAP_DATA_RETRIES      u8           data
    + *
    + *     Number of unicast retries a transmitted frame used.
    + *
    + * IEEE80211_RADIOTAP_MCS       u8, u8, u8              unitless
    + *
    + *     Contains a bitmap of known fields/flags, the flags, and
    + *     the MCS index.
    + *
    + * IEEE80211_RADIOTAP_AMPDU_STATUS      u32, u16, u8, u8        unitlesss
    + *
    + *      Contains the AMPDU information for the subframe.
      */
     enum ieee80211_radiotap_type {
     	IEEE80211_RADIOTAP_TSFT = 0,
    @@ -206,6 +230,7 @@ enum ieee80211_radiotap_type {
     	IEEE80211_RADIOTAP_XCHANNEL = 18,
     	IEEE80211_RADIOTAP_MCS = 19,
     	IEEE80211_RADIOTAP_AMPDU_STATUS = 20,
    +	IEEE80211_RADIOTAP_VHT = 21,
     
             IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
     	IEEE80211_RADIOTAP_VENDOREXT = 30,
    @@ -250,4 +275,95 @@ enum ieee80211_radiotap_type {
     #define	IEEE80211_RADIOTAP_F_BADFCS	0x40	/* does not pass FCS check */
     #define	IEEE80211_RADIOTAP_F_SHORTGI	0x80	/* HT short GI */
     
    +/* For IEEE80211_RADIOTAP_RX_FLAGS */
    +#define	IEEE80211_RADIOTAP_F_RX_BADPLCP	0x0002	/* bad PLCP */
    +
    +/* For IEEE80211_RADIOTAP_TX_FLAGS */
    +#define	IEEE80211_RADIOTAP_F_TX_FAIL	0x0001	/* failed due to excessive
    +						 * retries */
    +#define	IEEE80211_RADIOTAP_F_TX_CTS	0x0002	/* used cts 'protection' */
    +#define	IEEE80211_RADIOTAP_F_TX_RTS	0x0004	/* used rts/cts handshake */
    +
    +
    +/* For IEEE80211_RADIOTAP_MCS */
    +#define	IEEE80211_RADIOTAP_MCS_HAVE_BW		0x01
    +#define	IEEE80211_RADIOTAP_MCS_HAVE_MCS		0x02
    +#define	IEEE80211_RADIOTAP_MCS_HAVE_GI		0x04
    +#define	IEEE80211_RADIOTAP_MCS_HAVE_FMT		0x08
    +#define	IEEE80211_RADIOTAP_MCS_HAVE_FEC		0x10
    +#define	IEEE80211_RADIOTAP_MCS_HAVE_STBC	0x20
    +#define	IEEE80211_RADIOTAP_MCS_HAVE_NESS	0x40
    +#define	IEEE80211_RADIOTAP_MCS_NESS_BIT1	0x80
    +
    +#define	IEEE80211_RADIOTAP_MCS_BW_MASK		0x03
    +#define	    IEEE80211_RADIOTAP_MCS_BW_20	0
    +#define	    IEEE80211_RADIOTAP_MCS_BW_40	1
    +#define	 IEEE80211_RADIOTAP_MCS_BW_20L		2
    +#define	    IEEE80211_RADIOTAP_MCS_BW_20U	3
    +#define	IEEE80211_RADIOTAP_MCS_SGI		0x04
    +#define	IEEE80211_RADIOTAP_MCS_FMT_GF		0x08
    +#define	IEEE80211_RADIOTAP_MCS_FEC_LDPC		0x10
    +#define	IEEE80211_RADIOTAP_MCS_STBC_MASK	0x60
    +#define	IEEE80211_RADIOTAP_MCS_STBC_SHIFT	5
    +#define	    IEEE80211_RADIOTAP_MCS_STBC_1	1
    +#define	    IEEE80211_RADIOTAP_MCS_STBC_2	2
    +#define	    IEEE80211_RADIOTAP_MCS_STBC_3	3
    +#define	IEEE80211_RADIOTAP_MCS_NESS_BIT0	0x80
    +
    +/* For IEEE80211_RADIOTAP_AMPDU_STATUS */
    +#define	IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN		0x0001
    +#define	IEEE80211_RADIOTAP_AMPDU_IS_ZEROLEN		0x0002
    +#define	IEEE80211_RADIOTAP_AMPDU_LAST_KNOWN		0x0004
    +#define	IEEE80211_RADIOTAP_AMPDU_IS_LAST		0x0008
    +#define	IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR		0x0010
    +#define	IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN	0x0020
    +
    +/* For IEEE80211_RADIOTAP_VHT */
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_STBC	0x0001
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_TXOP_PS	0x0002
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_GI		0x0004
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_SGI_NSYM_DA	0x0008
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_LDPC_EXTRA	0x0010
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_BF		0x0020
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_BW		0x0040
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_GID		0x0080
    +#define	IEEE80211_RADIOTAP_VHT_HAVE_PAID	0x0100
    +#define	IEEE80211_RADIOTAP_VHT_STBC		0x01
    +#define	IEEE80211_RADIOTAP_VHT_TXOP_PS		0x02
    +#define	IEEE80211_RADIOTAP_VHT_SGI		0x04
    +#define	IEEE80211_RADIOTAP_VHT_SGI_NSYM_DA	0x08
    +#define	IEEE80211_RADIOTAP_VHT_LDPC_EXTRA	0x10
    +#define	IEEE80211_RADIOTAP_VHT_BF		0x20
    +#define	IEEE80211_RADIOTAP_VHT_NSS		0x0f
    +#define	IEEE80211_RADIOTAP_VHT_MCS		0xf0
    +#define	IEEE80211_RADIOTAP_VHT_CODING_LDPC	0x01
    +
    +#define	IEEE80211_RADIOTAP_VHT_BW_MASK		0x1f
    +#define	IEEE80211_RADIOTAP_VHT_BW_20		IEEE80211_RADIOTAP_MCS_BW_20
    +#define	IEEE80211_RADIOTAP_VHT_BW_40		IEEE80211_RADIOTAP_MCS_BW_40
    +#define	IEEE80211_RADIOTAP_VHT_BW_20L		IEEE80211_RADIOTAP_MCS_BW_20L
    +#define	IEEE80211_RADIOTAP_VHT_BW_20U		IEEE80211_RADIOTAP_MCS_BW_20U
    +#define	IEEE80211_RADIOTAP_VHT_BW_80		4
    +#define	IEEE80211_RADIOTAP_VHT_BW_40L		5
    +#define	IEEE80211_RADIOTAP_VHT_BW_40U		6
    +#define	IEEE80211_RADIOTAP_VHT_BW_20LL		7
    +#define	IEEE80211_RADIOTAP_VHT_BW_20LU		8
    +#define	IEEE80211_RADIOTAP_VHT_BW_20UL		9
    +#define	IEEE80211_RADIOTAP_VHT_BW_20UU		10
    +#define	IEEE80211_RADIOTAP_VHT_BW_160		11
    +#define	IEEE80211_RADIOTAP_VHT_BW_80L		12
    +#define	IEEE80211_RADIOTAP_VHT_BW_80U		13
    +#define	IEEE80211_RADIOTAP_VHT_BW_40LL		14
    +#define	IEEE80211_RADIOTAP_VHT_BW_40LU		15
    +#define	IEEE80211_RADIOTAP_VHT_BW_40UL		16
    +#define	IEEE80211_RADIOTAP_VHT_BW_40UU		17
    +#define	IEEE80211_RADIOTAP_VHT_BW_20LLL		18
    +#define	IEEE80211_RADIOTAP_VHT_BW_20LLU		19
    +#define	IEEE80211_RADIOTAP_VHT_BW_20LUL		20
    +#define	IEEE80211_RADIOTAP_VHT_BW_20LUU		21
    +#define	IEEE80211_RADIOTAP_VHT_BW_20ULL		22
    +#define	IEEE80211_RADIOTAP_VHT_BW_20ULU		23
    +#define	IEEE80211_RADIOTAP_VHT_BW_20UUL		24
    +#define	IEEE80211_RADIOTAP_VHT_BW_20UUU		25
    +
     #endif /* !_NET80211_IEEE80211_RADIOTAP_H_ */
    
    From owner-svn-src-head@freebsd.org  Wed May 17 21:14:29 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42228D714E4;
     Wed, 17 May 2017 21:14:29 +0000 (UTC)
     (envelope-from loos@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 1A2038F4;
     Wed, 17 May 2017 21:14:29 +0000 (UTC)
     (envelope-from loos@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HLESEh036564;
     Wed, 17 May 2017 21:14:28 GMT (envelope-from loos@FreeBSD.org)
    Received: (from loos@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HLESDA036563;
     Wed, 17 May 2017 21:14:28 GMT (envelope-from loos@FreeBSD.org)
    Message-Id: <201705172114.v4HLESDA036563@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: loos set sender to
     loos@FreeBSD.org using -f
    From: Luiz Otavio O Souza 
    Date: Wed, 17 May 2017 21:14:28 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318426 - head/sys/arm/mv
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 21:14:29 -0000
    
    Author: loos
    Date: Wed May 17 21:14:27 2017
    New Revision: 318426
    URL: https://svnweb.freebsd.org/changeset/base/318426
    
    Log:
      Use the MACROS to access the Global mpic registers.  Makes the code
      consistent and easier to read.
      
      While here, remove two unused static functions and fix a unused function
      warning when building !INTRNG.
      
      No functional changes.
      
      Sponsored by:	Rubicon Communications, LLC (Netgate)
    
    Modified:
      head/sys/arm/mv/mpic.c
    
    Modified: head/sys/arm/mv/mpic.c
    ==============================================================================
    --- head/sys/arm/mv/mpic.c	Wed May 17 20:23:27 2017	(r318425)
    +++ head/sys/arm/mv/mpic.c	Wed May 17 21:14:27 2017	(r318426)
    @@ -148,12 +148,10 @@ static void	mpic_unmask_irq(uintptr_t nb
     static void	mpic_mask_irq(uintptr_t nb);
     static void	mpic_mask_irq_err(uintptr_t nb);
     static void	mpic_unmask_irq_err(uintptr_t nb);
    +#ifdef INTRNG
     static int	mpic_intr(void *arg);
    -static void	mpic_unmask_msi(void);
    -#ifndef INTRNG
    -static void	arm_mask_irq_err(uintptr_t);
    -static void	arm_unmask_irq_err(uintptr_t);
     #endif
    +static void	mpic_unmask_msi(void);
     
     #define	MPIC_WRITE(softc, reg, val) \
         bus_space_write_4((softc)->mpic_bst, (softc)->mpic_bsh, (reg), (val))
    @@ -260,8 +258,7 @@ mv_mpic_attach(device_t dev)
     		sc->drbl_bsh = rman_get_bushandle(sc->mpic_res[2]);
     	}
     
    -	bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh,
    -	    MPIC_CTRL, 1);
    +	MPIC_WRITE(mv_mpic_sc, MPIC_CTRL, 1);
     	MPIC_CPU_WRITE(mv_mpic_sc, MPIC_CTP, 0);
     
     	val = MPIC_READ(mv_mpic_sc, MPIC_CTRL);
    @@ -435,27 +432,12 @@ arm_mask_irq(uintptr_t nb)
     	mpic_mask_irq(nb);
     }
     
    -
    -static void
    -arm_mask_irq_err(uintptr_t nb)
    -{
    -
    -	mpic_mask_irq_err(nb);
    -}
    -
     void
     arm_unmask_irq(uintptr_t nb)
     {
     
     	mpic_unmask_irq(nb);
     }
    -
    -void
    -arm_unmask_irq_err(uintptr_t nb)
    -{
    -
    -	mpic_unmask_irq_err(nb);
    -}
     #endif
     
     static void
    @@ -471,8 +453,7 @@ mpic_unmask_irq_err(uintptr_t nb)
     	uint32_t mask;
     	uint8_t bit_off;
     
    -	bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh,
    -	    MPIC_ISE, MPIC_INT_ERR);
    +	MPIC_WRITE(mv_mpic_sc, MPIC_ISE, MPIC_INT_ERR);
     	MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ICM, MPIC_INT_ERR);
     
     	bit_off = nb - ERR_IRQ;
    @@ -498,8 +479,7 @@ mpic_unmask_irq(uintptr_t nb)
     {
     
     	if (nb < ERR_IRQ) {
    -		bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh,
    -		    MPIC_ISE, nb);
    +		MPIC_WRITE(mv_mpic_sc, MPIC_ISE, nb);
     		MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ICM, nb);
     	} else if (nb < MSI_IRQ)
     		mpic_unmask_irq_err(nb);
    @@ -513,8 +493,7 @@ mpic_mask_irq(uintptr_t nb)
     {
     
     	if (nb < ERR_IRQ) {
    -		bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh,
    -		    MPIC_ICE, nb);
    +		MPIC_WRITE(mv_mpic_sc, MPIC_ICE, nb);
     		MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ISM, nb);
     	} else if (nb < MSI_IRQ)
     		mpic_mask_irq_err(nb);
    @@ -533,8 +512,7 @@ mv_mpic_get_cause_err(void)
     	uint32_t err_cause;
     	uint8_t bit_off;
     
    -	err_cause = bus_space_read_4(mv_mpic_sc->mpic_bst,
    -	    mv_mpic_sc->mpic_bsh, MPIC_ERR_CAUSE);
    +	err_cause = MPIC_READ(mv_mpic_sc, MPIC_ERR_CAUSE);
     
     	if (err_cause)
     		bit_off = ffs(err_cause) - 1;
    @@ -615,8 +593,7 @@ pic_ipi_send(cpuset_t cpus, u_int ipi)
     		if (CPU_ISSET(i, &cpus))
     			val |= (1 << (8 + i));
     	val |= ipi;
    -	bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh,
    -	    MPIC_SOFT_INT, val);
    +	MPIC_WRITE(mv_mpic_sc, MPIC_SOFT_INT, val);
     }
     
     int
    
    From owner-svn-src-head@freebsd.org  Wed May 17 21:33:38 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id D417ED7195B;
     Wed, 17 May 2017 21:33:38 +0000 (UTC) (envelope-from slm@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 813281303;
     Wed, 17 May 2017 21:33:38 +0000 (UTC) (envelope-from slm@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HLXbc2044714;
     Wed, 17 May 2017 21:33:37 GMT (envelope-from slm@FreeBSD.org)
    Received: (from slm@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HLXbi6044710;
     Wed, 17 May 2017 21:33:37 GMT (envelope-from slm@FreeBSD.org)
    Message-Id: <201705172133.v4HLXbi6044710@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org
     using -f
    From: Stephen McConnell 
    Date: Wed, 17 May 2017 21:33:37 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318427 - in head: share/man/man4 sys/dev/mpr
     sys/dev/mpr/mpi
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 21:33:38 -0000
    
    Author: slm
    Date: Wed May 17 21:33:37 2017
    New Revision: 318427
    URL: https://svnweb.freebsd.org/changeset/base/318427
    
    Log:
      Add tri-mode support (SAS/SATA/PCIe).
      
      This includes NVMe device support and adds support for the following adapters:
          SAS 3408
          SAS 3416
          SAS 3508
          SAS 3516
          SAS 3616
          SAS 3708
          SAS 3716
      
      Reviewed by:    ken, scottl, asomers, mav
      Approved by:	ken, scottl, mav
      MFC after:      2 weeks
      Relnotes:	yes
      Differential Revision: https://reviews.freebsd.org/D10095
    
    Added:
      head/sys/dev/mpr/mpi/mpi2_pci.h   (contents, props changed)
    Modified:
      head/share/man/man4/mpr.4
      head/sys/dev/mpr/mpi/mpi2.h
      head/sys/dev/mpr/mpi/mpi2_cnfg.h
      head/sys/dev/mpr/mpi/mpi2_hbd.h
      head/sys/dev/mpr/mpi/mpi2_history.txt
      head/sys/dev/mpr/mpi/mpi2_init.h
      head/sys/dev/mpr/mpi/mpi2_ioc.h
      head/sys/dev/mpr/mpi/mpi2_tool.h
      head/sys/dev/mpr/mpr.c
      head/sys/dev/mpr/mpr_config.c
      head/sys/dev/mpr/mpr_mapping.c
      head/sys/dev/mpr/mpr_mapping.h
      head/sys/dev/mpr/mpr_pci.c
      head/sys/dev/mpr/mpr_sas.c
      head/sys/dev/mpr/mpr_sas.h
      head/sys/dev/mpr/mpr_sas_lsi.c
      head/sys/dev/mpr/mpr_table.c
      head/sys/dev/mpr/mpr_table.h
      head/sys/dev/mpr/mpr_user.c
      head/sys/dev/mpr/mprvar.h
    
    Modified: head/share/man/man4/mpr.4
    ==============================================================================
    --- head/share/man/man4/mpr.4	Wed May 17 21:14:27 2017	(r318426)
    +++ head/share/man/man4/mpr.4	Wed May 17 21:33:37 2017	(r318427)
    @@ -1,8 +1,8 @@
     .\"
     .\" Copyright (c) 2010 Spectra Logic Corporation
     .\" Copyright (c) 2014 LSI Corp
    -.\" Copyright (c) 2016 Avago Technologies
    -.\" Copyright (c) 2016 Broadcom Ltd.
    +.\" Copyright (c) 2017 Avago Technologies
    +.\" Copyright (c) 2017 Broadcom Ltd.
     .\" All rights reserved.
     .\"
     .\" Redistribution and use in source and binary forms, with or without
    @@ -38,12 +38,12 @@
     .\" $Id$
     .\" $FreeBSD$
     .\"
    -.Dd July 6, 2016
    +.Dd May 17, 2017
     .Dt MPR 4
     .Os
     .Sh NAME
     .Nm mpr
    -.Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver"
    +.Nd "LSI Fusion-MPT 3/3.5 IT/IR 12Gb/s Serial Attached SCSI/SATA/PCIe driver"
     .Sh SYNOPSIS
     To compile this driver into the kernel, place these lines in the kernel
     configuration file:
    @@ -62,8 +62,8 @@ mpr_load="YES"
     The
     .Nm
     driver provides support for Broadcom Ltd./Avago Tech (LSI)
    -Fusion-MPT 3 IT/IR
    -.Tn SAS
    +Fusion-MPT 3/3.5 IT/IR
    +.Tn SAS/PCIe
     controllers.
     .Sh HARDWARE
     These controllers are supported by the
    @@ -81,6 +81,24 @@ Broadcom Ltd./Avago Tech (LSI) SAS 3108 
     Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS)
     .It
     Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3316 (16 Port SAS)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3324 (24 Port SAS)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3408 (8 Port SAS/PCIe)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3416 (16 Port SAS/PCIe)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3508 (8 Port SAS/PCIe)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3516 (16 Port SAS/PCIe)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3616 (16 Port SAS/PCIe)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3708 (8 Port SAS/PCIe)
    +.It
    +Broadcom Ltd./Avago Tech (LSI) SAS 3716 (16 Port SAS/PCIe)
     .El
     .Sh CONFIGURATION
     In all tunable descriptions below, X represents the adapter number.
    @@ -156,6 +174,24 @@ dev.mpr.X.io_cmds_active
     .Xr sysctl 8
     variable.
     .Pp
    +The current number of free PRP pages is stored in the
    +dev.mpr.X.prp_pages_free
    +.Xr sysctl 8
    +variable.
    +PRP pages are used by NVMe devices for I/O transfers, much like Scatter/Gather
    +lists.
    +.Pp
    +The lowest number of free PRP pages seen since boot is stored in the
    +dev.mpr.X.prp_pages_free_lowwater
    +.Xr sysctl 8
    +variable.
    +.Pp
    +The number of times that PRP page allocations have failed since boot is
    +stored in the
    +dev.mpr.X.prp_page_alloc_fail
    +.Xr sysctl 8
    +variable.
    +.Pp
     To set the maximum number of pages that will be used per I/O for all adapters,
     set this tunable in
     .Xr loader.conf 5 :
    @@ -229,13 +265,13 @@ Send SSU to HDDs, but not to SSDs.
     Send SSU to both HDDs and SSDs.
     .El
     .Pp
    -To control the feature for a specific adapter, set this tunable value in
    +To control this feature for a specific adapter, set this tunable value in
     .Xr loader.conf 5 :
     .Bd -literal -offset indent
     dev.mpr.X.enable_ssu
     .Ed
     .Pp
    -The same set of values are valid when setting this tunable for all adapters.
    +The same set of values are valid as when setting this tunable for all adapters.
     .Pp
     SATA disks that take several seconds to spin up and fail the SATA Identify
     command might not be discovered by the driver.
    @@ -261,6 +297,45 @@ dev.mpr.X.spinup_wait_time=NNNN
     tunable.
     NNNN is the number of seconds to wait for SATA devices to spin up when they fail
     the initial SATA Identify command.
    +.Pp
    +The driver can map devices discovered by the adapter so that target IDs
    +corresponding to a specific device persist across resets and reboots.
    +In some cases it is possible for devices to lose their mapped IDs due to
    +unexpected behavior from certain hardware, such as some types of enclosures.
    +To overcome this problem, a tunable is provided that will force the driver to
    +map devices using the Phy number associated with the device.
    +This feature is not recommended if the topology includes multiple
    +enclosures/expanders.
    +If multiple enclosures/expanders are present in the topology, Phy numbers are
    +repeated, causing all devices at these Phy numbers except the first device to
    +fail enumeration.
    +To control this feature for all adapters, set the
    +.Bd -literal -offset indent
    +hw.mpr.use_phy_num
    +.Ed
    +.Pp
    +tunable in
    +.Xr loader.conf 5
    +to one of these values:
    +.Bl -tag -width 6n -offset indent
    +.It -1
    +Only use Phy numbers to map devices and bypass the driver's mapping logic.
    +.It 0
    +Never use Phy numbers to map devices.
    +.It 1
    +Use Phy numbers to map devices, but only if the driver's mapping logic fails
    +to map the device that is being enumerated.
    +This is the default value.
    +.El
    +.Pp
    +To control this feature for a specific adapter, set this tunable value in
    +.Xr loader.conf 5 :
    +.Bd -literal -offset indent
    +dev.mpr.X.use_phy_num
    +.Ed
    +.Pp
    +The same set of values are valid as when setting this tunable for all adapters.
    +.Pp
     .Sh DEBUGGING
     To enable debugging prints from the
     .Nm
    
    Modified: head/sys/dev/mpr/mpi/mpi2.h
    ==============================================================================
    --- head/sys/dev/mpr/mpi/mpi2.h	Wed May 17 21:14:27 2017	(r318426)
    +++ head/sys/dev/mpr/mpi/mpi2.h	Wed May 17 21:33:37 2017	(r318427)
    @@ -44,7 +44,7 @@
      *                  scatter/gather formats.
      *  Creation Date:  June 21, 2006
      *
    - *  mpi2.h Version:  02.00.42
    + *  mpi2.h Version:  02.00.46
      *
      *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
      *        prefix are for use only on MPI v2.5 products, and must not be used
    @@ -132,7 +132,8 @@
      *                      Bumped MPI2_HEADER_VERSION_UNIT.
      *  03-16-15  02.00.37  Updated for MPI v2.6.
      *                      Bumped MPI2_HEADER_VERSION_UNIT.
    - *                      Added Scratchpad registers to
    + *                      Added Scratchpad registers and
    + *                      AtomicRequestDescriptorPost register to
      *                      MPI2_SYSTEM_INTERFACE_REGS.
      *                      Added MPI2_DIAG_SBR_RELOAD.
      *                      Added MPI2_IOCSTATUS_INSUFFICIENT_POWER.
    @@ -142,6 +143,14 @@
      *                      Added V7 HostDiagnostic register defines
      *  12-15-15  02.00.41  Bumped MPI_HEADER_VERSION_UNIT
      *  01-01-16  02.00.42  Bumped MPI_HEADER_VERSION_UNIT
    + *  04-05-16  02.00.43  Modified  MPI26_DIAG_BOOT_DEVICE_SELECT defines
    + *                      to be unique within first 32 characters.
    + *                      Removed AHCI support.
    + *                      Removed SOP support.
    + *                      Bumped MPI2_HEADER_VERSION_UNIT.
    + *  04-10-16  02.00.44  Bumped MPI2_HEADER_VERSION_UNIT.
    + *  07-06-16  02.00.45  Bumped MPI2_HEADER_VERSION_UNIT.
    + *  09-02-16  02.00.46  Bumped MPI2_HEADER_VERSION_UNIT.
      *  --------------------------------------------------------------------------
      */
     
    @@ -185,7 +194,7 @@
     
     
     /* Unit and Dev versioning for this MPI header set */
    -#define MPI2_HEADER_VERSION_UNIT            (0x2A)
    +#define MPI2_HEADER_VERSION_UNIT            (0x2E)
     #define MPI2_HEADER_VERSION_DEV             (0x00)
     #define MPI2_HEADER_VERSION_UNIT_MASK       (0xFF00)
     #define MPI2_HEADER_VERSION_UNIT_SHIFT      (8)
    @@ -245,7 +254,8 @@ typedef volatile struct _MPI2_SYSTEM_INT
         U32         Scratchpad[4];              /* 0xB0 */
         U32         RequestDescriptorPostLow;   /* 0xC0 */
         U32         RequestDescriptorPostHigh;  /* 0xC4 */
    -    U32         Reserved7[14];              /* 0xC8 */
    +    U32         AtomicRequestDescriptorPost;/* 0xC8 */ /* MPI v2.6 and later; reserved in earlier versions */
    +    U32         Reserved7[13];              /* 0xCC */
     } MPI2_SYSTEM_INTERFACE_REGS, MPI2_POINTER PTR_MPI2_SYSTEM_INTERFACE_REGS,
       Mpi2SystemInterfaceRegs_t, MPI2_POINTER pMpi2SystemInterfaceRegs_t;
     
    @@ -293,10 +303,11 @@ typedef volatile struct _MPI2_SYSTEM_INT
     #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW       (0x00000800)
     
     /* Defines for V7A/V7R HostDiagnostic Register */
    -#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH64    (0x00000000)
    -#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW64     (0x00000800)
    -#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH32    (0x00001000)
    -#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW32     (0x00001800)
    +#define MPI26_DIAG_BOOT_DEVICE_SEL_64FLASH      (0x00000000)
    +#define MPI26_DIAG_BOOT_DEVICE_SEL_64HCDW       (0x00000800)
    +#define MPI26_DIAG_BOOT_DEVICE_SEL_32FLASH      (0x00001000)
    +#define MPI26_DIAG_BOOT_DEVICE_SEL_32HCDW       (0x00001800)
    +
     #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG           (0x00000400)
     #define MPI2_DIAG_FORCE_HCB_ON_RESET            (0x00000200)
     #define MPI2_DIAG_HCB_MODE                      (0x00000100)
    @@ -379,6 +390,7 @@ typedef volatile struct _MPI2_SYSTEM_INT
      */
     #define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET     (0x000000C0)
     #define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET    (0x000000C4)
    +#define MPI26_ATOMIC_REQUEST_DESCRIPTOR_POST_OFFSET (0x000000C8)
     
     
     /* Hard Reset delay timings */
    @@ -415,6 +427,7 @@ typedef struct _MPI2_DEFAULT_REQUEST_DES
     #define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE            (0x08)
     #define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR        (0x0A)
     #define MPI25_REQ_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO      (0x0C)
    +#define MPI26_REQ_DESCRIPT_FLAGS_PCIE_ENCAPSULATED      (0x10)
     
     #define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01)
     
    @@ -482,6 +495,14 @@ typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
         MPI2_POINTER pMpi25FastPathSCSIIORequestDescriptor_t;
     
     
    +/* PCIe Encapsulated Request Descriptor */
    +typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
    +    MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
    +    MPI2_POINTER PTR_MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
    +    Mpi26PCIeEncapsulatedRequestDescriptor_t,
    +    MPI2_POINTER pMpi26PCIeEncapsulatedRequestDescriptor_t;
    +
    +
     /* union of Request Descriptors */
     typedef union _MPI2_REQUEST_DESCRIPTOR_UNION
     {
    @@ -491,11 +512,35 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_U
         MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR         SCSITarget;
         MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR          RAIDAccelerator;
         MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR         FastPathSCSIIO;
    +    MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR  PCIeEncapsulated;
         U64                                         Words;
     } MPI2_REQUEST_DESCRIPTOR_UNION, MPI2_POINTER PTR_MPI2_REQUEST_DESCRIPTOR_UNION,
       Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t;
     
     
    +/* Atomic Request Descriptors */
    +
    +/*
    + * All Atomic Request Descriptors have the same format, so the following
    + * structure is used for all Atomic Request Descriptors:
    + *      Atomic Default Request Descriptor
    + *      Atomic High Priority Request Descriptor
    + *      Atomic SCSI IO Request Descriptor
    + *      Atomic SCSI Target Request Descriptor
    + *      Atomic RAID Accelerator Request Descriptor
    + *      Atomic Fast Path SCSI IO Request Descriptor
    + *      Atomic PCIe Encapsulated Request Descriptor
    + */
    +
    +/* Atomic Request Descriptor */
    +typedef struct _MPI26_ATOMIC_REQUEST_DESCRIPTOR
    +{
    +    U8              RequestFlags;               /* 0x00 */
    +    U8              MSIxIndex;                  /* 0x01 */
    +    U16             SMID;                       /* 0x02 */
    +} MPI26_ATOMIC_REQUEST_DESCRIPTOR,
    +  MPI2_POINTER PTR_MPI26_ATOMIC_REQUEST_DESCRIPTOR,
    +  Mpi26AtomicRequestDescriptor_t, MPI2_POINTER pMpi26AtomicRequestDescriptor_t;
     
     /* for the RequestFlags field, use the same defines as MPI2_DEFAULT_REQUEST_DESCRIPTOR */
     
    @@ -520,6 +565,7 @@ typedef struct _MPI2_DEFAULT_REPLY_DESCR
     #define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER       (0x03)
     #define MPI2_RPY_DESCRIPT_FLAGS_RAID_ACCELERATOR_SUCCESS    (0x05)
     #define MPI25_RPY_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO_SUCCESS  (0x06)
    +#define MPI26_RPY_DESCRIPT_FLAGS_PCIE_ENCAPSULATED_SUCCESS  (0x08)
     #define MPI2_RPY_DESCRIPT_FLAGS_UNUSED                      (0x0F)
     
     /* values for marking a reply descriptor as unused */
    @@ -607,6 +653,14 @@ typedef MPI2_SCSI_IO_SUCCESS_REPLY_DESCR
         MPI2_POINTER pMpi25FastPathSCSIIOSuccessReplyDescriptor_t;
     
     
    +/* PCIe Encapsulated Success Reply Descriptor */
    +typedef MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR
    +    MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR,
    +    MPI2_POINTER PTR_MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR,
    +    Mpi26PCIeEncapsulatedSuccessReplyDescriptor_t,
    +    MPI2_POINTER pMpi26PCIeEncapsulatedSuccessReplyDescriptor_t;
    +
    +
     /* union of Reply Descriptors */
     typedef union _MPI2_REPLY_DESCRIPTORS_UNION
     {
    @@ -617,6 +671,7 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN
         MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR     TargetCommandBuffer;
         MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR  RAIDAcceleratorSuccess;
         MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR       FastPathSCSIIOSuccess;
    +    MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR    PCIeEncapsulatedSuccess;
         U64                                             Words;
     } MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION,
       Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t;
    @@ -659,6 +714,7 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN
     #define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION   (0x2F) /* Host Based Discovery Action */
     #define MPI2_FUNCTION_PWR_MGMT_CONTROL              (0x30) /* Power Management Control */
     #define MPI2_FUNCTION_SEND_HOST_MESSAGE             (0x31) /* Send Host Message */
    +#define MPI2_FUNCTION_NVME_ENCAPSULATED             (0x33) /* NVMe Encapsulated (MPI v2.6) */
     #define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC          (0xF0) /* beginning of product-specific range */
     #define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC          (0xFF) /* end of product-specific range */
     
    @@ -1232,6 +1288,8 @@ typedef union _MPI25_SGE_IO_UNION
     
     #define MPI26_IEEE_SGE_FLAGS_NSF_MASK           (0x1C)
     #define MPI26_IEEE_SGE_FLAGS_NSF_MPI_IEEE       (0x00)
    +#define MPI26_IEEE_SGE_FLAGS_NSF_NVME_PRP       (0x08)
    +#define MPI26_IEEE_SGE_FLAGS_NSF_NVME_SGL       (0x10)
     
     /* Data Location Address Space */
     
    
    Modified: head/sys/dev/mpr/mpi/mpi2_cnfg.h
    ==============================================================================
    --- head/sys/dev/mpr/mpi/mpi2_cnfg.h	Wed May 17 21:14:27 2017	(r318426)
    +++ head/sys/dev/mpr/mpi/mpi2_cnfg.h	Wed May 17 21:33:37 2017	(r318427)
    @@ -42,7 +42,7 @@
      *          Title:  MPI Configuration messages and pages
      *  Creation Date:  November 10, 2006
      *
    - *    mpi2_cnfg.h Version:  02.00.35
    + *    mpi2_cnfg.h Version:  02.00.39
      *
      *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
      *        prefix are for use only on MPI v2.5 products, and must not be used
    @@ -223,9 +223,38 @@
      *                      Flags field to IO Unit Page 7.
      *                      Added IO Unit Page 11.
      *                      Added new SAS Phy Event codes
    + *                      Added PCIe configuration pages.
    + *  03-19-15  02.00.32  Fixed PCIe Link Config page structure names to be
    + *                      unique in first 32 characters.
      *  05-25-15  02.00.33  Added more defines for the BiosOptions field of
      *                      MPI2_CONFIG_PAGE_BIOS_1.
    + *  08-25-15  02.00.34  Added PCIe Device Page 2 SGL format capability.
      *  12-18-15  02.00.35  Added SATADeviceWaitTime to SAS IO Unit Page 4.
    + *  01-21-16  02.00.36  Added/modified MPI2_MFGPAGE_DEVID_SAS defines.
    + *                      Added Link field to PCIe Link Pages
    + *                      Added EnclosureLevel and ConnectorName to PCIe
    + *                      Device Page 0.
    + *                      Added define for PCIE IoUnit page 1 max rate shift.
    + *                      Added comment for reserved ExtPageTypes.
    + *                      Added SAS 4 22.5 gbs speed support.
    + *                      Added PCIe 4 16.0 GT/sec speec support.
    + *                      Removed AHCI support.
    + *                      Removed SOP support.
    + *                      Added NegotiatedLinkRate and NegotiatedPortWidth to
    + *                      PCIe device page 0.
    + *  04-10-16  02.00.37  Fixed MPI2_MFGPAGE_DEVID_SAS3616/3708 defines
    + *  07-01-16  02.00.38  Added Manufacturing page 7 Connector types.
    + *                      Changed declaration of ConnectorName in PCIe DevicePage0
    + *                      to match SAS DevicePage 0.
    + *                      Added SATADeviceWaitTime to IO Unit Page 11.
    + *                      Added MPI26_MFGPAGE_DEVID_SAS4008
    + *                      Added x16 PCIe width to IO Unit Page 7
    + *                      Added LINKFLAGS to control SRIS in PCIe IO Unit page 1
    + *                      phy data.
    + *                      Added InitStatus to PCIe IO Unit Page 1 header.
    + *  09-01-16  02.00.39  Added MPI26_CONFIG_PAGE_ENCLOSURE_0 and related defines.
    + *                      Added MPI26_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE and
    + *                      MPI26_ENCLOS_PGAD_FORM_HANDLE page address formats.
      *  --------------------------------------------------------------------------
      */
     
    @@ -310,6 +339,12 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD
     #define MPI2_CONFIG_EXTPAGETYPE_SAS_PORT            (0x18)
     #define MPI2_CONFIG_EXTPAGETYPE_ETHERNET            (0x19)
     #define MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING   (0x1A)
    +#define MPI2_CONFIG_EXTPAGETYPE_PCIE_IO_UNIT        (0x1B) /* MPI v2.6 and later */
    +#define MPI2_CONFIG_EXTPAGETYPE_PCIE_SWITCH         (0x1C) /* MPI v2.6 and later */
    +#define MPI2_CONFIG_EXTPAGETYPE_PCIE_DEVICE         (0x1D) /* MPI v2.6 and later */
    +#define MPI2_CONFIG_EXTPAGETYPE_PCIE_LINK           (0x1E) /* MPI v2.6 and later */
    +/*  Product specific reserved values  0xE0 - 0xEF */
    +/*  Vendor specific reserved values   0xF0 - 0xFF */
     
     
     /*****************************************************************************
    @@ -377,6 +412,12 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD
     
     #define MPI2_SAS_ENCLOS_PGAD_HANDLE_MASK            (0x0000FFFF)
     
    +/* Enclosure PageAddress format */
    +#define MPI26_ENCLOS_PGAD_FORM_MASK                 (0xF0000000)
    +#define MPI26_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE      (0x00000000)
    +#define MPI26_ENCLOS_PGAD_FORM_HANDLE               (0x10000000)
    +
    +#define MPI26_ENCLOS_PGAD_HANDLE_MASK               (0x0000FFFF)
     
     /* RAID Configuration PageAddress format */
     #define MPI2_RAID_PGAD_FORM_MASK                    (0xF0000000)
    @@ -403,6 +444,33 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD
     #define MPI2_ETHERNET_PGAD_IF_NUMBER_MASK           (0x000000FF)
     
     
    +/* PCIe Switch PageAddress format */
    +#define MPI26_PCIE_SWITCH_PGAD_FORM_MASK            (0xF0000000)
    +#define MPI26_PCIE_SWITCH_PGAD_FORM_GET_NEXT_HNDL   (0x00000000)
    +#define MPI26_PCIE_SWITCH_PGAD_FORM_HNDL_PORTNUM    (0x10000000)
    +#define MPI26_PCIE_SWITCH_EXPAND_PGAD_FORM_HNDL     (0x20000000)
    +
    +#define MPI26_PCIE_SWITCH_PGAD_HANDLE_MASK          (0x0000FFFF)
    +#define MPI26_PCIE_SWITCH_PGAD_PORTNUM_MASK         (0x00FF0000)
    +#define MPI26_PCIE_SWITCH_PGAD_PORTNUM_SHIFT        (16)
    +
    +
    +/* PCIe Device PageAddress format */
    +#define MPI26_PCIE_DEVICE_PGAD_FORM_MASK            (0xF0000000)
    +#define MPI26_PCIE_DEVICE_PGAD_FORM_GET_NEXT_HANDLE (0x00000000)
    +#define MPI26_PCIE_DEVICE_PGAD_FORM_HANDLE          (0x20000000)
    +
    +#define MPI26_PCIE_DEVICE_PGAD_HANDLE_MASK          (0x0000FFFF)
    +
    +/* PCIe Link PageAddress format */
    +#define MPI26_PCIE_LINK_PGAD_FORM_MASK            (0xF0000000)
    +#define MPI26_PCIE_LINK_PGAD_FORM_GET_NEXT_LINK   (0x00000000)
    +#define MPI26_PCIE_LINK_PGAD_FORM_LINK_NUM        (0x10000000)
    +
    +#define MPI26_PCIE_DEVICE_PGAD_LINKNUM_MASK       (0x000000FF)
    +
    +
    +
     /****************************************************************************
     *   Configuration messages
     ****************************************************************************/
    @@ -518,6 +586,20 @@ typedef struct _MPI2_CONFIG_REPLY
     #define MPI26_MFGPAGE_DEVID_SAS3324_3               (0x00C2)
     #define MPI26_MFGPAGE_DEVID_SAS3324_4               (0x00C3)
     
    +#define MPI26_MFGPAGE_DEVID_SAS3516                 (0x00AA)
    +#define MPI26_MFGPAGE_DEVID_SAS3516_1               (0x00AB)
    +#define MPI26_MFGPAGE_DEVID_SAS3416                 (0x00AC)
    +#define MPI26_MFGPAGE_DEVID_SAS3508                 (0x00AD)
    +#define MPI26_MFGPAGE_DEVID_SAS3508_1               (0x00AE)
    +#define MPI26_MFGPAGE_DEVID_SAS3408                 (0x00AF)
    +
    +#define MPI26_MFGPAGE_DEVID_SAS3716                 (0x00D0)
    +#define MPI26_MFGPAGE_DEVID_SAS3616                 (0x00D1)
    +#define MPI26_MFGPAGE_DEVID_SAS3708                 (0x00D2)
    +
    +#define MPI26_MFGPAGE_DEVID_SAS4008                 (0x00A1)
    +
    +
     /* Manufacturing Page 0 */
     
     typedef struct _MPI2_CONFIG_PAGE_MAN_0
    @@ -755,6 +837,12 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_
     #define MPI2_MANPAGE7_PINOUT_SFF_8644_8X                (0x0B)
     #define MPI2_MANPAGE7_PINOUT_SFF_8644_16X               (0x0C)
     #define MPI2_MANPAGE7_PINOUT_SFF_8436                   (0x0D)
    +#define MPI2_MANPAGE7_PINOUT_SFF_8088_A                 (0x0E)
    +#define MPI2_MANPAGE7_PINOUT_SFF_8643_16i               (0x0F)
    +#define MPI2_MANPAGE7_PINOUT_SFF_8654_4i                (0x10)
    +#define MPI2_MANPAGE7_PINOUT_SFF_8654_8i                (0x11)
    +#define MPI2_MANPAGE7_PINOUT_SFF_8611_4i                (0x12)
    +#define MPI2_MANPAGE7_PINOUT_SFF_8611_8i                (0x13)
     
     /* defines for the Location field */
     #define MPI2_MANPAGE7_LOCATION_UNKNOWN                  (0x01)
    @@ -1017,11 +1105,13 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT
     #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X2              (0x02)
     #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X4              (0x04)
     #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X8              (0x08)
    +#define MPI2_IOUNITPAGE7_PCIE_WIDTH_X16             (0x10)
     
     /* defines for IO Unit Page 7 PCIeSpeed field */
     #define MPI2_IOUNITPAGE7_PCIE_SPEED_2_5_GBPS        (0x00)
     #define MPI2_IOUNITPAGE7_PCIE_SPEED_5_0_GBPS        (0x01)
     #define MPI2_IOUNITPAGE7_PCIE_SPEED_8_0_GBPS        (0x02)
    +#define MPI2_IOUNITPAGE7_PCIE_SPEED_16_0_GBPS       (0x03)
     
     /* defines for IO Unit Page 7 ProcessorState field */
     #define MPI2_IOUNITPAGE7_PSTATE_MASK_SECOND         (0x0000000F)
    @@ -1079,6 +1169,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT
     /* defines for IO Unit Page 7 Flags field */
     #define MPI2_IOUNITPAGE7_FLAG_CABLE_POWER_EXC       (0x01)
     
    +
     /* IO Unit Page 8 */
     
     #define MPI2_IOUNIT8_NUM_THRESHOLDS     (4)
    @@ -1228,7 +1319,7 @@ typedef struct _MPI26_CONFIG_PAGE_IO_UNI
         U32                             Reserved3;                      /* 0x1C */
         U32                             Reserved4;                      /* 0x20 */
         U8                              BootDeviceWaitTime;             /* 0x24 */
    -    U8                              Reserved5;                      /* 0x25 */
    +    U8                              SATADeviceWaitTime;             /* 0x25 */
         U16                             Reserved6;                      /* 0x26 */
         U8                              NumPhys;                        /* 0x28 */
         U8                              PEInitialSpinupDelay;           /* 0x29 */
    @@ -1249,9 +1340,6 @@ typedef struct _MPI26_CONFIG_PAGE_IO_UNI
     
     
     
    -
    -
    -
     /****************************************************************************
     *   IOC Config Pages
     ****************************************************************************/
    @@ -1968,6 +2056,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS
     #define MPI2_SAS_NEG_LINK_RATE_3_0                      (0x09)
     #define MPI2_SAS_NEG_LINK_RATE_6_0                      (0x0A)
     #define MPI25_SAS_NEG_LINK_RATE_12_0                    (0x0B)
    +#define MPI26_SAS_NEG_LINK_RATE_22_5                    (0x0C)
     
     
     /* values for AttachedPhyInfo fields */
    @@ -2035,12 +2124,14 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS
     #define MPI2_SAS_PRATE_MAX_RATE_3_0                     (0x90)
     #define MPI2_SAS_PRATE_MAX_RATE_6_0                     (0xA0)
     #define MPI25_SAS_PRATE_MAX_RATE_12_0                   (0xB0)
    +#define MPI26_SAS_PRATE_MAX_RATE_22_5                   (0xC0)
     #define MPI2_SAS_PRATE_MIN_RATE_MASK                    (0x0F)
     #define MPI2_SAS_PRATE_MIN_RATE_NOT_PROGRAMMABLE        (0x00)
     #define MPI2_SAS_PRATE_MIN_RATE_1_5                     (0x08)
     #define MPI2_SAS_PRATE_MIN_RATE_3_0                     (0x09)
     #define MPI2_SAS_PRATE_MIN_RATE_6_0                     (0x0A)
     #define MPI25_SAS_PRATE_MIN_RATE_12_0                   (0x0B)
    +#define MPI26_SAS_PRATE_MIN_RATE_22_5                   (0x0C)
     
     
     /* values for SAS HwLinkRate fields */
    @@ -2049,11 +2140,13 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS
     #define MPI2_SAS_HWRATE_MAX_RATE_3_0                    (0x90)
     #define MPI2_SAS_HWRATE_MAX_RATE_6_0                    (0xA0)
     #define MPI25_SAS_HWRATE_MAX_RATE_12_0                  (0xB0)
    +#define MPI26_SAS_HWRATE_MAX_RATE_22_5                  (0xC0)
     #define MPI2_SAS_HWRATE_MIN_RATE_MASK                   (0x0F)
     #define MPI2_SAS_HWRATE_MIN_RATE_1_5                    (0x08)
     #define MPI2_SAS_HWRATE_MIN_RATE_3_0                    (0x09)
     #define MPI2_SAS_HWRATE_MIN_RATE_6_0                    (0x0A)
     #define MPI25_SAS_HWRATE_MIN_RATE_12_0                  (0x0B)
    +#define MPI26_SAS_HWRATE_MIN_RATE_22_5                  (0x0C)
     
     
     
    @@ -2227,11 +2320,13 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN
     #define MPI2_SASIOUNIT1_MAX_RATE_3_0                                (0x90)
     #define MPI2_SASIOUNIT1_MAX_RATE_6_0                                (0xA0)
     #define MPI25_SASIOUNIT1_MAX_RATE_12_0                              (0xB0)
    +#define MPI26_SASIOUNIT1_MAX_RATE_22_5                              (0xC0)
     #define MPI2_SASIOUNIT1_MIN_RATE_MASK                               (0x0F)
     #define MPI2_SASIOUNIT1_MIN_RATE_1_5                                (0x08)
     #define MPI2_SASIOUNIT1_MIN_RATE_3_0                                (0x09)
     #define MPI2_SASIOUNIT1_MIN_RATE_6_0                                (0x0A)
     #define MPI25_SASIOUNIT1_MIN_RATE_12_0                              (0x0B)
    +#define MPI26_SASIOUNIT1_MIN_RATE_22_5                              (0x0C)
     
     /* see mpi2_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */
     
    @@ -2718,7 +2813,6 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_DEV
     #define MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID             (0x0002)
     #define MPI2_SAS_DEVICE0_FLAGS_DEVICE_PRESENT               (0x0001)
     
    -
     /* SAS Device Page 1 */
     
     typedef struct _MPI2_CONFIG_PAGE_SAS_DEV_1
    @@ -2885,7 +2979,6 @@ typedef struct _MPI2_SASPHY3_PHY_EVENT_C
     #define MPI2_SASPHY3_EVENT_CODE_HOTPLUG_TIMEOUT             (0xD0)
     #define MPI2_SASPHY3_EVENT_CODE_MISALIGNED_MUX_PRIMITIVE    (0xD1)
     #define MPI2_SASPHY3_EVENT_CODE_RX_AIP                      (0xD2)
    -
     /* Following codes are product specific and in MPI v2.6 and later */
     #define MPI2_SASPHY3_EVENT_CODE_LCARB_WAIT_TIME             (0xD3)
     #define MPI2_SASPHY3_EVENT_CODE_RCVD_CONN_RESP_WAIT_TIME    (0xD4)
    @@ -2898,7 +2991,6 @@ typedef struct _MPI2_SASPHY3_PHY_EVENT_C
     #define MPI2_SASPHY3_EVENT_CODE_SATA_RX_START_RECEIVE       (0xDB)
     #define MPI2_SASPHY3_EVENT_CODE_SMP_RX_START_RECEIVE        (0xDC)
     
    -
     /* values for the CounterType field */
     #define MPI2_SASPHY3_COUNTER_TYPE_WRAPPING                  (0x00)
     #define MPI2_SASPHY3_COUNTER_TYPE_SATURATING                (0x01)
    @@ -2989,7 +3081,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_POR
     *   SAS Enclosure Config Pages
     ****************************************************************************/
     
    -/* SAS Enclosure Page 0 */
    +/* SAS Enclosure Page 0, Enclosure Page 0 */
     
     typedef struct _MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0
     {
    @@ -3007,7 +3099,10 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENC
         U32                                 Reserved4;                  /* 0x24 */
     } MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0,
       MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0,
    -  Mpi2SasEnclosurePage0_t, MPI2_POINTER pMpi2SasEnclosurePage0_t;
    +  Mpi2SasEnclosurePage0_t, MPI2_POINTER pMpi2SasEnclosurePage0_t,
    +  MPI26_CONFIG_PAGE_ENCLOSURE_0,
    +  MPI2_POINTER PTR_MPI26_CONFIG_PAGE_ENCLOSURE_0,
    +  Mpi26EnclosurePage0_t, MPI2_POINTER pMpi26EnclosurePage0_t;
     
     #define MPI2_SASENCLOSURE0_PAGEVERSION      (0x04)
     
    @@ -3021,6 +3116,17 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENC
     #define MPI2_SAS_ENCLS0_FLAGS_MNG_SES_ENCLOSURE     (0x0004)
     #define MPI2_SAS_ENCLS0_FLAGS_MNG_IOC_GPIO          (0x0005)
     
    +#define MPI26_ENCLOSURE0_PAGEVERSION        (0x04)
    +
    +/* Values for Enclosure Page 0 Flags field */
    +#define MPI26_ENCLS0_FLAGS_ENCL_LEVEL_VALID         (0x0010)
    +#define MPI26_ENCLS0_FLAGS_MNG_MASK                 (0x000F)
    +#define MPI26_ENCLS0_FLAGS_MNG_UNKNOWN              (0x0000)
    +#define MPI26_ENCLS0_FLAGS_MNG_IOC_SES              (0x0001)
    +#define MPI26_ENCLS0_FLAGS_MNG_IOC_SGPIO            (0x0002)
    +#define MPI26_ENCLS0_FLAGS_MNG_EXP_SGPIO            (0x0003)
    +#define MPI26_ENCLS0_FLAGS_MNG_SES_ENCLOSURE        (0x0004)
    +#define MPI26_ENCLS0_FLAGS_MNG_IOC_GPIO             (0x0005)
     
     /****************************************************************************
     *   Log Config Page
    @@ -3300,5 +3406,424 @@ typedef struct _MPI2_CONFIG_PAGE_EXT_MAN
     
     /* PageVersion should be provided by product-specific code */
     
    +
    +/****************************************************************************
    +*   values for fields used by several types of PCIe Config Pages
    +****************************************************************************/
    +
    +/* values for NegotiatedLinkRates fields */
    +#define MPI26_PCIE_NEG_LINK_RATE_MASK_PHYSICAL          (0x0F)
    +/* link rates used for Negotiated Physical Link Rate */
    +#define MPI26_PCIE_NEG_LINK_RATE_UNKNOWN                (0x00)
    +#define MPI26_PCIE_NEG_LINK_RATE_PHY_DISABLED           (0x01)
    +#define MPI26_PCIE_NEG_LINK_RATE_2_5                    (0x02)
    +#define MPI26_PCIE_NEG_LINK_RATE_5_0                    (0x03)
    +#define MPI26_PCIE_NEG_LINK_RATE_8_0                    (0x04)
    +#define MPI26_PCIE_NEG_LINK_RATE_16_0                   (0x05)
    +
    +
    +/****************************************************************************
    +*   PCIe IO Unit Config Pages (MPI v2.6 and later)
    +****************************************************************************/
    +
    +/* PCIe IO Unit Page 0 */
    +
    +typedef struct _MPI26_PCIE_IO_UNIT0_PHY_DATA
    +{
    +    U8          Link;                   /* 0x00 */
    +    U8          LinkFlags;              /* 0x01 */
    +    U8          PhyFlags;               /* 0x02 */
    +    U8          NegotiatedLinkRate;     /* 0x03 */
    +    U32         ControllerPhyDeviceInfo;/* 0x04 */
    +    U16         AttachedDevHandle;      /* 0x08 */
    +    U16         ControllerDevHandle;    /* 0x0A */
    +    U32         EnumerationStatus;      /* 0x0C */
    +    U32         Reserved1;              /* 0x10 */
    +} MPI26_PCIE_IO_UNIT0_PHY_DATA, MPI2_POINTER PTR_MPI26_PCIE_IO_UNIT0_PHY_DATA,
    +  Mpi26PCIeIOUnit0PhyData_t, MPI2_POINTER pMpi26PCIeIOUnit0PhyData_t;
    +
    +/*
    + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
    + * one and check the value returned for NumPhys at runtime.
    + */
    +#ifndef MPI26_PCIE_IOUNIT0_PHY_MAX
    +#define MPI26_PCIE_IOUNIT0_PHY_MAX      (1)
    +#endif
    +
    +typedef struct _MPI26_CONFIG_PAGE_PIOUNIT_0
    +{
    +    MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                                 /* 0x00 */
    +    U32                                 Reserved1;                              /* 0x08 */
    +    U8                                  NumPhys;                                /* 0x0C */
    +    U8                                  InitStatus;                             /* 0x0D */
    +    U16                                 Reserved3;                              /* 0x0E */
    +    MPI26_PCIE_IO_UNIT0_PHY_DATA        PhyData[MPI26_PCIE_IOUNIT0_PHY_MAX];    /* 0x10 */
    +} MPI26_CONFIG_PAGE_PIOUNIT_0,
    +  MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PIOUNIT_0,
    +  Mpi26PCIeIOUnitPage0_t, MPI2_POINTER pMpi26PCIeIOUnitPage0_t;
    +
    +#define MPI26_PCIEIOUNITPAGE0_PAGEVERSION                   (0x00)
    +
    +/* values for PCIe IO Unit Page 0 LinkFlags */
    +#define MPI26_PCIEIOUNIT0_LINKFLAGS_ENUMERATION_IN_PROGRESS (0x08)
    +
    +/* values for PCIe IO Unit Page 0 PhyFlags */
    +#define MPI26_PCIEIOUNIT0_PHYFLAGS_PHY_DISABLED             (0x08)
    +
    +/* use MPI26_PCIE_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
    +
    +/* see mpi2_pci.h for values for PCIe IO Unit Page 0 ControllerPhyDeviceInfo values */
    +
    +/* values for PCIe IO Unit Page 0 EnumerationStatus */
    +#define MPI26_PCIEIOUNIT0_ES_MAX_SWITCHES_EXCEEDED          (0x40000000)
    +#define MPI26_PCIEIOUNIT0_ES_MAX_DEVICES_EXCEEDED           (0x20000000)
    +
    +
    +/* PCIe IO Unit Page 1 */
    +
    +typedef struct _MPI26_PCIE_IO_UNIT1_PHY_DATA
    +{
    +    U8          Link;                       /* 0x00 */
    +    U8          LinkFlags;                  /* 0x01 */
    +    U8          PhyFlags;                   /* 0x02 */
    +    U8          MaxMinLinkRate;             /* 0x03 */
    +    U32         ControllerPhyDeviceInfo;    /* 0x04 */
    +    U32         Reserved1;                  /* 0x08 */
    +} MPI26_PCIE_IO_UNIT1_PHY_DATA, MPI2_POINTER PTR_MPI26_PCIE_IO_UNIT1_PHY_DATA,
    +  Mpi26PCIeIOUnit1PhyData_t, MPI2_POINTER pMpi26PCIeIOUnit1PhyData_t;
    +
    +/* values for LinkFlags */
    +#define MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SRIS    (0x00)
    +#define MPI26_PCIEIOUNIT1_LINKFLAGS_EN_SRIS     (0x01)
    +
    +/*
    + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
    + * one and check the value returned for NumPhys at runtime.
    + */
    +#ifndef MPI26_PCIE_IOUNIT1_PHY_MAX
    +#define MPI26_PCIE_IOUNIT1_PHY_MAX      (1)
    +#endif
    +
    +typedef struct _MPI26_CONFIG_PAGE_PIOUNIT_1
    +{
    +    MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                             /* 0x00 */
    +    U16                                 ControlFlags;                       /* 0x08 */
    +    U16                                 Reserved;                           /* 0x0A */
    +    U16                                 AdditionalControlFlags;             /* 0x0C */
    +    U16                                 NVMeMaxQueueDepth;                  /* 0x0E */
    +    U8                                  NumPhys;                            /* 0x10 */
    +    U8                                  Reserved1;                          /* 0x11 */
    +    U16                                 Reserved2;                          /* 0x12 */
    +    MPI26_PCIE_IO_UNIT1_PHY_DATA        PhyData[MPI26_PCIE_IOUNIT1_PHY_MAX];/* 0x14 */
    +} MPI26_CONFIG_PAGE_PIOUNIT_1,
    +  MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PIOUNIT_1,
    +  Mpi26PCIeIOUnitPage1_t, MPI2_POINTER pMpi26PCIeIOUnitPage1_t;
    +
    +#define MPI26_PCIEIOUNITPAGE1_PAGEVERSION   (0x00)
    +
    +/* values for PCIe IO Unit Page 1 PhyFlags */
    +#define MPI26_PCIEIOUNIT1_PHYFLAGS_PHY_DISABLE                      (0x08)
    +#define MPI26_PCIEIOUNIT1_PHYFLAGS_ENDPOINT_ONLY                    (0x01)
    +
    +/* values for PCIe IO Unit Page 1 MaxMinLinkRate */
    +#define MPI26_PCIEIOUNIT1_MAX_RATE_MASK                             (0xF0)
    +#define MPI26_PCIEIOUNIT1_MAX_RATE_SHIFT                            (4)
    +#define MPI26_PCIEIOUNIT1_MAX_RATE_2_5                              (0x20)
    +#define MPI26_PCIEIOUNIT1_MAX_RATE_5_0                              (0x30)
    +#define MPI26_PCIEIOUNIT1_MAX_RATE_8_0                              (0x40)
    +#define MPI26_PCIEIOUNIT1_MAX_RATE_16_0                             (0x50)
    +
    +/* see mpi2_pci.h for values for PCIe IO Unit Page 0 ControllerPhyDeviceInfo values */
    +
    +
    +/****************************************************************************
    +*   PCIe Switch Config Pages (MPI v2.6 and later)
    +****************************************************************************/
    +
    +/* PCIe Switch Page 0 */
    +
    +typedef struct _MPI26_CONFIG_PAGE_PSWITCH_0
    +{
    +    MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                     /* 0x00 */
    +    U8                                  PhysicalPort;               /* 0x08 */
    +    U8                                  Reserved1;                  /* 0x09 */
    +    U16                                 Reserved2;                  /* 0x0A */
    +    U16                                 DevHandle;                  /* 0x0C */
    +    U16                                 ParentDevHandle;            /* 0x0E */
    +    U8                                  NumPorts;                   /* 0x10 */
    +    U8                                  PCIeLevel;                  /* 0x11 */
    +    U16                                 Reserved3;                  /* 0x12 */
    +    U32                                 Reserved4;                  /* 0x14 */
    +    U32                                 Reserved5;                  /* 0x18 */
    +    U32                                 Reserved6;                  /* 0x1C */
    +} MPI26_CONFIG_PAGE_PSWITCH_0, MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PSWITCH_0,
    +  Mpi26PCIeSwitchPage0_t, MPI2_POINTER pMpi26PCIeSwitchPage0_t;
    +
    +#define MPI26_PCIESWITCH0_PAGEVERSION       (0x00)
    +
    +
    +/* PCIe Switch Page 1 */
    +
    +typedef struct _MPI26_CONFIG_PAGE_PSWITCH_1
    +{
    +    MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                     /* 0x00 */
    +    U8                                  PhysicalPort;               /* 0x08 */
    +    U8                                  Reserved1;                  /* 0x09 */
    +    U16                                 Reserved2;                  /* 0x0A */
    +    U8                                  NumPorts;                   /* 0x0C */
    +    U8                                  PortNum;                    /* 0x0D */
    +    U16                                 AttachedDevHandle;          /* 0x0E */
    +    U16                                 SwitchDevHandle;            /* 0x10 */
    +    U8                                  NegotiatedPortWidth;        /* 0x12 */
    +    U8                                  NegotiatedLinkRate;         /* 0x13 */
    +    U32                                 Reserved4;                  /* 0x14 */
    +    U32                                 Reserved5;                  /* 0x18 */
    +} MPI26_CONFIG_PAGE_PSWITCH_1, MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PSWITCH_1,
    +  Mpi26PCIeSwitchPage1_t, MPI2_POINTER pMpi26PCIeSwitchPage1_t;
    +
    +#define MPI26_PCIESWITCH1_PAGEVERSION       (0x00)
    +
    +/* use MPI26_PCIE_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
    +
    +
    +/****************************************************************************
    +*   PCIe Device Config Pages (MPI v2.6 and later)
    +****************************************************************************/
    +
    +/* PCIe Device Page 0 */
    +
    +typedef struct _MPI26_CONFIG_PAGE_PCIEDEV_0
    +{
    +    MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                 /* 0x00 */
    +    U16                                 Slot;                   /* 0x08 */
    +    U16                                 EnclosureHandle;        /* 0x0A */
    +    U64                                 WWID;                   /* 0x0C */
    +    U16                                 ParentDevHandle;        /* 0x14 */
    +    U8                                  PortNum;                /* 0x16 */
    +    U8                                  AccessStatus;           /* 0x17 */
    +    U16                                 DevHandle;              /* 0x18 */
    +    U8                                  PhysicalPort;           /* 0x1A */
    +    U8                                  Reserved1;              /* 0x1B */
    +    U32                                 DeviceInfo;             /* 0x1C */
    +    U32                                 Flags;                  /* 0x20 */
    +    U8                                  SupportedLinkRates;     /* 0x24 */
    +    U8                                  MaxPortWidth;           /* 0x25 */
    +    U8                                  NegotiatedPortWidth;    /* 0x26 */
    +    U8                                  NegotiatedLinkRate;     /* 0x27 */
    +    U8                                  EnclosureLevel;         /* 0x28 */
    +    U8                                  Reserved2;              /* 0x29 */
    +    U16                                 Reserved3;              /* 0x2A */
    +    U8                                  ConnectorName[4];       /* 0x2C */
    +    U32                                 Reserved4;              /* 0x30 */
    +    U32                                 Reserved5;              /* 0x34 */
    +} MPI26_CONFIG_PAGE_PCIEDEV_0, MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PCIEDEV_0,
    +  Mpi26PCIeDevicePage0_t, MPI2_POINTER pMpi26PCIeDevicePage0_t;
    +
    +#define MPI26_PCIEDEVICE0_PAGEVERSION       (0x01)
    +
    +/* values for PCIe Device Page 0 AccessStatus field */
    +#define MPI26_PCIEDEV0_ASTATUS_NO_ERRORS                    (0x00)
    +#define MPI26_PCIEDEV0_ASTATUS_NEEDS_INITIALIZATION         (0x04)
    +#define MPI26_PCIEDEV0_ASTATUS_CAPABILITY_FAILED            (0x02)
    +#define MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED               (0x07)
    +#define MPI26_PCIEDEV0_ASTATUS_MEMORY_SPACE_ACCESS_FAILED   (0x08)
    +#define MPI26_PCIEDEV0_ASTATUS_UNSUPPORTED_DEVICE           (0x09)
    +#define MPI26_PCIEDEV0_ASTATUS_MSIX_REQUIRED                (0x0A)
    +#define MPI26_PCIEDEV0_ASTATUS_UNKNOWN                      (0x10)
    +
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_READY_TIMEOUT           (0x30)
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_DEVCFG_UNSUPPORTED      (0x31)
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_IDENTIFY_FAILED         (0x32)
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_QCONFIG_FAILED          (0x33)
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_QCREATION_FAILED        (0x34)
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_EVENTCFG_FAILED         (0x35)
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_GET_FEATURE_STAT_FAILED (0x36)
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_IDLE_TIMEOUT            (0x37)
    +#define MPI26_PCIEDEV0_ASTATUS_NVME_FAILURE_STATUS          (0x38)
    +
    +#define MPI26_PCIEDEV0_ASTATUS_INIT_FAIL_MAX                (0x3F)
    +
    +/* see mpi2_pci.h for the MPI26_PCIE_DEVINFO_ defines used for the DeviceInfo field */
    +
    +/* values for PCIe Device Page 0 Flags field */
    +#define MPI26_PCIEDEV0_FLAGS_UNAUTHORIZED_DEVICE            (0x8000)
    +#define MPI26_PCIEDEV0_FLAGS_ENABLED_FAST_PATH              (0x4000)
    +#define MPI26_PCIEDEV0_FLAGS_FAST_PATH_CAPABLE              (0x2000)
    +#define MPI26_PCIEDEV0_FLAGS_ASYNCHRONOUS_NOTIFICATION      (0x0400)
    +#define MPI26_PCIEDEV0_FLAGS_ATA_SW_PRESERVATION            (0x0200)
    +#define MPI26_PCIEDEV0_FLAGS_UNSUPPORTED_DEVICE             (0x0100)
    +#define MPI26_PCIEDEV0_FLAGS_ATA_48BIT_LBA_SUPPORTED        (0x0080)
    +#define MPI26_PCIEDEV0_FLAGS_ATA_SMART_SUPPORTED            (0x0040)
    +#define MPI26_PCIEDEV0_FLAGS_ATA_NCQ_SUPPORTED              (0x0020)
    +#define MPI26_PCIEDEV0_FLAGS_ATA_FUA_SUPPORTED              (0x0010)
    +#define MPI26_PCIEDEV0_FLAGS_ENCL_LEVEL_VALID               (0x0002)
    +#define MPI26_PCIEDEV0_FLAGS_DEVICE_PRESENT                 (0x0001)
    +
    +/* values for PCIe Device Page 0 SupportedLinkRates field */
    +#define MPI26_PCIEDEV0_LINK_RATE_16_0_SUPPORTED             (0x08)
    +#define MPI26_PCIEDEV0_LINK_RATE_8_0_SUPPORTED              (0x04)
    +#define MPI26_PCIEDEV0_LINK_RATE_5_0_SUPPORTED              (0x02)
    +#define MPI26_PCIEDEV0_LINK_RATE_2_5_SUPPORTED              (0x01)
    +
    +/* use MPI26_PCIE_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
    +
    +
    +/* PCIe Device Page 2 */
    +
    +typedef struct _MPI26_CONFIG_PAGE_PCIEDEV_2
    +{
    +    MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                 /* 0x00 */
    +    U16                                 DevHandle;              /* 0x08 */
    +    U16                                 Reserved1;              /* 0x0A */
    +    U32                                 MaximumDataTransferSize;/* 0x0C */
    +    U32                                 Capabilities;           /* 0x10 */
    +    U32                                 Reserved2;              /* 0x14 */
    +} MPI26_CONFIG_PAGE_PCIEDEV_2, MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PCIEDEV_2,
    +  Mpi26PCIeDevicePage2_t, MPI2_POINTER pMpi26PCIeDevicePage2_t;
    +
    +#define MPI26_PCIEDEVICE2_PAGEVERSION       (0x00)
    +
    +/* defines for PCIe Device Page 2 Capabilities field */
    +#define MPI26_PCIEDEV2_CAP_SGL_FORMAT                  (0x00000004)
    +#define MPI26_PCIEDEV2_CAP_BIT_BUCKET_SUPPORT          (0x00000002)
    +#define MPI26_PCIEDEV2_CAP_SGL_SUPPORT                 (0x00000001)
    +
    +
    +/****************************************************************************
    +*   PCIe Link Config Pages (MPI v2.6 and later)
    +****************************************************************************/
    +
    +/* PCIe Link Page 1 */
    +
    +typedef struct _MPI26_CONFIG_PAGE_PCIELINK_1
    +{
    +    MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                     /* 0x00 */
    +    U8                                  Link;                       /* 0x08 */
    +    U8                                  Reserved1;                  /* 0x09 */
    +    U16                                 Reserved2;                  /* 0x0A */
    +    U32                                 CorrectableErrorCount;      /* 0x0C */
    +    U16                                 NonFatalErrorCount;         /* 0x10 */
    +    U16                                 Reserved3;                  /* 0x12 */
    +    U16                                 FatalErrorCount;            /* 0x14 */
    +    U16                                 Reserved4;                  /* 0x16 */
    +} MPI26_CONFIG_PAGE_PCIELINK_1, MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PCIELINK_1,
    +  Mpi26PcieLinkPage1_t, MPI2_POINTER pMpi26PcieLinkPage1_t;
    +
    +#define MPI26_PCIELINK1_PAGEVERSION            (0x00)
    +
    +/* PCIe Link Page 2 */
    +
    +typedef struct _MPI26_PCIELINK2_LINK_EVENT
    +{
    +    U8          LinkEventCode;      /* 0x00 */
    +    U8          Reserved1;          /* 0x01 */
    +    U16         Reserved2;          /* 0x02 */
    +    U32         LinkEventInfo;      /* 0x04 */
    +} MPI26_PCIELINK2_LINK_EVENT, MPI2_POINTER PTR_MPI26_PCIELINK2_LINK_EVENT,
    +  Mpi26PcieLink2LinkEvent_t, MPI2_POINTER pMpi26PcieLink2LinkEvent_t;
    +
    +/* use MPI26_PCIELINK3_EVTCODE_ for the LinkEventCode field */
    +
    +
    +/*
    + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
    + * one and check the value returned for NumLinkEvents at runtime.
    + */
    +#ifndef MPI26_PCIELINK2_LINK_EVENT_MAX
    +#define MPI26_PCIELINK2_LINK_EVENT_MAX      (1)
    +#endif
    +
    +typedef struct _MPI26_CONFIG_PAGE_PCIELINK_2
    +{
    +    MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                     /* 0x00 */
    +    U8                                  Link;                       /* 0x08 */
    +    U8                                  Reserved1;                  /* 0x09 */
    +    U16                                 Reserved2;                  /* 0x0A */
    +    U8                                  NumLinkEvents;              /* 0x0C */
    +    U8                                  Reserved3;                  /* 0x0D */
    +    U16                                 Reserved4;                  /* 0x0E */
    +    MPI26_PCIELINK2_LINK_EVENT          LinkEvent[MPI26_PCIELINK2_LINK_EVENT_MAX]; /* 0x10 */
    +} MPI26_CONFIG_PAGE_PCIELINK_2, MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PCIELINK_2,
    +  Mpi26PcieLinkPage2_t, MPI2_POINTER pMpi26PcieLinkPage2_t;
    +
    +#define MPI26_PCIELINK2_PAGEVERSION            (0x00)
    +
    +
    +/* PCIe Link Page 3 */
    +
    +typedef struct _MPI26_PCIELINK3_LINK_EVENT_CONFIG
    +{
    +    U8          LinkEventCode;      /* 0x00 */
    +    U8          Reserved1;          /* 0x01 */
    +    U16         Reserved2;          /* 0x02 */
    +    U8          CounterType;        /* 0x04 */
    +    U8          ThresholdWindow;    /* 0x05 */
    +    U8          TimeUnits;          /* 0x06 */
    +    U8          Reserved3;          /* 0x07 */
    +    U32         EventThreshold;     /* 0x08 */
    +    U16         ThresholdFlags;     /* 0x0C */
    +    U16         Reserved4;          /* 0x0E */
    +} MPI26_PCIELINK3_LINK_EVENT_CONFIG, MPI2_POINTER PTR_MPI26_PCIELINK3_LINK_EVENT_CONFIG,
    +  Mpi26PcieLink3LinkEventConfig_t, MPI2_POINTER pMpi26PcieLink3LinkEventConfig_t;
    +
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-head@freebsd.org  Wed May 17 22:05:08 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA655D71408;
     Wed, 17 May 2017 22:05:08 +0000 (UTC)
     (envelope-from loos@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 8A8FC825;
     Wed, 17 May 2017 22:05:08 +0000 (UTC)
     (envelope-from loos@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HM57nS057434;
     Wed, 17 May 2017 22:05:07 GMT (envelope-from loos@FreeBSD.org)
    Received: (from loos@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HM57p1057433;
     Wed, 17 May 2017 22:05:07 GMT (envelope-from loos@FreeBSD.org)
    Message-Id: <201705172205.v4HM57p1057433@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: loos set sender to
     loos@FreeBSD.org using -f
    From: Luiz Otavio O Souza 
    Date: Wed, 17 May 2017 22:05:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318428 - head/sys/boot/fdt/dts/arm
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 22:05:08 -0000
    
    Author: loos
    Date: Wed May 17 22:05:07 2017
    New Revision: 318428
    URL: https://svnweb.freebsd.org/changeset/base/318428
    
    Log:
      Fix the offset for the CPU0 MPIC registers.
      
      Please note that only a subset of CPU0 registers are exported.  CPU1
      registers are not touched.
      
      Obtained from:	ARMADA38X Functional Specifications
      Sponsored by:	Rubicon Communications, LLC (Netgate)
    
    Modified:
      head/sys/boot/fdt/dts/arm/armada-38x.dtsi
    
    Modified: head/sys/boot/fdt/dts/arm/armada-38x.dtsi
    ==============================================================================
    --- head/sys/boot/fdt/dts/arm/armada-38x.dtsi	Wed May 17 21:33:37 2017	(r318427)
    +++ head/sys/boot/fdt/dts/arm/armada-38x.dtsi	Wed May 17 22:05:07 2017	(r318428)
    @@ -419,7 +419,7 @@
     
     			mpic: interrupt-controller@20a00 {
     				compatible = "marvell,mpic";
    -				reg = <0x20a00 0x2d0>, <0x21070 0x58>;
    +				reg = <0x20a00 0x2d0>, <0x21870 0x58>;
     				#interrupt-cells = <1>;
     				#size-cells = <1>;
     				interrupt-controller;
    
    From owner-svn-src-head@freebsd.org  Wed May 17 22:13:10 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1401BD718A9;
     Wed, 17 May 2017 22:13:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id A7012EFE;
     Wed, 17 May 2017 22:13: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 v4HMD8Th061378;
     Wed, 17 May 2017 22:13:08 GMT (envelope-from jhb@FreeBSD.org)
    Received: (from jhb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HMD8Js061369;
     Wed, 17 May 2017 22:13:08 GMT (envelope-from jhb@FreeBSD.org)
    Message-Id: <201705172213.v4HMD8Js061369@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
     using -f
    From: John Baldwin 
    Date: Wed, 17 May 2017 22:13:08 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318429 - in head: share/man/man4 sys/conf sys/dev/cxgbe
     sys/dev/cxgbe/crypto sys/modules/cxgbe sys/modules/cxgbe/ccr sys/powerpc/conf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 22:13:10 -0000
    
    Author: jhb
    Date: Wed May 17 22:13:07 2017
    New Revision: 318429
    URL: https://svnweb.freebsd.org/changeset/base/318429
    
    Log:
      Add a driver for the Chelsio T6 crypto accelerator engine.
      
      The ccr(4) driver supports use of the crypto accelerator engine on
      Chelsio T6 NICs in "lookaside" mode via the opencrypto framework.
      
      Currently, the driver supports AES-CBC, AES-CTR, AES-GCM, and AES-XTS
      cipher algorithms as well as the SHA1-HMAC, SHA2-256-HMAC, SHA2-384-HMAC,
      and SHA2-512-HMAC authentication algorithms.  The driver also supports
      chaining one of AES-CBC, AES-CTR, or AES-XTS with an authentication
      algorithm for encrypt-then-authenticate operations.
      
      Note that this driver is still under active development and testing and
      may not yet be ready for production use.  It does pass the tests in
      tests/sys/opencrypto with the exception that the AES-GCM implementation
      in the driver does not yet support requests with a zero byte payload.
      
      To use this driver currently, the "uwire" configuration must be used
      along with explicitly enabling support for lookaside crypto capabilities
      in the cxgbe(4) driver.  These can be done by setting the following
      tunables before loading the cxgbe(4) driver:
      
          hw.cxgbe.config_file=uwire
          hw.cxgbe.cryptocaps_allowed=-1
      
      MFC after:	1 month
      Relnotes:	yes
      Sponsored by:	Chelsio Communications
      Differential Revision:	https://reviews.freebsd.org/D10763
    
    Added:
      head/share/man/man4/ccr.4   (contents, props changed)
      head/sys/dev/cxgbe/crypto/
      head/sys/dev/cxgbe/crypto/t4_crypto.c   (contents, props changed)
      head/sys/dev/cxgbe/crypto/t4_crypto.h   (contents, props changed)
      head/sys/modules/cxgbe/ccr/
      head/sys/modules/cxgbe/ccr/Makefile   (contents, props changed)
    Modified:
      head/share/man/man4/Makefile
      head/share/man/man4/cxgbe.4
      head/sys/conf/NOTES
      head/sys/conf/files
      head/sys/dev/cxgbe/adapter.h
      head/sys/modules/cxgbe/Makefile
      head/sys/powerpc/conf/NOTES
    
    Modified: head/share/man/man4/Makefile
    ==============================================================================
    --- head/share/man/man4/Makefile	Wed May 17 22:05:07 2017	(r318428)
    +++ head/share/man/man4/Makefile	Wed May 17 22:13:07 2017	(r318429)
    @@ -100,6 +100,7 @@ MAN=	aac.4 \
     	cc_newreno.4 \
     	cc_vegas.4 \
     	${_ccd.4} \
    +	ccr.4 \
     	cd.4 \
     	cdce.4 \
     	cfi.4 \
    
    Added: head/share/man/man4/ccr.4
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/share/man/man4/ccr.4	Wed May 17 22:13:07 2017	(r318429)
    @@ -0,0 +1,110 @@
    +.\" Copyright (c) 2017, Chelsio Inc
    +.\" 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 16, 2017
    +.Dt CCR 4
    +.Os
    +.Sh NAME
    +.Nm ccr
    +.Nd "Chelsio T6 crypto accelerator driver"
    +.Sh SYNOPSIS
    +To compile this driver into the kernel,
    +place the following lines in your
    +kernel configuration file:
    +.Bd -ragged -offset indeunt
    +.Cd "device ccr"
    +.Ed
    +.Pp
    +To load the driver as a
    +module at boot time, place the following line in
    +.Xr loader.conf 5 :
    +.Bd -literal -offset indent
    +ccr_load="YES"
    +.Ed
    +.Sh DESCRIPTION
    +The
    +.Nm
    +driver provides support for the crypto accelerator engine included on
    +PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6).
    +The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1-HMAC,
    +SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for
    +.Xr crypto 4
    +and
    +.Xr ipsec 4 .
    +The driver also supports chaining one of AES-CBC, AES-CTR, or AES-XTS with
    +SHA1-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, or SHA2-512-HMAC for
    +encrypt-then-authenticate operations.
    +For further hardware information and questions related to hardware
    +requirements, see
    +.Pa http://www.chelsio.com/ .
    +.Pp
    +The
    +.Nm
    +driver attaches as a child of an existing Chelsio NIC device and thus
    +requires that the
    +.Xr cxgbe 4
    +driver be active.
    +.Sh HARDWARE
    +The
    +.Nm
    +driver supports the crypto accelerator engine included on adapters
    +based on the T6 ASIC:
    +.Pp
    +.Bl -bullet -compact
    +.It
    +Chelsio T6225-CR
    +.It
    +Chelsio T6225-SO-CR
    +.It
    +Chelsio T62100-LP-CR
    +.It
    +Chelsio T62100-SO-CR
    +.It
    +Chelsio T62100-CR
    +.El
    +.Sh SUPPORT
    +For general information and support,
    +go to the Chelsio support website at:
    +.Pa http://www.chelsio.com/ .
    +.Pp
    +If an issue is identified with this driver with a supported adapter,
    +email all the specific information related to the issue to
    +.Aq Mt support@chelsio.com .
    +.Sh SEE ALSO
    +.Xr crypto 4 ,
    +.Xr cxgbe 4 ,
    +.Xr ipsec 4
    +.Sh HISTORY
    +The
    +.Nm
    +device driver first appeared in
    +.Fx 12.0 .
    +.Sh AUTHORS
    +.An -nosplit
    +The
    +.Nm
    +driver was written by
    +.An John Baldwin Aq Mt jhb@FreeBSD.org .
    
    Modified: head/share/man/man4/cxgbe.4
    ==============================================================================
    --- head/share/man/man4/cxgbe.4	Wed May 17 22:05:07 2017	(r318428)
    +++ head/share/man/man4/cxgbe.4	Wed May 17 22:13:07 2017	(r318429)
    @@ -31,7 +31,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd December 22, 2016
    +.Dd May 16, 2017
     .Dt CXGBE 4
     .Os
     .Sh NAME
    @@ -367,6 +367,7 @@ email all the specific information relat
     .Sh SEE ALSO
     .Xr altq 4 ,
     .Xr arp 4 ,
    +.Xr ccr 4 ,
     .Xr cxgb 4 ,
     .Xr cxgbev 4 ,
     .Xr netintro 4 ,
    
    Modified: head/sys/conf/NOTES
    ==============================================================================
    --- head/sys/conf/NOTES	Wed May 17 22:05:07 2017	(r318428)
    +++ head/sys/conf/NOTES	Wed May 17 22:13:07 2017	(r318429)
    @@ -2849,6 +2849,8 @@ device		cryptodev	# /dev/crypto for acce
     
     device		rndtest		# FIPS 140-2 entropy tester
     
    +device		ccr		# Chelsio T6
    +
     device		hifn		# Hifn 7951, 7781, etc.
     options 	HIFN_DEBUG	# enable debugging support: hw.hifn.debug
     options 	HIFN_RNDTEST	# enable rndtest support
    
    Modified: head/sys/conf/files
    ==============================================================================
    --- head/sys/conf/files	Wed May 17 22:05:07 2017	(r318428)
    +++ head/sys/conf/files	Wed May 17 22:13:07 2017	(r318429)
    @@ -1428,6 +1428,8 @@ t6fw.fw			optional cxgbe					\
     	compile-with	"${NORMAL_FW}"					\
     	no-obj no-implicit-rule						\
     	clean		"t6fw.fw"
    +dev/cxgbe/crypto/t4_crypto.c	optional ccr \
    +	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
     dev/cy/cy.c			optional cy
     dev/cy/cy_isa.c			optional cy isa
     dev/cy/cy_pci.c			optional cy pci
    
    Modified: head/sys/dev/cxgbe/adapter.h
    ==============================================================================
    --- head/sys/dev/cxgbe/adapter.h	Wed May 17 22:05:07 2017	(r318428)
    +++ head/sys/dev/cxgbe/adapter.h	Wed May 17 22:13:07 2017	(r318429)
    @@ -796,6 +796,7 @@ struct adapter {
     	struct tom_tunables tt;
     	void *iwarp_softc;	/* (struct c4iw_dev *) */
     	void *iscsi_ulp_softc;	/* (struct cxgbei_data *) */
    +	void *ccr_softc;	/* (struct ccr_softc *) */
     	struct l2t_data *l2t;	/* L2 table */
     	struct tid_info tids;
     
    
    Added: head/sys/dev/cxgbe/crypto/t4_crypto.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/sys/dev/cxgbe/crypto/t4_crypto.c	Wed May 17 22:13:07 2017	(r318429)
    @@ -0,0 +1,2102 @@
    +/*-
    + * Copyright (c) 2017 Chelsio Communications, Inc.
    + * All rights reserved.
    + * Written by: John Baldwin 
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + */
    +
    +#include 
    +__FBSDID("$FreeBSD$");
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include 
    +#include 
    +
    +#include "cryptodev_if.h"
    +
    +#include "common/common.h"
    +#include "crypto/t4_crypto.h"
    +
    +/*
    + * Requests consist of:
    + *
    + * +-------------------------------+
    + * | struct fw_crypto_lookaside_wr |
    + * +-------------------------------+
    + * | struct ulp_txpkt              |
    + * +-------------------------------+
    + * | struct ulptx_idata            |
    + * +-------------------------------+
    + * | struct cpl_tx_sec_pdu         |
    + * +-------------------------------+
    + * | struct cpl_tls_tx_scmd_fmt    |
    + * +-------------------------------+
    + * | key context header            |
    + * +-------------------------------+
    + * | AES key                       |  ----- For requests with AES
    + * +-------------------------------+ -
    + * | IPAD (16-byte aligned)        |  \
    + * +-------------------------------+  +---- For requests with HMAC
    + * | OPAD (16-byte aligned)        |  /
    + * +-------------------------------+ -
    + * | GMAC H                        |  ----- For AES-GCM
    + * +-------------------------------+ -
    + * | struct cpl_rx_phys_dsgl       |  \
    + * +-------------------------------+  +---- Destination buffer for
    + * | PHYS_DSGL entries             |  /     non-hash-only requests
    + * +-------------------------------+ -
    + * | 16 dummy bytes                |  ----- Only for hash-only requests
    + * +-------------------------------+
    + * | IV                            |  ----- If immediate IV
    + * +-------------------------------+
    + * | Payload                       |  ----- If immediate Payload
    + * +-------------------------------+ -
    + * | struct ulptx_sgl              |  \
    + * +-------------------------------+  +---- If payload via SGL
    + * | SGL entries                   |  /
    + * +-------------------------------+ -
    + *
    + * Note that the key context must be padded to ensure 16-byte alignment.
    + * For HMAC requests, the key consists of the partial hash of the IPAD
    + * followed by the partial hash of the OPAD.
    + *
    + * Replies consist of:
    + *
    + * +-------------------------------+
    + * | struct cpl_fw6_pld            |
    + * +-------------------------------+
    + * | hash digest                   |  ----- For HMAC request with
    + * +-------------------------------+        'hash_size' set in work request
    + *
    + * A 32-bit big-endian error status word is supplied in the last 4
    + * bytes of data[0] in the CPL_FW6_PLD message.  bit 0 indicates a
    + * "MAC" error and bit 1 indicates a "PAD" error.
    + *
    + * The 64-bit 'cookie' field from the fw_crypto_lookaside_wr message
    + * in the request is returned in data[1] of the CPL_FW6_PLD message.
    + *
    + * For block cipher replies, the updated IV is supplied in data[2] and
    + * data[3] of the CPL_FW6_PLD message.
    + *
    + * For hash replies where the work request set 'hash_size' to request
    + * a copy of the hash in the reply, the hash digest is supplied
    + * immediately following the CPL_FW6_PLD message.
    + */
    +
    +/*
    + * The documentation for CPL_RX_PHYS_DSGL claims a maximum of 32
    + * SG entries.
    + */
    +#define	MAX_RX_PHYS_DSGL_SGE	32
    +#define	DSGL_SGE_MAXLEN		65535
    +
    +static MALLOC_DEFINE(M_CCR, "ccr", "Chelsio T6 crypto");
    +
    +struct ccr_session_hmac {
    +	struct auth_hash *auth_hash;
    +	int hash_len;
    +	unsigned int partial_digest_len;
    +	unsigned int auth_mode;
    +	unsigned int mk_size;
    +	char ipad[CHCR_HASH_MAX_BLOCK_SIZE_128];
    +	char opad[CHCR_HASH_MAX_BLOCK_SIZE_128];
    +};
    +
    +struct ccr_session_gmac {
    +	int hash_len;
    +	char ghash_h[GMAC_BLOCK_LEN];
    +};
    +
    +struct ccr_session_blkcipher {
    +	unsigned int cipher_mode;
    +	unsigned int key_len;
    +	unsigned int iv_len;
    +	__be32 key_ctx_hdr;
    +	char enckey[CHCR_AES_MAX_KEY_LEN];
    +	char deckey[CHCR_AES_MAX_KEY_LEN];
    +};
    +
    +struct ccr_session {
    +	bool active;
    +	int pending;
    +	enum { HMAC, BLKCIPHER, AUTHENC, GCM } mode;
    +	union {
    +		struct ccr_session_hmac hmac;
    +		struct ccr_session_gmac gmac;
    +	};
    +	struct ccr_session_blkcipher blkcipher;
    +};
    +
    +struct ccr_softc {
    +	struct adapter *adapter;
    +	device_t dev;
    +	uint32_t cid;
    +	int tx_channel_id;
    +	struct ccr_session *sessions;
    +	int nsessions;
    +	struct mtx lock;
    +	bool detaching;
    +	struct sge_wrq *txq;
    +	struct sge_rxq *rxq;
    +
    +	/*
    +	 * Pre-allocate S/G lists used when preparing a work request.
    +	 * 'sg_crp' contains an sglist describing the entire buffer
    +	 * for a 'struct cryptop'.  'sg_ulptx' is used to describe
    +	 * the data the engine should DMA as input via ULPTX_SGL.
    +	 * 'sg_dsgl' is used to describe the destination that cipher
    +	 * text and a tag should be written to.
    +	 */
    +	struct sglist *sg_crp;
    +	struct sglist *sg_ulptx;
    +	struct sglist *sg_dsgl;
    +
    +	/* Statistics. */
    +	uint64_t stats_blkcipher_encrypt;
    +	uint64_t stats_blkcipher_decrypt;
    +	uint64_t stats_hmac;
    +	uint64_t stats_authenc_encrypt;
    +	uint64_t stats_authenc_decrypt;
    +	uint64_t stats_gcm_encrypt;
    +	uint64_t stats_gcm_decrypt;
    +	uint64_t stats_wr_nomem;
    +	uint64_t stats_inflight;
    +	uint64_t stats_mac_error;
    +	uint64_t stats_pad_error;
    +	uint64_t stats_bad_session;
    +	uint64_t stats_sglist_error;
    +	uint64_t stats_process_error;
    +};
    +
    +/*
    + * Crypto requests involve two kind of scatter/gather lists.
    + *
    + * Non-hash-only requests require a PHYS_DSGL that describes the
    + * location to store the results of the encryption or decryption
    + * operation.  This SGL uses a different format (PHYS_DSGL) and should
    + * exclude the crd_skip bytes at the start of the data as well as
    + * any AAD or IV.  For authenticated encryption requests it should
    + * cover include the destination of the hash or tag.
    + *
    + * The input payload may either be supplied inline as immediate data,
    + * or via a standard ULP_TX SGL.  This SGL should include AAD,
    + * ciphertext, and the hash or tag for authenticated decryption
    + * requests.
    + *
    + * These scatter/gather lists can describe different subsets of the
    + * buffer described by the crypto operation.  ccr_populate_sglist()
    + * generates a scatter/gather list that covers the entire crypto
    + * operation buffer that is then used to construct the other
    + * scatter/gather lists.
    + */
    +static int
    +ccr_populate_sglist(struct sglist *sg, struct cryptop *crp)
    +{
    +	int error;
    +
    +	sglist_reset(sg);
    +	if (crp->crp_flags & CRYPTO_F_IMBUF)
    +		error = sglist_append_mbuf(sg, (struct mbuf *)crp->crp_buf);
    +	else if (crp->crp_flags & CRYPTO_F_IOV)
    +		error = sglist_append_uio(sg, (struct uio *)crp->crp_buf);
    +	else
    +		error = sglist_append(sg, crp->crp_buf, crp->crp_ilen);
    +	return (error);
    +}
    +
    +/*
    + * Segments in 'sg' larger than 'maxsegsize' are counted as multiple
    + * segments.
    + */
    +static int
    +ccr_count_sgl(struct sglist *sg, int maxsegsize)
    +{
    +	int i, nsegs;
    +
    +	nsegs = 0;
    +	for (i = 0; i < sg->sg_nseg; i++)
    +		nsegs += howmany(sg->sg_segs[i].ss_len, maxsegsize);
    +	return (nsegs);
    +}
    +
    +/* These functions deal with PHYS_DSGL for the reply buffer. */
    +static inline int
    +ccr_phys_dsgl_len(int nsegs)
    +{
    +	int len;
    +
    +	len = (nsegs / 8) * sizeof(struct phys_sge_pairs);
    +	if ((nsegs % 8) != 0) {
    +		len += sizeof(uint16_t) * 8;
    +		len += roundup2(nsegs % 8, 2) * sizeof(uint64_t);
    +	}
    +	return (len);
    +}
    +
    +static void
    +ccr_write_phys_dsgl(struct ccr_softc *sc, void *dst, int nsegs)
    +{
    +	struct sglist *sg;
    +	struct cpl_rx_phys_dsgl *cpl;
    +	struct phys_sge_pairs *sgl;
    +	vm_paddr_t paddr;
    +	size_t seglen;
    +	u_int i, j;
    +
    +	sg = sc->sg_dsgl;
    +	cpl = dst;
    +	cpl->op_to_tid = htobe32(V_CPL_RX_PHYS_DSGL_OPCODE(CPL_RX_PHYS_DSGL) |
    +	    V_CPL_RX_PHYS_DSGL_ISRDMA(0));
    +	cpl->pcirlxorder_to_noofsgentr = htobe32(
    +	    V_CPL_RX_PHYS_DSGL_PCIRLXORDER(0) |
    +	    V_CPL_RX_PHYS_DSGL_PCINOSNOOP(0) |
    +	    V_CPL_RX_PHYS_DSGL_PCITPHNTENB(0) | V_CPL_RX_PHYS_DSGL_DCAID(0) |
    +	    V_CPL_RX_PHYS_DSGL_NOOFSGENTR(nsegs));
    +	cpl->rss_hdr_int.opcode = CPL_RX_PHYS_ADDR;
    +	cpl->rss_hdr_int.qid = htobe16(sc->rxq->iq.abs_id);
    +	cpl->rss_hdr_int.hash_val = 0;
    +	sgl = (struct phys_sge_pairs *)(cpl + 1);
    +	j = 0;
    +	for (i = 0; i < sg->sg_nseg; i++) {
    +		seglen = sg->sg_segs[i].ss_len;
    +		paddr = sg->sg_segs[i].ss_paddr;
    +		do {
    +			sgl->addr[j] = htobe64(paddr);
    +			if (seglen > DSGL_SGE_MAXLEN) {
    +				sgl->len[j] = htobe16(DSGL_SGE_MAXLEN);
    +				paddr += DSGL_SGE_MAXLEN;
    +				seglen -= DSGL_SGE_MAXLEN;
    +			} else {
    +				sgl->len[j] = htobe16(seglen);
    +				seglen = 0;
    +			}
    +			j++;
    +			if (j == 8) {
    +				sgl++;
    +				j = 0;
    +			}
    +		} while (seglen != 0);
    +	}
    +	MPASS(j + 8 * (sgl - (struct phys_sge_pairs *)(cpl + 1)) == nsegs);
    +}
    +
    +/* These functions deal with the ULPTX_SGL for input payload. */
    +static inline int
    +ccr_ulptx_sgl_len(int nsegs)
    +{
    +	u_int n;
    +
    +	nsegs--; /* first segment is part of ulptx_sgl */
    +	n = sizeof(struct ulptx_sgl) + 8 * ((3 * nsegs) / 2 + (nsegs & 1));
    +	return (roundup2(n, 16));
    +}
    +
    +static void
    +ccr_write_ulptx_sgl(struct ccr_softc *sc, void *dst, int nsegs)
    +{
    +	struct ulptx_sgl *usgl;
    +	struct sglist *sg;
    +	struct sglist_seg *ss;
    +	int i;
    +
    +	sg = sc->sg_ulptx;
    +	MPASS(nsegs == sg->sg_nseg);
    +	ss = &sg->sg_segs[0];
    +	usgl = dst;
    +	usgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) |
    +	    V_ULPTX_NSGE(nsegs));
    +	usgl->len0 = htobe32(ss->ss_len);
    +	usgl->addr0 = htobe64(ss->ss_paddr);
    +	ss++;
    +	for (i = 0; i < sg->sg_nseg - 1; i++) {
    +		usgl->sge[i / 2].len[i & 1] = htobe32(ss->ss_len);
    +		usgl->sge[i / 2].addr[i & 1] = htobe64(ss->ss_paddr);
    +		ss++;
    +	}
    +	
    +}
    +
    +static bool
    +ccr_use_imm_data(u_int transhdr_len, u_int input_len)
    +{
    +
    +	if (input_len > CRYPTO_MAX_IMM_TX_PKT_LEN)
    +		return (false);
    +	if (roundup2(transhdr_len, 16) + roundup2(input_len, 16) >
    +	    SGE_MAX_WR_LEN)
    +		return (false);
    +	return (true);
    +}
    +
    +static void
    +ccr_populate_wreq(struct ccr_softc *sc, struct chcr_wr *crwr, u_int kctx_len,
    +    u_int wr_len, uint32_t sid, u_int imm_len, u_int sgl_len, u_int hash_size,
    +    u_int iv_loc, struct cryptop *crp)
    +{
    +	u_int cctx_size;
    +
    +	cctx_size = sizeof(struct _key_ctx) + kctx_len;
    +	crwr->wreq.op_to_cctx_size = htobe32(
    +	    V_FW_CRYPTO_LOOKASIDE_WR_OPCODE(FW_CRYPTO_LOOKASIDE_WR) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_COMPL(0) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN(imm_len) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC(1) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE(cctx_size >> 4));
    +	crwr->wreq.len16_pkd = htobe32(
    +	    V_FW_CRYPTO_LOOKASIDE_WR_LEN16(wr_len / 16));
    +	crwr->wreq.session_id = htobe32(sid);
    +	crwr->wreq.rx_chid_to_rx_q_id = htobe32(
    +	    V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(sc->tx_channel_id) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_LCB(0) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_PHASH(0) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_IV(iv_loc) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_FQIDX(0) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_TX_CH(0) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID(sc->rxq->iq.abs_id));
    +	crwr->wreq.key_addr = 0;
    +	crwr->wreq.pld_size_hash_size = htobe32(
    +	    V_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE(sgl_len) |
    +	    V_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE(hash_size));
    +	crwr->wreq.cookie = htobe64((uintptr_t)crp);
    +
    +	crwr->ulptx.cmd_dest = htobe32(V_ULPTX_CMD(ULP_TX_PKT) |
    +	    V_ULP_TXPKT_DATAMODIFY(0) |
    +	    V_ULP_TXPKT_CHANNELID(sc->tx_channel_id) | V_ULP_TXPKT_DEST(0) |
    +	    V_ULP_TXPKT_FID(0) | V_ULP_TXPKT_RO(1));
    +	crwr->ulptx.len = htobe32(
    +	    ((wr_len - sizeof(struct fw_crypto_lookaside_wr)) / 16));
    +
    +	crwr->sc_imm.cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM) |
    +	    V_ULP_TX_SC_MORE(imm_len != 0 ? 0 : 1));
    +	crwr->sc_imm.len = htobe32(wr_len - offsetof(struct chcr_wr, sec_cpl) -
    +	    sgl_len);
    +}
    +
    +static int
    +ccr_hmac(struct ccr_softc *sc, uint32_t sid, struct ccr_session *s,
    +    struct cryptop *crp)
    +{
    +	struct chcr_wr *crwr;
    +	struct wrqe *wr;
    +	struct auth_hash *axf;
    +	struct cryptodesc *crd;
    +	char *dst;
    +	u_int hash_size_in_response, kctx_flits, kctx_len, transhdr_len, wr_len;
    +	u_int imm_len, iopad_size;
    +	int error, sgl_nsegs, sgl_len;
    +
    +	axf = s->hmac.auth_hash;
    +
    +	/* PADs must be 128-bit aligned. */
    +	iopad_size = roundup2(s->hmac.partial_digest_len, 16);
    +
    +	/*
    +	 * The 'key' part of the context includes the aligned IPAD and
    +	 * OPAD.
    +	 */
    +	kctx_len = iopad_size * 2;
    +	hash_size_in_response = axf->hashsize;
    +	transhdr_len = HASH_TRANSHDR_SIZE(kctx_len);
    +
    +	crd = crp->crp_desc;
    +	if (ccr_use_imm_data(transhdr_len, crd->crd_len)) {
    +		imm_len = crd->crd_len;
    +		sgl_nsegs = 0;
    +		sgl_len = 0;
    +	} else {
    +		imm_len = 0;
    +		sglist_reset(sc->sg_ulptx);
    +		error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp,
    +		    crd->crd_skip, crd->crd_len);
    +		if (error)
    +			return (error);
    +		sgl_nsegs = sc->sg_ulptx->sg_nseg;
    +		sgl_len = ccr_ulptx_sgl_len(sgl_nsegs);
    +	}
    +
    +	wr_len = roundup2(transhdr_len, 16) + roundup2(imm_len, 16) + sgl_len;
    +	wr = alloc_wrqe(wr_len, sc->txq);
    +	if (wr == NULL) {
    +		sc->stats_wr_nomem++;
    +		return (ENOMEM);
    +	}
    +	crwr = wrtod(wr);
    +	memset(crwr, 0, wr_len);
    +
    +	ccr_populate_wreq(sc, crwr, kctx_len, wr_len, sid, imm_len, sgl_len,
    +	    hash_size_in_response, IV_NOP, crp);
    +
    +	/* XXX: Hardcodes SGE loopback channel of 0. */
    +	crwr->sec_cpl.op_ivinsrtofst = htobe32(
    +	    V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) |
    +	    V_CPL_TX_SEC_PDU_RXCHID(sc->tx_channel_id) |
    +	    V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) |
    +	    V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) |
    +	    V_CPL_TX_SEC_PDU_IVINSRTOFST(0));
    +
    +	crwr->sec_cpl.pldlen = htobe32(crd->crd_len);
    +
    +	crwr->sec_cpl.cipherstop_lo_authinsert = htobe32(
    +	    V_CPL_TX_SEC_PDU_AUTHSTART(1) | V_CPL_TX_SEC_PDU_AUTHSTOP(0));
    +
    +	/* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */
    +	crwr->sec_cpl.seqno_numivs = htobe32(
    +	    V_SCMD_SEQ_NO_CTRL(0) |
    +	    V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) |
    +	    V_SCMD_CIPH_MODE(CHCR_SCMD_CIPHER_MODE_NOP) |
    +	    V_SCMD_AUTH_MODE(s->hmac.auth_mode) |
    +	    V_SCMD_HMAC_CTRL(CHCR_SCMD_HMAC_CTRL_NO_TRUNC));
    +	crwr->sec_cpl.ivgen_hdrlen = htobe32(
    +	    V_SCMD_LAST_FRAG(0) | V_SCMD_MORE_FRAGS(0) | V_SCMD_MAC_ONLY(1));
    +
    +	memcpy(crwr->key_ctx.key, s->hmac.ipad, s->hmac.partial_digest_len);
    +	memcpy(crwr->key_ctx.key + iopad_size, s->hmac.opad,
    +	    s->hmac.partial_digest_len);
    +
    +	/* XXX: F_KEY_CONTEXT_SALT_PRESENT set, but 'salt' not set. */
    +	kctx_flits = (sizeof(struct _key_ctx) + kctx_len) / 16;
    +	crwr->key_ctx.ctx_hdr = htobe32(V_KEY_CONTEXT_CTX_LEN(kctx_flits) |
    +	    V_KEY_CONTEXT_OPAD_PRESENT(1) | V_KEY_CONTEXT_SALT_PRESENT(1) |
    +	    V_KEY_CONTEXT_CK_SIZE(CHCR_KEYCTX_NO_KEY) |
    +	    V_KEY_CONTEXT_MK_SIZE(s->hmac.mk_size) | V_KEY_CONTEXT_VALID(1));
    +
    +	dst = (char *)(crwr + 1) + kctx_len + DUMMY_BYTES;
    +	if (imm_len != 0)
    +		crypto_copydata(crp->crp_flags, crp->crp_buf, crd->crd_skip,
    +		    crd->crd_len, dst);
    +	else
    +		ccr_write_ulptx_sgl(sc, dst, sgl_nsegs);
    +
    +	/* XXX: TODO backpressure */
    +	t4_wrq_tx(sc->adapter, wr);
    +
    +	return (0);
    +}
    +
    +static int
    +ccr_hmac_done(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp,
    +    const struct cpl_fw6_pld *cpl, int error)
    +{
    +	struct cryptodesc *crd;
    +
    +	crd = crp->crp_desc;
    +	if (error == 0) {
    +		crypto_copyback(crp->crp_flags, crp->crp_buf, crd->crd_inject,
    +		    s->hmac.hash_len, (c_caddr_t)(cpl + 1));
    +	}
    +
    +	return (error);
    +}
    +
    +static int
    +ccr_blkcipher(struct ccr_softc *sc, uint32_t sid, struct ccr_session *s,
    +    struct cryptop *crp)
    +{
    +	char iv[CHCR_MAX_CRYPTO_IV_LEN];
    +	struct chcr_wr *crwr;
    +	struct wrqe *wr;
    +	struct cryptodesc *crd;
    +	char *dst;
    +	u_int iv_loc, kctx_len, key_half, op_type, transhdr_len, wr_len;
    +	u_int imm_len;
    +	int dsgl_nsegs, dsgl_len;
    +	int sgl_nsegs, sgl_len;
    +	int error;
    +
    +	crd = crp->crp_desc;
    +
    +	if (s->blkcipher.key_len == 0)
    +		return (EINVAL);
    +	if (crd->crd_alg == CRYPTO_AES_CBC &&
    +	    (crd->crd_len % AES_BLOCK_LEN) != 0)
    +		return (EINVAL);
    +
    +	iv_loc = IV_NOP;
    +	if (crd->crd_flags & CRD_F_ENCRYPT) {
    +		op_type = CHCR_ENCRYPT_OP;
    +		if (crd->crd_flags & CRD_F_IV_EXPLICIT)
    +			memcpy(iv, crd->crd_iv, s->blkcipher.iv_len);
    +		else
    +			arc4rand(iv, s->blkcipher.iv_len, 0);
    +		iv_loc = IV_IMMEDIATE;
    +		if ((crd->crd_flags & CRD_F_IV_PRESENT) == 0)
    +			crypto_copyback(crp->crp_flags, crp->crp_buf,
    +			    crd->crd_inject, s->blkcipher.iv_len, iv);
    +	} else {
    +		op_type = CHCR_DECRYPT_OP;
    +		if (crd->crd_flags & CRD_F_IV_EXPLICIT) {
    +			memcpy(iv, crd->crd_iv, s->blkcipher.iv_len);
    +			iv_loc = IV_IMMEDIATE;
    +		} else
    +			iv_loc = IV_DSGL;
    +	}
    +
    +	sglist_reset(sc->sg_dsgl);
    +	error = sglist_append_sglist(sc->sg_dsgl, sc->sg_crp, crd->crd_skip,
    +	    crd->crd_len);
    +	if (error)
    +		return (error);
    +	dsgl_nsegs = ccr_count_sgl(sc->sg_dsgl, DSGL_SGE_MAXLEN);
    +	if (dsgl_nsegs > MAX_RX_PHYS_DSGL_SGE)
    +		return (EFBIG);
    +	dsgl_len = ccr_phys_dsgl_len(dsgl_nsegs);
    +
    +	/* The 'key' must be 128-bit aligned. */
    +	kctx_len = roundup2(s->blkcipher.key_len, 16);
    +	transhdr_len = CIPHER_TRANSHDR_SIZE(kctx_len, dsgl_len);
    +
    +	if (ccr_use_imm_data(transhdr_len, crd->crd_len +
    +	    s->blkcipher.iv_len)) {
    +		imm_len = crd->crd_len;
    +		if (iv_loc == IV_DSGL) {
    +			crypto_copydata(crp->crp_flags, crp->crp_buf,
    +			    crd->crd_inject, s->blkcipher.iv_len, iv);
    +			iv_loc = IV_IMMEDIATE;
    +		}
    +		sgl_nsegs = 0;
    +		sgl_len = 0;
    +	} else {
    +		imm_len = 0;
    +		sglist_reset(sc->sg_ulptx);
    +		if (iv_loc == IV_DSGL) {
    +			error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp,
    +			    crd->crd_inject, s->blkcipher.iv_len);
    +			if (error)
    +				return (error);
    +		}
    +		error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp,
    +		    crd->crd_skip, crd->crd_len);
    +		if (error)
    +			return (error);
    +		sgl_nsegs = sc->sg_ulptx->sg_nseg;
    +		sgl_len = ccr_ulptx_sgl_len(sgl_nsegs);
    +	}
    +
    +	wr_len = roundup2(transhdr_len, 16) + roundup2(imm_len, 16) + sgl_len;
    +	if (iv_loc == IV_IMMEDIATE)
    +		wr_len += s->blkcipher.iv_len;
    +	wr = alloc_wrqe(wr_len, sc->txq);
    +	if (wr == NULL) {
    +		sc->stats_wr_nomem++;
    +		return (ENOMEM);
    +	}
    +	crwr = wrtod(wr);
    +	memset(crwr, 0, wr_len);
    +
    +	ccr_populate_wreq(sc, crwr, kctx_len, wr_len, sid, imm_len, sgl_len, 0,
    +	    iv_loc, crp);
    +
    +	/* XXX: Hardcodes SGE loopback channel of 0. */
    +	crwr->sec_cpl.op_ivinsrtofst = htobe32(
    +	    V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) |
    +	    V_CPL_TX_SEC_PDU_RXCHID(sc->tx_channel_id) |
    +	    V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) |
    +	    V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) |
    +	    V_CPL_TX_SEC_PDU_IVINSRTOFST(1));
    +
    +	crwr->sec_cpl.pldlen = htobe32(s->blkcipher.iv_len + crd->crd_len);
    +
    +	crwr->sec_cpl.aadstart_cipherstop_hi = htobe32(
    +	    V_CPL_TX_SEC_PDU_CIPHERSTART(s->blkcipher.iv_len + 1) |
    +	    V_CPL_TX_SEC_PDU_CIPHERSTOP_HI(0));
    +	crwr->sec_cpl.cipherstop_lo_authinsert = htobe32(
    +	    V_CPL_TX_SEC_PDU_CIPHERSTOP_LO(0));
    +
    +	/* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */
    +	crwr->sec_cpl.seqno_numivs = htobe32(
    +	    V_SCMD_SEQ_NO_CTRL(0) |
    +	    V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) |
    +	    V_SCMD_ENC_DEC_CTRL(op_type) |
    +	    V_SCMD_CIPH_MODE(s->blkcipher.cipher_mode) |
    +	    V_SCMD_AUTH_MODE(CHCR_SCMD_AUTH_MODE_NOP) |
    +	    V_SCMD_HMAC_CTRL(CHCR_SCMD_HMAC_CTRL_NOP) |
    +	    V_SCMD_IV_SIZE(s->blkcipher.iv_len / 2) |
    +	    V_SCMD_NUM_IVS(0));
    +	crwr->sec_cpl.ivgen_hdrlen = htobe32(
    +	    V_SCMD_IV_GEN_CTRL(0) |
    +	    V_SCMD_MORE_FRAGS(0) | V_SCMD_LAST_FRAG(0) | V_SCMD_MAC_ONLY(0) |
    +	    V_SCMD_AADIVDROP(1) | V_SCMD_HDR_LEN(dsgl_len));
    +
    +	crwr->key_ctx.ctx_hdr = s->blkcipher.key_ctx_hdr;
    +	switch (crd->crd_alg) {
    +	case CRYPTO_AES_CBC:
    +		if (crd->crd_flags & CRD_F_ENCRYPT)
    +			memcpy(crwr->key_ctx.key, s->blkcipher.enckey,
    +			    s->blkcipher.key_len);
    +		else
    +			memcpy(crwr->key_ctx.key, s->blkcipher.deckey,
    +			    s->blkcipher.key_len);
    +		break;
    +	case CRYPTO_AES_ICM:
    +		memcpy(crwr->key_ctx.key, s->blkcipher.enckey,
    +		    s->blkcipher.key_len);
    +		break;
    +	case CRYPTO_AES_XTS:
    +		key_half = s->blkcipher.key_len / 2;
    +		memcpy(crwr->key_ctx.key, s->blkcipher.enckey + key_half,
    +		    key_half);
    +		if (crd->crd_flags & CRD_F_ENCRYPT)
    +			memcpy(crwr->key_ctx.key + key_half,
    +			    s->blkcipher.enckey, key_half);
    +		else
    +			memcpy(crwr->key_ctx.key + key_half,
    +			    s->blkcipher.deckey, key_half);
    +		break;
    +	}
    +
    +	dst = (char *)(crwr + 1) + kctx_len;
    +	ccr_write_phys_dsgl(sc, dst, dsgl_nsegs);
    +	dst += sizeof(struct cpl_rx_phys_dsgl) + dsgl_len;
    +	if (iv_loc == IV_IMMEDIATE) {
    +		memcpy(dst, iv, s->blkcipher.iv_len);
    +		dst += s->blkcipher.iv_len;
    +	}
    +	if (imm_len != 0)
    +		crypto_copydata(crp->crp_flags, crp->crp_buf, crd->crd_skip,
    +		    crd->crd_len, dst);
    +	else
    +		ccr_write_ulptx_sgl(sc, dst, sgl_nsegs);
    +
    +	/* XXX: TODO backpressure */
    +	t4_wrq_tx(sc->adapter, wr);
    +
    +	return (0);
    +}
    +
    +static int
    +ccr_blkcipher_done(struct ccr_softc *sc, struct ccr_session *s,
    +    struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error)
    +{
    +
    +	/*
    +	 * The updated IV to permit chained requests is at
    +	 * cpl->data[2], but OCF doesn't permit chained requests.
    +	 */
    +	return (error);
    +}
    +
    +/*
    + * 'hashsize' is the length of a full digest.  'authsize' is the
    + * requested digest length for this operation which may be less
    + * than 'hashsize'.
    + */
    +static int
    +ccr_hmac_ctrl(unsigned int hashsize, unsigned int authsize)
    +{
    +
    +	if (authsize == 10)
    +		return (CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366);
    +	if (authsize == 12)
    +		return (CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT);
    +	if (authsize == hashsize / 2)
    +		return (CHCR_SCMD_HMAC_CTRL_DIV2);
    +	return (CHCR_SCMD_HMAC_CTRL_NO_TRUNC);
    +}
    +
    +static int
    +ccr_authenc(struct ccr_softc *sc, uint32_t sid, struct ccr_session *s,
    +    struct cryptop *crp, struct cryptodesc *crda, struct cryptodesc *crde)
    +{
    +	char iv[CHCR_MAX_CRYPTO_IV_LEN];
    +	struct chcr_wr *crwr;
    +	struct wrqe *wr;
    +	struct auth_hash *axf;
    +	char *dst;
    +	u_int iv_loc, kctx_len, key_half, op_type, transhdr_len, wr_len;
    +	u_int hash_size_in_response, imm_len, iopad_size;
    +	u_int aad_start, aad_len, aad_stop;
    +	u_int auth_start, auth_stop, auth_insert;
    +	u_int cipher_start, cipher_stop;
    +	u_int hmac_ctrl, input_len;
    +	int dsgl_nsegs, dsgl_len;
    +	int sgl_nsegs, sgl_len;
    +	int error;
    +
    +	if (s->blkcipher.key_len == 0)
    +		return (EINVAL);
    +	if (crde->crd_alg == CRYPTO_AES_CBC &&
    +	    (crde->crd_len % AES_BLOCK_LEN) != 0)
    +		return (EINVAL);
    +
    +	/*
    +	 * AAD is only permitted before the cipher/plain text, not
    +	 * after.
    +	 */
    +	if (crda->crd_len + crda->crd_skip > crde->crd_len + crde->crd_skip)
    +		return (EINVAL);
    +
    +	axf = s->hmac.auth_hash;
    +	hash_size_in_response = s->hmac.hash_len;
    +
    +	/*
    +	 * The IV is always stored at the start of the buffer even
    +	 * though it may be duplicated in the payload.  The crypto
    +	 * engine doesn't work properly if the IV offset points inside
    +	 * of the AAD region, so a second copy is always required.
    +	 */
    +	iv_loc = IV_IMMEDIATE;
    +	if (crde->crd_flags & CRD_F_ENCRYPT) {
    +		op_type = CHCR_ENCRYPT_OP;
    +		if (crde->crd_flags & CRD_F_IV_EXPLICIT)
    +			memcpy(iv, crde->crd_iv, s->blkcipher.iv_len);
    +		else
    +			arc4rand(iv, s->blkcipher.iv_len, 0);
    +		if ((crde->crd_flags & CRD_F_IV_PRESENT) == 0)
    +			crypto_copyback(crp->crp_flags, crp->crp_buf,
    +			    crde->crd_inject, s->blkcipher.iv_len, iv);
    +	} else {
    +		op_type = CHCR_DECRYPT_OP;
    +		if (crde->crd_flags & CRD_F_IV_EXPLICIT)
    +			memcpy(iv, crde->crd_iv, s->blkcipher.iv_len);
    +		else
    +			crypto_copydata(crp->crp_flags, crp->crp_buf,
    +			    crde->crd_inject, s->blkcipher.iv_len, iv);
    +	}
    +
    +	/*
    +	 * The output buffer consists of the cipher text followed by
    +	 * the hash when encrypting.  For decryption it only contains
    +	 * the plain text.
    +	 */
    +	sglist_reset(sc->sg_dsgl);
    +	error = sglist_append_sglist(sc->sg_dsgl, sc->sg_crp, crde->crd_skip,
    +	    crde->crd_len);
    +	if (error)
    +		return (error);
    +	if (op_type == CHCR_ENCRYPT_OP) {
    +		error = sglist_append_sglist(sc->sg_dsgl, sc->sg_crp,
    +		    crda->crd_inject, hash_size_in_response);
    +		if (error)
    +			return (error);
    +	}
    +	dsgl_nsegs = ccr_count_sgl(sc->sg_dsgl, DSGL_SGE_MAXLEN);
    +	if (dsgl_nsegs > MAX_RX_PHYS_DSGL_SGE)
    +		return (EFBIG);
    +	dsgl_len = ccr_phys_dsgl_len(dsgl_nsegs);
    +
    +	/* PADs must be 128-bit aligned. */
    +	iopad_size = roundup2(s->hmac.partial_digest_len, 16);
    +
    +	/*
    +	 * The 'key' part of the key context consists of the key followed
    +	 * by the IPAD and OPAD.
    +	 */
    +	kctx_len = roundup2(s->blkcipher.key_len, 16) + iopad_size * 2;
    +	transhdr_len = CIPHER_TRANSHDR_SIZE(kctx_len, dsgl_len);
    +
    +	/*
    +	 * The input buffer consists of the IV, any AAD, and then the
    +	 * cipher/plain text.  For decryption requests the hash is
    +	 * appended after the cipher text.
    +	 */
    +	if (crda->crd_skip < crde->crd_skip) {
    +		if (crda->crd_skip + crda->crd_len > crde->crd_skip)
    +			aad_len = (crde->crd_skip - crda->crd_skip);
    +		else
    +			aad_len = crda->crd_len;
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-head@freebsd.org  Wed May 17 22:51:30 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E35D710E4;
     Wed, 17 May 2017 22:51:29 +0000 (UTC)
     (envelope-from jonathan@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 C985A1F45;
     Wed, 17 May 2017 22:51:29 +0000 (UTC)
     (envelope-from jonathan@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HMpSXB076793;
     Wed, 17 May 2017 22:51:28 GMT (envelope-from jonathan@FreeBSD.org)
    Received: (from jonathan@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HMpSr3076792;
     Wed, 17 May 2017 22:51:28 GMT (envelope-from jonathan@FreeBSD.org)
    Message-Id: <201705172251.v4HMpSr3076792@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jonathan set sender to
     jonathan@FreeBSD.org using -f
    From: Jonathan Anderson 
    Date: Wed, 17 May 2017 22:51:28 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318431 - head/libexec/rtld-elf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 17 May 2017 22:51:30 -0000
    
    Author: jonathan
    Date: Wed May 17 22:51:28 2017
    New Revision: 318431
    URL: https://svnweb.freebsd.org/changeset/base/318431
    
    Log:
      Allow rtld direct-exec to take a file descriptor.
      
      When executing rtld directly, allow a file descriptor to be explicitly
      specified rather than opened from the given path. This, together with the
      LD_LIBRARY_PATH_FDS environment variable, allows dynamically-linked
      applications to be executed from within capability mode.
      
      Also add some rudimentary argument parsing (without pulling in getopt or
      the like) to accept this file descriptor, a help (-h) option and a basic
      usage string.
      
      Reviewed by:	kib
      Sponsored by:	NSERC, RDC
      Differential Revision:	https://reviews.freebsd.org/D10751
    
    Modified:
      head/libexec/rtld-elf/rtld.c
    
    Modified: head/libexec/rtld-elf/rtld.c
    ==============================================================================
    --- head/libexec/rtld-elf/rtld.c	Wed May 17 22:29:25 2017	(r318430)
    +++ head/libexec/rtld-elf/rtld.c	Wed May 17 22:51:28 2017	(r318431)
    @@ -115,8 +115,10 @@ static void objlist_push_head(Objlist *,
     static void objlist_push_tail(Objlist *, Obj_Entry *);
     static void objlist_put_after(Objlist *, Obj_Entry *, Obj_Entry *);
     static void objlist_remove(Objlist *, Obj_Entry *);
    +static int parse_args(char* argv[], int argc, bool *use_pathp, int *fdp);
     static int parse_integer(const char *);
     static void *path_enumerate(const char *, path_enum_proc, void *);
    +static void print_usage(const char *argv0);
     static void release_object(Obj_Entry *);
     static int relocate_object_dag(Obj_Entry *root, bool bind_now,
         Obj_Entry *rtldobj, int flags, RtldLockState *lockstate);
    @@ -350,9 +352,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
         char **argv, *argv0, **env, **envp, *kexecpath, *library_path_rpath;
         caddr_t imgentry;
         char buf[MAXPATHLEN];
    -    int argc, fd, i, mib[2], phnum;
    +    int argc, fd, i, mib[2], phnum, rtld_argc;
         size_t len;
    -    bool dir_enable;
    +    bool dir_enable, explicit_fd, search_in_path;
     
         /*
          * On entry, the dynamic linker itself has not been relocated yet.
    @@ -428,15 +430,19 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
     	    }
     	    dbg("opening main program in direct exec mode");
     	    if (argc >= 2) {
    -		argv0 = argv[1];
    -		fd = open(argv0, O_RDONLY | O_CLOEXEC | O_VERIFY);
    +		rtld_argc = parse_args(argv, argc, &search_in_path, &fd);
    +		argv0 = argv[rtld_argc];
    +		explicit_fd = (fd != -1);
    +		if (!explicit_fd)
    +		    fd = open(argv0, O_RDONLY | O_CLOEXEC | O_VERIFY);
     		if (fd == -1) {
     		    rtld_printf("Opening %s: %s\n", argv0,
     		      rtld_strerror(errno));
     		    rtld_die();
     		}
     		if (fstat(fd, &st) == -1) {
    -		    rtld_printf("Stat %s: %s\n", argv0,
    +		    _rtld_error("failed to fstat FD %d (%s): %s", fd,
    +		      explicit_fd ? "user-provided descriptor" : argv0,
     		      rtld_strerror(errno));
     		    rtld_die();
     		}
    @@ -469,26 +475,23 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
     
     		/*
     		 * For direct exec mode, argv[0] is the interpreter
    -		 * name, we must remove it and shift arguments left by
    -		 * 1 before invoking binary main.  Since stack layout
    +		 * name, we must remove it and shift arguments left
    +		 * before invoking binary main.  Since stack layout
     		 * places environment pointers and aux vectors right
     		 * after the terminating NULL, we must shift
     		 * environment and aux as well.
    -		 * XXX Shift will be > 1 when options are implemented.
     		 */
    +		main_argc = argc - rtld_argc;
    +		for (i = 0; i <= main_argc; i++)
    +		    argv[i] = argv[i + rtld_argc];
    +		*argcp -= rtld_argc;
    +		environ = env = envp = argv + main_argc + 1;
     		do {
    -		    *argv = *(argv + 1);
    -		    argv++;
    -		} while (*argv != NULL);
    -		*argcp -= 1;
    -		main_argc = argc - 1;
    -		environ = env = envp = argv;
    -		do {
    -		    *envp = *(envp + 1);
    +		    *envp = *(envp + rtld_argc);
     		    envp++;
     		} while (*envp != NULL);
     		aux = auxp = (Elf_Auxinfo *)envp;
    -		auxpf = (Elf_Auxinfo *)(envp + 1);
    +		auxpf = (Elf_Auxinfo *)(envp + rtld_argc);
     		for (;; auxp++, auxpf++) {
     		    *auxp = *auxpf;
     		    if (auxp->a_type == AT_NULL)
    @@ -5274,6 +5277,81 @@ symlook_init_from_req(SymLook *dst, cons
     
     
     /*
    + * Parse a set of command-line arguments.
    + */
    +static int
    +parse_args(char* argv[], int argc, bool *use_pathp, int *fdp)
    +{
    +	const char *arg;
    +	int fd, i, j, arglen;
    +	char opt;
    +
    +	dbg("Parsing command-line arguments");
    +	*use_pathp = false;
    +	*fdp = -1;
    +
    +	for (i = 1; i < argc; i++ ) {
    +		arg = argv[i];
    +		dbg("argv[%d]: '%s'", i, arg);
    +
    +		/*
    +		 * rtld arguments end with an explicit "--" or with the first
    +		 * non-prefixed argument.
    +		 */
    +		if (strcmp(arg, "--") == 0) {
    +			i++;
    +			break;
    +		}
    +		if (arg[0] != '-')
    +			break;
    +
    +		/*
    +		 * All other arguments are single-character options that can
    +		 * be combined, so we need to search through `arg` for them.
    +		 */
    +		arglen = strlen(arg);
    +		for (j = 1; j < arglen; j++) {
    +			opt = arg[j];
    +			if (opt == 'h') {
    +				print_usage(argv[0]);
    +				rtld_die();
    +			} else if (opt == 'f') {
    +			/*
    +			 * -f XX can be used to specify a descriptor for the
    +			 * binary named at the command line (i.e., the later
    +			 * argument will specify the process name but the
    +			 * descriptor is what will actually be executed)
    +			 */
    +			if (j != arglen - 1) {
    +				/* -f must be the last option in, e.g., -abcf */
    +				_rtld_error("invalid options: %s", arg);
    +				rtld_die();
    +			}
    +			i++;
    +			fd = parse_integer(argv[i]);
    +			if (fd == -1) {
    +				_rtld_error("invalid file descriptor: '%s'",
    +				    argv[i]);
    +				rtld_die();
    +			}
    +			*fdp = fd;
    +			break;
    +			/* TODO:
    +			} else if (opt == 'p') {
    +				*use_pathp = true;
    +			*/
    +			} else {
    +				rtld_printf("invalid argument: '%s'\n", arg);
    +				print_usage(argv[0]);
    +				rtld_die();
    +			}
    +		}
    +	}
    +
    +	return (i);
    +}
    +
    +/*
      * Parse a file descriptor number without pulling in more of libc (e.g. atoi).
      */
     static int
    @@ -5300,6 +5378,20 @@ parse_integer(const char *str)
     	return (n);
     }
     
    +void print_usage(const char *argv0)
    +{
    +
    +	rtld_printf("Usage: %s [-h] [-f ] [--]  []\n"
    +		"\n"
    +		"Options:\n"
    +		"  -h        Display this help message\n"
    +		/* TODO: "  -p        Search in PATH for named binary\n" */
    +		"  -f    Execute  instead of searching for \n"
    +		"  --        End of RTLD options\n"
    +		"    Name of process to execute\n"
    +		"      Arguments to the executed process\n", argv0);
    +}
    +
     /*
      * Overrides for libc_pic-provided functions.
      */
    
    From owner-svn-src-head@freebsd.org  Thu May 18 00:32:06 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EEB4D700FA;
     Thu, 18 May 2017 00:32:06 +0000 (UTC)
     (envelope-from jonathan@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 4AFDF15B0;
     Thu, 18 May 2017 00:32:06 +0000 (UTC)
     (envelope-from jonathan@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I0W5CS017678;
     Thu, 18 May 2017 00:32:05 GMT (envelope-from jonathan@FreeBSD.org)
    Received: (from jonathan@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I0W5KB017677;
     Thu, 18 May 2017 00:32:05 GMT (envelope-from jonathan@FreeBSD.org)
    Message-Id: <201705180032.v4I0W5KB017677@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jonathan set sender to
     jonathan@FreeBSD.org using -f
    From: Jonathan Anderson 
    Date: Thu, 18 May 2017 00:32:05 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318432 - head/libexec/rtld-elf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 00:32:06 -0000
    
    Author: jonathan
    Date: Thu May 18 00:32:05 2017
    New Revision: 318432
    URL: https://svnweb.freebsd.org/changeset/base/318432
    
    Log:
      Fix some nroff syntax in rtld.1.
      
      When I originally documented the LD_LIBRARY_PATH_FDS environment variable,
      I used `.Ev` rather than `.It Ev` to introduce it; this led to the
      documentation being embedded in the previous paragraph (LD_LIBRARY_PATH).
    
    Modified:
      head/libexec/rtld-elf/rtld.1
    
    Modified: head/libexec/rtld-elf/rtld.1
    ==============================================================================
    --- head/libexec/rtld-elf/rtld.1	Wed May 17 22:51:28 2017	(r318431)
    +++ head/libexec/rtld-elf/rtld.1	Thu May 18 00:32:05 2017	(r318432)
    @@ -192,7 +192,7 @@ the directories specified by
     will be searched first
     followed by the set of built-in standard directories.
     This variable is unset for set-user-ID and set-group-ID programs.
    -.Ev LD_LIBRARY_PATH_FDS
    +.It Ev LD_LIBRARY_PATH_FDS
     A colon separated list of file descriptor numbers for library directories.
     This is intended for use within
     .Xr capsicum 4
    
    From owner-svn-src-head@freebsd.org  Thu May 18 00:49:44 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id C94CED70769;
     Thu, 18 May 2017 00:49:44 +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 7B9201DEF;
     Thu, 18 May 2017 00:49:43 +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 v4I0nZnJ063722;
     Wed, 17 May 2017 17:49:35 -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 v4I0nZa1063721;
     Wed, 17 May 2017 17:49:35 -0700 (PDT) (envelope-from freebsd)
    From: "Rodney W. Grimes" 
    Message-Id: <201705180049.v4I0nZa1063721@pdx.rh.CN85.dnsmgr.net>
    Subject: Re: svn commit: r318400 - head/sbin/ipfw
    In-Reply-To: <201705171056.v4HAuMOV078812@repo.freebsd.org>
    To: "Andrey V. Elsukov" 
    Date: Wed, 17 May 2017 17:49:34 -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.23
    Precedence: list
    List-Id: 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, 18 May 2017 00:49:44 -0000
    
    [ Charset UTF-8 unsupported, converting... ]
    > Author: ae
    > Date: Wed May 17 10:56:22 2017
    > New Revision: 318400
    > URL: https://svnweb.freebsd.org/changeset/base/318400
    > 
    > Log:
    >   Allow zero port specification in table entries with type flow.
    >   
    >   PR:		217620
    >   MFC after:	1 week
    > 
    > Modified:
    >   head/sbin/ipfw/tables.c
    > 
    > Modified: head/sbin/ipfw/tables.c
    > ==============================================================================
    > --- head/sbin/ipfw/tables.c	Wed May 17 09:04:09 2017	(r318399)
    > +++ head/sbin/ipfw/tables.c	Wed May 17 10:56:22 2017	(r318400)
    > @@ -1260,16 +1260,14 @@ tentry_fill_key_type(char *arg, ipfw_obj
    >  			if ((p = strchr(arg, ',')) != NULL)
    >  				*p++ = '\0';
    >  
    > -			if ((port = htons(strtol(arg, NULL, 10))) == 0) {
    > +			port = htons(strtol(arg, &pp, 10));
                                                          ^^^
    Can this be converted to a sizeof(foo) somehow?
    Constants like this are typically bad style and lead to bugs.
    
    > +			if (*pp != '\0') {
    >  				if ((sent = getservbyname(arg, NULL)) == NULL)
    >  					errx(EX_DATAERR, "Unknown service: %s",
    >  					    arg);
    > -				else
    > -					key = sent->s_port;
    > +				port = sent->s_port;
    >  			}
    > -			
    >  			tfe->sport = port;
    > -
    >  			arg = p;
    >  		}
    >  
    > @@ -1304,16 +1302,14 @@ tentry_fill_key_type(char *arg, ipfw_obj
    >  			if ((p = strchr(arg, ',')) != NULL)
    >  				*p++ = '\0';
    >  
    > -			if ((port = htons(strtol(arg, NULL, 10))) == 0) {
    > +			port = htons(strtol(arg, &pp, 10));
    > +			if (*pp != '\0') {
    >  				if ((sent = getservbyname(arg, NULL)) == NULL)
    >  					errx(EX_DATAERR, "Unknown service: %s",
    >  					    arg);
    > -				else
    > -					key = sent->s_port;
    > +				port = sent->s_port;
    >  			}
    > -			
    >  			tfe->dport = port;
    > -
    >  			arg = p;
    >  		}
    >  
    > 
    > 
    
    -- 
    Rod Grimes                                                 rgrimes@freebsd.org
    
    From owner-svn-src-head@freebsd.org  Thu May 18 01:35:08 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D87D70B0E;
     Thu, 18 May 2017 01:35:08 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 4779A12DE;
     Thu, 18 May 2017 01:35:08 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I1Z7UQ043410;
     Thu, 18 May 2017 01:35:07 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I1Z7Fh043409;
     Thu, 18 May 2017 01:35:07 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705180135.v4I1Z7Fh043409@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Thu, 18 May 2017 01:35:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318434 - head/usr.bin/getconf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 01:35:08 -0000
    
    Author: ngie
    Date: Thu May 18 01:35:07 2017
    New Revision: 318434
    URL: https://svnweb.freebsd.org/changeset/base/318434
    
    Log:
      Make the `.gperf.c` suffix rule depend on fake-gperf.awk
      
      Parameterize out fake-gperf.awk to avoid duplicating the path
      
      MFC after:	2 weeks
      Sponsored by:	Dell EMC Isilon
    
    Modified:
      head/usr.bin/getconf/Makefile
    
    Modified: head/usr.bin/getconf/Makefile
    ==============================================================================
    --- head/usr.bin/getconf/Makefile	Thu May 18 01:32:50 2017	(r318433)
    +++ head/usr.bin/getconf/Makefile	Thu May 18 01:35:07 2017	(r318434)
    @@ -13,8 +13,9 @@ CLEANFILES+=	confstr.c limits.c pathconf
     
     all:	conflicts
     
    -.gperf.c:
    -	LC_ALL=C awk -f ${.CURDIR}/fake-gperf.awk ${.IMPSRC} >${.TARGET}
    +FAKE_GPERF=	${.CURDIR}/fake-gperf.awk
    +.gperf.c: ${FAKE_GPERF}
    +	LC_ALL=C awk -f ${FAKE_GPERF} ${.IMPSRC} >${.TARGET}
     
     .gperf.names:
     	LC_ALL=C awk '/^[_A-Z]/ { print; }' ${.IMPSRC} | \
    
    From owner-svn-src-head@freebsd.org  Thu May 18 01:43:31 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1F82D713D0;
     Thu, 18 May 2017 01:43:31 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 CF4451B31;
     Thu, 18 May 2017 01:43:31 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I1hUrr047544;
     Thu, 18 May 2017 01:43:30 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I1hUcT047538;
     Thu, 18 May 2017 01:43:30 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705180143.v4I1hUcT047538@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Thu, 18 May 2017 01:43:30 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318436 - in head: etc/mtree usr.bin/getconf
     usr.bin/getconf/tests
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 01:43:32 -0000
    
    Author: ngie
    Date: Thu May 18 01:43:30 2017
    New Revision: 318436
    URL: https://svnweb.freebsd.org/changeset/base/318436
    
    Log:
      usr.bin/getconf: add some initial tests
      
      Items tested via this commit are:
      - Some basic POSIX constants.
      - Some valid programming environments with -v.
      - Some invalid programming environments via -v.
      
      NOTE: this test makes assumptions about ILP32/LP32 vs LP64 that are
      currently not true on all architectures to avoid hardcoding some
      architectures in the tests. I'm working on improving getconf(1) to be
      more sane about handling ILP32/LP32 vs LP64. Future commits are coming
      soon to address this.
      
      MFC after:	2 weeks
      Tested with:	amd64, i386
      Sponsored by:	Dell EMC Isilon
    
    Added:
      head/usr.bin/getconf/tests/
      head/usr.bin/getconf/tests/Makefile   (contents, props changed)
      head/usr.bin/getconf/tests/arch_type.c   (contents, props changed)
      head/usr.bin/getconf/tests/getconf_test.sh   (contents, props changed)
    Modified:
      head/etc/mtree/BSD.tests.dist
      head/usr.bin/getconf/Makefile
      head/usr.bin/getconf/getconf.h
    
    Modified: head/etc/mtree/BSD.tests.dist
    ==============================================================================
    --- head/etc/mtree/BSD.tests.dist	Thu May 18 01:42:55 2017	(r318435)
    +++ head/etc/mtree/BSD.tests.dist	Thu May 18 01:43:30 2017	(r318436)
    @@ -622,6 +622,8 @@
             ..
             file2c
             ..
    +        getconf
    +        ..
             grep
             ..
             gzip
    
    Modified: head/usr.bin/getconf/Makefile
    ==============================================================================
    --- head/usr.bin/getconf/Makefile	Thu May 18 01:42:55 2017	(r318435)
    +++ head/usr.bin/getconf/Makefile	Thu May 18 01:43:30 2017	(r318436)
    @@ -1,5 +1,7 @@
     # $FreeBSD$
     
    +.include 
    +
     PROG=	getconf
     
     SRCS=	confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c
    @@ -35,4 +37,8 @@ conflicting.names:	confstr.names limits.
     unique.names:		conflicting.names
     	LC_ALL=C sort -u ${.ALLSRC} >${.TARGET}
     
    +.if ${MK_TESTS} != "no"
    +SUBDIR+=	tests
    +.endif
    +
     .include 
    
    Modified: head/usr.bin/getconf/getconf.h
    ==============================================================================
    --- head/usr.bin/getconf/getconf.h	Thu May 18 01:42:55 2017	(r318435)
    +++ head/usr.bin/getconf/getconf.h	Thu May 18 01:43:30 2017	(r318436)
    @@ -36,8 +36,15 @@ typedef long long intmax_t;
     #include 
     #endif
     
    +typedef enum {
    +	PROG_ENV_VALID_NO_ALT_PATH = -1,
    +	PROG_ENV_INVALID = 0,
    +	PROG_ENV_VALID_HAS_ALT_PATH = 1,
    +	PROG_ENV_UNKNOWN = 2,
    +} prog_env_validity;
    +
     int	find_confstr(const char *name, int *key);
     int	find_limit(const char *name, intmax_t *value);
     int	find_pathconf(const char *name, int *key);
    -int	find_progenv(const char *name, const char **alt_path);
    +prog_env_validity	find_progenv(const char *name, const char **alt_path);
     int	find_sysconf(const char *name, int *key);
    
    Added: head/usr.bin/getconf/tests/Makefile
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/usr.bin/getconf/tests/Makefile	Thu May 18 01:43:30 2017	(r318436)
    @@ -0,0 +1,11 @@
    +# $FreeBSD$
    +
    +ATF_TESTS_SH+=	getconf_test
    +
    +PROGS+=		arch_type
    +
    +BINDIR=		${TESTSDIR}
    +
    +WARNS?=		6
    +
    +.include 
    
    Added: head/usr.bin/getconf/tests/arch_type.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/usr.bin/getconf/tests/arch_type.c	Thu May 18 01:43:30 2017	(r318436)
    @@ -0,0 +1,59 @@
    +/*
    + * Copyright (c) 2017 Ngie Cooper 
    + * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
    + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
    + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
    + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    + * POSSIBILITY OF SUCH DAMAGE.
    + */
    +
    +#include 
    +__RCSID("$FreeBSD$");
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +int
    +main(void)
    +{
    +	bool known_arch_type;
    +
    +	known_arch_type = false;
    +#ifdef	__LP64__
    +	printf("LP64\n");
    +	known_arch_type = true;
    +#endif
    +#ifdef	__LP32__
    +	printf("LP32\n");
    +	known_arch_type = true;
    +#endif
    +#ifdef	__ILP32__
    +	printf("ILP32\n");
    +	known_arch_type = true;
    +#endif
    +
    +	if (known_arch_type)
    +		exit(0);
    +
    +	fprintf(stderr, "unknown architecture type detected\n");
    +	assert(0);
    +}
    
    Added: head/usr.bin/getconf/tests/getconf_test.sh
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/usr.bin/getconf/tests/getconf_test.sh	Thu May 18 01:43:30 2017	(r318436)
    @@ -0,0 +1,120 @@
    +#
    +# Copyright (c) 2017 Dell EMC
    +# 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$
    +
    +POSITIVE_EXP_EXPR_RE='match:[1-9][0-9]*'
    +
    +POSIX_CONSTANTS="ARG_MAX PAGESIZE"
    +POSIX_PATH_CONSTANTS="NAME_MAX PATH_MAX"
    +SUPPORTED_32BIT_PROGRAM_ENVS="POSIX_V6_ILP32_OFFBIG"
    +SUPPORTED_64BIT_PROGRAM_ENVS="POSIX_V6_LP64_OFF64"
    +UNAVAILABLE_PROGRAM_ENVS="I_AM_BOGUS"
    +UNSUPPORTED_32BIT_PROGRAM_ENVS="POSIX_V6_LP64_OFF64"
    +UNSUPPORTED_64BIT_PROGRAM_ENVS="POSIX_V6_ILP32_OFFBIG"
    +
    +XOPEN_CONSTANTS=
    +
    +# XXX: hardcoded sysexits
    +EX_USAGE=64
    +EX_UNAVAILABLE=69
    +
    +set_program_environments()
    +{
    +	atf_check -o save:arch_type.out $(atf_get_srcdir)/arch_type
    +	arch_type=$(cat arch_type.out)
    +	case "$arch_type" in
    +	ILP32|LP32)
    +		SUPPORTED_PROGRAM_ENVS="$SUPPORTED_PROGRAM_ENVS $SUPPORTED_32BIT_PROGRAM_ENVS"
    +		UNSUPPORTED_PROGRAM_ENVS="$UNSUPPORTED_PROGRAM_ENVS $UNSUPPORTED_32BIT_PROGRAM_ENVS"
    +		;;
    +	LP64)
    +		SUPPORTED_PROGRAM_ENVS="$SUPPORTED_PROGRAM_ENVS $SUPPORTED_64BIT_PROGRAM_ENVS"
    +		UNSUPPORTED_PROGRAM_ENVS="$UNSUPPORTED_PROGRAM_ENVS $UNSUPPORTED_64BIT_PROGRAM_ENVS"
    +		;;
    +	*)
    +		atf_fail "arch_type output unexpected: $arch_type"
    +		;;
    +	esac
    +}
    +
    +atf_test_case no_programming_environment
    +no_programming_environment_head()
    +{
    +	atf_set	"descr" "Test some POSIX constants as a positive functional test"
    +}
    +
    +no_programming_environment_body()
    +{
    +	for var in $POSIX_CONSTANTS; do
    +		atf_check -o "$POSITIVE_EXP_EXPR_RE" getconf $var
    +	done
    +	for var in $POSIX_PATH_CONSTANTS; do
    +		atf_check -o "$POSITIVE_EXP_EXPR_RE" getconf $var .
    +	done
    +}
    +
    +atf_test_case programming_environment
    +programming_environment_head()
    +{
    +	atf_set	"descr" "Test some constants with specific programming environments"
    +}
    +
    +programming_environment_body()
    +{
    +	set_program_environments
    +
    +	for prog_env in ${SUPPORTED_PROGRAM_ENVS}; do
    +		for var in $POSIX_CONSTANTS; do
    +			atf_check -o "$POSITIVE_EXP_EXPR_RE" \
    +			    getconf -v $prog_env $var
    +		done
    +	done
    +}
    +
    +atf_test_case programming_environment_unsupported
    +programming_environment_unsupported_head()
    +{
    +	atf_set	"descr" "Test for unsupported environments"
    +}
    +
    +programming_environment_unsupported_body()
    +{
    +	set_program_environments
    +
    +	for prog_env in ${UNSUPPORTED_PROGRAM_ENVS}; do
    +		for var in $POSIX_CONSTANTS; do
    +			atf_check -e not-empty -s exit:$EX_UNAVAILABLE \
    +			    getconf -v $prog_env $var
    +		done
    +	done
    +}
    +
    +atf_init_test_cases()
    +{
    +	atf_add_test_case no_programming_environment
    +	atf_add_test_case programming_environment
    +	atf_add_test_case programming_environment_unsupported
    +}
    
    From owner-svn-src-head@freebsd.org  Thu May 18 01:46:32 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A2C3D715FD;
     Thu, 18 May 2017 01:46:32 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 EEA511DC5;
     Thu, 18 May 2017 01:46:31 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I1kU6s047721;
     Thu, 18 May 2017 01:46:30 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I1kU1R047720;
     Thu, 18 May 2017 01:46:30 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705180146.v4I1kU1R047720@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Thu, 18 May 2017 01:46:30 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318437 - head/usr.bin/getconf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 01:46:32 -0000
    
    Author: ngie
    Date: Thu May 18 01:46:30 2017
    New Revision: 318437
    URL: https://svnweb.freebsd.org/changeset/base/318437
    
    Log:
      Revert local changes to find_progenv accidentally committed in r318436
      
      MFC after:	2 weeks
      MFC with:	r318436
      Sponsored by:	Dell EMC Isilon
    
    Modified:
      head/usr.bin/getconf/getconf.h
    
    Modified: head/usr.bin/getconf/getconf.h
    ==============================================================================
    --- head/usr.bin/getconf/getconf.h	Thu May 18 01:43:30 2017	(r318436)
    +++ head/usr.bin/getconf/getconf.h	Thu May 18 01:46:30 2017	(r318437)
    @@ -36,15 +36,8 @@ typedef long long intmax_t;
     #include 
     #endif
     
    -typedef enum {
    -	PROG_ENV_VALID_NO_ALT_PATH = -1,
    -	PROG_ENV_INVALID = 0,
    -	PROG_ENV_VALID_HAS_ALT_PATH = 1,
    -	PROG_ENV_UNKNOWN = 2,
    -} prog_env_validity;
    -
     int	find_confstr(const char *name, int *key);
     int	find_limit(const char *name, intmax_t *value);
     int	find_pathconf(const char *name, int *key);
    -prog_env_validity	find_progenv(const char *name, const char **alt_path);
    +int	find_progenv(const char *name, const char **alt_path);
     int	find_sysconf(const char *name, int *key);
    
    From owner-svn-src-head@freebsd.org  Thu May 18 02:00:27 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 322E1D71F05;
     Thu, 18 May 2017 02:00:27 +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 E43E315C2;
     Thu, 18 May 2017 02:00:26 +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 E17486DD2;
     Thu, 18 May 2017 02:00:25 +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 61FC477E5;
     Thu, 18 May 2017 02:00:24 +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 IRxYv4NmvBLL; Thu, 18 May 2017 02:00:21 +0000 (UTC)
    Subject: Re: svn commit: r310230 - head/sys/cam/scsi
    DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com B28DA77DF
    To: Alexander Motin , src-committers@freebsd.org,
     svn-src-all@freebsd.org, svn-src-head@freebsd.org
    References: <201612181502.uBIF2o4a023448@repo.freebsd.org>
    From: Bryan Drewery 
    Organization: FreeBSD
    Message-ID: 
    Date: Wed, 17 May 2017 19:00:03 -0700
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0)
     Gecko/20100101 Thunderbird/45.8.0
    MIME-Version: 1.0
    In-Reply-To: <201612181502.uBIF2o4a023448@repo.freebsd.org>
    Content-Type: multipart/signed; micalg=pgp-sha512;
     protocol="application/pgp-signature";
     boundary="3aWcPsVgnSaKubs64dVRi18s1MHXPfvK3"
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 02:00:27 -0000
    
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    --3aWcPsVgnSaKubs64dVRi18s1MHXPfvK3
    Content-Type: multipart/mixed; boundary="9uU2E3GaNi2sIbabd7nVWw3INDW82ucjL";
     protected-headers="v1"
    From: Bryan Drewery 
    To: Alexander Motin , src-committers@freebsd.org,
     svn-src-all@freebsd.org, svn-src-head@freebsd.org
    Message-ID: 
    Subject: Re: svn commit: r310230 - head/sys/cam/scsi
    References: <201612181502.uBIF2o4a023448@repo.freebsd.org>
    In-Reply-To: <201612181502.uBIF2o4a023448@repo.freebsd.org>
    
    --9uU2E3GaNi2sIbabd7nVWw3INDW82ucjL
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: quoted-printable
    
    On 12/18/16 7:02 AM, Alexander Motin wrote:
    > Author: mav
    > Date: Sun Dec 18 15:02:50 2016
    > New Revision: 310230
    > URL: https://svnweb.freebsd.org/changeset/base/310230
    >=20
    > Log:
    >   Don't treat informational exceptions (warnings and impending failures=
    )
    >   a.k.a. SCSI SMART events as errors.  Log them to console and continue=
    =2E
    >  =20
    >   MFC after:	2 weeks
    >=20
    > Modified:
    >   head/sys/cam/scsi/scsi_all.c
    >=20
    > Modified: head/sys/cam/scsi/scsi_all.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/cam/scsi/scsi_all.c	Sun Dec 18 14:54:20 2016	(r310229)
    > +++ head/sys/cam/scsi/scsi_all.c	Sun Dec 18 15:02:50 2016	(r310230)
    > @@ -1233,58 +1233,58 @@ static struct asc_table_entry asc_table[
    >  	{ SST(0x0A, 0x00, SS_FATAL | ENOSPC,
    >  	    "Error log overflow") },
    >  	/* DTLPWROMAEBKVF */
    > -	{ SST(0x0B, 0x00, SS_RDEF,
    > +	{ SST(0x0B, 0x00, SS_NOP | SSQ_PRINT_SENSE,
    
    After this change (removing SS_RETRY), will a retry still occur on the
    changed SENSE exceptions via something else?
    
    --=20
    Regards,
    Bryan Drewery
    
    
    --9uU2E3GaNi2sIbabd7nVWw3INDW82ucjL--
    
    --3aWcPsVgnSaKubs64dVRi18s1MHXPfvK3
    Content-Type: application/pgp-signature; name="signature.asc"
    Content-Description: OpenPGP digital signature
    Content-Disposition: attachment; filename="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    Comment: GPGTools - https://gpgtools.org
    
    iQEcBAEBCgAGBQJZHQAkAAoJEDXXcbtuRpfPSzEH/iBsxxIu8mdgMWT1ebnduODn
    lzH2atkYEbM8ubW2b5Qv20ssEru2bWVFKfBqJ5Vsntcqi1FI+NB9B0X/+7Pazdeu
    IwPUzi/9/eJX+vQgftqVLd4pbxz4L6AcUKMP30/Zxas/eYnqg7uN8b55wDk8EHAj
    xMEJD3Lb5ezyLIzdULVlU0QQiGWYit33cXZGdS6+GOBb7vtYZcgRNUfN+6JoaTH9
    CjKxErdzoLtWJ0F3udrXRVxps1qWHFMksifhaDEoLqAKdZciH1K+UbvSbt09BbnC
    o9FLXkk3d6u0fzK9tzanHfwk7tzVmxDtZhxXymvuHa4pZzOPCdwSL+CJKVneJaI=
    =B4gY
    -----END PGP SIGNATURE-----
    
    --3aWcPsVgnSaKubs64dVRi18s1MHXPfvK3--
    
    From owner-svn-src-head@freebsd.org  Thu May 18 02:44:05 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15CC9D72B0E;
     Thu, 18 May 2017 02:44:05 +0000 (UTC)
     (envelope-from mavbsd@gmail.com)
    Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com
     [IPv6:2607:f8b0:400e:c05::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 D8CFD14F2;
     Thu, 18 May 2017 02:44:04 +0000 (UTC)
     (envelope-from mavbsd@gmail.com)
    Received: by mail-pg0-x22b.google.com with SMTP id x64so15631470pgd.3;
     Wed, 17 May 2017 19:44:04 -0700 (PDT)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
     h=sender:subject:to:references:from:message-id:date:user-agent
     :mime-version:in-reply-to:content-language:content-transfer-encoding;
     bh=+/l3pdIHfwwJXOcnJDEBCOlhx3RBYfNMazMGdvaxtI0=;
     b=fD1qkp3qNd70tpMO3AwVazW4ueUfVrLXEONVhZDQMFO0DNHQ+2WQzy6KuTN5q2rpH4
     SMngOKQ5cT0FIWU6Zrt0gtKwyQGDkD/4jgIsZ2hbmoDBn1qBCIPaWPP40qmw2RVGXBpA
     yzbKwRUhJLUcM1ALHPT8sOCxfMlBQVZx07PaPlEMAIbB+XvHs2xKh8OuG76AeCpfxnH0
     Tg5AQlAPNXXb30bEp2E6et95NdrHW1TeEQRdF1hb8Wk73SgjW+T++KDcb+MW88gMlgsr
     /qcXjtaA7/gI8LvgRUs/8T5pncyh8cJuF6Cby3stR92DfkXzvRXhdE1IGvLPILc84Y6L
     MxqA==
    X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
     d=1e100.net; s=20161025;
     h=x-gm-message-state:sender:subject:to:references:from:message-id
     :date:user-agent:mime-version:in-reply-to:content-language
     :content-transfer-encoding;
     bh=+/l3pdIHfwwJXOcnJDEBCOlhx3RBYfNMazMGdvaxtI0=;
     b=s3i/KqfiYphXb1Z6gDKOrHUx+BdJ7T6mKt97VPANKYuE0EiC87v+aOiOEnt0zt+oC5
     H/0tf8V9tsbdvTRp/htqvFfzbSbCvWh/r9QBua2hN2nsyVPf5pvOUpi9vXJ7qtmRHvd3
     zFLbRHIOsDB/sV82v8rbP8N9DBJGf1icc9PUDwUXTyzOd3BtYAxWWCXdyN4LQILTSrA2
     VtjU5vGvnatiL9S+jrYcgt/GUQl3RTGWQbvEE9vD2KE7vcoOPo17faKbjs2wYg6sAUPv
     fga2YVBIBZpl1KoYOJEvYyw0+VVfkKiLEu7k7xOdUzL7c2hj0Vetij7A4Ww+K4XGj5tq
     TNFA==
    X-Gm-Message-State: AODbwcCh1QGfWuOYxtpVksMVrDEFSziMsi5Hd2yQM0Su9Vi6zPo8bZID
     1nfiU4MBNQ5u+w2TK5Q=
    X-Received: by 10.99.55.88 with SMTP id g24mr1898807pgn.176.1495075444245;
     Wed, 17 May 2017 19:44:04 -0700 (PDT)
    Received: from spectre.mavhome.dp.ua ([2601:647:4b00:5308:228:f8ff:fe04:d12])
     by smtp.gmail.com with ESMTPSA id
     x12sm6662286pge.60.2017.05.17.19.44.01
     (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
     Wed, 17 May 2017 19:44:02 -0700 (PDT)
    Sender: Alexander Motin 
    Subject: Re: svn commit: r310230 - head/sys/cam/scsi
    To: Bryan Drewery , src-committers@freebsd.org,
     svn-src-all@freebsd.org, svn-src-head@freebsd.org
    References: <201612181502.uBIF2o4a023448@repo.freebsd.org>
     
    From: Alexander Motin 
    Message-ID: <32cea555-27c9-555e-405b-1303bcd7ae17@FreeBSD.org>
    Date: Wed, 17 May 2017 19:44:01 -0700
    User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
     Thunderbird/52.0
    MIME-Version: 1.0
    In-Reply-To: 
    Content-Type: text/plain; charset=utf-8
    Content-Language: en-US
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 02:44:05 -0000
    
    On 17.05.2017 19:00, Bryan Drewery wrote:
    > On 12/18/16 7:02 AM, Alexander Motin wrote:
    >> Author: mav
    >> Date: Sun Dec 18 15:02:50 2016
    >> New Revision: 310230
    >> URL: https://svnweb.freebsd.org/changeset/base/310230
    >>
    >> Log:
    >>   Don't treat informational exceptions (warnings and impending failures)
    >>   a.k.a. SCSI SMART events as errors.  Log them to console and continue.
    >>   
    >>   MFC after:	2 weeks
    >>
    >> Modified:
    >>   head/sys/cam/scsi/scsi_all.c
    >>
    >> Modified: head/sys/cam/scsi/scsi_all.c
    >> ==============================================================================
    >> --- head/sys/cam/scsi/scsi_all.c	Sun Dec 18 14:54:20 2016	(r310229)
    >> +++ head/sys/cam/scsi/scsi_all.c	Sun Dec 18 15:02:50 2016	(r310230)
    >> @@ -1233,58 +1233,58 @@ static struct asc_table_entry asc_table[
    >>  	{ SST(0x0A, 0x00, SS_FATAL | ENOSPC,
    >>  	    "Error log overflow") },
    >>  	/* DTLPWROMAEBKVF */
    >> -	{ SST(0x0B, 0x00, SS_RDEF,
    >> +	{ SST(0x0B, 0x00, SS_NOP | SSQ_PRINT_SENSE,
    > 
    > After this change (removing SS_RETRY), will a retry still occur on the
    > changed SENSE exceptions via something else?
    
    There will be no retry, since it is no longer considered an error.  It
    is successful command completion status.  The command will complete
    normally after just logging the status for administrative purposes.
    
    -- 
    Alexander Motin
    
    From owner-svn-src-head@freebsd.org  Thu May 18 04:49:04 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57511D726F6;
     Thu, 18 May 2017 04:49:04 +0000 (UTC)
     (envelope-from bu7cher@yandex.ru)
    Received: from forward1m.cmail.yandex.net (forward1m.cmail.yandex.net
     [IPv6:2a02:6b8:b030::18])
     (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 CD9F81389;
     Thu, 18 May 2017 04:49:03 +0000 (UTC)
     (envelope-from bu7cher@yandex.ru)
    Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [95.108.130.59])
     by forward1m.cmail.yandex.net (Yandex) with ESMTP id 56B62217D3;
     Thu, 18 May 2017 07:48:51 +0300 (MSK)
    Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1])
     by smtp1j.mail.yandex.net (Yandex) with ESMTP id 28EE63C81054;
     Thu, 18 May 2017 07:48:48 +0300 (MSK)
    Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id
     Dfc6lwemod-mlsGdKJC; Thu, 18 May 2017 07:48:48 +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=1495082928; bh=WN0FJk3nR8Nge81XXqA6khwBNM0blrp6zpW5Ky2WJaM=;
     h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To;
     b=C7xqQ2wk2Y9DjxinKN46dsL1n/X8g37ZDHXqVCLQfg/rGw/A5OWNsb3ozLcJc4vBU
     gzmyCXURl1eqONFgHB87Ombw9CjdWTDvfwH1NRyKFYzGJ+wrNplkNfOl5+YqeFPPBz
     C9PgBtLtesYkmOoILj23FCy+huzRgG2rtePEBbZo=
    Authentication-Results: smtp1j.mail.yandex.net; dkim=pass header.i=@yandex.ru
    X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0
    Subject: Re: svn commit: r318400 - head/sbin/ipfw
    To: rgrimes@freebsd.org
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    References: <201705180049.v4I0nZa1063721@pdx.rh.CN85.dnsmgr.net>
    From: "Andrey V. Elsukov" 
    Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A
    Message-ID: <72e5d765-dfd5-dd65-b8f1-9d5524cde366@yandex.ru>
    Date: Thu, 18 May 2017 07:47:03 +0300
    User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
     Thunderbird/52.0.1
    MIME-Version: 1.0
    In-Reply-To: <201705180049.v4I0nZa1063721@pdx.rh.CN85.dnsmgr.net>
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature";
     boundary="siHLtSsUO8aIvOaXfWLit5o77ESrA96GP"
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 04:49:04 -0000
    
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    --siHLtSsUO8aIvOaXfWLit5o77ESrA96GP
    Content-Type: multipart/mixed; boundary="Etn7cfJBTaL5WvR4bGS0ux69lbSX3jEgf";
     protected-headers="v1"
    From: "Andrey V. Elsukov" 
    To: rgrimes@freebsd.org
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Message-ID: <72e5d765-dfd5-dd65-b8f1-9d5524cde366@yandex.ru>
    Subject: Re: svn commit: r318400 - head/sbin/ipfw
    References: <201705180049.v4I0nZa1063721@pdx.rh.CN85.dnsmgr.net>
    In-Reply-To: <201705180049.v4I0nZa1063721@pdx.rh.CN85.dnsmgr.net>
    
    --Etn7cfJBTaL5WvR4bGS0ux69lbSX3jEgf
    Content-Type: text/plain; charset=utf-8
    Content-Language: en-US
    Content-Transfer-Encoding: quoted-printable
    
    On 18.05.2017 03:49, Rodney W. Grimes wrote:
    > [ Charset UTF-8 unsupported, converting... ]
    >> Author: ae
    >> Date: Wed May 17 10:56:22 2017
    >> New Revision: 318400
    >> URL: https://svnweb.freebsd.org/changeset/base/318400
    >>
    >> Log:
    >>   Allow zero port specification in table entries with type flow.
    >>  =20
    >>   PR:		217620
    >>   MFC after:	1 week
    >>
    >> Modified:
    >>   head/sbin/ipfw/tables.c
    >>
    >> Modified: head/sbin/ipfw/tables.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/sbin/ipfw/tables.c	Wed May 17 09:04:09 2017	(r318399)
    >> +++ head/sbin/ipfw/tables.c	Wed May 17 10:56:22 2017	(r318400)
    >> @@ -1260,16 +1260,14 @@ tentry_fill_key_type(char *arg, ipfw_obj
    >>  			if ((p =3D strchr(arg, ',')) !=3D NULL)
    >>  				*p++ =3D '\0';
    >> =20
    >> -			if ((port =3D htons(strtol(arg, NULL, 10))) =3D=3D 0) {
    >> +			port =3D htons(strtol(arg, &pp, 10));
    >                                                       ^^^
    > Can this be converted to a sizeof(foo) somehow?
    > Constants like this are typically bad style and lead to bugs.
    
    This means that decimal number is expected in the string.
    Not sure what bugs this can lead to.
    
    --=20
    WBR, Andrey V. Elsukov
    
    
    --Etn7cfJBTaL5WvR4bGS0ux69lbSX3jEgf--
    
    --siHLtSsUO8aIvOaXfWLit5o77ESrA96GP
    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/
    
    iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlkdJ0cACgkQAcXqBBDI
    oXrJmQgAsDjmNc/WgLSIXEYc8jSmWJc9hvHmKVYwITYNUXHPk6EcKTF7fKb6tINv
    kytgFF7Bd3ZlrkqBrXgXlpdOnNac9ZzUI3UfC3qoqEbrKCWQ624kL54l3RE0w1f9
    k2RZBJ+CvL1XLriu03U8PCtCpNyXbl6LCK4IcBb+sPj26TvFqNekdBrS+sp11eSr
    +g1biZ6ckFHcKn/xqFbOk3V7MbKSTS1tzsGFovEIbctvusi4hTd6wAYH4i5C7J7O
    sICNA279K1A2YXCAQLvRQjQvl4U/jMEEea6EgLapfCMD25XkjiexmSiVaYoD6piL
    asy2P8jVeykpw47udjt6zKtOnKntUA==
    =9dAA
    -----END PGP SIGNATURE-----
    
    --siHLtSsUO8aIvOaXfWLit5o77ESrA96GP--
    
    From owner-svn-src-head@freebsd.org  Thu May 18 06:13:31 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32C28D72792;
     Thu, 18 May 2017 06:13:31 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 F3DCD1F93;
     Thu, 18 May 2017 06:13:30 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I6DTZW058239;
     Thu, 18 May 2017 06:13:29 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I6DTXL058238;
     Thu, 18 May 2017 06:13:29 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705180613.v4I6DTXL058238@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Thu, 18 May 2017 06:13:29 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318439 - head/sys/modules/ipsec
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 06:13:31 -0000
    
    Author: ngie
    Date: Thu May 18 06:13:29 2017
    New Revision: 318439
    URL: https://svnweb.freebsd.org/changeset/base/318439
    
    Log:
      Normalize .PATH on SRCTOP
      
      This will help Jenkins dedupe 9 warnings between the static build and
      the module build of ipsec(4).
      
      Missed in SRCTOP conversion in r314651.
      
      MFC with:	r314651
      Sponsored by:	Dell EMC Isilon
    
    Modified:
      head/sys/modules/ipsec/Makefile
    
    Modified: head/sys/modules/ipsec/Makefile
    ==============================================================================
    --- head/sys/modules/ipsec/Makefile	Thu May 18 03:32:01 2017	(r318438)
    +++ head/sys/modules/ipsec/Makefile	Thu May 18 06:13:29 2017	(r318439)
    @@ -1,6 +1,6 @@
     # $FreeBSD$
     
    -.PATH: ${SRCTOP}/sys/net ${.CURDIR}/../../netipsec
    +.PATH: ${SRCTOP}/sys/net ${SRCTOP}/sys/netipsec
     
     KMOD=	ipsec
     SRCS=	if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_mod.c \
    
    From owner-svn-src-head@freebsd.org  Thu May 18 06:15:43 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72A04D7281C;
     Thu, 18 May 2017 06:15:43 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 42F7C1104;
     Thu, 18 May 2017 06:15:43 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I6Fgev058367;
     Thu, 18 May 2017 06:15:42 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I6Fgu5058366;
     Thu, 18 May 2017 06:15:42 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705180615.v4I6Fgu5058366@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Thu, 18 May 2017 06:15:42 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318440 - head/sys/modules/dtrace/dtaudit
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 06:15:43 -0000
    
    Author: ngie
    Date: Thu May 18 06:15:42 2017
    New Revision: 318440
    URL: https://svnweb.freebsd.org/changeset/base/318440
    
    Log:
      Normalize SYSDIR on SRCTOP instead of .CURDIR
      
      This is being done to simplify pathing for CFLAGS and source files.
      
      MFC after:	2 weeks
      Sponsored by:	Dell EMC Isilon
    
    Modified:
      head/sys/modules/dtrace/dtaudit/Makefile
    
    Modified: head/sys/modules/dtrace/dtaudit/Makefile
    ==============================================================================
    --- head/sys/modules/dtrace/dtaudit/Makefile	Thu May 18 06:13:29 2017	(r318439)
    +++ head/sys/modules/dtrace/dtaudit/Makefile	Thu May 18 06:15:42 2017	(r318440)
    @@ -1,6 +1,6 @@
     # $FreeBSD$
     
    -SYSDIR?=	${.CURDIR}/../../..
    +SYSDIR?=	${SRCTOP}/sys
     
     .PATH:		${SYSDIR}/security/audit
     
    
    From owner-svn-src-head@freebsd.org  Thu May 18 06:25:40 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBA52D72B58;
     Thu, 18 May 2017 06:25:40 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 A364D1662;
     Thu, 18 May 2017 06:25:40 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I6PdHx062499;
     Thu, 18 May 2017 06:25:39 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I6Pd9j062495;
     Thu, 18 May 2017 06:25:39 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Thu, 18 May 2017 06:25:39 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318441 - in head/etc: . cron.d
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 06:25:41 -0000
    
    Author: ngie
    Date: Thu May 18 06:25:39 2017
    New Revision: 318441
    URL: https://svnweb.freebsd.org/changeset/base/318441
    
    Log:
      Handle the cron.d entry for MK_AT in cron conditionally
      
      Install /etc/cron.d/at if MK_AT != no, always using it, which tries
      to run a non-existent program via cron(8) every 5 minutes with the
      default /etc/crontab, prior to this commit.
      
      SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
      because atrun(8) executes programs, which may rely on environment
      currently set via /etc/crontab.
      
      Noted by:	bdrewery (in an internal review)
      MFC after:	2 months
      Relnotes:	yes (may need to add environmental modifications to
      		     /etc/cron.d/at)
      Sponsored by:	Dell EMC Isilon
    
    Added:
      head/etc/cron.d/
      head/etc/cron.d/Makefile   (contents, props changed)
      head/etc/cron.d/at   (contents, props changed)
    Modified:
      head/etc/Makefile
      head/etc/crontab
    
    Modified: head/etc/Makefile
    ==============================================================================
    --- head/etc/Makefile	Thu May 18 06:15:42 2017	(r318440)
    +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    @@ -8,6 +8,7 @@ FILESGROUPS=	FILES
     # No need as it is empty and just causes rebuilds since this file does so much.
     UPDATE_DEPENDFILE=	no
     SUBDIR=	\
    +	cron.d \
     	newsyslog.conf.d \
     	syslog.d
     
    
    Added: head/etc/cron.d/Makefile
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/etc/cron.d/Makefile	Thu May 18 06:25:39 2017	(r318441)
    @@ -0,0 +1,11 @@
    +# $FreeBSD$
    +
    +.include 
    +
    +.if ${MK_AT} != "no"
    +FILES+=		at
    +.endif
    +
    +BINDIR=		/etc/cron.d
    +
    +.include 
    
    Added: head/etc/cron.d/at
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/etc/cron.d/at	Thu May 18 06:25:39 2017	(r318441)
    @@ -0,0 +1,7 @@
    +# $FreeBSD$
    +#
    +SHELL=/bin/sh
    +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    +
    +# See crontab(5) for field format.
    +*/5	*	*	*	*	root	/usr/libexec/atrun
    
    Modified: head/etc/crontab
    ==============================================================================
    --- head/etc/crontab	Thu May 18 06:15:42 2017	(r318440)
    +++ head/etc/crontab	Thu May 18 06:25:39 2017	(r318441)
    @@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
     #
     #minute	hour	mday	month	wday	who	command
     #
    -*/5	*	*	*	*	root	/usr/libexec/atrun
    -#
     # Save some entropy so that /dev/random can re-seed on boot.
     */11	*	*	*	*	operator /usr/libexec/save-entropy
     #
    
    From owner-svn-src-head@freebsd.org  Thu May 18 06:27:38 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0BFDD72BFA;
     Thu, 18 May 2017 06:27:38 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 92ED517FA;
     Thu, 18 May 2017 06:27:38 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I6Rbx3062630;
     Thu, 18 May 2017 06:27:37 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I6RbXH062628;
     Thu, 18 May 2017 06:27:37 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705180627.v4I6RbXH062628@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Thu, 18 May 2017 06:27:37 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318442 - in head/etc: . cron.d
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 06:27:38 -0000
    
    Author: ngie
    Date: Thu May 18 06:27:37 2017
    New Revision: 318442
    URL: https://svnweb.freebsd.org/changeset/base/318442
    
    Log:
      Revert r318441: the commit message was incoherent
    
    Deleted:
      head/etc/cron.d/
    Modified:
      head/etc/Makefile
      head/etc/crontab
    
    Modified: head/etc/Makefile
    ==============================================================================
    --- head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    +++ head/etc/Makefile	Thu May 18 06:27:37 2017	(r318442)
    @@ -8,7 +8,6 @@ FILESGROUPS=	FILES
     # No need as it is empty and just causes rebuilds since this file does so much.
     UPDATE_DEPENDFILE=	no
     SUBDIR=	\
    -	cron.d \
     	newsyslog.conf.d \
     	syslog.d
     
    
    Modified: head/etc/crontab
    ==============================================================================
    --- head/etc/crontab	Thu May 18 06:25:39 2017	(r318441)
    +++ head/etc/crontab	Thu May 18 06:27:37 2017	(r318442)
    @@ -7,6 +7,8 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
     #
     #minute	hour	mday	month	wday	who	command
     #
    +*/5	*	*	*	*	root	/usr/libexec/atrun
    +#
     # Save some entropy so that /dev/random can re-seed on boot.
     */11	*	*	*	*	operator /usr/libexec/save-entropy
     #
    
    From owner-svn-src-head@freebsd.org  Thu May 18 06:33:57 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 854AFD72E80;
     Thu, 18 May 2017 06:33:57 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 3D3F41C6F;
     Thu, 18 May 2017 06:33:57 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I6Xuis066436;
     Thu, 18 May 2017 06:33:56 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I6Xt1g066432;
     Thu, 18 May 2017 06:33:55 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705180633.v4I6Xt1g066432@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Thu, 18 May 2017 06:33:55 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318443 - in head/etc: . cron.d
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 06:33:57 -0000
    
    Author: ngie
    Date: Thu May 18 06:33:55 2017
    New Revision: 318443
    URL: https://svnweb.freebsd.org/changeset/base/318443
    
    Log:
      Conditionally handle the crontab entry for atrun(8)
      
      The default crontab prior to this commit assumes atrun(8) is always
      present, which isn't true if MK_AT == no. Move atrun(8) execution
      from /etc/crontab to /etc/cron.d/at, and base /etc/cron.d/at's installation
      on MK_AT. cron(8) will detect /etc/cron.d/at's presence when the configuration
      is loaded and run atrun every 5 minutes like it would prior to this commit.
      
      SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
      because atrun(8) executes programs, which may rely on environment
      set in the current default /etc/crontab.
      
      Noted by:	bdrewery (in an internal review)
      MFC after:	2 months
      Relnotes:	yes (may need to add environmental modifications to
      		     /etc/cron.d/at)
      Sponsored by:	Dell EMC Isilon
    
    Added:
      head/etc/cron.d/
      head/etc/cron.d/Makefile   (contents, props changed)
      head/etc/cron.d/at   (contents, props changed)
    Modified:
      head/etc/Makefile
      head/etc/crontab
    
    Modified: head/etc/Makefile
    ==============================================================================
    --- head/etc/Makefile	Thu May 18 06:27:37 2017	(r318442)
    +++ head/etc/Makefile	Thu May 18 06:33:55 2017	(r318443)
    @@ -8,6 +8,7 @@ FILESGROUPS=	FILES
     # No need as it is empty and just causes rebuilds since this file does so much.
     UPDATE_DEPENDFILE=	no
     SUBDIR=	\
    +	cron.d \
     	newsyslog.conf.d \
     	syslog.d
     
    
    Added: head/etc/cron.d/Makefile
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/etc/cron.d/Makefile	Thu May 18 06:33:55 2017	(r318443)
    @@ -0,0 +1,11 @@
    +# $FreeBSD$
    +
    +.include 
    +
    +.if ${MK_AT} != "no"
    +FILES+=		at
    +.endif
    +
    +BINDIR=		/etc/cron.d
    +
    +.include 
    
    Added: head/etc/cron.d/at
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/etc/cron.d/at	Thu May 18 06:33:55 2017	(r318443)
    @@ -0,0 +1,7 @@
    +# $FreeBSD$
    +#
    +SHELL=/bin/sh
    +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    +
    +# See crontab(5) for field format.
    +*/5	*	*	*	*	root	/usr/libexec/atrun
    
    Modified: head/etc/crontab
    ==============================================================================
    --- head/etc/crontab	Thu May 18 06:27:37 2017	(r318442)
    +++ head/etc/crontab	Thu May 18 06:33:55 2017	(r318443)
    @@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
     #
     #minute	hour	mday	month	wday	who	command
     #
    -*/5	*	*	*	*	root	/usr/libexec/atrun
    -#
     # Save some entropy so that /dev/random can re-seed on boot.
     */11	*	*	*	*	operator /usr/libexec/save-entropy
     #
    
    From owner-svn-src-head@freebsd.org  Thu May 18 06:43:34 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F966D6C301;
     Thu, 18 May 2017 06:43:34 +0000 (UTC)
     (envelope-from bapt@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 783A21381;
     Thu, 18 May 2017 06:43:34 +0000 (UTC)
     (envelope-from bapt@FreeBSD.org)
    Received: by freefall.freebsd.org (Postfix, from userid 1235)
     id A1C952A13; Thu, 18 May 2017 06:43:33 +0000 (UTC)
    Date: Thu, 18 May 2017 08:43:33 +0200
    From: Baptiste Daroussin 
    To: Jonathan Anderson 
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: Re: svn commit: r318431 - head/libexec/rtld-elf
    Message-ID: <20170518064333.5767zwjk46vxi6fw@ivaldir.net>
    References: <201705172251.v4HMpSr3076792@repo.freebsd.org>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature"; boundary="befnp3zp4ufyadls"
    Content-Disposition: inline
    In-Reply-To: <201705172251.v4HMpSr3076792@repo.freebsd.org>
    User-Agent: NeoMutt/20170428 (1.8.2)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 06:43:34 -0000
    
    
    --befnp3zp4ufyadls
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    On Wed, May 17, 2017 at 10:51:28PM +0000, Jonathan Anderson wrote:
    > Author: jonathan
    > Date: Wed May 17 22:51:28 2017
    > New Revision: 318431
    > URL: https://svnweb.freebsd.org/changeset/base/318431
    >=20
    > Log:
    >   Allow rtld direct-exec to take a file descriptor.
    >  =20
    [snip]
    > +}
    > +
    > +/*
    >   * Parse a file descriptor number without pulling in more of libc (e.g. =
    atoi).
    >   */
    >  static int
    > @@ -5300,6 +5378,20 @@ parse_integer(const char *str)
    >  	return (n);
    >  }
    > =20
    > +void print_usage(const char *argv0)
    
    Style(9) bug :)
    
    > +{
    > +
    > +	rtld_printf("Usage: %s [-h] [-f ] [--]  []\n"
    > +		"\n"
    > +		"Options:\n"
    > +		"  -h        Display this help message\n"
    > +		/* TODO: "  -p        Search in PATH for named binary\n" */
    > +		"  -f    Execute  instead of searching for \n"
    > +		"  --        End of RTLD options\n"
    > +		"    Name of process to execute\n"
    > +		"      Arguments to the executed process\n", argv0);
    > +}
    > +
    >  /*
    >   * Overrides for libc_pic-provided functions.
    >   */
    >=20
    
    --befnp3zp4ufyadls
    Content-Type: application/pgp-signature; name="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlkdQpAACgkQY4mL3PG3
    PlqWFBAAsfCYUNgUff7orua4KEEYjuDPpvQAq+iOTsfu2Ph4Z6IOvR4hDBE/9BIG
    KSbkEgLjEGkeL3TKQNWjFboY8itqXdYDXFv2zkOuLLnkP7Gf+uBOQ4xw5Ukzslxc
    urbvHQqd0q8Hv5H2UXMy4AjJr7VQM2Z28zY8DEL4In4pd0cKbAL0ydYfkF5QYGRZ
    k5WVlZX2ri207jS9ztREI9K1+Fibn6uxEwgCMo0fZ14kPjfsNV9Y9qnq14SzZgyu
    yuo9WTKaimU6rxvZhB8/otZl/Wu+JKQbA76XQxACTZMOaVnGVkTNd6j6AGWVhjYP
    YUlj1xKSy6QZf8S17qHikMBVyT4ZdqZbZvqqzLZeClpxrW3ZrdRchTAzTHuoDrex
    tdjOAyIaHp9f8mHdQMqms142MtOrya4x/mg3rDqW3ADWyydO+tAOV4CuGv9oyFhN
    5PQ+mKXSorc4vP1FCE841Wf/Fpf6jD1NqAk9VUAXM/sj5k+1mh57oZQCetoSbkWW
    5zFNwkbeljELVbmMtRApyHtPShR86wqAbtHKVqw5kY+WuVGzPVTJ8ntAMW/F8cKE
    lj2VUvG1IaN/1vuPG4KeZLmHAHmKaI0+HwBx9rbGwiMq+5KZ3KCzYZFRQrBCwJZy
    GaTZTvg35mRGUemxq5335O+4yqReR4Ta39uVZL8+T/2NqOxcfuw=
    =7GjP
    -----END PGP SIGNATURE-----
    
    --befnp3zp4ufyadls--
    
    From owner-svn-src-head@freebsd.org  Thu May 18 08:25:09 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 554EAD712BA;
     Thu, 18 May 2017 08:25:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 19CB7172A;
     Thu, 18 May 2017 08:25:09 +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 v4I8P8kb011066;
     Thu, 18 May 2017 08:25:08 GMT (envelope-from trasz@FreeBSD.org)
    Received: (from trasz@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I8P8UA011065;
     Thu, 18 May 2017 08:25:08 GMT (envelope-from trasz@FreeBSD.org)
    Message-Id: <201705180825.v4I8P8UA011065@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: trasz set sender to
     trasz@FreeBSD.org using -f
    From: Edward Tomasz Napierala 
    Date: Thu, 18 May 2017 08:25:08 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318444 - head/sys/geom
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 08:25:09 -0000
    
    Author: trasz
    Date: Thu May 18 08:25:07 2017
    New Revision: 318444
    URL: https://svnweb.freebsd.org/changeset/base/318444
    
    Log:
      Fix typo.
      
      MFC after:	2 weeks
    
    Modified:
      head/sys/geom/geom_vfs.c
    
    Modified: head/sys/geom/geom_vfs.c
    ==============================================================================
    --- head/sys/geom/geom_vfs.c	Thu May 18 06:33:55 2017	(r318443)
    +++ head/sys/geom/geom_vfs.c	Thu May 18 08:25:07 2017	(r318444)
    @@ -168,7 +168,7 @@ g_vfs_strategy(struct bufobj *bo, struct
     	sc = cp->geom->softc;
     
     	/*
    -	 * If the provider has orphaned us, just return EXIO.
    +	 * If the provider has orphaned us, just return ENXIO.
     	 */
     	mtx_lock(&sc->sc_mtx);
     	if (sc->sc_orphaned) {
    
    From owner-svn-src-head@freebsd.org  Thu May 18 09:31:32 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 211AED7257B;
     Thu, 18 May 2017 09:31: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 mx1.freebsd.org (Postfix) with ESMTPS id E5AC61A12;
     Thu, 18 May 2017 09:31:31 +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 v4I9VUQ5039592;
     Thu, 18 May 2017 09:31:30 GMT (envelope-from kib@FreeBSD.org)
    Received: (from kib@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I9VU5n039591;
     Thu, 18 May 2017 09:31:30 GMT (envelope-from kib@FreeBSD.org)
    Message-Id: <201705180931.v4I9VU5n039591@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
     using -f
    From: Konstantin Belousov 
    Date: Thu, 18 May 2017 09:31:30 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318445 - head/libexec/rtld-elf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 09:31:32 -0000
    
    Author: kib
    Date: Thu May 18 09:31:30 2017
    New Revision: 318445
    URL: https://svnweb.freebsd.org/changeset/base/318445
    
    Log:
      Fix style [1], add static keyword before static function definition.
      
      Noted by:	bapt [1]
      Sponsored by:	The FreeBSD Foundation
      MFC after:	2 weeks
    
    Modified:
      head/libexec/rtld-elf/rtld.c
    
    Modified: head/libexec/rtld-elf/rtld.c
    ==============================================================================
    --- head/libexec/rtld-elf/rtld.c	Thu May 18 08:25:07 2017	(r318444)
    +++ head/libexec/rtld-elf/rtld.c	Thu May 18 09:31:30 2017	(r318445)
    @@ -5378,7 +5378,8 @@ parse_integer(const char *str)
     	return (n);
     }
     
    -void print_usage(const char *argv0)
    +static void
    +print_usage(const char *argv0)
     {
     
     	rtld_printf("Usage: %s [-h] [-f ] [--]  []\n"
    
    From owner-svn-src-head@freebsd.org  Thu May 18 09:34:28 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A666D727E5;
     Thu, 18 May 2017 09:34:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id DEF291F82;
     Thu, 18 May 2017 09:34:27 +0000 (UTC) (envelope-from kib@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4I9YQZd039984;
     Thu, 18 May 2017 09:34:26 GMT (envelope-from kib@FreeBSD.org)
    Received: (from kib@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4I9YQ6U039983;
     Thu, 18 May 2017 09:34:26 GMT (envelope-from kib@FreeBSD.org)
    Message-Id: <201705180934.v4I9YQ6U039983@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
     using -f
    From: Konstantin Belousov 
    Date: Thu, 18 May 2017 09:34:26 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318446 - head/libexec/rtld-elf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 09:34:28 -0000
    
    Author: kib
    Date: Thu May 18 09:34:26 2017
    New Revision: 318446
    URL: https://svnweb.freebsd.org/changeset/base/318446
    
    Log:
      Update my copyright, note The FreeBSD Foundation involvement.
      While tweaking copyright block, switch to use __FBSDID for tag.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	2 weeks
    
    Modified:
      head/libexec/rtld-elf/rtld.c
    
    Modified: head/libexec/rtld-elf/rtld.c
    ==============================================================================
    --- head/libexec/rtld-elf/rtld.c	Thu May 18 09:31:30 2017	(r318445)
    +++ head/libexec/rtld-elf/rtld.c	Thu May 18 09:34:26 2017	(r318446)
    @@ -1,10 +1,14 @@
     /*-
      * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra.
      * Copyright 2003 Alexander Kabaev .
    - * Copyright 2009-2012 Konstantin Belousov .
    + * Copyright 2009-2013 Konstantin Belousov .
      * Copyright 2012 John Marino .
    + * Copyright 2014-2017 The FreeBSD Foundation
      * All rights reserved.
      *
    + * Portions of this software were developed by Konstantin Belousov
    + * under sponsorship from the FreeBSD Foundation.
    + *
      * Redistribution and use in source and binary forms, with or without
      * modification, are permitted provided that the following conditions
      * are met:
    @@ -24,8 +28,6 @@
      * 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$
      */
     
     /*
    @@ -34,6 +36,9 @@
      * John Polstra .
      */
     
    +#include 
    +__FBSDID("$FreeBSD$");
    +
     #include 
     #include 
     #include 
    
    From owner-svn-src-head@freebsd.org  Thu May 18 09:45:48 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 481E2D72B45;
     Thu, 18 May 2017 09:45:48 +0000 (UTC)
     (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
    Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140])
     (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 0BE7615FA;
     Thu, 18 May 2017 09:45:47 +0000 (UTC)
     (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
    Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1])
     by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v4I9jkLk065430;
     Thu, 18 May 2017 02:45:46 -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 v4I9jkTP065429;
     Thu, 18 May 2017 02:45:46 -0700 (PDT) (envelope-from freebsd)
    From: "Rodney W. Grimes" 
    Message-Id: <201705180945.v4I9jkTP065429@pdx.rh.CN85.dnsmgr.net>
    Subject: Re: svn commit: r318400 - head/sbin/ipfw
    In-Reply-To: <72e5d765-dfd5-dd65-b8f1-9d5524cde366@yandex.ru>
    To: "Andrey V. Elsukov" 
    Date: Thu, 18 May 2017 02:45:46 -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.23
    Precedence: list
    List-Id: 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, 18 May 2017 09:45:48 -0000
    
    -- Start of PGP signed section.
    [ Charset UTF-8 unsupported, converting... ]
    > On 18.05.2017 03:49, Rodney W. Grimes wrote:
    > > [ Charset UTF-8 unsupported, converting... ]
    > >> Author: ae
    > >> Date: Wed May 17 10:56:22 2017
    > >> New Revision: 318400
    > >> URL: https://svnweb.freebsd.org/changeset/base/318400
    > >>
    > >> Log:
    > >>   Allow zero port specification in table entries with type flow.
    > >>   
    > >>   PR:		217620
    > >>   MFC after:	1 week
    > >>
    > >> Modified:
    > >>   head/sbin/ipfw/tables.c
    > >>
    > >> Modified: head/sbin/ipfw/tables.c
    > >> ==============================================================================
    > >> --- head/sbin/ipfw/tables.c	Wed May 17 09:04:09 2017	(r318399)
    > >> +++ head/sbin/ipfw/tables.c	Wed May 17 10:56:22 2017	(r318400)
    > >> @@ -1260,16 +1260,14 @@ tentry_fill_key_type(char *arg, ipfw_obj
    > >>  			if ((p = strchr(arg, ',')) != NULL)
    > >>  				*p++ = '\0';
    > >>  
    > >> -			if ((port = htons(strtol(arg, NULL, 10))) == 0) {
    > >> +			port = htons(strtol(arg, &pp, 10));
    > >                                                       ^^^
    > > Can this be converted to a sizeof(foo) somehow?
    > > Constants like this are typically bad style and lead to bugs.
    > 
    > This means that decimal number is expected in the string.
    > Not sure what bugs this can lead to.
    
    Ignore me, my brain was reading strtok as strncpy and expecting
    the third argument to be length limit.
    
    -- 
    Rod Grimes                                                 rgrimes@freebsd.org
    
    From owner-svn-src-head@freebsd.org  Thu May 18 09:56:32 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA265D72E0F;
     Thu, 18 May 2017 09:56:32 +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 8FF541AFF;
     Thu, 18 May 2017 09:56:32 +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 v4I9uVER065466;
     Thu, 18 May 2017 02:56: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 v4I9uVpQ065465;
     Thu, 18 May 2017 02:56:31 -0700 (PDT) (envelope-from freebsd)
    From: "Rodney W. Grimes" 
    Message-Id: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    In-Reply-To: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
    To: Ngie Cooper 
    Date: Thu, 18 May 2017 02:56:31 -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.23
    Precedence: list
    List-Id: 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, 18 May 2017 09:56:33 -0000
    
    > Author: ngie
    > Date: Thu May 18 06:25:39 2017
    > New Revision: 318441
    > URL: https://svnweb.freebsd.org/changeset/base/318441
    > 
    > Log:
    >   Handle the cron.d entry for MK_AT in cron conditionally
    >   
    >   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
    >   to run a non-existent program via cron(8) every 5 minutes with the
    >   default /etc/crontab, prior to this commit.
    >   
    >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
    >   because atrun(8) executes programs, which may rely on environment
    >   currently set via /etc/crontab.
    >   
    >   Noted by:	bdrewery (in an internal review)
    >   MFC after:	2 months
    >   Relnotes:	yes (may need to add environmental modifications to
    >   		     /etc/cron.d/at)
    >   Sponsored by:	Dell EMC Isilon
    > 
    > Added:
    >   head/etc/cron.d/
    >   head/etc/cron.d/Makefile   (contents, props changed)
    >   head/etc/cron.d/at   (contents, props changed)
    > Modified:
    >   head/etc/Makefile
    >   head/etc/crontab
    > 
    > Modified: head/etc/Makefile
    > ==============================================================================
    > --- head/etc/Makefile	Thu May 18 06:15:42 2017	(r318440)
    > +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    > @@ -8,6 +8,7 @@ FILESGROUPS=	FILES
    >  # No need as it is empty and just causes rebuilds since this file does so much.
    >  UPDATE_DEPENDFILE=	no
    >  SUBDIR=	\
    > +	cron.d \
    >  	newsyslog.conf.d \
    >  	syslog.d
    
    The thread on the newsyslog clearly shows that this is a contriversial change.
    
    I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
    to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
    desires of others.
    
    I especially object to it being done on a 1 of case, either completly split
    the file or make it 1 file, but making it this miss match is just adding to
    the work load of ansible and puppet task writting.  You now have to mange
    2 config files rather than 1 for cron, and 7 for newsyslog instead of 1.
    
    > Added: head/etc/cron.d/Makefile
    > ==============================================================================
    > --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    > +++ head/etc/cron.d/Makefile	Thu May 18 06:25:39 2017	(r318441)
    > @@ -0,0 +1,11 @@
    > +# $FreeBSD$
    > +
    > +.include 
    > +
    > +.if ${MK_AT} != "no"
    > +FILES+=		at
    > +.endif
    > +
    > +BINDIR=		/etc/cron.d
    > +
    > +.include 
    > 
    > Added: head/etc/cron.d/at
    > ==============================================================================
    > --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    > +++ head/etc/cron.d/at	Thu May 18 06:25:39 2017	(r318441)
    > @@ -0,0 +1,7 @@
    > +# $FreeBSD$
    > +#
    > +SHELL=/bin/sh
    > +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    > +
    > +# See crontab(5) for field format.
    > +*/5	*	*	*	*	root	/usr/libexec/atrun
    > 
    > Modified: head/etc/crontab
    > ==============================================================================
    > --- head/etc/crontab	Thu May 18 06:15:42 2017	(r318440)
    > +++ head/etc/crontab	Thu May 18 06:25:39 2017	(r318441)
    > @@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    >  #
    >  #minute	hour	mday	month	wday	who	command
    >  #
    > -*/5	*	*	*	*	root	/usr/libexec/atrun
    > -#
    >  # Save some entropy so that /dev/random can re-seed on boot.
    >  */11	*	*	*	*	operator /usr/libexec/save-entropy
    >  #
    > 
    > 
    
    -- 
    Rod Grimes                                                 rgrimes@freebsd.org
    
    From owner-svn-src-head@freebsd.org  Thu May 18 12:55:09 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 280F7D72210;
     Thu, 18 May 2017 12:55: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 mx1.freebsd.org (Postfix) with ESMTPS id EC4091503;
     Thu, 18 May 2017 12:55:08 +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 v4ICt7JZ021644;
     Thu, 18 May 2017 12:55:07 GMT (envelope-from allanjude@FreeBSD.org)
    Received: (from allanjude@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4ICt7UM021643;
     Thu, 18 May 2017 12:55:07 GMT (envelope-from allanjude@FreeBSD.org)
    Message-Id: <201705181255.v4ICt7UM021643@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: allanjude set sender to
     allanjude@FreeBSD.org using -f
    From: Allan Jude 
    Date: Thu, 18 May 2017 12:55:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318448 - head/usr.bin/top
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 12:55:09 -0000
    
    Author: allanjude
    Date: Thu May 18 12:55:07 2017
    New Revision: 318448
    URL: https://svnweb.freebsd.org/changeset/base/318448
    
    Log:
      Explain the new fields in top(1) related to ZFS compressed ARC
      
      Reviewed by:	bcr
      X-MFC-with:	316314
      Differential Revision:	https://reviews.freebsd.org/D10781
    
    Modified:
      head/usr.bin/top/top.local.1
    
    Modified: head/usr.bin/top/top.local.1
    ==============================================================================
    --- head/usr.bin/top/top.local.1	Thu May 18 12:27:41 2017	(r318447)
    +++ head/usr.bin/top/top.local.1	Thu May 18 12:55:07 2017	(r318448)
    @@ -2,9 +2,10 @@
     .SH "FreeBSD NOTES"
     
     .SH DESCRIPTION OF MEMORY
    -Mem: 9220K Active, 1M Inact, 1M Laundry, 3284K Wired, 2M Buf, 932K Free
    -ARC: 2048K Total, 342K MRU, 760K MFU, 272K Anon, 96K Header, 442K Other
    -Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out
    +Mem: 61M Active, 86M Inact, 368K Laundry, 22G Wired, 102G Free
    +ARC: 15G Total, 9303M MFU, 6155M MRU, 1464K Anon, 98M Header, 35M Other
    +     15G Compressed, 27G Uncompressed, 1.75:1 Ratio, 174M Overhead
    +Swap: 4096M Total, 532M Free, 13% Inuse, 80K In, 104K Out
     .TP
     .B K:
     Kilobyte
    @@ -54,8 +55,20 @@ number of ARC bytes holding in flight da
     .B Header:
     number of ARC bytes holding headers
     .TP
    -.B Other
    +.B Other:
     miscellaneous ARC bytes
    +.TP
    +.B Compressed:
    +bytes of memory used by ARC caches
    +.TP
    +.B Uncompressed:
    +bytes of data stored in ARC caches before compression
    +.TP
    +.B Ratio:
    +ratio of uncompressed data to total ARC size
    +.TP
    +.B Overhead:
    +amount of overhead from ARC compression
     .SS Swap Stats
     .TP
     .B Total:
    
    From owner-svn-src-head@freebsd.org  Thu May 18 12:59:28 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF259D72306
     for ;
     Thu, 18 May 2017 12:59:28 +0000 (UTC)
     (envelope-from lifanov@FreeBSD.org)
    Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12])
     (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 B04491815
     for ; Thu, 18 May 2017 12:59:28 +0000 (UTC)
     (envelope-from lifanov@FreeBSD.org)
    Received: from [10.11.0.121] (webassign-to-rtp-ip-asr-gw.ncren.net
     [128.109.111.6])
     (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
     (No client certificate requested)
     by mail.lifanov.com (Postfix) with ESMTPSA id 89CD1239431
     for ; Thu, 18 May 2017 08:59:22 -0400 (EDT)
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    To: svn-src-head@freebsd.org
    References: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    From: Nikolai Lifanov 
    Message-ID: 
    Date: Thu, 18 May 2017 08:59:10 -0400
    User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
     Thunderbird/52.1.0
    MIME-Version: 1.0
    In-Reply-To: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    Content-Type: multipart/signed; micalg=pgp-sha512;
     protocol="application/pgp-signature";
     boundary="EfUSSMKlEXBXLB7l0pU1taJVn0tsggRQa"
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 12:59:28 -0000
    
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    --EfUSSMKlEXBXLB7l0pU1taJVn0tsggRQa
    Content-Type: multipart/mixed; boundary="KKVmwrgnNtFlXMlgBXLKQsmHTUGtjxFl7";
     protected-headers="v1"
    From: Nikolai Lifanov 
    To: svn-src-head@freebsd.org
    Message-ID: 
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    References: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    In-Reply-To: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    
    --KKVmwrgnNtFlXMlgBXLKQsmHTUGtjxFl7
    Content-Type: text/plain; charset=utf-8
    Content-Language: en-US
    Content-Transfer-Encoding: quoted-printable
    
    On 05/18/2017 05:56, Rodney W. Grimes wrote:
    >> Author: ngie
    >> Date: Thu May 18 06:25:39 2017
    >> New Revision: 318441
    >> URL: https://svnweb.freebsd.org/changeset/base/318441
    >>
    >> Log:
    >>   Handle the cron.d entry for MK_AT in cron conditionally
    >>  =20
    
    >=20
    > The thread on the newsyslog clearly shows that this is a contriversial =
    change.
    >=20
    > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO =
    files
    > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and=
    
    > desires of others.
    >=20
    
    I'm not an appliance vendor and am not affiliated with Dell/EMC/Isilon
    and this change served my needs and desires.
    
    When automating configuration management, templating a file instead of
    conditionally installing/removing configuration snippets is:
    
    1) less performant because you can't just check mtime of the expanded
    template vs. the source file to figure out whether to expand it again,
    which affects practical frequency of configuration runs
    2) couples logic from unrelated configuration modules, making working on
    different configuration with different people more difficult
    
    I really wish we had /etc/fstab.d/ :)
    
    > I especially object to it being done on a 1 of case, either completly s=
    plit
    > the file or make it 1 file, but making it this miss match is just addin=
    g to
    > the work load of ansible and puppet task writting.  You now have to man=
    ge
    > 2 config files rather than 1 for cron, and 7 for newsyslog instead of 1=
    =2E
    >=20
    
    I agree that inconsistencies are bad, but I think we can get there
    incrementally, unbundling configuration of one MK_* thing at a time.
    
    - Nikolai Lifanov
    
    
    --KKVmwrgnNtFlXMlgBXLKQsmHTUGtjxFl7--
    
    --EfUSSMKlEXBXLB7l0pU1taJVn0tsggRQa
    Content-Type: application/pgp-signature; name="signature.asc"
    Content-Description: OpenPGP digital signature
    Content-Disposition: attachment; filename="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    
    iQKoBAEBCgCSFiEE5oT6TcuaWvG5gtjzZ6sv56ecR0UFAlkdmp5fFIAAAAAALgAo
    aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU2
    ODRGQTREQ0I5QTVBRjFCOTgyRDhGMzY3QUIyRkU3QTc5QzQ3NDUUHGxpZmFub3ZA
    ZnJlZWJzZC5vcmcACgkQZ6sv56ecR0WMAA//Yfc883KEFKj9gdmGT2+raIZm4n8g
    NniMqG9eqyQLTRnBmymSfgLFKt1gZxRrVWo1QH0XoyLjGex5XEBi3rVL8oM213Hj
    2w2NvsS2Amd0FInSgjdiRV9hxxzVk7TAywa9GyMqK2jci89pwyHro/6YOTPvv0O+
    9Df9W3ZCzYe9CoEvSjus4ZOdf2Dq3zvBKI9K93u4RUoYV5LukRrI7L9pd58bN7W3
    MD01yuHn1bHvC/dVfWHs9a5XtCV3xRSE92L9ls9BbzXWzgFHG0YcY+BHfYgy0U7+
    gRG7ZGU2BpxQhaynU2c5ox0q3sRKY/P6H3mKhulTKfi48dLe1UA7OHCc6P+ilW89
    vJj0j4Sef5JDD7r5pnmDkM7EYmXFzn2MDoDRutEuV19spr+ugvZyWVIB9PGdERj5
    fpbJtR2o60WqQqfAU74QOSVBMySMWnVzXmDBVUUazUjjbLV9ASrwzjuVC6IzAgjg
    kQhqtiXT1nVSeBO5IcQx/VHylJsBnT55SD5XKHVhpjIF66VKyd0yAsOBNMBM+6Wn
    FbrzkLEApj3y7CjWO47JHVt2pKXGS47Z444Q19w8epjSASL+ekJYKJXu6h/6rxXi
    ZOaY9vsBK5f8n2HA0/L18x9qWOpLmMqjCFrui9en3SGnaJYLN1hT0T9ETx9BDo6u
    1lLPjIrDaCjOmyw=
    =c7Os
    -----END PGP SIGNATURE-----
    
    --EfUSSMKlEXBXLB7l0pU1taJVn0tsggRQa--
    
    From owner-svn-src-head@freebsd.org  Thu May 18 13:09:33 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8F53D724D0;
     Thu, 18 May 2017 13:09:33 +0000 (UTC)
     (envelope-from bapt@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 812051BEA;
     Thu, 18 May 2017 13:09:33 +0000 (UTC)
     (envelope-from bapt@FreeBSD.org)
    Received: by freefall.freebsd.org (Postfix, from userid 1235)
     id A73E67400; Thu, 18 May 2017 13:09:32 +0000 (UTC)
    Date: Thu, 18 May 2017 15:09:32 +0200
    From: Baptiste Daroussin 
    To: rgrimes@freebsd.org
    Cc: Ngie Cooper , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    Message-ID: <20170518130932.eo5clhki4za2vigz@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature"; boundary="hkqzmaj2eaimfgcz"
    Content-Disposition: inline
    In-Reply-To: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    User-Agent: NeoMutt/20170428 (1.8.2)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 13:09:33 -0000
    
    
    --hkqzmaj2eaimfgcz
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
    > > Author: ngie
    > > Date: Thu May 18 06:25:39 2017
    > > New Revision: 318441
    > > URL: https://svnweb.freebsd.org/changeset/base/318441
    > >=20
    > > Log:
    > >   Handle the cron.d entry for MK_AT in cron conditionally
    > >  =20
    > >   Install /etc/cron.d/at if MK_AT !=3D no, always using it, which tries
    > >   to run a non-existent program via cron(8) every 5 minutes with the
    > >   default /etc/crontab, prior to this commit.
    > >  =20
    > >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
    > >   because atrun(8) executes programs, which may rely on environment
    > >   currently set via /etc/crontab.
    > >  =20
    > >   Noted by:	bdrewery (in an internal review)
    > >   MFC after:	2 months
    > >   Relnotes:	yes (may need to add environmental modifications to
    > >   		     /etc/cron.d/at)
    > >   Sponsored by:	Dell EMC Isilon
    > >=20
    > > Added:
    > >   head/etc/cron.d/
    > >   head/etc/cron.d/Makefile   (contents, props changed)
    > >   head/etc/cron.d/at   (contents, props changed)
    > > Modified:
    > >   head/etc/Makefile
    > >   head/etc/crontab
    > >=20
    > > Modified: head/etc/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/etc/Makefile	Thu May 18 06:15:42 2017	(r318440)
    > > +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    > > @@ -8,6 +8,7 @@ FILESGROUPS=3D	FILES
    > >  # No need as it is empty and just causes rebuilds since this file does=
     so much.
    > >  UPDATE_DEPENDFILE=3D	no
    > >  SUBDIR=3D	\
    > > +	cron.d \
    > >  	newsyslog.conf.d \
    > >  	syslog.d
    >=20
    > The thread on the newsyslog clearly shows that this is a contriversial ch=
    ange.
    >=20
    > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO fi=
    les
    > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
    > desires of others.
    
    Has multiple people has stated, on the newsyslog thread. this is not a
    DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
    1. Consistency
      as a project we do support building WITHOUT_FOO there is no reason to ins=
    tall
      syslog, cron configuration for FOO if the system was built without foo
    
    2. Packaging base
      if one does not install at there is no need for the at crontab to be inst=
    alled
      (same reason as 1.)
    
    3. Large deployment of freebsd farms
      Being able to administrate thousands of FreeBSD machines, one often ends =
    up
      using tools like puppet, chef, ansible, cfengine. When programmatically
      handling configuration management it is way easier and safer to simple
      add/removes files in a directory rather than mangling^Winplace editing fi=
    les.
    
    4. Ports/packages
      On can provide easily sample configuration for cron, syslog (not only) an=
    d the
      admin can decide to use it or not easily (ususally this is done by making
      symlinks from the said file which would live in share/* into the .d direc=
    tory.
    
    This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.
    
    Best regards,
    Bapt
    
    --hkqzmaj2eaimfgcz
    Content-Type: application/pgp-signature; name="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlkdnQkACgkQY4mL3PG3
    PlphKw//S2nZH85ZFQ5miEw9PbpWRR63V9cHp3M/OhT63hPeZ1TIXcU6Y3dPEKPU
    zCUjSeds8bZDKauR9ifPy1HhUzuvSIcJNQCaErCLE4l/F3Zc3jUC/nTQ7vsF1FGf
    lKf41fsoXnVuurBOhubmLwBu9BYjfw4grWPmJzIx1gv5mnYF9wf80d40VdsEOr6/
    4c/lErNr0B3RcWFq6yv93cYLDxCkGK0pxq1XJpQO1WygRYqBYZLvBwHAUG6/02Vi
    V0Piyu6apBzHvDyWoncrULYCtfF7UtxdGmdOQVH3arCNSBHtOUd1oZEtku0G6Qcc
    yHWAzqB8imZWQ9Hko9JX/Xmuqp2CUWLZNsmRxpwpGMbgplSoov4hZNFtiPMQlVhm
    v1j1uXOOPhVG/8wXqVewGf8A8om6GL2fHarMZ0OssZ5RAN9+zctdNL2+GUxqLsNH
    s/1Cx/UUoCx0cLiSBkWdpIhEzv3EYxGdzkTFIpFqMu9/RIrknmtlv+tibfHHivlQ
    7PMpaUSk/P6mSLj/WDHo9cIxBQ1P0z+qs2Wqa+ALyhNpXo1fYZdAEKNGVM2Lzma5
    Lez6+uHOto9hgWJmjG45oGgz34thRT4xg0iy56FwKpYBFXHiiP7879/Oi17fR+32
    2c2/k6b37cMt3WA5bsBiyyw7zdpAFiHq5sSAUa33in8P5nc+JWM=
    =GELL
    -----END PGP SIGNATURE-----
    
    --hkqzmaj2eaimfgcz--
    
    From owner-svn-src-head@freebsd.org  Thu May 18 13:12:25 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62D5CD72742;
     Thu, 18 May 2017 13:12:25 +0000 (UTC)
     (envelope-from jonathan@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 437D41FF6;
     Thu, 18 May 2017 13:12:25 +0000 (UTC)
     (envelope-from jonathan@FreeBSD.org)
    Received: from [IPv6:::1] (unknown [127.0.1.132])
     by freefall.freebsd.org (Postfix) with ESMTP id 1753C7568;
     Thu, 18 May 2017 13:12:24 +0000 (UTC)
     (envelope-from jonathan@FreeBSD.org)
    Subject: Re: svn commit: r318431 - head/libexec/rtld-elf
    To: Baptiste Daroussin 
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    References: <201705172251.v4HMpSr3076792@repo.freebsd.org>
     <20170518064333.5767zwjk46vxi6fw@ivaldir.net>
    From: Jonathan Anderson 
    Message-ID: <47efec4d-35cc-2908-af9e-0d462a83d868@FreeBSD.org>
    Date: Thu, 18 May 2017 10:42:23 -0230
    User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
     Thunderbird/52.0.1
    MIME-Version: 1.0
    In-Reply-To: <20170518064333.5767zwjk46vxi6fw@ivaldir.net>
    Content-Type: text/plain; charset=windows-1252; format=flowed
    Content-Transfer-Encoding: 7bit
    Content-Language: en-US
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 13:12:25 -0000
    
    
    
    On 05/18/17 04:13, Baptiste Daroussin wrote:
    > On Wed, May 17, 2017 at 10:51:28PM +0000, Jonathan Anderson wrote:
    >>   
    >> +void print_usage(const char *argv0)
    > Style(9) bug :)
    
    Duly noted. :)
    
    It looks like kib@ has already sorted this out in his timezone.
    
    
    Jon
    
    -- 
    jonathan@FreeBSD.org
    
    
    From owner-svn-src-head@freebsd.org  Thu May 18 13:49:55 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0030ED733D0;
     Thu, 18 May 2017 13:49:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id C13B11D37;
     Thu, 18 May 2017 13:49:54 +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 v4IDnrsZ044852;
     Thu, 18 May 2017 13:49:53 GMT (envelope-from kib@FreeBSD.org)
    Received: (from kib@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IDnrPf044850;
     Thu, 18 May 2017 13:49:53 GMT (envelope-from kib@FreeBSD.org)
    Message-Id: <201705181349.v4IDnrPf044850@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
     using -f
    From: Konstantin Belousov 
    Date: Thu, 18 May 2017 13:49:53 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318450 - head/lib/libc/tests/gen
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 13:49:55 -0000
    
    Author: kib
    Date: Thu May 18 13:49:53 2017
    New Revision: 318450
    URL: https://svnweb.freebsd.org/changeset/base/318450
    
    Log:
      Add tests for some cases in r318298.
      
      The first test triggers the out of bounds read of the 'left' array. It
      only fails when realpath.c is compiled with '-fsanitize=address'.
      
      The other test checks for ENOENT when running into an empty
      symlink. This matches NetBSD's realpath(3) semantics. Previously,
      empty symlinks were treated like ".".
      
      Submitted by:	Jan Kokemц╪ller 
      PR:	219154
      MFC after:	2 weeks
    
    Added:
      head/lib/libc/tests/gen/realpath2_test.c   (contents, props changed)
    Modified:
      head/lib/libc/tests/gen/Makefile
    
    Modified: head/lib/libc/tests/gen/Makefile
    ==============================================================================
    --- head/lib/libc/tests/gen/Makefile	Thu May 18 13:19:07 2017	(r318449)
    +++ head/lib/libc/tests/gen/Makefile	Thu May 18 13:49:53 2017	(r318450)
    @@ -13,6 +13,7 @@ ATF_TESTS_C+=		popen_test
     ATF_TESTS_C+=		posix_spawn_test
     ATF_TESTS_C+=		wordexp_test
     ATF_TESTS_C+=		dlopen_empty_test
    +ATF_TESTS_C+=		realpath2_test
     
     # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid,
     # TODO: t_siginfo (fixes require further inspection)
    
    Added: head/lib/libc/tests/gen/realpath2_test.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/tests/gen/realpath2_test.c	Thu May 18 13:49:53 2017	(r318450)
    @@ -0,0 +1,102 @@
    +/*
    + * Copyright (c) 2017 Jan Kokemüller
    + * All rights reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + */
    +
    +#include 
    +__FBSDID("$FreeBSD$");
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include 
    +
    +ATF_TC(realpath_buffer_overflow);
    +ATF_TC_HEAD(realpath_buffer_overflow, tc)
    +{
    +	atf_tc_set_md_var(tc, "descr",
    +	    "Test for out of bounds read from 'left' array "
    +	    "(compile realpath.c with '-fsanitize=address')");
    +}
    +
    +ATF_TC_BODY(realpath_buffer_overflow, tc)
    +{
    +	char path[MAXPATHLEN] = { 0 };
    +	char resb[MAXPATHLEN] = { 0 };
    +	size_t i;
    +
    +	path[0] = 'a';
    +	path[1] = '/';
    +	for (i = 2; i < sizeof(path) - 1; ++i) {
    +		path[i] = 'a';
    +	}
    +
    +	ATF_REQUIRE(realpath(path, resb) == NULL);
    +}
    +
    +ATF_TC(realpath_empty_symlink);
    +ATF_TC_HEAD(realpath_empty_symlink, tc)
    +{
    +	atf_tc_set_md_var(tc, "descr",
    +	    "Test for correct behavior when encountering empty symlinks");
    +}
    +
    +ATF_TC_BODY(realpath_empty_symlink, tc)
    +{
    +	char path[MAXPATHLEN] = { 0 };
    +	char slnk[MAXPATHLEN] = { 0 };
    +	char resb[MAXPATHLEN] = { 0 };
    +	int fd;
    +
    +	(void)strlcat(slnk, "empty_symlink", sizeof(slnk));
    +
    +	ATF_REQUIRE(symlink("", slnk) == 0);
    +
    +	fd = open("aaa", O_RDONLY | O_CREAT, 0600);
    +
    +	ATF_REQUIRE(fd >= 0);
    +	ATF_REQUIRE(close(fd) == 0);
    +
    +	(void)strlcat(path, "empty_symlink", sizeof(path));
    +	(void)strlcat(path, "/aaa", sizeof(path));
    +
    +	ATF_REQUIRE_ERRNO(ENOENT, realpath(path, resb) == NULL);
    +
    +	ATF_REQUIRE(unlink("aaa") == 0);
    +	ATF_REQUIRE(unlink(slnk) == 0);
    +}
    +
    +ATF_TP_ADD_TCS(tp)
    +{
    +
    +	ATF_TP_ADD_TC(tp, realpath_buffer_overflow);
    +	ATF_TP_ADD_TC(tp, realpath_empty_symlink);
    +
    +	return atf_no_error();
    +}
    
    From owner-svn-src-head@freebsd.org  Thu May 18 14:05:31 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E9B9D73C14;
     Thu, 18 May 2017 14:05:31 +0000 (UTC)
     (envelope-from emaste@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 40366D29;
     Thu, 18 May 2017 14:05:31 +0000 (UTC)
     (envelope-from emaste@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4IE5UNt052867;
     Thu, 18 May 2017 14:05:30 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IE5TEi052861;
     Thu, 18 May 2017 14:05:29 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705181405.v4IE5TEi052861@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Thu, 18 May 2017 14:05:29 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318451 - in head/usr.sbin/makefs: . ffs
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 14:05:31 -0000
    
    Author: emaste
    Date: Thu May 18 14:05:29 2017
    New Revision: 318451
    URL: https://svnweb.freebsd.org/changeset/base/318451
    
    Log:
      makefs: clean up signedness warnings and bump WARNS to 3
      
      Reviewed by:	kib
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D10650
    
    Modified:
      head/usr.sbin/makefs/Makefile
      head/usr.sbin/makefs/ffs.c
      head/usr.sbin/makefs/ffs/ffs_alloc.c
      head/usr.sbin/makefs/ffs/ffs_balloc.c
      head/usr.sbin/makefs/ffs/ffs_bswap.c
      head/usr.sbin/makefs/mtree.c
    
    Modified: head/usr.sbin/makefs/Makefile
    ==============================================================================
    --- head/usr.sbin/makefs/Makefile	Thu May 18 13:49:53 2017	(r318450)
    +++ head/usr.sbin/makefs/Makefile	Thu May 18 14:05:29 2017	(r318451)
    @@ -14,7 +14,7 @@ SRCS=	cd9660.c ffs.c \
     	walk.c
     MAN=	makefs.8
     
    -WARNS?=	2
    +WARNS?=	3
     
     .include "${SRCDIR}/cd9660/Makefile.inc"
     .include "${SRCDIR}/ffs/Makefile.inc"
    
    Modified: head/usr.sbin/makefs/ffs.c
    ==============================================================================
    --- head/usr.sbin/makefs/ffs.c	Thu May 18 13:49:53 2017	(r318450)
    +++ head/usr.sbin/makefs/ffs.c	Thu May 18 14:05:29 2017	(r318451)
    @@ -1065,10 +1065,11 @@ ffs_write_inode(union dinode *dp, uint32
     	struct ufs2_dinode *dp2, *dip;
     	struct cg	*cgp;
     	struct fs	*fs;
    -	int		cg, cgino, i;
    +	int		cg, cgino;
    +	uint32_t	i;
     	daddr_t		d;
     	char		sbbuf[FFS_MAXBSIZE];
    -	int32_t		initediblk;
    +	uint32_t	initediblk;
     	ffs_opt_t	*ffs_opts = fsopts->fs_specific;
     
     	assert (dp != NULL);
    
    Modified: head/usr.sbin/makefs/ffs/ffs_alloc.c
    ==============================================================================
    --- head/usr.sbin/makefs/ffs/ffs_alloc.c	Thu May 18 13:49:53 2017	(r318450)
    +++ head/usr.sbin/makefs/ffs/ffs_alloc.c	Thu May 18 14:05:29 2017	(r318451)
    @@ -64,7 +64,7 @@ static int scanc(u_int, const u_char *, 
     
     static daddr_t ffs_alloccg(struct inode *, int, daddr_t, int);
     static daddr_t ffs_alloccgblk(struct inode *, struct buf *, daddr_t);
    -static daddr_t ffs_hashalloc(struct inode *, int, daddr_t, int,
    +static daddr_t ffs_hashalloc(struct inode *, u_int, daddr_t, int,
     		     daddr_t (*)(struct inode *, int, daddr_t, int));
     static int32_t ffs_mapsearch(struct fs *, struct cg *, daddr_t, int);
     
    @@ -152,8 +152,8 @@ daddr_t
     ffs_blkpref_ufs1(struct inode *ip, daddr_t lbn, int indx, int32_t *bap)
     {
     	struct fs *fs;
    -	int cg;
    -	int avgbfree, startcg;
    +	u_int cg, startcg;
    +	int avgbfree;
     
     	fs = ip->i_fs;
     	if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
    @@ -191,8 +191,8 @@ daddr_t
     ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap)
     {
     	struct fs *fs;
    -	int cg;
    -	int avgbfree, startcg;
    +	u_int cg, startcg;
    +	int avgbfree;
     
     	fs = ip->i_fs;
     	if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
    @@ -240,12 +240,12 @@ ffs_blkpref_ufs2(struct inode *ip, daddr
      */
     /*VARARGS5*/
     static daddr_t
    -ffs_hashalloc(struct inode *ip, int cg, daddr_t pref, int size,
    +ffs_hashalloc(struct inode *ip, u_int cg, daddr_t pref, int size,
         daddr_t (*allocator)(struct inode *, int, daddr_t, int))
     {
     	struct fs *fs;
     	daddr_t result;
    -	int i, icg = cg;
    +	u_int i, icg = cg;
     
     	fs = ip->i_fs;
     	/*
    
    Modified: head/usr.sbin/makefs/ffs/ffs_balloc.c
    ==============================================================================
    --- head/usr.sbin/makefs/ffs/ffs_balloc.c	Thu May 18 13:49:53 2017	(r318450)
    +++ head/usr.sbin/makefs/ffs/ffs_balloc.c	Thu May 18 14:05:29 2017	(r318451)
    @@ -123,7 +123,8 @@ ffs_balloc_ufs1(struct inode *ip, off_t 
     
     	if (lbn < UFS_NDADDR) {
     		nb = ufs_rw32(ip->i_ffs1_db[lbn], needswap);
    -		if (nb != 0 && ip->i_ffs1_size >= lblktosize(fs, lbn + 1)) {
    +		if (nb != 0 && ip->i_ffs1_size >=
    +		    (uint64_t)lblktosize(fs, lbn + 1)) {
     
     			/*
     			 * The block is an already-allocated direct block
    @@ -178,7 +179,7 @@ ffs_balloc_ufs1(struct inode *ip, off_t 
     			 * allocate a new block or fragment.
     			 */
     
    -			if (ip->i_ffs1_size < lblktosize(fs, lbn + 1))
    +			if (ip->i_ffs1_size < (uint64_t)lblktosize(fs, lbn + 1))
     				nsize = fragroundup(fs, size);
     			else
     				nsize = fs->fs_bsize;
    @@ -373,7 +374,8 @@ ffs_balloc_ufs2(struct inode *ip, off_t 
     
     	if (lbn < UFS_NDADDR) {
     		nb = ufs_rw64(ip->i_ffs2_db[lbn], needswap);
    -		if (nb != 0 && ip->i_ffs2_size >= lblktosize(fs, lbn + 1)) {
    +		if (nb != 0 && ip->i_ffs2_size >=
    +		    (uint64_t)lblktosize(fs, lbn + 1)) {
     
     			/*
     			 * The block is an already-allocated direct block
    @@ -428,7 +430,7 @@ ffs_balloc_ufs2(struct inode *ip, off_t 
     			 * allocate a new block or fragment.
     			 */
     
    -			if (ip->i_ffs2_size < lblktosize(fs, lbn + 1))
    +			if (ip->i_ffs2_size < (uint64_t)lblktosize(fs, lbn + 1))
     				nsize = fragroundup(fs, size);
     			else
     				nsize = fs->fs_bsize;
    
    Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c
    ==============================================================================
    --- head/usr.sbin/makefs/ffs/ffs_bswap.c	Thu May 18 13:49:53 2017	(r318450)
    +++ head/usr.sbin/makefs/ffs/ffs_bswap.c	Thu May 18 14:05:29 2017	(r318451)
    @@ -39,12 +39,12 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#define panic(x)	printf("%s\n", (x)), abort()
     #endif
     
     #include 
     #include "ffs/ufs_bswap.h"
     #include 
    +#include "ffs/ffs_extern.h"
     
     #define	fs_old_postbloff	fs_spare5[0]
     #define	fs_old_rotbloff		fs_spare5[1]
    
    Modified: head/usr.sbin/makefs/mtree.c
    ==============================================================================
    --- head/usr.sbin/makefs/mtree.c	Thu May 18 13:49:53 2017	(r318450)
    +++ head/usr.sbin/makefs/mtree.c	Thu May 18 14:05:29 2017	(r318451)
    @@ -505,7 +505,8 @@ read_mtree_keywords(FILE *fp, fsnode *no
     	struct stat *st, sb;
     	intmax_t num;
     	u_long flset, flclr;
    -	int error, istemp, type;
    +	int error, istemp;
    +	uint32_t type;
     
     	st = &node->inode->st;
     	do {
    
    From owner-svn-src-head@freebsd.org  Thu May 18 14:09:58 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98B9CD73CD9;
     Thu, 18 May 2017 14:09:58 +0000 (UTC)
     (envelope-from oleg@lath.rinet.ru)
    Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90])
     by mx1.freebsd.org (Postfix) with ESMTP id 5B3EFEFF;
     Thu, 18 May 2017 14:09:55 +0000 (UTC)
     (envelope-from oleg@lath.rinet.ru)
    Received: by lath.rinet.ru (Postfix, from userid 222)
     id B3BC2B47; Thu, 18 May 2017 17:04:03 +0300 (MSK)
    Date: Thu, 18 May 2017 17:04:03 +0300
    From: Oleg Bulyzhin 
    To: Sepherosa Ziehau 
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org, araujo@FreeBSD.org, hps@FreeBSD.org
    Subject: Re: svn commit: r305177 - head/sys/net
    Message-ID: <20170518140403.GA54405@lath.RINET.ru>
    References: <201609010632.u816WZUj025186@repo.freebsd.org>
    MIME-Version: 1.0
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    In-Reply-To: <201609010632.u816WZUj025186@repo.freebsd.org>
    User-Agent: Mutt/1.8.0 (2017-02-23)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 14:09:58 -0000
    
    On Thu, Sep 01, 2016 at 06:32:35AM +0000, Sepherosa Ziehau wrote:
    > Author: sephe
    > Date: Thu Sep  1 06:32:35 2016
    > New Revision: 305177
    > URL: https://svnweb.freebsd.org/changeset/base/305177
    > 
    > Log:
    >   net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
    >   
    >   Reviewed by:	araujo, hps
    >   MFC after:	1 week
    >   Sponsored by:	Microsoft
    >   Differential Revision:	https://reviews.freebsd.org/D7710
    > 
    > Modified:
    >   head/sys/net/ethernet.h
    > 
    > Modified: head/sys/net/ethernet.h
    > ==============================================================================
    > --- head/sys/net/ethernet.h	Thu Sep  1 06:05:08 2016	(r305176)
    > +++ head/sys/net/ethernet.h	Thu Sep  1 06:32:35 2016	(r305177)
    > @@ -92,7 +92,7 @@ struct ether_vlan_header {
    >  #define	EVL_PRIOFTAG(tag)	(((tag) >> 13) & 7)
    >  #define	EVL_CFIOFTAG(tag)	(((tag) >> 12) & 1)
    >  #define	EVL_MAKETAG(vlid, pri, cfi)					\
    > -	((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    > +	((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    >  
    >  /*
    >   *  NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
    
    Please revert this one. It's just plain wrong and previous one was ok.
    
    If you care about readability it should be: 
    ((((pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
    
    -- 
    Oleg.
    
    ================================================================
    === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru ===
    ================================================================
    
    
    From owner-svn-src-head@freebsd.org  Thu May 18 14:19:08 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E529D73FD7;
     Thu, 18 May 2017 14:19:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 09A03162C;
     Thu, 18 May 2017 14:19:07 +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 v4IEJ6uW056965;
     Thu, 18 May 2017 14:19:06 GMT (envelope-from manu@FreeBSD.org)
    Received: (from manu@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IEJ6jQ056960;
     Thu, 18 May 2017 14:19:06 GMT (envelope-from manu@FreeBSD.org)
    Message-Id: <201705181419.v4IEJ6jQ056960@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: manu set sender to
     manu@FreeBSD.org using -f
    From: Emmanuel Vadot 
    Date: Thu, 18 May 2017 14:19:06 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318452 - in head/usr.sbin/makefs: . ffs
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 14:19:08 -0000
    
    Author: manu
    Date: Thu May 18 14:19:06 2017
    New Revision: 318452
    URL: https://svnweb.freebsd.org/changeset/base/318452
    
    Log:
      makefs: Add soft-updates option
      
      Add the ffs option to enable soft-updates.
      The option is only processed is ufs2 has been selected.
      
      Reviewed by:	emaste, bapt (earlier version), allanjude (earlier version)
      Sponsored by:	Gandi.net
      Differential Revision:	https://reviews.freebsd.org/D10773
    
    Modified:
      head/usr.sbin/makefs/ffs.c
      head/usr.sbin/makefs/ffs.h
      head/usr.sbin/makefs/ffs/mkfs.c
      head/usr.sbin/makefs/makefs.8
    
    Modified: head/usr.sbin/makefs/ffs.c
    ==============================================================================
    --- head/usr.sbin/makefs/ffs.c	Thu May 18 14:05:29 2017	(r318451)
    +++ head/usr.sbin/makefs/ffs.c	Thu May 18 14:19:06 2017	(r318452)
    @@ -176,6 +176,8 @@ ffs_prep_opts(fsinfo_t *fsopts)
     	      0, 0, "Optimization (time|space)" },
     	    { 'l', "label", ffs_opts->label, OPT_STRARRAY,
     	      1, sizeof(ffs_opts->label), "UFS label" },
    +	    { 's', "softupdates", &ffs_opts->softupdates, OPT_INT32,
    +	      0, 1, "enable softupdates" },
     	    { .name = NULL }
     	};
     
    @@ -190,6 +192,7 @@ ffs_prep_opts(fsinfo_t *fsopts)
     	ffs_opts->avgfilesize= -1;
     	ffs_opts->avgfpdir= -1;
     	ffs_opts->version = 1;
    +	ffs_opts->softupdates = 0;
     
     	fsopts->fs_specific = ffs_opts;
     	fsopts->fs_options = copy_opts(ffs_options);
    
    Modified: head/usr.sbin/makefs/ffs.h
    ==============================================================================
    --- head/usr.sbin/makefs/ffs.h	Thu May 18 14:05:29 2017	(r318451)
    +++ head/usr.sbin/makefs/ffs.h	Thu May 18 14:19:06 2017	(r318452)
    @@ -64,6 +64,7 @@ typedef struct {
     	int	version;	/* filesystem version (1 = FFS, 2 = UFS2) */
     	int	maxbsize;	/* maximum extent size */
     	int	maxblkspercg;	/* max # of blocks per cylinder group */
    +	int	softupdates;	/* soft updates */
     		/* XXX: support `old' file systems ? */
     } ffs_opt_t;
     
    
    Modified: head/usr.sbin/makefs/ffs/mkfs.c
    ==============================================================================
    --- head/usr.sbin/makefs/ffs/mkfs.c	Thu May 18 14:05:29 2017	(r318451)
    +++ head/usr.sbin/makefs/ffs/mkfs.c	Thu May 18 14:19:06 2017	(r318452)
    @@ -279,6 +279,8 @@ ffs_mkfs(const char *fsys, const fsinfo_
     		sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode);
     		sblock.fs_maxsymlinklen = ((UFS_NDADDR + UFS_NIADDR) *
     		    sizeof (ufs2_daddr_t));
    +		if (ffs_opts->softupdates == 1)
    +			sblock.fs_flags |= FS_DOSOFTDEP;
     	}
     
     	sblock.fs_sblkno =
    
    Modified: head/usr.sbin/makefs/makefs.8
    ==============================================================================
    --- head/usr.sbin/makefs/makefs.8	Thu May 18 14:05:29 2017	(r318451)
    +++ head/usr.sbin/makefs/makefs.8	Thu May 18 14:19:06 2017	(r318452)
    @@ -35,7 +35,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd April 6, 2017
    +.Dd May 17, 2017
     .Dt MAKEFS 8
     .Os
     .Sh NAME
    @@ -308,6 +308,8 @@ Maximum total number of blocks in a cyli
     .It Sy version
     UFS version.
     1 for FFS (default), 2 for UFS2.
    +.It Sy softupdates
    +0 for disable (default), 1 for enable
     .El
     .Ss CD9660-specific options
     .Sy cd9660
    
    From owner-svn-src-head@freebsd.org  Thu May 18 14:27:03 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB40D72336;
     Thu, 18 May 2017 14:27:03 +0000 (UTC) (envelope-from hps@selasky.org)
    Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 26FCD1D1C;
     Thu, 18 May 2017 14:27:02 +0000 (UTC) (envelope-from hps@selasky.org)
    Received: from hps2016.home.selasky.org (unknown [62.141.129.119])
     (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 7858A26093C;
     Thu, 18 May 2017 16:27:00 +0200 (CEST)
    Subject: Re: svn commit: r305177 - head/sys/net
    To: Oleg Bulyzhin , Sepherosa Ziehau 
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org, araujo@FreeBSD.org, hps@FreeBSD.org
    References: <201609010632.u816WZUj025186@repo.freebsd.org>
     <20170518140403.GA54405@lath.RINET.ru>
    From: Hans Petter Selasky 
    Message-ID: <355478da-ed4d-60bb-bb4e-144a694e28b8@selasky.org>
    Date: Thu, 18 May 2017 16:25:01 +0200
    User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
     Thunderbird/52.0.1
    MIME-Version: 1.0
    In-Reply-To: <20170518140403.GA54405@lath.RINET.ru>
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 14:27:03 -0000
    
    On 05/18/17 16:04, Oleg Bulyzhin wrote:
    > On Thu, Sep 01, 2016 at 06:32:35AM +0000, Sepherosa Ziehau wrote:
    >> Author: sephe
    >> Date: Thu Sep  1 06:32:35 2016
    >> New Revision: 305177
    >> URL: https://svnweb.freebsd.org/changeset/base/305177
    >>
    >> Log:
    >>    net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
    >>    
    >>    Reviewed by:	araujo, hps
    >>    MFC after:	1 week
    >>    Sponsored by:	Microsoft
    >>    Differential Revision:	https://reviews.freebsd.org/D7710
    >>
    >> Modified:
    >>    head/sys/net/ethernet.h
    >>
    >> Modified: head/sys/net/ethernet.h
    >> ==============================================================================
    >> --- head/sys/net/ethernet.h	Thu Sep  1 06:05:08 2016	(r305176)
    >> +++ head/sys/net/ethernet.h	Thu Sep  1 06:32:35 2016	(r305177)
    >> @@ -92,7 +92,7 @@ struct ether_vlan_header {
    >>   #define	EVL_PRIOFTAG(tag)	(((tag) >> 13) & 7)
    >>   #define	EVL_CFIOFTAG(tag)	(((tag) >> 12) & 1)
    >>   #define	EVL_MAKETAG(vlid, pri, cfi)					\
    >> -	((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    >> +	((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    >>   
    >>   /*
    >>    *  NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
    > 
    > Please revert this one. It's just plain wrong and previous one was ok.
    > 
    
    Hi,
    
    Can you explain a bit more what is wrong?
    
    > If you care about readability it should be:
    > ((((pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
    
    Isn't this exactly what the patch is doing? -R ???
    
    --HPS
    
    From owner-svn-src-head@freebsd.org  Thu May 18 15:00:31 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0CB2D72BEC;
     Thu, 18 May 2017 15:00:31 +0000 (UTC)
     (envelope-from oleg@lath.rinet.ru)
    Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90])
     by mx1.freebsd.org (Postfix) with ESMTP id 6218CFA4;
     Thu, 18 May 2017 15:00:31 +0000 (UTC)
     (envelope-from oleg@lath.rinet.ru)
    Received: by lath.rinet.ru (Postfix, from userid 222)
     id 590B4CFF; Thu, 18 May 2017 18:00:30 +0300 (MSK)
    Date: Thu, 18 May 2017 18:00:30 +0300
    From: Oleg Bulyzhin 
    To: Hans Petter Selasky 
    Cc: Oleg Bulyzhin , Sepherosa Ziehau ,
     src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org, araujo@FreeBSD.org, hps@FreeBSD.org
    Subject: Re: svn commit: r305177 - head/sys/net
    Message-ID: <20170518150030.GA55481@lath.RINET.ru>
    References: <201609010632.u816WZUj025186@repo.freebsd.org>
     <20170518140403.GA54405@lath.RINET.ru>
     <355478da-ed4d-60bb-bb4e-144a694e28b8@selasky.org>
    MIME-Version: 1.0
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    In-Reply-To: <355478da-ed4d-60bb-bb4e-144a694e28b8@selasky.org>
    User-Agent: Mutt/1.8.0 (2017-02-23)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 15:00:31 -0000
    
    On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote:
    > On 05/18/17 16:04, Oleg Bulyzhin wrote:
    > > On Thu, Sep 01, 2016 at 06:32:35AM +0000, Sepherosa Ziehau wrote:
    > >> Author: sephe
    > >> Date: Thu Sep  1 06:32:35 2016
    > >> New Revision: 305177
    > >> URL: https://svnweb.freebsd.org/changeset/base/305177
    > >>
    > >> Log:
    > >>    net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
    > >>    
    > >>    Reviewed by:	araujo, hps
    > >>    MFC after:	1 week
    > >>    Sponsored by:	Microsoft
    > >>    Differential Revision:	https://reviews.freebsd.org/D7710
    > >>
    > >> Modified:
    > >>    head/sys/net/ethernet.h
    > >>
    > >> Modified: head/sys/net/ethernet.h
    > >> ==============================================================================
    > >> --- head/sys/net/ethernet.h	Thu Sep  1 06:05:08 2016	(r305176)
    > >> +++ head/sys/net/ethernet.h	Thu Sep  1 06:32:35 2016	(r305177)
    > >> @@ -92,7 +92,7 @@ struct ether_vlan_header {
    > >>   #define	EVL_PRIOFTAG(tag)	(((tag) >> 13) & 7)
    > >>   #define	EVL_CFIOFTAG(tag)	(((tag) >> 12) & 1)
    > >>   #define	EVL_MAKETAG(vlid, pri, cfi)					\
    > >> -	((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    > >> +	((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    > >>   
    > >>   /*
    > >>    *  NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
    > > 
    > > Please revert this one. It's just plain wrong and previous one was ok.
    > > 
    > 
    > Hi,
    > 
    > Can you explain a bit more what is wrong?
    > 
    > > If you care about readability it should be:
    > > ((((pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
    > 
    > Isn't this exactly what the patch is doing? -R ???
    
    Current version is shifting pri out of uint16. If you examine parentheses:
    pri is shifted left 13, then 12.
    Original version did it right (shift 1, then 12 (total 13)).
    
    
    -- 
    Oleg.
    
    ================================================================
    === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru ===
    ================================================================
    
    
    From owner-svn-src-head@freebsd.org  Thu May 18 15:10:06 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 365D9D7307A;
     Thu, 18 May 2017 15:10:06 +0000 (UTC)
     (envelope-from bjkfbsd@gmail.com)
    Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com
     [IPv6:2607:f8b0:4003:c06::229])
     (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 DD3A1160E;
     Thu, 18 May 2017 15:10:02 +0000 (UTC)
     (envelope-from bjkfbsd@gmail.com)
    Received: by mail-oi0-x229.google.com with SMTP id h4so57728673oib.3;
     Thu, 18 May 2017 08:10:02 -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=rXFf1m+PKc0Jst4UNAxHnlnMYVGw2l/PMtaWxFqEQZ4=;
     b=tDDJfR6XbY9vqU/nlpM9txJbrqSnDR+PnV+lySMKMwiYKj7q65ht5g0j8WJsg6YYuc
     sn357j7sxgo1p2t2Q8R4vfBNbrbCACibT6/FxsCOowsRfGkyCvcTRqX7YhSqgDhTviw5
     0cXQy+sej/GfJsBaDkQS9gcEqqvlHGsOXVaOB4XGCUSw/IDLDj/3utftaTeKE2OigWT5
     sfQocqnjndI36mvmNbAyqI679Rap6CP8AsEfteRa2LATms51jGQOSlkKQcMbWHwSuYOX
     +mqj/QJqyRtCxjmCutMvH99nAIOQHklt4O1L+pwPWsXcox9zUBy4cJ+LeFvnt/7kMGSR
     L85g==
    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=rXFf1m+PKc0Jst4UNAxHnlnMYVGw2l/PMtaWxFqEQZ4=;
     b=hYwCgHiK0VbbpcWFy5IKyefR1W8oKUFz3qHaZrT8EqHUeygZn9GqTDgJH9mi3LDYpz
     /O7IV/4Lzckc8a8670Fn3LMbzm8rXPFxJSERFL0jq6udu0n4exCEkuzgPiUAcop8f2uI
     HhbCGQ/1FWEi+AzzCKxJdL6XZh5KURAYy+bz00+mxIB8WBVvkYhX2nZzASnuGs6EVnqu
     ksJQGfKvipQN8DjdgzKt1m8DAk6j8vDPCyyjtQStvWi+wP41bG1I+dTYVRdkDgBVywqr
     qtmIbMh26Hu/xKqraK4fLp3lhtR2rcd0lRMMS9JvHRU5M8KWTvQseoYOOLCUZDVHRHNq
     vz2g==
    X-Gm-Message-State: AODbwcCYPpfWSZd5ACEG2gyjGkjFxkrde0MFv/EuQEBKD/EOk2zk5jX8
     YP3DkMFjDax26uPcLI36gXJmgB2mcw==
    X-Received: by 10.157.29.235 with SMTP id w40mr2706985otw.128.1495120201896;
     Thu, 18 May 2017 08:10:01 -0700 (PDT)
    MIME-Version: 1.0
    Received: by 10.182.20.163 with HTTP; Thu, 18 May 2017 08:10:01 -0700 (PDT)
    In-Reply-To: <20170518150030.GA55481@lath.RINET.ru>
    References: <201609010632.u816WZUj025186@repo.freebsd.org>
     <20170518140403.GA54405@lath.RINET.ru>
     <355478da-ed4d-60bb-bb4e-144a694e28b8@selasky.org>
     <20170518150030.GA55481@lath.RINET.ru>
    From: Benjamin Kaduk 
    Date: Thu, 18 May 2017 10:10:01 -0500
    Message-ID: 
    Subject: Re: svn commit: r305177 - head/sys/net
    To: Oleg Bulyzhin 
    Cc: Hans Petter Selasky , 
     "src-committers@freebsd.org" , 
     "svn-src-all@freebsd.org" , araujo@freebsd.org,
     hps@freebsd.org, "svn-src-head@freebsd.org" ,
     Sepherosa Ziehau 
    Content-Type: text/plain; charset="UTF-8"
    X-Content-Filtered-By: Mailman/MimeDel 2.1.23
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 15:10:06 -0000
    
    On Thu, May 18, 2017 at 10:00 AM, Oleg Bulyzhin  wrote:
    
    > On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote:
    > >
    > > Can you explain a bit more what is wrong?
    > >
    > > > If you care about readability it should be:
    > > > ((((pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
    > >
    > > Isn't this exactly what the patch is doing? -R ???
    >
    > Current version is shifting pri out of uint16. If you examine parentheses:
    > pri is shifted left 13, then 12.
    > Original version did it right (shift 1, then 12 (total 13)).
    >
    
    Calculations in the C abstract machine would be performed in the 'int' type
    to which uint16 operands are promoted, though.
    
    -Ben
    
    From owner-svn-src-head@freebsd.org  Thu May 18 15:13:17 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 024C1D73209;
     Thu, 18 May 2017 15:13:17 +0000 (UTC) (envelope-from hps@selasky.org)
    Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id C10151A8D;
     Thu, 18 May 2017 15:13:16 +0000 (UTC) (envelope-from hps@selasky.org)
    Received: from hps2016.home.selasky.org (unknown [62.141.129.119])
     (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 E05AA26093C;
     Thu, 18 May 2017 17:13:14 +0200 (CEST)
    Subject: Re: svn commit: r305177 - head/sys/net
    To: Oleg Bulyzhin 
    Cc: Sepherosa Ziehau , src-committers@freebsd.org,
     svn-src-all@freebsd.org, svn-src-head@freebsd.org, araujo@FreeBSD.org
    References: <201609010632.u816WZUj025186@repo.freebsd.org>
     <20170518140403.GA54405@lath.RINET.ru>
     <355478da-ed4d-60bb-bb4e-144a694e28b8@selasky.org>
     <20170518150030.GA55481@lath.RINET.ru>
    From: Hans Petter Selasky 
    Message-ID: 
    Date: Thu, 18 May 2017 17:11:16 +0200
    User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
     Thunderbird/52.0.1
    MIME-Version: 1.0
    In-Reply-To: <20170518150030.GA55481@lath.RINET.ru>
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 15:13:17 -0000
    
    On 05/18/17 17:00, Oleg Bulyzhin wrote:
    > On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote:
    >> On 05/18/17 16:04, Oleg Bulyzhin wrote:
    >>> On Thu, Sep 01, 2016 at 06:32:35AM +0000, Sepherosa Ziehau wrote:
    >>>> Author: sephe
    >>>> Date: Thu Sep  1 06:32:35 2016
    >>>> New Revision: 305177
    >>>> URL: https://svnweb.freebsd.org/changeset/base/305177
    >>>>
    >>>> Log:
    >>>>     net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
    >>>>     
    >>>>     Reviewed by:	araujo, hps
    >>>>     MFC after:	1 week
    >>>>     Sponsored by:	Microsoft
    >>>>     Differential Revision:	https://reviews.freebsd.org/D7710
    >>>>
    >>>> Modified:
    >>>>     head/sys/net/ethernet.h
    >>>>
    >>>> Modified: head/sys/net/ethernet.h
    >>>> ==============================================================================
    >>>> --- head/sys/net/ethernet.h	Thu Sep  1 06:05:08 2016	(r305176)
    >>>> +++ head/sys/net/ethernet.h	Thu Sep  1 06:32:35 2016	(r305177)
    >>>> @@ -92,7 +92,7 @@ struct ether_vlan_header {
    >>>>    #define	EVL_PRIOFTAG(tag)	(((tag) >> 13) & 7)
    >>>>    #define	EVL_CFIOFTAG(tag)	(((tag) >> 12) & 1)
    >>>>    #define	EVL_MAKETAG(vlid, pri, cfi)					\
    >>>> -	((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    >>>> +	((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    >>>>    
    >>>>    /*
    >>>>     *  NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
    >>>
    >>> Please revert this one. It's just plain wrong and previous one was ok.
    >>>
    >>
    >> Hi,
    >>
    >> Can you explain a bit more what is wrong?
    >>
    >>> If you care about readability it should be:
    >>> ((((pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
    >>
    >> Isn't this exactly what the patch is doing? -R ???
    > 
    > Current version is shifting pri out of uint16. If you examine parentheses:
    > pri is shifted left 13, then 12.
    > Original version did it right (shift 1, then 12 (total 13)).
    > 
    
    Hi Oleg,
    
    I see. The VLAN priority is then always zero after this change.
    
    I'll let Sepherosa handle the revert and/or readability update.
    
    --HPS
    
    From owner-svn-src-head@freebsd.org  Thu May 18 16:48:26 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CC76D7280D;
     Thu, 18 May 2017 16:48:26 +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 A7086104F;
     Thu, 18 May 2017 16:48:25 +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 v4IGmLvg067012;
     Thu, 18 May 2017 09:48:21 -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 v4IGmLqr067011;
     Thu, 18 May 2017 09:48:21 -0700 (PDT) (envelope-from freebsd)
    From: "Rodney W. Grimes" 
    Message-Id: <201705181648.v4IGmLqr067011@pdx.rh.CN85.dnsmgr.net>
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    In-Reply-To: <20170518130932.eo5clhki4za2vigz@ivaldir.net>
    To: Baptiste Daroussin 
    Date: Thu, 18 May 2017 09:48:21 -0700 (PDT)
    CC: rgrimes@FreeBSD.org, Ngie Cooper ,
     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.23
    Precedence: list
    List-Id: 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, 18 May 2017 16:48:26 -0000
    
    > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
    > > > Author: ngie
    > > > Date: Thu May 18 06:25:39 2017
    > > > New Revision: 318441
    > > > URL: https://svnweb.freebsd.org/changeset/base/318441
    > > > 
    > > > Log:
    > > >   Handle the cron.d entry for MK_AT in cron conditionally
    > > >   
    > > >   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
    > > >   to run a non-existent program via cron(8) every 5 minutes with the
    > > >   default /etc/crontab, prior to this commit.
    > > >   
    > > >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
    > > >   because atrun(8) executes programs, which may rely on environment
    > > >   currently set via /etc/crontab.
    > > >   
    > > >   Noted by:	bdrewery (in an internal review)
    > > >   MFC after:	2 months
    > > >   Relnotes:	yes (may need to add environmental modifications to
    > > >   		     /etc/cron.d/at)
    > > >   Sponsored by:	Dell EMC Isilon
    > > > 
    > > > Added:
    > > >   head/etc/cron.d/
    > > >   head/etc/cron.d/Makefile   (contents, props changed)
    > > >   head/etc/cron.d/at   (contents, props changed)
    > > > Modified:
    > > >   head/etc/Makefile
    > > >   head/etc/crontab
    > > > 
    > > > Modified: head/etc/Makefile
    > > > ==============================================================================
    > > > --- head/etc/Makefile	Thu May 18 06:15:42 2017	(r318440)
    > > > +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    > > > @@ -8,6 +8,7 @@ FILESGROUPS=	FILES
    > > >  # No need as it is empty and just causes rebuilds since this file does so much.
    > > >  UPDATE_DEPENDFILE=	no
    > > >  SUBDIR=	\
    > > > +	cron.d \
    > > >  	newsyslog.conf.d \
    > > >  	syslog.d
    > > 
    > > The thread on the newsyslog clearly shows that this is a contriversial change.
    > > 
    > > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
    > > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
    > > desires of others.
    > 
    > Has multiple people has stated, on the newsyslog thread. this is not a
    > DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
    
    >From other mail in the newsyslog thread it was very evident that the
    newsyslog changes where driven by a specific need and desire of
    Dell/EMC/Isilon.  And as others pointed out that was more or less
    in conflict with others needs and desires.  I did not see any conclusion
    reached in that thread.
    
    > 1. Consistency
    >   as a project we do support building WITHOUT_FOO there is no reason to install
    >   syslog, cron configuration for FOO if the system was built without foo
    
    And there are very clean ways to do this WITHOUT the need to make this a
    bunch of seperate files.  This actually creates an inconsistent system,
    do I manage crons FOO item with /etc/crontabl or /etc/cron.d/FOO?  
    
    As I said lets do it one way or the other, but NOT a half baked some in
    one file and some others split into seperate files.  Others expressed
    this exact some issue, why is this issue being ignored?
    
    I also stated that this could be done and meet the requirements of one file
    with conditionalized Makefile syntax it is a trivial matter to create
    a string of files to cat from the src/etc directory into the objdir with
    the right lines in it based on if {${MK_FOO} knobs.
    
    > 2. Packaging base
    >   if one does not install at there is no need for the at crontab to be installed
    >   (same reason as 1.)
    
    Lets cross that bridge when the package of base is done, and with a great
    deal more engineering than this simple hack.    The configuration management
    of a packaged base is gona be a messy nightmare at best from what I am
    seeing, especially if this is the road to be taken.
    
    > 3. Large deployment of freebsd farms
    >   Being able to administrate thousands of FreeBSD machines, one often ends up
    >   using tools like puppet, chef, ansible, cfengine. When programmatically
    >   handling configuration management it is way easier and safer to simple
    >   add/removes files in a directory rather than mangling^Winplace editing files.
    
    This actually is breaking a massive deployment of both ansible and puppet
    based management tools.  Again, how does splitting this into 2 files to
    manage make it any easier to manage?  We now have to teach the management
    tools to deal with both /etc/crontab and /etc/cron.d/at if I want it to
    manage at.  And this tool has to be taught that FreeBSD < r318441 uses
    one way and >=r318441 is another way.
    
    > 4. Ports/packages
    >   On can provide easily sample configuration for cron, syslog (not only) and the
    >   admin can decide to use it or not easily (ususally this is done by making
    >   symlinks from the said file which would live in share/* into the .d directory.
    
    These files for ports/packages do not belong in /etc/cron.d but in
    /usr/local/etc/cron.d, I would fully support that as an addition if it
    does not exist, but that has nothing to do with /etc/crontab or /etc
    cron.d, or moving of 1 single /etc/crontab line to /etc/cron.d.
    
    > 
    > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.
    
    This IS a new trend in FreeBSD, the base system has always shipped with
    a minimal set of /etc/FOO files and not split them in to FOO.d.  The
    system SUPPORTS foo.d but does not ship that as its base configuration.
    
    -- 
    Rod Grimes                                                 rgrimes@freebsd.org
    
    From owner-svn-src-head@freebsd.org  Thu May 18 16:52:07 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDB04D72A93
     for ;
     Thu, 18 May 2017 16:52:07 +0000 (UTC) (envelope-from ian@freebsd.org)
    Received: from pmta2.delivery6.ore.mailhop.org
     (pmta2.delivery6.ore.mailhop.org [54.200.129.228])
     (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 C1E8F151B
     for ; Thu, 18 May 2017 16:52:07 +0000 (UTC)
     (envelope-from ian@freebsd.org)
    X-MHO-User: 04103c96-3bea-11e7-8c46-c35e37f62db1
    X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information
    X-Originating-IP: 73.78.92.27
    X-Mail-Handler: DuoCircle Outbound SMTP
    Received: from ilsoft.org (unknown [73.78.92.27])
     by outbound2.ore.mailhop.org (Halon) with ESMTPSA
     id 04103c96-3bea-11e7-8c46-c35e37f62db1;
     Thu, 18 May 2017 16:49:54 +0000 (UTC)
    Received: from rev (rev [172.22.42.240])
     by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4IGouZ7001606;
     Thu, 18 May 2017 10:50:56 -0600 (MDT) (envelope-from ian@freebsd.org)
    Message-ID: <1495126256.93532.14.camel@freebsd.org>
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    From: Ian Lepore 
    To: rgrimes@freebsd.org, Ngie Cooper 
    Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Date: Thu, 18 May 2017 10:50:56 -0600
    In-Reply-To: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    References: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    Content-Type: text/plain; charset="ISO-8859-1"
    X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port 
    Mime-Version: 1.0
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 16:52:08 -0000
    
    On Thu, 2017-05-18 at 02:56 -0700, Rodney W. Grimes wrote:
    > > 
    > > Author: ngie
    > > Date: Thu May 18 06:25:39 2017
    > > New Revision: 318441
    > > URL: https://svnweb.freebsd.org/changeset/base/318441
    > > 
    > > Log:
    > >   Handle the cron.d entry for MK_AT in cron conditionally
    > >   
    > >   Install /etc/cron.d/at if MK_AT != no, always using it, which
    > > tries
    > >   to run a non-existent program via cron(8) every 5 minutes with
    > > the
    > >   default /etc/crontab, prior to this commit.
    > >   
    > >   SHELL and PATH are duplicated between /etc/crontab and
    > > /etc/cron.d/at
    > >   because atrun(8) executes programs, which may rely on environment
    > >   currently set via /etc/crontab.
    > >   
    > >   Noted by:	bdrewery (in an internal review)
    > >   MFC after:	2 months
    > >   Relnotes:	yes (may need to add environmental modifications
    > > to
    > >   		     /etc/cron.d/at)
    > >   Sponsored by:	Dell EMC Isilon
    > > 
    > > Added:
    > >   head/etc/cron.d/
    > >   head/etc/cron.d/Makefile   (contents, props changed)
    > >   head/etc/cron.d/at   (contents, props changed)
    > > Modified:
    > >   head/etc/Makefile
    > >   head/etc/crontab
    > > 
    > > Modified: head/etc/Makefile
    > > ===================================================================
    > > ===========
    > > --- head/etc/Makefile	Thu May 18 06:15:42 2017	(r3184
    > > 40)
    > > +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r3184
    > > 41)
    > > @@ -8,6 +8,7 @@ FILESGROUPS=	FILES
    > >  # No need as it is empty and just causes rebuilds since this file
    > > does so much.
    > >  UPDATE_DEPENDFILE=	no
    > >  SUBDIR=	\
    > > +	cron.d \
    > >  	newsyslog.conf.d \
    > >  	syslog.d
    > The thread on the newsyslog clearly shows that this is a
    > contriversial change.
    > 
    > I strongly object to further splitting of /etc/FOO into
    > /etc/foo.d/FOO files
    > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs
    > and
    > desires of others.
    > 
    
    Actually, the newsyslog thread showed that 4 people supported Ngie's
    changes, and 4 people objected to them.  Not exactly a raging
    controversy.  Given how many people read this list, a pretty tepid
    response really.
    
    The objections seemed to boil down to:
    
     1. It's not how we've done it for years; I don't like newfangled
    stuff.
    
     2. It's strange to have some stuff in the old monolithic file and some
    in new little files in a directory.
    
     3. It will be hard to update existing systems.
    
    I don't see any point in discussing #1 further (not because peoples'
    opinions don't matter, but rather because there will never be universal
    agreement no matter how much it's discussed).
    
    I think #2 has some validity, but not as an argument for stopping or
    undoing the changes, but more as a valid design issue to be discussed.
     Do we need an "all or nothing" rule when it comes to changing existing
    config files to be fine-grained?  Or some other rule?  Right now I
    infer the rule Ngie is using to be "if you can disable a component with
    build/install controls, then its config should be fined-grained", and
    that strikes me as a workable rule, but not the only one possible.
    
    #3 seems like a strongly valid concern.  People following -current have
    agreed to take on some pain to do so, but when 12.0-release hits the
    streets there needs to be a way to upgrade existing systems without a
    lot of pain.  What can we do to make it easier?
    
    -- Ian
    
    
    From owner-svn-src-head@freebsd.org  Thu May 18 17:00:25 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id D48C8D72E9F;
     Thu, 18 May 2017 17:00:25 +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 95F471B41;
     Thu, 18 May 2017 17:00:25 +0000 (UTC) (envelope-from jhb@freebsd.org)
    Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net
     [73.231.226.104])
     by mail.baldwin.cx (Postfix) with ESMTPSA id 36C4210A7B9;
     Thu, 18 May 2017 13:00:24 -0400 (EDT)
    From: John Baldwin 
    To: Baptiste Daroussin 
    Cc: rgrimes@freebsd.org, Ngie Cooper ,
     svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    Date: Thu, 18 May 2017 09:48:25 -0700
    Message-ID: <2201156.H7EQSgYph9@ralph.baldwin.cx>
    User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; )
    In-Reply-To: <20170518130932.eo5clhki4za2vigz@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
     <20170518130932.eo5clhki4za2vigz@ivaldir.net>
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7Bit
    Content-Type: text/plain; charset="us-ascii"
    X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
     (mail.baldwin.cx); Thu, 18 May 2017 13:00: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.23
    Precedence: list
    List-Id: 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, 18 May 2017 17:00:25 -0000
    
    On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
    > > > Author: ngie
    > > > Date: Thu May 18 06:25:39 2017
    > > > New Revision: 318441
    > > > URL: https://svnweb.freebsd.org/changeset/base/318441
    > > > 
    > > > Log:
    > > >   Handle the cron.d entry for MK_AT in cron conditionally
    > > >   
    > > >   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
    > > >   to run a non-existent program via cron(8) every 5 minutes with the
    > > >   default /etc/crontab, prior to this commit.
    > > >   
    > > >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
    > > >   because atrun(8) executes programs, which may rely on environment
    > > >   currently set via /etc/crontab.
    > > >   
    > > >   Noted by:	bdrewery (in an internal review)
    > > >   MFC after:	2 months
    > > >   Relnotes:	yes (may need to add environmental modifications to
    > > >   		     /etc/cron.d/at)
    > > >   Sponsored by:	Dell EMC Isilon
    > > > 
    > > > Added:
    > > >   head/etc/cron.d/
    > > >   head/etc/cron.d/Makefile   (contents, props changed)
    > > >   head/etc/cron.d/at   (contents, props changed)
    > > > Modified:
    > > >   head/etc/Makefile
    > > >   head/etc/crontab
    > > > 
    > > > Modified: head/etc/Makefile
    > > > ==============================================================================
    > > > --- head/etc/Makefile	Thu May 18 06:15:42 2017	(r318440)
    > > > +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    > > > @@ -8,6 +8,7 @@ FILESGROUPS=	FILES
    > > >  # No need as it is empty and just causes rebuilds since this file does so much.
    > > >  UPDATE_DEPENDFILE=	no
    > > >  SUBDIR=	\
    > > > +	cron.d \
    > > >  	newsyslog.conf.d \
    > > >  	syslog.d
    > > 
    > > The thread on the newsyslog clearly shows that this is a contriversial change.
    > > 
    > > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
    > > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
    > > desires of others.
    > 
    > Has multiple people has stated, on the newsyslog thread. this is not a
    > DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
    > 1. Consistency
    >   as a project we do support building WITHOUT_FOO there is no reason to install
    >   syslog, cron configuration for FOO if the system was built without foo
    
    Though it doesn't _hurt_, and breaking POLA has to be worth it, not just
    because it looks nice.
    
    > 2. Packaging base
    >   if one does not install at there is no need for the at crontab to be installed
    >   (same reason as 1.)
    
    This is a viable reason except that it isn't fully baked yet.
    
    > 3. Large deployment of freebsd farms
    >   Being able to administrate thousands of FreeBSD machines, one often ends up
    >   using tools like puppet, chef, ansible, cfengine. When programmatically
    >   handling configuration management it is way easier and safer to simple
    >   add/removes files in a directory rather than mangling^Winplace editing files.
    
    There's nothing preventing you now from deploying split files and an empty
    global configuration file since the daemons support foo.d.  You don't require
    that to change in upstream since you should be using some sort of VCS to
    manage your configuration as it is.
    
    > 4. Ports/packages
    >   On can provide easily sample configuration for cron, syslog (not only) and the
    >   admin can decide to use it or not easily (ususally this is done by making
    >   symlinks from the said file which would live in share/* into the .d directory.
    > 
    > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.
    
    The support for broken out files has long been there, but the base system has
    not used them previously for default config shipped during a release.  That
    is in fact a new trend.
    
    However, the current approach seems to be the absolute worst way to do this.
    If someone wants to use the existing base system image and modify it with
    config management, they now have to use a mix of styles (for some services
    edit a global config file for certain settings, but use a dedicated file for
    other settings for the same service, or for the same settings but a different
    service).  It's also the worst case for humans trying to work with our system
    as the division between which services are broken out vs global is
    inconsistent and arbitrary.
    
    Once you split up the files you make a merge conflict for anyone trying to do
    an upgrade.  If we do this piecemail then we create N merge conflicts for users
    to deal with as opposed to if you split it up all at once.
    
    Also, there wasn't a clear consensus (a mail to arch@ with "hey, we should
    switch to splitting up config files for reasons A and B and let's do this for
    12.0 but not merge to stable so there is a clear flag day / sign post for users
    to manage upgrades".  Instead there have been a couple of commits and any
    not-in-100%-agreement opinions are ignored.
    
    -- 
    John Baldwin
    
    From owner-svn-src-head@freebsd.org  Thu May 18 17:16:00 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 468A7D735FA;
     Thu, 18 May 2017 17:16:00 +0000 (UTC)
     (envelope-from pstef@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 210A2D8C;
     Thu, 18 May 2017 17:16:00 +0000 (UTC)
     (envelope-from pstef@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4IHFxNi033852;
     Thu, 18 May 2017 17:15:59 GMT (envelope-from pstef@FreeBSD.org)
    Received: (from pstef@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IHFwwN033848;
     Thu, 18 May 2017 17:15:58 GMT (envelope-from pstef@FreeBSD.org)
    Message-Id: <201705181715.v4IHFwwN033848@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: pstef set sender to
     pstef@FreeBSD.org using -f
    From: Piotr Pawel Stefaniak 
    Date: Thu, 18 May 2017 17:15:58 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318471 - in head/usr.bin/indent: . tests
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 17:16:00 -0000
    
    Author: pstef
    Date: Thu May 18 17:15:58 2017
    New Revision: 318471
    URL: https://svnweb.freebsd.org/changeset/base/318471
    
    Log:
      indent(1): Support binary integer literals.
      This was done by Romain Tartière for PR123553. I initially thought that it would break code like this:
      #define b00101010 -1
      if (0 b00101010)
      ...
      
      by joining 0 and b00101010 together. However, the real problem with that patch was that once it saw a 0, it assumed that the number was base 2, 8 or 16, ignoring base 10 floating point numbers. I fixed that.
      
      I didn't copy the diagnostic part of the original patch as it seems out of scope of implementing binary integer literals formatting.
      
      PR:		123553
      Submitted by:	romain (original version)
      Approved by:	pfg (mentor)
    
    Added:
      head/usr.bin/indent/tests/binary.0   (contents, props changed)
      head/usr.bin/indent/tests/binary.0.stdout   (contents, props changed)
    Modified:
      head/usr.bin/indent/lexi.c
      head/usr.bin/indent/tests/Makefile
    
    Modified: head/usr.bin/indent/lexi.c
    ==============================================================================
    --- head/usr.bin/indent/lexi.c	Thu May 18 17:01:26 2017	(r318470)
    +++ head/usr.bin/indent/lexi.c	Thu May 18 17:15:58 2017	(r318471)
    @@ -169,19 +169,47 @@ lexi(void)
     	struct templ *p;
     
     	if (isdigit(*buf_ptr) || (buf_ptr[0] == '.' && isdigit(buf_ptr[1]))) {
    +	    enum base {
    +		BASE_2, BASE_8, BASE_10, BASE_16
    +	    };
     	    int         seendot = 0,
     	                seenexp = 0,
     			seensfx = 0;
    -	    if (*buf_ptr == '0' &&
    -		    (buf_ptr[1] == 'x' || buf_ptr[1] == 'X')) {
    +	    enum base	in_base = BASE_10;
    +
    +	    if (*buf_ptr == '0') {
    +		if (buf_ptr[1] == 'b' || buf_ptr[1] == 'B')
    +		    in_base = BASE_2;
    +		else if (buf_ptr[1] == 'x' || buf_ptr[1] == 'X')
    +		    in_base = BASE_16;
    +		else if (isdigit(buf_ptr[1]))
    +		    in_base = BASE_8;
    +	    }
    +	    switch (in_base) {
    +	    case BASE_2:
    +		*e_token++ = *buf_ptr++;
    +		*e_token++ = *buf_ptr++;
    +		while (*buf_ptr == '0' || *buf_ptr == '1') {
    +		    CHECK_SIZE_TOKEN;
    +		    *e_token++ = *buf_ptr++;
    +		}
    +		break;
    +	    case BASE_8:
    +		*e_token++ = *buf_ptr++;
    +		while (*buf_ptr >= '0' && *buf_ptr <= '8') {
    +		    CHECK_SIZE_TOKEN;
    +		    *e_token++ = *buf_ptr++;
    +		}
    +		break;
    +	    case BASE_16:
     		*e_token++ = *buf_ptr++;
     		*e_token++ = *buf_ptr++;
     		while (isxdigit(*buf_ptr)) {
     		    CHECK_SIZE_TOKEN;
     		    *e_token++ = *buf_ptr++;
     		}
    -	    }
    -	    else
    +		break;
    +	    case BASE_10:
     		while (1) {
     		    if (*buf_ptr == '.') {
     			if (seendot)
    @@ -204,6 +232,8 @@ lexi(void)
     			}
     		    }
     		}
    +		break;
    +	    }
     	    while (1) {
     		if (!(seensfx & 1) && (*buf_ptr == 'U' || *buf_ptr == 'u')) {
     		    CHECK_SIZE_TOKEN;
    
    Modified: head/usr.bin/indent/tests/Makefile
    ==============================================================================
    --- head/usr.bin/indent/tests/Makefile	Thu May 18 17:01:26 2017	(r318470)
    +++ head/usr.bin/indent/tests/Makefile	Thu May 18 17:15:58 2017	(r318471)
    @@ -2,6 +2,8 @@
     
     PACKAGE=	tests
     
    +${PACKAGE}FILES+=	binary.0
    +${PACKAGE}FILES+=	binary.0.stdout
     ${PACKAGE}FILES+=	comments.0
     ${PACKAGE}FILES+=	comments.0.stdout
     ${PACKAGE}FILES+=	declarations.0
    
    Added: head/usr.bin/indent/tests/binary.0
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/usr.bin/indent/tests/binary.0	Thu May 18 17:15:58 2017	(r318471)
    @@ -0,0 +1,10 @@
    +/* $FreeBSD$ */
    +#define b00101010 -1
    +void t(void) {
    +	unsigned a[] = {0b00101010, 0x00005678, 02, 17U};
    +	float x[] = {.7f, 0.7f};
    +	unsigned long ul[] = {0b00001111UL, 0x01010101UL, 02UL, 17UL};
    +
    +	if (0 b00101010)
    +		return;
    +}
    
    Added: head/usr.bin/indent/tests/binary.0.stdout
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/usr.bin/indent/tests/binary.0.stdout	Thu May 18 17:15:58 2017	(r318471)
    @@ -0,0 +1,12 @@
    +/* $FreeBSD$ */
    +#define b00101010 -1
    +void 
    +t(void)
    +{
    +	unsigned	a[] = {0b00101010, 0x00005678, 02, 17U};
    +	float		x[] = {.7f, 0.7f};
    +	unsigned long	ul[] = {0b00001111UL, 0x01010101UL, 02UL, 17UL};
    +
    +	if (0 b00101010)
    +		return;
    +}
    
    From owner-svn-src-head@freebsd.org  Thu May 18 17:19:35 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2406DD73779
     for ;
     Thu, 18 May 2017 17:19:35 +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 E945410A2
     for ; Thu, 18 May 2017 17:19:34 +0000 (UTC)
     (envelope-from wlosh@bsdimp.com)
    Received: by mail-it0-x234.google.com with SMTP id o5so104366754ith.1
     for ; Thu, 18 May 2017 10:19:34 -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=aD0mN/W7FjdAduIvmpZtp/CryPe018KeHZVUyMfG8CM=;
     b=erZdMXQEcbGc0VowIEtTM1dSL4NnLfmXiKwW6d/ZiGpafOz8x/+/I1RW3i/jX1rIgU
     S7ZQ1NiXKcpQsoLQiQ9oAkHEyQolpgN0aorzWJkmBuEPCeUFBC9UlsQqNPmYwZiN50BL
     YSCGbU4at3rR93Vu34XbSKyIOJ1cSz6B1tA77aHxUXNely3je2t8DJykhBukTILvg8bY
     Urfzo9oQyEXCtCGhRKDbE2KfNVbgj15Qvhz4Vz5Q2lml52Jjh8+KACuek0FS2WcbDp0i
     MRDqMcMerIRC04GTWYdZQhgAKchL8ALIgzSU9uU5Lsb7EDGiWv8AZEYJho57wUmKRnOk
     qEJg==
    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=aD0mN/W7FjdAduIvmpZtp/CryPe018KeHZVUyMfG8CM=;
     b=OdvOLsJBzBuB6KNGWSS/SsUvpYzJZPq3lQSnxfyuxl+YQMsr13WnJ4qZtG5GsHXgFD
     r9fgYWAB/JtU1g/mNjYTAHEqvBJuyEtLU5BYg03jNp06w/chVvP3Cb30lQmEwYm0MNLl
     ifHkl7L3iucRDXCUPxGisVCbw1IKtNQulGREb1MpdnjG90Z12ngvlg4heKmrfmr6ECPE
     njIUd3CA4vvRc3SWMgq0eYoNt/d9iC6bCCJIEaLbMoANejuixD/GTtCaIykHejYbQIYc
     FFU+i2LVYQ4e0D8N/EJsQleK+gaNziJPEX/Uqbq6GhnB+Q58nvY1D8PnlohkZAI07ZGn
     zUQA==
    X-Gm-Message-State: AODbwcA7SVTyNLSawrmTTUDqTh1acucEO3j1bakIIwQgGlmUWVxD4JRT
     8mlUjvWrfPdIv1faHqizBqo3Slb7dwZN
    X-Received: by 10.36.44.14 with SMTP id i14mr24386705iti.103.1495127974032;
     Thu, 18 May 2017 10:19:34 -0700 (PDT)
    MIME-Version: 1.0
    Sender: wlosh@bsdimp.com
    Received: by 10.79.126.6 with HTTP; Thu, 18 May 2017 10:19:33 -0700 (PDT)
    X-Originating-IP: [2603:300b:6:5100:cdd4:9b25:be09:9f7d]
    In-Reply-To: <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
    From: Warner Losh 
    Date: Thu, 18 May 2017 11:19:33 -0600
    X-Google-Sender-Auth: NsXvlxGjrESXeo6L3QrPY1n4KQ8
    Message-ID: 
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    To: "Rodney W. Grimes" 
    Cc: Ngie Cooper , 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.23
    Precedence: list
    List-Id: 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, 18 May 2017 17:19:35 -0000
    
    On Thu, May 18, 2017 at 3:56 AM, Rodney W. Grimes
     wrote:
    >> Author: ngie
    >> Date: Thu May 18 06:25:39 2017
    >> New Revision: 318441
    >> URL: https://svnweb.freebsd.org/changeset/base/318441
    >>
    >> Log:
    >>   Handle the cron.d entry for MK_AT in cron conditionally
    >>
    >>   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
    >>   to run a non-existent program via cron(8) every 5 minutes with the
    >>   default /etc/crontab, prior to this commit.
    >>
    >>   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
    >>   because atrun(8) executes programs, which may rely on environment
    >>   currently set via /etc/crontab.
    >>
    >>   Noted by:   bdrewery (in an internal review)
    >>   MFC after:  2 months
    >>   Relnotes:   yes (may need to add environmental modifications to
    >>                    /etc/cron.d/at)
    >>   Sponsored by:       Dell EMC Isilon
    >>
    >> Added:
    >>   head/etc/cron.d/
    >>   head/etc/cron.d/Makefile   (contents, props changed)
    >>   head/etc/cron.d/at   (contents, props changed)
    >> Modified:
    >>   head/etc/Makefile
    >>   head/etc/crontab
    >>
    >> Modified: head/etc/Makefile
    >> ==============================================================================
    >> --- head/etc/Makefile Thu May 18 06:15:42 2017        (r318440)
    >> +++ head/etc/Makefile Thu May 18 06:25:39 2017        (r318441)
    >> @@ -8,6 +8,7 @@ FILESGROUPS=  FILES
    >>  # No need as it is empty and just causes rebuilds since this file does so much.
    >>  UPDATE_DEPENDFILE=   no
    >>  SUBDIR=      \
    >> +     cron.d \
    >>       newsyslog.conf.d \
    >>       syslog.d
    >
    > The thread on the newsyslog clearly shows that this is a contriversial change.
    >
    > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
    > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
    > desires of others.
    >
    > I especially object to it being done on a 1 of case, either completly split
    > the file or make it 1 file, but making it this miss match is just adding to
    > the work load of ansible and puppet task writting.  You now have to mange
    > 2 config files rather than 1 for cron, and 7 for newsyslog instead of 1.
    
    In the vast majority of the cases so far, I'm convinced the changes
    are for the better and will make things like mergemaster / etcupate /
    etc easier on our users. Since the files are separate, and you almost
    never touch them, it's a net win.
    
    Consider this a strong encouragement to proceed.
    
    Warner
    
    >> Added: head/etc/cron.d/Makefile
    >> ==============================================================================
    >> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
    >> +++ head/etc/cron.d/Makefile  Thu May 18 06:25:39 2017        (r318441)
    >> @@ -0,0 +1,11 @@
    >> +# $FreeBSD$
    >> +
    >> +.include 
    >> +
    >> +.if ${MK_AT} != "no"
    >> +FILES+=              at
    >> +.endif
    >> +
    >> +BINDIR=              /etc/cron.d
    >> +
    >> +.include 
    >>
    >> Added: head/etc/cron.d/at
    >> ==============================================================================
    >> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
    >> +++ head/etc/cron.d/at        Thu May 18 06:25:39 2017        (r318441)
    >> @@ -0,0 +1,7 @@
    >> +# $FreeBSD$
    >> +#
    >> +SHELL=/bin/sh
    >> +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    >> +
    >> +# See crontab(5) for field format.
    >> +*/5  *       *       *       *       root    /usr/libexec/atrun
    >>
    >> Modified: head/etc/crontab
    >> ==============================================================================
    >> --- head/etc/crontab  Thu May 18 06:15:42 2017        (r318440)
    >> +++ head/etc/crontab  Thu May 18 06:25:39 2017        (r318441)
    >> @@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    >>  #
    >>  #minute      hour    mday    month   wday    who     command
    >>  #
    >> -*/5  *       *       *       *       root    /usr/libexec/atrun
    >> -#
    >>  # Save some entropy so that /dev/random can re-seed on boot.
    >>  */11 *       *       *       *       operator /usr/libexec/save-entropy
    >>  #
    >>
    >>
    >
    > --
    > Rod Grimes                                                 rgrimes@freebsd.org
    >
    
    From owner-svn-src-head@freebsd.org  Thu May 18 17:55:34 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5253D70690;
     Thu, 18 May 2017 17:55:34 +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 mx1.freebsd.org (Postfix) with ESMTPS id 84A64D29;
     Thu, 18 May 2017 17:55:34 +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 v4IHtXSr050360;
     Thu, 18 May 2017 17:55:33 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IHtXKi050359;
     Thu, 18 May 2017 17:55:33 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705181755.v4IHtXKi050359@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Thu, 18 May 2017 17:55:33 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318474 - head/usr.sbin/makefs
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 17:55:34 -0000
    
    Author: emaste
    Date: Thu May 18 17:55:33 2017
    New Revision: 318474
    URL: https://svnweb.freebsd.org/changeset/base/318474
    
    Log:
      makefs: drop WARNS back to 2
      
      GCC warns about additional signed comparision issues compared to Clang.
      Drop WARNS for now until the underlying issue is fixed.
    
    Modified:
      head/usr.sbin/makefs/Makefile
    
    Modified: head/usr.sbin/makefs/Makefile
    ==============================================================================
    --- head/usr.sbin/makefs/Makefile	Thu May 18 17:44:45 2017	(r318473)
    +++ head/usr.sbin/makefs/Makefile	Thu May 18 17:55:33 2017	(r318474)
    @@ -14,7 +14,7 @@ SRCS=	cd9660.c ffs.c \
     	walk.c
     MAN=	makefs.8
     
    -WARNS?=	3
    +WARNS?=	2
     
     .include "${SRCDIR}/cd9660/Makefile.inc"
     .include "${SRCDIR}/ffs/Makefile.inc"
    
    From owner-svn-src-head@freebsd.org  Thu May 18 18:24:12 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFC53D70F55;
     Thu, 18 May 2017 18:24:12 +0000 (UTC)
     (envelope-from markj@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 805A01F58;
     Thu, 18 May 2017 18:24:12 +0000 (UTC)
     (envelope-from markj@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4IIOBDw062739;
     Thu, 18 May 2017 18:24:11 GMT (envelope-from markj@FreeBSD.org)
    Received: (from markj@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IIOBSN062738;
     Thu, 18 May 2017 18:24:11 GMT (envelope-from markj@FreeBSD.org)
    Message-Id: <201705181824.v4IIOBSN062738@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: markj set sender to
     markj@FreeBSD.org using -f
    From: Mark Johnston 
    Date: Thu, 18 May 2017 18:24:11 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318476 - head/sys/kern
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 18:24:12 -0000
    
    Author: markj
    Date: Thu May 18 18:24:11 2017
    New Revision: 318476
    URL: https://svnweb.freebsd.org/changeset/base/318476
    
    Log:
      Avoid open-coding PRI_UNCHANGED.
      
      MFC after:	1 week
    
    Modified:
      head/sys/kern/kern_fail.c
    
    Modified: head/sys/kern/kern_fail.c
    ==============================================================================
    --- head/sys/kern/kern_fail.c	Thu May 18 18:18:39 2017	(r318475)
    +++ head/sys/kern/kern_fail.c	Thu May 18 18:24:11 2017	(r318476)
    @@ -612,7 +612,7 @@ fail_point_eval_nontrivial(struct fail_p
     			break;
     
     		case FAIL_POINT_YIELD:
    -			kern_yield(-1);
    +			kern_yield(PRI_UNCHANGED);
     			break;
     
     		case FAIL_POINT_DELAY:
    
    From owner-svn-src-head@freebsd.org  Thu May 18 18:35:15 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C46D712F8;
     Thu, 18 May 2017 18:35:15 +0000 (UTC)
     (envelope-from markj@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 5952F8CD;
     Thu, 18 May 2017 18:35:15 +0000 (UTC)
     (envelope-from markj@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4IIZE6a067064;
     Thu, 18 May 2017 18:35:14 GMT (envelope-from markj@FreeBSD.org)
    Received: (from markj@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IIZEbq067062;
     Thu, 18 May 2017 18:35:14 GMT (envelope-from markj@FreeBSD.org)
    Message-Id: <201705181835.v4IIZEbq067062@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: markj set sender to
     markj@FreeBSD.org using -f
    From: Mark Johnston 
    Date: Thu, 18 May 2017 18:35:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318478 - in head/sys: compat/linuxkpi/common/src
     dev/drm2/ttm
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 18:35:15 -0000
    
    Author: markj
    Date: Thu May 18 18:35:14 2017
    New Revision: 318478
    URL: https://svnweb.freebsd.org/changeset/base/318478
    
    Log:
      Fix a few uses of kern_yield() in the TTM and the LinuxKPI.
      
      kern_yield(0) effectively causes the calling thread to be rescheduled
      immediately since it resets the thread's priority to the highest possible
      value. This can cause livelocks when the pattern
      "while (!trylock()) kern_yield(0);" is used since the thread holding the
      lock may linger on the runqueue for the CPU on which the looping thread is
      running.
      
      MFC after:	1 week
    
    Modified:
      head/sys/compat/linuxkpi/common/src/linux_compat.c
      head/sys/dev/drm2/ttm/ttm_bo_vm.c
    
    Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
    ==============================================================================
    --- head/sys/compat/linuxkpi/common/src/linux_compat.c	Thu May 18 18:33:33 2017	(r318477)
    +++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Thu May 18 18:35:14 2017	(r318478)
    @@ -435,7 +435,7 @@ linux_cdev_pager_populate(vm_object_t vm
     		err = vmap->vm_ops->fault(vmap, &vmf);
     
     		while (vmap->vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) {
    -			kern_yield(0);
    +			kern_yield(PRI_USER);
     			err = vmap->vm_ops->fault(vmap, &vmf);
     		}
     	}
    
    Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
    ==============================================================================
    --- head/sys/dev/drm2/ttm/ttm_bo_vm.c	Thu May 18 18:33:33 2017	(r318477)
    +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c	Thu May 18 18:35:14 2017	(r318478)
    @@ -126,7 +126,7 @@ reserve:
     	ret = ttm_bo_reserve(bo, false, false, false, 0);
     	if (unlikely(ret != 0)) {
     		if (ret == -EBUSY) {
    -			kern_yield(0);
    +			kern_yield(PRI_USER);
     			goto reserve;
     		}
     	}
    @@ -139,7 +139,7 @@ reserve:
     		case -EBUSY:
     		case -ERESTARTSYS:
     		case -EINTR:
    -			kern_yield(0);
    +			kern_yield(PRI_USER);
     			goto reserve;
     		default:
     			retval = VM_PAGER_ERROR;
    
    From owner-svn-src-head@freebsd.org  Thu May 18 18:37:21 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A337D715DF;
     Thu, 18 May 2017 18:37:21 +0000 (UTC)
     (envelope-from markj@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id EEBF5B03;
     Thu, 18 May 2017 18:37:20 +0000 (UTC)
     (envelope-from markj@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4IIbJZp067174;
     Thu, 18 May 2017 18:37:19 GMT (envelope-from markj@FreeBSD.org)
    Received: (from markj@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IIbJPt067173;
     Thu, 18 May 2017 18:37:19 GMT (envelope-from markj@FreeBSD.org)
    Message-Id: <201705181837.v4IIbJPt067173@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: markj set sender to
     markj@FreeBSD.org using -f
    From: Mark Johnston 
    Date: Thu, 18 May 2017 18:37:19 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318479 - head/sys/dev/drm2/ttm
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 18:37:21 -0000
    
    Author: markj
    Date: Thu May 18 18:37:19 2017
    New Revision: 318479
    URL: https://svnweb.freebsd.org/changeset/base/318479
    
    Log:
      Don't bother enqueuing a page immediately before freeing it.
      
      No functional change intended.
      
      MFC after:	1 week
    
    Modified:
      head/sys/dev/drm2/ttm/ttm_page_alloc.c
    
    Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c
    ==============================================================================
    --- head/sys/dev/drm2/ttm/ttm_page_alloc.c	Thu May 18 18:35:14 2017	(r318478)
    +++ head/sys/dev/drm2/ttm/ttm_page_alloc.c	Thu May 18 18:37:19 2017	(r318479)
    @@ -136,7 +136,7 @@ ttm_vm_page_free(vm_page_t m)
     	KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m));
     	m->flags &= ~PG_FICTITIOUS;
     	m->oflags |= VPO_UNMANAGED;
    -	vm_page_unwire(m, PQ_INACTIVE);
    +	vm_page_unwire(m, PQ_NONE);
     	vm_page_free(m);
     }
     
    
    From owner-svn-src-head@freebsd.org  Thu May 18 18:42:56 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30685D71979;
     Thu, 18 May 2017 18:42:56 +0000 (UTC)
     (envelope-from carpeddiem@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 03D7D128A;
     Thu, 18 May 2017 18:42:55 +0000 (UTC)
     (envelope-from carpeddiem@gmail.com)
    Received: by mail-io0-x230.google.com with SMTP id o12so34405024iod.3;
     Thu, 18 May 2017 11:42: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; bh=OpcCCWc/cLdJxbsrEMZR7iAuCNjcq596QXkG5b12/qM=;
     b=Mr/HFHIrKi58Z8z+Ubdr3l0LyhSQBcnTdHdjdR3j4Xh9yIahWGR4OZVVFM39DV0qgT
     r/IW6q2HcLk0TVw+e6PMT02Yc+lGJ7iyJ8ubinj2Y59BPcpYgN1AUuMxQ7oWR4Zf+n5E
     +w6AbdpIvS0JhMDqxYiJfps/XbMaSABnFVxdhY8CDBJ2UXJ8N9aGZWoQOR1mY38xBkN9
     GCA0Ew/A+LrrKzeFSjQMyhoi8hYGCQHynpdv+T5e91FlTs8RnhOMDBV11W2QxFSGRXTs
     qcOTEx0sUerdPAoLndMZOZCikb9FFB/V2VVyXAemrVTuGoYXwQ3JPsLxfWf7ZEkJGlOJ
     72aA==
    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;
     bh=OpcCCWc/cLdJxbsrEMZR7iAuCNjcq596QXkG5b12/qM=;
     b=sK2fyQNCETI1Pk/wj+vRZEPBgx59xWr/BRPHu9EDmqY1DiFX5urbAKpbkPxYZa4/70
     K9M43Dt573v/nmPUEQy1uQKoDKJta3lcYlgkP/TiLCFlMgzOIuM+V2pj3JDBKv42siDS
     TVFGkK0FNE8b6/vsK9QJxyeuBvDEWuoPXsYdUpnVzdCzPhWSXEsZqIgH23OtPudlth0V
     l62jgz24Ll6T/kQM1V1vNrqx9dF/5AWloBm8nQ9JiRM8jxoiBUhzz7BJuxqOAqIYJtjM
     +6YkRlgci4RKDvVSdawYPI01Spy5fwglBZUou/HqknFx30lc77pchNfJxPLG38ui2KjW
     xBUA==
    X-Gm-Message-State: AODbwcBV299dVkyw7FmvRxmCP5vuM+XKzHdrYljKKcLwzNj/RXcPJV0c
     WDibCS/rxZJapIkRDG66CyTKnzh9Bd3SvcA=
    X-Received: by 10.107.1.70 with SMTP id 67mr5932569iob.159.1495132975162; Thu,
     18 May 2017 11:42:55 -0700 (PDT)
    MIME-Version: 1.0
    Sender: carpeddiem@gmail.com
    Received: by 10.107.169.201 with HTTP; Thu, 18 May 2017 11:42:34 -0700 (PDT)
    In-Reply-To: <201705181755.v4IHtXKi050359@repo.freebsd.org>
    References: <201705181755.v4IHtXKi050359@repo.freebsd.org>
    From: Ed Maste 
    Date: Thu, 18 May 2017 14:42:34 -0400
    X-Google-Sender-Auth: pBN94yErrIBVw6UVbB4imPimgVc
    Message-ID: 
    Subject: Re: svn commit: r318474 - head/usr.sbin/makefs
    To: "src-committers@freebsd.org" , 
     "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.23
    Precedence: list
    List-Id: 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, 18 May 2017 18:42:56 -0000
    
    On 18 May 2017 at 13:55, Ed Maste  wrote:
    > Author: emaste
    > Date: Thu May 18 17:55:33 2017
    > New Revision: 318474
    > URL: https://svnweb.freebsd.org/changeset/base/318474
    >
    > Log:
    >   makefs: drop WARNS back to 2
    >
    >   GCC warns about additional signed comparision issues compared to Clang.
    >   Drop WARNS for now until the underlying issue is fixed.
    
    FYI the GCC warning came from the same blksize macro, but from the
    conditional expression this time.
    
    #define blksize(fs, ip, lbn) \
            (((lbn) >= UFS_NDADDR || (ip)->i_size >= \
                (uint64_t)smalllblktosize(fs, (lbn) + 1)) \
                ? (fs)->fs_bsize \
                : (fragroundup(fs, blkoff(fs, (ip)->i_size))))
    
    (fs)->fs_bsize is a signed int, while fragroundup is unsigned (from i_size).
    
    >
    > Modified:
    >   head/usr.sbin/makefs/Makefile
    >
    > Modified: head/usr.sbin/makefs/Makefile
    > ==============================================================================
    > --- head/usr.sbin/makefs/Makefile       Thu May 18 17:44:45 2017        (r318473)
    > +++ head/usr.sbin/makefs/Makefile       Thu May 18 17:55:33 2017        (r318474)
    > @@ -14,7 +14,7 @@ SRCS= cd9660.c ffs.c \
    >         walk.c
    >  MAN=   makefs.8
    >
    > -WARNS?=        3
    > +WARNS?=        2
    >
    >  .include "${SRCDIR}/cd9660/Makefile.inc"
    >  .include "${SRCDIR}/ffs/Makefile.inc"
    >
    
    From owner-svn-src-head@freebsd.org  Thu May 18 19:42:20 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id D56A8D739C9;
     Thu, 18 May 2017 19:42:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id A2D1013AA;
     Thu, 18 May 2017 19:42:20 +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 v4IJgJbC095409;
     Thu, 18 May 2017 19:42:19 GMT (envelope-from trasz@FreeBSD.org)
    Received: (from trasz@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IJgJhJ095408;
     Thu, 18 May 2017 19:42:19 GMT (envelope-from trasz@FreeBSD.org)
    Message-Id: <201705181942.v4IJgJhJ095408@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: trasz set sender to
     trasz@FreeBSD.org using -f
    From: Edward Tomasz Napierala 
    Date: Thu, 18 May 2017 19:42:19 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318481 - head/usr.bin/resizewin
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 19:42:20 -0000
    
    Author: trasz
    Date: Thu May 18 19:42:19 2017
    New Revision: 318481
    URL: https://svnweb.freebsd.org/changeset/base/318481
    
    Log:
      Language fixes.
      
      Submitted by:	wblock
      MFC after:	2 weeks
    
    Modified:
      head/usr.bin/resizewin/resizewin.1
    
    Modified: head/usr.bin/resizewin/resizewin.1
    ==============================================================================
    --- head/usr.bin/resizewin/resizewin.1	Thu May 18 18:39:23 2017	(r318480)
    +++ head/usr.bin/resizewin/resizewin.1	Thu May 18 19:42:19 2017	(r318481)
    @@ -49,7 +49,7 @@ The following options are available:
     .Bl -tag -width ".Fl z"
     .It Fl z
     Do nothing unless the current kernel terminal size is zero.
    -This is useful when run from user's profile (shell startup) scripts:
    +This is useful when run from a user's profile (shell startup) scripts:
     querying the window size is required for serial lines, but not when
     logging in over the network, as protocols like TELNET or SSH already
     handle the terminal size by themselves.
    @@ -72,7 +72,7 @@ commands to set environment variables.
     .Pp
     The terminal is assumed to be VT100/ANSI compatible.
     The VT100/ANSI escape sequences are supported by virtually all modern
    -terminals; this include xterm, konsole, gnome-terminal, iTerm,
    +terminals, including xterm, konsole, gnome-terminal, iTerm,
     Terminal.app, and PuTTY.
     .Sh SEE ALSO
     .Xr stty 1 ,
    
    From owner-svn-src-head@freebsd.org  Thu May 18 21:24:30 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id E233DD6F385;
     Thu, 18 May 2017 21:24:30 +0000 (UTC)
     (envelope-from bapt@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 C115B8C7;
     Thu, 18 May 2017 21:24:30 +0000 (UTC)
     (envelope-from bapt@freebsd.org)
    Received: by freefall.freebsd.org (Postfix, from userid 1235)
     id EC8512E58; Thu, 18 May 2017 21:24:29 +0000 (UTC)
    Date: Thu, 18 May 2017 23:24:29 +0200
    From: Baptiste Daroussin 
    To: John Baldwin 
    Cc: rgrimes@freebsd.org, Ngie Cooper ,
     svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    Message-ID: <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
     <20170518130932.eo5clhki4za2vigz@ivaldir.net>
     <2201156.H7EQSgYph9@ralph.baldwin.cx>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature"; boundary="plhgbr6l2qpe7eme"
    Content-Disposition: inline
    In-Reply-To: <2201156.H7EQSgYph9@ralph.baldwin.cx>
    User-Agent: NeoMutt/20170428 (1.8.2)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 21:24:31 -0000
    
    
    --plhgbr6l2qpe7eme
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
    > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
    > > > > Author: ngie
    > > > > Date: Thu May 18 06:25:39 2017
    > > > > New Revision: 318441
    > > > > URL: https://svnweb.freebsd.org/changeset/base/318441
    > > > >=20
    > > > > Log:
    > > > >   Handle the cron.d entry for MK_AT in cron conditionally
    > > > >  =20
    > > > >   Install /etc/cron.d/at if MK_AT !=3D no, always using it, which t=
    ries
    > > > >   to run a non-existent program via cron(8) every 5 minutes with the
    > > > >   default /etc/crontab, prior to this commit.
    > > > >  =20
    > > > >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.=
    d/at
    > > > >   because atrun(8) executes programs, which may rely on environment
    > > > >   currently set via /etc/crontab.
    > > > >  =20
    > > > >   Noted by:	bdrewery (in an internal review)
    > > > >   MFC after:	2 months
    > > > >   Relnotes:	yes (may need to add environmental modifications to
    > > > >   		     /etc/cron.d/at)
    > > > >   Sponsored by:	Dell EMC Isilon
    > > > >=20
    > > > > Added:
    > > > >   head/etc/cron.d/
    > > > >   head/etc/cron.d/Makefile   (contents, props changed)
    > > > >   head/etc/cron.d/at   (contents, props changed)
    > > > > Modified:
    > > > >   head/etc/Makefile
    > > > >   head/etc/crontab
    > > > >=20
    > > > > Modified: head/etc/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/etc/Makefile	Thu May 18 06:15:42 2017	(r318440)
    > > > > +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    > > > > @@ -8,6 +8,7 @@ FILESGROUPS=3D	FILES
    > > > >  # No need as it is empty and just causes rebuilds since this file =
    does so much.
    > > > >  UPDATE_DEPENDFILE=3D	no
    > > > >  SUBDIR=3D	\
    > > > > +	cron.d \
    > > > >  	newsyslog.conf.d \
    > > > >  	syslog.d
    > > >=20
    > > > The thread on the newsyslog clearly shows that this is a contriversia=
    l change.
    > > >=20
    > > > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FO=
    O files
    > > > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs a=
    nd
    > > > desires of others.
    > >=20
    > > Has multiple people has stated, on the newsyslog thread. this is not a
    > > DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
    > > 1. Consistency
    > >   as a project we do support building WITHOUT_FOO there is no reason to=
     install
    > >   syslog, cron configuration for FOO if the system was built without foo
    >=20
    > Though it doesn't _hurt_, and breaking POLA has to be worth it, not just
    > because it looks nice.
    >=20
    > > 2. Packaging base
    > >   if one does not install at there is no need for the at crontab to be =
    installed
    > >   (same reason as 1.)
    >=20
    > This is a viable reason except that it isn't fully baked yet.
    >=20
    > > 3. Large deployment of freebsd farms
    > >   Being able to administrate thousands of FreeBSD machines, one often e=
    nds up
    > >   using tools like puppet, chef, ansible, cfengine. When programmatical=
    ly
    > >   handling configuration management it is way easier and safer to simple
    > >   add/removes files in a directory rather than mangling^Winplace editin=
    g files.
    >=20
    > There's nothing preventing you now from deploying split files and an empty
    > global configuration file since the daemons support foo.d.  You don't req=
    uire
    > that to change in upstream since you should be using some sort of VCS to
    > manage your configuration as it is.
    >=20
    > > 4. Ports/packages
    > >   On can provide easily sample configuration for cron, syslog (not only=
    ) and the
    > >   admin can decide to use it or not easily (ususally this is done by ma=
    king
    > >   symlinks from the said file which would live in share/* into the .d d=
    irectory.
    > >=20
    > > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.
    >=20
    > The support for broken out files has long been there, but the base system=
     has
    > not used them previously for default config shipped during a release.  Th=
    at
    > is in fact a new trend.
    >=20
    > However, the current approach seems to be the absolute worst way to do th=
    is.
    > If someone wants to use the existing base system image and modify it with
    > config management, they now have to use a mix of styles (for some services
    > edit a global config file for certain settings, but use a dedicated file =
    for
    > other settings for the same service, or for the same settings but a diffe=
    rent
    > service).  It's also the worst case for humans trying to work with our sy=
    stem
    > as the division between which services are broken out vs global is
    > inconsistent and arbitrary.
    >=20
    > Once you split up the files you make a merge conflict for anyone trying t=
    o do
    > an upgrade.  If we do this piecemail then we create N merge conflicts for=
     users
    > to deal with as opposed to if you split it up all at once.
    >=20
    > Also, there wasn't a clear consensus (a mail to arch@ with "hey, we should
    > switch to splitting up config files for reasons A and B and let's do this=
     for
    > 12.0 but not merge to stable so there is a clear flag day / sign post for=
     users
    > to manage upgrades".  Instead there have been a couple of commits and any
    > not-in-100%-agreement opinions are ignored.
    >=20
    That's true, another thing is the way it is done, there is no simple way to
    disable the at cron from an admin point of view  rather than rm /etc/cron.d=
    /at
    for an end user which an upgrade will bring back.
    
    Bapt
    
    --plhgbr6l2qpe7eme
    Content-Type: application/pgp-signature; name="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlkeEQkACgkQY4mL3PG3
    PlpEQQ/9EXMRc61538j3jaOjXNgWkwpZojKwebrudlrNLTAmUSbDIunl0n6HG/4B
    VE5M0xP19SM9GSV4nDxd/rKZty/Ybn2NBqB8pePRJTxcSX96qI1ZjBK/7xsIHsAk
    BbiPNFr+yZwOZt8C9zlKCNOX2EZ4YILS6onHEJV6oGbLK5ORdpo8EnLfNcwsNqiX
    yk9CmZ3E56lJ1t/YeX6hd/vgLMBh0Ur/eVoFQl8SjzXuAeLAa9thrd1utkrSOknY
    CLwbRteHTvOvrudIT6R83ODwdvVApImHpXFQDW6lezlwTbmy1fLoiEZBy94KmzOv
    NJXgdmZ2dgmCgen9YhHaKeHwgZZgfsoP5Ee5wAUsf5bzQ4ucp+y9VZwDn5Ew1Jr7
    5bsxmX70hMZ/KgvhhIcP+PRIvMpUU7sTTCxdUlt3LopA/B66oXW2EFQ/Hh4o4oGv
    cEt5r29mez+Rf/k7rc2vEMGl031N08+bY9GrrSGUIwPiQAkdlhM00lqNhnYKeYfU
    3Axe2NO7vguO1Jpl7dDZWBtGvt0LSMeVh/hpKLNkEnBIBA/0/FVW8Xm24IAyCWr0
    8ElR1Az4d/zVJZt2Wo0gPYtS/rQHt+pt5muONTUnNWG3a/eVfnMSboBfUE0+zUOh
    l+UY5ULFz5cv4QqZf+7dMytj8YC7CR96ZDgVTcCIGgrxYArFvBQ=
    =nA5v
    -----END PGP SIGNATURE-----
    
    --plhgbr6l2qpe7eme--
    
    From owner-svn-src-head@freebsd.org  Thu May 18 21:27:53 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id D438AD6F4D7
     for ;
     Thu, 18 May 2017 21:27:53 +0000 (UTC) (envelope-from ian@freebsd.org)
    Received: from pmta2.delivery6.ore.mailhop.org
     (pmta2.delivery6.ore.mailhop.org [54.200.129.228])
     (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 B6DB3B94
     for ; Thu, 18 May 2017 21:27:53 +0000 (UTC)
     (envelope-from ian@freebsd.org)
    X-MHO-User: b228e9ad-3c10-11e7-8c46-c35e37f62db1
    X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information
    X-Originating-IP: 73.78.92.27
    X-Mail-Handler: DuoCircle Outbound SMTP
    Received: from ilsoft.org (unknown [73.78.92.27])
     by outbound2.ore.mailhop.org (Halon) with ESMTPSA
     id b228e9ad-3c10-11e7-8c46-c35e37f62db1;
     Thu, 18 May 2017 21:26:47 +0000 (UTC)
    Received: from rev (rev [172.22.42.240])
     by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4ILRnjN002133;
     Thu, 18 May 2017 15:27:49 -0600 (MDT) (envelope-from ian@freebsd.org)
    Message-ID: <1495142869.89384.18.camel@freebsd.org>
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    From: Ian Lepore 
    To: Baptiste Daroussin , John Baldwin 
    Cc: rgrimes@freebsd.org, Ngie Cooper ,
     svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    Date: Thu, 18 May 2017 15:27:49 -0600
    In-Reply-To: <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
     <20170518130932.eo5clhki4za2vigz@ivaldir.net>
     <2201156.H7EQSgYph9@ralph.baldwin.cx>
     <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
    Content-Type: text/plain; charset="ISO-8859-1"
    X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port 
    Mime-Version: 1.0
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 21:27:53 -0000
    
    On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
    > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
    > > 
    > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    > > > 
    > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
    > > > > 
    > > > > > 
    > > > > > 
    > > > [...]
    > > The support for broken out files has long been there, but the base
    > > system has
    > > not used them previously for default config shipped during a
    > > release.  That
    > > is in fact a new trend.
    > > 
    > > However, the current approach seems to be the absolute worst way to
    > > do this.
    > > If someone wants to use the existing base system image and modify
    > > it with
    > > config management, they now have to use a mix of styles (for some
    > > services
    > > edit a global config file for certain settings, but use a dedicated
    > > file for
    > > other settings for the same service, or for the same settings but a
    > > different
    > > service).  It's also the worst case for humans trying to work with
    > > our system
    > > as the division between which services are broken out vs global is
    > > inconsistent and arbitrary.
    > > 
    > > Once you split up the files you make a merge conflict for anyone
    > > trying to do
    > > an upgrade.  If we do this piecemail then we create N merge
    > > conflicts for users
    > > to deal with as opposed to if you split it up all at once.
    > > 
    > > Also, there wasn't a clear consensus (a mail to arch@ with "hey, we
    > > should
    > > switch to splitting up config files for reasons A and B and let's
    > > do this for
    > > 12.0 but not merge to stable so there is a clear flag day / sign
    > > post for users
    > > to manage upgrades".  Instead there have been a couple of commits
    > > and any
    > > not-in-100%-agreement opinions are ignored.
    > > 
    > That's true, another thing is the way it is done, there is no simple
    > way to
    > disable the at cron from an admin point of view  rather than rm
    > /etc/cron.d/at
    > for an end user which an upgrade will bring back.
    > 
    > Bapt
    
    Would you not just comment out or delete the line, exactly as you would
    do in the main /etc/crontab?
    
    -- Ian
    
    
    From owner-svn-src-head@freebsd.org  Thu May 18 21:29:13 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34B67D6F603;
     Thu, 18 May 2017 21:29:13 +0000 (UTC)
     (envelope-from bapt@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 E901CDA8;
     Thu, 18 May 2017 21:29:12 +0000 (UTC)
     (envelope-from bapt@freebsd.org)
    Received: by freefall.freebsd.org (Postfix, from userid 1235)
     id 1A8A03215; Thu, 18 May 2017 21:29:12 +0000 (UTC)
    Date: Thu, 18 May 2017 23:29:11 +0200
    From: Baptiste Daroussin 
    To: Ian Lepore 
    Cc: John Baldwin , rgrimes@freebsd.org,
     Ngie Cooper , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    Message-ID: <20170518212911.mstgmzbydsv7oind@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
     <20170518130932.eo5clhki4za2vigz@ivaldir.net>
     <2201156.H7EQSgYph9@ralph.baldwin.cx>
     <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
     <1495142869.89384.18.camel@freebsd.org>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature"; boundary="3mk2o7g3rtz22ydu"
    Content-Disposition: inline
    In-Reply-To: <1495142869.89384.18.camel@freebsd.org>
    User-Agent: NeoMutt/20170428 (1.8.2)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 21:29:13 -0000
    
    
    --3mk2o7g3rtz22ydu
    Content-Type: text/plain; charset=iso-8859-1
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    On Thu, May 18, 2017 at 03:27:49PM -0600, Ian Lepore wrote:
    > On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
    > > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
    > > >=20
    > > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    > > > >=20
    > > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
    > > > > >=20
    > > > > > >=20
    > > > > > >=20
    > > > > [...]
    > > > The support for broken out files has long been there, but the base
    > > > system has
    > > > not used them previously for default config shipped during a
    > > > release.=A0=A0That
    > > > is in fact a new trend.
    > > >=20
    > > > However, the current approach seems to be the absolute worst way to
    > > > do this.
    > > > If someone wants to use the existing base system image and modify
    > > > it with
    > > > config management, they now have to use a mix of styles (for some
    > > > services
    > > > edit a global config file for certain settings, but use a dedicated
    > > > file for
    > > > other settings for the same service, or for the same settings but a
    > > > different
    > > > service).=A0=A0It's also the worst case for humans trying to work with
    > > > our system
    > > > as the division between which services are broken out vs global is
    > > > inconsistent and arbitrary.
    > > >=20
    > > > Once you split up the files you make a merge conflict for anyone
    > > > trying to do
    > > > an upgrade.=A0=A0If we do this piecemail then we create N merge
    > > > conflicts for users
    > > > to deal with as opposed to if you split it up all at once.
    > > >=20
    > > > Also, there wasn't a clear consensus (a mail to arch@ with "hey, we
    > > > should
    > > > switch to splitting up config files for reasons A and B and let's
    > > > do this for
    > > > 12.0 but not merge to stable so there is a clear flag day / sign
    > > > post for users
    > > > to manage upgrades".=A0=A0Instead there have been a couple of commits
    > > > and any
    > > > not-in-100%-agreement opinions are ignored.
    > > >=20
    > > That's true, another thing is the way it is done, there is no simple
    > > way to
    > > disable the at cron from an admin point of view=A0=A0rather than rm
    > > /etc/cron.d/at
    > > for an end user which an upgrade will bring back.
    > >=20
    > > Bapt
    >=20
    > Would you not just comment out or delete the line, exactly as you would
    > do in the main /etc/crontab?
    
    Right but with a .d directory I would expect to just remove/add files/symli=
    nks
    rather than editing it, which defeat the point of the .d
    
    Bapt
    
    --3mk2o7g3rtz22ydu
    Content-Type: application/pgp-signature; name="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlkeEicACgkQY4mL3PG3
    Plqw3hAA3I6Ii8MRR4r9vPjAdy5TbyA75eDgyMnyBAlVpyFuFXY8isxVo8q+n8HE
    FyggrevSV92QM9bJxFp4aqDDr/IMuyNkRbq4WoVLOwQqOweEggI26Fj2gno0wrwa
    1OsCKzcVS2bLJ+dvWoLXb9WJevoBE+jdblUToFSebi/P9zGDshMkoaAZpwN7nK1K
    K2swi5zJsb1Xjmz2hnpMcktDuXr9C3bsHRhsq54g6LZPmiS/Nfl698FZQR2e+fPP
    l74R0OLpGyiVfJ7AGzFM9Fngv7R9M85LU/9dCcBzvhmiHHXAIxSGn9q0JaxIq2TL
    q/GKIiKwGazB8aU9mbbfcsuPxOlJcFPJEFl6UZ/kWG+11TO8N71QfJMnn6R5um+a
    ACjEzA0z2E/Ut81fX+B5d56GCfbKEyYj/ODaMst4tfMwWzTrw1Vc0GrTyM38EdLG
    vC/nTTr2fbULqs5FwdK32hMSQfzdPonQst4D8gtZ9YLvBQ2ALtc3iVG025o6iaJN
    ajgUgD0/ncRAC5KP/9gDdbaRfTvoEVQWO4i3JVHotckDvfXjTgJjmgzI1eHSu1v7
    iTdokuDlIX0wup0fGjUw2i9/cusF0ehUHijhORLdkFAiIvXunPcZ5ihZhHtLtGxq
    9ss6eN5npl/zWIjLTtCFMOG7wixgctv0FePnfVk3QiBN060dgw4=
    =bc2S
    -----END PGP SIGNATURE-----
    
    --3mk2o7g3rtz22ydu--
    
    From owner-svn-src-head@freebsd.org  Thu May 18 21:34:42 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A5ACD6F8E3
     for ;
     Thu, 18 May 2017 21:34:42 +0000 (UTC) (envelope-from ian@freebsd.org)
    Received: from pmta2.delivery6.ore.mailhop.org
     (pmta2.delivery6.ore.mailhop.org [54.200.129.228])
     (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 2C5991324
     for ; Thu, 18 May 2017 21:34:41 +0000 (UTC)
     (envelope-from ian@freebsd.org)
    X-MHO-User: a5f2b807-3c11-11e7-8c46-c35e37f62db1
    X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information
    X-Originating-IP: 73.78.92.27
    X-Mail-Handler: DuoCircle Outbound SMTP
    Received: from ilsoft.org (unknown [73.78.92.27])
     by outbound2.ore.mailhop.org (Halon) with ESMTPSA
     id a5f2b807-3c11-11e7-8c46-c35e37f62db1;
     Thu, 18 May 2017 21:33:36 +0000 (UTC)
    Received: from rev (rev [172.22.42.240])
     by ilsoft.org (8.15.2/8.15.2) with ESMTP id v4ILYcCf002153;
     Thu, 18 May 2017 15:34:39 -0600 (MDT) (envelope-from ian@freebsd.org)
    Message-ID: <1495143278.89384.24.camel@freebsd.org>
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    From: Ian Lepore 
    To: Baptiste Daroussin 
    Cc: John Baldwin , rgrimes@freebsd.org, Ngie Cooper
     , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org
    Date: Thu, 18 May 2017 15:34:38 -0600
    In-Reply-To: <20170518212911.mstgmzbydsv7oind@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
     <20170518130932.eo5clhki4za2vigz@ivaldir.net>
     <2201156.H7EQSgYph9@ralph.baldwin.cx>
     <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
     <20170518212911.mstgmzbydsv7oind@ivaldir.net>
    Content-Type: text/plain; charset="ISO-8859-1"
    X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port 
    Mime-Version: 1.0
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 21:34:42 -0000
    
    On Thu, 2017-05-18 at 23:29 +0200, Baptiste Daroussin wrote:
    > On Thu, May 18, 2017 at 03:27:49PM -0600, Ian Lepore wrote:
    > > 
    > > On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
    > > > 
    > > > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
    > > > > 
    > > > > 
    > > > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    > > > > > 
    > > > > > 
    > > > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes
    > > > > > wrote:
    > > > > > > 
    > > > > > > 
    > > > > > > > 
    > > > > > > > 
    > > > > > > > 
    > > > > > [...]
    > > > > The support for broken out files has long been there, but the
    > > > > base
    > > > > system has
    > > > > not used them previously for default config shipped during a
    > > > > release.  That
    > > > > is in fact a new trend.
    > > > > 
    > > > > However, the current approach seems to be the absolute worst
    > > > > way to
    > > > > do this.
    > > > > If someone wants to use the existing base system image and
    > > > > modify
    > > > > it with
    > > > > config management, they now have to use a mix of styles (for
    > > > > some
    > > > > services
    > > > > edit a global config file for certain settings, but use a
    > > > > dedicated
    > > > > file for
    > > > > other settings for the same service, or for the same settings
    > > > > but a
    > > > > different
    > > > > service).  It's also the worst case for humans trying to work
    > > > > with
    > > > > our system
    > > > > as the division between which services are broken out vs global
    > > > > is
    > > > > inconsistent and arbitrary.
    > > > > 
    > > > > Once you split up the files you make a merge conflict for
    > > > > anyone
    > > > > trying to do
    > > > > an upgrade.  If we do this piecemail then we create N merge
    > > > > conflicts for users
    > > > > to deal with as opposed to if you split it up all at once.
    > > > > 
    > > > > Also, there wasn't a clear consensus (a mail to arch@ with
    > > > > "hey, we
    > > > > should
    > > > > switch to splitting up config files for reasons A and B and
    > > > > let's
    > > > > do this for
    > > > > 12.0 but not merge to stable so there is a clear flag day /
    > > > > sign
    > > > > post for users
    > > > > to manage upgrades".  Instead there have been a couple of
    > > > > commits
    > > > > and any
    > > > > not-in-100%-agreement opinions are ignored.
    > > > > 
    > > > That's true, another thing is the way it is done, there is no
    > > > simple
    > > > way to
    > > > disable the at cron from an admin point of view  rather than rm
    > > > /etc/cron.d/at
    > > > for an end user which an upgrade will bring back.
    > > > 
    > > > Bapt
    > > Would you not just comment out or delete the line, exactly as you
    > > would
    > > do in the main /etc/crontab?
    > Right but with a .d directory I would expect to just remove/add
    > files/symlinks
    > rather than editing it, which defeat the point of the .d
    > 
    > Bapt
    
    Hrm, I don't see any conflict between "this fine-grained file holds
    config for just one component" and "edit the file if you want to change
    the config".  That is, making the file fine-grained is to make editing
    it EASIER (for a human or a program), not to eliminate editing it.
    
    I do see how thinking that deleting the file (or renaming it to file.no
    or something) would seem like the right thing to do.  How can we fix
    that?
    
    -- Ian
    
    
    From owner-svn-src-head@freebsd.org  Thu May 18 21:36:24 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BC6AD6F975;
     Thu, 18 May 2017 21:36:24 +0000 (UTC)
     (envelope-from bapt@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 18B031531;
     Thu, 18 May 2017 21:36:24 +0000 (UTC)
     (envelope-from bapt@freebsd.org)
    Received: by freefall.freebsd.org (Postfix, from userid 1235)
     id 3F5FD3567; Thu, 18 May 2017 21:36:23 +0000 (UTC)
    Date: Thu, 18 May 2017 23:36:23 +0200
    From: Baptiste Daroussin 
    To: Ian Lepore 
    Cc: John Baldwin , rgrimes@freebsd.org,
     Ngie Cooper , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    Message-ID: <20170518213622.r66gzsjlvj76ujli@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
     <20170518130932.eo5clhki4za2vigz@ivaldir.net>
     <2201156.H7EQSgYph9@ralph.baldwin.cx>
     <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
     <20170518212911.mstgmzbydsv7oind@ivaldir.net>
     <1495143278.89384.24.camel@freebsd.org>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature"; boundary="3iqfx6deqp4ggs2f"
    Content-Disposition: inline
    In-Reply-To: <1495143278.89384.24.camel@freebsd.org>
    User-Agent: NeoMutt/20170428 (1.8.2)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 21:36:24 -0000
    
    
    --3iqfx6deqp4ggs2f
    Content-Type: text/plain; charset=iso-8859-1
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    On Thu, May 18, 2017 at 03:34:38PM -0600, Ian Lepore wrote:
    > On Thu, 2017-05-18 at 23:29 +0200, Baptiste Daroussin wrote:
    > > On Thu, May 18, 2017 at 03:27:49PM -0600, Ian Lepore wrote:
    > > >=20
    > > > On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
    > > > >=20
    > > > > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
    > > > > >=20
    > > > > >=20
    > > > > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    > > > > > >=20
    > > > > > >=20
    > > > > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes
    > > > > > > wrote:
    > > > > > > >=20
    > > > > > > >=20
    > > > > > > > >=20
    > > > > > > > >=20
    > > > > > > > >=20
    > > > > > > [...]
    > > > > > The support for broken out files has long been there, but the
    > > > > > base
    > > > > > system has
    > > > > > not used them previously for default config shipped during a
    > > > > > release.=A0=A0That
    > > > > > is in fact a new trend.
    > > > > >=20
    > > > > > However, the current approach seems to be the absolute worst
    > > > > > way to
    > > > > > do this.
    > > > > > If someone wants to use the existing base system image and
    > > > > > modify
    > > > > > it with
    > > > > > config management, they now have to use a mix of styles (for
    > > > > > some
    > > > > > services
    > > > > > edit a global config file for certain settings, but use a
    > > > > > dedicated
    > > > > > file for
    > > > > > other settings for the same service, or for the same settings
    > > > > > but a
    > > > > > different
    > > > > > service).=A0=A0It's also the worst case for humans trying to work
    > > > > > with
    > > > > > our system
    > > > > > as the division between which services are broken out vs global
    > > > > > is
    > > > > > inconsistent and arbitrary.
    > > > > >=20
    > > > > > Once you split up the files you make a merge conflict for
    > > > > > anyone
    > > > > > trying to do
    > > > > > an upgrade.=A0=A0If we do this piecemail then we create N merge
    > > > > > conflicts for users
    > > > > > to deal with as opposed to if you split it up all at once.
    > > > > >=20
    > > > > > Also, there wasn't a clear consensus (a mail to arch@ with
    > > > > > "hey, we
    > > > > > should
    > > > > > switch to splitting up config files for reasons A and B and
    > > > > > let's
    > > > > > do this for
    > > > > > 12.0 but not merge to stable so there is a clear flag day /
    > > > > > sign
    > > > > > post for users
    > > > > > to manage upgrades".=A0=A0Instead there have been a couple of
    > > > > > commits
    > > > > > and any
    > > > > > not-in-100%-agreement opinions are ignored.
    > > > > >=20
    > > > > That's true, another thing is the way it is done, there is no
    > > > > simple
    > > > > way to
    > > > > disable the at cron from an admin point of view=A0=A0rather than rm
    > > > > /etc/cron.d/at
    > > > > for an end user which an upgrade will bring back.
    > > > >=20
    > > > > Bapt
    > > > Would you not just comment out or delete the line, exactly as you
    > > > would
    > > > do in the main /etc/crontab?
    > > Right but with a .d directory I would expect to just remove/add
    > > files/symlinks
    > > rather than editing it, which defeat the point of the .d
    > >=20
    > > Bapt
    >=20
    > Hrm, I don't see any conflict between "this fine-grained file holds
    > config for just one component" and "edit the file if you want to change
    > the config". =A0That is, making the file fine-grained is to make editing
    > it EASIER (for a human or a program), not to eliminate editing it.
    >=20
    > I do see how thinking that deleting the file (or renaming it to file.no
    > or something) would seem like the right thing to do. =A0How can we fix
    > that?
    >=20
    
    For now I don't know :) I'm thinking about it
    
    Bapt
    
    --3iqfx6deqp4ggs2f
    Content-Type: application/pgp-signature; name="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlkeE9YACgkQY4mL3PG3
    PlolkQ//VfPKh64vfEONbmuYcBPM4G/7xBo6qDjq8lh4avpqNUw1oz2p1rfF5xh7
    H3FD0Md1UfAM4Iw9uXCfOujO5Gkk1+hUD2jjlnGJd57HRKoUzlJ+ra1EivYKJTWa
    CUmCcEr2QXEU7dtKw1s9z5BGFTQaHZkRdRT4oUlgn3RJ9j0XLWyr2fOH6BKsEMxX
    1O5YAwe5/Ph8L0TlF04m80G+l8Ca/ojfB7V2qwRqW7ClLhmT8IRAcaaC1uNZOTl3
    a0HekNLhbKukInzgGzoMBlG3ilO68YT0JNX/npMSNvB0ZDS7b4mbNtHw8W2kQq1s
    kjrkkP2w2r0GXZW+lmnd6djeaRifwvM/fp+I9FU4QXkbxzXY50Iw6aw1pXBqVVbM
    Gqehdj8i+HffluoOsEdg26k08CfH1S1oDmQDoU1RNMClZODOQfqNtRxzpST4KwXk
    /WeWZszYo7abvE6pzuF5N8L2qiCmnK1U1z9nuGWqrsfd6ZuHJJ5tnRTC4XnE9NvJ
    u8OJHxFZWs+G1PLSaCZ7IszHh5Hn4mlEPT6x7OqH4zge46n6YJOBHcl1B/DRgHBb
    orynU4/oyXA+sav/Ekl4MiiHFTGgWkeCJ4DEKZnSdG8Tw8Bf01wn+4AuAkhCv5CE
    m5Ov2k+fNUeMWC2xHGHxj0z1hKZte7Tg/r96MSItu8PMKgBPwFQ=
    =hk5v
    -----END PGP SIGNATURE-----
    
    --3iqfx6deqp4ggs2f--
    
    From owner-svn-src-head@freebsd.org  Thu May 18 21:36:59 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AD47D6F9F9;
     Thu, 18 May 2017 21:36:59 +0000 (UTC)
     (envelope-from eric@vangyzen.net)
    Received: from smtp.vangyzen.net (hotblack.vangyzen.net
     [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f])
     by mx1.freebsd.org (Postfix) with ESMTP id 07050169B;
     Thu, 18 May 2017 21:36:59 +0000 (UTC)
     (envelope-from eric@vangyzen.net)
    Received: from sweettea.beer.town (unknown [76.164.8.130])
     by smtp.vangyzen.net (Postfix) with ESMTPSA id 34D575646B;
     Thu, 18 May 2017 16:36:58 -0500 (CDT)
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    To: Ian Lepore , Baptiste Daroussin 
    Cc: John Baldwin , rgrimes@freebsd.org,
     Ngie Cooper , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <201705180956.v4I9uVpQ065465@pdx.rh.CN85.dnsmgr.net>
     <20170518130932.eo5clhki4za2vigz@ivaldir.net>
     <2201156.H7EQSgYph9@ralph.baldwin.cx>
     <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
     <20170518212911.mstgmzbydsv7oind@ivaldir.net>
     <1495143278.89384.24.camel@freebsd.org>
    From: Eric van Gyzen 
    Message-ID: <10f3d402-f392-d4ed-cc47-76296f0ef4e7@vangyzen.net>
    Date: Thu, 18 May 2017 16:36:57 -0500
    User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
     Thunderbird/52.0.1
    MIME-Version: 1.0
    In-Reply-To: <1495143278.89384.24.camel@freebsd.org>
    Content-Type: text/plain; charset=utf-8
    Content-Language: en-US
    Content-Transfer-Encoding: 7bit
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 18 May 2017 21:36:59 -0000
    
    On 05/18/2017 16:34, Ian Lepore wrote:
    > On Thu, 2017-05-18 at 23:29 +0200, Baptiste Daroussin wrote:
    >> On Thu, May 18, 2017 at 03:27:49PM -0600, Ian Lepore wrote:
    >>>
    >>> On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
    >>>>
    >>>> On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
    >>>>>
    >>>>>
    >>>>> On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    >>>>>>
    >>>>>>
    >>>>>> On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes
    >>>>>> wrote:
    >>>>>>>
    >>>>>>>
    >>>>>>>>
    >>>>>>>>
    >>>>>>>>
    >>>>>> [...]
    >>>>> The support for broken out files has long been there, but the
    >>>>> base
    >>>>> system has
    >>>>> not used them previously for default config shipped during a
    >>>>> release.  That
    >>>>> is in fact a new trend.
    >>>>>
    >>>>> However, the current approach seems to be the absolute worst
    >>>>> way to
    >>>>> do this.
    >>>>> If someone wants to use the existing base system image and
    >>>>> modify
    >>>>> it with
    >>>>> config management, they now have to use a mix of styles (for
    >>>>> some
    >>>>> services
    >>>>> edit a global config file for certain settings, but use a
    >>>>> dedicated
    >>>>> file for
    >>>>> other settings for the same service, or for the same settings
    >>>>> but a
    >>>>> different
    >>>>> service).  It's also the worst case for humans trying to work
    >>>>> with
    >>>>> our system
    >>>>> as the division between which services are broken out vs global
    >>>>> is
    >>>>> inconsistent and arbitrary.
    >>>>>
    >>>>> Once you split up the files you make a merge conflict for
    >>>>> anyone
    >>>>> trying to do
    >>>>> an upgrade.  If we do this piecemail then we create N merge
    >>>>> conflicts for users
    >>>>> to deal with as opposed to if you split it up all at once.
    >>>>>
    >>>>> Also, there wasn't a clear consensus (a mail to arch@ with
    >>>>> "hey, we
    >>>>> should
    >>>>> switch to splitting up config files for reasons A and B and
    >>>>> let's
    >>>>> do this for
    >>>>> 12.0 but not merge to stable so there is a clear flag day /
    >>>>> sign
    >>>>> post for users
    >>>>> to manage upgrades".  Instead there have been a couple of
    >>>>> commits
    >>>>> and any
    >>>>> not-in-100%-agreement opinions are ignored.
    >>>>>
    >>>> That's true, another thing is the way it is done, there is no
    >>>> simple
    >>>> way to
    >>>> disable the at cron from an admin point of view  rather than rm
    >>>> /etc/cron.d/at
    >>>> for an end user which an upgrade will bring back.
    >>>>
    >>>> Bapt
    >>> Would you not just comment out or delete the line, exactly as you
    >>> would
    >>> do in the main /etc/crontab?
    >> Right but with a .d directory I would expect to just remove/add
    >> files/symlinks
    >> rather than editing it, which defeat the point of the .d
    >>
    >> Bapt
    > 
    > Hrm, I don't see any conflict between "this fine-grained file holds
    > config for just one component" and "edit the file if you want to change
    > the config".  That is, making the file fine-grained is to make editing
    > it EASIER (for a human or a program), not to eliminate editing it.
    > 
    > I do see how thinking that deleting the file (or renaming it to file.no
    > or something) would seem like the right thing to do.  How can we fix
    > that?
    
    How would an upgrade bring back /etc/cron.d/at if the end-user deleted it?
    
    Eric
    
    From owner-svn-src-head@freebsd.org  Thu May 18 21:44:16 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E9D3D6FC63;
     Thu, 18 May 2017 21:44:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0C1101B68;
     Thu, 18 May 2017 21:44:15 +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 v4ILiF7t046858;
     Thu, 18 May 2017 21:44:15 GMT (envelope-from jilles@FreeBSD.org)
    Received: (from jilles@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4ILiEOs046856;
     Thu, 18 May 2017 21:44:14 GMT (envelope-from jilles@FreeBSD.org)
    Message-Id: <201705182144.v4ILiEOs046856@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jilles set sender to
     jilles@FreeBSD.org using -f
    From: Jilles Tjoelker 
    Date: Thu, 18 May 2017 21:44:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318501 - head/bin/sh
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 21:44:16 -0000
    
    Author: jilles
    Date: Thu May 18 21:44:14 2017
    New Revision: 318501
    URL: https://svnweb.freebsd.org/changeset/base/318501
    
    Log:
      sh: Ensure memout.bufsize matches allocated buffer, if it exists.
    
    Modified:
      head/bin/sh/eval.c
      head/bin/sh/output.c
    
    Modified: head/bin/sh/eval.c
    ==============================================================================
    --- head/bin/sh/eval.c	Thu May 18 21:23:39 2017	(r318500)
    +++ head/bin/sh/eval.c	Thu May 18 21:44:14 2017	(r318501)
    @@ -1081,8 +1081,6 @@ evalcommand(union node *cmd, int flags, 
     		mode = (cmdentry.u.index == EXECCMD)? 0 : REDIR_PUSH;
     		if (flags == EV_BACKCMD) {
     			memout.nextc = memout.buf;
    -			memout.bufend = memout.buf;
    -			memout.bufsize = 64;
     			mode |= REDIR_BACKQ;
     		}
     		savecmdname = commandname;
    @@ -1139,6 +1137,7 @@ cmddone:
     			memout.buf = NULL;
     			memout.nextc = NULL;
     			memout.bufend = NULL;
    +			memout.bufsize = 64;
     		}
     		if (cmdentry.u.index != EXECCMD)
     			popredir();
    
    Modified: head/bin/sh/output.c
    ==============================================================================
    --- head/bin/sh/output.c	Thu May 18 21:23:39 2017	(r318500)
    +++ head/bin/sh/output.c	Thu May 18 21:44:14 2017	(r318501)
    @@ -73,7 +73,7 @@ static int doformat_wr(void *, const cha
     
     struct output output = {NULL, NULL, NULL, OUTBUFSIZ, 1, 0};
     struct output errout = {NULL, NULL, NULL, 256, 2, 0};
    -struct output memout = {NULL, NULL, NULL, 0, MEM_OUT, 0};
    +struct output memout = {NULL, NULL, NULL, 64, MEM_OUT, 0};
     struct output *out1 = &output;
     struct output *out2 = &errout;
     
    @@ -208,7 +208,7 @@ outbin(const void *data, size_t len, str
     void
     emptyoutbuf(struct output *dest)
     {
    -	int offset;
    +	int offset, newsize;
     
     	if (dest->buf == NULL) {
     		INTOFF;
    @@ -218,10 +218,11 @@ emptyoutbuf(struct output *dest)
     		INTON;
     	} else if (dest->fd == MEM_OUT) {
     		offset = dest->nextc - dest->buf;
    +		newsize = dest->bufsize << 1;
     		INTOFF;
    -		dest->bufsize <<= 1;
    -		dest->buf = ckrealloc(dest->buf, dest->bufsize);
    -		dest->bufend = dest->buf + dest->bufsize;
    +		dest->buf = ckrealloc(dest->buf, newsize);
    +		dest->bufsize = newsize;
    +		dest->bufend = dest->buf + newsize;
     		dest->nextc = dest->buf + offset;
     		INTON;
     	} else {
    
    From owner-svn-src-head@freebsd.org  Thu May 18 22:10:06 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11764D73263;
     Thu, 18 May 2017 22:10:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id D5F8D6F1;
     Thu, 18 May 2017 22:10:05 +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 v4IMA4X9054970;
     Thu, 18 May 2017 22:10:04 GMT (envelope-from jilles@FreeBSD.org)
    Received: (from jilles@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IMA48d054969;
     Thu, 18 May 2017 22:10:04 GMT (envelope-from jilles@FreeBSD.org)
    Message-Id: <201705182210.v4IMA48d054969@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jilles set sender to
     jilles@FreeBSD.org using -f
    From: Jilles Tjoelker 
    Date: Thu, 18 May 2017 22:10:04 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318502 - head/bin/sh
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 18 May 2017 22:10:06 -0000
    
    Author: jilles
    Date: Thu May 18 22:10:04 2017
    New Revision: 318502
    URL: https://svnweb.freebsd.org/changeset/base/318502
    
    Log:
      sh: Keep output buffer across builtins.
      
      Allocating and deallocating repeatedly the 1024-byte buffer for stdout from
      builtins costs CPU time for little or no benefit.
      
      A simple loop containing builtins that write to a file descriptor, such as
        i=0; while [ "$i" -lt 1000000 ]; do printf .; i=$((i+1)); done >/dev/null
      is over 10% faster in a simple benchmark on an amd64 virtual machine.
    
    Modified:
      head/bin/sh/output.c
    
    Modified: head/bin/sh/output.c
    ==============================================================================
    --- head/bin/sh/output.c	Thu May 18 21:44:14 2017	(r318501)
    +++ head/bin/sh/output.c	Thu May 18 22:10:04 2017	(r318502)
    @@ -254,14 +254,7 @@ flushout(struct output *dest)
     void
     freestdout(void)
     {
    -	INTOFF;
    -	if (output.buf) {
    -		ckfree(output.buf);
    -		output.nextc = NULL;
    -		output.buf = NULL;
    -		output.bufend = NULL;
    -	}
    -	INTON;
    +	output.nextc = output.buf;
     }
     
     
    
    From owner-svn-src-head@freebsd.org  Fri May 19 00:25:11 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A0CD73B2B;
     Fri, 19 May 2017 00:25:11 +0000 (UTC)
     (envelope-from markj@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 099CCEC2;
     Fri, 19 May 2017 00:25:10 +0000 (UTC)
     (envelope-from markj@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J0PALo011833;
     Fri, 19 May 2017 00:25:10 GMT (envelope-from markj@FreeBSD.org)
    Received: (from markj@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J0PAwu011832;
     Fri, 19 May 2017 00:25:10 GMT (envelope-from markj@FreeBSD.org)
    Message-Id: <201705190025.v4J0PAwu011832@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: markj set sender to
     markj@FreeBSD.org using -f
    From: Mark Johnston 
    Date: Fri, 19 May 2017 00:25:10 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318508 - head/cddl/usr.sbin/dtrace/tests/tools
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 00:25:11 -0000
    
    Author: markj
    Date: Fri May 19 00:25:09 2017
    New Revision: 318508
    URL: https://svnweb.freebsd.org/changeset/base/318508
    
    Log:
      Remove the EXFAIL annotation for tests which pass as of r309596.
      
      Reported by:	bdrewery
      Sponsored by:	Dell EMC Isilon
    
    Modified:
      head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
    
    Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
    ==============================================================================
    --- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh	Fri May 19 00:00:38 2017	(r318507)
    +++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh	Fri May 19 00:25:09 2017	(r318508)
    @@ -139,11 +139,6 @@ exclude EXFAIL common/pid/tst.newprobes.
     exclude EXFAIL common/pid/tst.provregex2.ksh
     exclude EXFAIL common/pid/tst.provregex4.ksh
     
    -# libproc doesn't properly handle probe sites that correspond to multiple
    -# symbols.
    -exclude EXFAIL common/pid/tst.weak1.d
    -exclude EXFAIL common/pid/tst.weak2.d
    -
     # This test checks for a leading tab on a line before #define. That is illegal
     # on Solaris, but the clang pre-processor on FreeBSD is happy with code like
     # that.
    
    From owner-svn-src-head@freebsd.org  Fri May 19 01:18:31 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8795D719F1;
     Fri, 19 May 2017 01:18:31 +0000 (UTC)
     (envelope-from sepherosa@gmail.com)
    Received: from mail-pg0-x22e.google.com (mail-pg0-x22e.google.com
     [IPv6:2607:f8b0:400e:c05::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 92A75942;
     Fri, 19 May 2017 01:18:31 +0000 (UTC)
     (envelope-from sepherosa@gmail.com)
    Received: by mail-pg0-x22e.google.com with SMTP id x64so30472748pgd.3;
     Thu, 18 May 2017 18:18:31 -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=4tz9rXCMmxtEUksoEkeSQ5mYhtAFal6Uhe4IqTj6oX4=;
     b=qgwBw/czWAVyrIpyrA1jFYL6WpS649jATJxAIU1RXWYUOhZ7Y5Sns2DXguFAoWEayD
     fSfm9drgqm9Fdt/4mmm/rRZZj1MAaLLFTTFbKkj4rIq+GYKQ7UmgHAtBDGj60g6NZRT0
     WvzO7iaIwXiX+lSYdFXLcErhgqgvmfl/Vr3E5iUQagOKLgh8+Ywk5gpRNVnpYwjn7qZ2
     VqWr6O0AS89gAjysHGw7rMj+sxAziU08a92qJjaslsUjpPlJ2sx4rRSYsqJhLFnzp3xk
     1K2cFRRtn59KLGJNf8VuMir19Mn2rutp1TQC+hM5K6Ljv/6rBUobypbYlxLAD4SsO4pB
     3lpQ==
    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=4tz9rXCMmxtEUksoEkeSQ5mYhtAFal6Uhe4IqTj6oX4=;
     b=auPCQ85OpJRg02aubr82YgHKXWLJCrVjxlkcf3hjGaDedbHaqv2pxo9jiEnu5MAOSY
     0w+1TJYNd8iEycWpUkgjlbER65E4JcRU9B30U2PKamd+egnFPPBfx4wzwzRVzkLoaGFQ
     ZsZnkI1HZfOAimGn/W7cp78NCRWGSLm0J6m/jE0A0dMqpHxNp+jZDXWypWXXyuVC9/fI
     R6VBhtv5NPm/9KVjYhXfNTIzGv7P6ha938u01WJUpcv2np2p9aY5MPyGkGR54EHbamDE
     xQmiaKObS+ahhgjSE1BKqpuPiAzAnowz90pbxWWoj0PxA/dRVsrHsF2x5gbrNVQwHEST
     ygwg==
    X-Gm-Message-State: AODbwcBHGzXkyy9m/PJjl5Rh60/TcE0AK/7vo4nSOV1c0tL40bc0d5rg
     Gb2xvUBXQ0rcu0cFSLQ1urUBzbLG0g==
    X-Received: by 10.99.115.73 with SMTP id d9mr2114201pgn.5.1495156711153; Thu,
     18 May 2017 18:18:31 -0700 (PDT)
    MIME-Version: 1.0
    Sender: sepherosa@gmail.com
    Received: by 10.100.160.112 with HTTP; Thu, 18 May 2017 18:18:30 -0700 (PDT)
    In-Reply-To: 
    References: <201609010632.u816WZUj025186@repo.freebsd.org>
     <20170518140403.GA54405@lath.RINET.ru>
     <355478da-ed4d-60bb-bb4e-144a694e28b8@selasky.org>
     <20170518150030.GA55481@lath.RINET.ru>
     
    From: Sepherosa Ziehau 
    Date: Fri, 19 May 2017 09:18:30 +0800
    X-Google-Sender-Auth: G66Gd5S2gDp2rc1bE4OHC96Sxsc
    Message-ID: 
    Subject: Re: svn commit: r305177 - head/sys/net
    To: Hans Petter Selasky 
    Cc: Oleg Bulyzhin ,
     src-committers , 
     svn-src-all@freebsd.org, svn-src-head@freebsd.org, araujo@freebsd.org
    Content-Type: text/plain; charset="UTF-8"
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 19 May 2017 01:18:31 -0000
    
    Oh, my fault.  I will revert it.
    
    On Thu, May 18, 2017 at 11:11 PM, Hans Petter Selasky  wrote:
    > On 05/18/17 17:00, Oleg Bulyzhin wrote:
    >>
    >> On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote:
    >>>
    >>> On 05/18/17 16:04, Oleg Bulyzhin wrote:
    >>>>
    >>>> On Thu, Sep 01, 2016 at 06:32:35AM +0000, Sepherosa Ziehau wrote:
    >>>>>
    >>>>> Author: sephe
    >>>>> Date: Thu Sep  1 06:32:35 2016
    >>>>> New Revision: 305177
    >>>>> URL: https://svnweb.freebsd.org/changeset/base/305177
    >>>>>
    >>>>> Log:
    >>>>>     net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
    >>>>>         Reviewed by:    araujo, hps
    >>>>>     MFC after:  1 week
    >>>>>     Sponsored by:       Microsoft
    >>>>>     Differential Revision:      https://reviews.freebsd.org/D7710
    >>>>>
    >>>>> Modified:
    >>>>>     head/sys/net/ethernet.h
    >>>>>
    >>>>> Modified: head/sys/net/ethernet.h
    >>>>>
    >>>>> ==============================================================================
    >>>>> --- head/sys/net/ethernet.h     Thu Sep  1 06:05:08 2016
    >>>>> (r305176)
    >>>>> +++ head/sys/net/ethernet.h     Thu Sep  1 06:32:35 2016
    >>>>> (r305177)
    >>>>> @@ -92,7 +92,7 @@ struct ether_vlan_header {
    >>>>>    #define      EVL_PRIOFTAG(tag)       (((tag) >> 13) & 7)
    >>>>>    #define      EVL_CFIOFTAG(tag)       (((tag) >> 12) & 1)
    >>>>>    #define      EVL_MAKETAG(vlid, pri, cfi)
    >>>>> \
    >>>>> -       ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) &
    >>>>> EVL_VLID_MASK))
    >>>>> +       ((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) &
    >>>>> EVL_VLID_MASK))
    >>>>>       /*
    >>>>>     *  NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length
    >>>>> fields.
    >>>>
    >>>>
    >>>> Please revert this one. It's just plain wrong and previous one was ok.
    >>>>
    >>>
    >>> Hi,
    >>>
    >>> Can you explain a bit more what is wrong?
    >>>
    >>>> If you care about readability it should be:
    >>>> ((((pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
    >>>
    >>>
    >>> Isn't this exactly what the patch is doing? -R ???
    >>
    >>
    >> Current version is shifting pri out of uint16. If you examine parentheses:
    >> pri is shifted left 13, then 12.
    >> Original version did it right (shift 1, then 12 (total 13)).
    >>
    >
    > Hi Oleg,
    >
    > I see. The VLAN priority is then always zero after this change.
    >
    > I'll let Sepherosa handle the revert and/or readability update.
    >
    > --HPS
    
    
    
    -- 
    Tomorrow Will Never Die
    
    From owner-svn-src-head@freebsd.org  Fri May 19 01:23:08 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19F33D71C77;
     Fri, 19 May 2017 01:23:08 +0000 (UTC)
     (envelope-from truckman@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 C3AC3D9B;
     Fri, 19 May 2017 01:23:07 +0000 (UTC)
     (envelope-from truckman@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J1N6Jm036519;
     Fri, 19 May 2017 01:23:06 GMT (envelope-from truckman@FreeBSD.org)
    Received: (from truckman@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J1N699036517;
     Fri, 19 May 2017 01:23:06 GMT (envelope-from truckman@FreeBSD.org)
    Message-Id: <201705190123.v4J1N699036517@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: truckman set sender to
     truckman@FreeBSD.org using -f
    From: Don Lewis 
    Date: Fri, 19 May 2017 01:23:06 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318511 - head/sys/netpfil/ipfw
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 01:23:08 -0000
    
    Author: truckman
    Date: Fri May 19 01:23:06 2017
    New Revision: 318511
    URL: https://svnweb.freebsd.org/changeset/base/318511
    
    Log:
      The result of right shifting a negative signed value is implementation
      defined.  On machines without arithmetic shift instructions, zero bits
      may be shifted in from the left, giving a large positive result instead
      of the desired divide-by power-of-2.  Fix this by operating on the
      absolute value and compensating for the possible negation later.
      
      Reverse the order of the underflow/overflow tests and the exponential
      decay calculation to avoid the possibility of an erroneous overflow
      detection if p is a sufficiently small non-negative value.  Also
      check for negative values of prob before doing the exponential decay
      to avoid another instance of of right shifting a negative value.
      
      Tested by:	Rasool Al-Saadi 
      MFC after:	1 week
    
    Modified:
      head/sys/netpfil/ipfw/dn_aqm_pie.c
      head/sys/netpfil/ipfw/dn_sched_fq_pie.c
    
    Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c
    ==============================================================================
    --- head/sys/netpfil/ipfw/dn_aqm_pie.c	Fri May 19 00:43:49 2017	(r318510)
    +++ head/sys/netpfil/ipfw/dn_aqm_pie.c	Fri May 19 01:23:06 2017	(r318511)
    @@ -206,6 +206,7 @@ calculate_drop_prob(void *x)
     	int64_t p, prob, oldprob;
     	struct dn_aqm_pie_parms *pprms;
     	struct pie_status *pst = (struct pie_status *) x;
    +	int p_isneg;
     
     	pprms = pst->parms;
     	prob = pst->drop_prob;
    @@ -221,6 +222,12 @@ calculate_drop_prob(void *x)
     		((int64_t)pst->current_qdelay - (int64_t)pprms->qdelay_ref); 
     	p +=(int64_t) pprms->beta * 
     		((int64_t)pst->current_qdelay - (int64_t)pst->qdelay_old); 
    +
    +	/* take absolute value so right shift result is well defined */
    +	p_isneg = p < 0;
    +	if (p_isneg) {
    +		p = -p;
    +	}
     		
     	/* We PIE_MAX_PROB shift by 12-bits to increase the division precision */
     	p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S;
    @@ -243,37 +250,47 @@ calculate_drop_prob(void *x)
     
     	oldprob = prob;
     
    -	/* Cap Drop adjustment */
    -	if ((pprms->flags & PIE_CAPDROP_ENABLED) && prob >= PIE_MAX_PROB / 10
    -		&& p > PIE_MAX_PROB / 50 ) 
    -			p = PIE_MAX_PROB / 50;
    +	if (p_isneg) {
    +		prob = prob - p;
     
    -	prob = prob + p;
    -
    -	/* decay the drop probability exponentially */
    -	if (pst->current_qdelay == 0 && pst->qdelay_old == 0)
    -		/* 0.98 ~= 1- 1/64 */
    -		prob = prob - (prob >> 6); 
    +		/* check for multiplication underflow */
    +		if (prob > oldprob) {
    +			prob= 0;
    +			D("underflow");
    +		}
    +	} else {
    +		/* Cap Drop adjustment */
    +		if ((pprms->flags & PIE_CAPDROP_ENABLED) &&
    +		    prob >= PIE_MAX_PROB / 10 &&
    +		    p > PIE_MAX_PROB / 50 ) {
    +			p = PIE_MAX_PROB / 50;
    +		}
     
    +		prob = prob + p;
     
    -	/* check for multiplication overflow/underflow */
    -	if (p>0) {
    +		/* check for multiplication overflow */
     		if (proboldprob) {
    -			prob= 0;
    -			D("underflow");
    -		}
     
    -	/* make drop probability between 0 and PIE_MAX_PROB*/
    -	if (prob < 0)
    +	/*
    +	 * decay the drop probability exponentially
    +	 * and restrict it to range 0 to PIE_MAX_PROB
    +	 */
    +	if (prob < 0) {
     		prob = 0;
    -	else if (prob > PIE_MAX_PROB)
    -		prob = PIE_MAX_PROB;
    +	} else {
    +		if (pst->current_qdelay == 0 && pst->qdelay_old == 0) {
    +			/* 0.98 ~= 1- 1/64 */
    +			prob = prob - (prob >> 6); 
    +		}
    +
    +		if (prob > PIE_MAX_PROB) {
    +			prob = PIE_MAX_PROB;
    +		}
    +	}
     
     	pst->drop_prob = prob;
     	
    
    Modified: head/sys/netpfil/ipfw/dn_sched_fq_pie.c
    ==============================================================================
    --- head/sys/netpfil/ipfw/dn_sched_fq_pie.c	Fri May 19 00:43:49 2017	(r318510)
    +++ head/sys/netpfil/ipfw/dn_sched_fq_pie.c	Fri May 19 01:23:06 2017	(r318511)
    @@ -377,6 +377,7 @@ fq_calculate_drop_prob(void *x)
     	struct dn_aqm_pie_parms *pprms; 
     	int64_t p, prob, oldprob;
     	aqm_time_t now;
    +	int p_isneg;
     
     	now = AQM_UNOW;
     	pprms = pst->parms;
    @@ -393,6 +394,12 @@ fq_calculate_drop_prob(void *x)
     		((int64_t)pst->current_qdelay - (int64_t)pprms->qdelay_ref); 
     	p +=(int64_t) pprms->beta * 
     		((int64_t)pst->current_qdelay - (int64_t)pst->qdelay_old); 
    +
    +	/* take absolute value so right shift result is well defined */
    +	p_isneg = p < 0;
    +	if (p_isneg) {
    +		p = -p;
    +	}
     		
     	/* We PIE_MAX_PROB shift by 12-bits to increase the division precision  */
     	p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S;
    @@ -415,37 +422,47 @@ fq_calculate_drop_prob(void *x)
     
     	oldprob = prob;
     
    -	/* Cap Drop adjustment */
    -	if ((pprms->flags & PIE_CAPDROP_ENABLED) && prob >= PIE_MAX_PROB / 10
    -		&& p > PIE_MAX_PROB / 50 ) 
    -			p = PIE_MAX_PROB / 50;
    +	if (p_isneg) {
    +		prob = prob - p;
     
    -	prob = prob + p;
    -
    -	/* decay the drop probability exponentially */
    -	if (pst->current_qdelay == 0 && pst->qdelay_old == 0)
    -		/* 0.98 ~= 1- 1/64 */
    -		prob = prob - (prob >> 6); 
    +		/* check for multiplication underflow */
    +		if (prob > oldprob) {
    +			prob= 0;
    +			D("underflow");
    +		}
    +	} else {
    +		/* Cap Drop adjustment */
    +		if ((pprms->flags & PIE_CAPDROP_ENABLED) &&
    +		    prob >= PIE_MAX_PROB / 10 &&
    +		    p > PIE_MAX_PROB / 50 ) {
    +			p = PIE_MAX_PROB / 50;
    +		}
     
    +		prob = prob + p;
     
    -	/* check for multiplication over/under flow */
    -	if (p>0) {
    +		/* check for multiplication overflow */
     		if (proboldprob) {
    -			prob= 0;
    -			D("underflow");
    -		}
     
    -	/* make drop probability between 0 and PIE_MAX_PROB*/
    -	if (prob < 0)
    +	/*
    +	 * decay the drop probability exponentially
    +	 * and restrict it to range 0 to PIE_MAX_PROB
    +	 */
    +	if (prob < 0) {
     		prob = 0;
    -	else if (prob > PIE_MAX_PROB)
    -		prob = PIE_MAX_PROB;
    +	} else {
    +		if (pst->current_qdelay == 0 && pst->qdelay_old == 0) {
    +			/* 0.98 ~= 1- 1/64 */
    +			prob = prob - (prob >> 6); 
    +		}
    +
    +		if (prob > PIE_MAX_PROB) {
    +			prob = PIE_MAX_PROB;
    +		}
    +	}
     
     	pst->drop_prob = prob;
     	
    
    From owner-svn-src-head@freebsd.org  Fri May 19 01:42:33 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34C5FD743EC;
     Fri, 19 May 2017 01:42:33 +0000 (UTC)
     (envelope-from sephe@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 05194191D;
     Fri, 19 May 2017 01:42:32 +0000 (UTC)
     (envelope-from sephe@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J1gW8w044603;
     Fri, 19 May 2017 01:42:32 GMT (envelope-from sephe@FreeBSD.org)
    Received: (from sephe@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J1gWKn044602;
     Fri, 19 May 2017 01:42:32 GMT (envelope-from sephe@FreeBSD.org)
    Message-Id: <201705190142.v4J1gWKn044602@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: sephe set sender to
     sephe@FreeBSD.org using -f
    From: Sepherosa Ziehau 
    Date: Fri, 19 May 2017 01:42:32 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318512 - head/sys/net
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 01:42:33 -0000
    
    Author: sephe
    Date: Fri May 19 01:42:31 2017
    New Revision: 318512
    URL: https://svnweb.freebsd.org/changeset/base/318512
    
    Log:
      net/vlan: Revert 305177
      
      Miss read the parentheses.
      
      Reported by:	oleg@
      Reviewed by:	hps@
      MFC after:	3 days
      Sponsored by:	Microsoft
    
    Modified:
      head/sys/net/ethernet.h
    
    Modified: head/sys/net/ethernet.h
    ==============================================================================
    --- head/sys/net/ethernet.h	Fri May 19 01:23:06 2017	(r318511)
    +++ head/sys/net/ethernet.h	Fri May 19 01:42:31 2017	(r318512)
    @@ -92,7 +92,7 @@ struct ether_vlan_header {
     #define	EVL_PRIOFTAG(tag)	(((tag) >> 13) & 7)
     #define	EVL_CFIOFTAG(tag)	(((tag) >> 12) & 1)
     #define	EVL_MAKETAG(vlid, pri, cfi)					\
    -	((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
    +	((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
     
     /*
      *  NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
    
    From owner-svn-src-head@freebsd.org  Fri May 19 04:44:16 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 353D2D72A59;
     Fri, 19 May 2017 04:44:16 +0000 (UTC)
     (envelope-from delphij@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 0240712D7;
     Fri, 19 May 2017 04:44:15 +0000 (UTC)
     (envelope-from delphij@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J4iEpW018397;
     Fri, 19 May 2017 04:44:14 GMT (envelope-from delphij@FreeBSD.org)
    Received: (from delphij@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J4iEJ1018396;
     Fri, 19 May 2017 04:44:14 GMT (envelope-from delphij@FreeBSD.org)
    Message-Id: <201705190444.v4J4iEJ1018396@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: delphij set sender to
     delphij@FreeBSD.org using -f
    From: Xin LI 
    Date: Fri, 19 May 2017 04:44:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318514 - head/lib/libc/stdlib
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 04:44:16 -0000
    
    Author: delphij
    Date: Fri May 19 04:44:14 2017
    New Revision: 318514
    URL: https://svnweb.freebsd.org/changeset/base/318514
    
    Log:
      Use size_t.
      
      Inspired by:	OpenBSD src/lib/libc/stdlib/qsort.c,v 1.11
    
    Modified:
      head/lib/libc/stdlib/qsort.c
    
    Modified: head/lib/libc/stdlib/qsort.c
    ==============================================================================
    --- head/lib/libc/stdlib/qsort.c	Fri May 19 02:12:10 2017	(r318513)
    +++ head/lib/libc/stdlib/qsort.c	Fri May 19 04:44:14 2017	(r318514)
    @@ -41,7 +41,7 @@ typedef int		 cmp_t(void *, const void *
     typedef int		 cmp_t(const void *, const void *);
     #endif
     static inline char	*med3(char *, char *, char *, cmp_t *, void *);
    -static inline void	 swapfunc(char *, char *, int, int, int);
    +static inline void	 swapfunc(char *, char *, size_t, int, int);
     
     #define	MIN(a, b)	((a) < (b) ? a : b)
     
    @@ -49,7 +49,7 @@ static inline void	 swapfunc(char *, cha
      * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
      */
     #define	swapcode(TYPE, parmi, parmj, n) {		\
    -	long i = (n) / sizeof (TYPE);			\
    +	size_t i = (n) / sizeof (TYPE);			\
     	TYPE *pi = (TYPE *) (parmi);		\
     	TYPE *pj = (TYPE *) (parmj);		\
     	do { 						\
    @@ -64,7 +64,7 @@ static inline void	 swapfunc(char *, cha
     	es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1;
     
     static inline void
    -swapfunc( char *a, char *b, int n, int swaptype_long, int swaptype_int)
    +swapfunc(char *a, char *b, size_t n, int swaptype_long, int swaptype_int)
     {
     	if (swaptype_long <= 1)
     		swapcode(long, a, b, n)
    
    From owner-svn-src-head@freebsd.org  Fri May 19 04:59:13 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id A144DD72DC4;
     Fri, 19 May 2017 04:59:13 +0000 (UTC)
     (envelope-from delphij@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 4CDF717B4;
     Fri, 19 May 2017 04:59:13 +0000 (UTC)
     (envelope-from delphij@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J4xCGw022615;
     Fri, 19 May 2017 04:59:12 GMT (envelope-from delphij@FreeBSD.org)
    Received: (from delphij@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J4xCqq022614;
     Fri, 19 May 2017 04:59:12 GMT (envelope-from delphij@FreeBSD.org)
    Message-Id: <201705190459.v4J4xCqq022614@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: delphij set sender to
     delphij@FreeBSD.org using -f
    From: Xin LI 
    Date: Fri, 19 May 2017 04:59:12 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318515 - head/lib/libc/stdlib
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 04:59:13 -0000
    
    Author: delphij
    Date: Fri May 19 04:59:12 2017
    New Revision: 318515
    URL: https://svnweb.freebsd.org/changeset/base/318515
    
    Log:
      The current qsort(3) implementation ignores the sizes of partitions, and
      always perform recursion on the left partition, then use a tail call to
      handle the right partition.  In the worst case this could require O(N)
      levels of recursions.
      
      Reduce the possible recursion level to log2(N) by always recursing on the
      smaller partition instead.
      
      Obtained from:	PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096
    
    Modified:
      head/lib/libc/stdlib/qsort.c
    
    Modified: head/lib/libc/stdlib/qsort.c
    ==============================================================================
    --- head/lib/libc/stdlib/qsort.c	Fri May 19 04:44:14 2017	(r318514)
    +++ head/lib/libc/stdlib/qsort.c	Fri May 19 04:59:12 2017	(r318515)
    @@ -117,7 +117,7 @@ qsort(void *a, size_t n, size_t es, cmp_
     #endif
     {
     	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
    -	size_t d, r;
    +	size_t d1, d2;
     	int cmp_result;
     	int swaptype_long, swaptype_int, swap_cnt;
     
    @@ -137,7 +137,8 @@ loop:	SWAPINIT(long, a, es);
     		pl = a;
     		pn = (char *)a + (n - 1) * es;
     		if (n > 40) {
    -			d = (n / 8) * es;
    +			size_t d = (n / 8) * es;
    +
     			pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
     			pm = med3(pm - d, pm, pm + d, cmp, thunk);
     			pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
    @@ -182,21 +183,43 @@ loop:	SWAPINIT(long, a, es);
     	}
     
     	pn = (char *)a + n * es;
    -	r = MIN(pa - (char *)a, pb - pa);
    -	vecswap(a, pb - r, r);
    -	r = MIN(pd - pc, pn - pd - es);
    -	vecswap(pb, pn - r, r);
    -	if ((r = pb - pa) > es)
    +	d1 = MIN(pa - (char *)a, pb - pa);
    +	vecswap(a, pb - d1, d1);
    +	d1 = MIN(pd - pc, pn - pd - es);
    +	vecswap(pb, pn - d1, d1);
    +
    +	d1 = pb - pa;
    +	d2 = pd - pc;
    +	if (d1 <= d2) {
    +		/* Recurse on left partition, then iterate on right partition */
    +		if (d1 > es) {
     #ifdef I_AM_QSORT_R
    -		qsort_r(a, r / es, es, thunk, cmp);
    +			qsort_r(a, d1 / es, es, thunk, cmp);
     #else
    -		qsort(a, r / es, es, cmp);
    +			qsort(a, d1 / es, es, cmp);
     #endif
    -	if ((r = pd - pc) > es) {
    -		/* Iterate rather than recurse to save stack space */
    -		a = pn - r;
    -		n = r / es;
    -		goto loop;
    +		}
    +		if (d2 > es) {
    +			/* Iterate rather than recurse to save stack space */
    +			/* qsort(pn - d2, d2 / es, es, cmp); */
    +			a = pn - d2;
    +			n = d2 / es;
    +			goto loop;
    +		}
    +	} else {
    +		/* Recurse on right partition, then iterate on left partition */
    +		if (d2 > es) {
    +#ifdef I_AM_QSORT_R
    +			qsort_r(pn - d2, d2 / es, es, thunk, cmp);
    +#else
    +			qsort(pn - d2, d2 / es, es, cmp);
    +#endif
    +		}
    +		if (d1 > es) {
    +			/* Iterate rather than recurse to save stack space */
    +			/* qsort(a, d1 / es, es, cmp); */
    +			n = d1 / es;
    +			goto loop;
    +		}
     	}
    -/*		qsort(pn - r, r / es, es, cmp);*/
     }
    
    From owner-svn-src-head@freebsd.org  Fri May 19 05:12:59 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F838D733C4;
     Fri, 19 May 2017 05:12:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6ED9B84;
     Fri, 19 May 2017 05:12:59 +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 v4J5CwbH030583;
     Fri, 19 May 2017 05:12:58 GMT (envelope-from mav@FreeBSD.org)
    Received: (from mav@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J5Cwgf030582;
     Fri, 19 May 2017 05:12:58 GMT (envelope-from mav@FreeBSD.org)
    Message-Id: <201705190512.v4J5Cwgf030582@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
     using -f
    From: Alexander Motin 
    Date: Fri, 19 May 2017 05:12:58 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318516 -
     head/cddl/contrib/opensolaris/lib/libzpool/common
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 05:12:59 -0000
    
    Author: mav
    Date: Fri May 19 05:12:58 2017
    New Revision: 318516
    URL: https://svnweb.freebsd.org/changeset/base/318516
    
    Log:
      Fix time handling in cv_timedwait_hires().
      
      pthread_cond_timedwait() receives absolute time, not relative.  Passing
      wrong time there caused two threads of zdb to spin in a tight loop.
      
      MFC after:	1 week
    
    Modified:
      head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
    
    Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
    ==============================================================================
    --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c	Fri May 19 04:59:12 2017	(r318515)
    +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c	Fri May 19 05:12:58 2017	(r318516)
    @@ -368,7 +368,7 @@ cv_timedwait_hires(kcondvar_t *cv, kmute
         int flag)
     {
     	int error;
    -	timestruc_t ts;
    +	timespec_t ts;
     	hrtime_t delta;
     
     	ASSERT(flag == 0 || flag == CALLOUT_FLAG_ABSOLUTE);
    @@ -381,8 +381,13 @@ top:
     	if (delta <= 0)
     		return (-1);
     
    -	ts.tv_sec = delta / NANOSEC;
    -	ts.tv_nsec = delta % NANOSEC;
    +	clock_gettime(CLOCK_REALTIME, &ts);
    +	ts.tv_sec += delta / NANOSEC;
    +	ts.tv_nsec += delta % NANOSEC;
    +	if (ts.tv_nsec >= NANOSEC) {
    +		ts.tv_sec++;
    +		ts.tv_nsec -= NANOSEC;
    +	}
     
     	ASSERT(mutex_owner(mp) == curthread);
     	mp->m_owner = NULL;
    
    From owner-svn-src-head@freebsd.org  Fri May 19 06:37:17 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F5F2D74ACD;
     Fri, 19 May 2017 06:37:17 +0000 (UTC)
     (envelope-from delphij@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 2C7D29C5;
     Fri, 19 May 2017 06:37:17 +0000 (UTC)
     (envelope-from delphij@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J6bGc0062717;
     Fri, 19 May 2017 06:37:16 GMT (envelope-from delphij@FreeBSD.org)
    Received: (from delphij@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J6bG4s062716;
     Fri, 19 May 2017 06:37:16 GMT (envelope-from delphij@FreeBSD.org)
    Message-Id: <201705190637.v4J6bG4s062716@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: delphij set sender to
     delphij@FreeBSD.org using -f
    From: Xin LI 
    Date: Fri, 19 May 2017 06:37:16 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318517 - head/sys/libkern
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 06:37:17 -0000
    
    Author: delphij
    Date: Fri May 19 06:37:16 2017
    New Revision: 318517
    URL: https://svnweb.freebsd.org/changeset/base/318517
    
    Log:
      Sync qsort.c with userland r318515.
      
      (Note that MIN macro is removed in favor of sys/param.h's version).
      
      PR:		213922
    
    Modified:
      head/sys/libkern/qsort.c
    
    Modified: head/sys/libkern/qsort.c
    ==============================================================================
    --- head/sys/libkern/qsort.c	Fri May 19 05:12:58 2017	(r318516)
    +++ head/sys/libkern/qsort.c	Fri May 19 06:37:16 2017	(r318517)
    @@ -33,51 +33,57 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    -#ifdef	I_AM_QSORT_R
    -typedef int		cmp_t(void *, const void *, const void *);
    +#ifdef I_AM_QSORT_R
    +typedef int		 cmp_t(void *, const void *, const void *);
     #else
    -typedef int		cmp_t(const void *, const void *);
    +typedef int		 cmp_t(const void *, const void *);
     #endif
    -static __inline char	*med3(char *, char *, char *, cmp_t *, void *);
    -static __inline void	 swapfunc(char *, char *, int, int);
    -
    -#define min(a, b)	(a) < (b) ? (a) : (b)
    +static inline char	*med3(char *, char *, char *, cmp_t *, void *);
    +static inline void	 swapfunc(char *, char *, size_t, int, int);
     
     /*
      * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
      */
    -#define swapcode(TYPE, parmi, parmj, n) { 		\
    -	long i = (n) / sizeof (TYPE); 			\
    -	TYPE *pi = (TYPE *) (parmi); 			\
    -	TYPE *pj = (TYPE *) (parmj); 			\
    +#define	swapcode(TYPE, parmi, parmj, n) {		\
    +	size_t i = (n) / sizeof (TYPE);			\
    +	TYPE *pi = (TYPE *) (parmi);		\
    +	TYPE *pj = (TYPE *) (parmj);		\
     	do { 						\
    -		TYPE	t = *pi;			\
    +		TYPE	t = *pi;		\
     		*pi++ = *pj;				\
     		*pj++ = t;				\
    -        } while (--i > 0);				\
    +	} while (--i > 0);				\
     }
     
    -#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
    -	es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
    +#define	SWAPINIT(TYPE, a, es) swaptype_ ## TYPE =	\
    +	((char *)a - (char *)0) % sizeof(TYPE) ||	\
    +	es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1;
     
    -static __inline void
    -swapfunc(char *a, char *b, int n, int swaptype)
    +static inline void
    +swapfunc(char *a, char *b, size_t n, int swaptype_long, int swaptype_int)
     {
    -	if(swaptype <= 1)
    +	if (swaptype_long <= 1)
     		swapcode(long, a, b, n)
    +	else if (swaptype_int <= 1)
    +		swapcode(int, a, b, n)
     	else
     		swapcode(char, a, b, n)
     }
     
    -#define swap(a, b)					\
    -	if (swaptype == 0) {				\
    +#define	swap(a, b)					\
    +	if (swaptype_long == 0) {			\
     		long t = *(long *)(a);			\
     		*(long *)(a) = *(long *)(b);		\
     		*(long *)(b) = t;			\
    +	} else if (swaptype_int == 0) {			\
    +		int t = *(int *)(a);			\
    +		*(int *)(a) = *(int *)(b);		\
    +		*(int *)(b) = t;			\
     	} else						\
    -		swapfunc(a, b, es, swaptype)
    +		swapfunc(a, b, es, swaptype_long, swaptype_int)
     
    -#define vecswap(a, b, n) 	if ((n) > 0) swapfunc(a, b, n, swaptype)
    +#define	vecswap(a, b, n)				\
    +	if ((n) > 0) swapfunc(a, b, n, swaptype_long, swaptype_int)
     
     #ifdef I_AM_QSORT_R
     #define	CMP(t, x, y) (cmp((t), (x), (y)))
    @@ -85,16 +91,16 @@ swapfunc(char *a, char *b, int n, int sw
     #define	CMP(t, x, y) (cmp((x), (y)))
     #endif
     
    -static __inline char *
    +static inline char *
     med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk
    -#ifndef	I_AM_QSORT_R
    +#ifndef I_AM_QSORT_R
     __unused
     #endif
     )
     {
     	return CMP(thunk, a, b) < 0 ?
     	       (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
    -              :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
    +	      :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
     }
     
     #ifdef I_AM_QSORT_R
    @@ -107,13 +113,17 @@ qsort(void *a, size_t n, size_t es, cmp_
     #endif
     {
     	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
    -	int d, r, swaptype, swap_cnt;
    +	size_t d1, d2;
    +	int cmp_result;
    +	int swaptype_long, swaptype_int, swap_cnt;
     
    -loop:	SWAPINIT(a, es);
    +loop:	SWAPINIT(long, a, es);
    +	SWAPINIT(int, a, es);
     	swap_cnt = 0;
     	if (n < 7) {
     		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
    -			for (pl = pm; pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
    +			for (pl = pm; 
    +			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
     			     pl -= es)
     				swap(pl, pl - es);
     		return;
    @@ -123,7 +133,8 @@ loop:	SWAPINIT(a, es);
     		pl = a;
     		pn = (char *)a + (n - 1) * es;
     		if (n > 40) {
    -			d = (n / 8) * es;
    +			size_t d = (n / 8) * es;
    +
     			pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
     			pm = med3(pm - d, pm, pm + d, cmp, thunk);
     			pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
    @@ -135,16 +146,16 @@ loop:	SWAPINIT(a, es);
     
     	pc = pd = (char *)a + (n - 1) * es;
     	for (;;) {
    -		while (pb <= pc && (r = CMP(thunk, pb, a)) <= 0) {
    -			if (r == 0) {
    +		while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) {
    +			if (cmp_result == 0) {
     				swap_cnt = 1;
     				swap(pa, pb);
     				pa += es;
     			}
     			pb += es;
     		}
    -		while (pb <= pc && (r = CMP(thunk, pc, a)) >= 0) {
    -			if (r == 0) {
    +		while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) {
    +			if (cmp_result == 0) {
     				swap_cnt = 1;
     				swap(pc, pd);
     				pd -= es;
    @@ -160,27 +171,51 @@ loop:	SWAPINIT(a, es);
     	}
     	if (swap_cnt == 0) {  /* Switch to insertion sort */
     		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
    -			for (pl = pm; pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
    +			for (pl = pm; 
    +			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
     			     pl -= es)
     				swap(pl, pl - es);
     		return;
     	}
     
     	pn = (char *)a + n * es;
    -	r = min(pa - (char *)a, pb - pa);
    -	vecswap(a, pb - r, r);
    -	r = min(pd - pc, pn - pd - es);
    -	vecswap(pb, pn - r, r);
    -	if ((r = pb - pa) > es)
    -#ifdef	I_AM_QSORT_R
    -		qsort_r(a, r / es, es, thunk, cmp);
    +	d1 = MIN(pa - (char *)a, pb - pa);
    +	vecswap(a, pb - d1, d1);
    +	d1 = MIN(pd - pc, pn - pd - es);
    +	vecswap(pb, pn - d1, d1);
    +
    +	d1 = pb - pa;
    +	d2 = pd - pc;
    +	if (d1 <= d2) {
    +		/* Recurse on left partition, then iterate on right partition */
    +		if (d1 > es) {
    +#ifdef I_AM_QSORT_R
    +			qsort_r(a, d1 / es, es, thunk, cmp);
     #else
    -		qsort(a, r / es, es, cmp);
    +			qsort(a, d1 / es, es, cmp);
     #endif
    -	if ((r = pd - pc) > es) {
    -		/* Iterate rather than recurse to save stack space */
    -		a = pn - r;
    -		n = r / es;
    -		goto loop;
    +		}
    +		if (d2 > es) {
    +			/* Iterate rather than recurse to save stack space */
    +			/* qsort(pn - d2, d2 / es, es, cmp); */
    +			a = pn - d2;
    +			n = d2 / es;
    +			goto loop;
    +		}
    +	} else {
    +		/* Recurse on right partition, then iterate on left partition */
    +		if (d2 > es) {
    +#ifdef I_AM_QSORT_R
    +			qsort_r(pn - d2, d2 / es, es, thunk, cmp);
    +#else
    +			qsort(pn - d2, d2 / es, es, cmp);
    +#endif
    +		}
    +		if (d1 > es) {
    +			/* Iterate rather than recurse to save stack space */
    +			/* qsort(a, d1 / es, es, cmp); */
    +			n = d1 / es;
    +			goto loop;
    +		}
     	}
     }
    
    From owner-svn-src-head@freebsd.org  Fri May 19 06:43:24 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7238D74CC7;
     Fri, 19 May 2017 06:43:24 +0000 (UTC)
     (envelope-from julian@freebsd.org)
    Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client CN "vps1.elischer.org",
     Issuer "CA Cert Signing Authority" (not verified))
     by mx1.freebsd.org (Postfix) with ESMTPS id C1C2EE95;
     Fri, 19 May 2017 06:43:24 +0000 (UTC)
     (envelope-from julian@freebsd.org)
    Received: from Julian-MBP3.local (106-68-200-20.dyn.iinet.net.au
     [106.68.200.20]) (authenticated bits=0)
     by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v4J6h9FH070441
     (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
     Thu, 18 May 2017 23:43:13 -0700 (PDT)
     (envelope-from julian@freebsd.org)
    Subject: Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d
     etc/syslog.d tools/build/mk
    To: Ian Lepore , John Baldwin 
    References: <201705131537.v4DFbgWV045290@pdx.rh.CN85.dnsmgr.net>
     <2229085.lB46rKsq7o@ralph.baldwin.cx>
     <1494870201.59865.103.camel@freebsd.org>
     <4703731.Pl02uSWy7k@ralph.baldwin.cx>
     <1494879113.59865.129.camel@freebsd.org>
    Cc: Warner Losh , Ngie Cooper ,
     "Rodney W. Grimes" , Ngie Cooper ,
     src-committers ,
     "svn-src-all@freebsd.org" ,
     "svn-src-head@freebsd.org" 
    From: Julian Elischer 
    Message-ID: <82ddf34c-9180-f84d-3534-2b4489996aee@freebsd.org>
    Date: Fri, 19 May 2017 14:43:04 +0800
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0)
     Gecko/20100101 Thunderbird/45.8.0
    MIME-Version: 1.0
    In-Reply-To: <1494879113.59865.129.camel@freebsd.org>
    Content-Type: text/plain; charset=windows-1252; format=flowed
    Content-Transfer-Encoding: 7bit
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 19 May 2017 06:43:25 -0000
    
    On 16/5/17 4:11 am, Ian Lepore wrote:
    > On Mon, 2017-05-15 at 12:22 -0700, John Baldwin wrote:
    >> On Monday, May 15, 2017 11:43:21 AM Ian Lepore wrote:
    >>> On Mon, 2017-05-15 at 10:13 -0700, John Baldwin wrote:
    >>>> On Saturday, May 13, 2017 10:39:15 AM Warner Losh wrote:
    >>>>>
    >>>>>>
    >>>>>>>
    >>>>>>> - It's really easy to screw up a mergemaster call if you
    >>>>>>> edit
    >>>>>>> the files, and install the stock version which removes the
    >>>>>>> edits.
    >>>>>> Also, programmatically removing the entries means you have to
    >>>>>> bake the metadata into etc/Makefile, which is already
    >>>>>> complicated
    >>>>>> enough as-is.
    >>>>> Why do you care about removing them at all? They are no-ops if
    >>>>> the
    >>>>> files don't exist. Why not just always install all these files
    >>>>> is
    >>>>> where I'm going with this...
    >>>> I think this is actually the bigger question.  I think it is
    >>>> perfectly
    >>>> sensible to support conf.d/* files for ports to use and as a way
    >>>> to
    >>>> manage logs for application logs on an appliance, etc.  However,
    >>>> this
    >>>> shuffling is a bit of a merge nightmare for anyone using
    >>>> mergemaster
    >>>> or etcupdate, and the biggest cost is that newsyslog will create
    >>>> a
    >>>> one-line file in /var/log for entries with 'C'.
    >>>>
    >>> That's only a good argument for keeping the lines in the monolithic
    >>> file if those lines will be ignored when a file in the .conf.d
    >>> directory provides conflicting config.  Otherwise my embedded
    >>> product
    >>> that drops different rules for rotating /var/log/messages into
    >>> .conf.d
    >>> STILL has to programmatically edit the monolithic file to remove
    >>> the
    >>> standard rule(s).
    >> Now you have to programmatically edit the file in
    >> conf.d/foo.  However,
    >> by this argument the monolithic conf file shouldn't even exist.  The
    >> current approach is a half-way mix with the worst of both models it
    >> seems.
    >>
    > Programmatically editing a single file containing only config for a
    > single component typically means just rewriting the entire file with
    > your new contents.  In particular, you don't need to attempt to
    > preserve other information, the format of which you may not even know,
    > including free-form comments and who knows what-else.
    >
    >> Also, _you_ could just splat an empty /etc/newsyslog.conf file on
    >> your
    >> appliance and create a bunch of conf.d/foo files if that is easier
    >> for
    >> you to use on an appliance.  The files we ship in a release aren't
    >> really
    >> tailored for an appliance (I've yet to see an appliance that doesn't
    >> use
    >> a FooBSD with local patches).  OTOH, the existing setup is probably
    >> simpler to manage for an out-of-the-box install.
    >>
    >> I'm also suprised you don't manage the newsyslog.conf file yourself
    >> rather than trying to edit and merge in upstream changes?  That is, I
    >> can see a few approaches:
    >>
    > You seem to be picturing some sort of etcupdate kind of thing.  I'm
    > more talking about a GUI or other config-management tool within an
    > embedded product that has to edit or rewrite configuration on the fly
    > based on user choices.
    >
    > Of course, separate files does also simplify the update process, for
    > the most part.  If a new subsystem is added in a new freebsd release, I
    > have zero work to do to upgrade a system in the field if that new
    > subsystem just drops a new file into a .conf.d directory.  If it has
    > new entries in a monolithic file, then I do have to do some sort of
    > merge/edit operation.
    >
    >> 1) Keep your real newsyslog.conf / syslogd.conf files in your
    >> FooBSD's
    >>     VCS and when newsyslog.conf changes upstream you merge that in the
    >>     way you normally merge changes.
    >>
    >> 2) Move the "vendor" newsyslog.conf out entirely and install your own
    >>     versions of these files either as a monolithic assembled by config
    >>     management rules or a bunch of conf.d/foo files (here I would
    >> probably
    >>     opt for separate files).
    >>
    >> However, your approach doesn't seem to describe either of these since
    >> this commit doesn't impact those work flows (if 1), you would have
    >> already
    >> made any local changes you need and if anything merging this commit
    >> gives
    >> you the kind of merge conflicts people will get on the next
    >> mergemaster /
    >> etcupdate for non-appliance boxes, or if 2) you ignore these files)
    >>
    > This seems to be an argument for everyone doing for themselves the
    > operation of splitting the distributed monolithic file into finer
    > grained files, and re-performing that operation (or at least the
    > analysis part of it) on every update.
    We (Panzura) use the directory /etc/newsyslog.conf.d and have a separate
    panzura.conf in there that we write out in one hit with all our log 
    files in it.
    we rewrite it all (from our internal metadata) if it needs to change.
    We also have individual files for optional components that do their 
    own logging,
    so it is definitely important to us to have the ability to do the 
    small files but I don't
    really see a need to have a bunch of files for standard log files.
    I think files should be grouped in "installable unit" atomicity.
    and at this time the installable unit for the base system is the 
    entire base unit..
    
    Now when 'pkgbase' hist and we install our system from N separate pkg 
    units the
    argument will be different. It also needs to be decided what happens 
    it multipl modules
    use a shared file, or a single pkg has different options that require 
    different log files..
    > In general a lot of this feels like "I only needed 6 big config files
    > to control my whole system in 1988, and so I should only need those
    > same 6 files now."  Sure, all us old-timers have the finger memory for
    > editing rc.conf and syslog.conf and so on, but how often do you crack
    > open syslog.conf with the plan of editing 12 different lines in it at
    > once?  Because the main objection to .conf.d directories seems to be
    > that there are more files to edit, and that just doesn't feel like a
    > big problem in actual daily use.
    >
    > -- Ian
    >
    >
    
    
    From owner-svn-src-head@freebsd.org  Fri May 19 08:11:16 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6260D74BE2;
     Fri, 19 May 2017 08:11:16 +0000 (UTC)
     (envelope-from royger@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 77A5A1901;
     Fri, 19 May 2017 08:11:16 +0000 (UTC)
     (envelope-from royger@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J8BF7m000558;
     Fri, 19 May 2017 08:11:15 GMT (envelope-from royger@FreeBSD.org)
    Received: (from royger@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J8BFve000557;
     Fri, 19 May 2017 08:11:15 GMT (envelope-from royger@FreeBSD.org)
    Message-Id: <201705190811.v4J8BFve000557@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: royger set sender to
     royger@FreeBSD.org using -f
    From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= 
    Date: Fri, 19 May 2017 08:11:15 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318520 - head/sys/dev/xen/blkfront
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 08:11:16 -0000
    
    Author: royger
    Date: Fri May 19 08:11:15 2017
    New Revision: 318520
    URL: https://svnweb.freebsd.org/changeset/base/318520
    
    Log:
      xen/blkfront: correctly detach a disk with active users
      
      Call disk_gone when the backend switches to the "Closing" state and blkfront
      still has pending users. This allows the disk to be detached, and will call
      into xbd_closing by itself when the geom layout cleanup has finished.
      
      Reported by:		bapt
      Tested by:		manu
      Reviewed by:		bapt
      Sponsored by:		Citrix Systems R&D
      MFC after:		1 week
      Differential revision:	https://reviews.freebsd.org/D10772
    
    Modified:
      head/sys/dev/xen/blkfront/blkfront.c
    
    Modified: head/sys/dev/xen/blkfront/blkfront.c
    ==============================================================================
    --- head/sys/dev/xen/blkfront/blkfront.c	Fri May 19 07:31:48 2017	(r318519)
    +++ head/sys/dev/xen/blkfront/blkfront.c	Fri May 19 08:11:15 2017	(r318520)
    @@ -1578,11 +1578,14 @@ xbd_backend_changed(device_t dev, Xenbus
     		break;
     
     	case XenbusStateClosing:
    -		if (sc->xbd_users > 0)
    -			xenbus_dev_error(dev, -EBUSY,
    -			    "Device in use; refusing to close");
    -		else
    +		if (sc->xbd_users > 0) {
    +			device_printf(dev, "detaching with pending users\n");
    +			KASSERT(sc->xbd_disk != NULL,
    +			    ("NULL disk with pending users\n"));
    +			disk_gone(sc->xbd_disk);
    +		} else {
     			xbd_closing(dev);
    +		}
     		break;	
     	}
     }
    
    From owner-svn-src-head@freebsd.org  Fri May 19 08:16:48 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5B81D74CA6;
     Fri, 19 May 2017 08:16:48 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 8F6001CDA;
     Fri, 19 May 2017 08:16:48 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J8GlxD002882;
     Fri, 19 May 2017 08:16:47 GMT (envelope-from wma@FreeBSD.org)
    Received: (from wma@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J8GlaH002881;
     Fri, 19 May 2017 08:16:47 GMT (envelope-from wma@FreeBSD.org)
    Message-Id: <201705190816.v4J8GlaH002881@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org
     using -f
    From: Wojciech Macek 
    Date: Fri, 19 May 2017 08:16:47 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318521 - head/sys/dev/etherswitch/e6000sw
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 08:16:48 -0000
    
    Author: wma
    Date: Fri May 19 08:16:47 2017
    New Revision: 318521
    URL: https://svnweb.freebsd.org/changeset/base/318521
    
    Log:
      Improve busy-wait loop during switch phy access in e6000sw
      
      Hitherto implementation of PHY polling resulted in a risk of an
      endless loop and very high occupation of the SMI bus. Improve the
      operation by limiting the polling tries and adding sleepable
      pause.
      
      Submitted by: Marcin Wojtas 
      Obtained from: Semihalf
      Sponsored by: Stormshield
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10713
    
    Modified:
      head/sys/dev/etherswitch/e6000sw/e6000sw.c
    
    Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c
    ==============================================================================
    --- head/sys/dev/etherswitch/e6000sw/e6000sw.c	Fri May 19 08:11:15 2017	(r318520)
    +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c	Fri May 19 08:16:47 2017	(r318521)
    @@ -431,13 +431,21 @@ out_fail:
     	return (err);
     }
     
    -static __inline void
    +static __inline int
     e6000sw_poll_done(e6000sw_softc_t *sc)
     {
    +	int i;
    +
    +	for (i = 0; i < 16; i++) {
    +
    +		if (!(e6000sw_readreg(sc, REG_GLOBAL2, PHY_CMD) &
    +		    (1 << PHY_CMD_SMI_BUSY)))
    +			return (0);
     
    -	while (e6000sw_readreg(sc, REG_GLOBAL2, PHY_CMD) &
    -	    (1 << PHY_CMD_SMI_BUSY))
    -		continue;
    +		pause("e6000sw PHY poll", hz/1000);
    +	}
    +
    +	return (ETIMEDOUT);
     }
     
     /*
    @@ -449,6 +457,7 @@ e6000sw_readphy(device_t dev, int phy, i
     {
     	e6000sw_softc_t *sc;
     	uint32_t val;
    +	int err;
     
     	sc = device_get_softc(dev);
     	val = 0;
    @@ -460,14 +469,25 @@ e6000sw_readphy(device_t dev, int phy, i
     
     	E6000SW_LOCK_ASSERT(sc, SA_XLOCKED);
     
    -	e6000sw_poll_done(sc);
    +	err = e6000sw_poll_done(sc);
    +	if (err != 0) {
    +		device_printf(dev, "Timeout while waiting for switch\n");
    +		return (err);
    +	}
    +
     	val |= 1 << PHY_CMD_SMI_BUSY;
     	val |= PHY_CMD_MODE_MDIO << PHY_CMD_MODE;
     	val |= PHY_CMD_OPCODE_READ << PHY_CMD_OPCODE;
     	val |= (reg << PHY_CMD_REG_ADDR) & PHY_CMD_REG_ADDR_MASK;
     	val |= (phy << PHY_CMD_DEV_ADDR) & PHY_CMD_DEV_ADDR_MASK;
     	e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, val);
    -	e6000sw_poll_done(sc);
    +
    +	err = e6000sw_poll_done(sc);
    +	if (err != 0) {
    +		device_printf(dev, "Timeout while waiting for switch\n");
    +		return (err);
    +	}
    +
     	val = e6000sw_readreg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG)
     		& PHY_DATA_MASK;
     
    @@ -479,6 +499,7 @@ e6000sw_writephy(device_t dev, int phy, 
     {
     	e6000sw_softc_t *sc;
     	uint32_t val;
    +	int err;
     
     	sc = device_get_softc(dev);
     	val = 0;
    @@ -490,7 +511,12 @@ e6000sw_writephy(device_t dev, int phy, 
     
     	E6000SW_LOCK_ASSERT(sc, SA_XLOCKED);
     
    -	e6000sw_poll_done(sc);
    +	err = e6000sw_poll_done(sc);
    +	if (err != 0) {
    +		device_printf(dev, "Timeout while waiting for switch\n");
    +		return (err);
    +	}
    +
     	val |= PHY_CMD_MODE_MDIO << PHY_CMD_MODE;
     	val |= 1 << PHY_CMD_SMI_BUSY;
     	val |= PHY_CMD_OPCODE_WRITE << PHY_CMD_OPCODE;
    @@ -499,7 +525,12 @@ e6000sw_writephy(device_t dev, int phy, 
     	e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG,
     			 data & PHY_DATA_MASK);
     	e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, val);
    -	e6000sw_poll_done(sc);
    +
    +	err = e6000sw_poll_done(sc);
    +	if (err != 0) {
    +		device_printf(dev, "Timeout while waiting for switch\n");
    +		return (err);
    +	}
     
     	return (0);
     }
    
    From owner-svn-src-head@freebsd.org  Fri May 19 08:19:41 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00BA0D74D59;
     Fri, 19 May 2017 08:19:41 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 B67DB1EEC;
     Fri, 19 May 2017 08:19:40 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J8JdIw003014;
     Fri, 19 May 2017 08:19:39 GMT (envelope-from wma@FreeBSD.org)
    Received: (from wma@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J8JdkY003010;
     Fri, 19 May 2017 08:19:39 GMT (envelope-from wma@FreeBSD.org)
    Message-Id: <201705190819.v4J8JdkY003010@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org
     using -f
    From: Wojciech Macek 
    Date: Fri, 19 May 2017 08:19:39 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318522 - in head/sys: arm/mv dev/cesa
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 08:19:41 -0000
    
    Author: wma
    Date: Fri May 19 08:19:39 2017
    New Revision: 318522
    URL: https://svnweb.freebsd.org/changeset/base/318522
    
    Log:
      Enable proper configuration of CESA MBUS windows
      
      For all Marvell devices, MBUS windows configuration is done
      in a common place. Only CESA was an exception, so move its
      related code from driver to mv_common.c. This way it uses
      same proper DRAM information, same as  all other interfaces
      instead of parsing DT /memory node directly.
      
      Submitted by: Marcin Wojtas 
      Obtained from: Semihalf
      Sponsored by: Stormshield
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10723
    
    Modified:
      head/sys/arm/mv/mv_common.c
      head/sys/arm/mv/mvwin.h
      head/sys/dev/cesa/cesa.c
      head/sys/dev/cesa/cesa.h
    
    Modified: head/sys/arm/mv/mv_common.c
    ==============================================================================
    --- head/sys/arm/mv/mv_common.c	Fri May 19 08:16:47 2017	(r318521)
    +++ head/sys/arm/mv/mv_common.c	Fri May 19 08:19:39 2017	(r318522)
    @@ -76,6 +76,7 @@ MALLOC_DEFINE(M_IDMA, "idma", "idma dma 
     
     static int win_eth_can_remap(int i);
     
    +static int decode_win_cesa_valid(void);
     static int decode_win_cpu_valid(void);
     static int decode_win_usb_valid(void);
     static int decode_win_usb3_valid(void);
    @@ -91,6 +92,7 @@ static void decode_win_cpu_setup(void);
     #ifdef SOC_MV_ARMADAXP
     static int decode_win_sdram_fixup(void);
     #endif
    +static void decode_win_cesa_setup(u_long);
     static void decode_win_usb_setup(u_long);
     static void decode_win_usb3_setup(u_long);
     static void decode_win_eth_setup(u_long);
    @@ -101,6 +103,7 @@ static void decode_win_sdhci_setup(u_lon
     static void decode_win_idma_setup(u_long);
     static void decode_win_xor_setup(u_long);
     
    +static void decode_win_cesa_dump(u_long);
     static void decode_win_usb_dump(u_long);
     static void decode_win_usb3_dump(u_long);
     static void decode_win_eth_dump(u_long base);
    @@ -146,6 +149,7 @@ static struct soc_node_spec soc_nodes[] 
     	{ "mrvl,sata", &decode_win_sata_setup, NULL },
     	{ "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump },
     	{ "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump },
    +	{ "mrvl,cesa", &decode_win_cesa_setup, &decode_win_cesa_dump },
     	{ "mrvl,pcie", &decode_win_pcie_setup, NULL },
     	{ NULL, NULL, NULL },
     };
    @@ -574,7 +578,7 @@ soc_decode_win(void)
     	    !decode_win_eth_valid() || !decode_win_idma_valid() ||
     	    !decode_win_pcie_valid() || !decode_win_sata_valid() ||
     	    !decode_win_xor_valid() || !decode_win_usb3_valid() ||
    -	    !decode_win_sdhci_valid())
    +	    !decode_win_sdhci_valid() || !decode_win_cesa_valid())
     		return (EINVAL);
     
     	decode_win_cpu_setup();
    @@ -601,6 +605,11 @@ WIN_REG_IDX_WR(win_cpu, br, MV_WIN_CPU_B
     WIN_REG_IDX_WR(win_cpu, remap_l, MV_WIN_CPU_REMAP_LO, MV_MBUS_BRIDGE_BASE)
     WIN_REG_IDX_WR(win_cpu, remap_h, MV_WIN_CPU_REMAP_HI, MV_MBUS_BRIDGE_BASE)
     
    +WIN_REG_BASE_IDX_RD(win_cesa, cr, MV_WIN_CESA_CTRL)
    +WIN_REG_BASE_IDX_RD(win_cesa, br, MV_WIN_CESA_BASE)
    +WIN_REG_BASE_IDX_WR(win_cesa, cr, MV_WIN_CESA_CTRL)
    +WIN_REG_BASE_IDX_WR(win_cesa, br, MV_WIN_CESA_BASE)
    +
     WIN_REG_BASE_IDX_RD(win_usb, cr, MV_WIN_USB_CTRL)
     WIN_REG_BASE_IDX_RD(win_usb, br, MV_WIN_USB_BASE)
     WIN_REG_BASE_IDX_WR(win_usb, cr, MV_WIN_USB_CTRL)
    @@ -1071,6 +1080,63 @@ ddr_target(int i)
     }
     
     /**************************************************************************
    + * CESA windows routines
    + **************************************************************************/
    +static int
    +decode_win_cesa_valid(void)
    +{
    +
    +	return (decode_win_can_cover_ddr(MV_WIN_CESA_MAX));
    +}
    +
    +static void
    +decode_win_cesa_dump(u_long base)
    +{
    +	int i;
    +
    +	for (i = 0; i < MV_WIN_CESA_MAX; i++)
    +		printf("CESA window#%d: c 0x%08x, b 0x%08x\n", i,
    +		    win_cesa_cr_read(base, i), win_cesa_br_read(base, i));
    +}
    +
    +/*
    + * Set CESA decode windows.
    + */
    +static void
    +decode_win_cesa_setup(u_long base)
    +{
    +	uint32_t br, cr;
    +	int i, j;
    +
    +	for (i = 0; i < MV_WIN_CESA_MAX; i++) {
    +		win_cesa_cr_write(base, i, 0);
    +		win_cesa_br_write(base, i, 0);
    +	}
    +
    +	/* Only access to active DRAM banks is required */
    +	for (i = 0; i < MV_WIN_DDR_MAX; i++) {
    +		if (ddr_is_active(i)) {
    +			br = ddr_base(i);
    +
    +			cr = (((ddr_size(i) - 1) & 0xffff0000) |
    +			    (ddr_attr(i) << IO_WIN_ATTR_SHIFT) |
    +			    (ddr_target(i) << IO_WIN_TGT_SHIFT) |
    +			    IO_WIN_ENA_MASK);
    +
    +			/* Set the first free CESA window */
    +			for (j = 0; j < MV_WIN_CESA_MAX; j++) {
    +				if (win_cesa_cr_read(base, j) & 0x1)
    +					continue;
    +
    +				win_cesa_br_write(base, j, br);
    +				win_cesa_cr_write(base, j, cr);
    +				break;
    +			}
    +		}
    +	}
    +}
    +
    +/**************************************************************************
      * USB windows routines
      **************************************************************************/
     static int
    
    Modified: head/sys/arm/mv/mvwin.h
    ==============================================================================
    --- head/sys/arm/mv/mvwin.h	Fri May 19 08:16:47 2017	(r318521)
    +++ head/sys/arm/mv/mvwin.h	Fri May 19 08:19:39 2017	(r318522)
    @@ -216,6 +216,11 @@
     #define MV_WIN_CESA_ATTR(eng_sel)	0
     #endif
     
    +/* CESA TDMA address decoding registers */
    +#define MV_WIN_CESA_CTRL(n)		(0x8 * (n) + 0xA04)
    +#define MV_WIN_CESA_BASE(n)		(0x8 * (n) + 0xA00)
    +#define MV_WIN_CESA_MAX			4
    +
     #define MV_WIN_USB_CTRL(n)		(0x10 * (n) + 0x320)
     #define MV_WIN_USB_BASE(n)		(0x10 * (n) + 0x324)
     #define MV_WIN_USB_MAX			4
    
    Modified: head/sys/dev/cesa/cesa.c
    ==============================================================================
    --- head/sys/dev/cesa/cesa.c	Fri May 19 08:16:47 2017	(r318521)
    +++ head/sys/dev/cesa/cesa.c	Fri May 19 08:19:39 2017	(r318522)
    @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
     #include "cryptodev_if.h"
     
     #include 
    -#include 
     #include 
     #include "cesa.h"
     
    @@ -80,7 +79,6 @@ static void	cesa_intr(void *);
     static int	cesa_newsession(device_t, u_int32_t *, struct cryptoini *);
     static int	cesa_freesession(device_t, u_int64_t);
     static int	cesa_process(device_t, struct cryptop *, int);
    -static int	decode_win_cesa_setup(struct cesa_softc *sc);
     
     static struct resource_spec cesa_res_spec[] = {
     	{ SYS_RES_MEMORY, 0, RF_ACTIVE },
    @@ -1085,13 +1083,6 @@ cesa_attach(device_t dev)
     		goto err0;
     	}
     
    -	/* Setup CESA decoding windows */
    -	error = decode_win_cesa_setup(sc);
    -	if (error) {
    -		device_printf(dev, "could not setup decoding windows\n");
    -		goto err1;
    -	}
    -
     	/* Acquire SRAM base address */
     	error = cesa_setup_sram(sc);
     	if (error) {
    @@ -1706,50 +1697,3 @@ cesa_process(device_t dev, struct crypto
     
     	return (0);
     }
    -
    -/*
    - * Set CESA TDMA decode windows.
    - */
    -static int
    -decode_win_cesa_setup(struct cesa_softc *sc)
    -{
    -	struct mem_region availmem_regions[FDT_MEM_REGIONS];
    -	int availmem_regions_sz;
    -	uint32_t br, cr, i;
    -
    -	/* Grab physical memory regions information from DTS */
    -	if (fdt_get_mem_regions(availmem_regions, &availmem_regions_sz,
    -	    NULL) != 0)
    -		return (ENXIO);
    -
    -	if (availmem_regions_sz > MV_WIN_CESA_MAX) {
    -		device_printf(sc->sc_dev, "Too much memory regions, cannot "
    -		    " set CESA windows to cover whole DRAM \n");
    -		return (ENXIO);
    -	}
    -
    -	/* Disable and clear all CESA windows */
    -	for (i = 0; i < MV_WIN_CESA_MAX; i++) {
    -		CESA_TDMA_WRITE(sc, MV_WIN_CESA_BASE(i), 0);
    -		CESA_TDMA_WRITE(sc, MV_WIN_CESA_CTRL(i), 0);
    -	}
    -
    -	/* Fill CESA TDMA decoding windows with information acquired from DTS */
    -	for (i = 0; i < availmem_regions_sz; i++) {
    -		br = availmem_regions[i].mr_start;
    -		cr = availmem_regions[i].mr_size;
    -
    -		/* Don't add entries with size lower than 64KB */
    -		if (cr & 0xffff0000) {
    -			cr = (((cr - 1) & 0xffff0000) |
    -			(MV_WIN_DDR_ATTR(i) << MV_WIN_CPU_ATTR_SHIFT) |
    -			    (MV_WIN_DDR_TARGET << MV_WIN_CPU_TARGET_SHIFT) |
    -			    MV_WIN_CPU_ENABLE_BIT);
    -			CESA_TDMA_WRITE(sc, MV_WIN_CESA_BASE(i), br);
    -			CESA_TDMA_WRITE(sc, MV_WIN_CESA_CTRL(i), cr);
    -		}
    -	}
    -
    -	return (0);
    -}
    -
    
    Modified: head/sys/dev/cesa/cesa.h
    ==============================================================================
    --- head/sys/dev/cesa/cesa.h	Fri May 19 08:16:47 2017	(r318521)
    +++ head/sys/dev/cesa/cesa.h	Fri May 19 08:19:39 2017	(r318522)
    @@ -350,11 +350,6 @@ struct cesa_chain_info {
     #define CESA_TDMA_EMR_BOTH_HIT		CESA_TDMA_ECR_BOTH_HIT
     #define CESA_TDMA_EMR_DATA_ERROR	CESA_TDMA_ECR_DATA_ERROR
     
    -/*  CESA TDMA address decoding registers */
    -#define MV_WIN_CESA_CTRL(n)		(0x8 * (n) + 0xA04)
    -#define MV_WIN_CESA_BASE(n)		(0x8 * (n) + 0xA00)
    -#define MV_WIN_CESA_MAX			4
    -
     /* CESA SA registers definitions */
     #define CESA_SA_CMD			0x0E00
     #define CESA_SA_CMD_ACTVATE		(1 << 0)
    
    From owner-svn-src-head@freebsd.org  Fri May 19 08:19:52 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C473D74D85;
     Fri, 19 May 2017 08:19:52 +0000 (UTC)
     (envelope-from royger@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 57AE01F91;
     Fri, 19 May 2017 08:19:52 +0000 (UTC)
     (envelope-from royger@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J8JpRs003067;
     Fri, 19 May 2017 08:19:51 GMT (envelope-from royger@FreeBSD.org)
    Received: (from royger@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J8JplS003066;
     Fri, 19 May 2017 08:19:51 GMT (envelope-from royger@FreeBSD.org)
    Message-Id: <201705190819.v4J8JplS003066@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: royger set sender to
     royger@FreeBSD.org using -f
    From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= 
    Date: Fri, 19 May 2017 08:19:51 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318523 - head/sys/dev/xen/netfront
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 08:19:52 -0000
    
    Author: royger
    Date: Fri May 19 08:19:51 2017
    New Revision: 318523
    URL: https://svnweb.freebsd.org/changeset/base/318523
    
    Log:
      xen/netfront: don't drop the ring RX lock with inconsistent ring state
      
      Make sure the RX ring lock is only released when the state of the ring is
      consistent, or else concurrent calls to xn_rxeof might get an inconsistent ring
      state and thus some packets might be processed twice.
      
      Note that this is not very common, and could only happen when an interrupt is
      delivered while in xn_ifinit.
      
      Reported by:	cperciva
      Tested by:	cperciva
      MFC after:	1 week
      Sponsored by:	Citrix Systems R&D
    
    Modified:
      head/sys/dev/xen/netfront/netfront.c
    
    Modified: head/sys/dev/xen/netfront/netfront.c
    ==============================================================================
    --- head/sys/dev/xen/netfront/netfront.c	Fri May 19 08:19:39 2017	(r318522)
    +++ head/sys/dev/xen/netfront/netfront.c	Fri May 19 08:19:51 2017	(r318523)
    @@ -1161,17 +1161,18 @@ xn_rxeof(struct netfront_rxq *rxq)
     	struct mbufq mbufq_rxq, mbufq_errq;
     	int err, work_to_do;
     
    -	do {
    -		XN_RX_LOCK_ASSERT(rxq);
    -		if (!netfront_carrier_ok(np))
    -			return;
    -
    -		/* XXX: there should be some sane limit. */
    -		mbufq_init(&mbufq_errq, INT_MAX);
    -		mbufq_init(&mbufq_rxq, INT_MAX);
    +	XN_RX_LOCK_ASSERT(rxq);
    +
    +	if (!netfront_carrier_ok(np))
    +		return;
    +
    +	/* XXX: there should be some sane limit. */
    +	mbufq_init(&mbufq_errq, INT_MAX);
    +	mbufq_init(&mbufq_rxq, INT_MAX);
     
    -		ifp = np->xn_ifp;
    +	ifp = np->xn_ifp;
     
    +	do {
     		rp = rxq->ring.sring->rsp_prod;
     		rmb();	/* Ensure we see queued responses up to 'rp'. */
     
    @@ -1191,7 +1192,7 @@ xn_rxeof(struct netfront_rxq *rxq)
     			}
     
     			m->m_pkthdr.rcvif = ifp;
    -			if ( rx->flags & NETRXF_data_validated ) {
    +			if (rx->flags & NETRXF_data_validated) {
     				/*
     				 * According to mbuf(9) the correct way to tell
     				 * the stack that the checksum of an inbound
    @@ -1214,50 +1215,45 @@ xn_rxeof(struct netfront_rxq *rxq)
     			}
     
     			(void )mbufq_enqueue(&mbufq_rxq, m);
    -			rxq->ring.rsp_cons = i;
     		}
     
    -		mbufq_drain(&mbufq_errq);
    +		rxq->ring.rsp_cons = i;
     
    -		/*
    -		 * Process all the mbufs after the remapping is complete.
    -		 * Break the mbuf chain first though.
    -		 */
    -		while ((m = mbufq_dequeue(&mbufq_rxq)) != NULL) {
    -			if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
    +		xn_alloc_rx_buffers(rxq);
     
    -			/* XXX: Do we really need to drop the rx lock? */
    -			XN_RX_UNLOCK(rxq);
    +		RING_FINAL_CHECK_FOR_RESPONSES(&rxq->ring, work_to_do);
    +	} while (work_to_do);
    +
    +	XN_RX_UNLOCK(rxq);
    +	mbufq_drain(&mbufq_errq);
    +	/*
    +	 * Process all the mbufs after the remapping is complete.
    +	 * Break the mbuf chain first though.
    +	 */
    +	while ((m = mbufq_dequeue(&mbufq_rxq)) != NULL) {
    +		if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
     #if (defined(INET) || defined(INET6))
    -			/* Use LRO if possible */
    -			if ((ifp->if_capenable & IFCAP_LRO) == 0 ||
    -			    lro->lro_cnt == 0 || tcp_lro_rx(lro, m, 0)) {
    -				/*
    -				 * If LRO fails, pass up to the stack
    -				 * directly.
    -				 */
    -				(*ifp->if_input)(ifp, m);
    -			}
    -#else
    +		/* Use LRO if possible */
    +		if ((ifp->if_capenable & IFCAP_LRO) == 0 ||
    +		    lro->lro_cnt == 0 || tcp_lro_rx(lro, m, 0)) {
    +			/*
    +			 * If LRO fails, pass up to the stack
    +			 * directly.
    +			 */
     			(*ifp->if_input)(ifp, m);
    -#endif
    -
    -			XN_RX_LOCK(rxq);
     		}
    -
    -		rxq->ring.rsp_cons = i;
    +#else
    +		(*ifp->if_input)(ifp, m);
    +#endif
    +	}
     
     #if (defined(INET) || defined(INET6))
    -		/*
    -		 * Flush any outstanding LRO work
    -		 */
    -		tcp_lro_flush_all(lro);
    +	/*
    +	 * Flush any outstanding LRO work
    +	 */
    +	tcp_lro_flush_all(lro);
     #endif
    -
    -		xn_alloc_rx_buffers(rxq);
    -
    -		RING_FINAL_CHECK_FOR_RESPONSES(&rxq->ring, work_to_do);
    -	} while (work_to_do);
    +	XN_RX_LOCK(rxq);
     }
     
     static void
    
    From owner-svn-src-head@freebsd.org  Fri May 19 08:24:24 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id A58EFD74F3A;
     Fri, 19 May 2017 08:24:24 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 77E2777F;
     Fri, 19 May 2017 08:24:24 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J8ONOx007273;
     Fri, 19 May 2017 08:24:23 GMT (envelope-from wma@FreeBSD.org)
    Received: (from wma@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J8ON6X007271;
     Fri, 19 May 2017 08:24:23 GMT (envelope-from wma@FreeBSD.org)
    Message-Id: <201705190824.v4J8ON6X007271@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org
     using -f
    From: Wojciech Macek 
    Date: Fri, 19 May 2017 08:24:23 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318524 - head/sys/dev/etherswitch/e6000sw
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 08:24:24 -0000
    
    Author: wma
    Date: Fri May 19 08:24:23 2017
    New Revision: 318524
    URL: https://svnweb.freebsd.org/changeset/base/318524
    
    Log:
      Poll PHY status using internal e6000sw registers
      
      e6000sw family automatically reflects PHY status in each port's registers.
      Therefore it is not necessary to do a full PHY polling squence, which
      results in much quicker operation and much less significant usage of
      the SMI bus.
      
      Care must be taken that the resulting ifmedia_active is identical to
      what the PHY will compute, or gratuitous link status changes will
      occur whenever the PHYs update function is called.
      
      This patch implements above improvement. On the occasion set a pointer to
      the proc structure to be part of software context instead of being
      a global variable.
      
      Submitted by: Marcin Wojtas 
      Obtained from: Semihalf
      Sponsored by: Stormshield
      Reviewed by: loos
      Differential revision: https://reviews.freebsd.org/D10714
    
    Modified:
      head/sys/dev/etherswitch/e6000sw/e6000sw.c
      head/sys/dev/etherswitch/e6000sw/e6000swreg.h
    
    Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c
    ==============================================================================
    --- head/sys/dev/etherswitch/e6000sw/e6000sw.c	Fri May 19 08:19:51 2017	(r318523)
    +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c	Fri May 19 08:24:23 2017	(r318524)
    @@ -89,7 +89,7 @@ typedef struct e6000sw_softc {
     	char			*ifname[E6000SW_MAX_PORTS];
     	device_t		miibus[E6000SW_MAX_PORTS];
     	struct mii_data		*mii[E6000SW_MAX_PORTS];
    -	struct callout		tick_callout;
    +	struct proc		*kproc;
     
     	uint32_t		cpuports_mask;
     	uint32_t		fixed_mask;
    @@ -149,8 +149,6 @@ static __inline int e6000sw_is_phyport(e
     static __inline struct mii_data *e6000sw_miiforphy(e6000sw_softc_t *sc,
         unsigned int phy);
     
    -static struct proc *e6000sw_kproc;
    -
     static device_method_t e6000sw_methods[] = {
     	/* device interface */
     	DEVMETHOD(device_identify,		e6000sw_identify),
    @@ -419,8 +417,7 @@ e6000sw_attach(device_t dev)
     	bus_generic_probe(dev);
     	bus_generic_attach(dev);
     
    -	kproc_create(e6000sw_tick, sc, &e6000sw_kproc, 0, 0,
    -	    "e6000sw tick kproc");
    +	kproc_create(e6000sw_tick, sc, &sc->kproc, 0, 0, "e6000sw tick kproc");
     
     	return (0);
     
    @@ -1010,23 +1007,65 @@ e6000sw_get_pvid(e6000sw_softc_t *sc, in
     	return (0);
     }
     
    +/*
    + * Convert port status to ifmedia.
    + */
    +static void
    +e6000sw_update_ifmedia(uint16_t portstatus, u_int *media_status, u_int *media_active)
    +{
    +	*media_active = IFM_ETHER;
    +	*media_status = IFM_AVALID;
    +
    +	if ((portstatus & PORT_STATUS_LINK_MASK) != 0)
    +		*media_status |= IFM_ACTIVE;
    +	else {
    +		*media_active |= IFM_NONE;
    +		return;
    +	}
    +
    +	switch (portstatus & PORT_STATUS_SPEED_MASK) {
    +	case PORT_STATUS_SPEED_10:
    +		*media_active |= IFM_10_T;
    +		break;
    +	case PORT_STATUS_SPEED_100:
    +		*media_active |= IFM_100_TX;
    +		break;
    +	case PORT_STATUS_SPEED_1000:
    +		*media_active |= IFM_1000_T;
    +		break;
    +	}
    +
    +	if ((portstatus & PORT_STATUS_DUPLEX_MASK) == 0)
    +		*media_active |= IFM_FDX;
    +	else
    +		*media_active |= IFM_HDX;
    +}
    +
     static void
     e6000sw_tick (void *arg)
     {
     	e6000sw_softc_t *sc;
     	struct mii_softc *miisc;
    +	uint16_t portstatus;
     	int port;
     
     	sc = arg;
     
     	E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED);
    +
     	for (;;) {
     		E6000SW_LOCK(sc);
     		for (port = 0; port < sc->num_ports; port++) {
     			/* Tick only on PHY ports */
     			if (!e6000sw_is_phyport(sc, port))
     				continue;
    -			mii_tick(sc->mii[port]);
    +
    +			portstatus = e6000sw_readreg(sc, REG_PORT(port), PORT_STATUS);
    +
    +			e6000sw_update_ifmedia(portstatus,
    +			    &sc->mii[port]->mii_media_status,
    +			    &sc->mii[port]->mii_media_active);
    +
     			LIST_FOREACH(miisc, &sc->mii[port]->mii_phys, mii_list) {
     				if (IFM_INST(sc->mii[port]->mii_media.ifm_cur->ifm_media)
     				    != miisc->mii_inst)
    
    Modified: head/sys/dev/etherswitch/e6000sw/e6000swreg.h
    ==============================================================================
    --- head/sys/dev/etherswitch/e6000sw/e6000swreg.h	Fri May 19 08:19:51 2017	(r318523)
    +++ head/sys/dev/etherswitch/e6000sw/e6000swreg.h	Fri May 19 08:24:23 2017	(r318524)
    @@ -55,6 +55,14 @@ struct atu_opt {
      * Per-Port Switch Registers
      */
     #define PORT_STATUS			0x0
    +#define	PORT_STATUS_SPEED_MASK		0x300
    +#define	PORT_STATUS_SPEED_10		0
    +#define	PORT_STATUS_SPEED_100		1
    +#define	PORT_STATUS_SPEED_1000		2
    +#define	PORT_STATUS_DUPLEX_MASK		(1 << 10)
    +#define	PORT_STATUS_LINK_MASK		(1 << 11)
    +#define	PORT_STATUS_PHY_DETECT_MASK	(1 << 12)
    +
     #define PSC_CONTROL			0x1
     #define SWITCH_ID			0x3
     #define PORT_CONTROL			0x4
    
    From owner-svn-src-head@freebsd.org  Fri May 19 08:25:41 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DEFBD74FC1;
     Fri, 19 May 2017 08:25:41 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 349828F2;
     Fri, 19 May 2017 08:25:41 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J8Pef2007360;
     Fri, 19 May 2017 08:25:40 GMT (envelope-from wma@FreeBSD.org)
    Received: (from wma@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J8Peic007359;
     Fri, 19 May 2017 08:25:40 GMT (envelope-from wma@FreeBSD.org)
    Message-Id: <201705190825.v4J8Peic007359@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org
     using -f
    From: Wojciech Macek 
    Date: Fri, 19 May 2017 08:25:40 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318525 - head/sys/arm/mv
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 08:25:41 -0000
    
    Author: wma
    Date: Fri May 19 08:25:40 2017
    New Revision: 318525
    URL: https://svnweb.freebsd.org/changeset/base/318525
    
    Log:
      Fix MPIC mask/unmask
      
      Before the fix for single interrupt, both percpu and non-percpu routes
      were enabled/disable at the same time.
      
      Submitted by:  Marcin Wojtas 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95897D73081;
     Fri, 19 May 2017 08:26:42 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 62A6AA6A;
     Fri, 19 May 2017 08:26:42 +0000 (UTC) (envelope-from wma@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J8Qfe3007441;
     Fri, 19 May 2017 08:26:41 GMT (envelope-from wma@FreeBSD.org)
    Received: (from wma@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J8QfT9007440;
     Fri, 19 May 2017 08:26:41 GMT (envelope-from wma@FreeBSD.org)
    Message-Id: <201705190826.v4J8QfT9007440@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org
     using -f
    From: Wojciech Macek 
    Date: Fri, 19 May 2017 08:26:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318526 - head/sys/arm/mv/armada38x
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 08:26:42 -0000
    
    Author: wma
    Date: Fri May 19 08:26:41 2017
    New Revision: 318526
    URL: https://svnweb.freebsd.org/changeset/base/318526
    
    Log:
      Fix boot up on ARMADA38X uniprocessor variant
      
      Marvell Armada 380 is a uni-processor variant of the 38x SoC
      family. A function platform_mp_setmaxid() was setting a hardcoded
      value, which caused boot fail on A380. Fix this by relying on
      the CPU count obtained from device tree nodes.
      
      Submitted by:  Marcin Wojtas 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC18DD737AD;
     Fri, 19 May 2017 08:38:04 +0000 (UTC)
     (envelope-from truckman@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 AD8211190;
     Fri, 19 May 2017 08:38:04 +0000 (UTC)
     (envelope-from truckman@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4J8c31b011372;
     Fri, 19 May 2017 08:38:03 GMT (envelope-from truckman@FreeBSD.org)
    Received: (from truckman@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4J8c3Jq011370;
     Fri, 19 May 2017 08:38:03 GMT (envelope-from truckman@FreeBSD.org)
    Message-Id: <201705190838.v4J8c3Jq011370@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: truckman set sender to
     truckman@FreeBSD.org using -f
    From: Don Lewis 
    Date: Fri, 19 May 2017 08:38:03 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318527 - head/sys/netpfil/ipfw
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 08:38:05 -0000
    
    Author: truckman
    Date: Fri May 19 08:38:03 2017
    New Revision: 318527
    URL: https://svnweb.freebsd.org/changeset/base/318527
    
    Log:
      Fix the queue delay estimation in PIE/FQ-PIE when the timestamp
      (TS) method is used.  When packet timestamp is used, the "current_qdelay"
      keeps storing the last queue delay value calculated in the dequeue
      function.  Therefore, when a burst of packets arrives followed by
      a pause, the "current_qdelay" will store a high value caused by the
      burst and stick to that value during the pause because the queue
      delay measurement is done inside the dequeue function.  This causes
      the drop probability calculation function to calculate high drop
      probability value instead of zero and prevents the burst allowance
      mechanism from working properly.  Fix this problem by resetting
      "current_qdelay" inside the drop probability calculation function
      when the queue length is zero and TS option is used.
      
      Submitted by:	Rasool Al-Saadi 
      MFC after:	1 week
    
    Modified:
      head/sys/netpfil/ipfw/dn_aqm_pie.c
      head/sys/netpfil/ipfw/dn_sched_fq_pie.c
    
    Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c
    ==============================================================================
    --- head/sys/netpfil/ipfw/dn_aqm_pie.c	Fri May 19 08:26:41 2017	(r318526)
    +++ head/sys/netpfil/ipfw/dn_aqm_pie.c	Fri May 19 08:38:03 2017	(r318527)
    @@ -211,11 +211,16 @@ calculate_drop_prob(void *x)
     	pprms = pst->parms;
     	prob = pst->drop_prob;
     
    -	/* calculate current qdelay */
    -	if (pprms->flags & PIE_DEPRATEEST_ENABLED) {
    +	/* calculate current qdelay using DRE method.
    +	 * If TS is used and no data in the queue, reset current_qdelay
    +	 * as it stays at last value during dequeue process. 
    +	*/
    +	if (pprms->flags & PIE_DEPRATEEST_ENABLED)
     		pst->current_qdelay = ((uint64_t)pst->pq->ni.len_bytes *
     			pst->avg_dq_time) >> PIE_DQ_THRESHOLD_BITS;
    -	}
    +	else 
    +		if (!pst->pq->ni.len_bytes)
    +			 pst->current_qdelay = 0;
     
     	/* calculate drop probability */
     	p = (int64_t)pprms->alpha * 
    
    Modified: head/sys/netpfil/ipfw/dn_sched_fq_pie.c
    ==============================================================================
    --- head/sys/netpfil/ipfw/dn_sched_fq_pie.c	Fri May 19 08:26:41 2017	(r318526)
    +++ head/sys/netpfil/ipfw/dn_sched_fq_pie.c	Fri May 19 08:38:03 2017	(r318527)
    @@ -383,11 +383,16 @@ fq_calculate_drop_prob(void *x)
     	pprms = pst->parms;
     	prob = pst->drop_prob;
     
    -	/* calculate current qdelay */
    -	if (pprms->flags & PIE_DEPRATEEST_ENABLED) {
    +	/* calculate current qdelay using DRE method.
    +	 * If TS is used and no data in the queue, reset current_qdelay
    +	 * as it stays at last value during dequeue process.
    +	*/
    +	if (pprms->flags & PIE_DEPRATEEST_ENABLED)
     		pst->current_qdelay = ((uint64_t)q->stats.len_bytes  * pst->avg_dq_time)
     			>> PIE_DQ_THRESHOLD_BITS;
    -	}
    +	else
    +		if (!q->stats.len_bytes)
    +			pst->current_qdelay = 0;
     
     	/* calculate drop probability */
     	p = (int64_t)pprms->alpha * 
    
    From owner-svn-src-head@freebsd.org  Fri May 19 11:45:15 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82356D74C67;
     Fri, 19 May 2017 11:45:15 +0000 (UTC)
     (envelope-from mmel@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 527F914AB;
     Fri, 19 May 2017 11:45:15 +0000 (UTC)
     (envelope-from mmel@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4JBjESG088695;
     Fri, 19 May 2017 11:45:14 GMT (envelope-from mmel@FreeBSD.org)
    Received: (from mmel@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4JBjEWh088694;
     Fri, 19 May 2017 11:45:14 GMT (envelope-from mmel@FreeBSD.org)
    Message-Id: <201705191145.v4JBjEWh088694@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: mmel set sender to
     mmel@FreeBSD.org using -f
    From: Michal Meloun 
    Date: Fri, 19 May 2017 11:45:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318530 - head/sys/arm/include
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 11:45:15 -0000
    
    Author: mmel
    Date: Fri May 19 11:45:14 2017
    New Revision: 318530
    URL: https://svnweb.freebsd.org/changeset/base/318530
    
    Log:
      Increase maximum text segment size.
      LLVM binaries are huge...
      
      MFC after:	3 days
    
    Modified:
      head/sys/arm/include/vmparam.h
    
    Modified: head/sys/arm/include/vmparam.h
    ==============================================================================
    --- head/sys/arm/include/vmparam.h	Fri May 19 10:16:51 2017	(r318529)
    +++ head/sys/arm/include/vmparam.h	Fri May 19 11:45:14 2017	(r318530)
    @@ -42,7 +42,7 @@
      * Virtual memory related constants, all in bytes
      */
     #ifndef	MAXTSIZ
    -#define	MAXTSIZ		(64UL*1024*1024)	/* max text size */
    +#define	MAXTSIZ		(256UL*1024*1024)	/* max text size */
     #endif
     #ifndef	DFLDSIZ
     #define	DFLDSIZ		(128UL*1024*1024)	/* initial data size limit */
    
    From owner-svn-src-head@freebsd.org  Fri May 19 12:22:50 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65AF3D7227F;
     Fri, 19 May 2017 12:22:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id 238A71C01;
     Fri, 19 May 2017 12:22:50 +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 v4JCMnNX004848;
     Fri, 19 May 2017 12:22:49 GMT (envelope-from hselasky@FreeBSD.org)
    Received: (from hselasky@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4JCMni4004846;
     Fri, 19 May 2017 12:22:49 GMT (envelope-from hselasky@FreeBSD.org)
    Message-Id: <201705191222.v4JCMni4004846@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
     hselasky@FreeBSD.org using -f
    From: Hans Petter Selasky 
    Date: Fri, 19 May 2017 12:22:49 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318531 - head/sys/dev/mlx4/mlx4_core
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 12:22:50 -0000
    
    Author: hselasky
    Date: Fri May 19 12:22:48 2017
    New Revision: 318531
    URL: https://svnweb.freebsd.org/changeset/base/318531
    
    Log:
      mlx4: Use the CQ quota for SRIOV when creating completion EQs
      
      When creating EQs to handle CQ completion events for the PF or for
      VFs, we create enough EQE entries to handle completions for the max
      number of CQs that can use that EQ.
      
      When SRIOV is activated, the max number of CQs a VF (or the PF) can
      obtain is its CQ quota (determined by the Hypervisor resource
      tracker).  Therefore, when creating an EQ, the number of EQE entries
      that the VF should request for that EQ is the CQ quota value (and not
      the total number of CQs available in the firmware).
      
      Under SRIOV, the PF, also must use its CQ quota, because the resource
      tracker also controls how many CQs the PF can obtain.
      
      Using the firmware total CQs instead of the CQ quota when creating EQs
      resulted wasting MTT entries, due to allocating more EQEs than were
      needed.
      
      MFC after:		3 days
      Sponsored by:		Mellanox Technologies
    
    Modified:
      head/sys/dev/mlx4/mlx4_core/mlx4_eq.c
      head/sys/dev/mlx4/mlx4_core/mlx4_main.c
    
    Modified: head/sys/dev/mlx4/mlx4_core/mlx4_eq.c
    ==============================================================================
    --- head/sys/dev/mlx4/mlx4_core/mlx4_eq.c	Fri May 19 11:45:14 2017	(r318530)
    +++ head/sys/dev/mlx4/mlx4_core/mlx4_eq.c	Fri May 19 12:22:48 2017	(r318531)
    @@ -1169,8 +1169,7 @@ int mlx4_init_eq_table(struct mlx4_dev *
     	}
     
     	for (i = 0; i < dev->caps.num_comp_vectors; ++i) {
    -		err = mlx4_create_eq(dev, dev->caps.num_cqs -
    -					  dev->caps.reserved_cqs +
    +		err = mlx4_create_eq(dev, dev->quotas.cq +
     					  MLX4_NUM_SPARE_EQE,
     				     (dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
     				     &priv->eq_table.eq[i]);
    @@ -1190,8 +1189,7 @@ int mlx4_init_eq_table(struct mlx4_dev *
     	for (i = dev->caps.num_comp_vectors + 1;
     	      i < dev->caps.num_comp_vectors + dev->caps.comp_pool + 1; ++i) {
     
    -		err = mlx4_create_eq(dev, dev->caps.num_cqs -
    -					  dev->caps.reserved_cqs +
    +		err = mlx4_create_eq(dev, dev->quotas.cq +
     					  MLX4_NUM_SPARE_EQE,
     				     (dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
     				     &priv->eq_table.eq[i]);
    
    Modified: head/sys/dev/mlx4/mlx4_core/mlx4_main.c
    ==============================================================================
    --- head/sys/dev/mlx4/mlx4_core/mlx4_main.c	Fri May 19 11:45:14 2017	(r318530)
    +++ head/sys/dev/mlx4/mlx4_core/mlx4_main.c	Fri May 19 12:22:48 2017	(r318531)
    @@ -3446,6 +3446,8 @@ slave_start:
     			goto err_free_eq;
     	}
     
    +	mlx4_init_quotas(dev);
    +
     	err = mlx4_setup_hca(dev);
     	if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) &&
     	    !mlx4_is_mfunc(dev)) {
    @@ -3459,7 +3461,6 @@ slave_start:
     	if (err)
     		goto err_steer;
     
    -	mlx4_init_quotas(dev);
     	mlx4_init_hca_info(dev);
     
     	for (port = 1; port <= dev->caps.num_ports; port++) {
    
    From owner-svn-src-head@freebsd.org  Fri May 19 13:04:07 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81188D73188;
     Fri, 19 May 2017 13:04:07 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 5DEF11A90;
     Fri, 19 May 2017 13:04:07 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4JD462K021860;
     Fri, 19 May 2017 13:04:06 GMT (envelope-from vangyzen@FreeBSD.org)
    Received: (from vangyzen@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4JD45Sn021851;
     Fri, 19 May 2017 13:04:05 GMT (envelope-from vangyzen@FreeBSD.org)
    Message-Id: <201705191304.v4JD45Sn021851@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
     vangyzen@FreeBSD.org using -f
    From: Eric van Gyzen 
    Date: Fri, 19 May 2017 13:04:05 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318539 - head/lib/libthr/thread
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 13:04:07 -0000
    
    Author: vangyzen
    Date: Fri May 19 13:04:05 2017
    New Revision: 318539
    URL: https://svnweb.freebsd.org/changeset/base/318539
    
    Log:
      libthr: fix warnings at WARNS=6
      
      Fix warnings about the following when WARNS=6 (which I will commit soon):
      
      - casting away const
      - no previous 'extern' declaration for non-static variable
      - others as explained by #pragmas and comments
      - unused parameters
      
      The last is the only functional change.
      
      Reviewed by:	kib
      MFC after:	3 days
      Sponsored by:	Dell EMC
      Differential Revision:	https://reviews.freebsd.org/D10808
    
    Modified:
      head/lib/libthr/thread/thr_attr.c
      head/lib/libthr/thread/thr_exit.c
      head/lib/libthr/thread/thr_sig.c
      head/lib/libthr/thread/thr_spec.c
      head/lib/libthr/thread/thr_stack.c
      head/lib/libthr/thread/thr_symbols.c
      head/lib/libthr/thread/thr_umtx.c
      head/lib/libthr/thread/thr_umtx.h
    
    Modified: head/lib/libthr/thread/thr_attr.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_attr.c	Fri May 19 13:02:19 2017	(r318538)
    +++ head/lib/libthr/thread/thr_attr.c	Fri May 19 13:04:05 2017	(r318539)
    @@ -607,7 +607,7 @@ _pthread_attr_setaffinity_np(pthread_att
     			/* Kernel checks invalid bits, we check it here too. */
     			size_t i;
     			for (i = kern_size; i < cpusetsize; ++i) {
    -				if (((char *)cpusetp)[i])
    +				if (((const char *)cpusetp)[i])
     					return (EINVAL);
     			}
     		}
    
    Modified: head/lib/libthr/thread/thr_exit.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_exit.c	Fri May 19 13:02:19 2017	(r318538)
    +++ head/lib/libthr/thread/thr_exit.c	Fri May 19 13:04:05 2017	(r318539)
    @@ -119,7 +119,8 @@ _Unwind_GetCFA(struct _Unwind_Context *c
     #endif /* PIC */
     
     static void
    -thread_unwind_cleanup(_Unwind_Reason_Code code, struct _Unwind_Exception *e)
    +thread_unwind_cleanup(_Unwind_Reason_Code code __unused,
    +    struct _Unwind_Exception *e __unused)
     {
     	/*
     	 * Specification said that _Unwind_Resume should not be used here,
    @@ -130,10 +131,10 @@ thread_unwind_cleanup(_Unwind_Reason_Cod
     }
     
     static _Unwind_Reason_Code
    -thread_unwind_stop(int version, _Unwind_Action actions,
    -	int64_t exc_class,
    -	struct _Unwind_Exception *exc_obj,
    -	struct _Unwind_Context *context, void *stop_parameter)
    +thread_unwind_stop(int version __unused, _Unwind_Action actions,
    +	int64_t exc_class __unused,
    +	struct _Unwind_Exception *exc_obj __unused,
    +	struct _Unwind_Context *context, void *stop_parameter __unused)
     {
     	struct pthread *curthread = _get_curthread();
     	struct pthread_cleanup *cur;
    
    Modified: head/lib/libthr/thread/thr_sig.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_sig.c	Fri May 19 13:02:19 2017	(r318538)
    +++ head/lib/libthr/thread/thr_sig.c	Fri May 19 13:04:05 2017	(r318539)
    @@ -441,7 +441,7 @@ _thr_signal_init(int dlopened)
     }
     
     void
    -_thr_sigact_unload(struct dl_phdr_info *phdr_info)
    +_thr_sigact_unload(struct dl_phdr_info *phdr_info __unused)
     {
     #if 0
     	struct pthread *curthread = _get_curthread();
    
    Modified: head/lib/libthr/thread/thr_spec.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_spec.c	Fri May 19 13:02:19 2017	(r318538)
    +++ head/lib/libthr/thread/thr_spec.c	Fri May 19 13:04:05 2017	(r318539)
    @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
     
     #include "thr_private.h"
     
    -struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
    +static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
     
     __weak_reference(_pthread_key_create, pthread_key_create);
     __weak_reference(_pthread_key_delete, pthread_key_delete);
    
    Modified: head/lib/libthr/thread/thr_stack.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_stack.c	Fri May 19 13:02:19 2017	(r318538)
    +++ head/lib/libthr/thread/thr_stack.c	Fri May 19 13:04:05 2017	(r318539)
    @@ -290,6 +290,19 @@ _thr_stack_alloc(struct pthread_attr *at
     		return (-1);
     }
     
    +/*
    + * Disable this warning from clang:
    + *
    + * cast from 'char *' to
    + *    'struct stack *' increases required alignment from 1 to 8
    + *    [-Werror,-Wcast-align]
    + *                 spare_stack = (struct stack *)
    + */
    +#ifdef __clang__
    +#pragma GCC diagnostic push
    +#pragma GCC diagnostic ignored "-Wcast-align"
    +#endif
    +
     /* This function must be called with _thread_list_lock held. */
     void
     _thr_stack_free(struct pthread_attr *attr)
    @@ -316,3 +329,7 @@ _thr_stack_free(struct pthread_attr *att
     		attr->stackaddr_attr = NULL;
     	}
     }
    +
    +#ifdef __clang__
    +#pragma GCC diagnostic pop
    +#endif
    
    Modified: head/lib/libthr/thread/thr_symbols.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_symbols.c	Fri May 19 13:02:19 2017	(r318538)
    +++ head/lib/libthr/thread/thr_symbols.c	Fri May 19 13:04:05 2017	(r318539)
    @@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$");
     
     #include "thr_private.h"
     
    +#ifdef __clang__
    +#pragma GCC diagnostic ignored "-Wmissing-variable-declarations"
    +#endif
    +
     /* A collection of symbols needed by debugger */
     
     /* int _libthr_debug */
    
    Modified: head/lib/libthr/thread/thr_umtx.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_umtx.c	Fri May 19 13:02:19 2017	(r318538)
    +++ head/lib/libthr/thread/thr_umtx.c	Fri May 19 13:04:05 2017	(r318539)
    @@ -168,7 +168,7 @@ __thr_umutex_timedlock(struct umutex *mt
     }
     
     int
    -__thr_umutex_unlock(struct umutex *mtx, uint32_t id)
    +__thr_umutex_unlock(struct umutex *mtx)
     {
     
     	return (_umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0));
    
    Modified: head/lib/libthr/thread/thr_umtx.h
    ==============================================================================
    --- head/lib/libthr/thread/thr_umtx.h	Fri May 19 13:02:19 2017	(r318538)
    +++ head/lib/libthr/thread/thr_umtx.h	Fri May 19 13:04:05 2017	(r318539)
    @@ -44,7 +44,7 @@ int __thr_umutex_lock(struct umutex *mtx
     int __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) __hidden;
     int __thr_umutex_timedlock(struct umutex *mtx, uint32_t id,
     	const struct timespec *timeout) __hidden;
    -int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) __hidden;
    +int __thr_umutex_unlock(struct umutex *mtx) __hidden;
     int __thr_umutex_trylock(struct umutex *mtx) __hidden;
     int __thr_umutex_set_ceiling(struct umutex *mtx, uint32_t ceiling,
     	uint32_t *oldceiling) __hidden;
    @@ -155,7 +155,7 @@ _thr_umutex_unlock2(struct umutex *mtx, 
     		if (atomic_cmpset_rel_32(&mtx->m_owner, id, noncst ?
     		    UMUTEX_RB_NOTRECOV : UMUTEX_UNOWNED))
     			return (0);
    -		return (__thr_umutex_unlock(mtx, id));
    +		return (__thr_umutex_unlock(mtx));
     	}
     
     	do {
    
    From owner-svn-src-head@freebsd.org  Fri May 19 16:28:34 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97C96D73ECC;
     Fri, 19 May 2017 16:28:34 +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 5825E1CB7;
     Fri, 19 May 2017 16:28:34 +0000 (UTC) (envelope-from jhb@freebsd.org)
    Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net
     [73.231.226.104])
     by mail.baldwin.cx (Postfix) with ESMTPSA id E07DF10A7B9;
     Fri, 19 May 2017 12:28:32 -0400 (EDT)
    From: John Baldwin 
    To: Baptiste Daroussin 
    Cc: rgrimes@freebsd.org, Ngie Cooper ,
     svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    Date: Fri, 19 May 2017 09:17:23 -0700
    Message-ID: <9570430.uB7Ojud3DG@ralph.baldwin.cx>
    User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; )
    In-Reply-To: <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <2201156.H7EQSgYph9@ralph.baldwin.cx>
     <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7Bit
    Content-Type: text/plain; charset="us-ascii"
    X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
     (mail.baldwin.cx); Fri, 19 May 2017 12:28: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.23
    Precedence: list
    List-Id: 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, 19 May 2017 16:28:34 -0000
    
    On Thursday, May 18, 2017 11:24:29 PM Baptiste Daroussin wrote:
    > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
    > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
    > > > > > Author: ngie
    > > > > > Date: Thu May 18 06:25:39 2017
    > > > > > New Revision: 318441
    > > > > > URL: https://svnweb.freebsd.org/changeset/base/318441
    > > > > > 
    > > > > > Log:
    > > > > >   Handle the cron.d entry for MK_AT in cron conditionally
    > > > > >   
    > > > > >   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
    > > > > >   to run a non-existent program via cron(8) every 5 minutes with the
    > > > > >   default /etc/crontab, prior to this commit.
    > > > > >   
    > > > > >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
    > > > > >   because atrun(8) executes programs, which may rely on environment
    > > > > >   currently set via /etc/crontab.
    > > > > >   
    > > > > >   Noted by:	bdrewery (in an internal review)
    > > > > >   MFC after:	2 months
    > > > > >   Relnotes:	yes (may need to add environmental modifications to
    > > > > >   		     /etc/cron.d/at)
    > > > > >   Sponsored by:	Dell EMC Isilon
    > > > > > 
    > > > > > Added:
    > > > > >   head/etc/cron.d/
    > > > > >   head/etc/cron.d/Makefile   (contents, props changed)
    > > > > >   head/etc/cron.d/at   (contents, props changed)
    > > > > > Modified:
    > > > > >   head/etc/Makefile
    > > > > >   head/etc/crontab
    > > > > > 
    > > > > > Modified: head/etc/Makefile
    > > > > > ==============================================================================
    > > > > > --- head/etc/Makefile	Thu May 18 06:15:42 2017	(r318440)
    > > > > > +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    > > > > > @@ -8,6 +8,7 @@ FILESGROUPS=	FILES
    > > > > >  # No need as it is empty and just causes rebuilds since this file does so much.
    > > > > >  UPDATE_DEPENDFILE=	no
    > > > > >  SUBDIR=	\
    > > > > > +	cron.d \
    > > > > >  	newsyslog.conf.d \
    > > > > >  	syslog.d
    > > > > 
    > > > > The thread on the newsyslog clearly shows that this is a contriversial change.
    > > > > 
    > > > > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
    > > > > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
    > > > > desires of others.
    > > > 
    > > > Has multiple people has stated, on the newsyslog thread. this is not a
    > > > DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
    > > > 1. Consistency
    > > >   as a project we do support building WITHOUT_FOO there is no reason to install
    > > >   syslog, cron configuration for FOO if the system was built without foo
    > > 
    > > Though it doesn't _hurt_, and breaking POLA has to be worth it, not just
    > > because it looks nice.
    > > 
    > > > 2. Packaging base
    > > >   if one does not install at there is no need for the at crontab to be installed
    > > >   (same reason as 1.)
    > > 
    > > This is a viable reason except that it isn't fully baked yet.
    > > 
    > > > 3. Large deployment of freebsd farms
    > > >   Being able to administrate thousands of FreeBSD machines, one often ends up
    > > >   using tools like puppet, chef, ansible, cfengine. When programmatically
    > > >   handling configuration management it is way easier and safer to simple
    > > >   add/removes files in a directory rather than mangling^Winplace editing files.
    > > 
    > > There's nothing preventing you now from deploying split files and an empty
    > > global configuration file since the daemons support foo.d.  You don't require
    > > that to change in upstream since you should be using some sort of VCS to
    > > manage your configuration as it is.
    > > 
    > > > 4. Ports/packages
    > > >   On can provide easily sample configuration for cron, syslog (not only) and the
    > > >   admin can decide to use it or not easily (ususally this is done by making
    > > >   symlinks from the said file which would live in share/* into the .d directory.
    > > > 
    > > > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.
    > > 
    > > The support for broken out files has long been there, but the base system has
    > > not used them previously for default config shipped during a release.  That
    > > is in fact a new trend.
    > > 
    > > However, the current approach seems to be the absolute worst way to do this.
    > > If someone wants to use the existing base system image and modify it with
    > > config management, they now have to use a mix of styles (for some services
    > > edit a global config file for certain settings, but use a dedicated file for
    > > other settings for the same service, or for the same settings but a different
    > > service).  It's also the worst case for humans trying to work with our system
    > > as the division between which services are broken out vs global is
    > > inconsistent and arbitrary.
    > > 
    > > Once you split up the files you make a merge conflict for anyone trying to do
    > > an upgrade.  If we do this piecemail then we create N merge conflicts for users
    > > to deal with as opposed to if you split it up all at once.
    > > 
    > > Also, there wasn't a clear consensus (a mail to arch@ with "hey, we should
    > > switch to splitting up config files for reasons A and B and let's do this for
    > > 12.0 but not merge to stable so there is a clear flag day / sign post for users
    > > to manage upgrades".  Instead there have been a couple of commits and any
    > > not-in-100%-agreement opinions are ignored.
    > > 
    > That's true, another thing is the way it is done, there is no simple way to
    > disable the at cron from an admin point of view  rather than rm /etc/cron.d/at
    > for an end user which an upgrade will bring back.
    
    I think an upgrade won't bring the file back necessarily (etcupdate warns you
    that a removed file changed, but it doesn't bring it back, I think a similar
    strategy might be sensible for pkg as well).
    
    To be clear, my main thoughts are that if we are going to start using conf.d
    for the base system:
    
    1) We should be intentional about deciding to use that approach in general
       (so discuss it first, though perhaps we've had enough discussion in the
       current threads).
    
    2) When converting a utility from a global foo.conf to a conf.d style, I
       think we should convert it all at once, not piecemeal so that there's just
       one painful update for users to work through instead of N updates to the
       same file.
    
    3) This is probably a sufficiently large POLA violation to not MFC, but be
       part of a new X.0.
    
    -- 
    John Baldwin
    
    From owner-svn-src-head@freebsd.org  Fri May 19 16:33:56 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3D11D74265;
     Fri, 19 May 2017 16:33:56 +0000 (UTC)
     (envelope-from bapt@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 8AF4B13E5;
     Fri, 19 May 2017 16:33:56 +0000 (UTC)
     (envelope-from bapt@freebsd.org)
    Received: by freefall.freebsd.org (Postfix, from userid 1235)
     id 9EA8E11B8; Fri, 19 May 2017 16:33:55 +0000 (UTC)
    Date: Fri, 19 May 2017 18:33:55 +0200
    From: Baptiste Daroussin 
    To: John Baldwin 
    Cc: rgrimes@freebsd.org, Ngie Cooper ,
     svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    Subject: Re: svn commit: r318441 - in head/etc: . cron.d
    Message-ID: <20170519163355.rs5w3hr6dltdx7kv@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <2201156.H7EQSgYph9@ralph.baldwin.cx>
     <20170518212429.rugl6vnv5d2b2hpb@ivaldir.net>
     <9570430.uB7Ojud3DG@ralph.baldwin.cx>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature"; boundary="fpgvlokedjylwomp"
    Content-Disposition: inline
    In-Reply-To: <9570430.uB7Ojud3DG@ralph.baldwin.cx>
    User-Agent: NeoMutt/20170428 (1.8.2)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 19 May 2017 16:33:56 -0000
    
    
    --fpgvlokedjylwomp
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    On Fri, May 19, 2017 at 09:17:23AM -0700, John Baldwin wrote:
    > On Thursday, May 18, 2017 11:24:29 PM Baptiste Daroussin wrote:
    > > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
    > > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
    > > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
    > > > > > > Author: ngie
    > > > > > > Date: Thu May 18 06:25:39 2017
    > > > > > > New Revision: 318441
    > > > > > > URL: https://svnweb.freebsd.org/changeset/base/318441
    > > > > > >=20
    > > > > > > Log:
    > > > > > >   Handle the cron.d entry for MK_AT in cron conditionally
    > > > > > >  =20
    > > > > > >   Install /etc/cron.d/at if MK_AT !=3D no, always using it, whi=
    ch tries
    > > > > > >   to run a non-existent program via cron(8) every 5 minutes wit=
    h the
    > > > > > >   default /etc/crontab, prior to this commit.
    > > > > > >  =20
    > > > > > >   SHELL and PATH are duplicated between /etc/crontab and /etc/c=
    ron.d/at
    > > > > > >   because atrun(8) executes programs, which may rely on environ=
    ment
    > > > > > >   currently set via /etc/crontab.
    > > > > > >  =20
    > > > > > >   Noted by:	bdrewery (in an internal review)
    > > > > > >   MFC after:	2 months
    > > > > > >   Relnotes:	yes (may need to add environmental modifications to
    > > > > > >   		     /etc/cron.d/at)
    > > > > > >   Sponsored by:	Dell EMC Isilon
    > > > > > >=20
    > > > > > > Added:
    > > > > > >   head/etc/cron.d/
    > > > > > >   head/etc/cron.d/Makefile   (contents, props changed)
    > > > > > >   head/etc/cron.d/at   (contents, props changed)
    > > > > > > Modified:
    > > > > > >   head/etc/Makefile
    > > > > > >   head/etc/crontab
    > > > > > >=20
    > > > > > > Modified: head/etc/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/etc/Makefile	Thu May 18 06:15:42 2017	(r318440)
    > > > > > > +++ head/etc/Makefile	Thu May 18 06:25:39 2017	(r318441)
    > > > > > > @@ -8,6 +8,7 @@ FILESGROUPS=3D	FILES
    > > > > > >  # No need as it is empty and just causes rebuilds since this f=
    ile does so much.
    > > > > > >  UPDATE_DEPENDFILE=3D	no
    > > > > > >  SUBDIR=3D	\
    > > > > > > +	cron.d \
    > > > > > >  	newsyslog.conf.d \
    > > > > > >  	syslog.d
    > > > > >=20
    > > > > > The thread on the newsyslog clearly shows that this is a contrive=
    rsial change.
    > > > > >=20
    > > > > > I strongly object to further splitting of /etc/FOO into /etc/foo.=
    d/FOO files
    > > > > > to suite Dell/EMC/Isilon's needs.  It is in conflict with the nee=
    ds and
    > > > > > desires of others.
    > > > >=20
    > > > > Has multiple people has stated, on the newsyslog thread. this is no=
    t a
    > > > > DELL/EMC/Isilon need, this is also a requirement for plenty of use =
    cases
    > > > > 1. Consistency
    > > > >   as a project we do support building WITHOUT_FOO there is no reaso=
    n to install
    > > > >   syslog, cron configuration for FOO if the system was built withou=
    t foo
    > > >=20
    > > > Though it doesn't _hurt_, and breaking POLA has to be worth it, not j=
    ust
    > > > because it looks nice.
    > > >=20
    > > > > 2. Packaging base
    > > > >   if one does not install at there is no need for the at crontab to=
     be installed
    > > > >   (same reason as 1.)
    > > >=20
    > > > This is a viable reason except that it isn't fully baked yet.
    > > >=20
    > > > > 3. Large deployment of freebsd farms
    > > > >   Being able to administrate thousands of FreeBSD machines, one oft=
    en ends up
    > > > >   using tools like puppet, chef, ansible, cfengine. When programmat=
    ically
    > > > >   handling configuration management it is way easier and safer to s=
    imple
    > > > >   add/removes files in a directory rather than mangling^Winplace ed=
    iting files.
    > > >=20
    > > > There's nothing preventing you now from deploying split files and an =
    empty
    > > > global configuration file since the daemons support foo.d.  You don't=
     require
    > > > that to change in upstream since you should be using some sort of VCS=
     to
    > > > manage your configuration as it is.
    > > >=20
    > > > > 4. Ports/packages
    > > > >   On can provide easily sample configuration for cron, syslog (not =
    only) and the
    > > > >   admin can decide to use it or not easily (ususally this is done b=
    y making
    > > > >   symlinks from the said file which would live in share/* into the =
    =2Ed directory.
    > > > >=20
    > > > > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and =
    more.
    > > >=20
    > > > The support for broken out files has long been there, but the base sy=
    stem has
    > > > not used them previously for default config shipped during a release.=
      That
    > > > is in fact a new trend.
    > > >=20
    > > > However, the current approach seems to be the absolute worst way to d=
    o this.
    > > > If someone wants to use the existing base system image and modify it =
    with
    > > > config management, they now have to use a mix of styles (for some ser=
    vices
    > > > edit a global config file for certain settings, but use a dedicated f=
    ile for
    > > > other settings for the same service, or for the same settings but a d=
    ifferent
    > > > service).  It's also the worst case for humans trying to work with ou=
    r system
    > > > as the division between which services are broken out vs global is
    > > > inconsistent and arbitrary.
    > > >=20
    > > > Once you split up the files you make a merge conflict for anyone tryi=
    ng to do
    > > > an upgrade.  If we do this piecemail then we create N merge conflicts=
     for users
    > > > to deal with as opposed to if you split it up all at once.
    > > >=20
    > > > Also, there wasn't a clear consensus (a mail to arch@ with "hey, we s=
    hould
    > > > switch to splitting up config files for reasons A and B and let's do =
    this for
    > > > 12.0 but not merge to stable so there is a clear flag day / sign post=
     for users
    > > > to manage upgrades".  Instead there have been a couple of commits and=
     any
    > > > not-in-100%-agreement opinions are ignored.
    > > >=20
    > > That's true, another thing is the way it is done, there is no simple wa=
    y to
    > > disable the at cron from an admin point of view  rather than rm /etc/cr=
    on.d/at
    > > for an end user which an upgrade will bring back.
    >=20
    > I think an upgrade won't bring the file back necessarily (etcupdate warns=
     you
    > that a removed file changed, but it doesn't bring it back, I think a simi=
    lar
    > strategy might be sensible for pkg as well).
    
    I need to check, I do not remember what I did here and I will certainly add=
     a
    regression test for that to ensure this behaviour is always working as expe=
    cted.
    >=20
    > To be clear, my main thoughts are that if we are going to start using con=
    f.d
    > for the base system:
    >=20
    > 1) We should be intentional about deciding to use that approach in general
    >    (so discuss it first, though perhaps we've had enough discussion in the
    >    current threads).
    >=20
    > 2) When converting a utility from a global foo.conf to a conf.d style, I
    >    think we should convert it all at once, not piecemeal so that there's =
    just
    >    one painful update for users to work through instead of N updates to t=
    he
    >    same file.
    >=20
    > 3) This is probably a sufficiently large POLA violation to not MFC, but be
    >    part of a new X.0.
    
    I agree with the 3 points above.
    
    Bapt
    
    --fpgvlokedjylwomp
    Content-Type: application/pgp-signature; name="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlkfHnAACgkQY4mL3PG3
    PlqWoQ//UGIf5rjCu3zCc7QBhD93NVqeMc5M3c1o8GiqmPbpUaj4wHYCpaMnbcZ/
    ljH2SPR5h+JAaNEvgNsn0qHokSEfxM3k4l/Y/BQ7ofgqn4+rVmhei4XGhu3sIqmC
    OiJXB1UBJPCSheLFcAd14lhfKgBJgC2+1/JV2iWWR5fepd7aTBBsSh/hIrMafmhc
    iO8Iu9/3ZVGdrm7qeuqjWmD5yYtoZaQ24SJLi1pI2nt/QS5HIvqZ4xrTAXcpCIyG
    h5u4TF64iH+IRYfqIkY9F6ziZk4kqbMsz+dihBJNw4kFvW0QploWoqpJK+1J7tJA
    vvWjmVKa9zQcpbgY47ADxzqGQH/TYb0uGqqhfBqDK/pNUXOZIIbX0AjVgORzq4Tw
    hZ9kcno1ufBIefYY1si+iN4fangRUVdx0zFAJGL+EJLO/SlkrKXtbgVeiT+qHS8v
    JmlwQLMysccsfw4T2whnxMtFV52YsbOM/N17aIqL3aDyQw9HiQv4luMAykJDBb27
    1aeu3FckRrHS6Gc1Eb74P7hkcWvElwcGdWPUpqm2SWH7OEyYIgpET0tuus9NAMoA
    IVV/WfPMv48EUltP9prYdYUDQaERpbU4SZiIwacuuAh6Z8Qu1U/iK/5DnsC8RUPb
    jPRGcaQ6bcU4Z50K+ghtrpzKOGeu7DZXPk+XJVDR/+HnAXIoX40=
    =MMKP
    -----END PGP SIGNATURE-----
    
    --fpgvlokedjylwomp--
    
    From owner-svn-src-head@freebsd.org  Fri May 19 17:04:03 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3505FD74D55;
     Fri, 19 May 2017 17:04:03 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 DE0C775E;
     Fri, 19 May 2017 17:04:02 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4JH41I2022292;
     Fri, 19 May 2017 17:04:01 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4JH41Zh022291;
     Fri, 19 May 2017 17:04:01 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705191704.v4JH41Zh022291@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Fri, 19 May 2017 17:04:01 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318545 - head/etc
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 17:04:03 -0000
    
    Author: ngie
    Date: Fri May 19 17:04:01 2017
    New Revision: 318545
    URL: https://svnweb.freebsd.org/changeset/base/318545
    
    Log:
      Install {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make install`
      
      I incorrectly started this pattern in r277541 with the opensm newsyslog.conf.d file,
      and continued using it in r318441 and r318443.
      
      This will fix the files being handled improperly via installworld, preventing tools like
      etcupdate, mergemaster, etc from functioning properly when comparing the installed
      contents on a system vs the contents in a source tree when doing merges.
      
      PR:		219404
      Submitted by:	Dan McGregor 
      MFC after:	2 weeks
      MFC with:	r277541, r318441, r318443
      Sponsored by:	Dell EMC Isilon
    
    Modified:
      head/etc/Makefile
    
    Modified: head/etc/Makefile
    ==============================================================================
    --- head/etc/Makefile	Fri May 19 16:22:26 2017	(r318544)
    +++ head/etc/Makefile	Fri May 19 17:04:01 2017	(r318545)
    @@ -7,10 +7,6 @@ FILESGROUPS=	FILES
     
     # No need as it is empty and just causes rebuilds since this file does so much.
     UPDATE_DEPENDFILE=	no
    -SUBDIR=	\
    -	cron.d \
    -	newsyslog.conf.d \
    -	syslog.d
     
     .if ${MK_SENDMAIL} != "no"
     SUBDIR+=sendmail
    @@ -254,9 +250,11 @@ distribution:
     .if ${MK_CASPER} != "no"
     	${_+_}cd ${.CURDIR}/casper; ${MAKE} install
     .endif
    +	${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install
     	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
     	${_+_}cd ${.CURDIR}/devd; ${MAKE} install
     	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
    +	${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
     .if ${MK_NTP} != "no"
     	${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
     .endif
    @@ -266,6 +264,7 @@ distribution:
     .endif
     	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
     	${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
    +	${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
     	${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
     	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
     	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
    
    From owner-svn-src-head@freebsd.org  Fri May 19 17:14:30 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81D86D73236;
     Fri, 19 May 2017 17:14:30 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 5EF86FE5;
     Fri, 19 May 2017 17:14:30 +0000 (UTC)
     (envelope-from ngie@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4JHETUY026882;
     Fri, 19 May 2017 17:14:29 GMT (envelope-from ngie@FreeBSD.org)
    Received: (from ngie@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4JHEToi026880;
     Fri, 19 May 2017 17:14:29 GMT (envelope-from ngie@FreeBSD.org)
    Message-Id: <201705191714.v4JHEToi026880@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: ngie set sender to
     ngie@FreeBSD.org using -f
    From: Ngie Cooper 
    Date: Fri, 19 May 2017 17:14:29 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318546 - in head: contrib/netbsd-tests/fs/tmpfs
     tests/sys/fs/tmpfs
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 17:14:30 -0000
    
    Author: ngie
    Date: Fri May 19 17:14:29 2017
    New Revision: 318546
    URL: https://svnweb.freebsd.org/changeset/base/318546
    
    Log:
      sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic
      
      The previous logic was flawed in the sense that it assumed that /dev/md3
      was always available. This was a caveat I noted in r306038, that I hadn't
      gotten around to solving before now.
      
      Cache the device for the mountpoint after executing mdmfs, then use the
      cached value in basic_cleanup(..) when unmounting/disconnecting the md(4)
      device.
      
      Apply sed expressions to use reuse logic in the NetBSD code that could
      also be applied to FreeBSD, just with different tools.
      
      Differential Revision:	D10766
      MFC after:	1 week
      Reviewed by:	bdrewery
      Sponsored by:	Dell EMC Isilon
    
    Modified:
      head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
      head/tests/sys/fs/tmpfs/Makefile
    
    Modified: head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
    ==============================================================================
    --- head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh	Fri May 19 17:04:01 2017	(r318545)
    +++ head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh	Fri May 19 17:14:29 2017	(r318546)
    @@ -28,6 +28,10 @@
     # Verifies that vnd works with files stored in tmpfs.
     #
     
    +# Begin FreeBSD
    +MD_DEVICE_FILE=md.device
    +# End FreeBSD
    +
     atf_test_case basic cleanup
     basic_head() {
     	atf_set "descr" "Verifies that vnd works with files stored in tmpfs"
    @@ -41,7 +45,10 @@ basic_body() {
     	# Begin FreeBSD
     	if true; then
     		atf_check -s eq:0 -o empty -e empty mkdir mnt
    -		atf_check -s eq:0 -o empty -e empty mdmfs -F disk.img md3 mnt
    +		atf_check -s eq:0 -o empty -e empty mdmfs -F disk.img md mnt
    +		md_dev=$(df mnt | awk 'NR != 1 { print $1 }' | xargs basename)
    +		atf_check test -c /dev/$md_dev # Sanity check
    +		echo -n $md_dev > $TMPDIR/$MD_DEVICE_FILE
     	else
     	# End FreeBSD
     	atf_check -s eq:0 -o empty -e empty vndconfig /dev/vnd3 disk.img
    @@ -67,31 +74,23 @@ basic_body() {
     	done
     
     	atf_check -s eq:0 -o empty -e empty umount mnt
    -	# Begin FreeBSD
    -	if true; then
    -		atf_check -s eq:0 -o empty -e empty mdconfig -d -u 3
    -	else
    -	# End FreeBSD
     	atf_check -s eq:0 -o empty -e empty vndconfig -u /dev/vnd3
    -	# Begin FreeBSD
    -	fi
    -	# End FreeBSD
     
     	test_unmount
     	touch done
     }
     basic_cleanup() {
    +	# Begin FreeBSD
    +	if md_dev=$(cat $TMPDIR/$MD_DEVICE_FILE); then
    +		echo "Will try disconnecting $md_dev"
    +	else
    +		echo "$MD_DEVICE_FILE doesn't exist in $TMPDIR; returning early"
    +		return 0
    +	fi
    +	# End FreeBSD
     	if [ ! -f done ]; then
     		umount mnt 2>/dev/null 1>&2
    -		# Begin FreeBSD
    -		if true; then
    -			[ ! -c /dev/md3 ] || mdconfig -d -u 3
    -		else
    -		# End FreeBSD
     		vndconfig -u /dev/vnd3 2>/dev/null 1>&2
    -		# Begin FreeBSD
    -		fi
    -		# End FreeBSD
     	fi
     }
     
    
    Modified: head/tests/sys/fs/tmpfs/Makefile
    ==============================================================================
    --- head/tests/sys/fs/tmpfs/Makefile	Fri May 19 17:04:01 2017	(r318545)
    +++ head/tests/sys/fs/tmpfs/Makefile	Fri May 19 17:14:29 2017	(r318546)
    @@ -54,6 +54,9 @@ ATF_TESTS_SH_SED_mount_test=		\
     ATF_TESTS_SH_SED_readdir_test=		-e 's,mknod fifo p,mkfifo fifo,g'
     ATF_TESTS_SH_SED_sizes_test=		-e 's,-o -s,-o size=,g'
     ATF_TESTS_SH_SED_statvfs_test=		-e 's,-o -s,-o size=,g'
    +ATF_TESTS_SH_SED_vnd_test=		\
    +					-e 's,vndconfig -u /dev/vnd3,mdconfig -d -u $$md_dev,g' \
    +					-e 's,/dev/vnd3,/dev/$$md_dev,g'
     ATF_TESTS_SH_SED_vnode_leak_test=	-e 's,-o -s,-o size=,g'
     
     .include 
    
    From owner-svn-src-head@freebsd.org  Fri May 19 17:43:51 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D97DD7410B;
     Fri, 19 May 2017 17:43:51 +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 A4B649CB;
     Fri, 19 May 2017 17:43:50 +0000 (UTC) (envelope-from jhb@freebsd.org)
    Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net
     [73.231.226.104])
     by mail.baldwin.cx (Postfix) with ESMTPSA id C888F10A87D;
     Fri, 19 May 2017 13:43:42 -0400 (EDT)
    From: John Baldwin 
    To: Baptiste Daroussin , svn-src-head@freebsd.org
    Cc: svn-src-all@freebsd.org, src-committers@freebsd.org
    Subject: pkgbase and conf files (was Re: svn commit: r318441 - in head/etc: .
     cron.d)
    Date: Fri, 19 May 2017 10:43:30 -0700
    Message-ID: <3548472.irpQCNYL7x@ralph.baldwin.cx>
    User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; )
    In-Reply-To: <20170519163355.rs5w3hr6dltdx7kv@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <9570430.uB7Ojud3DG@ralph.baldwin.cx>
     <20170519163355.rs5w3hr6dltdx7kv@ivaldir.net>
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7Bit
    Content-Type: text/plain; charset="us-ascii"
    X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
     (mail.baldwin.cx); Fri, 19 May 2017 13:43: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.23
    Precedence: list
    List-Id: 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, 19 May 2017 17:43:51 -0000
    
    On Friday, May 19, 2017 06:33:55 PM Baptiste Daroussin wrote:
    > On Fri, May 19, 2017 at 09:17:23AM -0700, John Baldwin wrote:
    > > On Thursday, May 18, 2017 11:24:29 PM Baptiste Daroussin wrote:
    > > I think an upgrade won't bring the file back necessarily (etcupdate warns you
    > > that a removed file changed, but it doesn't bring it back, I think a similar
    > > strategy might be sensible for pkg as well).
    > 
    > I need to check, I do not remember what I did here and I will certainly add a
    > regression test for that to ensure this behaviour is always working as expected.
    
    One nice "feature" to have in pkg for pkgbase would be a way to ask pkg to restore
    a stock configuration file (perhaps with an option to restore it to an alternate
    directory or filename?)  This would imply that packages would need to keep the
    "pristine" conf files around somewhere.  This would also let you do 'pkg confdiff'
    or the like (as a replacement for 'etcupdate diff')
    
    -- 
    John Baldwin
    
    From owner-svn-src-head@freebsd.org  Fri May 19 18:13:43 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45C60D74D49;
     Fri, 19 May 2017 18:13:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0C5231CBE;
     Fri, 19 May 2017 18:13:42 +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 v4JIDgMc051241;
     Fri, 19 May 2017 18:13:42 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4JIDfs9051232;
     Fri, 19 May 2017 18:13:41 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705191813.v4JIDfs9051232@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Fri, 19 May 2017 18:13:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318548 - head/sys/fs/msdosfs
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 18:13:43 -0000
    
    Author: emaste
    Date: Fri May 19 18:13:41 2017
    New Revision: 318548
    URL: https://svnweb.freebsd.org/changeset/base/318548
    
    Log:
      msdosfs: use C99 types
      
      General cleanup, for diff reduction with NetBSD and future use by FAT
      support in makefs.
      
      Submitted by:	Siva Mahadevan 
      Obtained from:	NetBSD
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D10821
    
    Modified:
      head/sys/fs/msdosfs/bootsect.h
      head/sys/fs/msdosfs/bpb.h
      head/sys/fs/msdosfs/denode.h
      head/sys/fs/msdosfs/direntry.h
      head/sys/fs/msdosfs/msdosfs_conv.c
      head/sys/fs/msdosfs/msdosfs_fat.c
      head/sys/fs/msdosfs/msdosfs_lookup.c
      head/sys/fs/msdosfs/msdosfs_vfsops.c
      head/sys/fs/msdosfs/msdosfsmount.h
    
    Modified: head/sys/fs/msdosfs/bootsect.h
    ==============================================================================
    --- head/sys/fs/msdosfs/bootsect.h	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/bootsect.h	Fri May 19 18:13:41 2017	(r318548)
    @@ -25,13 +25,13 @@
      * first sector of a partitioned hard disk.
      */
     struct bootsector33 {
    -	u_int8_t	bsJump[3];		/* jump inst E9xxxx or EBxx90 */
    +	uint8_t		bsJump[3];		/* jump inst E9xxxx or EBxx90 */
     	int8_t		bsOemName[8];		/* OEM name and version */
     	int8_t		bsBPB[19];		/* BIOS parameter block */
     	int8_t		bsDriveNumber;		/* drive number (0x80) */
     	int8_t		bsBootCode[479];	/* pad so struct is 512b */
    -	u_int8_t	bsBootSectSig0;
    -	u_int8_t	bsBootSectSig1;
    +	uint8_t		bsBootSectSig0;
    +	uint8_t		bsBootSectSig1;
     #define	BOOTSIG0	0x55
     #define	BOOTSIG1	0xaa
     };
    @@ -47,25 +47,25 @@ struct extboot {
     };
     
     struct bootsector50 {
    -	u_int8_t	bsJump[3];		/* jump inst E9xxxx or EBxx90 */
    +	uint8_t		bsJump[3];		/* jump inst E9xxxx or EBxx90 */
     	int8_t		bsOemName[8];		/* OEM name and version */
     	int8_t		bsBPB[25];		/* BIOS parameter block */
     	int8_t		bsExt[26];		/* Bootsector Extension */
     	int8_t		bsBootCode[448];	/* pad so structure is 512b */
    -	u_int8_t	bsBootSectSig0;
    -	u_int8_t	bsBootSectSig1;
    +	uint8_t		bsBootSectSig0;
    +	uint8_t		bsBootSectSig1;
     #define	BOOTSIG0	0x55
     #define	BOOTSIG1	0xaa
     };
     
     struct bootsector710 {
    -	u_int8_t	bsJump[3];		/* jump inst E9xxxx or EBxx90 */
    +	uint8_t		bsJump[3];		/* jump inst E9xxxx or EBxx90 */
     	int8_t		bsOEMName[8];		/* OEM name and version */
     	int8_t		bsBPB[53];		/* BIOS parameter block */
     	int8_t		bsExt[26];		/* Bootsector Extension */
     	int8_t		bsBootCode[420];	/* pad so structure is 512b */
    -	u_int8_t	bsBootSectSig0;
    -	u_int8_t	bsBootSectSig1;
    +	uint8_t		bsBootSectSig0;
    +	uint8_t		bsBootSectSig1;
     #define	BOOTSIG0	0x55
     #define	BOOTSIG1	0xaa
     };
    
    Modified: head/sys/fs/msdosfs/bpb.h
    ==============================================================================
    --- head/sys/fs/msdosfs/bpb.h	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/bpb.h	Fri May 19 18:13:41 2017	(r318548)
    @@ -24,17 +24,17 @@
      * BIOS Parameter Block (BPB) for DOS 3.3
      */
     struct bpb33 {
    -	u_int16_t	bpbBytesPerSec;	/* bytes per sector */
    -	u_int8_t	bpbSecPerClust;	/* sectors per cluster */
    -	u_int16_t	bpbResSectors;	/* number of reserved sectors */
    -	u_int8_t	bpbFATs;	/* number of FATs */
    -	u_int16_t	bpbRootDirEnts;	/* number of root directory entries */
    -	u_int16_t	bpbSectors;	/* total number of sectors */
    -	u_int8_t	bpbMedia;	/* media descriptor */
    -	u_int16_t	bpbFATsecs;	/* number of sectors per FAT */
    -	u_int16_t	bpbSecPerTrack;	/* sectors per track */
    -	u_int16_t	bpbHeads;	/* number of heads */
    -	u_int16_t	bpbHiddenSecs;	/* number of hidden sectors */
    +	uint16_t	bpbBytesPerSec;	/* bytes per sector */
    +	uint8_t		bpbSecPerClust;	/* sectors per cluster */
    +	uint16_t	bpbResSectors;	/* number of reserved sectors */
    +	uint8_t		bpbFATs;	/* number of FATs */
    +	uint16_t	bpbRootDirEnts;	/* number of root directory entries */
    +	uint16_t	bpbSectors;	/* total number of sectors */
    +	uint8_t		bpbMedia;	/* media descriptor */
    +	uint16_t	bpbFATsecs;	/* number of sectors per FAT */
    +	uint16_t	bpbSecPerTrack;	/* sectors per track */
    +	uint16_t	bpbHeads;	/* number of heads */
    +	uint16_t	bpbHiddenSecs;	/* number of hidden sectors */
     };
     
     /*
    @@ -42,46 +42,46 @@ struct bpb33 {
      * and bpbHugeSectors is not in the 3.3 bpb.
      */
     struct bpb50 {
    -	u_int16_t	bpbBytesPerSec;	/* bytes per sector */
    -	u_int8_t	bpbSecPerClust;	/* sectors per cluster */
    -	u_int16_t	bpbResSectors;	/* number of reserved sectors */
    -	u_int8_t	bpbFATs;	/* number of FATs */
    -	u_int16_t	bpbRootDirEnts;	/* number of root directory entries */
    -	u_int16_t	bpbSectors;	/* total number of sectors */
    -	u_int8_t	bpbMedia;	/* media descriptor */
    -	u_int16_t	bpbFATsecs;	/* number of sectors per FAT */
    -	u_int16_t	bpbSecPerTrack;	/* sectors per track */
    -	u_int16_t	bpbHeads;	/* number of heads */
    -	u_int32_t	bpbHiddenSecs;	/* # of hidden sectors */
    -	u_int32_t	bpbHugeSectors;	/* # of sectors if bpbSectors == 0 */
    +	uint16_t	bpbBytesPerSec;	/* bytes per sector */
    +	uint8_t		bpbSecPerClust;	/* sectors per cluster */
    +	uint16_t	bpbResSectors;	/* number of reserved sectors */
    +	uint8_t		bpbFATs;	/* number of FATs */
    +	uint16_t	bpbRootDirEnts;	/* number of root directory entries */
    +	uint16_t	bpbSectors;	/* total number of sectors */
    +	uint8_t		bpbMedia;	/* media descriptor */
    +	uint16_t	bpbFATsecs;	/* number of sectors per FAT */
    +	uint16_t	bpbSecPerTrack;	/* sectors per track */
    +	uint16_t	bpbHeads;	/* number of heads */
    +	uint32_t	bpbHiddenSecs;	/* # of hidden sectors */
    +	uint32_t	bpbHugeSectors;	/* # of sectors if bpbSectors == 0 */
     };
     
     /*
      * BPB for DOS 7.10 (FAT32).  This one has a few extensions to bpb50.
      */
     struct bpb710 {
    -	u_int16_t	bpbBytesPerSec;	/* bytes per sector */
    -	u_int8_t	bpbSecPerClust;	/* sectors per cluster */
    -	u_int16_t	bpbResSectors;	/* number of reserved sectors */
    -	u_int8_t	bpbFATs;	/* number of FATs */
    -	u_int16_t	bpbRootDirEnts;	/* number of root directory entries */
    -	u_int16_t	bpbSectors;	/* total number of sectors */
    -	u_int8_t	bpbMedia;	/* media descriptor */
    -	u_int16_t	bpbFATsecs;	/* number of sectors per FAT */
    -	u_int16_t	bpbSecPerTrack;	/* sectors per track */
    -	u_int16_t	bpbHeads;	/* number of heads */
    -	u_int32_t	bpbHiddenSecs;	/* # of hidden sectors */
    -	u_int32_t	bpbHugeSectors;	/* # of sectors if bpbSectors == 0 */
    -	u_int32_t	bpbBigFATsecs;	/* like bpbFATsecs for FAT32 */
    -	u_int16_t	bpbExtFlags;	/* extended flags: */
    +	uint16_t	bpbBytesPerSec;	/* bytes per sector */
    +	uint8_t		bpbSecPerClust;	/* sectors per cluster */
    +	uint16_t	bpbResSectors;	/* number of reserved sectors */
    +	uint8_t		bpbFATs;	/* number of FATs */
    +	uint16_t	bpbRootDirEnts;	/* number of root directory entries */
    +	uint16_t	bpbSectors;	/* total number of sectors */
    +	uint8_t		bpbMedia;	/* media descriptor */
    +	uint16_t	bpbFATsecs;	/* number of sectors per FAT */
    +	uint16_t	bpbSecPerTrack;	/* sectors per track */
    +	uint16_t	bpbHeads;	/* number of heads */
    +	uint32_t	bpbHiddenSecs;	/* # of hidden sectors */
    +	uint32_t	bpbHugeSectors;	/* # of sectors if bpbSectors == 0 */
    +	uint32_t	bpbBigFATsecs;	/* like bpbFATsecs for FAT32 */
    +	uint16_t	bpbExtFlags;	/* extended flags: */
     #define	FATNUM		0xf		/* mask for numbering active FAT */
     #define	FATMIRROR	0x80		/* FAT is mirrored (like it always was) */
    -	u_int16_t	bpbFSVers;	/* filesystem version */
    +	uint16_t	bpbFSVers;	/* filesystem version */
     #define	FSVERS		0		/* currently only 0 is understood */
    -	u_int32_t	bpbRootClust;	/* start cluster for root directory */
    -	u_int16_t	bpbFSInfo;	/* filesystem info structure sector */
    -	u_int16_t	bpbBackup;	/* backup boot sector */
    -	u_int8_t	bpbReserved[12]; /* reserved for future expansion */
    +	uint32_t	bpbRootClust;	/* start cluster for root directory */
    +	uint16_t	bpbFSInfo;	/* filesystem info structure sector */
    +	uint16_t	bpbBackup;	/* backup boot sector */
    +	uint8_t		bpbReserved[12]; /* reserved for future expansion */
     };
     
     /*
    @@ -138,37 +138,37 @@ struct byte_bpb50 {
      * BPB for DOS 7.10 (FAT32).  This one has a few extensions to bpb50.
      */
     struct byte_bpb710 {
    -	u_int8_t bpbBytesPerSec[2];	/* bytes per sector */
    -	u_int8_t bpbSecPerClust;	/* sectors per cluster */
    -	u_int8_t bpbResSectors[2];	/* number of reserved sectors */
    -	u_int8_t bpbFATs;		/* number of FATs */
    -	u_int8_t bpbRootDirEnts[2];	/* number of root directory entries */
    -	u_int8_t bpbSectors[2];		/* total number of sectors */
    -	u_int8_t bpbMedia;		/* media descriptor */
    -	u_int8_t bpbFATsecs[2];		/* number of sectors per FAT */
    -	u_int8_t bpbSecPerTrack[2];	/* sectors per track */
    -	u_int8_t bpbHeads[2];		/* number of heads */
    -	u_int8_t bpbHiddenSecs[4];	/* # of hidden sectors */
    -	u_int8_t bpbHugeSectors[4];	/* # of sectors if bpbSectors == 0 */
    -	u_int8_t bpbBigFATsecs[4];	/* like bpbFATsecs for FAT32 */
    -	u_int8_t bpbExtFlags[2];	/* extended flags: */
    -	u_int8_t bpbFSVers[2];		/* filesystem version */
    -	u_int8_t bpbRootClust[4];	/* start cluster for root directory */
    -	u_int8_t bpbFSInfo[2];		/* filesystem info structure sector */
    -	u_int8_t bpbBackup[2];		/* backup boot sector */
    -	u_int8_t bpbReserved[12];	/* reserved for future expansion */
    +	uint8_t bpbBytesPerSec[2];	/* bytes per sector */
    +	uint8_t bpbSecPerClust;		/* sectors per cluster */
    +	uint8_t bpbResSectors[2];	/* number of reserved sectors */
    +	uint8_t bpbFATs;		/* number of FATs */
    +	uint8_t bpbRootDirEnts[2];	/* number of root directory entries */
    +	uint8_t bpbSectors[2];		/* total number of sectors */
    +	uint8_t bpbMedia;		/* media descriptor */
    +	uint8_t bpbFATsecs[2];		/* number of sectors per FAT */
    +	uint8_t bpbSecPerTrack[2];	/* sectors per track */
    +	uint8_t bpbHeads[2];		/* number of heads */
    +	uint8_t bpbHiddenSecs[4];	/* # of hidden sectors */
    +	uint8_t bpbHugeSectors[4];	/* # of sectors if bpbSectors == 0 */
    +	uint8_t bpbBigFATsecs[4];	/* like bpbFATsecs for FAT32 */
    +	uint8_t bpbExtFlags[2];		/* extended flags: */
    +	uint8_t bpbFSVers[2];		/* filesystem version */
    +	uint8_t bpbRootClust[4];	/* start cluster for root directory */
    +	uint8_t bpbFSInfo[2];		/* filesystem info structure sector */
    +	uint8_t bpbBackup[2];		/* backup boot sector */
    +	uint8_t bpbReserved[12];	/* reserved for future expansion */
     };
     
     /*
      * FAT32 FSInfo block.
      */
     struct fsinfo {
    -	u_int8_t fsisig1[4];
    -	u_int8_t fsifill1[480];
    -	u_int8_t fsisig2[4];
    -	u_int8_t fsinfree[4];
    -	u_int8_t fsinxtfree[4];
    -	u_int8_t fsifill2[12];
    -	u_int8_t fsisig3[4];
    +	uint8_t fsisig1[4];
    +	uint8_t fsifill1[480];
    +	uint8_t fsisig2[4];
    +	uint8_t fsinfree[4];
    +	uint8_t fsinxtfree[4];
    +	uint8_t fsifill2[12];
    +	uint8_t fsisig3[4];
     };
     #endif /* !_FS_MSDOSFS_BPB_H_ */
    
    Modified: head/sys/fs/msdosfs/denode.h
    ==============================================================================
    --- head/sys/fs/msdosfs/denode.h	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/denode.h	Fri May 19 18:13:41 2017	(r318548)
    @@ -158,7 +158,7 @@ struct denode {
     	u_long de_FileSize;	/* size of file in bytes */
     	struct fatcache de_fc[FC_SIZE];	/* fat cache */
     	u_quad_t de_modrev;	/* Revision level for lease. */
    -	u_int64_t de_inode;	/* Inode number (really byte offset of direntry) */
    +	uint64_t de_inode;	/* Inode number (really byte offset of direntry) */
     };
     
     /*
    @@ -224,7 +224,7 @@ struct denode {
     		break;							\
     	}								\
     	if ((dep)->de_flag & DE_ACCESS) {				\
    -		u_int16_t adate;					\
    +		uint16_t adate;						\
     									\
     		timespec2fattime((acc), 0, &adate, NULL, NULL);		\
     		if (adate != (dep)->de_ADate) {				\
    @@ -247,10 +247,10 @@ struct defid {
     	u_short defid_len;	/* length of structure */
     	u_short defid_pad;	/* force long alignment */
     
    -	u_int32_t defid_dirclust; /* cluster this dir entry came from */
    -	u_int32_t defid_dirofs;	/* offset of entry within the cluster */
    +	uint32_t defid_dirclust; /* cluster this dir entry came from */
    +	uint32_t defid_dirofs;	/* offset of entry within the cluster */
     #if 0
    -	u_int32_t defid_gen;	/* generation number */
    +	uint32_t defid_gen;	/* generation number */
     #endif
     };
     
    
    Modified: head/sys/fs/msdosfs/direntry.h
    ==============================================================================
    --- head/sys/fs/msdosfs/direntry.h	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/direntry.h	Fri May 19 18:13:41 2017	(r318548)
    @@ -54,11 +54,11 @@
      * Structure of a dos directory entry.
      */
     struct direntry {
    -	u_int8_t	deName[11];	/* filename, blank filled */
    +	uint8_t		deName[11];	/* filename, blank filled */
     #define	SLOT_EMPTY	0x00		/* slot has never been used */
     #define	SLOT_E5		0x05		/* the real value is 0xe5 */
     #define	SLOT_DELETED	0xe5		/* file in this slot deleted */
    -	u_int8_t	deAttributes;	/* file attributes */
    +	uint8_t		deAttributes;	/* file attributes */
     #define	ATTR_NORMAL	0x00		/* normal file */
     #define	ATTR_READONLY	0x01		/* file is readonly */
     #define	ATTR_HIDDEN	0x02		/* file is hidden */
    @@ -66,35 +66,35 @@ struct direntry {
     #define	ATTR_VOLUME	0x08		/* entry is a volume label */
     #define	ATTR_DIRECTORY	0x10		/* entry is a directory name */
     #define	ATTR_ARCHIVE	0x20		/* file is new or modified */
    -	u_int8_t	deLowerCase;	/* NT VFAT lower case flags */
    +	uint8_t		deLowerCase;	/* NT VFAT lower case flags */
     #define	LCASE_BASE	0x08		/* filename base in lower case */
     #define	LCASE_EXT	0x10		/* filename extension in lower case */
    -	u_int8_t	deCHundredth;	/* hundredth of seconds in CTime */
    -	u_int8_t	deCTime[2];	/* create time */
    -	u_int8_t	deCDate[2];	/* create date */
    -	u_int8_t	deADate[2];	/* access date */
    -	u_int8_t	deHighClust[2];	/* high bytes of cluster number */
    -	u_int8_t	deMTime[2];	/* last update time */
    -	u_int8_t	deMDate[2];	/* last update date */
    -	u_int8_t	deStartCluster[2]; /* starting cluster of file */
    -	u_int8_t	deFileSize[4];	/* size of file in bytes */
    +	uint8_t		deCHundredth;	/* hundredth of seconds in CTime */
    +	uint8_t		deCTime[2];	/* create time */
    +	uint8_t		deCDate[2];	/* create date */
    +	uint8_t		deADate[2];	/* access date */
    +	uint8_t		deHighClust[2];	/* high bytes of cluster number */
    +	uint8_t		deMTime[2];	/* last update time */
    +	uint8_t		deMDate[2];	/* last update date */
    +	uint8_t		deStartCluster[2]; /* starting cluster of file */
    +	uint8_t		deFileSize[4];	/* size of file in bytes */
     };
     
     /*
      * Structure of a Win95 long name directory entry
      */
     struct winentry {
    -	u_int8_t	weCnt;
    +	uint8_t		weCnt;
     #define	WIN_LAST	0x40
     #define	WIN_CNT		0x3f
    -	u_int8_t	wePart1[10];
    -	u_int8_t	weAttributes;
    +	uint8_t		wePart1[10];
    +	uint8_t		weAttributes;
     #define	ATTR_WIN95	0x0f
    -	u_int8_t	weReserved1;
    -	u_int8_t	weChksum;
    -	u_int8_t	wePart2[12];
    -	u_int16_t	weReserved2;
    -	u_int8_t	wePart3[4];
    +	uint8_t		weReserved1;
    +	uint8_t		weChksum;
    +	uint8_t		wePart2[12];
    +	uint16_t	weReserved2;
    +	uint8_t		wePart3[4];
     };
     #define	WIN_CHARS	13	/* Number of chars per winentry */
     
    @@ -156,7 +156,7 @@ int	winChkName(struct mbnambuf *nbp, con
     	    int chksum, struct msdosfsmount *pmp);
     int	win2unixfn(struct mbnambuf *nbp, struct winentry *wep, int chksum,
     	    struct msdosfsmount *pmp);
    -u_int8_t winChksum(u_int8_t *name);
    +uint8_t winChksum(uint8_t *name);
     int	winSlotCnt(const u_char *un, size_t unlen, struct msdosfsmount *pmp);
     size_t	winLenFixup(const u_char *un, size_t unlen);
     #endif	/* _KERNEL */
    
    Modified: head/sys/fs/msdosfs/msdosfs_conv.c
    ==============================================================================
    --- head/sys/fs/msdosfs/msdosfs_conv.c	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/msdosfs_conv.c	Fri May 19 18:13:41 2017	(r318548)
    @@ -62,9 +62,9 @@ extern struct iconv_functions *msdosfs_i
     
     static int mbsadjpos(const char **, size_t, size_t, int, int, void *handle);
     static u_char * dos2unixchr(u_char *, const u_char **, size_t *, int, struct msdosfsmount *);
    -static u_int16_t unix2doschr(const u_char **, size_t *, struct msdosfsmount *);
    -static u_char * win2unixchr(u_char *, u_int16_t, struct msdosfsmount *);
    -static u_int16_t unix2winchr(const u_char **, size_t *, int, struct msdosfsmount *);
    +static uint16_t unix2doschr(const u_char **, size_t *, struct msdosfsmount *);
    +static u_char * win2unixchr(u_char *, uint16_t, struct msdosfsmount *);
    +static uint16_t unix2winchr(const u_char **, size_t *, int, struct msdosfsmount *);
     
     /*
      * 0 - character disallowed in long file name.
    @@ -303,7 +303,7 @@ unix2dosfn(const u_char *un, u_char dn[1
     	int conv = 1;
     	const u_char *cp, *dp, *dp1;
     	u_char gentext[6], *wcp;
    -	u_int16_t c;
    +	uint16_t c;
     
     	/*
     	 * Fill the dos filename string with blanks. These are DOS's pad
    @@ -518,9 +518,9 @@ int
     unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt,
         int chksum, struct msdosfsmount *pmp)
     {
    -	u_int8_t *wcp;
    +	uint8_t *wcp;
     	int i, end;
    -	u_int16_t code;
    +	uint16_t code;
     
     	/*
     	 * Drop trailing blanks and dots
    @@ -536,7 +536,7 @@ unix2winfn(const u_char *un, size_t unle
     	/*
     	 * Initialize winentry to some useful default
     	 */
    -	for (wcp = (u_int8_t *)wep, i = sizeof(*wep); --i >= 0; *wcp++ = 0xff);
    +	for (wcp = (uint8_t *)wep, i = sizeof(*wep); --i >= 0; *wcp++ = 0xff);
     	wep->weCnt = cnt;
     	wep->weAttributes = ATTR_WIN95;
     	wep->weReserved1 = 0;
    @@ -583,7 +583,7 @@ winChkName(struct mbnambuf *nbp, const u
         struct msdosfsmount *pmp)
     {
     	size_t len;
    -	u_int16_t c1, c2;
    +	uint16_t c1, c2;
     	u_char *np;
     	struct dirent dirbuf;
     
    @@ -630,9 +630,9 @@ win2unixfn(struct mbnambuf *nbp, struct 
         struct msdosfsmount *pmp)
     {
     	u_char *c, tmpbuf[5];
    -	u_int8_t *cp;
    -	u_int8_t *np, name[WIN_CHARS * 3 + 1];
    -	u_int16_t code;
    +	uint8_t *cp;
    +	uint8_t *np, name[WIN_CHARS * 3 + 1];
    +	uint16_t code;
     	int i;
     
     	if ((wep->weCnt&WIN_CNT) > howmany(WIN_MAXLEN, WIN_CHARS)
    @@ -722,11 +722,11 @@ win2unixfn(struct mbnambuf *nbp, struct 
     /*
      * Compute the unrolled checksum of a DOS filename for Win95 LFN use.
      */
    -u_int8_t
    -winChksum(u_int8_t *name)
    +uint8_t
    +winChksum(uint8_t *name)
     {
     	int i;
    -	u_int8_t s;
    +	uint8_t s;
     
     	for (s = 0, i = 11; --i >= 0; s += *name++)
     		s = (s << 7)|(s >> 1);
    @@ -838,12 +838,12 @@ dos2unixchr(u_char *outbuf, const u_char
     /*
      * Convert Local char to DOS char
      */
    -static u_int16_t
    +static uint16_t
     unix2doschr(const u_char **instr, size_t *ilen, struct msdosfsmount *pmp)
     {
     	u_char c;
     	char *up, *outp, unicode[3], outbuf[3];
    -	u_int16_t wc;
    +	uint16_t wc;
     	size_t len, ucslen, unixlen, olen;
     
     	if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) {
    @@ -909,14 +909,14 @@ unix2doschr(const u_char **instr, size_t
     	c = *(*instr)++;
     	c = l2u[c];
     	c = unix2dos[c];
    -	return ((u_int16_t)c);
    +	return ((uint16_t)c);
     }
     
     /*
      * Convert Windows char to Local char
      */
     static u_char *
    -win2unixchr(u_char *outbuf, u_int16_t wc, struct msdosfsmount *pmp)
    +win2unixchr(u_char *outbuf, uint16_t wc, struct msdosfsmount *pmp)
     {
     	u_char *inp, *outp, inbuf[3];
     	size_t ilen, olen, len;
    @@ -951,11 +951,11 @@ win2unixchr(u_char *outbuf, u_int16_t wc
     /*
      * Convert Local char to Windows char
      */
    -static u_int16_t
    +static uint16_t
     unix2winchr(const u_char **instr, size_t *ilen, int lower, struct msdosfsmount *pmp)
     {
     	u_char *outp, outbuf[3];
    -	u_int16_t wc;
    +	uint16_t wc;
     	size_t olen;
     
     	if (*ilen == 0)
    
    Modified: head/sys/fs/msdosfs/msdosfs_fat.c
    ==============================================================================
    --- head/sys/fs/msdosfs/msdosfs_fat.c	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/msdosfs_fat.c	Fri May 19 18:13:41 2017	(r318548)
    @@ -338,9 +338,9 @@ updatefats(struct msdosfsmount *pmp, str
     			bcopy(bp->b_data, bpn->b_data, bp->b_bcount);
     			/* Force the clean bit on in the other copies. */
     			if (cleanfat == 16)
    -				((u_int8_t *)bpn->b_data)[3] |= 0x80;
    +				((uint8_t *)bpn->b_data)[3] |= 0x80;
     			else if (cleanfat == 32)
    -				((u_int8_t *)bpn->b_data)[7] |= 0x08;
    +				((uint8_t *)bpn->b_data)[7] |= 0x08;
     			if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS)
     				bwrite(bpn);
     			else
    
    Modified: head/sys/fs/msdosfs/msdosfs_lookup.c
    ==============================================================================
    --- head/sys/fs/msdosfs/msdosfs_lookup.c	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/msdosfs_lookup.c	Fri May 19 18:13:41 2017	(r318548)
    @@ -62,7 +62,7 @@
     #include 
     
     static int msdosfs_lookup_(struct vnode *vdp, struct vnode **vpp,
    -    struct componentname *cnp, u_int64_t *inum);
    +    struct componentname *cnp, uint64_t *inum);
     
     int
     msdosfs_lookup(struct vop_cachedlookup_args *ap)
    @@ -110,7 +110,7 @@ msdosfs_deget_dotdot(struct mount *mp, v
      */
     static int
     msdosfs_lookup_(struct vnode *vdp, struct vnode **vpp,
    -    struct componentname *cnp, u_int64_t *dd_inum)
    +    struct componentname *cnp, uint64_t *dd_inum)
     {
     	struct mbnambuf nb;
     	daddr_t bn;
    @@ -135,7 +135,7 @@ msdosfs_lookup_(struct vnode *vdp, struc
     	int flags = cnp->cn_flags;
     	int nameiop = cnp->cn_nameiop;
     	int unlen;
    -	u_int64_t inode1;
    +	uint64_t inode1;
     
     	int wincnt = 1;
     	int chksum = -1, chksum_ok;
    @@ -656,7 +656,7 @@ createde(struct denode *dep, struct deno
     	 * Now write the Win95 long name
     	 */
     	if (ddep->de_fndcnt > 0) {
    -		u_int8_t chksum = winChksum(ndep->deName);
    +		uint8_t chksum = winChksum(ndep->deName);
     		const u_char *un = (const u_char *)cnp->cn_nameptr;
     		int unlen = cnp->cn_namelen;
     		int cnt = 1;
    
    Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
    ==============================================================================
    --- head/sys/fs/msdosfs/msdosfs_vfsops.c	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/msdosfs_vfsops.c	Fri May 19 18:13:41 2017	(r318548)
    @@ -398,7 +398,7 @@ mountmsdosfs(struct vnode *devvp, struct
     	struct byte_bpb33 *b33;
     	struct byte_bpb50 *b50;
     	struct byte_bpb710 *b710;
    -	u_int8_t SecPerClust;
    +	uint8_t SecPerClust;
     	u_long clusters;
     	int ronly, error;
     	struct g_consumer *cp;
    
    Modified: head/sys/fs/msdosfs/msdosfsmount.h
    ==============================================================================
    --- head/sys/fs/msdosfs/msdosfsmount.h	Fri May 19 18:07:28 2017	(r318547)
    +++ head/sys/fs/msdosfs/msdosfsmount.h	Fri May 19 18:13:41 2017	(r318548)
    @@ -96,7 +96,7 @@ struct msdosfsmount {
     	u_long pm_fatblocksize;	/* size of fat blocks in bytes */
     	u_long pm_fatblocksec;	/* size of fat blocks in sectors */
     	u_long pm_fatsize;	/* size of fat in bytes */
    -	u_int32_t pm_fatmask;	/* mask to use for fat numbers */
    +	uint32_t pm_fatmask;	/* mask to use for fat numbers */
     	u_long pm_fsinfo;	/* fsinfo block number */
     	u_long pm_nxtfree;	/* next place to search for a free cluster */
     	u_int pm_fatmult;	/* these 2 values are used in fat */
    @@ -108,7 +108,7 @@ struct msdosfsmount {
     	void *pm_w2u;	/* Unicode->Local iconv handle */
     	void *pm_u2d;	/* Unicode->DOS iconv handle */
     	void *pm_d2u;	/* DOS->Local iconv handle */
    -	u_int32_t pm_nfileno;	/* next 32-bit fileno */
    +	uint32_t pm_nfileno;	/* next 32-bit fileno */
     	RB_HEAD(msdosfs_filenotree, msdosfs_fileno)
     	    pm_filenos; /* 64<->32-bit fileno mapping */
     	struct lock pm_fatlock;	/* lockmgr protecting allocations and rb tree */
    @@ -240,7 +240,7 @@ struct msdosfs_args {
     	mode_t	mask;		/* file mask to be applied for msdosfs perms */
     	int	flags;		/* see below */
     	int	unused1;	/* unused, was version number */
    -	u_int16_t unused2[128];	/* no longer used, was Local->Unicode table */
    +	uint16_t unused2[128];	/* no longer used, was Local->Unicode table */
     	char	*cs_win;	/* Windows(Unicode) Charset */
     	char	*cs_dos;	/* DOS Charset */
     	char	*cs_local;	/* Local Charset */
    
    From owner-svn-src-head@freebsd.org  Fri May 19 20:02:34 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 545B6D74E17;
     Fri, 19 May 2017 20:02:34 +0000 (UTC)
     (envelope-from maxim@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 21259ECE;
     Fri, 19 May 2017 20:02:34 +0000 (UTC)
     (envelope-from maxim@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4JK2Xoo099044;
     Fri, 19 May 2017 20:02:33 GMT (envelope-from maxim@FreeBSD.org)
    Received: (from maxim@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4JK2XBn099043;
     Fri, 19 May 2017 20:02:33 GMT (envelope-from maxim@FreeBSD.org)
    Message-Id: <201705192002.v4JK2XBn099043@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: maxim set sender to
     maxim@FreeBSD.org using -f
    From: Maxim Konovalov 
    Date: Fri, 19 May 2017 20:02:33 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318550 - head/usr.sbin/devctl
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 20:02:34 -0000
    
    Author: maxim
    Date: Fri May 19 20:02:32 2017
    New Revision: 318550
    URL: https://svnweb.freebsd.org/changeset/base/318550
    
    Log:
      o Missed flag restored.
      
      PR:		219395
      Submitted by:	Tiwei Bie
    
    Modified:
      head/usr.sbin/devctl/devctl.8
    
    Modified: head/usr.sbin/devctl/devctl.8
    ==============================================================================
    --- head/usr.sbin/devctl/devctl.8	Fri May 19 18:23:44 2017	(r318549)
    +++ head/usr.sbin/devctl/devctl.8	Fri May 19 20:02:32 2017	(r318550)
    @@ -156,7 +156,7 @@ the device will not be changed.
     Rescan a bus device checking for devices that have been added or
     removed.
     .It Xo Cm delete
    -.Op Fl
    +.Op Fl f
     .Ar device
     .Xc
     Delete the device from the device tree.
    
    From owner-svn-src-head@freebsd.org  Fri May 19 22:54:46 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id B91D7D74824;
     Fri, 19 May 2017 22:54:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 863A2EF1;
     Fri, 19 May 2017 22:54:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4JMsjcH070375;
     Fri, 19 May 2017 22:54:45 GMT (envelope-from jhb@FreeBSD.org)
    Received: (from jhb@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4JMsj0V070374;
     Fri, 19 May 2017 22:54:45 GMT (envelope-from jhb@FreeBSD.org)
    Message-Id: <201705192254.v4JMsj0V070374@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
     using -f
    From: John Baldwin 
    Date: Fri, 19 May 2017 22:54:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318562 - head/sys/arm/conf
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 19 May 2017 22:54:46 -0000
    
    Author: jhb
    Date: Fri May 19 22:54:45 2017
    New Revision: 318562
    URL: https://svnweb.freebsd.org/changeset/base/318562
    
    Log:
      Exclude ccr(4) from arm LINT since it excludes cxgbe(4).
    
    Modified:
      head/sys/arm/conf/NOTES
    
    Modified: head/sys/arm/conf/NOTES
    ==============================================================================
    --- head/sys/arm/conf/NOTES	Fri May 19 21:20:01 2017	(r318561)
    +++ head/sys/arm/conf/NOTES	Fri May 19 22:54:45 2017	(r318562)
    @@ -79,6 +79,7 @@ nodevice	snake_saver
     nodevice	star_saver
     nodevice	warp_saver
     
    +nodevice	ccr
     nodevice	cxgbe
     nodevice	cxgbev
     nodevice	snd_cmi
    
    From owner-svn-src-head@freebsd.org  Sat May 20 00:42:48 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE632D7336E;
     Sat, 20 May 2017 00:42:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id A0621108E;
     Sat, 20 May 2017 00:42:48 +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 v4K0gltp014983;
     Sat, 20 May 2017 00:42:47 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4K0glEV014982;
     Sat, 20 May 2017 00:42:47 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705200042.v4K0glEV014982@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Sat, 20 May 2017 00:42:47 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318565 - head/usr.bin/grep
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 00:42:48 -0000
    
    Author: emaste
    Date: Sat May 20 00:42:47 2017
    New Revision: 318565
    URL: https://svnweb.freebsd.org/changeset/base/318565
    
    Log:
      bsdgrep: fix segfault with --mmap
      
      r313948 partially fixed --mmap behavior but was incomplete.  This commit
      generally reverts it and does it the more correct way- by just consuming
      the rest of the buffer and moving on.
      
      PR:		219402
      Submitted by:	Kyle Evans 
      Reviewed by:	cem
      Differential Revision:	https://reviews.freebsd.org/D10820
    
    Modified:
      head/usr.bin/grep/file.c
    
    Modified: head/usr.bin/grep/file.c
    ==============================================================================
    --- head/usr.bin/grep/file.c	Sat May 20 00:41:12 2017	(r318564)
    +++ head/usr.bin/grep/file.c	Sat May 20 00:42:47 2017	(r318565)
    @@ -213,24 +213,24 @@ grep_fgetln(struct file *f, size_t *lenp
     		if (grep_lnbufgrow(len + LNBUFBUMP))
     			goto error;
     		memcpy(lnbuf + off, bufpos, len - off);
    +		/* With FILE_MMAP, this is EOF; there's no more to refill */
    +		if (filebehave == FILE_MMAP) {
    +			bufrem -= len;
    +			break;
    +		}
     		off = len;
    +		/* Fetch more to try and find EOL/EOF */
     		if (grep_refill(f) != 0)
     			goto error;
     		if (bufrem == 0)
     			/* EOF: return partial line */
     			break;
    -		if ((p = memchr(bufpos, fileeol, bufrem)) == NULL &&
    -		    filebehave != FILE_MMAP)
    +		if ((p = memchr(bufpos, fileeol, bufrem)) == NULL)
     			continue;
    -		if (p == NULL) {
    -			/* mmap EOF: return partial line, consume buffer */
    -			diff = len;
    -		} else {
    -			/* got it: finish up the line (like code above) */
    -			++p;
    -			diff = p - bufpos;
    -			len += diff;
    -		}
    +		/* got it: finish up the line (like code above) */
    +		++p;
    +		diff = p - bufpos;
    +		len += diff;
     		if (grep_lnbufgrow(len))
     		    goto error;
     		memcpy(lnbuf + off, bufpos, diff);
    
    From owner-svn-src-head@freebsd.org  Sat May 20 00:43:54 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B3B4D73414;
     Sat, 20 May 2017 00:43:54 +0000 (UTC)
     (envelope-from adrian@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 3E5801232;
     Sat, 20 May 2017 00:43:54 +0000 (UTC)
     (envelope-from adrian@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4K0hr29015100;
     Sat, 20 May 2017 00:43:53 GMT (envelope-from adrian@FreeBSD.org)
    Received: (from adrian@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4K0hqjB015092;
     Sat, 20 May 2017 00:43:52 GMT (envelope-from adrian@FreeBSD.org)
    Message-Id: <201705200043.v4K0hqjB015092@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: adrian set sender to
     adrian@FreeBSD.org using -f
    From: Adrian Chadd 
    Date: Sat, 20 May 2017 00:43:52 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318566 - head/sys/net80211
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 00:43:54 -0000
    
    Author: adrian
    Date: Sat May 20 00:43:52 2017
    New Revision: 318566
    URL: https://svnweb.freebsd.org/changeset/base/318566
    
    Log:
      [net80211] prepare for A-MSDU/A-MPDU offload crypto / sequence number checking.
      
      When doing AMSDU offload, the driver (for now!) presents 802.11 frames with
      the same sequence number and crypto sequence number / IV values up to the stack.
      But, this will trip afoul over the sequence number detection.
      
      So drivers now have a way to signify that a frame is part of an offloaded
      AMSDU group, so we can just ensure that we pass those frames up to the
      stack.
      
      The logic will be a bit messy - the TL;DR will be that if it's part of
      the previously seen sequence number then it belongs in the same burst.
      But if we get a repeat of the same sequence number (eg we sent an ACK
      but the receiver didn't hear it) then we shouldn't be passing those frames
      up.  So, we can't just say "all subframes go up", we need to track
      whether we've seen the end of a burst of frames for the given sequence
      number or not, so we know whether to actually pass them up or not.
      
      The first part of doing all of this is to ensure the ieee80211_rx_stats
      struct is available in the RX sequence number check path and the
      RX ampdu reorder path.  So, start by passing the pointer into these
      functions to avoid doing another lookup.
      
      The actual support will come in a subsequent commit once I know the
      functionality actually works!
    
    Modified:
      head/sys/net80211/ieee80211_adhoc.c
      head/sys/net80211/ieee80211_hostap.c
      head/sys/net80211/ieee80211_ht.c
      head/sys/net80211/ieee80211_ht.h
      head/sys/net80211/ieee80211_input.h
      head/sys/net80211/ieee80211_mesh.c
      head/sys/net80211/ieee80211_sta.c
      head/sys/net80211/ieee80211_wds.c
    
    Modified: head/sys/net80211/ieee80211_adhoc.c
    ==============================================================================
    --- head/sys/net80211/ieee80211_adhoc.c	Sat May 20 00:42:47 2017	(r318565)
    +++ head/sys/net80211/ieee80211_adhoc.c	Sat May 20 00:43:52 2017	(r318566)
    @@ -448,7 +448,7 @@ adhoc_input(struct ieee80211_node *ni, s
     			if (IEEE80211_QOS_HAS_SEQ(wh) &&
     			    TID_TO_WME_AC(tid) >= WME_AC_VI)
     				ic->ic_wme.wme_hipri_traffic++;
    -			if (! ieee80211_check_rxseq(ni, wh, bssid))
    +			if (! ieee80211_check_rxseq(ni, wh, bssid, rxs))
     				goto out;
     		}
     	}
    @@ -479,7 +479,7 @@ adhoc_input(struct ieee80211_node *ni, s
     		 * and we should do nothing more with it.
     		 */
     		if ((m->m_flags & M_AMPDU) &&
    -		    ieee80211_ampdu_reorder(ni, m) != 0) {
    +		    ieee80211_ampdu_reorder(ni, m, rxs) != 0) {
     			m = NULL;
     			goto out;
     		}
    
    Modified: head/sys/net80211/ieee80211_hostap.c
    ==============================================================================
    --- head/sys/net80211/ieee80211_hostap.c	Sat May 20 00:42:47 2017	(r318565)
    +++ head/sys/net80211/ieee80211_hostap.c	Sat May 20 00:43:52 2017	(r318566)
    @@ -577,7 +577,7 @@ hostap_input(struct ieee80211_node *ni, 
     			if (IEEE80211_QOS_HAS_SEQ(wh) &&
     			    TID_TO_WME_AC(tid) >= WME_AC_VI)
     				ic->ic_wme.wme_hipri_traffic++;
    -			if (! ieee80211_check_rxseq(ni, wh, bssid))
    +			if (! ieee80211_check_rxseq(ni, wh, bssid, rxs))
     				goto out;
     		}
     	}
    @@ -665,7 +665,7 @@ hostap_input(struct ieee80211_node *ni, 
     		 * and we should do nothing more with it.
     		 */
     		if ((m->m_flags & M_AMPDU) &&
    -		    ieee80211_ampdu_reorder(ni, m) != 0) {
    +		    ieee80211_ampdu_reorder(ni, m, rxs) != 0) {
     			m = NULL;
     			goto out;
     		}
    
    Modified: head/sys/net80211/ieee80211_ht.c
    ==============================================================================
    --- head/sys/net80211/ieee80211_ht.c	Sat May 20 00:42:47 2017	(r318565)
    +++ head/sys/net80211/ieee80211_ht.c	Sat May 20 00:43:52 2017	(r318566)
    @@ -849,7 +849,8 @@ ampdu_rx_flush_upto(struct ieee80211_nod
      * the frame should be processed normally by the caller.
      */
     int
    -ieee80211_ampdu_reorder(struct ieee80211_node *ni, struct mbuf *m)
    +ieee80211_ampdu_reorder(struct ieee80211_node *ni, struct mbuf *m,
    +    const struct ieee80211_rx_stats *rxs)
     {
     #define	PROCESS		0	/* caller should process frame */
     #define	CONSUMED	1	/* frame consumed, caller does nothing */
    
    Modified: head/sys/net80211/ieee80211_ht.h
    ==============================================================================
    --- head/sys/net80211/ieee80211_ht.h	Sat May 20 00:42:47 2017	(r318565)
    +++ head/sys/net80211/ieee80211_ht.h	Sat May 20 00:43:52 2017	(r318566)
    @@ -185,7 +185,8 @@ int	ieee80211_setup_htrates(struct ieee8
     void	ieee80211_setup_basic_htrates(struct ieee80211_node *,
     		const uint8_t *htinfo);
     struct mbuf *ieee80211_decap_amsdu(struct ieee80211_node *, struct mbuf *);
    -int	ieee80211_ampdu_reorder(struct ieee80211_node *, struct mbuf *);
    +int	ieee80211_ampdu_reorder(struct ieee80211_node *, struct mbuf *,
    +	    const struct ieee80211_rx_stats *);
     void	ieee80211_recv_bar(struct ieee80211_node *, struct mbuf *);
     void	ieee80211_ht_node_init(struct ieee80211_node *);
     void	ieee80211_ht_node_cleanup(struct ieee80211_node *);
    
    Modified: head/sys/net80211/ieee80211_input.h
    ==============================================================================
    --- head/sys/net80211/ieee80211_input.h	Sat May 20 00:42:47 2017	(r318565)
    +++ head/sys/net80211/ieee80211_input.h	Sat May 20 00:43:52 2017	(r318566)
    @@ -158,7 +158,7 @@ ishtinfooui(const uint8_t *frm)
      */
     static __inline int
     ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh,
    -    uint8_t *bssid)
    +    uint8_t *bssid, const struct ieee80211_rx_stats *rxs)
     {
     #define	SEQ_LEQ(a,b)	((int)((a)-(b)) <= 0)
     #define	SEQ_EQ(a,b)	((int)((a)-(b)) == 0)
    
    Modified: head/sys/net80211/ieee80211_mesh.c
    ==============================================================================
    --- head/sys/net80211/ieee80211_mesh.c	Sat May 20 00:42:47 2017	(r318565)
    +++ head/sys/net80211/ieee80211_mesh.c	Sat May 20 00:43:52 2017	(r318566)
    @@ -1580,7 +1580,7 @@ mesh_input(struct ieee80211_node *ni, st
     			if (IEEE80211_QOS_HAS_SEQ(wh) &&
     			    TID_TO_WME_AC(tid) >= WME_AC_VI)
     				ic->ic_wme.wme_hipri_traffic++;
    -			if (! ieee80211_check_rxseq(ni, wh, wh->i_addr1))
    +			if (! ieee80211_check_rxseq(ni, wh, wh->i_addr1, rxs))
     				goto out;
     		}
     	}
    
    Modified: head/sys/net80211/ieee80211_sta.c
    ==============================================================================
    --- head/sys/net80211/ieee80211_sta.c	Sat May 20 00:42:47 2017	(r318565)
    +++ head/sys/net80211/ieee80211_sta.c	Sat May 20 00:43:52 2017	(r318566)
    @@ -648,7 +648,7 @@ sta_input(struct ieee80211_node *ni, str
     			if (IEEE80211_QOS_HAS_SEQ(wh) &&
     			    TID_TO_WME_AC(tid) >= WME_AC_VI)
     				ic->ic_wme.wme_hipri_traffic++;
    -			if (! ieee80211_check_rxseq(ni, wh, bssid))
    +			if (! ieee80211_check_rxseq(ni, wh, bssid, rxs))
     				goto out;
     		}
     	}
    @@ -673,7 +673,7 @@ sta_input(struct ieee80211_node *ni, str
     		if ((m->m_flags & M_AMPDU) &&
     		    (dir == IEEE80211_FC1_DIR_FROMDS ||
     		     dir == IEEE80211_FC1_DIR_DSTODS) &&
    -		    ieee80211_ampdu_reorder(ni, m) != 0) {
    +		    ieee80211_ampdu_reorder(ni, m, rxs) != 0) {
     			m = NULL;
     			goto out;
     		}
    
    Modified: head/sys/net80211/ieee80211_wds.c
    ==============================================================================
    --- head/sys/net80211/ieee80211_wds.c	Sat May 20 00:42:47 2017	(r318565)
    +++ head/sys/net80211/ieee80211_wds.c	Sat May 20 00:43:52 2017	(r318566)
    @@ -504,7 +504,7 @@ wds_input(struct ieee80211_node *ni, str
     		if (IEEE80211_QOS_HAS_SEQ(wh) &&
     		    TID_TO_WME_AC(tid) >= WME_AC_VI)
     			ic->ic_wme.wme_hipri_traffic++;
    -		if (! ieee80211_check_rxseq(ni, wh, wh->i_addr1))
    +		if (! ieee80211_check_rxseq(ni, wh, wh->i_addr1, rxs))
     			goto out;
     	}
     	switch (type) {
    @@ -540,7 +540,7 @@ wds_input(struct ieee80211_node *ni, str
     		 * and we should do nothing more with it.
     		 */
     		if ((m->m_flags & M_AMPDU) &&
    -		    ieee80211_ampdu_reorder(ni, m) != 0) {
    +		    ieee80211_ampdu_reorder(ni, m, rxs) != 0) {
     			m = NULL;
     			goto out;
     		}
    
    From owner-svn-src-head@freebsd.org  Sat May 20 03:51:33 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41C42D7326F;
     Sat, 20 May 2017 03:51:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id EF3311A8D;
     Sat, 20 May 2017 03:51:32 +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 v4K3pVwa090645;
     Sat, 20 May 2017 03:51:31 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4K3pV3g090643;
     Sat, 20 May 2017 03:51:31 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705200351.v4K3pV3g090643@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Sat, 20 May 2017 03:51:31 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318571 - in head: contrib/netbsd-tests/usr.bin/grep
     usr.bin/grep
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 03:51:33 -0000
    
    Author: emaste
    Date: Sat May 20 03:51:31 2017
    New Revision: 318571
    URL: https://svnweb.freebsd.org/changeset/base/318571
    
    Log:
      bsdgrep: emit more than MAX_LINE_MATCHES per line
      
      We should not set an arbitrary cap on the number of matches on a line,
      and in any case MAX_LINE_MATCHES of 32 is much too low.  Instead, if we
      match more than MAX_LINE_MATCHES, keep processing and matching from the
      last match until all are found.
      
      For the regression test, we produce 4096 matches (larger than we expect
      we'll ever set MAX_LINE_MATCHES) and make sure we actually get 4096
      lines of output with the -o flag.
      
      We'll also make sure that every distinct line is getting its own line
      number to detect line metadata not being printed as appropriate along
      the way.
      
      PR:		218811
      Submitted by:	Kyle Evans 
      Reported by:	jbeich
      Reviewed by:	cem
      Differential Revision:	https://reviews.freebsd.org/D10577
    
    Modified:
      head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
      head/usr.bin/grep/util.c
    
    Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
    ==============================================================================
    --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh	Sat May 20 01:04:47 2017	(r318570)
    +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh	Sat May 20 03:51:31 2017	(r318571)
    @@ -413,6 +413,26 @@ wflag_emptypat_body()
     	atf_check -o file:test4 grep -w -e "" test4
     }
     
    +atf_test_case excessive_matches
    +excessive_matches_head()
    +{
    +	atf_set "descr" "Check for proper handling of lines with excessive matches (PR 218811)"
    +}
    +excessive_matches_body()
    +{
    +	grep_type
    +	if [ $? -eq $GREP_TYPE_GNU_FREEBSD ]; then
    +		atf_expect_fail "this test does not pass with GNU grep in base"
    +	fi
    +
    +	for i in $(jot 4096); do
    +		printf "x" >> test.in
    +	done
    +
    +	atf_check -s exit:0 -x '[ $(grep -o x test.in | wc -l) -eq 4096 ]'
    +	#atf_check -s exit:1 -x 'grep -on x test.in | grep -v "1:x"'
    +}
    +
     atf_test_case fgrep_sanity
     fgrep_sanity_head()
     {
    @@ -603,6 +623,7 @@ atf_init_test_cases()
     	atf_add_test_case egrep_empty_invalid
     	atf_add_test_case zerolen
     	atf_add_test_case wflag_emptypat
    +	atf_add_test_case excessive_matches
     	atf_add_test_case wv_combo_break
     	atf_add_test_case fgrep_sanity
     	atf_add_test_case egrep_sanity
    
    Modified: head/usr.bin/grep/util.c
    ==============================================================================
    --- head/usr.bin/grep/util.c	Sat May 20 01:04:47 2017	(r318570)
    +++ head/usr.bin/grep/util.c	Sat May 20 03:51:31 2017	(r318571)
    @@ -63,6 +63,7 @@ static bool	 first_match = true;
     struct parsec {
     	regmatch_t matches[MAX_LINE_MATCHES];	/* Matches made */
     	struct str ln;				/* Current line */
    +	size_t lnstart;				/* Start of line processing */
     	size_t matchidx;			/* Latest used match index */
     	bool binary;				/* Binary file? */
     };
    @@ -247,8 +248,9 @@ procfile(const char *fn)
     	mcount = mlimit;
     
     	for (c = 0;  c == 0 || !(lflag || qflag); ) {
    -		/* Reset match count for every line processed */
    +		/* Reset match count and line start for every line processed */
     		pc.matchidx = 0;
    +		pc.lnstart = 0;
     		pc.ln.off += pc.ln.len + 1;
     		if ((pc.ln.dat = grep_fgetln(f, &pc.ln.len)) == NULL ||
     		    pc.ln.len == 0) {
    @@ -288,6 +290,14 @@ procfile(const char *fn)
     		/* Print the matching line, but only if not quiet/binary */
     		if (t == 0 && printmatch) {
     			printline(&pc, ':');
    +			while (pc.matchidx >= MAX_LINE_MATCHES) {
    +				/* Reset matchidx and try again */
    +				pc.matchidx = 0;
    +				if (procline(&pc) == 0)
    +					printline(&pc, ':');
    +				else
    +					break;
    +			}
     			first_match = false;
     			same_file = true;
     			last_outed = 0;
    @@ -356,11 +366,11 @@ procline(struct parsec *pc)
     {
     	regmatch_t pmatch, lastmatch, chkmatch;
     	wchar_t wbegin, wend;
    -	size_t st = 0, nst = 0;
    +	size_t st, nst;
     	unsigned int i;
     	int c = 0, r = 0, lastmatches = 0, leflags = eflags;
     	size_t startm = 0, matchidx;
    -	int retry;
    +	unsigned int retry;
     
     	matchidx = pc->matchidx;
     
    @@ -376,6 +386,8 @@ procline(struct parsec *pc)
     	} else if (matchall)
     		return (0);
     
    +	st = pc->lnstart;
    +	nst = 0;
     	/* Initialize to avoid a false positive warning from GCC. */
     	lastmatch.rm_so = lastmatch.rm_eo = 0;
     
    @@ -432,12 +444,12 @@ procline(struct parsec *pc)
     				 * still match a whole word.
     				 */
     				if (r == REG_NOMATCH &&
    -				    (retry == 0 || pmatch.rm_so + 1 < retry))
    +				    (retry == pc->lnstart ||
    +				    pmatch.rm_so + 1 < retry))
     					retry = pmatch.rm_so + 1;
     				if (r == REG_NOMATCH)
     					continue;
     			}
    -
     			lastmatches++;
     			lastmatch = pmatch;
     
    @@ -466,8 +478,11 @@ procline(struct parsec *pc)
     			}
     			/* avoid excessive matching - skip further patterns */
     			if ((color == NULL && !oflag) || qflag || lflag ||
    -			    matchidx >= MAX_LINE_MATCHES)
    +			    matchidx >= MAX_LINE_MATCHES) {
    +				pc->lnstart = nst;
    +				lastmatches = 0;
     				break;
    +			}
     		}
     
     		/*
    @@ -475,7 +490,7 @@ procline(struct parsec *pc)
     		 * again just in case we still have a chance to match later in
     		 * the string.
     		 */
    -		if (lastmatches == 0 && retry > 0) {
    +		if (lastmatches == 0 && retry > pc->lnstart) {
     			st = retry;
     			continue;
     		}
    @@ -497,6 +512,7 @@ procline(struct parsec *pc)
     
     		/* Advance st based on previous matches */
     		st = nst;
    +		pc->lnstart = st;
     	}
     
     	/* Reflect the new matchidx in the context */
    
    From owner-svn-src-head@freebsd.org  Sat May 20 09:47:34 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA69D7417E;
     Sat, 20 May 2017 09:47:34 +0000 (UTC)
     (envelope-from bapt@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 1E77B1758;
     Sat, 20 May 2017 09:47:34 +0000 (UTC)
     (envelope-from bapt@freebsd.org)
    Received: by freefall.freebsd.org (Postfix, from userid 1235)
     id 50ED95208; Sat, 20 May 2017 09:47:33 +0000 (UTC)
    Date: Sat, 20 May 2017 11:47:33 +0200
    From: Baptiste Daroussin 
    To: John Baldwin 
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    Subject: Re: pkgbase and conf files (was Re: svn commit: r318441 - in
     head/etc: . cron.d)
    Message-ID: <20170520094732.4qzvcbp2nt5cz7yb@ivaldir.net>
    References: <201705180625.v4I6Pd9j062495@repo.freebsd.org>
     <9570430.uB7Ojud3DG@ralph.baldwin.cx>
     <20170519163355.rs5w3hr6dltdx7kv@ivaldir.net>
     <3548472.irpQCNYL7x@ralph.baldwin.cx>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature"; boundary="uzzwgxho2hksozcd"
    Content-Disposition: inline
    In-Reply-To: <3548472.irpQCNYL7x@ralph.baldwin.cx>
    User-Agent: NeoMutt/20170428 (1.8.2)
    X-BeenThere: svn-src-head@freebsd.org
    X-Mailman-Version: 2.1.23
    Precedence: list
    List-Id: 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, 20 May 2017 09:47:34 -0000
    
    
    --uzzwgxho2hksozcd
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    On Fri, May 19, 2017 at 10:43:30AM -0700, John Baldwin wrote:
    > On Friday, May 19, 2017 06:33:55 PM Baptiste Daroussin wrote:
    > > On Fri, May 19, 2017 at 09:17:23AM -0700, John Baldwin wrote:
    > > > On Thursday, May 18, 2017 11:24:29 PM Baptiste Daroussin wrote:
    > > > I think an upgrade won't bring the file back necessarily (etcupdate w=
    arns you
    > > > that a removed file changed, but it doesn't bring it back, I think a =
    similar
    > > > strategy might be sensible for pkg as well).
    > >=20
    > > I need to check, I do not remember what I did here and I will certainly=
     add a
    > > regression test for that to ensure this behaviour is always working as =
    expected.
    >=20
    > One nice "feature" to have in pkg for pkgbase would be a way to ask pkg t=
    o restore
    > a stock configuration file (perhaps with an option to restore it to an al=
    ternate
    > directory or filename?)  This would imply that packages would need to kee=
    p the
    > "pristine" conf files around somewhere.  This would also let you do 'pkg =
    confdiff'
    > or the like (as a replacement for 'etcupdate diff')
    
    Yes this is in my TODO list
    
    Bapt
    
    --uzzwgxho2hksozcd
    Content-Type: application/pgp-signature; name="signature.asc"
    
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlkgELQACgkQY4mL3PG3
    PlrWVg//UD9qBFMOpPSdPda44oy9M/3nDHlU5Xh/4ificVpNz1g7qqIjNm2Fk7us
    6QMLLBk+STba8yz0S25ISfGbLwObhvbh0cJOXsldOhw9jq1Ku+6K/trAwkiDebV1
    /7XAdl3Xb9rPTua3XItYG2InfITKVKWY3l/p5hfMFagn8IfVItFtB9cHCXNUxt0T
    4PebY5RPWiAQRBju6piPP86iiGaR9GtNBGgTPZR9eAdV5f0d6y/U8cZ4iX3pg9R6
    NDHzqoHpGiR/zWqVrVqH/hdVbJ5txSfhwEYrCnnjCqKaN+akryLPVWS/Xj9Q9I5d
    zcmUwc+8y6KAp8o1PKujhmrsyjGfPSJg5jvAPXFs7FrUfcBjUmInTh5JqxPq+lK1
    NI2B84CwjerntR6ckLZH63XE9bHxW1HP6ZlHfyxvyP66DW/tg1L2E4VRUJo7m32H
    9e8UuKv3c1oh8camDC65/U7uFOgxLG+T0zP/hT63Nz4+ZlL4XBXz397GdIblmXjp
    Zv96BcSY3rBApToeQXmDUr0HbqImHV4TOAo7Jv2XRzXS1RIJ40iIyFJ4tnGR7Hrr
    D4cmuvIu6KC84niJxLWucn7KqFT4J20PdZQpfw7WR9ACKh5T7OOMGEuJ1kFZT1Oj
    GFl0TVm8n75me0Eqtyo1MRlV0w93GnFxn9H9J4ZPABNgf5pS0t0=
    =nkTU
    -----END PGP SIGNATURE-----
    
    --uzzwgxho2hksozcd--
    
    From owner-svn-src-head@freebsd.org  Sat May 20 11:20:04 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDD54D76CCC;
     Sat, 20 May 2017 11:20:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 984271048;
     Sat, 20 May 2017 11:20:04 +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 v4KBK3mV075727;
     Sat, 20 May 2017 11:20:03 GMT (envelope-from emaste@FreeBSD.org)
    Received: (from emaste@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KBK3s8075723;
     Sat, 20 May 2017 11:20:03 GMT (envelope-from emaste@FreeBSD.org)
    Message-Id: <201705201120.v4KBK3s8075723@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: emaste set sender to
     emaste@FreeBSD.org using -f
    From: Ed Maste 
    Date: Sat, 20 May 2017 11:20:03 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318574 - in head: contrib/netbsd-tests/usr.bin/grep
     usr.bin/grep
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 11:20:04 -0000
    
    Author: emaste
    Date: Sat May 20 11:20:03 2017
    New Revision: 318574
    URL: https://svnweb.freebsd.org/changeset/base/318574
    
    Log:
      bsdgrep: Correct per-line line metadata printing
      
      Metadata printing with -b, -H, or -n flags suffered from a few flaws:
      
      1) -b/offset printing was broken when used in conjunction with -o
      
      2) With -o, bsdgrep did not print metadata for every match/line, just
         the first match of a line
      
      3) There were no tests for this
      
      Address these issues by outputting this data per-match if the -o flag is
      specified, and prior to outputting any matches if -o but not --color,
      since --color alone will not generate a new line of output for every
      iteration over the matches.
      
      To correct -b output, fudge the line offset as we're printing matches.
      
      While here, make sure we're using grep_printline in -A context.  Context
      printing should *never* look at the parsing context, just the line.
      
      The tests included do not pass with gnugrep in base due to it exhibiting
      similar quirky behavior that bsdgrep previously exhibited.
      
      Submitted by:	Kyle Evans 
      Reviewed by:	cem
      Differential Revision:	https://reviews.freebsd.org/D10580
    
    Modified:
      head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
      head/usr.bin/grep/grep.h
      head/usr.bin/grep/queue.c
      head/usr.bin/grep/util.c
    
    Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
    ==============================================================================
    --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh	Sat May 20 06:01:09 2017	(r318573)
    +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh	Sat May 20 11:20:03 2017	(r318574)
    @@ -430,7 +430,7 @@ excessive_matches_body()
     	done
     
     	atf_check -s exit:0 -x '[ $(grep -o x test.in | wc -l) -eq 4096 ]'
    -	#atf_check -s exit:1 -x 'grep -on x test.in | grep -v "1:x"'
    +	atf_check -s exit:1 -x 'grep -on x test.in | grep -v "1:x"'
     }
     
     atf_test_case fgrep_sanity
    @@ -510,6 +510,39 @@ wv_combo_break_body()
     	atf_check -s exit:1 grep -v -w "x" test2
     }
     
    +atf_test_case ocolor_metadata
    +ocolor_metadata_head()
    +{
    +	atf_set "descr" "Check for -n/-b producing per-line metadata output"
    +}
    +ocolor_metadata_body()
    +{
    +	grep_type
    +	if [ $? -eq $GREP_TYPE_GNU_FREEBSD ]; then
    +		atf_expect_fail "this test does not pass with GNU grep in base"
    +	fi
    +
    +	printf "xxx\nyyyy\nzzz\nfoobarbaz\n" > test1
    +	check_expr="^[^:]*[0-9][^:]*:[^:]+$"
    +
    +	atf_check -o inline:"1:1:xx\n" grep -bon "xx$" test1
    +
    +	atf_check -o inline:"2:4:yyyy\n" grep -bn "yy" test1
    +
    +	atf_check -o inline:"2:6:yy\n" grep -bon "yy$" test1
    +
    +	# These checks ensure that grep isn't producing bogus line numbering
    +	# in the middle of a line.
    +	atf_check -s exit:1 -x \
    +	    "grep -Eon 'x|y|z|f' test1 | grep -Ev '${check_expr}'"
    +
    +	atf_check -s exit:1 -x \
    +	    "grep -En 'x|y|z|f' --color=always test1 | grep -Ev '${check_expr}'"
    +
    +	atf_check -s exit:1 -x \
    +	    "grep -Eon 'x|y|z|f' --color=always test1 | grep -Ev '${check_expr}'"
    +}
    +
     atf_test_case grep_nomatch_flags
     grep_nomatch_flags_head()
     {
    @@ -628,6 +661,7 @@ atf_init_test_cases()
     	atf_add_test_case fgrep_sanity
     	atf_add_test_case egrep_sanity
     	atf_add_test_case grep_sanity
    +	atf_add_test_case ocolor_metadata
     	atf_add_test_case grep_nomatch_flags
     	atf_add_test_case binary_flags
     	atf_add_test_case badcontext
    
    Modified: head/usr.bin/grep/grep.h
    ==============================================================================
    --- head/usr.bin/grep/grep.h	Sat May 20 06:01:09 2017	(r318573)
    +++ head/usr.bin/grep/grep.h	Sat May 20 11:20:03 2017	(r318574)
    @@ -90,6 +90,7 @@ struct file {
     };
     
     struct str {
    +	off_t		 boff;
     	off_t		 off;
     	size_t		 len;
     	char		*dat;
    
    Modified: head/usr.bin/grep/queue.c
    ==============================================================================
    --- head/usr.bin/grep/queue.c	Sat May 20 06:01:09 2017	(r318573)
    +++ head/usr.bin/grep/queue.c	Sat May 20 11:20:03 2017	(r318574)
    @@ -65,6 +65,7 @@ enqueue(struct str *x)
     	item->data.dat = grep_malloc(sizeof(char) * x->len);
     	item->data.len = x->len;
     	item->data.line_no = x->line_no;
    +	item->data.boff = x->boff;
     	item->data.off = x->off;
     	memcpy(item->data.dat, x->dat, x->len);
     	item->data.file = x->file;
    
    Modified: head/usr.bin/grep/util.c
    ==============================================================================
    --- head/usr.bin/grep/util.c	Sat May 20 06:01:09 2017	(r318573)
    +++ head/usr.bin/grep/util.c	Sat May 20 11:20:03 2017	(r318574)
    @@ -61,11 +61,12 @@ static bool	 first_match = true;
      * other useful bits
      */
     struct parsec {
    -	regmatch_t matches[MAX_LINE_MATCHES];	/* Matches made */
    -	struct str ln;				/* Current line */
    -	size_t lnstart;				/* Start of line processing */
    -	size_t matchidx;			/* Latest used match index */
    -	bool binary;				/* Binary file? */
    +	regmatch_t	matches[MAX_LINE_MATCHES];	/* Matches made */
    +	struct str	ln;				/* Current line */
    +	size_t		lnstart;			/* Position in line */
    +	size_t		matchidx;			/* Latest match index */
    +	int		printed;			/* Metadata printed? */
    +	bool		binary;				/* Binary file? */
     };
     
     
    @@ -233,8 +234,10 @@ procfile(const char *fn)
     	strcpy(pc.ln.file, fn);
     	pc.ln.line_no = 0;
     	pc.ln.len = 0;
    +	pc.ln.boff = 0;
     	pc.ln.off = -1;
     	pc.binary = f->binary;
    +	pc.printed = 0;
     	tail = 0;
     	last_outed = 0;
     	same_file = false;
    @@ -248,9 +251,11 @@ procfile(const char *fn)
     	mcount = mlimit;
     
     	for (c = 0;  c == 0 || !(lflag || qflag); ) {
    -		/* Reset match count and line start for every line processed */
    +		/* Reset per-line statistics */
    +		pc.printed = 0;
     		pc.matchidx = 0;
     		pc.lnstart = 0;
    +		pc.ln.boff = 0;
     		pc.ln.off += pc.ln.len + 1;
     		if ((pc.ln.dat = grep_fgetln(f, &pc.ln.len)) == NULL ||
     		    pc.ln.len == 0) {
    @@ -305,7 +310,7 @@ procfile(const char *fn)
     		if (t != 0 && doctx) {
     			/* Deal with any -A context */
     			if (tail > 0) {
    -				printline(&pc, '-');
    +				grep_printline(&pc.ln, '-');
     				tail--;
     				if (Bflag > 0)
     					clearqueue();
    @@ -607,7 +612,7 @@ printline_metadata(struct str *line, int
     	if (bflag) {
     		if (printsep)
     			putchar(sep);
    -		printf("%lld", (long long)line->off);
    +		printf("%lld", (long long)(line->off + line->boff));
     		printsep = true;
     	}
     	if (printsep)
    @@ -632,13 +637,22 @@ printline(struct parsec *pc, int sep)
     
     	/* --color and -o */
     	if ((oflag || color) && matchidx > 0) {
    -		printline_metadata(&pc->ln, sep);
    +		/* Only print metadata once per line if --color */
    +		if (!oflag && pc->printed == 0)
    +			printline_metadata(&pc->ln, sep);
     		for (i = 0; i < matchidx; i++) {
     			match = pc->matches[i];
     			/* Don't output zero length matches */
     			if (match.rm_so == match.rm_eo)
     				continue;
    -			if (!oflag)
    +			/*
    +			 * Metadata is printed on a per-line basis, so every
    +			 * match gets file metadata with the -o flag.
    +			 */
    +			if (oflag) {
    +				pc->ln.boff = match.rm_so;
    +				printline_metadata(&pc->ln, sep);
    +			} else
     				fwrite(pc->ln.dat + a, match.rm_so - a, 1,
     				    stdout);
     			if (color)
    @@ -659,4 +673,5 @@ printline(struct parsec *pc, int sep)
     		}
     	} else
     		grep_printline(&pc->ln, sep);
    +	pc->printed++;
     }
    
    From owner-svn-src-head@freebsd.org  Sat May 20 11:40:39 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23215D761F5;
     Sat, 20 May 2017 11:40:39 +0000 (UTC) (envelope-from dim@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 E98CD1B00;
     Sat, 20 May 2017 11:40:38 +0000 (UTC) (envelope-from dim@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KBecla083890;
     Sat, 20 May 2017 11:40:38 GMT (envelope-from dim@FreeBSD.org)
    Received: (from dim@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KBec1w083889;
     Sat, 20 May 2017 11:40:38 GMT (envelope-from dim@FreeBSD.org)
    Message-Id: <201705201140.v4KBec1w083889@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
     using -f
    From: Dimitry Andric 
    Date: Sat, 20 May 2017 11:40:37 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318575 - head/etc/mtree
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 11:40:39 -0000
    
    Author: dim
    Date: Sat May 20 11:40:37 2017
    New Revision: 318575
    URL: https://svnweb.freebsd.org/changeset/base/318575
    
    Log:
      After r317383 (removal of NATM), also remove usr/include/dev/utopia from
      BSD.include.dist.
    
    Modified:
      head/etc/mtree/BSD.include.dist
    
    Modified: head/etc/mtree/BSD.include.dist
    ==============================================================================
    --- head/etc/mtree/BSD.include.dist	Sat May 20 11:20:03 2017	(r318574)
    +++ head/etc/mtree/BSD.include.dist	Sat May 20 11:40:37 2017	(r318575)
    @@ -156,8 +156,6 @@
             ..
             usb
             ..
    -        utopia
    -        ..
             vkbd
             ..
             wi
    
    From owner-svn-src-head@freebsd.org  Sat May 20 16:47:01 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BBB7D76A1A;
     Sat, 20 May 2017 16:47:01 +0000 (UTC) (envelope-from mr@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 358A513DF;
     Sat, 20 May 2017 16:47:01 +0000 (UTC) (envelope-from mr@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KGl0nG010050;
     Sat, 20 May 2017 16:47:00 GMT (envelope-from mr@FreeBSD.org)
    Received: (from mr@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KGl0Lx010049;
     Sat, 20 May 2017 16:47:00 GMT (envelope-from mr@FreeBSD.org)
    Message-Id: <201705201647.v4KGl0Lx010049@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org
     using -f
    From: Michael Reifenberger 
    Date: Sat, 20 May 2017 16:47:00 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318577 - head/etc/periodic/daily
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 16:47:01 -0000
    
    Author: mr
    Date: Sat May 20 16:47:00 2017
    New Revision: 318577
    URL: https://svnweb.freebsd.org/changeset/base/318577
    
    Log:
      Improve time-since-last-scrub calculation.
      This can be needed to compensate anticongestion delays in 410.pkg-audit or 480.leapfile-ntpd.
      
      PR:		217622
      Submitted by:	wbe@psr.com
      MFC after:	2 weeks
    
    Modified:
      head/etc/periodic/daily/800.scrub-zfs
    
    Modified: head/etc/periodic/daily/800.scrub-zfs
    ==============================================================================
    --- head/etc/periodic/daily/800.scrub-zfs	Sat May 20 16:12:44 2017	(r318576)
    +++ head/etc/periodic/daily/800.scrub-zfs	Sat May 20 16:47:00 2017	(r318577)
    @@ -71,7 +71,7 @@ case "$daily_scrub_zfs_enable" in
     
     		# Now minus last scrub (both in seconds) converted to days.
     		_scrub_diff=$(expr -e \( $(date +%s) - \
    -		    $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24)
    +		    $(date -j -v -70M -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24)
     		if [ ${_scrub_diff} -lt ${_pool_threshold} ]; then
     			echo "   skipping scrubbing of pool '${pool}':"
     			echo "      last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days"
    
    From owner-svn-src-head@freebsd.org  Sat May 20 16:58:50 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E8DCD76F65;
     Sat, 20 May 2017 16:58:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id 11C021DAE;
     Sat, 20 May 2017 16:58:49 +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 v4KGwnGh014612;
     Sat, 20 May 2017 16:58:49 GMT (envelope-from cy@FreeBSD.org)
    Received: (from cy@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KGwnjk014611;
     Sat, 20 May 2017 16:58:49 GMT (envelope-from cy@FreeBSD.org)
    Message-Id: <201705201658.v4KGwnjk014611@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org
     using -f
    From: Cy Schubert 
    Date: Sat, 20 May 2017 16:58:48 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318578 - head/usr.sbin/nscd
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 16:58:50 -0000
    
    Author: cy
    Date: Sat May 20 16:58:48 2017
    New Revision: 318578
    URL: https://svnweb.freebsd.org/changeset/base/318578
    
    Log:
      Fix non-recoverable name resolution failures due to negative cache
      entries never expiring. This patch honours the negative cache timeout.
      
      To test/experience the failure do the following:
      
      1. Edit /etc/ncd.conf to adjust the cache timeouts as follows:
      
      	positive-time-to-live hosts 30
      	negative-time-to-live hosts 1
      
      2. Ensure that nsswitch.conf hosts line contains something like:
      
      	hosts: files cache dns
      
      	Note that cache must be specified before dns.
      
      3. Start nscd.
      
      4. Run the following command:
      
      	while true; do nc -z -w 3 www.google.com 80; sleep 5; done
      
      5. While running the command, remove or comment out all nameserver
         statements in /etc/resolv.conf. After a short while you will notice
         non-recoverable name rsolution failures.
      
      6. Uncomment or replace all nameserver statements back into
         /etc/resolv.conf. Take note that name resolution never recovers.
         To recover nscd must be restarted. This patch fixes this.
      
      PR:		207804
      Submitted by:	Jov 
      MFC after:	1 week
    
    Modified:
      head/usr.sbin/nscd/query.c
    
    Modified: head/usr.sbin/nscd/query.c
    ==============================================================================
    --- head/usr.sbin/nscd/query.c	Sat May 20 16:47:00 2017	(r318577)
    +++ head/usr.sbin/nscd/query.c	Sat May 20 16:58:48 2017	(r318578)
    @@ -743,9 +743,14 @@ on_read_request_process(struct query_sta
     				&read_response->data_size);
     
     			if (read_response->error_code == -2) {
    -				read_response->error_code = 0;
    -				read_response->data = NULL;
    -				read_response->data_size = 0;
    +				read_response->data = malloc(
    +					read_response->data_size);
    +				assert(read_response != NULL);
    +				read_response->error_code = cache_read(neg_c_entry,
    +					read_request->cache_key,
    +		    			read_request->cache_key_size,
    +		    			read_response->data,
    +		    			&read_response->data_size);
     			}
     		}
     		configuration_unlock_entry(qstate->config_entry, CELT_NEGATIVE);
    
    From owner-svn-src-head@freebsd.org  Sat May 20 17:29:37 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E5AD75C67;
     Sat, 20 May 2017 17:29:37 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 7286D1E98;
     Sat, 20 May 2017 17:29:37 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHTabW027475;
     Sat, 20 May 2017 17:29:36 GMT (envelope-from vangyzen@FreeBSD.org)
    Received: (from vangyzen@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHTaHh027474;
     Sat, 20 May 2017 17:29:36 GMT (envelope-from vangyzen@FreeBSD.org)
    Message-Id: <201705201729.v4KHTaHh027474@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
     vangyzen@FreeBSD.org using -f
    From: Eric van Gyzen 
    Date: Sat, 20 May 2017 17:29:36 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318580 - head/lib/libthr
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 17:29:37 -0000
    
    Author: vangyzen
    Date: Sat May 20 17:29:36 2017
    New Revision: 318580
    URL: https://svnweb.freebsd.org/changeset/base/318580
    
    Log:
      libthr: disable thread-safety warnings
      
      These warnings don't make sense for code that implements
      the locking primitives.
      
      Reviewed by:	kib
      MFC after:	3 days
      Sponsored by:	Dell EMC
      Differential Revision:	https://reviews.freebsd.org/D10832
    
    Modified:
      head/lib/libthr/Makefile
    
    Modified: head/lib/libthr/Makefile
    ==============================================================================
    --- head/lib/libthr/Makefile	Sat May 20 17:09:27 2017	(r318579)
    +++ head/lib/libthr/Makefile	Sat May 20 17:29:36 2017	(r318580)
    @@ -17,6 +17,7 @@ MK_SSP=	no
     LIB=thr
     SHLIB_MAJOR= 3
     WARNS?=	3
    +NO_WTHREAD_SAFETY=1
     CFLAGS+=-DPTHREAD_KERNEL
     CFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR}/thread \
     	-I${SRCTOP}/include
    
    From owner-svn-src-head@freebsd.org  Sat May 20 17:30:49 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85288D75D0F;
     Sat, 20 May 2017 17:30:49 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 62649119A;
     Sat, 20 May 2017 17:30:49 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHUmjj028309;
     Sat, 20 May 2017 17:30:48 GMT (envelope-from vangyzen@FreeBSD.org)
    Received: (from vangyzen@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHUmt3028308;
     Sat, 20 May 2017 17:30:48 GMT (envelope-from vangyzen@FreeBSD.org)
    Message-Id: <201705201730.v4KHUmt3028308@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
     vangyzen@FreeBSD.org using -f
    From: Eric van Gyzen 
    Date: Sat, 20 May 2017 17:30:48 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318581 - head/lib/libthr/thread
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 17:30:49 -0000
    
    Author: vangyzen
    Date: Sat May 20 17:30:48 2017
    New Revision: 318581
    URL: https://svnweb.freebsd.org/changeset/base/318581
    
    Log:
      libthr: change CHECK_AND_INIT_RWLOCK to an inline function
      
      This was prompted by a compiler warning about 'ret' shadowing
      a local variable in the callers of the macro.
      
      Reviewed by:	kib
      MFC after:	3 days
      Sponsored by:	Dell EMC
      Differential Revision:	https://reviews.freebsd.org/D10832
    
    Modified:
      head/lib/libthr/thread/thr_rwlock.c
    
    Modified: head/lib/libthr/thread/thr_rwlock.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_rwlock.c	Sat May 20 17:29:36 2017	(r318580)
    +++ head/lib/libthr/thread/thr_rwlock.c	Sat May 20 17:30:48 2017	(r318581)
    @@ -49,27 +49,42 @@ __weak_reference(_pthread_rwlock_unlock,
     __weak_reference(_pthread_rwlock_wrlock, pthread_rwlock_wrlock);
     __weak_reference(_pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock);
     
    -#define CHECK_AND_INIT_RWLOCK							\
    -	if (*rwlock == THR_PSHARED_PTR) {					\
    -		prwlock = __thr_pshared_offpage(rwlock, 0);			\
    -		if (prwlock == NULL)						\
    -			return (EINVAL);					\
    -	} else if (__predict_false((prwlock = (*rwlock)) <=			\
    -	    THR_RWLOCK_DESTROYED)) {						\
    -		if (prwlock == THR_RWLOCK_INITIALIZER) {			\
    -			int ret;						\
    -			ret = init_static(_get_curthread(), rwlock);		\
    -			if (ret)						\
    -				return (ret);					\
    -		} else if (prwlock == THR_RWLOCK_DESTROYED) {			\
    -			return (EINVAL);					\
    -		}								\
    -		prwlock = *rwlock;						\
    -	}
    -
    -/*
    - * Prototypes
    - */
    +static int init_static(struct pthread *thread, pthread_rwlock_t *rwlock);
    +static int init_rwlock(pthread_rwlock_t *rwlock, pthread_rwlock_t *rwlock_out);
    +
    +static int __always_inline
    +check_and_init_rwlock(pthread_rwlock_t *rwlock, pthread_rwlock_t *rwlock_out)
    +{
    +	if (__predict_false(*rwlock == THR_PSHARED_PTR ||
    +	    *rwlock <= THR_RWLOCK_DESTROYED))
    +		return (init_rwlock(rwlock, rwlock_out));
    +	*rwlock_out = *rwlock;
    +	return (0);
    +}
    +
    +static int __noinline
    +init_rwlock(pthread_rwlock_t *rwlock, pthread_rwlock_t *rwlock_out)
    +{
    +	pthread_rwlock_t prwlock;
    +	int ret;
    +
    +	if (*rwlock == THR_PSHARED_PTR) {
    +		prwlock = __thr_pshared_offpage(rwlock, 0);
    +		if (prwlock == NULL)
    +			return (EINVAL);
    +	} else if ((prwlock = *rwlock) <= THR_RWLOCK_DESTROYED) {
    +		if (prwlock == THR_RWLOCK_INITIALIZER) {
    +			ret = init_static(_get_curthread(), rwlock);
    +			if (ret != 0)
    +				return (ret);
    +		} else if (prwlock == THR_RWLOCK_DESTROYED) {
    +			return (EINVAL);
    +		}
    +		prwlock = *rwlock;
    +	}
    +	*rwlock_out = prwlock;
    +	return (0);
    +}
     
     static int
     rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr)
    @@ -148,7 +163,9 @@ rwlock_rdlock_common(pthread_rwlock_t *r
     	int flags;
     	int ret;
     
    -	CHECK_AND_INIT_RWLOCK
    +	ret = check_and_init_rwlock(rwlock, &prwlock);
    +	if (ret != 0)
    +		return (ret);
     
     	if (curthread->rdlock_count) {
     		/*
    @@ -220,7 +237,9 @@ _pthread_rwlock_tryrdlock (pthread_rwloc
     	int flags;
     	int ret;
     
    -	CHECK_AND_INIT_RWLOCK
    +	ret = check_and_init_rwlock(rwlock, &prwlock);
    +	if (ret != 0)
    +		return (ret);
     
     	if (curthread->rdlock_count) {
     		/*
    @@ -253,7 +272,9 @@ _pthread_rwlock_trywrlock (pthread_rwloc
     	pthread_rwlock_t prwlock;
     	int ret;
     
    -	CHECK_AND_INIT_RWLOCK
    +	ret = check_and_init_rwlock(rwlock, &prwlock);
    +	if (ret != 0)
    +		return (ret);
     
     	ret = _thr_rwlock_trywrlock(&prwlock->lock);
     	if (ret == 0)
    @@ -268,7 +289,9 @@ rwlock_wrlock_common (pthread_rwlock_t *
     	pthread_rwlock_t prwlock;
     	int ret;
     
    -	CHECK_AND_INIT_RWLOCK
    +	ret = check_and_init_rwlock(rwlock, &prwlock);
    +	if (ret != 0)
    +		return (ret);
     
     	/*
     	 * POSIX said the validity of the abstimeout parameter need
    
    From owner-svn-src-head@freebsd.org  Sat May 20 17:32:03 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88379D75F37;
     Sat, 20 May 2017 17:32:03 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 4D10F1443;
     Sat, 20 May 2017 17:32:03 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHW2oB029068;
     Sat, 20 May 2017 17:32:02 GMT (envelope-from vangyzen@FreeBSD.org)
    Received: (from vangyzen@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHW1Pc029064;
     Sat, 20 May 2017 17:32:01 GMT (envelope-from vangyzen@FreeBSD.org)
    Message-Id: <201705201732.v4KHW1Pc029064@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
     vangyzen@FreeBSD.org using -f
    From: Eric van Gyzen 
    Date: Sat, 20 May 2017 17:32:01 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318582 - in head/lib: libc/gen libc/include libthr/thread
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 17:32:03 -0000
    
    Author: vangyzen
    Date: Sat May 20 17:32:01 2017
    New Revision: 318582
    URL: https://svnweb.freebsd.org/changeset/base/318582
    
    Log:
      Remove old spinlock_debug code from libc
      
      This no longer seems useful.  Remove it.
      
      This was prompted by a "cast discards volatile qualifier" warning
      in libthr when WARNS=6.
      
      Reviewed by:	kib
      MFC after:	3 days
      Sponsored by:	Dell EMC
      Differential Revision:	https://reviews.freebsd.org/D10832
    
    Modified:
      head/lib/libc/gen/Symbol.map
      head/lib/libc/gen/_spinlock_stub.c
      head/lib/libc/include/spinlock.h
      head/lib/libthr/thread/thr_init.c
      head/lib/libthr/thread/thr_spinlock.c
    
    Modified: head/lib/libc/gen/Symbol.map
    ==============================================================================
    --- head/lib/libc/gen/Symbol.map	Sat May 20 17:30:48 2017	(r318581)
    +++ head/lib/libc/gen/Symbol.map	Sat May 20 17:32:01 2017	(r318582)
    @@ -485,7 +485,6 @@ FBSDprivate_1.0 {
     	_pthread_sigmask;
     	_pthread_testcancel;
     	_spinlock;
    -	_spinlock_debug;
     	_spinunlock;
     	_rtld_addr_phdr;
     	_rtld_atfork_pre;
    
    Modified: head/lib/libc/gen/_spinlock_stub.c
    ==============================================================================
    --- head/lib/libc/gen/_spinlock_stub.c	Sat May 20 17:30:48 2017	(r318581)
    +++ head/lib/libc/gen/_spinlock_stub.c	Sat May 20 17:32:01 2017	(r318582)
    @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
     long _atomic_lock_stub(volatile long *);
     void _spinlock_stub(spinlock_t *);
     void _spinunlock_stub(spinlock_t *);
    -void _spinlock_debug_stub(spinlock_t *, char *, int);
     
     __weak_reference(_atomic_lock_stub, _atomic_lock);
     
    @@ -48,7 +47,6 @@ _atomic_lock_stub(volatile long *lck __u
     	return (0L);
     }
     
    -__weak_reference(_spinlock, _spinlock_debug);
     #pragma weak _spinlock
     void
     _spinlock(spinlock_t *lck)
    
    Modified: head/lib/libc/include/spinlock.h
    ==============================================================================
    --- head/lib/libc/include/spinlock.h	Sat May 20 17:30:48 2017	(r318581)
    +++ head/lib/libc/include/spinlock.h	Sat May 20 17:32:01 2017	(r318582)
    @@ -41,21 +41,17 @@
      * Lock structure with room for debugging information.
      */
     struct _spinlock {
    -	volatile long	access_lock;
    -	volatile long	lock_owner;
    -	volatile char	*fname;
    -	volatile int	lineno;
    +	long	spare1;
    +	long	spare2;
    +	void	*thr_extra;
    +	int	spare3;
     };
     typedef struct _spinlock spinlock_t;
     
     #define	_SPINLOCK_INITIALIZER	{ 0, 0, 0, 0 }
     
     #define _SPINUNLOCK(_lck)	_spinunlock(_lck);
    -#ifdef	_LOCK_DEBUG
    -#define	_SPINLOCK(_lck)		_spinlock_debug(_lck, __FILE__, __LINE__)
    -#else
     #define	_SPINLOCK(_lck)		_spinlock(_lck)
    -#endif
     
     /*
      * Thread function prototype definitions:
    @@ -64,7 +60,6 @@ __BEGIN_DECLS
     long	_atomic_lock(volatile long *);
     void	_spinlock(spinlock_t *);
     void	_spinunlock(spinlock_t *);
    -void	_spinlock_debug(spinlock_t *, char *, int);
     __END_DECLS
     
     #endif /* _SPINLOCK_H_ */
    
    Modified: head/lib/libthr/thread/thr_init.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_init.c	Sat May 20 17:30:48 2017	(r318581)
    +++ head/lib/libthr/thread/thr_init.c	Sat May 20 17:32:01 2017	(r318582)
    @@ -173,7 +173,6 @@ STATIC_LIB_REQUIRE(_sigtimedwait);
     STATIC_LIB_REQUIRE(_sigwait);
     STATIC_LIB_REQUIRE(_sigwaitinfo);
     STATIC_LIB_REQUIRE(_spinlock);
    -STATIC_LIB_REQUIRE(_spinlock_debug);
     STATIC_LIB_REQUIRE(_spinunlock);
     STATIC_LIB_REQUIRE(_thread_init_hack);
     
    
    Modified: head/lib/libthr/thread/thr_spinlock.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_spinlock.c	Sat May 20 17:30:48 2017	(r318581)
    +++ head/lib/libthr/thread/thr_spinlock.c	Sat May 20 17:32:01 2017	(r318582)
    @@ -65,7 +65,7 @@ __thr_spinunlock(spinlock_t *lck)
     {
     	struct spinlock_extra	*_extra;
     
    -	_extra = (struct spinlock_extra *)lck->fname;
    +	_extra = lck->thr_extra;
     	THR_UMUTEX_UNLOCK(_get_curthread(), &_extra->lock);
     }
     
    @@ -78,9 +78,9 @@ __thr_spinlock(spinlock_t *lck)
     		PANIC("Spinlock called when not threaded.");
     	if (!initialized)
     		PANIC("Spinlocks not initialized.");
    -	if (lck->fname == NULL)
    +	if (lck->thr_extra == NULL)
     		init_spinlock(lck);
    -	_extra = (struct spinlock_extra *)lck->fname;
    +	_extra = lck->thr_extra;
     	THR_UMUTEX_LOCK(_get_curthread(), &_extra->lock);
     }
     
    @@ -90,14 +90,14 @@ init_spinlock(spinlock_t *lck)
     	struct pthread *curthread = _get_curthread();
     
     	THR_UMUTEX_LOCK(curthread, &spinlock_static_lock);
    -	if ((lck->fname == NULL) && (spinlock_count < MAX_SPINLOCKS)) {
    -		lck->fname = (char *)&extra[spinlock_count];
    +	if ((lck->thr_extra == NULL) && (spinlock_count < MAX_SPINLOCKS)) {
    +		lck->thr_extra = &extra[spinlock_count];
     		_thr_umutex_init(&extra[spinlock_count].lock);
     		extra[spinlock_count].owner = lck;
     		spinlock_count++;
     	}
     	THR_UMUTEX_UNLOCK(curthread, &spinlock_static_lock);
    -	if (lck->fname == NULL)
    +	if (lck->thr_extra == NULL)
     		PANIC("Warning: exceeded max spinlocks");
     }
     
    
    From owner-svn-src-head@freebsd.org  Sat May 20 17:32:32 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48713D75FC0;
     Sat, 20 May 2017 17:32:32 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 1A7FA1632;
     Sat, 20 May 2017 17:32:32 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHWVFf031225;
     Sat, 20 May 2017 17:32:31 GMT (envelope-from vangyzen@FreeBSD.org)
    Received: (from vangyzen@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHWVif031224;
     Sat, 20 May 2017 17:32:31 GMT (envelope-from vangyzen@FreeBSD.org)
    Message-Id: <201705201732.v4KHWVif031224@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
     vangyzen@FreeBSD.org using -f
    From: Eric van Gyzen 
    Date: Sat, 20 May 2017 17:32:31 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318583 - head/lib/libthr
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 17:32:32 -0000
    
    Author: vangyzen
    Date: Sat May 20 17:32:30 2017
    New Revision: 318583
    URL: https://svnweb.freebsd.org/changeset/base/318583
    
    Log:
      libthr: use default WARNS level of 6
      
      Reviewed by:	kib
      MFC after:	3 days
      Sponsored by:	Dell EMC
      Differential Revision:	https://reviews.freebsd.org/D10832
    
    Modified:
      head/lib/libthr/Makefile
    
    Modified: head/lib/libthr/Makefile
    ==============================================================================
    --- head/lib/libthr/Makefile	Sat May 20 17:32:01 2017	(r318582)
    +++ head/lib/libthr/Makefile	Sat May 20 17:32:30 2017	(r318583)
    @@ -16,7 +16,6 @@ MK_SSP=	no
     
     LIB=thr
     SHLIB_MAJOR= 3
    -WARNS?=	3
     NO_WTHREAD_SAFETY=1
     CFLAGS+=-DPTHREAD_KERNEL
     CFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR}/thread \
    
    From owner-svn-src-head@freebsd.org  Sat May 20 17:33:49 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C709D7609A;
     Sat, 20 May 2017 17:33:49 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id C3FDC17B2;
     Sat, 20 May 2017 17:33:48 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHXlJb031335;
     Sat, 20 May 2017 17:33:47 GMT (envelope-from vangyzen@FreeBSD.org)
    Received: (from vangyzen@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHXlT6031332;
     Sat, 20 May 2017 17:33:47 GMT (envelope-from vangyzen@FreeBSD.org)
    Message-Id: <201705201733.v4KHXlT6031332@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
     vangyzen@FreeBSD.org using -f
    From: Eric van Gyzen 
    Date: Sat, 20 May 2017 17:33:47 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318584 - in head/lib/libthr: . thread
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 17:33:49 -0000
    
    Author: vangyzen
    Date: Sat May 20 17:33:47 2017
    New Revision: 318584
    URL: https://svnweb.freebsd.org/changeset/base/318584
    
    Log:
      libthr: Use CLI flags instead of pragmas to disable warnings
      
      People tweaking the build system or compilers tend to look into
      the Makefile and not into the source.  Having some warning controls
      in the Makefile and some in the source code is surprising.
      
      Pragmas have the advantage that they leave the warnings enabled
      for more code, but that advantage isn't very relevant in these cases.
      
      Requested by:	kib
      Reviewed by:	kib
      MFC after:	3 days
      Sponsored by:	Dell EMC
      Differential Revision:	https://reviews.freebsd.org/D10832
    
    Modified:
      head/lib/libthr/Makefile
      head/lib/libthr/thread/thr_stack.c
      head/lib/libthr/thread/thr_symbols.c
    
    Modified: head/lib/libthr/Makefile
    ==============================================================================
    --- head/lib/libthr/Makefile	Sat May 20 17:32:30 2017	(r318583)
    +++ head/lib/libthr/Makefile	Sat May 20 17:33:47 2017	(r318584)
    @@ -27,6 +27,12 @@ CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${M
     CFLAGS+=-I${SRCTOP}/lib/libthread_db
     CFLAGS+=-Winline
     
    +CFLAGS.thr_stack.c+=	-Wno-cast-align
    +.include 
    +.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300)
    +CFLAGS.thr_symbols.c+=	-Wno-missing-variable-declarations
    +.endif
    +
     .ifndef NO_THREAD_UNWIND_STACK
     CFLAGS+=-fexceptions
     CFLAGS+=-D_PTHREAD_FORCED_UNWIND
    
    Modified: head/lib/libthr/thread/thr_stack.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_stack.c	Sat May 20 17:32:30 2017	(r318583)
    +++ head/lib/libthr/thread/thr_stack.c	Sat May 20 17:33:47 2017	(r318584)
    @@ -290,19 +290,6 @@ _thr_stack_alloc(struct pthread_attr *at
     		return (-1);
     }
     
    -/*
    - * Disable this warning from clang:
    - *
    - * cast from 'char *' to
    - *    'struct stack *' increases required alignment from 1 to 8
    - *    [-Werror,-Wcast-align]
    - *                 spare_stack = (struct stack *)
    - */
    -#ifdef __clang__
    -#pragma GCC diagnostic push
    -#pragma GCC diagnostic ignored "-Wcast-align"
    -#endif
    -
     /* This function must be called with _thread_list_lock held. */
     void
     _thr_stack_free(struct pthread_attr *attr)
    @@ -329,7 +316,3 @@ _thr_stack_free(struct pthread_attr *att
     		attr->stackaddr_attr = NULL;
     	}
     }
    -
    -#ifdef __clang__
    -#pragma GCC diagnostic pop
    -#endif
    
    Modified: head/lib/libthr/thread/thr_symbols.c
    ==============================================================================
    --- head/lib/libthr/thread/thr_symbols.c	Sat May 20 17:32:30 2017	(r318583)
    +++ head/lib/libthr/thread/thr_symbols.c	Sat May 20 17:33:47 2017	(r318584)
    @@ -37,10 +37,6 @@ __FBSDID("$FreeBSD$");
     
     #include "thr_private.h"
     
    -#ifdef __clang__
    -#pragma GCC diagnostic ignored "-Wmissing-variable-declarations"
    -#endif
    -
     /* A collection of symbols needed by debugger */
     
     /* int _libthr_debug */
    
    From owner-svn-src-head@freebsd.org  Sat May 20 17:39:24 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57E6FD761F0;
     Sat, 20 May 2017 17:39:24 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 29CCD1A51;
     Sat, 20 May 2017 17:39:24 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHdN18031580;
     Sat, 20 May 2017 17:39:23 GMT (envelope-from vangyzen@FreeBSD.org)
    Received: (from vangyzen@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHdNBW031579;
     Sat, 20 May 2017 17:39:23 GMT (envelope-from vangyzen@FreeBSD.org)
    Message-Id: <201705201739.v4KHdNBW031579@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
     vangyzen@FreeBSD.org using -f
    From: Eric van Gyzen 
    Date: Sat, 20 May 2017 17:39:23 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318585 - head/contrib/dma
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 17:39:24 -0000
    
    Author: vangyzen
    Date: Sat May 20 17:39:23 2017
    New Revision: 318585
    URL: https://svnweb.freebsd.org/changeset/base/318585
    
    Log:
      dma.8: use the correct name for 'SECURETRANSFER'
      
      The code uses 'SECURETRANS', but the config file uses 'SECURETRANSFER'.
      
      MFC after:	3 days
    
    Modified:
      head/contrib/dma/dma.8
    
    Modified: head/contrib/dma/dma.8
    ==============================================================================
    --- head/contrib/dma/dma.8	Sat May 20 17:33:47 2017	(r318584)
    +++ head/contrib/dma/dma.8	Sat May 20 17:39:23 2017	(r318585)
    @@ -30,7 +30,7 @@
     .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     .\" SUCH DAMAGE.
     .\"
    -.Dd February 13, 2014
    +.Dd May 20, 2017
     .Dt DMA 8
     .Os
     .Sh NAME
    @@ -213,7 +213,7 @@ Just stick with the default.
     Path to the
     .Sq auth.conf
     file.
    -.It Ic SECURETRANS Xo
    +.It Ic SECURETRANSFER Xo
     (boolean, default=commented)
     .Xc
     Uncomment if you want TLS/SSL secured transfer.
    @@ -222,7 +222,7 @@ Uncomment if you want TLS/SSL secured tr
     .Xc
     Uncomment if you want to use STARTTLS.
     Only useful together with
    -.Sq SECURETRANS .
    +.Sq SECURETRANSFER .
     .It Ic OPPORTUNISTIC_TLS Xo
     (boolean, default=commented)
     .Xc
    @@ -234,7 +234,7 @@ the outside mail exchangers; in opportun
     be encrypted if the remote server supports STARTTLS, but an unencrypted
     delivery will still be made if the negotiation fails.
     Only useful together with
    -.Sq SECURETRANS
    +.Sq SECURETRANSFER
     and
     .Sq STARTTLS .
     .It Ic CERTFILE Xo
    
    From owner-svn-src-head@freebsd.org  Sat May 20 17:42:59 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDDCFD76568;
     Sat, 20 May 2017 17:42:59 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
     (Client did not present a certificate)
     by mx1.freebsd.org (Postfix) with ESMTPS id 7412F1160;
     Sat, 20 May 2017 17:42:59 +0000 (UTC)
     (envelope-from vangyzen@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHgwVk035395;
     Sat, 20 May 2017 17:42:58 GMT (envelope-from vangyzen@FreeBSD.org)
    Received: (from vangyzen@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHgwgv035394;
     Sat, 20 May 2017 17:42:58 GMT (envelope-from vangyzen@FreeBSD.org)
    Message-Id: <201705201742.v4KHgwgv035394@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
     vangyzen@FreeBSD.org using -f
    From: Eric van Gyzen 
    Date: Sat, 20 May 2017 17:42:58 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318586 - head/contrib/dma
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 17:42:59 -0000
    
    Author: vangyzen
    Date: Sat May 20 17:42:58 2017
    New Revision: 318586
    URL: https://svnweb.freebsd.org/changeset/base/318586
    
    Log:
      dma.8: fix problems reported by igor and 'mandoc -Tlint'
      
      dma.8:77:contraction:Queue the mail, but [don't] attempt to deliver it.
      dma.8:85:repeated:s [are are] ignored.
      dma.8:87:contraction:[Don't] run in the background.
      dma.8:201:contraction:Use the catch-all alias only if you [don't] want any local mail to be
      
      mandoc: dma.8:308:5: WARNING: macro neither callable nor escaped: Sm
      
      MFC after:	3 days
    
    Modified:
      head/contrib/dma/dma.8
    
    Modified: head/contrib/dma/dma.8
    ==============================================================================
    --- head/contrib/dma/dma.8	Sat May 20 17:39:23 2017	(r318585)
    +++ head/contrib/dma/dma.8	Sat May 20 17:42:58 2017	(r318586)
    @@ -74,7 +74,7 @@ acts as a compatibility option for sendm
     .It Fl bp
     List all mails currently stored in the mail queue.
     .It Fl bq
    -Queue the mail, but don't attempt to deliver it.
    +Queue the mail, but do not attempt to deliver it.
     See also the
     .Sq DEFER
     config file setting below.
    @@ -82,9 +82,9 @@ config file setting below.
     .Pp
     All other
     .Ar mode Ns
    -s are are ignored.
    +s are ignored.
     .It Fl D
    -Don't run in the background.
    +Do not run in the background.
     Useful for debugging.
     .It Fl f Ar sender
     Set sender address (envelope-from) to
    @@ -198,7 +198,7 @@ The special name
     .Ql *
     can be used to create a catch-all alias, which gets used if no other
     matching alias is found.
    -Use the catch-all alias only if you don't want any local mail to be
    +Use the catch-all alias only if you do not want any local mail to be
     delivered.
     .It Ic SPOOLDIR Xo
     (string, default=/var/spool/dma)
    @@ -305,7 +305,8 @@ will send all mails as
     setting it to
     .Ql percolator
     will send all mails as
    -.Ql Sm off Va username @percolator .
    +.Sm off
    +.Ql Va username @percolator .
     .Sm on
     .It Ic NULLCLIENT Xo
     .Xc
    
    From owner-svn-src-head@freebsd.org  Sat May 20 18:02:32 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2652D76C50;
     Sat, 20 May 2017 18:02:32 +0000 (UTC) (envelope-from des@FreeBSD.org)
    Received: from repo.freebsd.org (repo.freebsd.org
     [IPv6:2610:1c1:1:6068::e6a:0])
     (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 82C661C5F;
     Sat, 20 May 2017 18:02:32 +0000 (UTC) (envelope-from des@FreeBSD.org)
    Received: from repo.freebsd.org ([127.0.1.37])
     by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KI2Vtf043969;
     Sat, 20 May 2017 18:02:31 GMT (envelope-from des@FreeBSD.org)
    Received: (from des@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KI2VcS043968;
     Sat, 20 May 2017 18:02:31 GMT (envelope-from des@FreeBSD.org)
    Message-Id: <201705201802.v4KI2VcS043968@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org
     using -f
    From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= 
    Date: Sat, 20 May 2017 18:02:31 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318587 - head/contrib/top
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 18:02:32 -0000
    
    Author: des
    Date: Sat May 20 18:02:31 2017
    New Revision: 318587
    URL: https://svnweb.freebsd.org/changeset/base/318587
    
    Log:
      Add -w to usage string.
      
      Reported by:	Jamie Landeg-Jones 
      MFC after:	1 week
    
    Modified:
      head/contrib/top/top.c
    
    Modified: head/contrib/top/top.c
    ==============================================================================
    --- head/contrib/top/top.c	Sat May 20 17:42:58 2017	(r318586)
    +++ head/contrib/top/top.c	Sat May 20 18:02:31 2017	(r318587)
    @@ -433,7 +433,7 @@ char *argv[];
     	      default:
     		fprintf(stderr,
     "Top version %s\n"
    -"Usage: %s [-abCHIijnPqStuvz] [-d count] [-m io | cpu] [-o field] [-s time]\n"
    +"Usage: %s [-abCHIijnPqStuvwz] [-d count] [-m io | cpu] [-o field] [-s time]\n"
     "       [-J jail] [-U username] [number]\n",
     			version_string(), myname);
     		exit(1);
    
    From owner-svn-src-head@freebsd.org  Sat May 20 18:16:28 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47A4BD766FF;
     Sat, 20 May 2017 18:16:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1845516EA;
     Sat, 20 May 2017 18:16:28 +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 v4KIGRkM048166;
     Sat, 20 May 2017 18:16:27 GMT (envelope-from cy@FreeBSD.org)
    Received: (from cy@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KIGR8c048165;
     Sat, 20 May 2017 18:16:27 GMT (envelope-from cy@FreeBSD.org)
    Message-Id: <201705201816.v4KIGR8c048165@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org
     using -f
    From: Cy Schubert 
    Date: Sat, 20 May 2017 18:16:27 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318588 - head/usr.sbin/nscd
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 18:16:28 -0000
    
    Author: cy
    Date: Sat May 20 18:16:26 2017
    New Revision: 318588
    URL: https://svnweb.freebsd.org/changeset/base/318588
    
    Log:
      Fix up two assertions following malloc(). vangyzen@ notified me of
      the second one. The first one is fixed as well.
      
      Reported by:	vangyzen@
      MFC after:	1 week
    
    Modified:
      head/usr.sbin/nscd/query.c
    
    Modified: head/usr.sbin/nscd/query.c
    ==============================================================================
    --- head/usr.sbin/nscd/query.c	Sat May 20 18:02:31 2017	(r318587)
    +++ head/usr.sbin/nscd/query.c	Sat May 20 18:16:26 2017	(r318588)
    @@ -725,7 +725,7 @@ on_read_request_process(struct query_sta
     		if (read_response->error_code == -2) {
     			read_response->data = malloc(
     				read_response->data_size);
    -			assert(read_response != NULL);
    +			assert(read_response->data != NULL);
     			read_response->error_code = cache_read(c_entry,
     				read_request->cache_key,
     		    		read_request->cache_key_size,
    @@ -745,7 +745,7 @@ on_read_request_process(struct query_sta
     			if (read_response->error_code == -2) {
     				read_response->data = malloc(
     					read_response->data_size);
    -				assert(read_response != NULL);
    +				assert(read_response->data != NULL);
     				read_response->error_code = cache_read(neg_c_entry,
     					read_request->cache_key,
     		    			read_request->cache_key_size,
    
    From owner-svn-src-head@freebsd.org  Sat May 20 23:25:08 2017
    Return-Path: 
    Delivered-To: svn-src-head@mailman.ysv.freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC638D75F17;
     Sat, 20 May 2017 23:25:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8876916DD;
     Sat, 20 May 2017 23:25:08 +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 v4KNP7JD076625;
     Sat, 20 May 2017 23:25:07 GMT (envelope-from rmacklem@FreeBSD.org)
    Received: (from rmacklem@localhost)
     by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KNP7Vp076624;
     Sat, 20 May 2017 23:25:07 GMT (envelope-from rmacklem@FreeBSD.org)
    Message-Id: <201705202325.v4KNP7Vp076624@repo.freebsd.org>
    X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
     rmacklem@FreeBSD.org using -f
    From: Rick Macklem 
    Date: Sat, 20 May 2017 23:25:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r318589 - head/usr.sbin/mountd
    X-SVN-Group: head
    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.23
    Precedence: list
    List-Id: 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, 20 May 2017 23:25:08 -0000
    
    Author: rmacklem
    Date: Sat May 20 23:25:07 2017
    New Revision: 318589
    URL: https://svnweb.freebsd.org/changeset/base/318589
    
    Log:
      Update the exports.5 man page to reflect the change in default uid/gid
      made by r318262.
      
      This is a content change.
    
    Modified:
      head/usr.sbin/mountd/exports.5
    
    Modified: head/usr.sbin/mountd/exports.5
    ==============================================================================
    --- head/usr.sbin/mountd/exports.5	Sat May 20 18:16:26 2017	(r318588)
    +++ head/usr.sbin/mountd/exports.5	Sat May 20 23:25:07 2017	(r318589)
    @@ -28,7 +28,7 @@
     .\"     @(#)exports.5	8.3 (Berkeley) 3/29/95
     .\" $FreeBSD$
     .\"
    -.Dd August 14, 2014
    +.Dd May 20, 2017
     .Dt EXPORTS 5
     .Os
     .Sh NAME
    @@ -164,12 +164,12 @@ In the absence of
     .Fl maproot
     and
     .Fl mapall
    -options, remote accesses by root will result in using a credential of -2:-2.
    +options, remote accesses by root will result in using a credential of 65534:65533.
     All other users will be mapped to their remote credential.
     If a
     .Fl maproot
     option is given,
    -remote access by root will be mapped to that credential instead of -2:-2.
    +remote access by root will be mapped to that credential instead of 65534:65533.
     If a
     .Fl mapall
     option is given,