From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 03:06:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C506918; Sun, 14 Dec 2014 03:06:20 +0000 (UTC) Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) (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 72902E2C; Sun, 14 Dec 2014 03:06:18 +0000 (UTC) X-AuditID: 1209190c-f79e46d000000eb2-01-548cfea3d2f1 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 76.EE.03762.3AEFC845; Sat, 13 Dec 2014 22:06:11 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id sBE36Atr029372; Sat, 13 Dec 2014 22:06:10 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id sBE367SF011495 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 13 Dec 2014 22:06:09 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id sBE367XM005334; Sat, 13 Dec 2014 22:06:07 -0500 (EST) Date: Sat, 13 Dec 2014 22:06:06 -0500 (EST) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: Chagin Dmitry Subject: Re: svn commit: r275751 - in head: share/man/man9 sys/kern sys/sys In-Reply-To: <20141213213111.GA2070@dchagin.static.corbina.net> Message-ID: References: <201412132100.sBDL0BvR094009@svn.freebsd.org> <20141213213111.GA2070@dchagin.static.corbina.net> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmleLIzCtJLcpLzFFi42IR4hRV1l38ryfE4M1LQYvTs1+yWfxpn8Ji 8WfTQlaLpi8LmBxYPGZ8ms8SwBjFZZOSmpNZllqkb5fAldHT8I6tYBFbxbR7h9gaGF+wdDFy ckgImEj8/XSPGcIWk7hwbz1bFyMXh5DAYiaJns872CGcjYwSL99ch3IOMUmcXXcdqqyBUeLS 9MesXYwcHCwC2hKHOtlARrEJqEk83tvMCjFWUWLzqUlgK0QE1CVuv/rICGIzC+xmlNh0zBTE Fhbwljj2eRdYL6eAvcSR96/BbF4BR4nbJ2BOArpi1dst7CAJUQEdidX7p7BAFAlKnJz5hAVi qJbE8unbWCYwCs1CkpqFJLWAkWkVo2xKbpVubmJmTnFqsm5xcmJeXmqRrqFebmaJXmpK6SZG cDhL8uxgfHNQ6RCjAAejEg+vRW93iBBrYllxZe4hRkkOJiVR3opHPSFCfEn5KZUZicUZ8UWl OanFhxglOJiVRHj7vgPleFMSK6tSi/JhUtIcLErivJt+8IUICaQnlqRmp6YWpBbBZGU4OJQk eJf9BWoULEpNT61Iy8wpQUgzcXCCDOcBGr4OpIa3uCAxtzgzHSJ/ilGXY0H7/plMQix5+Xmp UuK8S0GKBECKMkrz4ObA0tArRnGgt4R5T4BU8QBTGNykV0BLmICWXGYEW1KSiJCSamBc11xo nr1zz7ODH6L5luwyX2kb8z1HrdpbuNfWpORg5PEaR969rXfmZGc8mshTmbNGvOGIK/NetW89 6+1cPz5U2buJ5W2gov2t7c7tXw9lJBgbMWzKc9TYcsRFSPCL+WrWnfy8cZzhcUv+Bi/18965 Zo6IivSFYAubI4u2XJ3Pb11omOgtPk+JpTgj0VCLuag4EQDMmB2MHgMAAA== Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 03:06:20 -0000 On Sat, 13 Dec 2014, Chagin Dmitry wrote: > > Can you please say a bit more about why this is desired and what it will be > > used for? > > > If the kernel has been compiled with INVARIANTS _init() will assert that the > lock has not been initialized multiple times. _NEW flag is needed to skip this. Yes, I have run into that assertion a few times; it helped me fix bugs in my code. > as _init() does expect you to zero lock first. > it should be used carefully, when you are sure its safe, > to avoid bzero'ing lock struct. ugh I guess I'm still confused as why skipping the zeroing is useful. Wouldn't it be a good practice to always zero? Do you have any specific places in mind where you want to use this functionality? That might help me understand. Thanks, Ben From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 03:15:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16AF2ACA; Sun, 14 Dec 2014 03:15:30 +0000 (UTC) Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu [18.7.68.34]) by mx1.freebsd.org (Postfix) with ESMTP id 7FEC4EE9; Sun, 14 Dec 2014 03:15:29 +0000 (UTC) X-AuditID: 12074422-f79476d000000d9e-17-548cff9edf45 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id C2.76.03486.E9FFC845; Sat, 13 Dec 2014 22:10:22 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id sBE3ALDI024518; Sat, 13 Dec 2014 22:10:21 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id sBE3AJOq012339 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 13 Dec 2014 22:10:20 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id sBE3AIae005928; Sat, 13 Dec 2014 22:10:18 -0500 (EST) Date: Sat, 13 Dec 2014 22:10:18 -0500 (EST) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: Mateusz Guzik Subject: Re: svn commit: r275751 - in head: share/man/man9 sys/kern sys/sys In-Reply-To: <20141213215011.GA17746@dft-labs.eu> Message-ID: References: <201412132100.sBDL0BvR094009@svn.freebsd.org> <20141213213111.GA2070@dchagin.static.corbina.net> <20141213215011.GA17746@dft-labs.eu> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmleLIzCtJLcpLzFFi42IR4hTV1p33vyfE4N9OCYvTs1+yWTQeXMxi 8ad9CpDYtJDVounLAiYHVo8Zn+azeOycdZc9gCmKyyYlNSezLLVI3y6BK+Perlb2gpscFa9e n2FvYPzN1sXIySEhYCLx8s1xVghbTOLCvfVAcS4OIYHFTBIv/y1lh3A2Mkr8WtUO5Rxikug6 OIcJwmlglJi/aR0LSD+LgLbEvhPPwGaxCahJPN7bDDVXUWLzqUnMILaIgKrE86PrWUGamQVe Mkoc2b4PrEhYwFvi2OddYEdxChhKfHo5iQnE5hVwlNi28QzU6muMEvdOfmcHSYgK6Eis3j+F BaJIUOLkzCdgNrOAlsTy6dtYJjAKzUKSmoUktYCRaRWjbEpulW5uYmZOcWqybnFyYl5eapGu qV5uZoleakrpJkZQmLO7KO1g/HlQ6RCjAAejEg+vRW93iBBrYllxZe4hRkkOJiVR3opHPSFC fEn5KZUZicUZ8UWlOanFhxglOJiVRHj7vgPleFMSK6tSi/JhUtIcLErivJt+8IUICaQnlqRm p6YWpBbBZGU4OJQkeFX/ATUKFqWmp1akZeaUIKSZODhBhvMADU8CqeEtLkjMLc5Mh8ifYlSU Eud1A0kIgCQySvPgemFp6BWjONArwrx1IFU8wBQG1/0KaDAT0ODLjGCDSxIRUlINjI6LTjWI mMl9EilY8pCT//ilh/OOm3AWxc5+dZHvubzuDg875UXs/e7PTxfOyTSQ2nC5RGCOytSUPcdn fsguDtpiKRvt935Wj1zxxVniN38rHfUu6vi1bv3Mt5sefTiwqdbQXUj8XHA7x1MFjRvr7ZdN 22Z4a9K9hwxhXnM9ym4ozv6pEVHEVq/EUpyRaKjFXFScCAB4i1izHgMAAA== Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Chagin Dmitry X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 03:15:30 -0000 On Sat, 13 Dec 2014, Mateusz Guzik wrote: > I think the actual question was when would you call _init_flags and not > want _NEW and it would have a potential to detect double init. That is a fine question to ask, but it is not the one I was trying to ask. I can answer yours, though: it detects when buggy code is using uninitialized memory for a structure that needs initialization. If I remember correctly, the need for https://github.com/openafs/openafs/commit/64da7c133a66a15233c2cdc5d9a8f71d17d80d77 was detected by this feature of WITNESS. > I think a better approach would be to have a hash with addresses of all > locks in use. Then _init/_destroy would add/remove it respectively and > we would not be dependent on the state of the lock (e.g. struct could be > zeroed by unrelated code and then double init is not detected). > > Chains locked separately of course. > > I didn't try that, should be totally fine for invariants. That is an interesting proposal, which might be better than the current state of affairs. (I am not signing up to implement it, though.) -Ben From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 04:06:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AD11311; Sun, 14 Dec 2014 04:06:10 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2807F380; Sun, 14 Dec 2014 04:06:10 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id b13so12010909wgh.17 for ; Sat, 13 Dec 2014 20:06:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=XPfzpF/ME1GVcv2XX+5u7nnW+cYDvoTIgiZdkVhVZZ4=; b=kp9dVaN9FB4KHklxfmbj2dwOJ6iqxzWMwmad3X/rRz1igRs9lanIgEjNcW954AxsQB lgQ5A9BIhzByUqmTE2p3nWTnUd/xEHIHuez8Via+xpjAKY2GcqoBTjVELsqUyfyVNYUg 9IePmZGUkwnEMIEyez2KR35lu3YgrDAnAYcq5geEJ43Oee85OGbq5HPJzeQxQQDpUpBY bb8gg0GpvvJ6/V0MuYtsTtCh9S79fPoHrqqv+zX52FrE+A7YvNKc0UZzU66VjmXnBKjZ jaxYXMiJm//rq60zKdzuOLTleULesDc+JDgKBe4qRDagPwyCzFh4VLIvU64poNhIQ0Ec OPkQ== X-Received: by 10.194.90.244 with SMTP id bz20mr40882605wjb.125.1418529968504; Sat, 13 Dec 2014 20:06:08 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id p14sm7970864wie.1.2014.12.13.20.06.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 13 Dec 2014 20:06:07 -0800 (PST) Date: Sun, 14 Dec 2014 05:06:04 +0100 From: Mateusz Guzik To: Benjamin Kaduk Subject: Re: svn commit: r275751 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141214040604.GA2720@dft-labs.eu> References: <201412132100.sBDL0BvR094009@svn.freebsd.org> <20141213213111.GA2070@dchagin.static.corbina.net> <20141213215011.GA17746@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Chagin Dmitry X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 04:06:10 -0000 On Sat, Dec 13, 2014 at 10:10:18PM -0500, Benjamin Kaduk wrote: > On Sat, 13 Dec 2014, Mateusz Guzik wrote: > > > I think the actual question was when would you call _init_flags and not > > want _NEW and it would have a potential to detect double init. > > That is a fine question to ask, but it is not the one I was trying to ask. > > I can answer yours, though: it detects when buggy code is using > uninitialized memory for a structure that needs initialization. > It detects when provided memory happens to not be zeroed, which may or may not violate a requirement for the structure which contains given lock. I'm guessing the rationale is to simply not have to call malloc with M_ZERO just to satisfy invariants. But then who and where would not want to use this _NEW flag? > If I remember correctly, the need for > https://github.com/openafs/openafs/commit/64da7c133a66a15233c2cdc5d9a8f71d17d80d77 > was detected by this feature of WITNESS. > This sounds valid, but does not answer my concern, see above. > > I think a better approach would be to have a hash with addresses of all > > locks in use. Then _init/_destroy would add/remove it respectively and > > we would not be dependent on the state of the lock (e.g. struct could be > > zeroed by unrelated code and then double init is not detected). > > > > Chains locked separately of course. > > > > I didn't try that, should be totally fine for invariants. > > That is an interesting proposal, which might be better than the current > state of affairs. (I am not signing up to implement it, though.) > Turns out even production code contains some witness-related structs, so growing it just to accomodate for this feature may not be as easy. Someone(tm) will have to check what's the point (I doubt production modules run on debug kernels, at least not reliably). -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 06:33:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F558B03; Sun, 14 Dec 2014 06:33:52 +0000 (UTC) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru [78.107.232.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dchagin.static.corbina.net", Issuer "dchagin.static.corbina.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A90C13D; Sun, 14 Dec 2014 06:33:50 +0000 (UTC) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.9/8.14.9) with ESMTP id sBE6Xl9O002987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Dec 2014 09:33:47 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.9/8.14.9/Submit) id sBE6XlIb002986; Sun, 14 Dec 2014 09:33:47 +0300 (MSK) (envelope-from dchagin) Date: Sun, 14 Dec 2014 09:33:47 +0300 From: Chagin Dmitry To: Mateusz Guzik Subject: Re: svn commit: r275751 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141214063346.GA2966@dchagin.static.corbina.net> References: <201412132100.sBDL0BvR094009@svn.freebsd.org> <20141213213111.GA2070@dchagin.static.corbina.net> <20141213215011.GA17746@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20141213215011.GA17746@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 06:33:52 -0000 On Sat, Dec 13, 2014 at 10:50:11PM +0100, Mateusz Guzik wrote: > On Sun, Dec 14, 2014 at 12:31:11AM +0300, Chagin Dmitry wrote: > > On Sat, Dec 13, 2014 at 04:03:47PM -0500, Benjamin Kaduk wrote: > > > On Sat, Dec 13, 2014 at 4:00 PM, Dmitry Chagin = wrote: > > > > > > > > Author: dchagin > > > > Date: Sat Dec 13 21:00:10 2014 > > > > New Revision: 275751 > > > > URL: https://svnweb.freebsd.org/changeset/base/275751 > > > > > > > > Log: > > > > Add _NEW flag to mtx(9), sx(9), rmlock(9) and rwlock(9). > > > > A _NEW flag passed to _init_flags() to avoid check for double-ini= t. > > > > > > > > > > > Can you please say a bit more about why this is desired and what it w= ill be > > > used for? > > >=20 > > If the kernel has been compiled with INVARIANTS _init() will assert tha= t the > > lock has not been initialized multiple times. _NEW flag is needed to sk= ip this. > > as _init() does expect you to zero lock first. > > it should be used carefully, when you are sure its safe, > > to avoid bzero'ing lock struct. ugh > >=20 >=20 > I think the actual question was when would you call _init_flags and not > want _NEW and it would have a potential to detect double init. >=20 > I think a better approach would be to have a hash with addresses of all > locks in use. Then _init/_destroy would add/remove it respectively and > we would not be dependent on the state of the lock (e.g. struct could be > zeroed by unrelated code and then double init is not detected). >=20 > Chains locked separately of course. >=20 > I didn't try that, should be totally fine for invariants. >=20 maybe you're right, I think it would be overkill --=20 Have fun! chd From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 08:43:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FF90397; Sun, 14 Dec 2014 08:43:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5C421D4A; Sun, 14 Dec 2014 08:43:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBE8hEbu038641; Sun, 14 Dec 2014 08:43:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBE8hEoT038640; Sun, 14 Dec 2014 08:43:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412140843.sBE8hEoT038640@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Dec 2014 08:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275753 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 08:43:14 -0000 Author: kib Date: Sun Dec 14 08:43:13 2014 New Revision: 275753 URL: https://svnweb.freebsd.org/changeset/base/275753 Log: Fix gcc build. Sponsored by: The FreeBSD Foundation MFC after: 13 days Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Dec 13 21:13:28 2014 (r275752) +++ head/sys/kern/kern_proc.c Sun Dec 14 08:43:13 2014 (r275753) @@ -3031,6 +3031,7 @@ sysctl_debug_stop_all_proc(SYSCTL_HANDLE } SYSCTL_PROC(_debug, OID_AUTO, stop_all_proc, CTLTYPE_INT | CTLFLAG_RW | - CTLFLAG_MPSAFE, (void *)&ap_resume, 0, sysctl_debug_stop_all_proc, "I", + CTLFLAG_MPSAFE, __DEVOLATILE(int *, &ap_resume), 0, + sysctl_debug_stop_all_proc, "I", ""); #endif From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 09:34:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5169DA57; Sun, 14 Dec 2014 09:34:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 33514196; Sun, 14 Dec 2014 09:34:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBE9YuJN063972; Sun, 14 Dec 2014 09:34:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBE9YuXw063971; Sun, 14 Dec 2014 09:34:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412140934.sBE9YuXw063971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Dec 2014 09:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275754 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 09:34:56 -0000 Author: kib Date: Sun Dec 14 09:34:55 2014 New Revision: 275754 URL: https://svnweb.freebsd.org/changeset/base/275754 Log: MFC r275347: Provide mutual exclusion between zone allocation/destruction and uma_reclaim(). Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Sun Dec 14 08:43:13 2014 (r275753) +++ stable/10/sys/vm/uma_core.c Sun Dec 14 09:34:55 2014 (r275754) @@ -145,6 +145,8 @@ static LIST_HEAD(,uma_slab) uma_boot_pag /* This mutex protects the boot time pages list */ static struct mtx_padalign uma_boot_pages_mtx; +static struct sx uma_drain_lock; + /* Is the VM done starting up? */ static int booted = 0; #define UMA_STARTUP 1 @@ -1876,6 +1878,7 @@ uma_startup2(void) { booted = UMA_STARTUP2; bucket_enable(); + sx_init(&uma_drain_lock, "umadrain"); #ifdef UMA_DEBUG printf("UMA startup2 complete.\n"); #endif @@ -1930,6 +1933,8 @@ uma_zcreate(const char *name, size_t siz { struct uma_zctor_args args; + uma_zone_t res; + bool locked; /* This stuff is essential for the zone ctor */ memset(&args, 0, sizeof(args)); @@ -1943,7 +1948,16 @@ uma_zcreate(const char *name, size_t siz args.flags = flags; args.keg = NULL; - return (zone_alloc_item(zones, &args, M_WAITOK)); + if (booted < UMA_STARTUP2) { + locked = false; + } else { + sx_slock(&uma_drain_lock); + locked = true; + } + res = zone_alloc_item(zones, &args, M_WAITOK); + if (locked) + sx_sunlock(&uma_drain_lock); + return (res); } /* See uma.h */ @@ -1953,6 +1967,8 @@ uma_zsecond_create(char *name, uma_ctor { struct uma_zctor_args args; uma_keg_t keg; + uma_zone_t res; + bool locked; keg = zone_first_keg(master); memset(&args, 0, sizeof(args)); @@ -1966,8 +1982,17 @@ uma_zsecond_create(char *name, uma_ctor args.flags = keg->uk_flags | UMA_ZONE_SECONDARY; args.keg = keg; + if (booted < UMA_STARTUP2) { + locked = false; + } else { + sx_slock(&uma_drain_lock); + locked = true; + } /* XXX Attaches only one keg of potentially many. */ - return (zone_alloc_item(zones, &args, M_WAITOK)); + res = zone_alloc_item(zones, &args, M_WAITOK); + if (locked) + sx_sunlock(&uma_drain_lock); + return (res); } /* See uma.h */ @@ -2085,7 +2110,9 @@ void uma_zdestroy(uma_zone_t zone) { + sx_slock(&uma_drain_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); + sx_sunlock(&uma_drain_lock); } /* See uma.h */ @@ -3171,6 +3198,7 @@ uma_reclaim(void) #ifdef UMA_DEBUG printf("UMA: vm asked us to release pages!\n"); #endif + sx_xlock(&uma_drain_lock); bucket_enable(); zone_foreach(zone_drain); if (vm_page_count_min()) { @@ -3185,6 +3213,7 @@ uma_reclaim(void) zone_drain(slabzone); zone_drain(slabrefzone); bucket_zone_drain(); + sx_xunlock(&uma_drain_lock); } /* See uma.h */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 10:37:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3FA852E; Sun, 14 Dec 2014 10:37:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9FBA08DE; Sun, 14 Dec 2014 10:37:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEAbIwa093618; Sun, 14 Dec 2014 10:37:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEAbIZG093617; Sun, 14 Dec 2014 10:37:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201412141037.sBEAbIZG093617@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 14 Dec 2014 10:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275755 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 10:37:18 -0000 Author: trasz Date: Sun Dec 14 10:37:17 2014 New Revision: 275755 URL: https://svnweb.freebsd.org/changeset/base/275755 Log: Fix spurious "child process X terminated with exit status 1" messages from automountd(8). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automountd.c Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Sun Dec 14 09:34:55 2014 (r275754) +++ head/usr.sbin/autofs/automountd.c Sun Dec 14 10:37:17 2014 (r275755) @@ -82,14 +82,8 @@ done(int request_error, bool wildcards) request_id, request_error); error = ioctl(autofs_fd, AUTOFSDONE, &add); - if (error != 0) { - /* - * Do this instead of log_err() to avoid calling - * done() again with error, from atexit handler. - */ + if (error != 0) log_warn("AUTOFSDONE"); - } - quick_exit(1); } /* From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 10:49:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12FE69C1; Sun, 14 Dec 2014 10:49:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F2BE89C1; Sun, 14 Dec 2014 10:49:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEAnNrl098735; Sun, 14 Dec 2014 10:49:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEAnN9K098734; Sun, 14 Dec 2014 10:49:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201412141049.sBEAnN9K098734@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 14 Dec 2014 10:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275756 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 10:49:24 -0000 Author: trasz Date: Sun Dec 14 10:49:22 2014 New Revision: 275756 URL: https://svnweb.freebsd.org/changeset/base/275756 Log: Fix bug that made automount(8) never unmount stale autofs(5) mounts, ie mounts for entries that were there in auto_master(5), and then got removed. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Sun Dec 14 10:37:17 2014 (r275755) +++ head/usr.sbin/autofs/common.c Sun Dec 14 10:49:22 2014 (r275756) @@ -676,8 +676,8 @@ node_print(const struct node *n) node_print_indent(child, 0); } -struct node * -node_find(struct node *node, const char *path) +static struct node * +node_find_x(struct node *node, const char *path) { struct node *child, *found; char *tmp; @@ -702,7 +702,7 @@ node_find(struct node *node, const char free(tmp); TAILQ_FOREACH(child, &node->n_children, n_next) { - found = node_find(child, path); + found = node_find_x(child, path); if (found != NULL) return (found); } @@ -710,6 +710,17 @@ node_find(struct node *node, const char return (node); } +struct node * +node_find(struct node *root, const char *path) +{ + struct node *node; + + node = node_find_x(root, path); + if (node == root) + return (NULL); + return (node); +} + /* * Canonical form of a map entry looks like this: * From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 10:58:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2879B95; Sun, 14 Dec 2014 10:58:55 +0000 (UTC) Received: from dchagin.static.corbina.net (5.45.224.107-red.dhcp.yndx.net [5.45.224.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dchagin.static.corbina.net", Issuer "dchagin.static.corbina.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 32E73A86; Sun, 14 Dec 2014 10:58:54 +0000 (UTC) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.9/8.14.9) with ESMTP id sBEA7lHA007351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Dec 2014 13:07:48 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.9/8.14.9/Submit) id sBEA7lT5007350; Sun, 14 Dec 2014 13:07:47 +0300 (MSK) (envelope-from dchagin) Date: Sun, 14 Dec 2014 13:07:47 +0300 From: Chagin Dmitry To: Benjamin Kaduk Subject: Re: svn commit: r275751 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141214100747.GA7216@dchagin.static.corbina.net> References: <201412132100.sBDL0BvR094009@svn.freebsd.org> <20141213213111.GA2070@dchagin.static.corbina.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 10:58:55 -0000 On Sat, Dec 13, 2014 at 10:06:06PM -0500, Benjamin Kaduk wrote: > On Sat, 13 Dec 2014, Chagin Dmitry wrote: >=20 > > > Can you please say a bit more about why this is desired and what it w= ill be > > > used for? > > > > > If the kernel has been compiled with INVARIANTS _init() will assert tha= t the > > lock has not been initialized multiple times. _NEW flag is needed to sk= ip this. >=20 > Yes, I have run into that assertion a few times; it helped me fix bugs in > my code. >=20 > > as _init() does expect you to zero lock first. > > it should be used carefully, when you are sure its safe, > > to avoid bzero'ing lock struct. ugh >=20 > I guess I'm still confused as why skipping the zeroing is useful. > Wouldn't it be a good practice to always zero? useful? no >=20 >=20 > Do you have any specific places in mind where you want to use this > functionality? That might help me understand. >=20 sure, next commit --=20 Have fun! chd From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 11:03:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5AA9D8F; Sun, 14 Dec 2014 11:03:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 905C4B39; Sun, 14 Dec 2014 11:03:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEB3Ndt007849; Sun, 14 Dec 2014 11:03:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEB3N4V007848; Sun, 14 Dec 2014 11:03:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201412141103.sBEB3N4V007848@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 14 Dec 2014 11:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275757 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 11:03:23 -0000 Author: trasz Date: Sun Dec 14 11:03:22 2014 New Revision: 275757 URL: https://svnweb.freebsd.org/changeset/base/275757 Log: MFC r274495: Add missing commas to .Xr. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/mkimg/mkimg.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.1 Sun Dec 14 10:49:22 2014 (r275756) +++ stable/10/usr.bin/mkimg/mkimg.1 Sun Dec 14 11:03:22 2014 (r275757) @@ -220,9 +220,9 @@ utility supports assigning labels to the In the following example the file system partition is labeled as 'backup': .Dl % mkimg -s gpt -p freebsd-ufs/backup:=file-system.ufs -o gpt.img .Sh SEE ALSO -.Xr gpart 8 -.Xr makefs 8 -.Xr mdconfig 8 +.Xr gpart 8 , +.Xr makefs 8 , +.Xr mdconfig 8 , .Xr newfs 8 .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 13:32:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 800831C9; Sun, 14 Dec 2014 13:32:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6117AA2D; Sun, 14 Dec 2014 13:32:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEDWFjp081030; Sun, 14 Dec 2014 13:32:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEDWFsf081029; Sun, 14 Dec 2014 13:32:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412141332.sBEDWFsf081029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 14 Dec 2014 13:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275758 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 13:32:15 -0000 Author: dim Date: Sun Dec 14 13:32:14 2014 New Revision: 275758 URL: https://svnweb.freebsd.org/changeset/base/275758 Log: Update patch-r274286-llvm-r201784-asm-dollar.diff, so test/MC/AsmParser/macros.s is properly deleted when patching. Modified: head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Modified: head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff ============================================================================== --- head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Sun Dec 14 11:03:22 2014 (r275757) +++ head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Sun Dec 14 13:32:14 2014 (r275758) @@ -64,8 +64,104 @@ Index: test/MC/AsmParser/exprs.s .macro check_expr .if ($0) != ($1) -Index: test/MC/AsmParser/macros.s (deleted) +Index: test/MC/AsmParser/macros.s =================================================================== +--- test/MC/AsmParser/macros.s ++++ test/MC/AsmParser/macros.s +@@ -1,93 +0,0 @@ +-// RUN: not llvm-mc -triple i386-unknown-unknown %s 2> %t.err | FileCheck %s +-// RUN: FileCheck --check-prefix=CHECK-ERRORS %s < %t.err +- +-.macro .test0 +-.macrobody0 +-.endmacro +-.macro .test1 +-.test0 +-.endmacro +- +-.test1 +-// CHECK-ERRORS: :1:1: error: unknown directive +-// CHECK-ERRORS-NEXT: macrobody0 +-// CHECK-ERRORS-NEXT: ^ +-// CHECK-ERRORS: :1:1: note: while in macro instantiation +-// CHECK-ERRORS-NEXT: .test0 +-// CHECK-ERRORS-NEXT: ^ +-// CHECK-ERRORS: 11:1: note: while in macro instantiation +-// CHECK-ERRORS-NEXT: .test1 +-// CHECK-ERRORS-NEXT: ^ +- +-.macro test2 +-.byte $0 +-.endmacro +-test2 10 +- +-.macro test3 +-.globl "$0 $1 $2 $$3 $n" +-.endmacro +- +-// CHECK: .globl "1 (23) $3 2" +-test3 1, (2 3) +- +-// CHECK: .globl "1 2 $3 2" +-test3 1 2 +- +-.macro test4 +-.globl "$0 -- $1" +-.endmacro +- +-// CHECK: .globl "(ab)(,)) -- (cd)" +-test4 (a b)(,)),(cd) +- +-// CHECK: .globl "(ab)(,)) -- (cd)" +-test4 (a b)(,)),(cd) +- +-.macro test5 _a +-.globl "\_a" +-.endm +- +-// CHECK: .globl zed1 +-test5 zed1 +- +-.macro test6 $a +-.globl "\$a" +-.endm +- +-// CHECK: .globl zed2 +-test6 zed2 +- +-.macro test7 .a +-.globl "\.a" +-.endm +- +-// CHECK: .globl zed3 +-test7 zed3 +- +-.macro test8 _a, _b, _c +-.globl "\_a,\_b,\_c" +-.endmacro +- +-.macro test9 _a _b _c +-.globl "\_a \_b \_c" +-.endmacro +- +-// CHECK: .globl "a,b,c" +-test8 a, b, c +-// CHECK: .globl "%1,%2,%3" +-test8 %1 %2 %3 #a comment +-// CHECK: .globl "x-y,z,1" +-test8 x - y z 1 +-// CHECK: .globl "1 2 3" +-test9 1, 2,3 +- +-test8 1,2 3 +-// CHECK-ERRORS: error: macro argument '_c' is missing +-// CHECK-ERRORS-NEXT: test8 1,2 3 +-// CHECK-ERRORS-NEXT: ^ +- +-test8 1 2, 3 +-// CHECK-ERRORS: error: expected ' ' for macro argument separator +-// CHECK-ERRORS-NEXT:test8 1 2, 3 +-// CHECK-ERRORS-NEXT: ^ Index: test/MC/AsmParser/macros-darwin.s =================================================================== --- test/MC/AsmParser/macros-darwin.s From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 13:38:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C60C39D; Sun, 14 Dec 2014 13:38:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5CE7AA69; Sun, 14 Dec 2014 13:38:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEDcBK1081923; Sun, 14 Dec 2014 13:38:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEDcBQw081922; Sun, 14 Dec 2014 13:38:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412141338.sBEDcBQw081922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 14 Dec 2014 13:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275759 - head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 13:38:11 -0000 Author: dim Date: Sun Dec 14 13:38:10 2014 New Revision: 275759 URL: https://svnweb.freebsd.org/changeset/base/275759 Log: Pull in r221170 from upstream clang trunk (by Roman Divacky): Implement vaarg lowering for ppc32. Lowering of scalars and aggregates is supported. Complex numbers are not. This adds va_args support for PowerPC (32 bit) to clang. Reviewed by: jhibbits MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1308 Modified: head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Modified: head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Sun Dec 14 13:32:14 2014 (r275758) +++ head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Sun Dec 14 13:38:10 2014 (r275759) @@ -2733,11 +2733,19 @@ llvm::Value *NaClX86_64ABIInfo::EmitVAAr // PowerPC-32 - namespace { -class PPC32TargetCodeGenInfo : public DefaultTargetCodeGenInfo { +/// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. +class PPC32_SVR4_ABIInfo : public DefaultABIInfo { public: - PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : DefaultTargetCodeGenInfo(CGT) {} + PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} + + llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, + CodeGenFunction &CGF) const; +}; + +class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { +public: + PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT)) {} int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const { // This is recovered from gcc output. @@ -2750,6 +2758,96 @@ public: } +llvm::Value *PPC32_SVR4_ABIInfo::EmitVAArg(llvm::Value *VAListAddr, + QualType Ty, + CodeGenFunction &CGF) const { + if (const ComplexType *CTy = Ty->getAs()) { + // TODO: Implement this. For now ignore. + (void)CTy; + return NULL; + } + + bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64; + bool isInt = Ty->isIntegerType() || Ty->isPointerType() || Ty->isAggregateType(); + llvm::Type *CharPtr = CGF.Int8PtrTy; + llvm::Type *CharPtrPtr = CGF.Int8PtrPtrTy; + + CGBuilderTy &Builder = CGF.Builder; + llvm::Value *GPRPtr = Builder.CreateBitCast(VAListAddr, CharPtr, "gprptr"); + llvm::Value *GPRPtrAsInt = Builder.CreatePtrToInt(GPRPtr, CGF.Int32Ty); + llvm::Value *FPRPtrAsInt = Builder.CreateAdd(GPRPtrAsInt, Builder.getInt32(1)); + llvm::Value *FPRPtr = Builder.CreateIntToPtr(FPRPtrAsInt, CharPtr); + llvm::Value *OverflowAreaPtrAsInt = Builder.CreateAdd(FPRPtrAsInt, Builder.getInt32(3)); + llvm::Value *OverflowAreaPtr = Builder.CreateIntToPtr(OverflowAreaPtrAsInt, CharPtrPtr); + llvm::Value *RegsaveAreaPtrAsInt = Builder.CreateAdd(OverflowAreaPtrAsInt, Builder.getInt32(4)); + llvm::Value *RegsaveAreaPtr = Builder.CreateIntToPtr(RegsaveAreaPtrAsInt, CharPtrPtr); + llvm::Value *GPR = Builder.CreateLoad(GPRPtr, false, "gpr"); + // Align GPR when TY is i64. + if (isI64) { + llvm::Value *GPRAnd = Builder.CreateAnd(GPR, Builder.getInt8(1)); + llvm::Value *CC64 = Builder.CreateICmpEQ(GPRAnd, Builder.getInt8(1)); + llvm::Value *GPRPlusOne = Builder.CreateAdd(GPR, Builder.getInt8(1)); + GPR = Builder.CreateSelect(CC64, GPRPlusOne, GPR); + } + llvm::Value *FPR = Builder.CreateLoad(FPRPtr, false, "fpr"); + llvm::Value *OverflowArea = Builder.CreateLoad(OverflowAreaPtr, false, "overflow_area"); + llvm::Value *OverflowAreaAsInt = Builder.CreatePtrToInt(OverflowArea, CGF.Int32Ty); + llvm::Value *RegsaveArea = Builder.CreateLoad(RegsaveAreaPtr, false, "regsave_area"); + llvm::Value *RegsaveAreaAsInt = Builder.CreatePtrToInt(RegsaveArea, CGF.Int32Ty); + + llvm::Value *CC = Builder.CreateICmpULT(isInt ? GPR : FPR, + Builder.getInt8(8), "cond"); + + llvm::Value *RegConstant = Builder.CreateMul(isInt ? GPR : FPR, + Builder.getInt8(isInt ? 4 : 8)); + + llvm::Value *OurReg = Builder.CreateAdd(RegsaveAreaAsInt, Builder.CreateSExt(RegConstant, CGF.Int32Ty)); + + if (Ty->isFloatingType()) + OurReg = Builder.CreateAdd(OurReg, Builder.getInt32(32)); + + llvm::BasicBlock *UsingRegs = CGF.createBasicBlock("using_regs"); + llvm::BasicBlock *UsingOverflow = CGF.createBasicBlock("using_overflow"); + llvm::BasicBlock *Cont = CGF.createBasicBlock("cont"); + + Builder.CreateCondBr(CC, UsingRegs, UsingOverflow); + + CGF.EmitBlock(UsingRegs); + + llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); + llvm::Value *Result1 = Builder.CreateIntToPtr(OurReg, PTy); + // Increase the GPR/FPR indexes. + if (isInt) { + GPR = Builder.CreateAdd(GPR, Builder.getInt8(isI64 ? 2 : 1)); + Builder.CreateStore(GPR, GPRPtr); + } else { + FPR = Builder.CreateAdd(FPR, Builder.getInt8(1)); + Builder.CreateStore(FPR, FPRPtr); + } + CGF.EmitBranch(Cont); + + CGF.EmitBlock(UsingOverflow); + + // Increase the overflow area. + llvm::Value *Result2 = Builder.CreateIntToPtr(OverflowAreaAsInt, PTy); + OverflowAreaAsInt = Builder.CreateAdd(OverflowAreaAsInt, Builder.getInt32(isInt ? 4 : 8)); + Builder.CreateStore(Builder.CreateIntToPtr(OverflowAreaAsInt, CharPtr), OverflowAreaPtr); + CGF.EmitBranch(Cont); + + CGF.EmitBlock(Cont); + + llvm::PHINode *Result = CGF.Builder.CreatePHI(PTy, 2, "vaarg.addr"); + Result->addIncoming(Result1, UsingRegs); + Result->addIncoming(Result2, UsingOverflow); + + if (Ty->isAggregateType()) { + llvm::Value *AGGPtr = Builder.CreateBitCast(Result, CharPtrPtr, "aggrptr") ; + return Builder.CreateLoad(AGGPtr, false, "aggr"); + } + + return Result; +} + bool PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const { From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 13:40:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D390953C; Sun, 14 Dec 2014 13:40:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BDDEDA84; Sun, 14 Dec 2014 13:40:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEDehpR084204; Sun, 14 Dec 2014 13:40:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEDehqE084203; Sun, 14 Dec 2014 13:40:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412141340.sBEDehqE084203@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 14 Dec 2014 13:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275760 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 13:40:44 -0000 Author: dim Date: Sun Dec 14 13:40:42 2014 New Revision: 275760 URL: https://svnweb.freebsd.org/changeset/base/275760 Log: Add clang patch corresponding to r275759. Added: head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff Added: head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff Sun Dec 14 13:40:42 2014 (r275760) @@ -0,0 +1,241 @@ +Pull in r221170 from upstream clang trunk (by Roman Divacky): + + Implement vaarg lowering for ppc32. Lowering of scalars and + aggregates is supported. Complex numbers are not. + +This adds va_args support for PowerPC (32 bit) to clang. + +Introduced here: http://svnweb.freebsd.org/changeset/base/275759 + +Index: tools/clang/lib/CodeGen/TargetInfo.cpp +=================================================================== +--- tools/clang/lib/CodeGen/TargetInfo.cpp ++++ tools/clang/lib/CodeGen/TargetInfo.cpp +@@ -2733,12 +2733,20 @@ llvm::Value *NaClX86_64ABIInfo::EmitVAArg(llvm::Va + + + // PowerPC-32 +- + namespace { +-class PPC32TargetCodeGenInfo : public DefaultTargetCodeGenInfo { ++/// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. ++class PPC32_SVR4_ABIInfo : public DefaultABIInfo { + public: +- PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : DefaultTargetCodeGenInfo(CGT) {} ++ PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} + ++ llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, ++ CodeGenFunction &CGF) const; ++}; ++ ++class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { ++public: ++ PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT)) {} ++ + int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const { + // This is recovered from gcc output. + return 1; // r1 is the dedicated stack pointer +@@ -2750,6 +2758,96 @@ namespace { + + } + ++llvm::Value *PPC32_SVR4_ABIInfo::EmitVAArg(llvm::Value *VAListAddr, ++ QualType Ty, ++ CodeGenFunction &CGF) const { ++ if (const ComplexType *CTy = Ty->getAs()) { ++ // TODO: Implement this. For now ignore. ++ (void)CTy; ++ return NULL; ++ } ++ ++ bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64; ++ bool isInt = Ty->isIntegerType() || Ty->isPointerType() || Ty->isAggregateType(); ++ llvm::Type *CharPtr = CGF.Int8PtrTy; ++ llvm::Type *CharPtrPtr = CGF.Int8PtrPtrTy; ++ ++ CGBuilderTy &Builder = CGF.Builder; ++ llvm::Value *GPRPtr = Builder.CreateBitCast(VAListAddr, CharPtr, "gprptr"); ++ llvm::Value *GPRPtrAsInt = Builder.CreatePtrToInt(GPRPtr, CGF.Int32Ty); ++ llvm::Value *FPRPtrAsInt = Builder.CreateAdd(GPRPtrAsInt, Builder.getInt32(1)); ++ llvm::Value *FPRPtr = Builder.CreateIntToPtr(FPRPtrAsInt, CharPtr); ++ llvm::Value *OverflowAreaPtrAsInt = Builder.CreateAdd(FPRPtrAsInt, Builder.getInt32(3)); ++ llvm::Value *OverflowAreaPtr = Builder.CreateIntToPtr(OverflowAreaPtrAsInt, CharPtrPtr); ++ llvm::Value *RegsaveAreaPtrAsInt = Builder.CreateAdd(OverflowAreaPtrAsInt, Builder.getInt32(4)); ++ llvm::Value *RegsaveAreaPtr = Builder.CreateIntToPtr(RegsaveAreaPtrAsInt, CharPtrPtr); ++ llvm::Value *GPR = Builder.CreateLoad(GPRPtr, false, "gpr"); ++ // Align GPR when TY is i64. ++ if (isI64) { ++ llvm::Value *GPRAnd = Builder.CreateAnd(GPR, Builder.getInt8(1)); ++ llvm::Value *CC64 = Builder.CreateICmpEQ(GPRAnd, Builder.getInt8(1)); ++ llvm::Value *GPRPlusOne = Builder.CreateAdd(GPR, Builder.getInt8(1)); ++ GPR = Builder.CreateSelect(CC64, GPRPlusOne, GPR); ++ } ++ llvm::Value *FPR = Builder.CreateLoad(FPRPtr, false, "fpr"); ++ llvm::Value *OverflowArea = Builder.CreateLoad(OverflowAreaPtr, false, "overflow_area"); ++ llvm::Value *OverflowAreaAsInt = Builder.CreatePtrToInt(OverflowArea, CGF.Int32Ty); ++ llvm::Value *RegsaveArea = Builder.CreateLoad(RegsaveAreaPtr, false, "regsave_area"); ++ llvm::Value *RegsaveAreaAsInt = Builder.CreatePtrToInt(RegsaveArea, CGF.Int32Ty); ++ ++ llvm::Value *CC = Builder.CreateICmpULT(isInt ? GPR : FPR, ++ Builder.getInt8(8), "cond"); ++ ++ llvm::Value *RegConstant = Builder.CreateMul(isInt ? GPR : FPR, ++ Builder.getInt8(isInt ? 4 : 8)); ++ ++ llvm::Value *OurReg = Builder.CreateAdd(RegsaveAreaAsInt, Builder.CreateSExt(RegConstant, CGF.Int32Ty)); ++ ++ if (Ty->isFloatingType()) ++ OurReg = Builder.CreateAdd(OurReg, Builder.getInt32(32)); ++ ++ llvm::BasicBlock *UsingRegs = CGF.createBasicBlock("using_regs"); ++ llvm::BasicBlock *UsingOverflow = CGF.createBasicBlock("using_overflow"); ++ llvm::BasicBlock *Cont = CGF.createBasicBlock("cont"); ++ ++ Builder.CreateCondBr(CC, UsingRegs, UsingOverflow); ++ ++ CGF.EmitBlock(UsingRegs); ++ ++ llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); ++ llvm::Value *Result1 = Builder.CreateIntToPtr(OurReg, PTy); ++ // Increase the GPR/FPR indexes. ++ if (isInt) { ++ GPR = Builder.CreateAdd(GPR, Builder.getInt8(isI64 ? 2 : 1)); ++ Builder.CreateStore(GPR, GPRPtr); ++ } else { ++ FPR = Builder.CreateAdd(FPR, Builder.getInt8(1)); ++ Builder.CreateStore(FPR, FPRPtr); ++ } ++ CGF.EmitBranch(Cont); ++ ++ CGF.EmitBlock(UsingOverflow); ++ ++ // Increase the overflow area. ++ llvm::Value *Result2 = Builder.CreateIntToPtr(OverflowAreaAsInt, PTy); ++ OverflowAreaAsInt = Builder.CreateAdd(OverflowAreaAsInt, Builder.getInt32(isInt ? 4 : 8)); ++ Builder.CreateStore(Builder.CreateIntToPtr(OverflowAreaAsInt, CharPtr), OverflowAreaPtr); ++ CGF.EmitBranch(Cont); ++ ++ CGF.EmitBlock(Cont); ++ ++ llvm::PHINode *Result = CGF.Builder.CreatePHI(PTy, 2, "vaarg.addr"); ++ Result->addIncoming(Result1, UsingRegs); ++ Result->addIncoming(Result2, UsingOverflow); ++ ++ if (Ty->isAggregateType()) { ++ llvm::Value *AGGPtr = Builder.CreateBitCast(Result, CharPtrPtr, "aggrptr") ; ++ return Builder.CreateLoad(AGGPtr, false, "aggr"); ++ } ++ ++ return Result; ++} ++ + bool + PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, + llvm::Value *Address) const { +Index: tools/clang/test/CodeGen/ppc64-varargs-struct.c +=================================================================== +--- tools/clang/test/CodeGen/ppc64-varargs-struct.c ++++ tools/clang/test/CodeGen/ppc64-varargs-struct.c +@@ -1,5 +1,6 @@ + // REQUIRES: ppc64-registered-target + // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s ++// RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PPC + + #include + +@@ -17,6 +18,46 @@ void testva (int n, ...) + // CHECK: bitcast %struct.x* %t to i8* + // CHECK: bitcast %struct.x* %{{[0-9]+}} to i8* + // CHECK: call void @llvm.memcpy ++// CHECK-PPC: %arraydecay = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0 ++// CHECK-PPC-NEXT: %gprptr = bitcast %struct.__va_list_tag* %arraydecay to i8* ++// CHECK-PPC-NEXT: %0 = ptrtoint i8* %gprptr to i32 ++// CHECK-PPC-NEXT: %1 = add i32 %0, 1 ++// CHECK-PPC-NEXT: %2 = inttoptr i32 %1 to i8* ++// CHECK-PPC-NEXT: %3 = add i32 %1, 3 ++// CHECK-PPC-NEXT: %4 = inttoptr i32 %3 to i8** ++// CHECK-PPC-NEXT: %5 = add i32 %3, 4 ++// CHECK-PPC-NEXT: %6 = inttoptr i32 %5 to i8** ++// CHECK-PPC-NEXT: %gpr = load i8* %gprptr ++// CHECK-PPC-NEXT: %fpr = load i8* %2 ++// CHECK-PPC-NEXT: %overflow_area = load i8** %4 ++// CHECK-PPC-NEXT: %7 = ptrtoint i8* %overflow_area to i32 ++// CHECK-PPC-NEXT: %regsave_area = load i8** %6 ++// CHECK-PPC-NEXT: %8 = ptrtoint i8* %regsave_area to i32 ++// CHECK-PPC-NEXT: %cond = icmp ult i8 %gpr, 8 ++// CHECK-PPC-NEXT: %9 = mul i8 %gpr, 4 ++// CHECK-PPC-NEXT: %10 = sext i8 %9 to i32 ++// CHECK-PPC-NEXT: %11 = add i32 %8, %10 ++// CHECK-PPC-NEXT: br i1 %cond, label %using_regs, label %using_overflow ++// ++// CHECK-PPC-LABEL:using_regs: ; preds = %entry ++// CHECK-PPC-NEXT: %12 = inttoptr i32 %11 to %struct.x* ++// CHECK-PPC-NEXT: %13 = add i8 %gpr, 1 ++// CHECK-PPC-NEXT: store i8 %13, i8* %gprptr ++// CHECK-PPC-NEXT: br label %cont ++// ++// CHECK-PPC-LABEL:using_overflow: ; preds = %entry ++// CHECK-PPC-NEXT: %14 = inttoptr i32 %7 to %struct.x* ++// CHECK-PPC-NEXT: %15 = add i32 %7, 4 ++// CHECK-PPC-NEXT: %16 = inttoptr i32 %15 to i8* ++// CHECK-PPC-NEXT: store i8* %16, i8** %4 ++// CHECK-PPC-NEXT: br label %cont ++// ++// CHECK-PPC-LABEL:cont: ; preds = %using_overflow, %using_regs ++// CHECK-PPC-NEXT: %vaarg.addr = phi %struct.x* [ %12, %using_regs ], [ %14, %using_overflow ] ++// CHECK-PPC-NEXT: %aggrptr = bitcast %struct.x* %vaarg.addr to i8** ++// CHECK-PPC-NEXT: %aggr = load i8** %aggrptr ++// CHECK-PPC-NEXT: %17 = bitcast %struct.x* %t to i8* ++// CHECK-PPC-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %17, i8* %aggr, i32 16, i32 8, i1 false) + + int v = va_arg (ap, int); + // CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64 +@@ -23,8 +64,48 @@ void testva (int n, ...) + // CHECK: add i64 %{{[0-9]+}}, 4 + // CHECK: inttoptr i64 %{{[0-9]+}} to i8* + // CHECK: bitcast i8* %{{[0-9]+}} to i32* ++// CHECK-PPC: %arraydecay1 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0 ++// CHECK-PPC-NEXT: %gprptr2 = bitcast %struct.__va_list_tag* %arraydecay1 to i8* ++// CHECK-PPC-NEXT: %18 = ptrtoint i8* %gprptr2 to i32 ++// CHECK-PPC-NEXT: %19 = add i32 %18, 1 ++// CHECK-PPC-NEXT: %20 = inttoptr i32 %19 to i8* ++// CHECK-PPC-NEXT: %21 = add i32 %19, 3 ++// CHECK-PPC-NEXT: %22 = inttoptr i32 %21 to i8** ++// CHECK-PPC-NEXT: %23 = add i32 %21, 4 ++// CHECK-PPC-NEXT: %24 = inttoptr i32 %23 to i8** ++// CHECK-PPC-NEXT: %gpr3 = load i8* %gprptr2 ++// CHECK-PPC-NEXT: %fpr4 = load i8* %20 ++// CHECK-PPC-NEXT: %overflow_area5 = load i8** %22 ++// CHECK-PPC-NEXT: %25 = ptrtoint i8* %overflow_area5 to i32 ++// CHECK-PPC-NEXT: %regsave_area6 = load i8** %24 ++// CHECK-PPC-NEXT: %26 = ptrtoint i8* %regsave_area6 to i32 ++// CHECK-PPC-NEXT: %cond7 = icmp ult i8 %gpr3, 8 ++// CHECK-PPC-NEXT: %27 = mul i8 %gpr3, 4 ++// CHECK-PPC-NEXT: %28 = sext i8 %27 to i32 ++// CHECK-PPC-NEXT: %29 = add i32 %26, %28 ++// CHECK-PPC-NEXT: br i1 %cond7, label %using_regs8, label %using_overflow9 ++// ++// CHECK-PPC-LABEL:using_regs8: ; preds = %cont ++// CHECK-PPC-NEXT: %30 = inttoptr i32 %29 to i32* ++// CHECK-PPC-NEXT: %31 = add i8 %gpr3, 1 ++// CHECK-PPC-NEXT: store i8 %31, i8* %gprptr2 ++// CHECK-PPC-NEXT: br label %cont10 ++// ++// CHECK-PPC-LABEL:using_overflow9: ; preds = %cont ++// CHECK-PPC-NEXT: %32 = inttoptr i32 %25 to i32* ++// CHECK-PPC-NEXT: %33 = add i32 %25, 4 ++// CHECK-PPC-NEXT: %34 = inttoptr i32 %33 to i8* ++// CHECK-PPC-NEXT: store i8* %34, i8** %22 ++// CHECK-PPC-NEXT: br label %cont10 ++// ++// CHECK-PPC-LABEL:cont10: ; preds = %using_overflow9, %using_regs8 ++// CHECK-PPC-NEXT: %vaarg.addr11 = phi i32* [ %30, %using_regs8 ], [ %32, %using_overflow9 ] ++// CHECK-PPC-NEXT: %35 = load i32* %vaarg.addr11 ++// CHECK-PPC-NEXT: store i32 %35, i32* %v, align 4 + ++#ifdef __powerpc64__ + __int128_t u = va_arg (ap, __int128_t); ++#endif + // CHECK: bitcast i8* %{{[a-z.0-9]+}} to i128* + // CHECK-NEXT: load i128* %{{[0-9]+}} + } From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 14:56:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F93B2F9 for ; Sun, 14 Dec 2014 14:56:32 +0000 (UTC) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96BDC301 for ; Sun, 14 Dec 2014 14:56:31 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id a1so12623883wgh.23 for ; Sun, 14 Dec 2014 06:56:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=UgkyLLGs09GDlFU0MJHgjAsSpvcWhlaeeFWhSwvwp4Q=; b=Z0TWHPTCMx2ra+ubOuJfe9eUhWAVeJ+UwYyu9duUsbWKXnMFdej4h+0Fci5Cfu58H/ r78rO3NIL+Wzv/5T01jq9P8//RA1G8fm18CzEILZ02ZjFLxpuvizUd+2ZS5tgsTnbP7K 2kZsmwJGOiX7p0kj6Wlu0l0K1/Vp2XLHxcgNbhIHwYTP/X3Wfg8q4zimE8RwJjkL0/o4 rDsndOy2iUKgzbDgIhPhQ1In6a794WpZLaaOZiwZx/y6Uyk9zuzv3NsMGxqSyRzkL+TB 9/QsYO+RUfgYuvszLBG5B3mbYo8UCmjjGNVEhWoKqT1sdL9M51XjeRn+4i2BTaxqKbvE xfOQ== X-Gm-Message-State: ALoCoQnCKoYH0Jr9Z7rppq+11LvIqtNVtPy5xSiKGLvK3jY9QAWJHQyglnu05npPrmZ2gffSOxmw X-Received: by 10.180.108.205 with SMTP id hm13mr24538897wib.5.1418568983926; Sun, 14 Dec 2014 06:56:23 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id d2sm9416411wjs.32.2014.12.14.06.56.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Dec 2014 06:56:23 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <548DA4A3.8020000@freebsd.org> Date: Sun, 14 Dec 2014 14:54:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys References: <201412131214.sBDCESwJ033037@svn.freebsd.org> In-Reply-To: <201412131214.sBDCESwJ033037@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 14:56:32 -0000 Sounds nasty, is this something that only effects stable/10 or does it also effects 10.1-RELEASE? On 13/12/2014 12:14, Dimitry Andric wrote: > Author: dim > Date: Sat Dec 13 12:14:26 2014 > New Revision: 275742 > URL: https://svnweb.freebsd.org/changeset/base/275742 > > Log: > MFC r275633: > > Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin): > > PR21302. Vectorize only bottom-tested loops. > > rdar://problem/18886083 > > This fixes a bug in the llvm vectorizer, which could sometimes cause > vectorized loops to perform an additional iteration, leading to possible > buffer overruns. Symptoms of this, which are usually segfaults, were > first noticed when building gcc ports, here: > > https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html > https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html > > Since this fix is very important for ports, bump __FreeBSD_version to > make it easier for port maintainers to test whether the fix has been > applied. > > Upstream PR: http://llvm.org/PR21302 > > Modified: > stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp > stable/10/sys/sys/param.h > Directory Properties: > stable/10/ (props changed) > > Changes in other areas also in this revision: > Modified: > stable/9/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp > stable/9/sys/sys/param.h > Directory Properties: > stable/9/contrib/llvm/ (props changed) > stable/9/sys/ (props changed) > > Modified: stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp > ============================================================================== > --- stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sat Dec 13 04:50:14 2014 (r275741) > +++ stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sat Dec 13 12:14:26 2014 (r275742) > @@ -2864,6 +2864,14 @@ bool LoopVectorizationLegality::canVecto > if (!TheLoop->getExitingBlock()) > return false; > > + // We only handle bottom-tested loops, i.e. loop in which the condition is > + // checked at the end of each iteration. With that we can assume that all > + // instructions in the loop are executed the same number of times. > + if (TheLoop->getExitingBlock() != TheLoop->getLoopLatch()) { > + DEBUG(dbgs() << "LV: loop control flow is not understood by vectorizer\n"); > + return false; > + } > + > // We need to have a loop header. > DEBUG(dbgs() << "LV: Found a loop: " << > TheLoop->getHeader()->getName() << '\n'); > > Modified: stable/10/sys/sys/param.h > ============================================================================== > --- stable/10/sys/sys/param.h Sat Dec 13 04:50:14 2014 (r275741) > +++ stable/10/sys/sys/param.h Sat Dec 13 12:14:26 2014 (r275742) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1001503 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1001504 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 15:03:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68D7D609; Sun, 14 Dec 2014 15:03:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3A69B61C; Sun, 14 Dec 2014 15:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEF3C8f025219; Sun, 14 Dec 2014 15:03:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEF3CZD025218; Sun, 14 Dec 2014 15:03:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141503.sBEF3CZD025218@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 15:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275762 - stable/10/sys/boot/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:03:12 -0000 Author: andrew Date: Sun Dec 14 15:03:11 2014 New Revision: 275762 URL: https://svnweb.freebsd.org/changeset/base/275762 Log: MFC r273913: Clean up the types of a few strings to make them const when they are never written to. MFC r273914: The command name is a constant, use the correct type. Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Dec 14 14:03:40 2014 (r275761) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Dec 14 15:03:11 2014 (r275762) @@ -93,9 +93,9 @@ static int fdt_cmd_mres(int argc, char * typedef int cmdf_t(int, char *[]); struct cmdtab { - char *name; - cmdf_t *handler; - int flags; + const char *name; + cmdf_t *handler; + int flags; }; static const struct cmdtab commands[] = { @@ -364,11 +364,11 @@ fdt_setup_fdtp() (cellbuf), (lim), (cellsize), 16); static int -_fdt_strtovect(char *str, void *cellbuf, int lim, unsigned char cellsize, +_fdt_strtovect(const char *str, void *cellbuf, int lim, unsigned char cellsize, uint8_t base) { - char *buf = str; - char *end = str + strlen(str) - 2; + const char *buf = str; + const char *end = str + strlen(str) - 2; uint32_t *u32buf = NULL; uint8_t *u8buf = NULL; int cnt = 0; @@ -411,7 +411,8 @@ _fdt_strtovect(char *str, void *cellbuf, static void fixup_ethernet(const char *env, char *ethstr, int *eth_no, int len) { - char *end, *str; + const char *str; + char *end; uint8_t tmp_addr[6]; int i, n; @@ -1347,7 +1348,7 @@ static int fdt_modprop(int nodeoff, char *propname, void *value, char mode) { uint32_t cells[100]; - char *buf; + const char *buf; int len, rv; const struct fdt_property *p; @@ -1365,7 +1366,7 @@ fdt_modprop(int nodeoff, char *propname, } len = strlen(value); rv = 0; - buf = (char *)value; + buf = value; switch (*buf) { case '&': From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 15:11:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E32158BF; Sun, 14 Dec 2014 15:11:31 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A21E77B; Sun, 14 Dec 2014 15:11:31 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::ec02:9330:f41e:f824] (unknown [IPv6:2001:7b8:3a7:0:ec02:9330:f41e:f824]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 56967B80A; Sun, 14 Dec 2014 16:11:17 +0100 (CET) Subject: Re: svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_11473C2F-6908-4332-8B72-2C7072FDDD52"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b3 From: Dimitry Andric In-Reply-To: <548DA4A3.8020000@freebsd.org> Date: Sun, 14 Dec 2014 16:11:09 +0100 Message-Id: <43A88D44-A799-46AB-8853-560407BABC84@FreeBSD.org> References: <201412131214.sBDCESwJ033037@svn.freebsd.org> <548DA4A3.8020000@freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.1993) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:11:32 -0000 --Apple-Mail=_11473C2F-6908-4332-8B72-2C7072FDDD52 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 14 Dec 2014, at 15:54, Steven Hartland = wrote: >=20 > On 13/12/2014 12:14, Dimitry Andric wrote: >> Author: dim >> Date: Sat Dec 13 12:14:26 2014 >> New Revision: 275742 >> URL: https://svnweb.freebsd.org/changeset/base/275742 >>=20 >> Log: >> MFC r275633: >> Pull in r223171 from upstream llvm trunk (by Michael = Zolotukhin): >> PR21302. Vectorize only bottom-tested loops. >> rdar://problem/18886083 >> This fixes a bug in the llvm vectorizer, which could sometimes = cause >> vectorized loops to perform an additional iteration, leading to = possible >> buffer overruns. Symptoms of this, which are usually segfaults, = were >> first noticed when building gcc ports, here: >> = https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.ht= ml >> = https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/00121= 1.html >> Since this fix is very important for ports, bump = __FreeBSD_version to >> make it easier for port maintainers to test whether the fix has = been >> applied. >> Upstream PR: http://llvm.org/PR21302 >=20 > Sounds nasty, is this something that only effects stable/10 or does it = also effects 10.1-RELEASE? Yes, this is quite nasty, and it does affect 10.1-RELEASE, 9.3-RELEASE, and any other release with clang 3.4.x, which turned on the vectorizer by default. Although it is in fact rather hard to create the situation where it can possibly do an off-by-one, I would really advise to apply this diff to release systems as well. I also contacted secteam@ about it, but apparently they have not yet decided whether to do a security advisory for this bug. -Dimitry --Apple-Mail=_11473C2F-6908-4332-8B72-2C7072FDDD52 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----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlSNqJUACgkQsF6jCi4glqNu4QCfUAG/IKnCl61Lz557s4NHDmId WuQAoMw6P5IekLs/uJ55PgziVWKTTwfs =4Yf+ -----END PGP SIGNATURE----- --Apple-Mail=_11473C2F-6908-4332-8B72-2C7072FDDD52-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 15:17:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 98181A61; Sun, 14 Dec 2014 15:17:19 +0000 (UTC) Date: Sun, 14 Dec 2014 15:17:19 +0000 From: Alexey Dokuchaev To: Dimitry Andric Subject: Re: svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys Message-ID: <20141214151719.GB76347@FreeBSD.org> References: <201412131214.sBDCESwJ033037@svn.freebsd.org> <548DA4A3.8020000@freebsd.org> <43A88D44-A799-46AB-8853-560407BABC84@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43A88D44-A799-46AB-8853-560407BABC84@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steven Hartland , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:17:19 -0000 On Sun, Dec 14, 2014 at 04:11:09PM +0100, Dimitry Andric wrote: > Yes, this is quite nasty, and it does affect 10.1-RELEASE, 9.3-RELEASE, > and any other release with clang 3.4.x, which turned on the vectorizer > by default. Could it be the cause of "REDZONE: Buffer overflow detected. 16 bytes corrupted after 0xd2375200 (256 bytes allocated)" bug reported by dhw@ WRT nvidia-driver-340.46 on 2014-11-18 [1]? ./danfe [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195154 From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 15:22:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8F9EBD9; Sun, 14 Dec 2014 15:22:02 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF6E853; Sun, 14 Dec 2014 15:22:02 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::ec02:9330:f41e:f824] (unknown [IPv6:2001:7b8:3a7:0:ec02:9330:f41e:f824]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6EDDDB80A; Sun, 14 Dec 2014 16:21:57 +0100 (CET) Subject: Re: svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_279BC7EC-83DD-4B3C-81FD-833658439F75"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b3 From: Dimitry Andric In-Reply-To: <20141214151719.GB76347@FreeBSD.org> Date: Sun, 14 Dec 2014 16:21:52 +0100 Message-Id: References: <201412131214.sBDCESwJ033037@svn.freebsd.org> <548DA4A3.8020000@freebsd.org> <43A88D44-A799-46AB-8853-560407BABC84@FreeBSD.org> <20141214151719.GB76347@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1993) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steven Hartland , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:22:02 -0000 --Apple-Mail=_279BC7EC-83DD-4B3C-81FD-833658439F75 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 14 Dec 2014, at 16:17, Alexey Dokuchaev wrote: > > On Sun, Dec 14, 2014 at 04:11:09PM +0100, Dimitry Andric wrote: >> Yes, this is quite nasty, and it does affect 10.1-RELEASE, 9.3-RELEASE, >> and any other release with clang 3.4.x, which turned on the vectorizer >> by default. > > Could it be the cause of "REDZONE: Buffer overflow detected. 16 bytes > corrupted after 0xd2375200 (256 bytes allocated)" bug reported by dhw@ > WRT nvidia-driver-340.46 on 2014-11-18 [1]? This is extremely unlikely, since the kernel is compiled without SSE. (The bug was in the vectorizer, which transforms loops into SSE constructs.) Does this problem disappear when both the kernel and the NVIDIA kernel module are compiled with -O1? -Dimitry --Apple-Mail=_279BC7EC-83DD-4B3C-81FD-833658439F75 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----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlSNqxYACgkQsF6jCi4glqNbqgCcCH9cA6OQGJwJ8flg79jd4m3N iQcAoL2TT2QnQ+m9Hr3W8gvlbLSABrS0 =q+b5 -----END PGP SIGNATURE----- --Apple-Mail=_279BC7EC-83DD-4B3C-81FD-833658439F75-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 15:33:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 885709DB; Sun, 14 Dec 2014 15:33:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7217AB38; Sun, 14 Dec 2014 15:33:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEFXnwI040942; Sun, 14 Dec 2014 15:33:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEFXkoB040925; Sun, 14 Dec 2014 15:33:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141533.sBEFXkoB040925@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 15:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275763 - in stable/10/sys/boot: arm/uboot fdt powerpc/uboot uboot uboot/common uboot/fdt uboot/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:33:49 -0000 Author: andrew Date: Sun Dec 14 15:33:45 2014 New Revision: 275763 URL: https://svnweb.freebsd.org/changeset/base/275763 Log: MFC 273927: Move the definitions of the fdt functions from a uboot header to a new fdt header. There is nothing in the fdt spec that ties it to U-Boot. While here sort and fix the signature of fdt_setup_fdtp. MFC 273934: Start to allow platforms other than U-Boot to use the FDT code in loader by moving U-Boot specific code from libfdt.a to a new libuboot_fdt.a. This needs to be a new library for linking to work correctly. Differential Revision: https://reviews.freebsd.org/D1054 Reviewed by: ian, rpaulo (earlier version) Added: stable/10/sys/boot/fdt/fdt_platform.h - copied, changed from r273927, head/sys/boot/fdt/fdt_platform.h stable/10/sys/boot/uboot/fdt/ - copied from r273934, head/sys/boot/uboot/fdt/ Modified: stable/10/sys/boot/arm/uboot/Makefile stable/10/sys/boot/fdt/Makefile stable/10/sys/boot/fdt/fdt_loader_cmd.c stable/10/sys/boot/powerpc/uboot/Makefile stable/10/sys/boot/uboot/Makefile stable/10/sys/boot/uboot/common/metadata.c stable/10/sys/boot/uboot/fdt/Makefile stable/10/sys/boot/uboot/lib/Makefile stable/10/sys/boot/uboot/lib/libuboot.h stable/10/sys/boot/uboot/lib/module.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/10/sys/boot/arm/uboot/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/arm/uboot/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -72,6 +72,7 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt CFLAGS+= -DLOADER_FDT_SUPPORT +LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif @@ -112,8 +113,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: stable/10/sys/boot/fdt/Makefile ============================================================================== --- stable/10/sys/boot/fdt/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/fdt/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -11,8 +11,7 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw. # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c -CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ \ - -I${.CURDIR}/../uboot/lib +CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Dec 14 15:33:45 2014 (r275763) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" -#include "glue.h" +#include "fdt_platform.h" #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ @@ -52,9 +52,6 @@ __FBSDID("$FreeBSD$"); #define FDT_PROP_SEP " = " -#define STR(number) #number -#define STRINGIFY(number) STR(number) - #define COPYOUT(s,d,l) archsw.arch_copyout(s, d, l) #define COPYIN(s,d,l) archsw.arch_copyin(s, d, l) @@ -228,7 +225,7 @@ fdt_load_dtb(vm_offset_t va) return (0); } -static int +int fdt_load_dtb_addr(struct fdt_header *header) { int err; @@ -253,7 +250,7 @@ fdt_load_dtb_addr(struct fdt_header *hea return (0); } -static int +int fdt_load_dtb_file(const char * filename) { struct preloaded_file *bfp, *oldbfp; @@ -283,9 +280,6 @@ int fdt_setup_fdtp() { struct preloaded_file *bfp; - struct fdt_header *hdr; - const char *s; - char *p; vm_offset_t va; debugf("fdt_setup_fdtp()\n"); @@ -308,41 +302,8 @@ fdt_setup_fdtp() } } - /* - * If the U-boot environment contains a variable giving the address of a - * valid blob in memory, use it. The U-boot README says the right - * variable for fdt data loaded into ram is fdt_addr_r, so try that - * first. Board vendors also use both fdtaddr and fdt_addr names. - */ - s = ub_env_get("fdt_addr_r"); - if (s == NULL) - s = ub_env_get("fdtaddr"); - if (s == NULL) - s = ub_env_get("fdt_addr"); - if (s != NULL && *s != '\0') { - hdr = (struct fdt_header *)strtoul(s, &p, 16); - if (*p == '\0') { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by U-Boot at " - "address 0x%p.\n", hdr); - return (0); - } - } - } - - /* - * If the U-boot environment contains a variable giving the name of a - * file, use it if we can load and validate it. - */ - s = ub_env_get("fdtfile"); - if (s == NULL) - s = ub_env_get("fdt_file"); - if (s != NULL && *s != '\0') { - if (fdt_load_dtb_file(s) == 0) { - printf("Loaded DTB from file '%s'.\n", s); - return (0); - } - } + if (fdt_platform_load_dtb() == 0) + return (0); /* If there is a dtb compiled into the kernel, use it. */ if ((va = fdt_find_static_dtb()) != 0) { @@ -406,48 +367,20 @@ _fdt_strtovect(const char *str, void *ce return (cnt); } -#define TMP_MAX_ETH 8 - -static void -fixup_ethernet(const char *env, char *ethstr, int *eth_no, int len) +void +fdt_fixup_ethernet(const char *str, char *ethstr, int len) { - const char *str; - char *end; uint8_t tmp_addr[6]; - int i, n; - - /* Extract interface number */ - i = strtol(env + 3, &end, 10); - if (end == (env + 3)) - /* 'ethaddr' means interface 0 address */ - n = 0; - else - n = i; - - if (n > TMP_MAX_ETH) - return; - - str = ub_env_get(env); /* Convert macaddr string into a vector of uints */ fdt_strtovectx(str, &tmp_addr, 6, sizeof(uint8_t)); - if (n != 0) { - i = strlen(env) - 7; - strncpy(ethstr + 8, env + 3, i); - } /* Set actual property to a value from vect */ fdt_setprop(fdtp, fdt_path_offset(fdtp, ethstr), "local-mac-address", &tmp_addr, 6 * sizeof(uint8_t)); - - /* Clear ethernet..XXXX.. string */ - bzero(ethstr + 8, len - 8); - - if (n + 1 > *eth_no) - *eth_no = n + 1; } -static void -fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) +void +fdt_fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) { int lo, o = 0, o2, maxo = 0, depth; const uint32_t zero = 0; @@ -526,13 +459,14 @@ fdt_reg_valid(uint32_t *reg, int len, in return (0); } -static void -fixup_memory(struct sys_info *si) +void +fdt_fixup_memory(struct fdt_mem_region *region, size_t num) { - struct mem_region *curmr; + struct fdt_mem_region *curmr; uint32_t addr_cells, size_cells; uint32_t *addr_cellsp, *reg, *size_cellsp; - int err, i, len, memory, realmrno, root; + int err, i, len, memory, root; + size_t realmrno; uint8_t *buf, *sb; uint64_t rstart, rsize; int reserved; @@ -590,7 +524,6 @@ fixup_memory(struct sys_info *si) bzero(buf, len); for (i = 0; i < reserved; i++) { - curmr = &si->mr[i]; if (fdt_get_mem_rsv(fdtp, i, &rstart, &rsize)) break; if (rsize) { @@ -622,9 +555,9 @@ fixup_memory(struct sys_info *si) } /* Count valid memory regions entries in sysinfo. */ - realmrno = si->mr_no; - for (i = 0; i < si->mr_no; i++) - if (si->mr[i].start == 0 && si->mr[i].size == 0) + realmrno = num; + for (i = 0; i < num; i++) + if (region[i].start == 0 && region[i].size == 0) realmrno--; if (realmrno == 0) { @@ -651,8 +584,8 @@ fixup_memory(struct sys_info *si) bzero(buf, len); - for (i = 0; i < si->mr_no; i++) { - curmr = &si->mr[i]; + for (i = 0; i < num; i++) { + curmr = ®ion[i]; if (curmr->size != 0) { /* Ensure endianess, and put cells into a buffer */ if (addr_cells == 2) @@ -681,17 +614,15 @@ fixup_memory(struct sys_info *si) free(sb); } -static void -fixup_stdout(const char *env) +void +fdt_fixup_stdout(const char *str) { - const char *str; char *ptr; int serialno; int len, no, sero; const struct fdt_property *prop; char *tmp[10]; - str = ub_env_get(env); ptr = (char *)str + strlen(str) - 1; while (ptr > str && isdigit(*(str - 1))) str--; @@ -737,14 +668,8 @@ fixup_stdout(const char *env) static int fdt_fixup(void) { - const char *env; - char *ethstr; - int chosen, eth_no, len; - struct sys_info *si; - - env = NULL; - eth_no = 0; - ethstr = NULL; + int chosen, len; + len = 0; debugf("fdt_fixup()\n"); @@ -761,45 +686,7 @@ fdt_fixup(void) if (fdt_getprop(fdtp, chosen, "fixup-applied", NULL)) return (1); - /* Acquire sys_info */ - si = ub_get_sys_info(); - - while ((env = ub_env_enum(env)) != NULL) { - if (strncmp(env, "eth", 3) == 0 && - strncmp(env + (strlen(env) - 4), "addr", 4) == 0) { - /* - * Handle Ethernet addrs: parse uboot env eth%daddr - */ - - if (!eth_no) { - /* - * Check how many chars we will need to store - * maximal eth iface number. - */ - len = strlen(STRINGIFY(TMP_MAX_ETH)) + - strlen("ethernet"); - - /* - * Reserve mem for string "ethernet" and len - * chars for iface no. - */ - ethstr = (char *)malloc(len * sizeof(char)); - bzero(ethstr, len * sizeof(char)); - strcpy(ethstr, "ethernet0"); - } - - /* Modify blob */ - fixup_ethernet(env, ethstr, ð_no, len); - - } else if (strcmp(env, "consoledev") == 0) - fixup_stdout(env); - } - - /* Modify cpu(s) and bus clock frequenties in /cpus node [Hz] */ - fixup_cpubusfreqs(si->clk_cpu, si->clk_bus); - - /* Fixup memory regions */ - fixup_memory(si); + fdt_platform_fixups(); fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); return (1); Copied and modified: stable/10/sys/boot/fdt/fdt_platform.h (from r273927, head/sys/boot/fdt/fdt_platform.h) ============================================================================== --- head/sys/boot/fdt/fdt_platform.h Sat Nov 1 10:50:18 2014 (r273927, copy source) +++ stable/10/sys/boot/fdt/fdt_platform.h Sun Dec 14 15:33:45 2014 (r275763) @@ -29,7 +29,26 @@ #ifndef FDT_PLATFORM_H #define FDT_PLATFORM_H -extern int fdt_copy(vm_offset_t); -extern int fdt_setup_fdtp(void); +struct fdt_header; + +struct fdt_mem_region { + unsigned long start; + unsigned long size; +}; + +#define TMP_MAX_ETH 8 + +int fdt_copy(vm_offset_t); +void fdt_fixup_cpubusfreqs(unsigned long, unsigned long); +void fdt_fixup_ethernet(const char *, char *, int); +void fdt_fixup_memory(struct fdt_mem_region *, size_t); +void fdt_fixup_stdout(const char *); +int fdt_load_dtb_addr(struct fdt_header *); +int fdt_load_dtb_file(const char *); +int fdt_setup_fdtp(void); + +/* The platform library needs to implement these functions */ +int fdt_platform_load_dtb(void); +void fdt_platform_fixups(void); #endif /* FDT_PLATFORM_H */ Modified: stable/10/sys/boot/powerpc/uboot/Makefile ============================================================================== --- stable/10/sys/boot/powerpc/uboot/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/powerpc/uboot/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -62,6 +62,7 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt CFLAGS+= -DLOADER_FDT_SUPPORT +LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif @@ -98,8 +99,8 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: stable/10/sys/boot/uboot/Makefile ============================================================================== --- stable/10/sys/boot/uboot/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -1,5 +1,11 @@ # $FreeBSD$ +.include + SUBDIR= lib +.if ${MK_FDT} != "no" +SUBDIR+=fdt +.endif + .include Modified: stable/10/sys/boot/uboot/common/metadata.c ============================================================================== --- stable/10/sys/boot/uboot/common/metadata.c Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/common/metadata.c Sun Dec 14 15:33:45 2014 (r275763) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #if defined(LOADER_FDT_SUPPORT) -#include "libuboot.h" +#include #endif static int Modified: stable/10/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Sat Nov 1 17:12:44 2014 (r273934) +++ stable/10/sys/boot/uboot/fdt/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include .PATH: ${.CURDIR}/../../common Modified: stable/10/sys/boot/uboot/lib/Makefile ============================================================================== --- stable/10/sys/boot/uboot/lib/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/lib/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -27,7 +27,7 @@ LOADER_FDT_SUPPORT= no .endif .if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -DLOADER_FDT_SUPPORT +CFLAGS+= -DLOADER_FDT_SUPPORT -I${.CURDIR}/../../fdt .endif # Pick up FDT includes Modified: stable/10/sys/boot/uboot/lib/libuboot.h ============================================================================== --- stable/10/sys/boot/uboot/lib/libuboot.h Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/lib/libuboot.h Sun Dec 14 15:33:45 2014 (r275763) @@ -72,8 +72,3 @@ void reboot(void); int uboot_diskgetunit(int type, int type_unit); -#if defined(LOADER_FDT_SUPPORT) -extern int fdt_setup_fdtp(); -extern int fdt_copy(vm_offset_t); -#endif - Modified: stable/10/sys/boot/uboot/lib/module.c ============================================================================== --- stable/10/sys/boot/uboot/lib/module.c Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/lib/module.c Sun Dec 14 15:33:45 2014 (r275763) @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(LOADER_FDT_SUPPORT) +#include +#endif + #include "bootstrap.h" #include "libuboot.h" From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 15:41:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D8B1D2C; Sun, 14 Dec 2014 15:41:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 89C25C3C; Sun, 14 Dec 2014 15:41:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEFfvhl045563; Sun, 14 Dec 2014 15:41:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEFfvjq045562; Sun, 14 Dec 2014 15:41:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141541.sBEFfvjq045562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 15:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275764 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:41:57 -0000 Author: andrew Date: Sun Dec 14 15:41:56 2014 New Revision: 275764 URL: https://svnweb.freebsd.org/changeset/base/275764 Log: MFC 275207: We don't use the hypervisor interrupt, make it optional in the device tree. Submitted by: Julien Grall MFC 275208: Some device tree configurations place the generic timer under the root of the tree and not under simplebus. Update the driver to handle this. Submitted by: Julien Grall Modified: stable/10/sys/arm/arm/generic_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/generic_timer.c ============================================================================== --- stable/10/sys/arm/arm/generic_timer.c Sun Dec 14 15:33:45 2014 (r275763) +++ stable/10/sys/arm/arm/generic_timer.c Sun Dec 14 15:41:56 2014 (r275764) @@ -86,7 +86,7 @@ static struct resource_spec timer_spec[] { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Secure */ { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Non-secure */ { SYS_RES_IRQ, 2, RF_ACTIVE }, /* Virt */ - { SYS_RES_IRQ, 3, RF_ACTIVE }, /* Hyp */ + { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, /* Hyp */ { -1, 0 } }; @@ -345,6 +345,8 @@ static devclass_t arm_tmr_devclass; EARLY_DRIVER_MODULE(timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(timer, ofwbus, arm_tmr_driver, arm_tmr_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); void DELAY(int usec) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:17:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2466944B; Sun, 14 Dec 2014 16:17:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 103A5EF9; Sun, 14 Dec 2014 16:17:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEGHngl061256; Sun, 14 Dec 2014 16:17:49 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEGHnmY061255; Sun, 14 Dec 2014 16:17:49 GMT (envelope-from des@FreeBSD.org) Message-Id: <201412141617.sBEGHnmY061255@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Sun, 14 Dec 2014 16:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275765 - head/usr.sbin/chkgrp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 16:17:50 -0000 Author: des Date: Sun Dec 14 16:17:48 2014 New Revision: 275765 URL: https://svnweb.freebsd.org/changeset/base/275765 Log: Clean up, reindent, add a special case for NIS / LDAP line MFC after: 1 week Modified: head/usr.sbin/chkgrp/chkgrp.c Modified: head/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- head/usr.sbin/chkgrp/chkgrp.c Sun Dec 14 15:41:56 2014 (r275764) +++ head/usr.sbin/chkgrp/chkgrp.c Sun Dec 14 16:17:48 2014 (r275765) @@ -40,154 +40,152 @@ __FBSDID("$FreeBSD$"); #include #include -static char empty[] = { 0 }; - static void __dead2 usage(void) { - fprintf(stderr, "usage: chkgrp [groupfile]\n"); - exit(EX_USAGE); + + fprintf(stderr, "usage: chkgrp [-q] [groupfile]\n"); + exit(EX_USAGE); } int main(int argc, char *argv[]) { - unsigned int i; - size_t len; - int quiet; - int ch; - int n = 0, k, e = 0; - char *line, *f[4], *p; - const char *cp, *gfn; - FILE *gf; - - quiet = 0; - while ((ch = getopt(argc, argv, "q")) != -1) { - switch (ch) { + FILE *gf; + unsigned long gid; + unsigned int i; + size_t len; + int opt, quiet; + int n = 0, k, e = 0; + const char *cp, *f[4], *gfn, *p; + char *line; + + quiet = 0; + while ((opt = getopt(argc, argv, "q")) != -1) { + switch (opt) { case 'q': quiet = 1; break; - case '?': default: usage(); - } - } - - if (optind == argc) - gfn = "/etc/group"; - else if (optind == argc - 1) - gfn = argv[optind]; - else - usage(); - - /* open group file */ - if ((gf = fopen(gfn, "r")) == NULL) - err(EX_NOINPUT, "%s", gfn); - - /* check line by line */ - while (++n) { - if ((line = fgetln(gf, &len)) == NULL) - break; - if (len > 0 && line[len - 1] != '\n') { - warnx("%s: line %d: no newline character", gfn, n); - e = 1; - } - while (len && isspace(line[len-1])) - len--; - - /* ignore blank lines and comments */ - for (p = line; p < (line + len); p++) - if (!isspace(*p)) break; - if (!len || (*p == '#')) { -#if 0 - /* entry is correct, so print it */ - printf("%*.*s\n", len, len, line); -#endif - continue; - } - - /* - * A correct group entry has four colon-separated fields, the third - * of which must be entirely numeric and the fourth of which may - * be empty. - */ - for (i = k = 0; k < 4; k++) { - for (f[k] = line+i; (i < len) && (line[i] != ':'); i++) - /* nothing */ ; - if ((k < 3) && (line[i] != ':')) - break; - line[i++] = 0; + } } - if (k < 4) { - warnx("%s: line %d: missing field(s)", gfn, n); - for ( ; k < 4; k++) - f[k] = empty; - e = 1; - } - - for (cp = f[0] ; *cp ; cp++) { - if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-' && - (cp > f[0] || *cp != '+')) { - warnx("%s: line %d: '%c' invalid character", gfn, n, *cp); - e = 1; - } - } - - for (cp = f[3] ; *cp ; cp++) { - if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-' && - *cp != ',') { - warnx("%s: line %d: '%c' invalid character", gfn, n, *cp); - e = 1; - } - } + argc -= optind; + argv += optind; - /* check if fourth field ended with a colon */ - if (i < len) { - warnx("%s: line %d: too many fields", gfn, n); - e = 1; - } - - /* check that none of the fields contain whitespace */ - for (k = 0; k < 4; k++) { - if (strcspn(f[k], " \t") != strlen(f[k])) { - warnx("%s: line %d: field %d contains whitespace", - gfn, n, k+1); - e = 1; - } - } - - /* check that the GID is numeric */ - if (strspn(f[2], "0123456789") != strlen(f[2])) { - warnx("%s: line %d: GID is not numeric", gfn, n); - e = 1; - } - - /* check the range of the group id */ - errno = 0; - unsigned long groupid = strtoul(f[2], NULL, 10); - if (errno != 0) { - warnx("%s: line %d: strtoul failed", gfn, n); - } - else if (groupid > GID_MAX) { - warnx("%s: line %d: group id is too large (> %ju)", - gfn, n, (uintmax_t)GID_MAX); - e = 1; - } + if (argc == 0) + gfn = "/etc/group"; + else if (argc == 1) + gfn = argv[0]; + else + usage(); + + /* open group file */ + if ((gf = fopen(gfn, "r")) == NULL) + err(EX_NOINPUT, "%s", gfn); + + /* check line by line */ + while (++n) { + if ((line = fgetln(gf, &len)) == NULL) + break; + if (len > 0 && line[len - 1] != '\n') { + warnx("%s: line %d: no newline character", gfn, n); + e = 1; + } + while (len && isspace(line[len-1])) + len--; + + /* ignore blank lines and comments */ + for (p = line; p < line + len; p++) + if (!isspace(*p)) break; + if (!len || *p == '#') + continue; + + /* + * Hack: special case for + line + */ + if (strncmp(line, "+:::", len) == 0) + continue; + + /* + * A correct group entry has four colon-separated fields, + * the third of which must be entirely numeric and the + * fourth of which may be empty. + */ + for (i = k = 0; k < 4; k++) { + for (f[k] = line + i; i < len && line[i] != ':'; i++) + /* nothing */ ; + if (k < 3 && line[i] != ':') + break; + line[i++] = 0; + } + + if (k < 4) { + warnx("%s: line %d: missing field(s)", gfn, n); + while (k < 4) + f[k++] = ""; + e = 1; + } + + for (cp = f[0] ; *cp ; cp++) { + if (!isalnum(*cp) && *cp != '.' && *cp != '_' && + *cp != '-' && (cp > f[0] || *cp != '+')) { + warnx("%s: line %d: '%c' invalid character", + gfn, n, *cp); + e = 1; + } + } + + for (cp = f[3] ; *cp ; cp++) { + if (!isalnum(*cp) && *cp != '.' && *cp != '_' && + *cp != '-' && *cp != ',') { + warnx("%s: line %d: '%c' invalid character", + gfn, n, *cp); + e = 1; + } + } + + /* check if fourth field ended with a colon */ + if (i < len) { + warnx("%s: line %d: too many fields", gfn, n); + e = 1; + } -#if 0 - /* entry is correct, so print it */ - printf("%s:%s:%s:%s\n", f[0], f[1], f[2], f[3]); -#endif - } - - /* check what broke the loop */ - if (ferror(gf)) - err(EX_IOERR, "%s: line %d", gfn, n); - - /* done */ - fclose(gf); - if (e == 0 && quiet == 0) - printf("%s is fine\n", gfn); - exit(e ? EX_DATAERR : EX_OK); + /* check that none of the fields contain whitespace */ + for (k = 0; k < 4; k++) { + if (strcspn(f[k], " \t") != strlen(f[k])) { + warnx("%s: line %d: field %d contains whitespace", + gfn, n, k+1); + e = 1; + } + } + + /* check that the GID is numeric */ + if (strspn(f[2], "0123456789") != strlen(f[2])) { + warnx("%s: line %d: group id is not numeric", gfn, n); + e = 1; + } + + /* check the range of the group id */ + errno = 0; + gid = strtoul(f[2], NULL, 10); + if (errno != 0) { + warnx("%s: line %d: strtoul failed", gfn, n); + } else if (gid > GID_MAX) { + warnx("%s: line %d: group id is too large (%ju > %ju)", + gfn, n, (uintmax_t)gid, (uintmax_t)GID_MAX); + e = 1; + } + } + + /* check what broke the loop */ + if (ferror(gf)) + err(EX_IOERR, "%s: line %d", gfn, n); + + /* done */ + fclose(gf); + if (e == 0 && quiet == 0) + printf("%s is fine\n", gfn); + exit(e ? EX_DATAERR : EX_OK); } From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:26:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85BEF66A; Sun, 14 Dec 2014 16:26:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 713F4FC9; Sun, 14 Dec 2014 16:26:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEGQLNQ065972; Sun, 14 Dec 2014 16:26:21 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEGQKHt065965; Sun, 14 Dec 2014 16:26:20 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201412141626.sBEGQKHt065965@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 14 Dec 2014 16:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275766 - in head/bin/sh: . tests/execution X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 16:26:21 -0000 Author: jilles Date: Sun Dec 14 16:26:19 2014 New Revision: 275766 URL: https://svnweb.freebsd.org/changeset/base/275766 Log: sh: Make sure output suitable as shell input is also printable. Commands like 'export -p', 'set' and 'trap', and tracing enabled via 'set -x' generate output suitable as shell input by adding quotes as necessary. If there are control characters other than newline or invalid UTF-8 sequences, use $'...' and \OOO to display them safely. The resulting output is not parsable by a strict POSIX.1-2008 shell but sh from FreeBSD 9.0 and newer and many other shells can parse it. Added: head/bin/sh/tests/execution/set-x4.0 (contents, props changed) Modified: head/bin/sh/output.c head/bin/sh/tests/execution/Makefile Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Sun Dec 14 16:17:48 2014 (r275765) +++ head/bin/sh/output.c Sun Dec 14 16:26:19 2014 (r275766) @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "shell.h" #include "syntax.h" @@ -111,42 +113,86 @@ outstr(const char *p, struct output *fil outbin(p, strlen(p), file); } +static void +byteseq(int ch, struct output *file) +{ + char seq[4]; + + seq[0] = '\\'; + seq[1] = (ch >> 6 & 0x3) + '0'; + seq[2] = (ch >> 3 & 0x7) + '0'; + seq[3] = (ch & 0x7) + '0'; + outbin(seq, 4, file); +} + +static void +outdqstr(const char *p, struct output *file) +{ + const char *end; + mbstate_t mbs; + size_t clen; + wchar_t wc; + + memset(&mbs, '\0', sizeof(mbs)); + end = p + strlen(p); + outstr("$'", file); + while ((clen = mbrtowc(&wc, p, end - p + 1, &mbs)) != 0) { + if (clen == (size_t)-2) { + while (p < end) + byteseq(*p++, file); + break; + } + if (clen == (size_t)-1) { + memset(&mbs, '\0', sizeof(mbs)); + byteseq(*p++, file); + continue; + } + if (wc == L'\n') + outcslow('\n', file), p++; + else if (wc == L'\r') + outstr("\\r", file), p++; + else if (wc == L'\t') + outstr("\\t", file), p++; + else if (!iswprint(wc)) { + for (; clen > 0; clen--) + byteseq(*p++, file); + } else { + if (wc == L'\'' || wc == L'\\') + outcslow('\\', file); + outbin(p, clen, file); + p += clen; + } + } + outcslow('\'', file); +} + /* Like outstr(), but quote for re-input into the shell. */ void outqstr(const char *p, struct output *file) { - char ch; - int inquotes; + int i; if (p[0] == '\0') { outstr("''", file); return; } - if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#=")] == '\0' || + for (i = 0; p[i] != '\0'; i++) { + if ((p[i] > '\0' && p[i] < ' ' && p[i] != '\n') || + (p[i] & 0x80) != 0 || p[i] == '\'') { + outdqstr(p, file); + return; + } + } + + if (p[strcspn(p, "|&;<>()$`\\\" \n*?[~#=")] == '\0' || strcmp(p, "[") == 0) { outstr(p, file); return; } - inquotes = 0; - while ((ch = *p++) != '\0') { - switch (ch) { - case '\'': - /* Can't quote single quotes inside single quotes. */ - if (inquotes) - outcslow('\'', file); - inquotes = 0; - outstr("\\'", file); - break; - default: - if (!inquotes) - outcslow('\'', file); - inquotes = 1; - outc(ch, file); - } - } - if (inquotes) - outcslow('\'', file); + outcslow('\'', file); + outstr(p, file); + outcslow('\'', file); } void Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Sun Dec 14 16:17:48 2014 (r275765) +++ head/bin/sh/tests/execution/Makefile Sun Dec 14 16:26:19 2014 (r275766) @@ -44,6 +44,7 @@ FILES+= set-n4.0 FILES+= set-x1.0 FILES+= set-x2.0 FILES+= set-x3.0 +FILES+= set-x4.0 FILES+= shellproc1.0 FILES+= subshell1.0 subshell1.0.stdout FILES+= subshell2.0 Added: head/bin/sh/tests/execution/set-x4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/set-x4.0 Sun Dec 14 16:26:19 2014 (r275766) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +key=`printf '\r\t\001\200\300'` +r=`{ set -x; : "$key"; } 2>&1 >/dev/null` +case $r in +*[![:print:]]*) echo fail; exit 3 +esac From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:28:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B80B9822; Sun, 14 Dec 2014 16:28:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A0C6BFE8; Sun, 14 Dec 2014 16:28:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEGSwv5066403; Sun, 14 Dec 2014 16:28:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEGSsbO066365; Sun, 14 Dec 2014 16:28:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141628.sBEGSsbO066365@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 16:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275767 - in stable/10: lib/libc/arm/string sys/arm/arm sys/arm/include sys/arm/ti sys/arm/xscale/ixp425 sys/libkern/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 16:28:58 -0000 Author: andrew Date: Sun Dec 14 16:28:53 2014 New Revision: 275767 URL: https://svnweb.freebsd.org/changeset/base/275767 Log: Clean up our ARM assembly: MFC 275256: Switch to the ARM unified assembly language as the clang integrated as only supports it. Binutils supports it when the ".syntax unified" directive is set. Sponsored by: ABT Systems Ltd MFC 275264: Update _ENTRY to use _EENTRY to reduce the common code. MFC 275321: Remove extra labels, ENTRY_NP already provides them. Sponsored by: ABT Systems Ltd MFC 275322: Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND Sponsored by: ABT Systems Ltd MFC 275416: Fix the name of the coprocessor to include the "p" prefix, the clang integrated assembler expects this. Sponsored by: ABT Systems Ltd MFC 275418: Switch to unified syntax so these can be built with clang 3.5. Sponsored by: ABT Systems Ltd MFC 275519: Add missing END macros to some of the xscale functions. Sponsored by: ABT Systems Ltd MFC 275520: Use the unified syntax in a few more assembly files Sponsored by: ABT Systems Ltd MFC 275521: Set the alignment to 4-bytes after a string as clang 3.5 can switch to thumb mode if this is incorrect. Sponsored by: ABT Systems Ltd MFC 275522: Place the literal pool after a RET otherwise clang 3.5 tries to put it too far away from a ldr psuedo instruction. With this clang will place the literal value here where it's close enough to be loaded. Sponsored by: ABT Systems Ltd MFC 275523: Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is unsupported as it needs a newer cpu. Sponsored by: ABT Systems Ltd MFC 275524: Switch to a .cpu directive. These will work when clang 3.5 is imported where the .arch directive is a nop. Sponsored by: ABT Systems Ltd Modified: stable/10/lib/libc/arm/string/ffs.S stable/10/lib/libc/arm/string/memcmp.S stable/10/lib/libc/arm/string/memcpy_arm.S stable/10/lib/libc/arm/string/memcpy_xscale.S stable/10/lib/libc/arm/string/memmove.S stable/10/lib/libc/arm/string/memset.S stable/10/lib/libc/arm/string/strlen.S stable/10/sys/arm/arm/bcopyinout_xscale.S stable/10/sys/arm/arm/blockio.S stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S stable/10/sys/arm/arm/cpufunc_asm_armv5.S stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S stable/10/sys/arm/arm/fusu.S stable/10/sys/arm/arm/in_cksum_arm.S stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/support.S stable/10/sys/arm/include/asm.h stable/10/sys/arm/ti/ti_smc.S stable/10/sys/arm/xscale/ixp425/ixp425_a4x_io.S stable/10/sys/arm/xscale/ixp425/ixp425_pci_asm.S stable/10/sys/libkern/arm/ffs.S Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/arm/string/ffs.S ============================================================================== --- stable/10/lib/libc/arm/string/ffs.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/ffs.S Sun Dec 14 16:28:53 2014 (r275767) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); +.syntax unified + /* * ffs - find first set bit, this algorithm isolates the first set * bit, then multiplies the number by 0x0450fbaf which leaves the top @@ -60,7 +62,7 @@ ENTRY(ffs) rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */ /* now lookup in table indexed on top 6 bits of r0 */ - ldrneb r0, [ r2, r0, lsr #26 ] + ldrbne r0, [ r2, r0, lsr #26 ] RET .text; Modified: stable/10/lib/libc/arm/string/memcmp.S ============================================================================== --- stable/10/lib/libc/arm/string/memcmp.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memcmp.S Sun Dec 14 16:28:53 2014 (r275767) @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); +.syntax unified + ENTRY(memcmp) mov ip, r0 #if defined(_KERNEL) && !defined(_STANDALONE) @@ -76,7 +78,7 @@ ENTRY(memcmp) /* Are both addresses aligned the same way? */ cmp r2, #0x00 - eornes r3, ip, r1 + eorsne r3, ip, r1 RETeq /* len == 0, or same addresses! */ tst r3, #0x03 subne r2, r2, #0x01 Modified: stable/10/lib/libc/arm/string/memcpy_arm.S ============================================================================== --- stable/10/lib/libc/arm/string/memcpy_arm.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memcpy_arm.S Sun Dec 14 16:28:53 2014 (r275767) @@ -31,6 +31,9 @@ #include __FBSDID("$FreeBSD$"); + +.syntax unified + /* * This is one fun bit of code ... * Some easy listening music is suggested while trying to understand this @@ -91,8 +94,8 @@ ENTRY(memcpy) bge .Lmemcpy_loop32 cmn r2, #0x10 - ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgeia r0!, {r3, r4, r12, lr} + ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmiage r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 ldmia sp!, {r4} /* return r4 */ @@ -101,9 +104,9 @@ ENTRY(memcpy) /* blat 12 bytes at a time */ .Lmemcpy_loop12: - ldmgeia r1!, {r3, r12, lr} - stmgeia r0!, {r3, r12, lr} - subges r2, r2, #0x0c + ldmiage r1!, {r3, r12, lr} + stmiage r0!, {r3, r12, lr} + subsge r2, r2, #0x0c bge .Lmemcpy_loop12 .Lmemcpy_l12: @@ -113,26 +116,26 @@ ENTRY(memcpy) subs r2, r2, #4 ldrlt r3, [r1], #4 strlt r3, [r0], #4 - ldmgeia r1!, {r3, r12} - stmgeia r0!, {r3, r12} + ldmiage r1!, {r3, r12} + stmiage r0!, {r3, r12} subge r2, r2, #4 .Lmemcpy_l4: /* less than 4 bytes to go */ adds r2, r2, #4 #ifdef __APCS_26_ - ldmeqia sp!, {r0, pc}^ /* done */ + ldmiaeq sp!, {r0, pc}^ /* done */ #else - ldmeqia sp!, {r0, pc} /* done */ + ldmiaeq sp!, {r0, pc} /* done */ #endif /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 ldmia sp!, {r0, pc} /* erg - unaligned destination */ @@ -143,10 +146,10 @@ ENTRY(memcpy) /* align destination with byte copies */ ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 subs r2, r2, r12 blt .Lmemcpy_l4 /* less the 4 bytes */ Modified: stable/10/lib/libc/arm/string/memcpy_xscale.S ============================================================================== --- stable/10/lib/libc/arm/string/memcpy_xscale.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memcpy_xscale.S Sun Dec 14 16:28:53 2014 (r275767) @@ -38,6 +38,8 @@ #include __FBSDID("$FreeBSD$"); +.syntax unified + /* LINTSTUB: Func: void *memcpy(void *dst, const void *src, size_t len) */ ENTRY(memcpy) pld [r1] @@ -52,12 +54,12 @@ ENTRY(memcpy) ldrb ip, [r1], #0x01 sub r2, r2, #0x01 strb ip, [r3], #0x01 - ldrleb ip, [r1], #0x01 + ldrble ip, [r1], #0x01 suble r2, r2, #0x01 - strleb ip, [r3], #0x01 - ldrltb ip, [r1], #0x01 + strble ip, [r3], #0x01 + ldrblt ip, [r1], #0x01 sublt r2, r2, #0x01 - strltb ip, [r3], #0x01 + strblt ip, [r3], #0x01 /* Destination buffer is now word aligned */ .Lmemcpy_wordaligned: @@ -134,7 +136,7 @@ ENTRY(memcpy) .Lmemcpy_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} bxeq lr /* Return now if done */ subs r2, r2, #0x20 blt .Lmemcpy_w_lessthan32 @@ -159,7 +161,7 @@ ENTRY(memcpy) .Lmemcpy_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} bxeq lr /* Return now if done */ and r4, r2, #0x18 @@ -195,11 +197,11 @@ ENTRY(memcpy) addlt r2, r2, #0x04 ldrb ip, [r1], #0x01 cmp r2, #0x02 - ldrgeb r2, [r1], #0x01 + ldrbge r2, [r1], #0x01 strb ip, [r3], #0x01 - ldrgtb ip, [r1] - strgeb r2, [r3], #0x01 - strgtb ip, [r3] + ldrbgt ip, [r1] + strbge r2, [r3], #0x01 + strbgt ip, [r3] bx lr @@ -253,7 +255,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} bxeq lr /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x03 @@ -314,7 +316,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} bxeq lr /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x02 @@ -375,7 +377,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} bxeq lr /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x01 @@ -404,11 +406,11 @@ ENTRY(memcpy) bxeq lr ldrb ip, [r1], #0x01 cmp r2, #0x02 - ldrgeb r2, [r1], #0x01 + ldrbge r2, [r1], #0x01 strb ip, [r3], #0x01 - ldrgtb ip, [r1] - strgeb r2, [r3], #0x01 - strgtb ip, [r3] + ldrbgt ip, [r1] + strbge r2, [r3], #0x01 + strbgt ip, [r3] bx lr @@ -440,7 +442,7 @@ ENTRY(memcpy) ldrb ip, [r1], #0x01 1: subs r2, r2, #0x01 strb ip, [r3], #0x01 - ldrneb ip, [r1], #0x01 + ldrbne ip, [r1], #0x01 bne 1b bx lr Modified: stable/10/lib/libc/arm/string/memmove.S ============================================================================== --- stable/10/lib/libc/arm/string/memmove.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memmove.S Sun Dec 14 16:28:53 2014 (r275767) @@ -32,6 +32,8 @@ #include __FBSDID("$FreeBSD$"); +.syntax unified + #ifndef _BCOPY /* LINTSTUB: Func: void *memmove(void *, const void *, size_t) */ ENTRY(memmove) @@ -86,8 +88,8 @@ ENTRY(bcopy) bge .Lmemmove_floop32 cmn r2, #0x10 - ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgeia r0!, {r3, r4, r12, lr} + ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmiage r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 ldmia sp!, {r4} /* return r4 */ @@ -96,9 +98,9 @@ ENTRY(bcopy) /* blat 12 bytes at a time */ .Lmemmove_floop12: - ldmgeia r1!, {r3, r12, lr} - stmgeia r0!, {r3, r12, lr} - subges r2, r2, #0x0c + ldmiage r1!, {r3, r12, lr} + stmiage r0!, {r3, r12, lr} + subsge r2, r2, #0x0c bge .Lmemmove_floop12 .Lmemmove_fl12: @@ -108,23 +110,23 @@ ENTRY(bcopy) subs r2, r2, #4 ldrlt r3, [r1], #4 strlt r3, [r0], #4 - ldmgeia r1!, {r3, r12} - stmgeia r0!, {r3, r12} + ldmiage r1!, {r3, r12} + stmiage r0!, {r3, r12} subge r2, r2, #4 .Lmemmove_fl4: /* less than 4 bytes to go */ adds r2, r2, #4 - ldmeqia sp!, {r0, pc} /* done */ + ldmiaeq sp!, {r0, pc} /* done */ /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 ldmia sp!, {r0, pc} /* erg - unaligned destination */ @@ -135,10 +137,10 @@ ENTRY(bcopy) /* align destination with byte copies */ ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 subs r2, r2, r12 blt .Lmemmove_fl4 /* less the 4 bytes */ @@ -353,12 +355,12 @@ ENTRY(bcopy) .Lmemmove_bl32: cmn r2, #0x10 - ldmgedb r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgedb r0!, {r3, r4, r12, lr} + ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmdbge r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 adds r2, r2, #0x14 - ldmgedb r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ - stmgedb r0!, {r3, r12, lr} + ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ + stmdbge r0!, {r3, r12, lr} subge r2, r2, #0x0c ldmia sp!, {r4, lr} @@ -368,8 +370,8 @@ ENTRY(bcopy) subs r2, r2, #4 ldrlt r3, [r1, #-4]! strlt r3, [r0, #-4]! - ldmgedb r1!, {r3, r12} - stmgedb r0!, {r3, r12} + ldmdbge r1!, {r3, r12} + stmdbge r0!, {r3, r12} subge r2, r2, #4 .Lmemmove_bl4: @@ -381,10 +383,10 @@ ENTRY(bcopy) cmp r2, #2 ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! - ldrgeb r3, [r1, #-1]! - strgeb r3, [r0, #-1]! - ldrgtb r3, [r1, #-1]! - strgtb r3, [r0, #-1]! + ldrbge r3, [r1, #-1]! + strbge r3, [r0, #-1]! + ldrbgt r3, [r1, #-1]! + strbgt r3, [r0, #-1]! RET /* erg - unaligned destination */ @@ -394,10 +396,10 @@ ENTRY(bcopy) /* align destination with byte copies */ ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! - ldrgeb r3, [r1, #-1]! - strgeb r3, [r0, #-1]! - ldrgtb r3, [r1, #-1]! - strgtb r3, [r0, #-1]! + ldrbge r3, [r1, #-1]! + strbge r3, [r0, #-1]! + ldrbgt r3, [r1, #-1]! + strbgt r3, [r0, #-1]! subs r2, r2, r12 blt .Lmemmove_bl4 /* less than 4 bytes to go */ ands r12, r1, #3 Modified: stable/10/lib/libc/arm/string/memset.S ============================================================================== --- stable/10/lib/libc/arm/string/memset.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memset.S Sun Dec 14 16:28:53 2014 (r275767) @@ -69,6 +69,8 @@ #include __FBSDID("$FreeBSD$"); +.syntax unified + /* * memset: Sets a block of memory to the specified value * @@ -125,39 +127,39 @@ ENTRY(memset) .Lmemset_loop128: subs r1, r1, #0x80 #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 -#else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 +#else + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop128 RETeq /* Zero length so just exit */ @@ -168,15 +170,15 @@ ENTRY(memset) .Lmemset_loop32: subs r1, r1, #0x20 #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 -#else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 +#else + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop32 RETeq /* Zero length so just exit */ @@ -185,11 +187,11 @@ ENTRY(memset) /* Deal with 16 bytes or more */ #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 #else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif RETeq /* Zero length so just exit */ @@ -212,17 +214,17 @@ ENTRY(memset) #endif strb r3, [ip], #0x01 /* Set 1 byte */ - strgeb r3, [ip], #0x01 /* Set another byte */ - strgtb r3, [ip] /* and a third */ + strbge r3, [ip], #0x01 /* Set another byte */ + strbgt r3, [ip] /* and a third */ RET /* Exit */ .Lmemset_wordunaligned: rsb r2, r2, #0x004 strb r3, [ip], #0x01 /* Set 1 byte */ cmp r2, #0x02 - strgeb r3, [ip], #0x01 /* Set another byte */ + strbge r3, [ip], #0x01 /* Set another byte */ sub r1, r1, r2 - strgtb r3, [ip], #0x01 /* and a third */ + strbgt r3, [ip], #0x01 /* and a third */ cmp r1, #0x04 /* More than 4 bytes left? */ bge .Lmemset_wordaligned /* Yup */ @@ -231,8 +233,8 @@ ENTRY(memset) RETeq /* Zero length so exit */ strb r3, [ip], #0x01 /* Set 1 byte */ cmp r1, #0x02 - strgeb r3, [ip], #0x01 /* Set another byte */ - strgtb r3, [ip] /* and a third */ + strbge r3, [ip], #0x01 /* Set another byte */ + strbgt r3, [ip] /* and a third */ RET /* Exit */ #ifdef _BZERO END(bzero) Modified: stable/10/lib/libc/arm/string/strlen.S ============================================================================== --- stable/10/lib/libc/arm/string/strlen.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/strlen.S Sun Dec 14 16:28:53 2014 (r275767) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +.syntax unified + ENTRY(strlen) mov r1, #0 /* Check that the pointer is aligned on 32 bits. */ @@ -53,23 +55,23 @@ ENTRY(strlen) addne r1, r1, #1 .Ldo_3: #ifndef __ARMEB__ - andnes r3, r2, #0x0000ff00 + andsne r3, r2, #0x0000ff00 #else - andnes r3, r2, #0x00ff0000 + andsne r3, r2, #0x00ff0000 #endif addne r1, r1, #1 .Ldo_2: #ifndef __ARMEB__ - andnes r3, r2, #0x00ff0000 + andsne r3, r2, #0x00ff0000 #else - andnes r3, r2, #0x0000ff00 + andsne r3, r2, #0x0000ff00 #endif addne r1, r1, #1 .Ldo_1: #ifndef __ARMEB__ - andnes r3, r2, #0xff000000 + andsne r3, r2, #0xff000000 #else - andnes r3, r2, #0x000000ff + andsne r3, r2, #0x000000ff #endif addne r1, r1, #1 bne .Loop Modified: stable/10/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- stable/10/sys/arm/arm/bcopyinout_xscale.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/bcopyinout_xscale.S Sun Dec 14 16:28:53 2014 (r275767) @@ -38,6 +38,7 @@ #include __FBSDID("$FreeBSD$"); + .syntax unified .text .align 0 @@ -104,8 +105,8 @@ ENTRY(copyin) ldr r0, =EFAULT str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ + ldmfdgt sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ + ldmfdlt sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ ldmfd sp!, {r10-r11, pc} .Lcopyin_guts: @@ -138,7 +139,7 @@ ENTRY(copyin) /* Quad-align the destination buffer */ tst r1, #0x07 /* Already quad aligned? */ - ldrnet ip, [r0], #0x04 + ldrtne ip, [r0], #0x04 strne ip, [r1], #0x04 subne r2, r2, #0x04 stmfd sp!, {r4-r9} /* Free up some registers */ @@ -207,7 +208,7 @@ ENTRY(copyin) .Lcopyin_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq subs r2, r2, #0x20 blt .Lcopyin_w_lessthan32 @@ -232,7 +233,7 @@ ENTRY(copyin) .Lcopyin_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ and r4, r2, #0x18 @@ -266,17 +267,17 @@ ENTRY(copyin) .Lcopyin_w_less_than8: subs r2, r2, #0x04 - ldrget ip, [r0], #0x04 + ldrtge ip, [r0], #0x04 strge ip, [r1], #0x04 RETeq /* Return now if done */ addlt r2, r2, #0x04 ldrbt ip, [r0], #0x01 cmp r2, #0x02 - ldrgebt r2, [r0], #0x01 + ldrbtge r2, [r0], #0x01 strb ip, [r1], #0x01 - ldrgtbt ip, [r0] - strgeb r2, [r1], #0x01 - strgtb ip, [r1] + ldrbtgt ip, [r0] + strbge r2, [r1], #0x01 + strbgt ip, [r1] RET /* @@ -331,7 +332,7 @@ ENTRY(copyin) bge .Lcopyin_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 @@ -392,7 +393,7 @@ ENTRY(copyin) bge .Lcopyin_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 @@ -453,7 +454,7 @@ ENTRY(copyin) bge .Lcopyin_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 @@ -546,8 +547,8 @@ ENTRY(copyout) ldr r0, =EFAULT str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ + ldmfdgt sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ + ldmfdlt sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ ldmfd sp!, {r10-r11, pc} .Lcopyout_guts: @@ -582,7 +583,7 @@ ENTRY(copyout) tst r0, #0x07 /* Already quad aligned? */ ldrne ip, [r0], #0x04 subne r2, r2, #0x04 - strnet ip, [r1], #0x04 + strtne ip, [r1], #0x04 stmfd sp!, {r4-r9} /* Free up some registers */ mov r3, #-1 /* Signal restore r4-r9 */ @@ -650,7 +651,7 @@ ENTRY(copyout) .Lcopyout_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ subs r2, r2, #0x20 blt .Lcopyout_w_lessthan32 @@ -675,7 +676,7 @@ ENTRY(copyout) .Lcopyout_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ and r4, r2, #0x18 @@ -710,16 +711,16 @@ ENTRY(copyout) .Lcopyout_w_less_than8: subs r2, r2, #0x04 ldrge ip, [r0], #0x04 - strget ip, [r1], #0x04 + strtge ip, [r1], #0x04 RETeq /* Return now if done */ addlt r2, r2, #0x04 ldrb ip, [r0], #0x01 cmp r2, #0x02 - ldrgeb r2, [r0], #0x01 + ldrbge r2, [r0], #0x01 strbt ip, [r1], #0x01 - ldrgtb ip, [r0] - strgebt r2, [r1], #0x01 - strgtbt ip, [r1] + ldrbgt ip, [r0] + strbtge r2, [r1], #0x01 + strbtgt ip, [r1] RET /* @@ -774,7 +775,7 @@ ENTRY(copyout) bge .Lcopyout_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 @@ -835,7 +836,7 @@ ENTRY(copyout) bge .Lcopyout_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 @@ -896,7 +897,7 @@ ENTRY(copyout) bge .Lcopyout_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 Modified: stable/10/sys/arm/arm/blockio.S ============================================================================== --- stable/10/sys/arm/arm/blockio.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/blockio.S Sun Dec 14 16:28:53 2014 (r275767) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); + .syntax unified + /* * Read bytes from an I/O address into a block of memory * @@ -71,10 +73,10 @@ ENTRY(read_multi_1) cmp r12, #2 ldrb r3, [r0] strb r3, [r1], #1 - ldrgeb r3, [r0] - strgeb r3, [r1], #1 - ldrgtb r3, [r0] - strgtb r3, [r1], #1 + ldrbge r3, [r0] + strbge r3, [r1], #1 + ldrbgt r3, [r0] + strbgt r3, [r1], #1 subs r2, r2, r12 blt .Lrm1_l4 .Lrm1_main: @@ -91,15 +93,15 @@ ENTRY(read_multi_1) bge .Lrm1loop .Lrm1_l4: adds r2, r2, #4 /* r2 = length again */ - ldmeqdb fp, {fp, sp, pc} + ldmdbeq fp, {fp, sp, pc} RETeq cmp r2, #2 ldrb r3, [r0] strb r3, [r1], #1 - ldrgeb r3, [r0] - strgeb r3, [r1], #1 - ldrgtb r3, [r0] - strgtb r3, [r1], #1 + ldrbge r3, [r0] + strbge r3, [r1], #1 + ldrbgt r3, [r0] + strbgt r3, [r1], #1 ldmdb fp, {fp, sp, pc} END(read_multi_1) @@ -124,10 +126,10 @@ ENTRY(write_multi_1) cmp r12, #2 ldrb r3, [r1], #1 strb r3, [r0] - ldrgeb r3, [r1], #1 - strgeb r3, [r0] - ldrgtb r3, [r1], #1 - strgtb r3, [r0] + ldrbge r3, [r1], #1 + strbge r3, [r0] + ldrbgt r3, [r1], #1 + strbgt r3, [r0] subs r2, r2, r12 blt .Lwm1_l4 .Lwm1_main: @@ -144,14 +146,14 @@ ENTRY(write_multi_1) bge .Lwm1loop .Lwm1_l4: adds r2, r2, #4 /* r2 = length again */ - ldmeqdb fp, {fp, sp, pc} + ldmdbeq fp, {fp, sp, pc} cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0] - ldrgeb r3, [r1], #1 - strgeb r3, [r0] - ldrgtb r3, [r1], #1 - strgtb r3, [r0] + ldrbge r3, [r1], #1 + strbge r3, [r0] + ldrbgt r3, [r1], #1 + strbgt r3, [r0] ldmdb fp, {fp, sp, pc} END(write_multi_1) Modified: stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S Sun Dec 14 16:28:53 2014 (r275767) @@ -62,7 +62,7 @@ #include __FBSDID("$FreeBSD$"); - .cpu arm1136js + .cpu arm1176jz-s #if 0 #define Invalidate_I_cache(Rtmp1, Rtmp2) \ Modified: stable/10/sys/arm/arm/cpufunc_asm_armv5.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv5.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/cpufunc_asm_armv5.S Sun Dec 14 16:28:53 2014 (r275767) @@ -194,7 +194,6 @@ ENTRY(armv5_idcache_wbinv_range) END(armv5_idcache_wbinv_range) ENTRY_NP(armv5_idcache_wbinv_all) -armv5_idcache_wbinv_all: .Larmv5_idcache_wbinv_all: /* * We assume that the code here can never be out of sync with the Modified: stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Dec 14 16:28:53 2014 (r275767) @@ -143,7 +143,6 @@ __FBSDID("$FreeBSD$"); ENTRY_NP(xscalec3_cache_syncI) -xscalec3_cache_purgeID: EENTRY_NP(xscalec3_cache_purgeID) mcr p15, 0, r0, c7, c5, 0 /* flush I cache (D cleaned below) */ EENTRY_NP(xscalec3_cache_cleanID) Modified: stable/10/sys/arm/arm/fusu.S ============================================================================== --- stable/10/sys/arm/arm/fusu.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/fusu.S Sun Dec 14 16:28:53 2014 (r275767) @@ -38,6 +38,8 @@ #include "assym.s" __FBSDID("$FreeBSD$"); + .syntax unified + #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ @@ -83,7 +85,7 @@ EENTRY_NP(casuword32) ldrt r5, [r0] cmp r5, r1 movne r0, r5 - streqt r2, [r0] + strteq r2, [r0] #endif moveq r0, r1 2: @@ -129,7 +131,7 @@ EENTRY_NP(fuword32) str r1, [r2, #PCB_ONFAULT] mov r0, r3 RET -END(fuword32) +EEND(fuword32) END(fuword) /* @@ -269,7 +271,7 @@ _C_LABEL(fusubailout): fusupcbfaulttext: .asciz "Yikes - no valid PCB during fusuxxx() addr=%08x\n" - .align 0 + .align 2 #endif /* @@ -295,7 +297,7 @@ EENTRY_NP(suword32) mov r0, #0x00000000 str r0, [r2, #PCB_ONFAULT] RET -END(suword32) +EEND(suword32) END(suword) /* Modified: stable/10/sys/arm/arm/in_cksum_arm.S ============================================================================== --- stable/10/sys/arm/arm/in_cksum_arm.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/in_cksum_arm.S Sun Dec 14 16:28:53 2014 (r275767) @@ -46,6 +46,7 @@ #include "assym.s" __FBSDID("$FreeBSD$"); + .syntax unified /* * int in_cksum(struct mbuf *m, int len) * @@ -128,9 +129,9 @@ ASENTRY_NP(L_cksumdata) blt .Lcksumdata_endgame cmp r7, #0x02 ldrb r4, [r0], #0x01 /* Fetch 1st byte */ - ldrgeb r5, [r0], #0x01 /* Fetch 2nd byte */ + ldrbge r5, [r0], #0x01 /* Fetch 2nd byte */ movlt r5, #0x00 - ldrgtb r6, [r0], #0x01 /* Fetch 3rd byte */ + ldrbgt r6, [r0], #0x01 /* Fetch 3rd byte */ movle r6, #0x00 /* Combine the three bytes depending on endianness and alignment */ #ifdef __ARMEB__ @@ -196,7 +197,7 @@ ASENTRY_NP(L_cksumdata) adcs r2, r2, r5 adc r2, r2, #0x00 subs r1, r1, #0x40 - ldrged r4, [r0], #0x08 + ldrdge r4, [r0], #0x08 bge .Lcksumdata_bigloop adds r2, r2, r6 /* r6/r7 still need summing */ @@ -241,7 +242,7 @@ ASENTRY_NP(L_cksumdata) cmp r1, #0x20 #ifdef _ARM_ARCH_5E - ldrged r4, [r0], #0x08 /* Avoid stalling pld and result */ + ldrdge r4, [r0], #0x08 /* Avoid stalling pld and result */ blt .Lcksumdata_less_than_32 pld [r0, #0x18] ldrd r6, [r0], #0x08 @@ -319,9 +320,9 @@ ASENTRY_NP(L_cksumdata) .Lcksumdata_endgame: ldrb r3, [r0] /* Fetch first byte */ cmp r1, #0x02 - ldrgeb r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */ + ldrbge r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */ movlt r4, #0x00 - ldrgtb r5, [r0, #0x02] + ldrbgt r5, [r0, #0x02] movle r5, #0x00 /* Combine the three bytes depending on endianness and alignment */ tst r0, #0x01 Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/locore.S Sun Dec 14 16:28:53 2014 (r275767) @@ -474,8 +474,8 @@ ENTRY_NP(cpu_halt) * Hurl ourselves into the ROM */ mov r0, #(CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE) - mcr 15, 0, r0, c1, c0, 0 - mcrne 15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ + mcr p15, 0, r0, c1, c0, 0 + mcrne p15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ mov pc, r4 /* Modified: stable/10/sys/arm/arm/support.S ============================================================================== --- stable/10/sys/arm/arm/support.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/support.S Sun Dec 14 16:28:53 2014 (r275767) @@ -91,6 +91,8 @@ __FBSDID("$FreeBSD$"); #include "assym.s" + .syntax unified + .L_arm_memcpy: .word _C_LABEL(_arm_memcpy) .L_arm_bzero: @@ -130,7 +132,7 @@ ENTRY(bzero) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:40:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 158C8C8F; Sun, 14 Dec 2014 16:40:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F41E6135; Sun, 14 Dec 2014 16:40:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEGelI9072516; Sun, 14 Dec 2014 16:40:47 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEGelm0072509; Sun, 14 Dec 2014 16:40:47 GMT (envelope-from des@FreeBSD.org) Message-Id: <201412141640.sBEGelm0072509@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Sun, 14 Dec 2014 16:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275768 - in head/usr.sbin: . vigr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 16:40:48 -0000 Author: des Date: Sun Dec 14 16:40:46 2014 New Revision: 275768 URL: https://svnweb.freebsd.org/changeset/base/275768 Log: Add a vigr(8) utility which does for /etc/group what vipw(8) does for /etc/master.passwd. Added: head/usr.sbin/vigr/ head/usr.sbin/vigr/Makefile (contents, props changed) head/usr.sbin/vigr/vigr.8 (contents, props changed) head/usr.sbin/vigr/vigr.sh (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Dec 14 16:28:53 2014 (r275767) +++ head/usr.sbin/Makefile Sun Dec 14 16:40:46 2014 (r275768) @@ -94,6 +94,7 @@ SUBDIR= adduser \ trpt \ tzsetup \ ugidfw \ + vigr \ vipw \ wake \ watch \ Added: head/usr.sbin/vigr/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/vigr/Makefile Sun Dec 14 16:40:46 2014 (r275768) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SCRIPTS= vigr +MAN= vigr.8 + +.include Added: head/usr.sbin/vigr/vigr.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/vigr/vigr.8 Sun Dec 14 16:40:46 2014 (r275768) @@ -0,0 +1,71 @@ +.\"- +.\" Copyright (c) 2014 Dag-Erling Smørgrav +.\" 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 December 14, 2014 +.Dt VIGR 8 +.Os +.Sh NAME +.Nm vigr +.Nd edit the group file +.Sh SYNOPSIS +.Nm +.Op Fl d Ar directory +.Sh DESCRIPTION +The +.Nm +utility makes a temporary copy of the group file, allows the user to +edit it, then verifies that the edited file is valid before installing +it. +.Pp +The following options are available: +.Bl -tag -width Fl +.It Fl d Ar directory +Edit the group file in the specified directory instead of the default +.Pa /etc/group . +.El +.Sh ENVIRONMENT +.Bl -tag -width EDITOR +.It Ev EDITOR +The editor to use instead of +.Xr vi 1 . +.It Ev TMPDIR +The directory in which to store the temporary copy of the group file. +.El +.Sh SEE ALSO +.Xr group 5 , +.Xr chkgrp 8 , +.Xr vipw 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +utility and this manual page were written by +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . Added: head/usr.sbin/vigr/vigr.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/vigr/vigr.sh Sun Dec 14 16:40:46 2014 (r275768) @@ -0,0 +1,95 @@ +#!/bin/sh +#- +# Copyright (c) 2014 Dag-Erling Smørgrav +# 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$ +# + +error() { + echo "$@" >&2 + exit 1 +} + +usage() { + error "usage: vigr [-d dir]" +} + +# Check arguments +while getopts d: opt ; do + case $opt in + d) + etcdir="${OPTARG}" + ;; + *) + usage + ;; + esac +done + +# Look for the current group file +grpfile="${etcdir:-/etc}/group" +if [ ! -f "${grpfile}" ] ; then + error "Missing group file" +fi + +# Create a secure temporary working directory +tmpdir=$(mktemp -d -t vigr) +if [ -z "${tmpdir}" -o ! -d "${tmpdir}" ] ; then + error "Unable to create the temporary directory" +fi +tmpfile="${tmpdir}/group" + +# Clean up on exit +trap "exit 1" INT +trap "rm -rf '${tmpdir}'" EXIT +set -e + +# Make a copy of the group file for the user to edit +cp "${grpfile}" "${tmpfile}" + +while :; do + # Let the user edit the file + ${EDITOR:-/usr/bin/vi} "${tmpfile}" + + # If the result is valid, install it and exit + if chkgrp -q "${tmpfile}" ; then + install -b -m 0644 -C -S "${tmpfile}" "${grpfile}" + exit 0 + fi + + # If it is not, offer to re-edit + while :; do + echo -n "Re-edit the group file? " + read ans + case $ans in + [Yy]|[Yy][Ee][Ss]) + break + ;; + [Nn]|[Nn][Oo]) + exit 1 + ;; + esac + done +done From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 17:28:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5555040D; Sun, 14 Dec 2014 17:28:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 403E77F7; Sun, 14 Dec 2014 17:28:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEHS3OH095784; Sun, 14 Dec 2014 17:28:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEHS34C095783; Sun, 14 Dec 2014 17:28:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141728.sBEHS34C095783@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 17:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275769 - stable/10/contrib/binutils/bfd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 17:28:03 -0000 Author: andrew Date: Sun Dec 14 17:28:02 2014 New Revision: 275769 URL: https://svnweb.freebsd.org/changeset/base/275769 Log: MFC 275336: Use llabs when getting the absolute value of a long long. Sponsored by: ABT Ststems Ltd Modified: stable/10/contrib/binutils/bfd/elf32-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- stable/10/contrib/binutils/bfd/elf32-arm.c Sun Dec 14 16:40:46 2014 (r275768) +++ stable/10/contrib/binutils/bfd/elf32-arm.c Sun Dec 14 17:28:02 2014 (r275769) @@ -4960,7 +4960,7 @@ elf32_arm_final_link_relocate (reloc_how + input_section->output_offset + rel->r_offset); - value = abs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; @@ -4998,7 +4998,7 @@ elf32_arm_final_link_relocate (reloc_how + input_section->output_offset + rel->r_offset); - value = abs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; @@ -5984,7 +5984,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_n, in encoded constant-with-rotation format. */ - g_n = calculate_group_reloc_mask (abs (signed_value), group, + g_n = calculate_group_reloc_mask (llabs (signed_value), group, &residual); /* Check for overflow if required. */ @@ -5998,7 +5998,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6077,7 +6077,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. */ if (residual >= 0x1000) @@ -6085,7 +6085,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6160,7 +6160,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. */ if (residual >= 0x100) @@ -6168,7 +6168,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6243,7 +6243,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. (The absolute value to go in the place must be divisible by four and, after having been divided by four, must @@ -6253,7 +6253,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 17:38:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7173567A; Sun, 14 Dec 2014 17:38:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 443748D6; Sun, 14 Dec 2014 17:38:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEHciJQ000926; Sun, 14 Dec 2014 17:38:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEHciRH000923; Sun, 14 Dec 2014 17:38:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141738.sBEHciRH000923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 17:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275770 - stable/10/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 17:38:44 -0000 Author: andrew Date: Sun Dec 14 17:38:43 2014 New Revision: 275770 URL: https://svnweb.freebsd.org/changeset/base/275770 Log: MFC 275415: Allow the UAL APSR_nzcv format for the mrc and mrc2 instructions. The clang integrated assembler only allows these forms so binutils will need to support them. Sponsored by: ABT Systems Ltd MFC 275584: Fix mrc and mrc2 with APSR_nzcv. Binutils encodes it internally as 0 where we need it to be set to 15 for it to be equivalent to r15. Sponsored by: ABT Systems Ltd Modified: stable/10/contrib/binutils/gas/config/tc-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-arm.c Sun Dec 14 17:28:02 2014 (r275769) +++ stable/10/contrib/binutils/gas/config/tc-arm.c Sun Dec 14 17:38:43 2014 (r275770) @@ -6771,7 +6771,11 @@ do_co_reg (void) { inst.instruction |= inst.operands[0].reg << 8; inst.instruction |= inst.operands[1].imm << 21; - inst.instruction |= inst.operands[2].reg << 12; + /* If this is a vector we are using the APSR_nzcv syntax, encode as r15 */ + if (inst.operands[2].isvec != 0) + inst.instruction |= 15 << 12; + else + inst.instruction |= inst.operands[2].reg << 12; inst.instruction |= inst.operands[3].reg << 16; inst.instruction |= inst.operands[4].reg; inst.instruction |= inst.operands[5].imm << 5; @@ -15029,7 +15033,7 @@ static const struct asm_opcode insns[] = TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TCE(mcr, e000010, ee000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), - TCE(mrc, e100010, ee100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TCE(mrc, e100010, ee100010, 6, (RCP, I7b, APSR_RR, RCN, RCN, oI7b), co_reg, co_reg), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v2s /* ARM 3 - swp instructions. */ @@ -15088,7 +15092,7 @@ static const struct asm_opcode insns[] = TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TUF(cdp2, e000000, fe000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), TUF(mcr2, e000010, fe000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), - TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, APSR_RR, RCN, RCN, oI7b), co_reg, co_reg), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v5exp /* ARM Architecture 5TExP. */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 18:01:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45CA1E7A; Sun, 14 Dec 2014 18:01:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 17DCFB4F; Sun, 14 Dec 2014 18:01:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEI1Ake013679; Sun, 14 Dec 2014 18:01:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEI1AWk013677; Sun, 14 Dec 2014 18:01:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141801.sBEI1AWk013677@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 18:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275771 - stable/10/contrib/gcc/config/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:01:11 -0000 Author: andrew Date: Sun Dec 14 18:01:09 2014 New Revision: 275771 URL: https://svnweb.freebsd.org/changeset/base/275771 Log: MFC 275337: There is no need to use FUNC_END with aeabi_ldiv0 or aeabi_idiv0 as they are aliases. Sponsored by: ABT Systems Ltd MFC 275380: Use the floating-point instruction on ARMv7 as the clang 3.5 integrated assembler doesn't allow these two instructions to use co-processor 11. Sponsored by: ABT Systems Ltd Modified: stable/10/contrib/gcc/config/arm/lib1funcs.asm stable/10/contrib/gcc/config/arm/libunwind.S Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/config/arm/lib1funcs.asm ============================================================================== --- stable/10/contrib/gcc/config/arm/lib1funcs.asm Sun Dec 14 17:38:43 2014 (r275770) +++ stable/10/contrib/gcc/config/arm/lib1funcs.asm Sun Dec 14 18:01:09 2014 (r275771) @@ -980,8 +980,6 @@ LSYM(Lover12): RET - FUNC_END aeabi_ldiv0 - FUNC_END aeabi_idiv0 FUNC_END div0 #endif /* L_divmodsi_tools */ Modified: stable/10/contrib/gcc/config/arm/libunwind.S ============================================================================== --- stable/10/contrib/gcc/config/arm/libunwind.S Sun Dec 14 17:38:43 2014 (r275770) +++ stable/10/contrib/gcc/config/arm/libunwind.S Sun Dec 14 18:01:09 2014 (r275771) @@ -26,6 +26,13 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + +/* Allow the use of VFP instructions */ +#if __ARM_ARCH >= 7 +.fpu vfp +#endif + #ifndef __symbian__ #include "lib1funcs.asm" @@ -66,14 +73,22 @@ ARM_FUNC_START restore_core_regs ARM_FUNC_START gnu_Unwind_Restore_VFP /* Use the generic coprocessor form so that gas doesn't complain on soft-float targets. */ +#if __ARM_ARCH >= 7 + fldmiax r0, {d0-d15} +#else ldc p11,cr0,[r0],{0x21} /* fldmiax r0, {d0-d15} */ +#endif RET /* Store VFR regsters d0-d15 to the address in r0. */ ARM_FUNC_START gnu_Unwind_Save_VFP /* Use the generic coprocessor form so that gas doesn't complain on soft-float targets. */ +#if __ARM_ARCH >= 7 + fstmiax r0, {d0-d15} +#else stc p11,cr0,[r0],{0x21} /* fstmiax r0, {d0-d15} */ +#endif RET /* Wrappers to save core registers, then call the real routine. */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 18:16:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D012E5AE; Sun, 14 Dec 2014 18:16:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B0A36C99; Sun, 14 Dec 2014 18:16:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEIGoX1021021; Sun, 14 Dec 2014 18:16:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEIGoAQ021020; Sun, 14 Dec 2014 18:16:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412141816.sBEIGoAQ021020@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 14 Dec 2014 18:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275772 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:16:50 -0000 Author: dim Date: Sun Dec 14 18:16:49 2014 New Revision: 275772 URL: https://svnweb.freebsd.org/changeset/base/275772 Log: Update clang patch for r275759 to use correct test cases. Modified: head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff Modified: head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff ============================================================================== --- head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff Sun Dec 14 18:01:09 2014 (r275771) +++ head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff Sun Dec 14 18:16:49 2014 (r275772) @@ -3,6 +3,18 @@ Pull in r221170 from upstream clang trun Implement vaarg lowering for ppc32. Lowering of scalars and aggregates is supported. Complex numbers are not. +Pull in r221174 from upstream clang trunk (by Roman Divacky): + + Require asserts to unbreak the buildbots. + +Pull in r221284 from upstream clang trunk (by Roman Divacky): + + Rewrite the test to not require asserts. + +Pull in r221285 from upstream clang trunk (by Roman Divacky): + + Since the file has both ppc and ppc64 tests in it rename it. + This adds va_args support for PowerPC (32 bit) to clang. Introduced here: http://svnweb.freebsd.org/changeset/base/275759 @@ -136,106 +148,151 @@ Index: tools/clang/test/CodeGen/ppc64-va =================================================================== --- tools/clang/test/CodeGen/ppc64-varargs-struct.c +++ tools/clang/test/CodeGen/ppc64-varargs-struct.c -@@ -1,5 +1,6 @@ - // REQUIRES: ppc64-registered-target - // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s +@@ -1,30 +0,0 @@ +-// REQUIRES: ppc64-registered-target +-// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s +- +-#include +- +-struct x { +- long a; +- double b; +-}; +- +-void testva (int n, ...) +-{ +- va_list ap; +- +- struct x t = va_arg (ap, struct x); +-// CHECK: bitcast i8* %{{[a-z.0-9]*}} to %struct.x* +-// CHECK: bitcast %struct.x* %t to i8* +-// CHECK: bitcast %struct.x* %{{[0-9]+}} to i8* +-// CHECK: call void @llvm.memcpy +- +- int v = va_arg (ap, int); +-// CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64 +-// CHECK: add i64 %{{[0-9]+}}, 4 +-// CHECK: inttoptr i64 %{{[0-9]+}} to i8* +-// CHECK: bitcast i8* %{{[0-9]+}} to i32* +- +- __int128_t u = va_arg (ap, __int128_t); +-// CHECK: bitcast i8* %{{[a-z.0-9]+}} to i128* +-// CHECK-NEXT: load i128* %{{[0-9]+}} +-} +Index: tools/clang/test/CodeGen/ppc-varargs-struct.c +=================================================================== +--- tools/clang/test/CodeGen/ppc-varargs-struct.c ++++ tools/clang/test/CodeGen/ppc-varargs-struct.c +@@ -0,0 +1,112 @@ ++// REQUIRES: ppc64-registered-target ++// REQUIRES: asserts ++// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PPC - - #include - -@@ -17,6 +18,46 @@ void testva (int n, ...) - // CHECK: bitcast %struct.x* %t to i8* - // CHECK: bitcast %struct.x* %{{[0-9]+}} to i8* - // CHECK: call void @llvm.memcpy -+// CHECK-PPC: %arraydecay = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0 -+// CHECK-PPC-NEXT: %gprptr = bitcast %struct.__va_list_tag* %arraydecay to i8* -+// CHECK-PPC-NEXT: %0 = ptrtoint i8* %gprptr to i32 -+// CHECK-PPC-NEXT: %1 = add i32 %0, 1 -+// CHECK-PPC-NEXT: %2 = inttoptr i32 %1 to i8* -+// CHECK-PPC-NEXT: %3 = add i32 %1, 3 -+// CHECK-PPC-NEXT: %4 = inttoptr i32 %3 to i8** -+// CHECK-PPC-NEXT: %5 = add i32 %3, 4 -+// CHECK-PPC-NEXT: %6 = inttoptr i32 %5 to i8** -+// CHECK-PPC-NEXT: %gpr = load i8* %gprptr -+// CHECK-PPC-NEXT: %fpr = load i8* %2 -+// CHECK-PPC-NEXT: %overflow_area = load i8** %4 -+// CHECK-PPC-NEXT: %7 = ptrtoint i8* %overflow_area to i32 -+// CHECK-PPC-NEXT: %regsave_area = load i8** %6 -+// CHECK-PPC-NEXT: %8 = ptrtoint i8* %regsave_area to i32 -+// CHECK-PPC-NEXT: %cond = icmp ult i8 %gpr, 8 -+// CHECK-PPC-NEXT: %9 = mul i8 %gpr, 4 -+// CHECK-PPC-NEXT: %10 = sext i8 %9 to i32 -+// CHECK-PPC-NEXT: %11 = add i32 %8, %10 -+// CHECK-PPC-NEXT: br i1 %cond, label %using_regs, label %using_overflow -+// -+// CHECK-PPC-LABEL:using_regs: ; preds = %entry -+// CHECK-PPC-NEXT: %12 = inttoptr i32 %11 to %struct.x* -+// CHECK-PPC-NEXT: %13 = add i8 %gpr, 1 -+// CHECK-PPC-NEXT: store i8 %13, i8* %gprptr -+// CHECK-PPC-NEXT: br label %cont -+// -+// CHECK-PPC-LABEL:using_overflow: ; preds = %entry -+// CHECK-PPC-NEXT: %14 = inttoptr i32 %7 to %struct.x* -+// CHECK-PPC-NEXT: %15 = add i32 %7, 4 -+// CHECK-PPC-NEXT: %16 = inttoptr i32 %15 to i8* -+// CHECK-PPC-NEXT: store i8* %16, i8** %4 -+// CHECK-PPC-NEXT: br label %cont -+// -+// CHECK-PPC-LABEL:cont: ; preds = %using_overflow, %using_regs -+// CHECK-PPC-NEXT: %vaarg.addr = phi %struct.x* [ %12, %using_regs ], [ %14, %using_overflow ] -+// CHECK-PPC-NEXT: %aggrptr = bitcast %struct.x* %vaarg.addr to i8** -+// CHECK-PPC-NEXT: %aggr = load i8** %aggrptr -+// CHECK-PPC-NEXT: %17 = bitcast %struct.x* %t to i8* -+// CHECK-PPC-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %17, i8* %aggr, i32 16, i32 8, i1 false) - - int v = va_arg (ap, int); - // CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64 -@@ -23,8 +64,48 @@ void testva (int n, ...) - // CHECK: add i64 %{{[0-9]+}}, 4 - // CHECK: inttoptr i64 %{{[0-9]+}} to i8* - // CHECK: bitcast i8* %{{[0-9]+}} to i32* -+// CHECK-PPC: %arraydecay1 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0 -+// CHECK-PPC-NEXT: %gprptr2 = bitcast %struct.__va_list_tag* %arraydecay1 to i8* -+// CHECK-PPC-NEXT: %18 = ptrtoint i8* %gprptr2 to i32 -+// CHECK-PPC-NEXT: %19 = add i32 %18, 1 -+// CHECK-PPC-NEXT: %20 = inttoptr i32 %19 to i8* -+// CHECK-PPC-NEXT: %21 = add i32 %19, 3 -+// CHECK-PPC-NEXT: %22 = inttoptr i32 %21 to i8** -+// CHECK-PPC-NEXT: %23 = add i32 %21, 4 -+// CHECK-PPC-NEXT: %24 = inttoptr i32 %23 to i8** -+// CHECK-PPC-NEXT: %gpr3 = load i8* %gprptr2 -+// CHECK-PPC-NEXT: %fpr4 = load i8* %20 -+// CHECK-PPC-NEXT: %overflow_area5 = load i8** %22 -+// CHECK-PPC-NEXT: %25 = ptrtoint i8* %overflow_area5 to i32 -+// CHECK-PPC-NEXT: %regsave_area6 = load i8** %24 -+// CHECK-PPC-NEXT: %26 = ptrtoint i8* %regsave_area6 to i32 -+// CHECK-PPC-NEXT: %cond7 = icmp ult i8 %gpr3, 8 -+// CHECK-PPC-NEXT: %27 = mul i8 %gpr3, 4 -+// CHECK-PPC-NEXT: %28 = sext i8 %27 to i32 -+// CHECK-PPC-NEXT: %29 = add i32 %26, %28 -+// CHECK-PPC-NEXT: br i1 %cond7, label %using_regs8, label %using_overflow9 -+// -+// CHECK-PPC-LABEL:using_regs8: ; preds = %cont -+// CHECK-PPC-NEXT: %30 = inttoptr i32 %29 to i32* -+// CHECK-PPC-NEXT: %31 = add i8 %gpr3, 1 -+// CHECK-PPC-NEXT: store i8 %31, i8* %gprptr2 -+// CHECK-PPC-NEXT: br label %cont10 -+// -+// CHECK-PPC-LABEL:using_overflow9: ; preds = %cont -+// CHECK-PPC-NEXT: %32 = inttoptr i32 %25 to i32* -+// CHECK-PPC-NEXT: %33 = add i32 %25, 4 -+// CHECK-PPC-NEXT: %34 = inttoptr i32 %33 to i8* -+// CHECK-PPC-NEXT: store i8* %34, i8** %22 -+// CHECK-PPC-NEXT: br label %cont10 -+// -+// CHECK-PPC-LABEL:cont10: ; preds = %using_overflow9, %using_regs8 -+// CHECK-PPC-NEXT: %vaarg.addr11 = phi i32* [ %30, %using_regs8 ], [ %32, %using_overflow9 ] -+// CHECK-PPC-NEXT: %35 = load i32* %vaarg.addr11 -+// CHECK-PPC-NEXT: store i32 %35, i32* %v, align 4 - ++ ++#include ++ ++struct x { ++ long a; ++ double b; ++}; ++ ++void testva (int n, ...) ++{ ++ va_list ap; ++ ++ struct x t = va_arg (ap, struct x); ++// CHECK: bitcast i8* %{{[a-z.0-9]*}} to %struct.x* ++// CHECK: bitcast %struct.x* %t to i8* ++// CHECK: bitcast %struct.x* %{{[0-9]+}} to i8* ++// CHECK: call void @llvm.memcpy ++// CHECK-PPC: [[ARRAYDECAY:%[a-z0-9]+]] = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0 ++// CHECK-PPC-NEXT: [[GPRPTR:%[a-z0-9]+]] = bitcast %struct.__va_list_tag* [[ARRAYDECAY]] to i8* ++// CHECK-PPC-NEXT: [[ZERO:%[0-9]+]] = ptrtoint i8* [[GPRPTR]] to i32 ++// CHECK-PPC-NEXT: [[ONE:%[0-9]+]] = add i32 [[ZERO]], 1 ++// CHECK-PPC-NEXT: [[TWO:%[0-9]+]] = inttoptr i32 [[ONE]] to i8* ++// CHECK-PPC-NEXT: [[THREE:%[0-9]+]] = add i32 [[ONE]], 3 ++// CHECK-PPC-NEXT: [[FOUR:%[0-9]+]] = inttoptr i32 [[THREE]] to i8** ++// CHECK-PPC-NEXT: [[FIVE:%[0-9]+]] = add i32 [[THREE]], 4 ++// CHECK-PPC-NEXT: [[SIX:%[0-9]+]] = inttoptr i32 [[FIVE]] to i8** ++// CHECK-PPC-NEXT: [[GPR:%[a-z0-9]+]] = load i8* [[GPRPTR]] ++// CHECK-PPC-NEXT: [[FPR:%[a-z0-9]+]] = load i8* [[TWO]] ++// CHECK-PPC-NEXT: [[OVERFLOW_AREA:%[a-z_0-9]+]] = load i8** [[FOUR]] ++// CHECK-PPC-NEXT: [[SEVEN:%[0-9]+]] = ptrtoint i8* [[OVERFLOW_AREA]] to i32 ++// CHECK-PPC-NEXT: [[REGSAVE_AREA:%[a-z_0-9]+]] = load i8** [[SIX]] ++// CHECK-PPC-NEXT: [[EIGHT:%[0-9]+]] = ptrtoint i8* [[REGSAVE_AREA]] to i32 ++// CHECK-PPC-NEXT: [[COND:%[a-z0-9]+]] = icmp ult i8 [[GPR]], 8 ++// CHECK-PPC-NEXT: [[NINE:%[0-9]+]] = mul i8 [[GPR]], 4 ++// CHECK-PPC-NEXT: [[TEN:%[0-9]+]] = sext i8 [[NINE]] to i32 ++// CHECK-PPC-NEXT: [[ELEVEN:%[0-9]+]] = add i32 [[EIGHT]], [[TEN]] ++// CHECK-PPC-NEXT: br i1 [[COND]], label [[USING_REGS:%[a-z_0-9]+]], label [[USING_OVERFLOW:%[a-z_0-9]+]] ++// ++// CHECK-PPC1:[[USING_REGS]] ++// CHECK-PPC: [[TWELVE:%[0-9]+]] = inttoptr i32 [[ELEVEN]] to %struct.x* ++// CHECK-PPC-NEXT: [[THIRTEEN:%[0-9]+]] = add i8 [[GPR]], 1 ++// CHECK-PPC-NEXT: store i8 [[THIRTEEN]], i8* [[GPRPTR]] ++// CHECK-PPC-NEXT: br label [[CONT:%[a-z0-9]+]] ++// ++// CHECK-PPC1:[[USING_OVERFLOW]] ++// CHECK-PPC: [[FOURTEEN:%[0-9]+]] = inttoptr i32 [[SEVEN]] to %struct.x* ++// CHECK-PPC-NEXT: [[FIFTEEN:%[0-9]+]] = add i32 [[SEVEN]], 4 ++// CHECK-PPC-NEXT: [[SIXTEEN:%[0-9]+]] = inttoptr i32 [[FIFTEEN]] to i8* ++// CHECK-PPC-NEXT: store i8* [[SIXTEEN]], i8** [[FOUR]] ++// CHECK-PPC-NEXT: br label [[CONT]] ++// ++// CHECK-PPC1:[[CONT]] ++// CHECK-PPC: [[VAARG_ADDR:%[a-z.0-9]+]] = phi %struct.x* [ [[TWELVE]], [[USING_REGS]] ], [ [[FOURTEEN]], [[USING_OVERFLOW]] ] ++// CHECK-PPC-NEXT: [[AGGRPTR:%[a-z0-9]+]] = bitcast %struct.x* [[VAARG_ADDR]] to i8** ++// CHECK-PPC-NEXT: [[AGGR:%[a-z0-9]+]] = load i8** [[AGGRPTR]] ++// CHECK-PPC-NEXT: [[SEVENTEEN:%[0-9]+]] = bitcast %struct.x* %t to i8* ++// CHECK-PPC-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[SEVENTEEN]], i8* [[AGGR]], i32 16, i32 8, i1 false) ++ ++ int v = va_arg (ap, int); ++// CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64 ++// CHECK: add i64 %{{[0-9]+}}, 4 ++// CHECK: inttoptr i64 %{{[0-9]+}} to i8* ++// CHECK: bitcast i8* %{{[0-9]+}} to i32* ++// CHECK-PPC: [[ARRAYDECAY1:%[a-z0-9]+]] = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0 ++// CHECK-PPC-NEXT: [[GPRPTR1:%[a-z0-9]+]] = bitcast %struct.__va_list_tag* [[ARRAYDECAY1]] to i8* ++// CHECK-PPC-NEXT: [[EIGHTEEN:%[0-9]+]] = ptrtoint i8* [[GPRPTR1]] to i32 ++// CHECK-PPC-NEXT: [[NINETEEN:%[0-9]+]] = add i32 [[EIGHTEEN]], 1 ++// CHECK-PPC-NEXT: [[TWENTY:%[0-9]+]] = inttoptr i32 [[NINETEEN]] to i8* ++// CHECK-PPC-NEXT: [[TWENTYONE:%[0-9]+]] = add i32 [[NINETEEN]], 3 ++// CHECK-PPC-NEXT: [[TWENTYTWO:%[0-9]+]] = inttoptr i32 [[TWENTYONE]] to i8** ++// CHECK-PPC-NEXT: [[TWENTYTHREE:%[0-9]+]] = add i32 [[TWENTYONE]], 4 ++// CHECK-PPC-NEXT: [[TWENTYFOUR:%[0-9]+]] = inttoptr i32 [[TWENTYTHREE]] to i8** ++// CHECK-PPC-NEXT: [[GPR1:%[a-z0-9]+]] = load i8* [[GPRPTR1]] ++// CHECK-PPC-NEXT: [[FPR1:%[a-z0-9]+]] = load i8* [[TWENTY]] ++// CHECK-PPC-NEXT: [[OVERFLOW_AREA1:%[a-z_0-9]+]] = load i8** [[TWENTYTWO]] ++// CHECK-PPC-NEXT: [[TWENTYFIVE:%[0-9]+]] = ptrtoint i8* [[OVERFLOW_AREA1]] to i32 ++// CHECK-PPC-NEXT: [[REGSAVE_AREA1:%[a-z_0-9]+]] = load i8** [[TWENTYFOUR]] ++// CHECK-PPC-NEXT: [[TWENTYSIX:%[0-9]+]] = ptrtoint i8* [[REGSAVE_AREA1]] to i32 ++// CHECK-PPC-NEXT: [[COND1:%[a-z0-9]+]] = icmp ult i8 [[GPR1]], 8 ++// CHECK-PPC-NEXT: [[TWENTYSEVEN:%[0-9]+]] = mul i8 [[GPR1]], 4 ++// CHECK-PPC-NEXT: [[TWENTYEIGHT:%[0-9]+]] = sext i8 [[TWENTYSEVEN]] to i32 ++// CHECK-PPC-NEXT: [[TWENTYNINE:%[0-9]+]] = add i32 [[TWENTYSIX]], [[TWENTYEIGHT]] ++// CHECK-PPC-NEXT: br i1 [[COND1]], label [[USING_REGS1:%[a-z_0-9]+]], label [[USING_OVERFLOW1:%[a-z_0-9]+]] ++// ++// CHECK-PPC1:[[USING_REGS1]]: ++// CHECK-PPC: [[THIRTY:%[0-9]+]] = inttoptr i32 [[TWENTYNINE]] to i32* ++// CHECK-PPC-NEXT: [[THIRTYONE:%[0-9]+]] = add i8 [[GPR1]], 1 ++// CHECK-PPC-NEXT: store i8 [[THIRTYONE]], i8* [[GPRPTR1]] ++// CHECK-PPC-NEXT: br label [[CONT1:%[a-z0-9]+]] ++// ++// CHECK-PPC1:[[USING_OVERFLOW1]]: ++// CHECK-PPC: [[THIRTYTWO:%[0-9]+]] = inttoptr i32 [[TWENTYFIVE]] to i32* ++// CHECK-PPC-NEXT: [[THIRTYTHREE:%[0-9]+]] = add i32 [[TWENTYFIVE]], 4 ++// CHECK-PPC-NEXT: [[THIRTYFOUR:%[0-9]+]] = inttoptr i32 [[THIRTYTHREE]] to i8* ++// CHECK-PPC-NEXT: store i8* [[THIRTYFOUR]], i8** [[TWENTYTWO]] ++// CHECK-PPC-NEXT: br label [[CONT1]] ++// ++// CHECK-PPC1:[[CONT1]]: ++// CHECK-PPC: [[VAARG_ADDR1:%[a-z.0-9]+]] = phi i32* [ [[THIRTY]], [[USING_REGS1]] ], [ [[THIRTYTWO]], [[USING_OVERFLOW1]] ] ++// CHECK-PPC-NEXT: [[THIRTYFIVE:%[0-9]+]] = load i32* [[VAARG_ADDR1]] ++// CHECK-PPC-NEXT: store i32 [[THIRTYFIVE]], i32* %v, align 4 ++ +#ifdef __powerpc64__ - __int128_t u = va_arg (ap, __int128_t); ++ __int128_t u = va_arg (ap, __int128_t); +#endif - // CHECK: bitcast i8* %{{[a-z.0-9]+}} to i128* - // CHECK-NEXT: load i128* %{{[0-9]+}} - } ++// CHECK: bitcast i8* %{{[a-z.0-9]+}} to i128* ++// CHECK-NEXT: load i128* %{{[0-9]+}} ++} From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 18:23:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FA60916; Sun, 14 Dec 2014 18:23:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5AF19D59; Sun, 14 Dec 2014 18:23:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEINVjH025539; Sun, 14 Dec 2014 18:23:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEINVne025538; Sun, 14 Dec 2014 18:23:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141823.sBEINVne025538@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 18:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275775 - stable/10/sys/arm/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:23:31 -0000 Author: andrew Date: Sun Dec 14 18:23:30 2014 New Revision: 275775 URL: https://svnweb.freebsd.org/changeset/base/275775 Log: MFC 275378: Pull in the NetBSD global offset table handling code. Clang 3.5 creates relocations the linker complains about. Obtained from: NetBSD Modified: stable/10/sys/arm/include/asm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/include/asm.h ============================================================================== --- stable/10/sys/arm/include/asm.h Sun Dec 14 18:21:03 2014 (r275774) +++ stable/10/sys/arm/include/asm.h Sun Dec 14 18:23:30 2014 (r275775) @@ -118,10 +118,16 @@ ldr x, [x, got] #define GOT_INIT(got,gotsym,pclabel) \ ldr got, gotsym; \ - add got, got, pc; \ - pclabel: + pclabel: add got, got, pc +#ifdef __thumb__ #define GOT_INITSYM(gotsym,pclabel) \ - gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (pclabel+4)) + .align 0; \ + gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+4) +#else +#define GOT_INITSYM(gotsym,pclabel) \ + .align 0; \ + gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+8) +#endif #ifdef __STDC__ #define PIC_SYM(x,y) x ## ( ## y ## ) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 18:28:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5538DA9E; Sun, 14 Dec 2014 18:28:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 40BBED7A; Sun, 14 Dec 2014 18:28:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEIS2E1026250; Sun, 14 Dec 2014 18:28:02 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEIS2Uo026249; Sun, 14 Dec 2014 18:28:02 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141828.sBEIS2Uo026249@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 18:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275776 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:28:02 -0000 Author: andrew Date: Sun Dec 14 18:28:01 2014 New Revision: 275776 URL: https://svnweb.freebsd.org/changeset/base/275776 Log: MFC 275564: Use the unified syntax when generating assembly for clang. The clang 3.5 integrated assembler only accepts it. Sponsored by: ABT Systems Ltd Modified: stable/10/sys/arm/arm/stdatomic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/stdatomic.c ============================================================================== --- stable/10/sys/arm/arm/stdatomic.c Sun Dec 14 18:23:30 2014 (r275775) +++ stable/10/sys/arm/arm/stdatomic.c Sun Dec 14 18:28:01 2014 (r275776) @@ -854,8 +854,13 @@ EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_sub, "sub") \ EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_xor, "eor") +#ifdef __clang__ +EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "strbeq") +EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "strheq") +#else EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "streqb") EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "streqh") +#endif EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str", "streq") #ifndef __clang__ From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 18:30:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF47DBF0; Sun, 14 Dec 2014 18:30:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C0986D8F; Sun, 14 Dec 2014 18:30:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEIUVBo026752; Sun, 14 Dec 2014 18:30:31 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEIUVuq026749; Sun, 14 Dec 2014 18:30:31 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201412141830.sBEIUVuq026749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 14 Dec 2014 18:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275777 - in stable/10/bin/sh: . tests/parameters X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:30:32 -0000 Author: jilles Date: Sun Dec 14 18:30:30 2014 New Revision: 275777 URL: https://svnweb.freebsd.org/changeset/base/275777 Log: MFC r268576: sh: Correctly handle positional parameters beyond INT_MAX on 64-bit systems. Currently, there can be no more than INT_MAX positional parameters. Make sure to treat all higher ones as unset to avoid incorrect results and crashes. On 64-bit systems, our atoi() takes the low 32 bits of the strtol() and sign-extends them. On 32-bit systems, the call to atoi() returned INT_MAX for too high values and there is not enough address space for so many positional parameters, so there was no issue. PR: 195918 Added: stable/10/bin/sh/tests/parameters/positional5.0 - copied unchanged from r268576, head/bin/sh/tests/parameters/positional5.0 Modified: stable/10/bin/sh/expand.c stable/10/bin/sh/tests/parameters/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Sun Dec 14 18:28:01 2014 (r275776) +++ stable/10/bin/sh/expand.c Sun Dec 14 18:30:30 2014 (r275777) @@ -846,9 +846,11 @@ varisset(const char *name, int nulok) } } else if (is_digit(*name)) { char *ap; - int num = atoi(name); + long num; - if (num > shellparam.nparam) + errno = 0; + num = strtol(name, NULL, 10); + if (errno != 0 || num > shellparam.nparam) return 0; if (num == 0) Modified: stable/10/bin/sh/tests/parameters/Makefile ============================================================================== --- stable/10/bin/sh/tests/parameters/Makefile Sun Dec 14 18:28:01 2014 (r275776) +++ stable/10/bin/sh/tests/parameters/Makefile Sun Dec 14 18:30:30 2014 (r275777) @@ -13,6 +13,7 @@ FILES+= optind1.0 FILES+= optind2.0 FILES+= positional1.0 FILES+= positional2.0 +FILES+= positional5.0 FILES+= pwd1.0 FILES+= pwd2.0 Copied: stable/10/bin/sh/tests/parameters/positional5.0 (from r268576, head/bin/sh/tests/parameters/positional5.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/sh/tests/parameters/positional5.0 Sun Dec 14 18:30:30 2014 (r275777, copy of r268576, head/bin/sh/tests/parameters/positional5.0) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +i=1 +r=0 +while [ $i -lt $((0x100000000)) ]; do + t= + eval t=\${$i-x} + case $t in + x) ;; + *) echo "Problem with \${$i}" >&2; r=1 ;; + esac + i=$((i + 0x10000000)) +done +exit $r From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 18:51:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 516FAF64; Sun, 14 Dec 2014 18:51:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3D4F6FD8; Sun, 14 Dec 2014 18:51:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEIpEU4038079; Sun, 14 Dec 2014 18:51:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEIpEkG038078; Sun, 14 Dec 2014 18:51:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141851.sBEIpEkG038078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 18:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275778 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:51:14 -0000 Author: andrew Date: Sun Dec 14 18:51:13 2014 New Revision: 275778 URL: https://svnweb.freebsd.org/changeset/base/275778 Log: MFC 275379: Set the correct architecture when targeting ARMv7 Sponsored by: ABT Systems Ltd Modified: stable/10/share/mk/bsd.cpu.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.cpu.mk ============================================================================== --- stable/10/share/mk/bsd.cpu.mk Sun Dec 14 18:30:30 2014 (r275777) +++ stable/10/share/mk/bsd.cpu.mk Sun Dec 14 18:51:13 2014 (r275778) @@ -101,7 +101,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ . elif ${CPUTYPE} == "armv6" _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" -_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp +_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp . else _CPUCFLAGS = -mcpu=${CPUTYPE} . endif From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 22:41:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADC65160; Sun, 14 Dec 2014 22:41:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8ED94B33; Sun, 14 Dec 2014 22:41:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEMf9VE051608; Sun, 14 Dec 2014 22:41:09 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEMf9fw051606; Sun, 14 Dec 2014 22:41:09 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412142241.sBEMf9fw051606@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sun, 14 Dec 2014 22:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275779 - in head/sys: conf dev/ofw powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 22:41:09 -0000 Author: rpaulo Date: Sun Dec 14 22:41:08 2014 New Revision: 275779 URL: https://svnweb.freebsd.org/changeset/base/275779 Log: Move ofw_cpu.c to sys/dev/ofw so that it can be used by other architectures. Differential Revision: https://reviews.freebsd.org/D1307 Reviewed by: jhibbits Added: head/sys/dev/ofw/ofw_cpu.c - copied unchanged from r275778, head/sys/powerpc/ofw/ofw_cpu.c Deleted: head/sys/powerpc/ofw/ofw_cpu.c Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Dec 14 18:51:13 2014 (r275778) +++ head/sys/conf/files.powerpc Sun Dec 14 22:41:08 2014 (r275779) @@ -44,6 +44,7 @@ dev/nand/nfc_fsl.c optional nand mpc85x dev/ofw/openfirm.c optional aim dev/ofw/openfirmio.c optional aim dev/ofw/ofw_bus_if.m optional aim +dev/ofw/ofw_cpu.c optional aim dev/ofw/ofw_if.m optional aim dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim @@ -135,7 +136,6 @@ powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/platform_mpc85xx.c optional mpc85xx powerpc/mpc85xx/pci_mpc85xx.c optional pci mpc85xx -powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c standard powerpc/ofw/ofw_pci.c optional pci powerpc/ofw/ofw_pcibus.c optional pci Copied: head/sys/dev/ofw/ofw_cpu.c (from r275778, head/sys/powerpc/ofw/ofw_cpu.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_cpu.c Sun Dec 14 22:41:08 2014 (r275779, copy of r275778, head/sys/powerpc/ofw/ofw_cpu.c) @@ -0,0 +1,214 @@ +/*- + * Copyright (C) 2009 Nathan Whitehorn + * 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 Benno Rice ``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 TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static int ofw_cpulist_probe(device_t); +static int ofw_cpulist_attach(device_t); +static const struct ofw_bus_devinfo *ofw_cpulist_get_devinfo(device_t dev, + device_t child); + +static MALLOC_DEFINE(M_OFWCPU, "ofwcpu", "OFW CPU device information"); + +static device_method_t ofw_cpulist_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_cpulist_probe), + DEVMETHOD(device_attach, ofw_cpulist_attach), + + /* Bus interface */ + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ofw_cpulist_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static driver_t ofw_cpulist_driver = { + "cpulist", + ofw_cpulist_methods, + 0 +}; + +static devclass_t ofw_cpulist_devclass; + +DRIVER_MODULE(ofw_cpulist, ofwbus, ofw_cpulist_driver, ofw_cpulist_devclass, + 0, 0); + +static int +ofw_cpulist_probe(device_t dev) +{ + const char *name; + + name = ofw_bus_get_name(dev); + + if (name == NULL || strcmp(name, "cpus") != 0) + return (ENXIO); + + device_set_desc(dev, "Open Firmware CPU Group"); + + return (0); +} + +static int +ofw_cpulist_attach(device_t dev) +{ + phandle_t root, child; + device_t cdev; + struct ofw_bus_devinfo *dinfo; + + root = ofw_bus_get_node(dev); + + for (child = OF_child(root); child != 0; child = OF_peer(child)) { + dinfo = malloc(sizeof(*dinfo), M_OFWCPU, M_WAITOK | M_ZERO); + + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_OFWCPU); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_OFWCPU); + continue; + } + device_set_ivars(cdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static const struct ofw_bus_devinfo * +ofw_cpulist_get_devinfo(device_t dev, device_t child) +{ + return (device_get_ivars(child)); +} + +static int ofw_cpu_probe(device_t); +static int ofw_cpu_attach(device_t); +static int ofw_cpu_read_ivar(device_t dev, device_t child, int index, + uintptr_t *result); + +struct ofw_cpu_softc { + struct pcpu *sc_cpu_pcpu; + uint32_t sc_nominal_mhz; +}; + +static device_method_t ofw_cpu_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_cpu_probe), + DEVMETHOD(device_attach, ofw_cpu_attach), + + /* Bus interface */ + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_read_ivar, ofw_cpu_read_ivar), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), + + DEVMETHOD_END +}; + +static driver_t ofw_cpu_driver = { + "cpu", + ofw_cpu_methods, + sizeof(struct ofw_cpu_softc) +}; + +static devclass_t ofw_cpu_devclass; + +DRIVER_MODULE(ofw_cpu, cpulist, ofw_cpu_driver, ofw_cpu_devclass, 0, 0); + +static int +ofw_cpu_probe(device_t dev) +{ + const char *type = ofw_bus_get_type(dev); + + if (strcmp(type, "cpu") != 0) + return (ENXIO); + + device_set_desc(dev, "Open Firmware CPU"); + return (0); +} + +static int +ofw_cpu_attach(device_t dev) +{ + struct ofw_cpu_softc *sc; + uint32_t cell; + + sc = device_get_softc(dev); + OF_getprop(ofw_bus_get_node(dev), "reg", &cell, sizeof(cell)); + sc->sc_cpu_pcpu = pcpu_find(cell); + OF_getprop(ofw_bus_get_node(dev), "clock-frequency", &cell, sizeof(cell)); + sc->sc_nominal_mhz = cell / 1000000; /* convert to MHz */ + + bus_generic_probe(dev); + return (bus_generic_attach(dev)); +} + +static int +ofw_cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) +{ + struct ofw_cpu_softc *sc; + + sc = device_get_softc(dev); + + switch (index) { + case CPU_IVAR_PCPU: + *result = (uintptr_t)sc->sc_cpu_pcpu; + return (0); + case CPU_IVAR_NOMINAL_MHZ: + *result = (uintptr_t)sc->sc_nominal_mhz; + return (0); + } + + return (ENOENT); +} + From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 02:28:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35A74BF6; Mon, 15 Dec 2014 02:28:10 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtpout001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 097FDF3; Mon, 15 Dec 2014 02:28:09 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTPSA id <0NGL00KUEQUORY00@st11p02mm-asmtp001.mac.com>; Mon, 15 Dec 2014 02:28:03 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2014-12-15_01:2014-12-13,2014-12-14,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1412150027 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r275779 - in head/sys: conf dev/ofw powerpc/ofw From: Rui Paulo In-reply-to: <201412142241.sBEMf9fw051606@svn.freebsd.org> Date: Sun, 14 Dec 2014 18:28:00 -0800 Content-transfer-encoding: 7bit Message-id: References: <201412142241.sBEMf9fw051606@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 02:28:10 -0000 On Dec 14, 2014, at 14:41, Rui Paulo wrote: > > Author: rpaulo > Date: Sun Dec 14 22:41:08 2014 > New Revision: 275779 > URL: https://svnweb.freebsd.org/changeset/base/275779 > > Log: > Move ofw_cpu.c to sys/dev/ofw so that it can be used by other > architectures. > > Differential Revision: https://reviews.freebsd.org/D1307 > Reviewed by: jhibbits Forgot to mention: Submitted by: Daisuke Aoyama -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 04:51:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79FBDA84; Mon, 15 Dec 2014 04:51:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5AEBAFDA; Mon, 15 Dec 2014 04:51:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF4pbec031834; Mon, 15 Dec 2014 04:51:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF4pbvC031833; Mon, 15 Dec 2014 04:51:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412150451.sBF4pbvC031833@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Dec 2014 04:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275780 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 04:51:37 -0000 Author: delphij Date: Mon Dec 15 04:51:36 2014 New Revision: 275780 URL: https://svnweb.freebsd.org/changeset/base/275780 Log: MFV r275549: Add a loader tunable, vfs.zfs.arc_meta_min, which controls how much metadata ZFS should keep in ARC at minimum. In arc_evict(), when doing recycle, take more factors into account by applying the following policy: 1. If no evictable data, evict metadata; 2. If no evictable metadata, evict data; 3. If we hit arc_meta_limit, evict metadata; 4. If we haven't hit arc_meta_min, evict data; 5* (Illumos only, not present in new FreeBSD code, yet) evict the oldest cached element from data and metadata. (FreeBSD) evict the data type specified by caller, which is the existing behavior. Note that because of our splitted locks (implemented in r205231 to improve scalability by reducing lock contention), implementing the fifth Illumos behavior will not be cheap, so for now just implement the 1-4 and fall back to current behavior for 5. Illumos issue: 5368 ARC should cache more metadata MFC after: 2 months (assuming we didn't found better solution) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Dec 14 22:41:08 2014 (r275779) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Dec 15 04:51:36 2014 (r275780) @@ -197,6 +197,7 @@ static boolean_t arc_warm; uint64_t zfs_arc_max; uint64_t zfs_arc_min; uint64_t zfs_arc_meta_limit = 0; +uint64_t zfs_arc_meta_min = 0; int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; @@ -218,6 +219,7 @@ SYSINIT(arc_free_target_init, SI_SUB_KTH arc_free_target_init, NULL); TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit); +TUNABLE_QUAD("vfs.zfs.arc_meta_min", &zfs_arc_meta_min); TUNABLE_INT("vfs.zfs.arc_shrink_shift", &zfs_arc_shrink_shift); SYSCTL_DECL(_vfs_zfs); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0, @@ -426,6 +428,7 @@ typedef struct arc_stats { kstat_named_t arcstat_meta_used; kstat_named_t arcstat_meta_limit; kstat_named_t arcstat_meta_max; + kstat_named_t arcstat_meta_min; } arc_stats_t; static arc_stats_t arc_stats = { @@ -506,7 +509,8 @@ static arc_stats_t arc_stats = { { "duplicate_reads", KSTAT_DATA_UINT64 }, { "arc_meta_used", KSTAT_DATA_UINT64 }, { "arc_meta_limit", KSTAT_DATA_UINT64 }, - { "arc_meta_max", KSTAT_DATA_UINT64 } + { "arc_meta_max", KSTAT_DATA_UINT64 }, + { "arc_meta_min", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -569,6 +573,7 @@ static arc_state_t *arc_l2c_only; #define arc_c_min ARCSTAT(arcstat_c_min) /* min target cache size */ #define arc_c_max ARCSTAT(arcstat_c_max) /* max target cache size */ #define arc_meta_limit ARCSTAT(arcstat_meta_limit) /* max size for metadata */ +#define arc_meta_min ARCSTAT(arcstat_meta_min) /* min size for metadata */ #define arc_meta_used ARCSTAT(arcstat_meta_used) /* size of metadata */ #define arc_meta_max ARCSTAT(arcstat_meta_max) /* max size of metadata */ @@ -2057,6 +2062,49 @@ arc_evict(arc_state_t *state, uint64_t s evicted_state = (state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; + /* + * Decide which "type" (data vs metadata) to recycle from. + * + * If we are over the metadata limit, recycle from metadata. + * If we are under the metadata minimum, recycle from data. + * Otherwise, recycle from whichever type has the oldest (least + * recently accessed) header. This is not yet implemented. + */ + if (recycle) { + arc_buf_contents_t realtype; + if (state->arcs_lsize[ARC_BUFC_DATA] == 0) { + realtype = ARC_BUFC_METADATA; + } else if (state->arcs_lsize[ARC_BUFC_METADATA] == 0) { + realtype = ARC_BUFC_DATA; + } else if (arc_meta_used >= arc_meta_limit) { + realtype = ARC_BUFC_METADATA; + } else if (arc_meta_used <= arc_meta_min) { + realtype = ARC_BUFC_DATA; + } else { +#ifdef illumos + if (data_hdr->b_arc_access < + metadata_hdr->b_arc_access) { + realtype = ARC_BUFC_DATA; + } else { + realtype = ARC_BUFC_METADATA; + } +#else + /* TODO */ + realtype = type; +#endif + } + if (realtype != type) { + /* + * If we want to evict from a different list, + * we can not recycle, because DATA vs METADATA + * buffers are segregated into different kmem + * caches (and vmem arenas). + */ + type = realtype; + recycle = B_FALSE; + } + } + if (type == ARC_BUFC_METADATA) { offset = 0; list_count = ARC_BUFC_NUMMETADATALISTS; @@ -4198,6 +4246,12 @@ arc_init(void) if (arc_c_min < arc_meta_limit / 2 && zfs_arc_min == 0) arc_c_min = arc_meta_limit / 2; + if (zfs_arc_meta_min > 0) { + arc_meta_min = zfs_arc_meta_min; + } else { + arc_meta_min = arc_c_min / 2; + } + if (zfs_arc_grow_retry > 0) arc_grow_retry = zfs_arc_grow_retry; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 05:10:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AF63CE0; Mon, 15 Dec 2014 05:10:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 65D4F1DF; Mon, 15 Dec 2014 05:10:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF5AvYi038548; Mon, 15 Dec 2014 05:10:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF5AuNu038541; Mon, 15 Dec 2014 05:10:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412150510.sBF5AuNu038541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Dec 2014 05:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275781 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 05:10:57 -0000 Author: delphij Date: Mon Dec 15 05:10:55 2014 New Revision: 275781 URL: https://svnweb.freebsd.org/changeset/base/275781 Log: MFV r275550: In addition to r273158, make the code in spa_sync() that checks if the current TXG is a no-op TXG less fragile. Illumos issue: 5347 idle pool may run itself out of space MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Dec 15 04:51:36 2014 (r275780) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Dec 15 05:10:55 2014 (r275781) @@ -1486,11 +1486,15 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * dp->dp_bptree_obj, tx)); dp->dp_bptree_obj = 0; scn->scn_async_destroying = B_FALSE; + scn->scn_async_stalled = B_FALSE; } else { /* - * If we didn't make progress, mark the async destroy as - * stalled, so that we will not initiate a spa_sync() on - * its behalf. + * If we didn't make progress, mark the async + * destroy as stalled, so that we will not initiate + * a spa_sync() on its behalf. Note that we only + * check this if we are not finished, because if the + * bptree had no blocks for us to visit, we can + * finish without "making progress". */ scn->scn_async_stalled = (scn->scn_visited_this_txg == 0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Dec 15 04:51:36 2014 (r275780) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Dec 15 05:10:55 2014 (r275781) @@ -6605,21 +6605,6 @@ spa_sync(spa_t *spa, uint64_t txg) } /* - * If anything has changed in this txg, or if someone is waiting - * for this txg to sync (eg, spa_vdev_remove()), push the - * deferred frees from the previous txg. If not, leave them - * alone so that we don't generate work on an otherwise idle - * system. - */ - if (!txg_list_empty(&dp->dp_dirty_datasets, txg) || - !txg_list_empty(&dp->dp_dirty_dirs, txg) || - !txg_list_empty(&dp->dp_sync_tasks, txg) || - ((dsl_scan_active(dp->dp_scan) || - txg_sync_waiting(dp)) && !spa_shutting_down(spa))) { - spa_sync_deferred_frees(spa, tx); - } - - /* * Iterate to convergence. */ do { @@ -6636,6 +6621,11 @@ spa_sync(spa_t *spa, uint64_t txg) if (pass < zfs_sync_pass_deferred_free) { spa_sync_frees(spa, free_bpl, tx); } else { + /* + * We can not defer frees in pass 1, because + * we sync the deferred frees later in pass 1. + */ + ASSERT3U(pass, >, 1); bplist_iterate(free_bpl, bpobj_enqueue_cb, &spa->spa_deferred_bpobj, tx); } @@ -6646,8 +6636,37 @@ spa_sync(spa_t *spa, uint64_t txg) while (vd = txg_list_remove(&spa->spa_vdev_txg_list, txg)) vdev_sync(vd, txg); - if (pass == 1) + if (pass == 1) { spa_sync_upgrades(spa, tx); + ASSERT3U(txg, >=, + spa->spa_uberblock.ub_rootbp.blk_birth); + /* + * Note: We need to check if the MOS is dirty + * because we could have marked the MOS dirty + * without updating the uberblock (e.g. if we + * have sync tasks but no dirty user data). We + * need to check the uberblock's rootbp because + * it is updated if we have synced out dirty + * data (though in this case the MOS will most + * likely also be dirty due to second order + * effects, we don't want to rely on that here). + */ + if (spa->spa_uberblock.ub_rootbp.blk_birth < txg && + !dmu_objset_is_dirty(mos, txg)) { + /* + * Nothing changed on the first pass, + * therefore this TXG is a no-op. Avoid + * syncing deferred frees, so that we + * can keep this TXG as a no-op. + */ + ASSERT(txg_list_empty(&dp->dp_dirty_datasets, + txg)); + ASSERT(txg_list_empty(&dp->dp_dirty_dirs, txg)); + ASSERT(txg_list_empty(&dp->dp_sync_tasks, txg)); + break; + } + spa_sync_deferred_frees(spa, tx); + } } while (dmu_objset_is_dirty(mos, txg)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock.h Mon Dec 15 04:51:36 2014 (r275780) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock.h Mon Dec 15 05:10:55 2014 (r275781) @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ #ifndef _SYS_UBERBLOCK_H #define _SYS_UBERBLOCK_H @@ -36,8 +39,8 @@ extern "C" { typedef struct uberblock uberblock_t; -extern int uberblock_verify(uberblock_t *ub); -extern int uberblock_update(uberblock_t *ub, vdev_t *rvd, uint64_t txg); +extern int uberblock_verify(uberblock_t *); +extern boolean_t uberblock_update(uberblock_t *, vdev_t *, uint64_t); #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c Mon Dec 15 04:51:36 2014 (r275780) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c Mon Dec 15 05:10:55 2014 (r275781) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ #include @@ -40,10 +40,10 @@ uberblock_verify(uberblock_t *ub) } /* - * Update the uberblock and return a boolean value indicating whether - * anything changed in this transaction group. + * Update the uberblock and return TRUE if anything changed in this + * transaction group. */ -int +boolean_t uberblock_update(uberblock_t *ub, vdev_t *rvd, uint64_t txg) { ASSERT(ub->ub_txg < txg); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 07:52:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99CC3102; Mon, 15 Dec 2014 07:52:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 824C53A4; Mon, 15 Dec 2014 07:52:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF7qRWQ017840; Mon, 15 Dec 2014 07:52:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF7qOwD017825; Mon, 15 Dec 2014 07:52:24 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412150752.sBF7qOwD017825@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Dec 2014 07:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275782 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 07:52:27 -0000 Author: delphij Date: Mon Dec 15 07:52:23 2014 New Revision: 275782 URL: https://svnweb.freebsd.org/changeset/base/275782 Log: MFV r275551: Remove "dbuf phys" db->db_data pointer aliases. Use function accessors that cast db->db_data to the appropriate "phys" type, removing the need for clients of the dmu buf user API to keep properly typed pointer aliases to db->db_data in order to conveniently access their data. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c: In zap_leaf() and zap_leaf_byteswap, now that the pointer alias field l_phys has been removed, use the db_data field in an on stack dmu_buf_t to point to the leaf's phys data. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c: Remove the db_user_data_ptr_ptr field from dbuf and all logic to maintain it. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c: Modify the DMU buf user API to remove the ability to specify a db_data aliasing pointer (db_user_data_ptr_ptr). cddl/contrib/opensolaris/cmd/zdb/zdb.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h: Create and use the new "phys data" accessor functions dsl_dir_phys(), dsl_dataset_phys(), zap_m_phys(), zap_f_phys(), and zap_leaf_phys(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h: Remove now unused "phys pointer" aliases to db->db_data from clients of the DMU buf user API. Illumos issue: 5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Dec 15 07:52:23 2014 (r275782) @@ -1884,8 +1884,8 @@ dump_dir(objset_t *os) if (dds.dds_type == DMU_OST_META) { dds.dds_creation_txg = TXG_INITIAL; usedobjs = BP_GET_FILL(os->os_rootbp); - refdbytes = os->os_spa->spa_dsl_pool-> - dp_mos_dir->dd_phys->dd_used_bytes; + refdbytes = dsl_dir_phys(os->os_spa->spa_dsl_pool->dp_mos_dir)-> + dd_used_bytes; } else { dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Dec 15 07:52:23 2014 (r275782) @@ -223,11 +223,8 @@ dbuf_evict_user(dmu_buf_impl_t *db) if (db->db_level != 0 || db->db_evict_func == NULL) return; - if (db->db_user_data_ptr_ptr) - *db->db_user_data_ptr_ptr = db->db.db_data; db->db_evict_func(&db->db, db->db_user_ptr); db->db_user_ptr = NULL; - db->db_user_data_ptr_ptr = NULL; db->db_evict_func = NULL; } @@ -418,16 +415,6 @@ dbuf_verify(dmu_buf_impl_t *db) #endif static void -dbuf_update_data(dmu_buf_impl_t *db) -{ - ASSERT(MUTEX_HELD(&db->db_mtx)); - if (db->db_level == 0 && db->db_user_data_ptr_ptr) { - ASSERT(!refcount_is_zero(&db->db_holds)); - *db->db_user_data_ptr_ptr = db->db.db_data; - } -} - -static void dbuf_set_data(dmu_buf_impl_t *db, arc_buf_t *buf) { ASSERT(MUTEX_HELD(&db->db_mtx)); @@ -437,7 +424,6 @@ dbuf_set_data(dmu_buf_impl_t *db, arc_bu db->db.db_data = buf->b_data; if (!arc_released(buf)) arc_set_callback(buf, dbuf_do_evict, db); - dbuf_update_data(db); } else { dbuf_evict_user(db); db->db.db_data = NULL; @@ -543,7 +529,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t if (bonuslen) bcopy(DN_BONUS(dn->dn_phys), db->db.db_data, bonuslen); DB_DNODE_EXIT(db); - dbuf_update_data(db); db->db_state = DB_CACHED; mutex_exit(&db->db_mtx); return; @@ -1726,7 +1711,6 @@ dbuf_create(dnode_t *dn, uint8_t level, db->db_blkptr = blkptr; db->db_user_ptr = NULL; - db->db_user_data_ptr_ptr = NULL; db->db_evict_func = NULL; db->db_immediate_evict = 0; db->db_freed_in_flight = 0; @@ -1971,7 +1955,6 @@ top: } (void) refcount_add(&db->db_holds, tag); - dbuf_update_data(db); DBUF_VERIFY(db); mutex_exit(&db->db_mtx); @@ -2182,27 +2165,25 @@ dbuf_refcount(dmu_buf_impl_t *db) } void * -dmu_buf_set_user(dmu_buf_t *db_fake, void *user_ptr, void *user_data_ptr_ptr, +dmu_buf_set_user(dmu_buf_t *db_fake, void *user_ptr, dmu_buf_evict_func_t *evict_func) { - return (dmu_buf_update_user(db_fake, NULL, user_ptr, - user_data_ptr_ptr, evict_func)); + return (dmu_buf_update_user(db_fake, NULL, user_ptr, evict_func)); } void * -dmu_buf_set_user_ie(dmu_buf_t *db_fake, void *user_ptr, void *user_data_ptr_ptr, +dmu_buf_set_user_ie(dmu_buf_t *db_fake, void *user_ptr, dmu_buf_evict_func_t *evict_func) { dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; db->db_immediate_evict = TRUE; - return (dmu_buf_update_user(db_fake, NULL, user_ptr, - user_data_ptr_ptr, evict_func)); + return (dmu_buf_update_user(db_fake, NULL, user_ptr, evict_func)); } void * dmu_buf_update_user(dmu_buf_t *db_fake, void *old_user_ptr, void *user_ptr, - void *user_data_ptr_ptr, dmu_buf_evict_func_t *evict_func) + dmu_buf_evict_func_t *evict_func) { dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; ASSERT(db->db_level == 0); @@ -2213,10 +2194,7 @@ dmu_buf_update_user(dmu_buf_t *db_fake, if (db->db_user_ptr == old_user_ptr) { db->db_user_ptr = user_ptr; - db->db_user_data_ptr_ptr = user_data_ptr_ptr; db->db_evict_func = evict_func; - - dbuf_update_data(db); } else { old_user_ptr = db->db_user_ptr; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c Mon Dec 15 07:52:23 2014 (r275782) @@ -221,7 +221,7 @@ dmu_diff(const char *tosnap_name, const return (SET_ERROR(EXDEV)); } - fromtxg = fromsnap->ds_phys->ds_creation_txg; + fromtxg = dsl_dataset_phys(fromsnap)->ds_creation_txg; dsl_dataset_rele(fromsnap, FTAG); dsl_dataset_long_hold(tosnap, FTAG); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Dec 15 07:52:23 2014 (r275782) @@ -1479,12 +1479,12 @@ dmu_snapshot_realname(objset_t *os, char dsl_dataset_t *ds = os->os_dsl_dataset; uint64_t ignored; - if (ds->ds_phys->ds_snapnames_zapobj == 0) + if (dsl_dataset_phys(ds)->ds_snapnames_zapobj == 0) return (SET_ERROR(ENOENT)); return (zap_lookup_norm(ds->ds_dir->dd_pool->dp_meta_objset, - ds->ds_phys->ds_snapnames_zapobj, name, 8, 1, &ignored, MT_FIRST, - real, maxlen, conflict)); + dsl_dataset_phys(ds)->ds_snapnames_zapobj, name, 8, 1, &ignored, + MT_FIRST, real, maxlen, conflict)); } int @@ -1497,12 +1497,12 @@ dmu_snapshot_list_next(objset_t *os, int ASSERT(dsl_pool_config_held(dmu_objset_pool(os))); - if (ds->ds_phys->ds_snapnames_zapobj == 0) + if (dsl_dataset_phys(ds)->ds_snapnames_zapobj == 0) return (SET_ERROR(ENOENT)); zap_cursor_init_serialized(&cursor, ds->ds_dir->dd_pool->dp_meta_objset, - ds->ds_phys->ds_snapnames_zapobj, *offp); + dsl_dataset_phys(ds)->ds_snapnames_zapobj, *offp); if (zap_cursor_retrieve(&cursor, &attr) != 0) { zap_cursor_fini(&cursor); @@ -1536,12 +1536,12 @@ dmu_dir_list_next(objset_t *os, int name /* there is no next dir on a snapshot! */ if (os->os_dsl_dataset->ds_object != - dd->dd_phys->dd_head_dataset_obj) + dsl_dir_phys(dd)->dd_head_dataset_obj) return (SET_ERROR(ENOENT)); zap_cursor_init_serialized(&cursor, dd->dd_pool->dp_meta_objset, - dd->dd_phys->dd_child_dir_zapobj, *offp); + dsl_dir_phys(dd)->dd_child_dir_zapobj, *offp); if (zap_cursor_retrieve(&cursor, &attr) != 0) { zap_cursor_fini(&cursor); @@ -1589,7 +1589,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 return (0); } - thisobj = dd->dd_phys->dd_head_dataset_obj; + thisobj = dsl_dir_phys(dd)->dd_head_dataset_obj; attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); /* @@ -1597,7 +1597,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 */ if (flags & DS_FIND_CHILDREN) { for (zap_cursor_init(&zc, dp->dp_meta_objset, - dd->dd_phys->dd_child_dir_zapobj); + dsl_dir_phys(dd)->dd_child_dir_zapobj); zap_cursor_retrieve(&zc, attr) == 0; (void) zap_cursor_advance(&zc)) { ASSERT3U(attr->za_integer_length, ==, @@ -1626,7 +1626,9 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 err = dsl_dataset_hold_obj(dp, thisobj, FTAG, &ds); if (err == 0) { - uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; + uint64_t snapobj; + + snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; dsl_dataset_rele(ds, FTAG); for (zap_cursor_init(&zc, dp->dp_meta_objset, snapobj); @@ -1701,7 +1703,7 @@ dmu_objset_find_impl(spa_t *spa, const c return (0); } - thisobj = dd->dd_phys->dd_head_dataset_obj; + thisobj = dsl_dir_phys(dd)->dd_head_dataset_obj; attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); /* @@ -1709,7 +1711,7 @@ dmu_objset_find_impl(spa_t *spa, const c */ if (flags & DS_FIND_CHILDREN) { for (zap_cursor_init(&zc, dp->dp_meta_objset, - dd->dd_phys->dd_child_dir_zapobj); + dsl_dir_phys(dd)->dd_child_dir_zapobj); zap_cursor_retrieve(&zc, attr) == 0; (void) zap_cursor_advance(&zc)) { ASSERT3U(attr->za_integer_length, ==, @@ -1742,7 +1744,9 @@ dmu_objset_find_impl(spa_t *spa, const c err = dsl_dataset_hold_obj(dp, thisobj, FTAG, &ds); if (err == 0) { - uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; + uint64_t snapobj; + + snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; dsl_dataset_rele(ds, FTAG); for (zap_cursor_init(&zc, dp->dp_meta_objset, snapobj); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Dec 15 07:52:23 2014 (r275782) @@ -623,12 +623,12 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, featureflags); drr->drr_u.drr_begin.drr_creation_time = - ds->ds_phys->ds_creation_time; + dsl_dataset_phys(ds)->ds_creation_time; drr->drr_u.drr_begin.drr_type = dmu_objset_type(os); if (is_clone) drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CLONE; - drr->drr_u.drr_begin.drr_toguid = ds->ds_phys->ds_guid; - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(ds)->ds_guid; + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA; if (fromzb != NULL) { @@ -650,7 +650,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsp->dsa_fp = fp; dsp->dsa_os = os; dsp->dsa_off = off; - dsp->dsa_toguid = ds->ds_phys->ds_guid; + dsp->dsa_toguid = dsl_dataset_phys(ds)->ds_guid; ZIO_SET_CHECKSUM(&dsp->dsa_zc, 0, 0, 0, 0); dsp->dsa_pending_op = PENDING_NONE; dsp->dsa_incremental = (fromzb != NULL); @@ -740,9 +740,10 @@ dmu_send_obj(const char *pool, uint64_t } if (!dsl_dataset_is_before(ds, fromds, 0)) err = SET_ERROR(EXDEV); - zb.zbm_creation_time = fromds->ds_phys->ds_creation_time; - zb.zbm_creation_txg = fromds->ds_phys->ds_creation_txg; - zb.zbm_guid = fromds->ds_phys->ds_guid; + zb.zbm_creation_time = + dsl_dataset_phys(fromds)->ds_creation_time; + zb.zbm_creation_txg = dsl_dataset_phys(fromds)->ds_creation_txg; + zb.zbm_guid = dsl_dataset_phys(fromds)->ds_guid; is_clone = (fromds->ds_dir != ds->ds_dir); dsl_dataset_rele(fromds, FTAG); err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, @@ -813,10 +814,10 @@ dmu_send(const char *tosnap, const char if (!dsl_dataset_is_before(ds, fromds, 0)) err = SET_ERROR(EXDEV); zb.zbm_creation_time = - fromds->ds_phys->ds_creation_time; + dsl_dataset_phys(fromds)->ds_creation_time; zb.zbm_creation_txg = - fromds->ds_phys->ds_creation_txg; - zb.zbm_guid = fromds->ds_phys->ds_guid; + dsl_dataset_phys(fromds)->ds_creation_txg; + zb.zbm_guid = dsl_dataset_phys(fromds)->ds_guid; is_clone = (ds->ds_dir != fromds->ds_dir); dsl_dataset_rele(fromds, FTAG); } @@ -863,7 +864,7 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl /* Get uncompressed size estimate of changed data. */ if (fromds == NULL) { - size = ds->ds_phys->ds_uncompressed_bytes; + size = dsl_dataset_phys(ds)->ds_uncompressed_bytes; } else { uint64_t used, comp; err = dsl_dataset_space_written(fromds, ds, @@ -918,15 +919,15 @@ recv_begin_check_existing_impl(dmu_recv_ /* temporary clone name must not exist */ error = zap_lookup(dp->dp_meta_objset, - ds->ds_dir->dd_phys->dd_child_dir_zapobj, recv_clone_name, + dsl_dir_phys(ds->ds_dir)->dd_child_dir_zapobj, recv_clone_name, 8, 1, &val); if (error != ENOENT) return (error == 0 ? EBUSY : error); /* new snapshot name must not exist */ error = zap_lookup(dp->dp_meta_objset, - ds->ds_phys->ds_snapnames_zapobj, drba->drba_cookie->drc_tosnap, - 8, 1, &val); + dsl_dataset_phys(ds)->ds_snapnames_zapobj, + drba->drba_cookie->drc_tosnap, 8, 1, &val); if (error != ENOENT) return (error == 0 ? EEXIST : error); @@ -946,7 +947,7 @@ recv_begin_check_existing_impl(dmu_recv_ if (fromguid != 0) { dsl_dataset_t *snap; - uint64_t obj = ds->ds_phys->ds_prev_snap_obj; + uint64_t obj = dsl_dataset_phys(ds)->ds_prev_snap_obj; /* Find snapshot in this dir that matches fromguid. */ while (obj != 0) { @@ -958,9 +959,9 @@ recv_begin_check_existing_impl(dmu_recv_ dsl_dataset_rele(snap, FTAG); return (SET_ERROR(ENODEV)); } - if (snap->ds_phys->ds_guid == fromguid) + if (dsl_dataset_phys(snap)->ds_guid == fromguid) break; - obj = snap->ds_phys->ds_prev_snap_obj; + obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); } if (obj == 0) @@ -983,9 +984,9 @@ recv_begin_check_existing_impl(dmu_recv_ dsl_dataset_rele(snap, FTAG); } else { /* if full, most recent snapshot must be $ORIGIN */ - if (ds->ds_phys->ds_prev_snap_txg >= TXG_INITIAL) + if (dsl_dataset_phys(ds)->ds_prev_snap_txg >= TXG_INITIAL) return (SET_ERROR(ENODEV)); - drba->drba_snapobj = ds->ds_phys->ds_prev_snap_obj; + drba->drba_snapobj = dsl_dataset_phys(ds)->ds_prev_snap_obj; } return (0); @@ -1103,7 +1104,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t dsl_dataset_rele(ds, FTAG); return (SET_ERROR(EINVAL)); } - if (origin->ds_phys->ds_guid != fromguid) { + if (dsl_dataset_phys(origin)->ds_guid != fromguid) { dsl_dataset_rele(origin, FTAG); dsl_dataset_rele(ds, FTAG); return (SET_ERROR(ENODEV)); @@ -1174,7 +1175,7 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t } dmu_buf_will_dirty(newds->ds_dbuf, tx); - newds->ds_phys->ds_flags |= DS_FLAG_INCONSISTENT; + dsl_dataset_phys(newds)->ds_flags |= DS_FLAG_INCONSISTENT; /* * If we actually created a non-clone, we need to create the @@ -1837,7 +1838,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, */ VERIFY0(dmu_objset_from_ds(drc->drc_ds, &os)); - ASSERT(drc->drc_ds->ds_phys->ds_flags & DS_FLAG_INCONSISTENT); + ASSERT(dsl_dataset_phys(drc->drc_ds)->ds_flags & DS_FLAG_INCONSISTENT); featureflags = DMU_GET_FEATUREFLAGS(drc->drc_drrb->drr_versioninfo); @@ -2000,8 +2001,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t * * the snap before drc_ds, because drc_ds can not * have any snaps of its own). */ - uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; - while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + uint64_t obj; + + obj = dsl_dataset_phys(origin_head)->ds_prev_snap_obj; + while (obj != + dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj) { dsl_dataset_t *snap; error = dsl_dataset_hold_obj(dp, obj, FTAG, &snap); @@ -2013,7 +2017,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_destroy_snapshot_check_impl( snap, B_FALSE); } - obj = snap->ds_phys->ds_prev_snap_obj; + obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); if (error != 0) return (error); @@ -2059,13 +2063,16 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t * Destroy any snapshots of drc_tofs (origin_head) * after the origin (the snap before drc_ds). */ - uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; - while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + uint64_t obj; + + obj = dsl_dataset_phys(origin_head)->ds_prev_snap_obj; + while (obj != + dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj) { dsl_dataset_t *snap; VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, &snap)); ASSERT3P(snap->ds_dir, ==, origin_head->ds_dir); - obj = snap->ds_phys->ds_prev_snap_obj; + obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_destroy_snapshot_sync_impl(snap, B_FALSE, tx); dsl_dataset_rele(snap, FTAG); @@ -2081,15 +2088,16 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t /* set snapshot's creation time and guid */ dmu_buf_will_dirty(origin_head->ds_prev->ds_dbuf, tx); - origin_head->ds_prev->ds_phys->ds_creation_time = + dsl_dataset_phys(origin_head->ds_prev)->ds_creation_time = drc->drc_drrb->drr_creation_time; - origin_head->ds_prev->ds_phys->ds_guid = + dsl_dataset_phys(origin_head->ds_prev)->ds_guid = drc->drc_drrb->drr_toguid; - origin_head->ds_prev->ds_phys->ds_flags &= + dsl_dataset_phys(origin_head->ds_prev)->ds_flags &= ~DS_FLAG_INCONSISTENT; dmu_buf_will_dirty(origin_head->ds_dbuf, tx); - origin_head->ds_phys->ds_flags &= ~DS_FLAG_INCONSISTENT; + dsl_dataset_phys(origin_head)->ds_flags &= + ~DS_FLAG_INCONSISTENT; dsl_dataset_rele(origin_head, FTAG); dsl_destroy_head_sync_impl(drc->drc_ds, tx); @@ -2103,15 +2111,17 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t /* set snapshot's creation time and guid */ dmu_buf_will_dirty(ds->ds_prev->ds_dbuf, tx); - ds->ds_prev->ds_phys->ds_creation_time = + dsl_dataset_phys(ds->ds_prev)->ds_creation_time = drc->drc_drrb->drr_creation_time; - ds->ds_prev->ds_phys->ds_guid = drc->drc_drrb->drr_toguid; - ds->ds_prev->ds_phys->ds_flags &= ~DS_FLAG_INCONSISTENT; + dsl_dataset_phys(ds->ds_prev)->ds_guid = + drc->drc_drrb->drr_toguid; + dsl_dataset_phys(ds->ds_prev)->ds_flags &= + ~DS_FLAG_INCONSISTENT; dmu_buf_will_dirty(ds->ds_dbuf, tx); - ds->ds_phys->ds_flags &= ~DS_FLAG_INCONSISTENT; + dsl_dataset_phys(ds)->ds_flags &= ~DS_FLAG_INCONSISTENT; } - drc->drc_newsnapobj = drc->drc_ds->ds_phys->ds_prev_snap_obj; + drc->drc_newsnapobj = dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj; /* * Release the hold from dmu_recv_begin. This must be done before * we return to open context, so that when we free the dataset's dnode, @@ -2137,7 +2147,7 @@ add_ds_to_guidmap(const char *name, avl_ gmep = kmem_alloc(sizeof (*gmep), KM_SLEEP); err = dsl_dataset_hold_obj(dp, snapobj, gmep, &snapds); if (err == 0) { - gmep->guid = snapds->ds_phys->ds_guid; + gmep->guid = dsl_dataset_phys(snapds)->ds_guid; gmep->gme_ds = snapds; avl_add(guid_map, gmep); dsl_dataset_long_hold(snapds, gmep); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Dec 15 07:52:23 2014 (r275782) @@ -579,7 +579,7 @@ traverse_dataset(dsl_dataset_t *ds, uint blkptr_cb_t func, void *arg) { return (traverse_impl(ds->ds_dir->dd_pool->dp_spa, ds, ds->ds_object, - &ds->ds_phys->ds_bp, txg_start, NULL, flags, func, arg)); + &dsl_dataset_phys(ds)->ds_bp, txg_start, NULL, flags, func, arg)); } int @@ -634,8 +634,8 @@ traverse_pool(spa_t *spa, uint64_t txg_s continue; break; } - if (ds->ds_phys->ds_prev_snap_txg > txg) - txg = ds->ds_phys->ds_prev_snap_txg; + if (dsl_dataset_phys(ds)->ds_prev_snap_txg > txg) + txg = dsl_dataset_phys(ds)->ds_prev_snap_txg; err = traverse_dataset(ds, txg, flags, func, arg); dsl_dataset_rele(ds, FTAG); if (err != 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Dec 15 07:52:23 2014 (r275782) @@ -714,6 +714,7 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o { dmu_tx_hold_t *txh; dnode_t *dn; + dsl_dataset_phys_t *ds_phys; uint64_t nblocks; int epbs, err; @@ -788,8 +789,9 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o * we'll have to modify an indirect twig for each. */ epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; + ds_phys = dsl_dataset_phys(dn->dn_objset->os_dsl_dataset); for (nblocks = dn->dn_maxblkid >> epbs; nblocks != 0; nblocks >>= epbs) - if (dn->dn_objset->os_dsl_dataset->ds_phys->ds_prev_snap_obj) + if (ds_phys->ds_prev_snap_obj) txh->txh_space_towrite += 3 << dn->dn_indblkshift; else txh->txh_space_tooverwrite += 3 << dn->dn_indblkshift; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Dec 15 07:52:23 2014 (r275782) @@ -1121,7 +1121,7 @@ dnode_hold_impl(objset_t *os, uint64_t o zrl_init(&dnh[i].dnh_zrlock); dnh[i].dnh_dnode = NULL; } - if (winner = dmu_buf_set_user(&db->db, children_dnodes, NULL, + if (winner = dmu_buf_set_user(&db->db, children_dnodes, dnode_buf_pageout)) { for (i = 0; i < epb; i++) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c Mon Dec 15 07:52:23 2014 (r275782) @@ -65,7 +65,7 @@ dsl_dataset_bmark_lookup(dsl_dataset_t * if (bmark_zapobj == 0) return (SET_ERROR(ESRCH)); - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) mt = MT_FIRST; else mt = MT_EXACT; @@ -208,10 +208,11 @@ dsl_bookmark_create_sync(void *arg, dmu_ &bmark_fs->ds_bookmarks, tx)); } - bmark_phys.zbm_guid = snapds->ds_phys->ds_guid; - bmark_phys.zbm_creation_txg = snapds->ds_phys->ds_creation_txg; + bmark_phys.zbm_guid = dsl_dataset_phys(snapds)->ds_guid; + bmark_phys.zbm_creation_txg = + dsl_dataset_phys(snapds)->ds_creation_txg; bmark_phys.zbm_creation_time = - snapds->ds_phys->ds_creation_time; + dsl_dataset_phys(snapds)->ds_creation_time; VERIFY0(zap_add(mos, bmark_fs->ds_bookmarks, shortname, sizeof (uint64_t), @@ -340,7 +341,7 @@ dsl_dataset_bookmark_remove(dsl_dataset_ uint64_t bmark_zapobj = ds->ds_bookmarks; matchtype_t mt; - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) mt = MT_FIRST; else mt = MT_EXACT; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Dec 15 05:10:55 2014 (r275781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Dec 15 07:52:23 2014 (r275782) @@ -76,6 +76,9 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recor #define DS_REF_MAX (1ULL << 62) +extern inline dsl_dataset_phys_t *dsl_dataset_phys(dsl_dataset_t *ds); +extern inline boolean_t dsl_dataset_is_snapshot(dsl_dataset_t *ds); + /* * Figure out how much of this delta should be propogated to the dsl_dir * layer. If there's a refreservation, that space has already been @@ -84,13 +87,15 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recor static int64_t parent_delta(dsl_dataset_t *ds, int64_t delta) { + dsl_dataset_phys_t *ds_phys; uint64_t old_bytes, new_bytes; if (ds->ds_reserved == 0) return (delta); - old_bytes = MAX(ds->ds_phys->ds_unique_bytes, ds->ds_reserved); - new_bytes = MAX(ds->ds_phys->ds_unique_bytes + delta, ds->ds_reserved); + ds_phys = dsl_dataset_phys(ds); + old_bytes = MAX(ds_phys->ds_unique_bytes, ds->ds_reserved); + new_bytes = MAX(ds_phys->ds_unique_bytes + delta, ds->ds_reserved); ASSERT3U(ABS((int64_t)(new_bytes - old_bytes)), <=, ABS(delta)); return (new_bytes - old_bytes); @@ -121,10 +126,10 @@ dsl_dataset_block_born(dsl_dataset_t *ds dmu_buf_will_dirty(ds->ds_dbuf, tx); mutex_enter(&ds->ds_lock); delta = parent_delta(ds, used); - ds->ds_phys->ds_referenced_bytes += used; - ds->ds_phys->ds_compressed_bytes += compressed; - ds->ds_phys->ds_uncompressed_bytes += uncompressed; - ds->ds_phys->ds_unique_bytes += used; + dsl_dataset_phys(ds)->ds_referenced_bytes += used; + dsl_dataset_phys(ds)->ds_compressed_bytes += compressed; + dsl_dataset_phys(ds)->ds_uncompressed_bytes += uncompressed; + dsl_dataset_phys(ds)->ds_unique_bytes += used; if (BP_GET_LSIZE(bp) > SPA_OLD_MAXBLOCKSIZE) ds->ds_need_large_blocks = B_TRUE; mutex_exit(&ds->ds_lock); @@ -159,17 +164,17 @@ dsl_dataset_block_kill(dsl_dataset_t *ds ASSERT(!dsl_dataset_is_snapshot(ds)); dmu_buf_will_dirty(ds->ds_dbuf, tx); - if (bp->blk_birth > ds->ds_phys->ds_prev_snap_txg) { + if (bp->blk_birth > dsl_dataset_phys(ds)->ds_prev_snap_txg) { int64_t delta; dprintf_bp(bp, "freeing ds=%llu", ds->ds_object); dsl_free(tx->tx_pool, tx->tx_txg, bp); mutex_enter(&ds->ds_lock); - ASSERT(ds->ds_phys->ds_unique_bytes >= used || + ASSERT(dsl_dataset_phys(ds)->ds_unique_bytes >= used || !DS_UNIQUE_IS_ACCURATE(ds)); delta = parent_delta(ds, -used); - ds->ds_phys->ds_unique_bytes -= used; + dsl_dataset_phys(ds)->ds_unique_bytes -= used; mutex_exit(&ds->ds_lock); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, delta, -compressed, -uncompressed, tx); @@ -190,15 +195,15 @@ dsl_dataset_block_kill(dsl_dataset_t *ds dsl_deadlist_insert(&ds->ds_deadlist, bp, tx); } ASSERT3U(ds->ds_prev->ds_object, ==, - ds->ds_phys->ds_prev_snap_obj); - ASSERT(ds->ds_prev->ds_phys->ds_num_children > 0); + dsl_dataset_phys(ds)->ds_prev_snap_obj); + ASSERT(dsl_dataset_phys(ds->ds_prev)->ds_num_children > 0); /* if (bp->blk_birth > prev prev snap txg) prev unique += bs */ - if (ds->ds_prev->ds_phys->ds_next_snap_obj == + if (dsl_dataset_phys(ds->ds_prev)->ds_next_snap_obj == ds->ds_object && bp->blk_birth > - ds->ds_prev->ds_phys->ds_prev_snap_txg) { + dsl_dataset_phys(ds->ds_prev)->ds_prev_snap_txg) { dmu_buf_will_dirty(ds->ds_prev->ds_dbuf, tx); mutex_enter(&ds->ds_prev->ds_lock); - ds->ds_prev->ds_phys->ds_unique_bytes += used; + dsl_dataset_phys(ds->ds_prev)->ds_unique_bytes += used; mutex_exit(&ds->ds_prev->ds_lock); } if (bp->blk_birth > ds->ds_dir->dd_origin_txg) { @@ -207,12 +212,12 @@ dsl_dataset_block_kill(dsl_dataset_t *ds } } mutex_enter(&ds->ds_lock); - ASSERT3U(ds->ds_phys->ds_referenced_bytes, >=, used); - ds->ds_phys->ds_referenced_bytes -= used; - ASSERT3U(ds->ds_phys->ds_compressed_bytes, >=, compressed); - ds->ds_phys->ds_compressed_bytes -= compressed; - ASSERT3U(ds->ds_phys->ds_uncompressed_bytes, >=, uncompressed); - ds->ds_phys->ds_uncompressed_bytes -= uncompressed; + ASSERT3U(dsl_dataset_phys(ds)->ds_referenced_bytes, >=, used); + dsl_dataset_phys(ds)->ds_referenced_bytes -= used; + ASSERT3U(dsl_dataset_phys(ds)->ds_compressed_bytes, >=, compressed); + dsl_dataset_phys(ds)->ds_compressed_bytes -= compressed; + ASSERT3U(dsl_dataset_phys(ds)->ds_uncompressed_bytes, >=, uncompressed); + dsl_dataset_phys(ds)->ds_uncompressed_bytes -= uncompressed; mutex_exit(&ds->ds_lock); return (used); @@ -238,7 +243,7 @@ dsl_dataset_prev_snap_txg(dsl_dataset_t if (ds->ds_trysnap_txg > spa_last_synced_txg(ds->ds_dir->dd_pool->dp_spa)) trysnap = ds->ds_trysnap_txg; - return (MAX(ds->ds_phys->ds_prev_snap_txg, trysnap)); + return (MAX(dsl_dataset_phys(ds)->ds_prev_snap_txg, trysnap)); } boolean_t @@ -273,7 +278,7 @@ dsl_dataset_evict(dmu_buf_t *db, void *d } bplist_destroy(&ds->ds_pending_deadlist); - if (ds->ds_phys->ds_deadlist_obj != 0) + if (dsl_dataset_phys(ds)->ds_deadlist_obj != 0) dsl_deadlist_close(&ds->ds_deadlist); if (ds->ds_dir) dsl_dir_rele(ds->ds_dir, ds); @@ -303,10 +308,10 @@ dsl_dataset_get_snapname(dsl_dataset_t * if (ds->ds_snapname[0]) return (0); - if (ds->ds_phys->ds_next_snap_obj == 0) + if (dsl_dataset_phys(ds)->ds_next_snap_obj == 0) return (0); - err = dmu_bonus_hold(mos, ds->ds_dir->dd_phys->dd_head_dataset_obj, + err = dmu_bonus_hold(mos, dsl_dir_phys(ds->ds_dir)->dd_head_dataset_obj, FTAG, &headdbuf); if (err != 0) return (err); @@ -321,11 +326,11 @@ int dsl_dataset_snap_lookup(dsl_dataset_t *ds, const char *name, uint64_t *value) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; - uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; + uint64_t snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; matchtype_t mt; int err; - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) mt = MT_FIRST; else mt = MT_EXACT; @@ -342,13 +347,13 @@ dsl_dataset_snap_remove(dsl_dataset_t *d boolean_t adj_cnt) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; - uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; + uint64_t snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; matchtype_t mt; int err; dsl_dir_snap_cmtime_update(ds->ds_dir); - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) mt = MT_FIRST; else mt = MT_EXACT; @@ -394,7 +399,6 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin ds = kmem_zalloc(sizeof (dsl_dataset_t), KM_SLEEP); ds->ds_dbuf = dbuf; ds->ds_object = dsobj; - ds->ds_phys = dbuf->db_data; mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_opening_lock, NULL, MUTEX_DEFAULT, NULL); @@ -403,7 +407,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin bplist_create(&ds->ds_pending_deadlist); dsl_deadlist_open(&ds->ds_deadlist, - mos, ds->ds_phys->ds_deadlist_obj); + mos, dsl_dataset_phys(ds)->ds_deadlist_obj); list_create(&ds->ds_sendstreams, sizeof (dmu_sendarg_t), offsetof(dmu_sendarg_t, dsa_link)); @@ -418,7 +422,8 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin if (err == 0) { err = dsl_dir_hold_obj(dp, - ds->ds_phys->ds_dir_obj, NULL, ds, &ds->ds_dir); + dsl_dataset_phys(ds)->ds_dir_obj, NULL, ds, + &ds->ds_dir); } if (err != 0) { mutex_destroy(&ds->ds_lock); @@ -434,9 +439,9 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin if (!dsl_dataset_is_snapshot(ds)) { ds->ds_snapname[0] = '\0'; - if (ds->ds_phys->ds_prev_snap_obj != 0) { + if (dsl_dataset_phys(ds)->ds_prev_snap_obj != 0) { err = dsl_dataset_hold_obj(dp, - ds->ds_phys->ds_prev_snap_obj, + dsl_dataset_phys(ds)->ds_prev_snap_obj, ds, &ds->ds_prev); } if (doi.doi_type == DMU_OTN_ZAP_METADATA) { @@ -450,10 +455,11 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin } else { if (zfs_flags & ZFS_DEBUG_SNAPNAMES) err = dsl_dataset_get_snapname(ds); - if (err == 0 && ds->ds_phys->ds_userrefs_obj != 0) { + if (err == 0 && + dsl_dataset_phys(ds)->ds_userrefs_obj != 0) { err = zap_count( ds->ds_dir->dd_pool->dp_meta_objset, - ds->ds_phys->ds_userrefs_obj, + dsl_dataset_phys(ds)->ds_userrefs_obj, &ds->ds_userrefs); } } @@ -472,7 +478,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin } if (err != 0 || (winner = dmu_buf_set_user_ie(dbuf, ds, - &ds->ds_phys, dsl_dataset_evict)) != NULL) { + dsl_dataset_evict)) != NULL) { bplist_destroy(&ds->ds_pending_deadlist); dsl_deadlist_close(&ds->ds_deadlist); if (ds->ds_prev) @@ -490,12 +496,12 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin ds = winner; } else { ds->ds_fsid_guid = - unique_insert(ds->ds_phys->ds_fsid_guid); + unique_insert(dsl_dataset_phys(ds)->ds_fsid_guid); } } ASSERT3P(ds->ds_dbuf, ==, dbuf); - ASSERT3P(ds->ds_phys, ==, dbuf->db_data); - ASSERT(ds->ds_phys->ds_prev_snap_obj != 0 || + ASSERT3P(dsl_dataset_phys(ds), ==, dbuf->db_data); + ASSERT(dsl_dataset_phys(ds)->ds_prev_snap_obj != 0 || spa_version(dp->dp_spa) < SPA_VERSION_ORIGIN || dp->dp_origin_snap == NULL || ds == dp->dp_origin_snap); *dsp = ds; @@ -516,7 +522,7 @@ dsl_dataset_hold(dsl_pool_t *dp, const c return (err); ASSERT(dsl_pool_config_held(dp)); - obj = dd->dd_phys->dd_head_dataset_obj; + obj = dsl_dir_phys(dd)->dd_head_dataset_obj; if (obj != 0) err = dsl_dataset_hold_obj(dp, obj, tag, dsp); else @@ -683,9 +689,9 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd origin = dp->dp_origin_snap; ASSERT(origin == NULL || origin->ds_dir->dd_pool == dp); - ASSERT(origin == NULL || origin->ds_phys->ds_num_children > 0); + ASSERT(origin == NULL || dsl_dataset_phys(origin)->ds_num_children > 0); ASSERT(dmu_tx_is_syncing(tx)); - ASSERT(dd->dd_phys->dd_head_dataset_obj == 0); + ASSERT(dsl_dir_phys(dd)->dd_head_dataset_obj == 0); dsobj = dmu_object_alloc(mos, DMU_OT_DSL_DATASET, 0, DMU_OT_DSL_DATASET, sizeof (dsl_dataset_phys_t), tx); @@ -713,55 +719,58 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsphys->ds_prev_snap_obj = origin->ds_object; dsphys->ds_prev_snap_txg = - origin->ds_phys->ds_creation_txg; + dsl_dataset_phys(origin)->ds_creation_txg; dsphys->ds_referenced_bytes = - origin->ds_phys->ds_referenced_bytes; + dsl_dataset_phys(origin)->ds_referenced_bytes; dsphys->ds_compressed_bytes = - origin->ds_phys->ds_compressed_bytes; + dsl_dataset_phys(origin)->ds_compressed_bytes; dsphys->ds_uncompressed_bytes = - origin->ds_phys->ds_uncompressed_bytes; - dsphys->ds_bp = origin->ds_phys->ds_bp; + dsl_dataset_phys(origin)->ds_uncompressed_bytes; + dsphys->ds_bp = dsl_dataset_phys(origin)->ds_bp; /* * Inherit flags that describe the dataset's contents * (INCONSISTENT) or properties (Case Insensitive). */ - dsphys->ds_flags |= origin->ds_phys->ds_flags & + dsphys->ds_flags |= dsl_dataset_phys(origin)->ds_flags & (DS_FLAG_INCONSISTENT | DS_FLAG_CI_DATASET); if (origin->ds_large_blocks) dsl_dataset_activate_large_blocks_sync_impl(dsobj, tx); dmu_buf_will_dirty(origin->ds_dbuf, tx); - origin->ds_phys->ds_num_children++; + dsl_dataset_phys(origin)->ds_num_children++; VERIFY0(dsl_dataset_hold_obj(dp, - origin->ds_dir->dd_phys->dd_head_dataset_obj, FTAG, &ohds)); + dsl_dir_phys(origin->ds_dir)->dd_head_dataset_obj, + FTAG, &ohds)); dsphys->ds_deadlist_obj = dsl_deadlist_clone(&ohds->ds_deadlist, dsphys->ds_prev_snap_txg, dsphys->ds_prev_snap_obj, tx); dsl_dataset_rele(ohds, FTAG); if (spa_version(dp->dp_spa) >= SPA_VERSION_NEXT_CLONES) { - if (origin->ds_phys->ds_next_clones_obj == 0) { - origin->ds_phys->ds_next_clones_obj = + if (dsl_dataset_phys(origin)->ds_next_clones_obj == 0) { + dsl_dataset_phys(origin)->ds_next_clones_obj = zap_create(mos, DMU_OT_NEXT_CLONES, DMU_OT_NONE, 0, tx); } VERIFY0(zap_add_int(mos, - origin->ds_phys->ds_next_clones_obj, dsobj, tx)); + dsl_dataset_phys(origin)->ds_next_clones_obj, + dsobj, tx)); } dmu_buf_will_dirty(dd->dd_dbuf, tx); - dd->dd_phys->dd_origin_obj = origin->ds_object; + dsl_dir_phys(dd)->dd_origin_obj = origin->ds_object; if (spa_version(dp->dp_spa) >= SPA_VERSION_DIR_CLONES) { - if (origin->ds_dir->dd_phys->dd_clones == 0) { + if (dsl_dir_phys(origin->ds_dir)->dd_clones == 0) { dmu_buf_will_dirty(origin->ds_dir->dd_dbuf, tx); - origin->ds_dir->dd_phys->dd_clones = + dsl_dir_phys(origin->ds_dir)->dd_clones = zap_create(mos, DMU_OT_DSL_CLONES, DMU_OT_NONE, 0, tx); } VERIFY0(zap_add_int(mos, - origin->ds_dir->dd_phys->dd_clones, dsobj, tx)); + dsl_dir_phys(origin->ds_dir)->dd_clones, + dsobj, tx)); } } @@ -771,7 +780,7 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dmu_buf_rele(dbuf, FTAG); dmu_buf_will_dirty(dd->dd_dbuf, tx); - dd->dd_phys->dd_head_dataset_obj = dsobj; + dsl_dir_phys(dd)->dd_head_dataset_obj = dsobj; return (dsobj); } @@ -893,20 +902,20 @@ dsl_dataset_recalc_head_uniq(dsl_dataset ASSERT(!dsl_dataset_is_snapshot(ds)); - if (ds->ds_phys->ds_prev_snap_obj != 0) - mrs_used = ds->ds_prev->ds_phys->ds_referenced_bytes; + if (dsl_dataset_phys(ds)->ds_prev_snap_obj != 0) + mrs_used = dsl_dataset_phys(ds->ds_prev)->ds_referenced_bytes; else mrs_used = 0; dsl_deadlist_space(&ds->ds_deadlist, &dlused, &dlcomp, &dluncomp); ASSERT3U(dlused, <=, mrs_used); - ds->ds_phys->ds_unique_bytes = - ds->ds_phys->ds_referenced_bytes - (mrs_used - dlused); + dsl_dataset_phys(ds)->ds_unique_bytes = + dsl_dataset_phys(ds)->ds_referenced_bytes - (mrs_used - dlused); if (spa_version(ds->ds_dir->dd_pool->dp_spa) >= SPA_VERSION_UNIQUE_ACCURATE) - ds->ds_phys->ds_flags |= DS_FLAG_UNIQUE_ACCURATE; + dsl_dataset_phys(ds)->ds_flags |= DS_FLAG_UNIQUE_ACCURATE; } void @@ -917,8 +926,9 @@ dsl_dataset_remove_from_next_clones(dsl_ uint64_t count; int err; - ASSERT(ds->ds_phys->ds_num_children >= 2); - err = zap_remove_int(mos, ds->ds_phys->ds_next_clones_obj, obj, tx); + ASSERT(dsl_dataset_phys(ds)->ds_num_children >= 2); + err = zap_remove_int(mos, dsl_dataset_phys(ds)->ds_next_clones_obj, + obj, tx); /* * The err should not be ENOENT, but a bug in a previous version * of the code could cause upgrade_clones_cb() to not set @@ -931,16 +941,16 @@ dsl_dataset_remove_from_next_clones(dsl_ */ if (err != ENOENT) VERIFY0(err); - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + ASSERT0(zap_count(mos, dsl_dataset_phys(ds)->ds_next_clones_obj, &count)); - ASSERT3U(count, <=, ds->ds_phys->ds_num_children - 2); + ASSERT3U(count, <=, dsl_dataset_phys(ds)->ds_num_children - 2); } blkptr_t * dsl_dataset_get_blkptr(dsl_dataset_t *ds) { - return (&ds->ds_phys->ds_bp); + return (&dsl_dataset_phys(ds)->ds_bp); } void @@ -952,7 +962,7 @@ dsl_dataset_set_blkptr(dsl_dataset_t *ds tx->tx_pool->dp_meta_rootbp = *bp; } else { dmu_buf_will_dirty(ds->ds_dbuf, tx); - ds->ds_phys->ds_bp = *bp; + dsl_dataset_phys(ds)->ds_bp = *bp; } } @@ -972,7 +982,7 @@ dsl_dataset_dirty(dsl_dataset_t *ds, dmu ASSERT(ds->ds_objset != NULL); - if (ds->ds_phys->ds_next_snap_obj != 0) + if (dsl_dataset_phys(ds)->ds_next_snap_obj != 0) panic("dirtying snapshot!"); dp = ds->ds_dir->dd_pool; @@ -1008,7 +1018,7 @@ dsl_dataset_snapshot_reserve_space(dsl_d * outside of the reservation. */ ASSERT(ds->ds_reserved == 0 || DS_UNIQUE_IS_ACCURATE(ds)); - asize = MIN(ds->ds_phys->ds_unique_bytes, ds->ds_reserved); + asize = MIN(dsl_dataset_phys(ds)->ds_unique_bytes, ds->ds_reserved); if (asize > dsl_dir_space_available(ds->ds_dir, NULL, 0, TRUE)) return (SET_ERROR(ENOSPC)); @@ -1045,7 +1055,7 @@ dsl_dataset_snapshot_check_impl(dsl_data *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 07:59:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A37A31C; Mon, 15 Dec 2014 07:59:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 053783ED; Mon, 15 Dec 2014 07:59:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF7xXWe018856; Mon, 15 Dec 2014 07:59:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF7xXlG018855; Mon, 15 Dec 2014 07:59:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412150759.sBF7xXlG018855@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Dec 2014 07:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275783 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 07:59:34 -0000 Author: delphij Date: Mon Dec 15 07:59:33 2014 New Revision: 275783 URL: https://svnweb.freebsd.org/changeset/base/275783 Log: 5369 arc flags should be an enum 5370 consistent arc_buf_hdr_t naming scheme Reviewed by: Matthew Ahrens Reviewed by: Alex Reece Reviewed by: Sebastien Roy Reviewed by: Richard Elling Approved by: Richard Lowe Author: George Wilson illumos/illumos-gate@7adb730b589e553bf3b1ccfd9bae2df91c5c1061 Modified: vendor/illumos/dist/cmd/zdb/zdb.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Mon Dec 15 07:52:23 2014 (r275782) +++ vendor/illumos/dist/cmd/zdb/zdb.c Mon Dec 15 07:59:33 2014 (r275783) @@ -1157,7 +1157,7 @@ visit_indirect(spa_t *spa, const dnode_p print_indirect(bp, zb, dnp); if (BP_GET_LEVEL(bp) > 0 && !BP_IS_HOLE(bp)) { - uint32_t flags = ARC_WAIT; + arc_flags_t flags = ARC_FLAG_WAIT; int i; blkptr_t *cbp; int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 07:59:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B22C931D; Mon, 15 Dec 2014 07:59:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9C5AB3EE; Mon, 15 Dec 2014 07:59:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF7xYJV018865; Mon, 15 Dec 2014 07:59:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF7xYJN018862; Mon, 15 Dec 2014 07:59:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412150759.sBF7xYJN018862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Dec 2014 07:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275783 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 07:59:34 -0000 Author: delphij Date: Mon Dec 15 07:59:33 2014 New Revision: 275783 URL: https://svnweb.freebsd.org/changeset/base/275783 Log: 5369 arc flags should be an enum 5370 consistent arc_buf_hdr_t naming scheme Reviewed by: Matthew Ahrens Reviewed by: Alex Reece Reviewed by: Sebastien Roy Reviewed by: Richard Elling Approved by: Richard Lowe Author: George Wilson illumos/illumos-gate@7adb730b589e553bf3b1ccfd9bae2df91c5c1061 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Mon Dec 15 07:52:23 2014 (r275782) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Mon Dec 15 07:59:33 2014 (r275783) @@ -500,7 +500,7 @@ struct arc_buf_hdr { arc_buf_hdr_t *b_hash_next; arc_buf_t *b_buf; - uint32_t b_flags; + arc_flags_t b_flags; uint32_t b_datacnt; arc_callback_t *b_acb; @@ -528,50 +528,26 @@ struct arc_buf_hdr { static arc_buf_t *arc_eviction_list; static kmutex_t arc_eviction_mtx; static arc_buf_hdr_t arc_eviction_hdr; -static void arc_get_data_buf(arc_buf_t *buf); -static void arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock); -static int arc_evict_needed(arc_buf_contents_t type); -static void arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes); -static void arc_buf_watch(arc_buf_t *buf); - -static boolean_t l2arc_write_eligible(uint64_t spa_guid, arc_buf_hdr_t *ab); #define GHOST_STATE(state) \ ((state) == arc_mru_ghost || (state) == arc_mfu_ghost || \ (state) == arc_l2c_only) -/* - * Private ARC flags. These flags are private ARC only flags that will show up - * in b_flags in the arc_hdr_buf_t. Some flags are publicly declared, and can - * be passed in as arc_flags in things like arc_read. However, these flags - * should never be passed and should only be set by ARC code. When adding new - * public flags, make sure not to smash the private ones. - */ - -#define ARC_IN_HASH_TABLE (1 << 9) /* this buffer is hashed */ -#define ARC_IO_IN_PROGRESS (1 << 10) /* I/O in progress for buf */ -#define ARC_IO_ERROR (1 << 11) /* I/O failed for buf */ -#define ARC_FREED_IN_READ (1 << 12) /* buf freed while in read */ -#define ARC_BUF_AVAILABLE (1 << 13) /* block not in active use */ -#define ARC_INDIRECT (1 << 14) /* this is an indirect block */ -#define ARC_FREE_IN_PROGRESS (1 << 15) /* hdr about to be freed */ -#define ARC_L2_WRITING (1 << 16) /* L2ARC write in progress */ -#define ARC_L2_EVICTED (1 << 17) /* evicted during I/O */ -#define ARC_L2_WRITE_HEAD (1 << 18) /* head of write list */ - -#define HDR_IN_HASH_TABLE(hdr) ((hdr)->b_flags & ARC_IN_HASH_TABLE) -#define HDR_IO_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_IO_IN_PROGRESS) -#define HDR_IO_ERROR(hdr) ((hdr)->b_flags & ARC_IO_ERROR) -#define HDR_PREFETCH(hdr) ((hdr)->b_flags & ARC_PREFETCH) -#define HDR_FREED_IN_READ(hdr) ((hdr)->b_flags & ARC_FREED_IN_READ) -#define HDR_BUF_AVAILABLE(hdr) ((hdr)->b_flags & ARC_BUF_AVAILABLE) -#define HDR_FREE_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_FREE_IN_PROGRESS) -#define HDR_L2CACHE(hdr) ((hdr)->b_flags & ARC_L2CACHE) -#define HDR_L2_READING(hdr) ((hdr)->b_flags & ARC_IO_IN_PROGRESS && \ - (hdr)->b_l2hdr != NULL) -#define HDR_L2_WRITING(hdr) ((hdr)->b_flags & ARC_L2_WRITING) -#define HDR_L2_EVICTED(hdr) ((hdr)->b_flags & ARC_L2_EVICTED) -#define HDR_L2_WRITE_HEAD(hdr) ((hdr)->b_flags & ARC_L2_WRITE_HEAD) +#define HDR_IN_HASH_TABLE(hdr) ((hdr)->b_flags & ARC_FLAG_IN_HASH_TABLE) +#define HDR_IO_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS) +#define HDR_IO_ERROR(hdr) ((hdr)->b_flags & ARC_FLAG_IO_ERROR) +#define HDR_PREFETCH(hdr) ((hdr)->b_flags & ARC_FLAG_PREFETCH) +#define HDR_FREED_IN_READ(hdr) ((hdr)->b_flags & ARC_FLAG_FREED_IN_READ) +#define HDR_BUF_AVAILABLE(hdr) ((hdr)->b_flags & ARC_FLAG_BUF_AVAILABLE) +#define HDR_FREE_IN_PROGRESS(hdr) \ + ((hdr)->b_flags & ARC_FLAG_FREE_IN_PROGRESS) +#define HDR_L2CACHE(hdr) ((hdr)->b_flags & ARC_FLAG_L2CACHE) +#define HDR_L2_READING(hdr) \ + ((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS && \ + (hdr)->b_l2hdr != NULL) +#define HDR_L2_WRITING(hdr) ((hdr)->b_flags & ARC_FLAG_L2_WRITING) +#define HDR_L2_EVICTED(hdr) ((hdr)->b_flags & ARC_FLAG_L2_EVICTED) +#define HDR_L2_WRITE_HEAD(hdr) ((hdr)->b_flags & ARC_FLAG_L2_WRITE_HEAD) /* * Other sizes @@ -703,14 +679,20 @@ static kmutex_t l2arc_feed_thr_lock; static kcondvar_t l2arc_feed_thr_cv; static uint8_t l2arc_thread_exit; -static void l2arc_read_done(zio_t *zio); +static void arc_get_data_buf(arc_buf_t *); +static void arc_access(arc_buf_hdr_t *, kmutex_t *); +static int arc_evict_needed(arc_buf_contents_t); +static void arc_evict_ghost(arc_state_t *, uint64_t, int64_t); +static void arc_buf_watch(arc_buf_t *); + +static boolean_t l2arc_write_eligible(uint64_t, arc_buf_hdr_t *); +static void l2arc_read_done(zio_t *); static void l2arc_hdr_stat_add(void); static void l2arc_hdr_stat_remove(void); -static boolean_t l2arc_compress_buf(l2arc_buf_hdr_t *l2hdr); -static void l2arc_decompress_zio(zio_t *zio, arc_buf_hdr_t *hdr, - enum zio_compress c); -static void l2arc_release_cdata_buf(arc_buf_hdr_t *ab); +static boolean_t l2arc_compress_buf(l2arc_buf_hdr_t *); +static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); +static void l2arc_release_cdata_buf(arc_buf_hdr_t *); static uint64_t buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth) @@ -755,14 +737,14 @@ buf_hash_find(uint64_t spa, const blkptr uint64_t birth = BP_PHYSICAL_BIRTH(bp); uint64_t idx = BUF_HASH_INDEX(spa, dva, birth); kmutex_t *hash_lock = BUF_HASH_LOCK(idx); - arc_buf_hdr_t *buf; + arc_buf_hdr_t *hdr; mutex_enter(hash_lock); - for (buf = buf_hash_table.ht_table[idx]; buf != NULL; - buf = buf->b_hash_next) { - if (BUF_EQUAL(spa, dva, birth, buf)) { + for (hdr = buf_hash_table.ht_table[idx]; hdr != NULL; + hdr = hdr->b_hash_next) { + if (BUF_EQUAL(spa, dva, birth, hdr)) { *lockp = hash_lock; - return (buf); + return (hdr); } } mutex_exit(hash_lock); @@ -777,27 +759,27 @@ buf_hash_find(uint64_t spa, const blkptr * Otherwise returns NULL. */ static arc_buf_hdr_t * -buf_hash_insert(arc_buf_hdr_t *buf, kmutex_t **lockp) +buf_hash_insert(arc_buf_hdr_t *hdr, kmutex_t **lockp) { - uint64_t idx = BUF_HASH_INDEX(buf->b_spa, &buf->b_dva, buf->b_birth); + uint64_t idx = BUF_HASH_INDEX(hdr->b_spa, &hdr->b_dva, hdr->b_birth); kmutex_t *hash_lock = BUF_HASH_LOCK(idx); - arc_buf_hdr_t *fbuf; + arc_buf_hdr_t *fhdr; uint32_t i; - ASSERT(!DVA_IS_EMPTY(&buf->b_dva)); - ASSERT(buf->b_birth != 0); - ASSERT(!HDR_IN_HASH_TABLE(buf)); + ASSERT(!DVA_IS_EMPTY(&hdr->b_dva)); + ASSERT(hdr->b_birth != 0); + ASSERT(!HDR_IN_HASH_TABLE(hdr)); *lockp = hash_lock; mutex_enter(hash_lock); - for (fbuf = buf_hash_table.ht_table[idx], i = 0; fbuf != NULL; - fbuf = fbuf->b_hash_next, i++) { - if (BUF_EQUAL(buf->b_spa, &buf->b_dva, buf->b_birth, fbuf)) - return (fbuf); + for (fhdr = buf_hash_table.ht_table[idx], i = 0; fhdr != NULL; + fhdr = fhdr->b_hash_next, i++) { + if (BUF_EQUAL(hdr->b_spa, &hdr->b_dva, hdr->b_birth, fhdr)) + return (fhdr); } - buf->b_hash_next = buf_hash_table.ht_table[idx]; - buf_hash_table.ht_table[idx] = buf; - buf->b_flags |= ARC_IN_HASH_TABLE; + hdr->b_hash_next = buf_hash_table.ht_table[idx]; + buf_hash_table.ht_table[idx] = hdr; + hdr->b_flags |= ARC_FLAG_IN_HASH_TABLE; /* collect some hash table performance data */ if (i > 0) { @@ -815,22 +797,22 @@ buf_hash_insert(arc_buf_hdr_t *buf, kmut } static void -buf_hash_remove(arc_buf_hdr_t *buf) +buf_hash_remove(arc_buf_hdr_t *hdr) { - arc_buf_hdr_t *fbuf, **bufp; - uint64_t idx = BUF_HASH_INDEX(buf->b_spa, &buf->b_dva, buf->b_birth); + arc_buf_hdr_t *fhdr, **hdrp; + uint64_t idx = BUF_HASH_INDEX(hdr->b_spa, &hdr->b_dva, hdr->b_birth); ASSERT(MUTEX_HELD(BUF_HASH_LOCK(idx))); - ASSERT(HDR_IN_HASH_TABLE(buf)); + ASSERT(HDR_IN_HASH_TABLE(hdr)); - bufp = &buf_hash_table.ht_table[idx]; - while ((fbuf = *bufp) != buf) { - ASSERT(fbuf != NULL); - bufp = &fbuf->b_hash_next; - } - *bufp = buf->b_hash_next; - buf->b_hash_next = NULL; - buf->b_flags &= ~ARC_IN_HASH_TABLE; + hdrp = &buf_hash_table.ht_table[idx]; + while ((fhdr = *hdrp) != hdr) { + ASSERT(fhdr != NULL); + hdrp = &fhdr->b_hash_next; + } + *hdrp = hdr->b_hash_next; + hdr->b_hash_next = NULL; + hdr->b_flags &= ~ARC_FLAG_IN_HASH_TABLE; /* collect some hash table performance data */ ARCSTAT_BUMPDOWN(arcstat_hash_elements); @@ -867,12 +849,12 @@ buf_fini(void) static int hdr_cons(void *vbuf, void *unused, int kmflag) { - arc_buf_hdr_t *buf = vbuf; + arc_buf_hdr_t *hdr = vbuf; - bzero(buf, sizeof (arc_buf_hdr_t)); - refcount_create(&buf->b_refcnt); - cv_init(&buf->b_cv, NULL, CV_DEFAULT, NULL); - mutex_init(&buf->b_freeze_lock, NULL, MUTEX_DEFAULT, NULL); + bzero(hdr, sizeof (arc_buf_hdr_t)); + refcount_create(&hdr->b_refcnt); + cv_init(&hdr->b_cv, NULL, CV_DEFAULT, NULL); + mutex_init(&hdr->b_freeze_lock, NULL, MUTEX_DEFAULT, NULL); arc_space_consume(sizeof (arc_buf_hdr_t), ARC_SPACE_HDRS); return (0); @@ -899,12 +881,12 @@ buf_cons(void *vbuf, void *unused, int k static void hdr_dest(void *vbuf, void *unused) { - arc_buf_hdr_t *buf = vbuf; + arc_buf_hdr_t *hdr = vbuf; - ASSERT(BUF_EMPTY(buf)); - refcount_destroy(&buf->b_refcnt); - cv_destroy(&buf->b_cv); - mutex_destroy(&buf->b_freeze_lock); + ASSERT(BUF_EMPTY(hdr)); + refcount_destroy(&hdr->b_refcnt); + cv_destroy(&hdr->b_cv); + mutex_destroy(&hdr->b_freeze_lock); arc_space_return(sizeof (arc_buf_hdr_t), ARC_SPACE_HDRS); } @@ -986,7 +968,7 @@ arc_cksum_verify(arc_buf_t *buf) mutex_enter(&buf->b_hdr->b_freeze_lock); if (buf->b_hdr->b_freeze_cksum == NULL || - (buf->b_hdr->b_flags & ARC_IO_ERROR)) { + (buf->b_hdr->b_flags & ARC_FLAG_IO_ERROR)) { mutex_exit(&buf->b_hdr->b_freeze_lock); return; } @@ -1077,7 +1059,7 @@ arc_buf_thaw(arc_buf_t *buf) if (zfs_flags & ZFS_DEBUG_MODIFY) { if (buf->b_hdr->b_state != arc_anon) panic("modifying non-anon buffer!"); - if (buf->b_hdr->b_flags & ARC_IO_IN_PROGRESS) + if (buf->b_hdr->b_flags & ARC_FLAG_IO_IN_PROGRESS) panic("modifying buffer while i/o in progress!"); arc_cksum_verify(buf); } @@ -1118,54 +1100,54 @@ arc_buf_freeze(arc_buf_t *buf) } static void -add_reference(arc_buf_hdr_t *ab, kmutex_t *hash_lock, void *tag) +add_reference(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, void *tag) { ASSERT(MUTEX_HELD(hash_lock)); - if ((refcount_add(&ab->b_refcnt, tag) == 1) && - (ab->b_state != arc_anon)) { - uint64_t delta = ab->b_size * ab->b_datacnt; - list_t *list = &ab->b_state->arcs_list[ab->b_type]; - uint64_t *size = &ab->b_state->arcs_lsize[ab->b_type]; - - ASSERT(!MUTEX_HELD(&ab->b_state->arcs_mtx)); - mutex_enter(&ab->b_state->arcs_mtx); - ASSERT(list_link_active(&ab->b_arc_node)); - list_remove(list, ab); - if (GHOST_STATE(ab->b_state)) { - ASSERT0(ab->b_datacnt); - ASSERT3P(ab->b_buf, ==, NULL); - delta = ab->b_size; + if ((refcount_add(&hdr->b_refcnt, tag) == 1) && + (hdr->b_state != arc_anon)) { + uint64_t delta = hdr->b_size * hdr->b_datacnt; + list_t *list = &hdr->b_state->arcs_list[hdr->b_type]; + uint64_t *size = &hdr->b_state->arcs_lsize[hdr->b_type]; + + ASSERT(!MUTEX_HELD(&hdr->b_state->arcs_mtx)); + mutex_enter(&hdr->b_state->arcs_mtx); + ASSERT(list_link_active(&hdr->b_arc_node)); + list_remove(list, hdr); + if (GHOST_STATE(hdr->b_state)) { + ASSERT0(hdr->b_datacnt); + ASSERT3P(hdr->b_buf, ==, NULL); + delta = hdr->b_size; } ASSERT(delta > 0); ASSERT3U(*size, >=, delta); atomic_add_64(size, -delta); - mutex_exit(&ab->b_state->arcs_mtx); + mutex_exit(&hdr->b_state->arcs_mtx); /* remove the prefetch flag if we get a reference */ - if (ab->b_flags & ARC_PREFETCH) - ab->b_flags &= ~ARC_PREFETCH; + if (hdr->b_flags & ARC_FLAG_PREFETCH) + hdr->b_flags &= ~ARC_FLAG_PREFETCH; } } static int -remove_reference(arc_buf_hdr_t *ab, kmutex_t *hash_lock, void *tag) +remove_reference(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, void *tag) { int cnt; - arc_state_t *state = ab->b_state; + arc_state_t *state = hdr->b_state; ASSERT(state == arc_anon || MUTEX_HELD(hash_lock)); ASSERT(!GHOST_STATE(state)); - if (((cnt = refcount_remove(&ab->b_refcnt, tag)) == 0) && + if (((cnt = refcount_remove(&hdr->b_refcnt, tag)) == 0) && (state != arc_anon)) { - uint64_t *size = &state->arcs_lsize[ab->b_type]; + uint64_t *size = &state->arcs_lsize[hdr->b_type]; ASSERT(!MUTEX_HELD(&state->arcs_mtx)); mutex_enter(&state->arcs_mtx); - ASSERT(!list_link_active(&ab->b_arc_node)); - list_insert_head(&state->arcs_list[ab->b_type], ab); - ASSERT(ab->b_datacnt > 0); - atomic_add_64(size, ab->b_size * ab->b_datacnt); + ASSERT(!list_link_active(&hdr->b_arc_node)); + list_insert_head(&state->arcs_list[hdr->b_type], hdr); + ASSERT(hdr->b_datacnt > 0); + atomic_add_64(size, hdr->b_size * hdr->b_datacnt); mutex_exit(&state->arcs_mtx); } return (cnt); @@ -1176,19 +1158,20 @@ remove_reference(arc_buf_hdr_t *ab, kmut * for the buffer must be held by the caller. */ static void -arc_change_state(arc_state_t *new_state, arc_buf_hdr_t *ab, kmutex_t *hash_lock) +arc_change_state(arc_state_t *new_state, arc_buf_hdr_t *hdr, + kmutex_t *hash_lock) { - arc_state_t *old_state = ab->b_state; - int64_t refcnt = refcount_count(&ab->b_refcnt); + arc_state_t *old_state = hdr->b_state; + int64_t refcnt = refcount_count(&hdr->b_refcnt); uint64_t from_delta, to_delta; ASSERT(MUTEX_HELD(hash_lock)); ASSERT3P(new_state, !=, old_state); - ASSERT(refcnt == 0 || ab->b_datacnt > 0); - ASSERT(ab->b_datacnt == 0 || !GHOST_STATE(new_state)); - ASSERT(ab->b_datacnt <= 1 || old_state != arc_anon); + ASSERT(refcnt == 0 || hdr->b_datacnt > 0); + ASSERT(hdr->b_datacnt == 0 || !GHOST_STATE(new_state)); + ASSERT(hdr->b_datacnt <= 1 || old_state != arc_anon); - from_delta = to_delta = ab->b_datacnt * ab->b_size; + from_delta = to_delta = hdr->b_datacnt * hdr->b_size; /* * If this buffer is evictable, transfer it from the @@ -1197,22 +1180,22 @@ arc_change_state(arc_state_t *new_state, if (refcnt == 0) { if (old_state != arc_anon) { int use_mutex = !MUTEX_HELD(&old_state->arcs_mtx); - uint64_t *size = &old_state->arcs_lsize[ab->b_type]; + uint64_t *size = &old_state->arcs_lsize[hdr->b_type]; if (use_mutex) mutex_enter(&old_state->arcs_mtx); - ASSERT(list_link_active(&ab->b_arc_node)); - list_remove(&old_state->arcs_list[ab->b_type], ab); + ASSERT(list_link_active(&hdr->b_arc_node)); + list_remove(&old_state->arcs_list[hdr->b_type], hdr); /* * If prefetching out of the ghost cache, * we will have a non-zero datacnt. */ - if (GHOST_STATE(old_state) && ab->b_datacnt == 0) { + if (GHOST_STATE(old_state) && hdr->b_datacnt == 0) { /* ghost elements have a ghost size */ - ASSERT(ab->b_buf == NULL); - from_delta = ab->b_size; + ASSERT(hdr->b_buf == NULL); + from_delta = hdr->b_size; } ASSERT3U(*size, >=, from_delta); atomic_add_64(size, -from_delta); @@ -1222,18 +1205,19 @@ arc_change_state(arc_state_t *new_state, } if (new_state != arc_anon) { int use_mutex = !MUTEX_HELD(&new_state->arcs_mtx); - uint64_t *size = &new_state->arcs_lsize[ab->b_type]; + uint64_t *size = &new_state->arcs_lsize[hdr->b_type]; if (use_mutex) mutex_enter(&new_state->arcs_mtx); - list_insert_head(&new_state->arcs_list[ab->b_type], ab); + list_insert_head(&new_state->arcs_list[hdr->b_type], + hdr); /* ghost elements have a ghost size */ if (GHOST_STATE(new_state)) { - ASSERT(ab->b_datacnt == 0); - ASSERT(ab->b_buf == NULL); - to_delta = ab->b_size; + ASSERT(hdr->b_datacnt == 0); + ASSERT(hdr->b_buf == NULL); + to_delta = hdr->b_size; } atomic_add_64(size, to_delta); @@ -1242,9 +1226,9 @@ arc_change_state(arc_state_t *new_state, } } - ASSERT(!BUF_EMPTY(ab)); - if (new_state == arc_anon && HDR_IN_HASH_TABLE(ab)) - buf_hash_remove(ab); + ASSERT(!BUF_EMPTY(hdr)); + if (new_state == arc_anon && HDR_IN_HASH_TABLE(hdr)) + buf_hash_remove(hdr); /* adjust state sizes */ if (to_delta) @@ -1253,7 +1237,7 @@ arc_change_state(arc_state_t *new_state, ASSERT3U(old_state->arcs_size, >=, from_delta); atomic_add_64(&old_state->arcs_size, -from_delta); } - ab->b_state = new_state; + hdr->b_state = new_state; /* adjust l2arc hdr stats */ if (new_state == arc_l2c_only) @@ -1455,7 +1439,7 @@ arc_buf_add_ref(arc_buf_t *buf, void* ta arc_access(hdr, hash_lock); mutex_exit(hash_lock); ARCSTAT_BUMP(arcstat_hits); - ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_PREFETCH), + ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_FLAG_PREFETCH), demand, prefetch, hdr->b_type != ARC_BUFC_METADATA, data, metadata, hits); } @@ -1656,7 +1640,7 @@ arc_buf_free(arc_buf_t *buf, void *tag) } else { ASSERT(buf == hdr->b_buf); ASSERT(buf->b_efunc == NULL); - hdr->b_flags |= ARC_BUF_AVAILABLE; + hdr->b_flags |= ARC_FLAG_BUF_AVAILABLE; } mutex_exit(hash_lock); } else if (HDR_IO_IN_PROGRESS(hdr)) { @@ -1707,7 +1691,7 @@ arc_buf_remove_ref(arc_buf_t *buf, void* } else if (no_callback) { ASSERT(hdr->b_buf == buf && buf->b_next == NULL); ASSERT(buf->b_efunc == NULL); - hdr->b_flags |= ARC_BUF_AVAILABLE; + hdr->b_flags |= ARC_FLAG_BUF_AVAILABLE; } ASSERT(no_callback || hdr->b_datacnt > 1 || refcount_is_zero(&hdr->b_refcnt)); @@ -1782,7 +1766,7 @@ arc_evict(arc_state_t *state, uint64_t s { arc_state_t *evicted_state; uint64_t bytes_evicted = 0, skipped = 0, missed = 0; - arc_buf_hdr_t *ab, *ab_prev = NULL; + arc_buf_hdr_t *hdr, *hdr_prev = NULL; kmutex_t *hash_lock; boolean_t have_lock; void *stolen = NULL; @@ -1840,24 +1824,24 @@ arc_evict(arc_state_t *state, uint64_t s list_t *list = &state->arcs_list[type]; - for (ab = list_tail(list); ab; ab = ab_prev) { - ab_prev = list_prev(list, ab); + for (hdr = list_tail(list); hdr; hdr = hdr_prev) { + hdr_prev = list_prev(list, hdr); /* prefetch buffers have a minimum lifespan */ - if (HDR_IO_IN_PROGRESS(ab) || - (spa && ab->b_spa != spa) || - (ab->b_flags & (ARC_PREFETCH|ARC_INDIRECT) && - ddi_get_lbolt() - ab->b_arc_access < + if (HDR_IO_IN_PROGRESS(hdr) || + (spa && hdr->b_spa != spa) || + (hdr->b_flags & (ARC_FLAG_PREFETCH | ARC_FLAG_INDIRECT) && + ddi_get_lbolt() - hdr->b_arc_access < arc_min_prefetch_lifespan)) { skipped++; continue; } /* "lookahead" for better eviction candidate */ - if (recycle && ab->b_size != bytes && - ab_prev && ab_prev->b_size == bytes) + if (recycle && hdr->b_size != bytes && + hdr_prev && hdr_prev->b_size == bytes) continue; /* ignore markers */ - if (ab->b_spa == 0) + if (hdr->b_spa == 0) continue; /* @@ -1870,34 +1854,34 @@ arc_evict(arc_state_t *state, uint64_t s * the hot code path, so don't sleep. */ if (!recycle && count++ > arc_evict_iterations) { - list_insert_after(list, ab, &marker); + list_insert_after(list, hdr, &marker); mutex_exit(&evicted_state->arcs_mtx); mutex_exit(&state->arcs_mtx); kpreempt(KPREEMPT_SYNC); mutex_enter(&state->arcs_mtx); mutex_enter(&evicted_state->arcs_mtx); - ab_prev = list_prev(list, &marker); + hdr_prev = list_prev(list, &marker); list_remove(list, &marker); count = 0; continue; } - hash_lock = HDR_LOCK(ab); + hash_lock = HDR_LOCK(hdr); have_lock = MUTEX_HELD(hash_lock); if (have_lock || mutex_tryenter(hash_lock)) { - ASSERT0(refcount_count(&ab->b_refcnt)); - ASSERT(ab->b_datacnt > 0); - while (ab->b_buf) { - arc_buf_t *buf = ab->b_buf; + ASSERT0(refcount_count(&hdr->b_refcnt)); + ASSERT(hdr->b_datacnt > 0); + while (hdr->b_buf) { + arc_buf_t *buf = hdr->b_buf; if (!mutex_tryenter(&buf->b_evict_lock)) { missed += 1; break; } if (buf->b_data) { - bytes_evicted += ab->b_size; - if (recycle && ab->b_type == type && - ab->b_size == bytes && - !HDR_L2_WRITING(ab)) { + bytes_evicted += hdr->b_size; + if (recycle && hdr->b_type == type && + hdr->b_size == bytes && + !HDR_L2_WRITING(hdr)) { stolen = buf->b_data; recycle = FALSE; } @@ -1906,7 +1890,7 @@ arc_evict(arc_state_t *state, uint64_t s mutex_enter(&arc_eviction_mtx); arc_buf_destroy(buf, buf->b_data == stolen, FALSE); - ab->b_buf = buf->b_next; + hdr->b_buf = buf->b_next; buf->b_hdr = &arc_eviction_hdr; buf->b_next = arc_eviction_list; arc_eviction_list = buf; @@ -1919,26 +1903,26 @@ arc_evict(arc_state_t *state, uint64_t s } } - if (ab->b_l2hdr) { + if (hdr->b_l2hdr) { ARCSTAT_INCR(arcstat_evict_l2_cached, - ab->b_size); + hdr->b_size); } else { - if (l2arc_write_eligible(ab->b_spa, ab)) { + if (l2arc_write_eligible(hdr->b_spa, hdr)) { ARCSTAT_INCR(arcstat_evict_l2_eligible, - ab->b_size); + hdr->b_size); } else { ARCSTAT_INCR( arcstat_evict_l2_ineligible, - ab->b_size); + hdr->b_size); } } - if (ab->b_datacnt == 0) { - arc_change_state(evicted_state, ab, hash_lock); - ASSERT(HDR_IN_HASH_TABLE(ab)); - ab->b_flags |= ARC_IN_HASH_TABLE; - ab->b_flags &= ~ARC_BUF_AVAILABLE; - DTRACE_PROBE1(arc__evict, arc_buf_hdr_t *, ab); + if (hdr->b_datacnt == 0) { + arc_change_state(evicted_state, hdr, hash_lock); + ASSERT(HDR_IN_HASH_TABLE(hdr)); + hdr->b_flags |= ARC_FLAG_IN_HASH_TABLE; + hdr->b_flags &= ~ARC_FLAG_BUF_AVAILABLE; + DTRACE_PROBE1(arc__evict, arc_buf_hdr_t *, hdr); } if (!have_lock) mutex_exit(hash_lock); @@ -1979,7 +1963,7 @@ arc_evict(arc_state_t *state, uint64_t s static void arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes) { - arc_buf_hdr_t *ab, *ab_prev; + arc_buf_hdr_t *hdr, *hdr_prev; arc_buf_hdr_t marker = { 0 }; list_t *list = &state->arcs_list[ARC_BUFC_DATA]; kmutex_t *hash_lock; @@ -1990,18 +1974,18 @@ arc_evict_ghost(arc_state_t *state, uint ASSERT(GHOST_STATE(state)); top: mutex_enter(&state->arcs_mtx); - for (ab = list_tail(list); ab; ab = ab_prev) { - ab_prev = list_prev(list, ab); - if (ab->b_type > ARC_BUFC_NUMTYPES) - panic("invalid ab=%p", (void *)ab); - if (spa && ab->b_spa != spa) + for (hdr = list_tail(list); hdr; hdr = hdr_prev) { + hdr_prev = list_prev(list, hdr); + if (hdr->b_type > ARC_BUFC_NUMTYPES) + panic("invalid hdr=%p", (void *)hdr); + if (spa && hdr->b_spa != spa) continue; /* ignore markers */ - if (ab->b_spa == 0) + if (hdr->b_spa == 0) continue; - hash_lock = HDR_LOCK(ab); + hash_lock = HDR_LOCK(hdr); /* caller may be trying to modify this buffer, skip it */ if (MUTEX_HELD(hash_lock)) continue; @@ -2013,35 +1997,35 @@ top: * before reacquiring the lock. */ if (count++ > arc_evict_iterations) { - list_insert_after(list, ab, &marker); + list_insert_after(list, hdr, &marker); mutex_exit(&state->arcs_mtx); kpreempt(KPREEMPT_SYNC); mutex_enter(&state->arcs_mtx); - ab_prev = list_prev(list, &marker); + hdr_prev = list_prev(list, &marker); list_remove(list, &marker); count = 0; continue; } if (mutex_tryenter(hash_lock)) { - ASSERT(!HDR_IO_IN_PROGRESS(ab)); - ASSERT(ab->b_buf == NULL); + ASSERT(!HDR_IO_IN_PROGRESS(hdr)); + ASSERT(hdr->b_buf == NULL); ARCSTAT_BUMP(arcstat_deleted); - bytes_deleted += ab->b_size; + bytes_deleted += hdr->b_size; - if (ab->b_l2hdr != NULL) { + if (hdr->b_l2hdr != NULL) { /* * This buffer is cached on the 2nd Level ARC; * don't destroy the header. */ - arc_change_state(arc_l2c_only, ab, hash_lock); + arc_change_state(arc_l2c_only, hdr, hash_lock); mutex_exit(hash_lock); } else { - arc_change_state(arc_anon, ab, hash_lock); + arc_change_state(arc_anon, hdr, hash_lock); mutex_exit(hash_lock); - arc_hdr_destroy(ab); + arc_hdr_destroy(hdr); } - DTRACE_PROBE1(arc__delete, arc_buf_hdr_t *, ab); + DTRACE_PROBE1(arc__delete, arc_buf_hdr_t *, hdr); if (bytes >= 0 && bytes_deleted >= bytes) break; } else if (bytes < 0) { @@ -2050,12 +2034,12 @@ top: * hash lock to become available. Once its * available, restart from where we left off. */ - list_insert_after(list, ab, &marker); + list_insert_after(list, hdr, &marker); mutex_exit(&state->arcs_mtx); mutex_enter(hash_lock); mutex_exit(hash_lock); mutex_enter(&state->arcs_mtx); - ab_prev = list_prev(list, &marker); + hdr_prev = list_prev(list, &marker); list_remove(list, &marker); } else { bufs_skipped += 1; @@ -2571,7 +2555,8 @@ arc_get_data_buf(arc_buf_t *buf) * will end up on the mru list; so steal space from there. */ if (state == arc_mfu_ghost) - state = buf->b_hdr->b_flags & ARC_PREFETCH ? arc_mru : arc_mfu; + state = buf->b_hdr->b_flags & ARC_FLAG_PREFETCH ? + arc_mru : arc_mfu; else if (state == arc_mru_ghost) state = arc_mru; @@ -2626,25 +2611,25 @@ out: * NOTE: the hash lock is dropped in this function. */ static void -arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock) +arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) { clock_t now; ASSERT(MUTEX_HELD(hash_lock)); - if (buf->b_state == arc_anon) { + if (hdr->b_state == arc_anon) { /* * This buffer is not in the cache, and does not * appear in our "ghost" list. Add the new buffer * to the MRU state. */ - ASSERT(buf->b_arc_access == 0); - buf->b_arc_access = ddi_get_lbolt(); - DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, buf); - arc_change_state(arc_mru, buf, hash_lock); + ASSERT(hdr->b_arc_access == 0); + hdr->b_arc_access = ddi_get_lbolt(); + DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, hdr); + arc_change_state(arc_mru, hdr, hash_lock); - } else if (buf->b_state == arc_mru) { + } else if (hdr->b_state == arc_mru) { now = ddi_get_lbolt(); /* @@ -2655,14 +2640,14 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * - move the buffer to the head of the list if this is * another prefetch (to make it less likely to be evicted). */ - if ((buf->b_flags & ARC_PREFETCH) != 0) { - if (refcount_count(&buf->b_refcnt) == 0) { - ASSERT(list_link_active(&buf->b_arc_node)); + if ((hdr->b_flags & ARC_FLAG_PREFETCH) != 0) { + if (refcount_count(&hdr->b_refcnt) == 0) { + ASSERT(list_link_active(&hdr->b_arc_node)); } else { - buf->b_flags &= ~ARC_PREFETCH; + hdr->b_flags &= ~ARC_FLAG_PREFETCH; ARCSTAT_BUMP(arcstat_mru_hits); } - buf->b_arc_access = now; + hdr->b_arc_access = now; return; } @@ -2671,18 +2656,18 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * but it is still in the cache. Move it to the MFU * state. */ - if (now > buf->b_arc_access + ARC_MINTIME) { + if (now > hdr->b_arc_access + ARC_MINTIME) { /* * More than 125ms have passed since we * instantiated this buffer. Move it to the * most frequently used state. */ - buf->b_arc_access = now; - DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); - arc_change_state(arc_mfu, buf, hash_lock); + hdr->b_arc_access = now; + DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); + arc_change_state(arc_mfu, hdr, hash_lock); } ARCSTAT_BUMP(arcstat_mru_hits); - } else if (buf->b_state == arc_mru_ghost) { + } else if (hdr->b_state == arc_mru_ghost) { arc_state_t *new_state; /* * This buffer has been "accessed" recently, but @@ -2690,21 +2675,21 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * MFU state. */ - if (buf->b_flags & ARC_PREFETCH) { + if (hdr->b_flags & ARC_FLAG_PREFETCH) { new_state = arc_mru; - if (refcount_count(&buf->b_refcnt) > 0) - buf->b_flags &= ~ARC_PREFETCH; - DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, buf); + if (refcount_count(&hdr->b_refcnt) > 0) + hdr->b_flags &= ~ARC_FLAG_PREFETCH; + DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, hdr); } else { new_state = arc_mfu; - DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); + DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); } - buf->b_arc_access = ddi_get_lbolt(); - arc_change_state(new_state, buf, hash_lock); + hdr->b_arc_access = ddi_get_lbolt(); + arc_change_state(new_state, hdr, hash_lock); ARCSTAT_BUMP(arcstat_mru_ghost_hits); - } else if (buf->b_state == arc_mfu) { + } else if (hdr->b_state == arc_mfu) { /* * This buffer has been accessed more than once and is * still in the cache. Keep it in the MFU state. @@ -2714,13 +2699,13 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * If it was a prefetch, we will explicitly move it to * the head of the list now. */ - if ((buf->b_flags & ARC_PREFETCH) != 0) { - ASSERT(refcount_count(&buf->b_refcnt) == 0); - ASSERT(list_link_active(&buf->b_arc_node)); + if ((hdr->b_flags & ARC_FLAG_PREFETCH) != 0) { + ASSERT(refcount_count(&hdr->b_refcnt) == 0); + ASSERT(list_link_active(&hdr->b_arc_node)); } ARCSTAT_BUMP(arcstat_mfu_hits); - buf->b_arc_access = ddi_get_lbolt(); - } else if (buf->b_state == arc_mfu_ghost) { + hdr->b_arc_access = ddi_get_lbolt(); + } else if (hdr->b_state == arc_mfu_ghost) { arc_state_t *new_state = arc_mfu; /* * This buffer has been accessed more than once but has @@ -2728,28 +2713,28 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * MFU state. */ - if (buf->b_flags & ARC_PREFETCH) { + if (hdr->b_flags & ARC_FLAG_PREFETCH) { /* * This is a prefetch access... * move this block back to the MRU state. */ - ASSERT0(refcount_count(&buf->b_refcnt)); + ASSERT0(refcount_count(&hdr->b_refcnt)); new_state = arc_mru; } - buf->b_arc_access = ddi_get_lbolt(); - DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); - arc_change_state(new_state, buf, hash_lock); + hdr->b_arc_access = ddi_get_lbolt(); + DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); + arc_change_state(new_state, hdr, hash_lock); ARCSTAT_BUMP(arcstat_mfu_ghost_hits); - } else if (buf->b_state == arc_l2c_only) { + } else if (hdr->b_state == arc_l2c_only) { /* * This buffer is on the 2nd Level ARC. */ - buf->b_arc_access = ddi_get_lbolt(); - DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); - arc_change_state(arc_mfu, buf, hash_lock); + hdr->b_arc_access = ddi_get_lbolt(); + DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); + arc_change_state(arc_mfu, hdr, hash_lock); } else { ASSERT(!"invalid arc state"); } @@ -2817,9 +2802,9 @@ arc_read_done(zio_t *zio) (found == hdr && HDR_L2_READING(hdr))); } - hdr->b_flags &= ~ARC_L2_EVICTED; - if (l2arc_noprefetch && (hdr->b_flags & ARC_PREFETCH)) - hdr->b_flags &= ~ARC_L2CACHE; + hdr->b_flags &= ~ARC_FLAG_L2_EVICTED; + if (l2arc_noprefetch && (hdr->b_flags & ARC_FLAG_PREFETCH)) + hdr->b_flags &= ~ARC_FLAG_L2CACHE; /* byteswap if necessary */ callback_list = hdr->b_acb; @@ -2859,18 +2844,18 @@ arc_read_done(zio_t *zio) } } hdr->b_acb = NULL; - hdr->b_flags &= ~ARC_IO_IN_PROGRESS; + hdr->b_flags &= ~ARC_FLAG_IO_IN_PROGRESS; ASSERT(!HDR_BUF_AVAILABLE(hdr)); if (abuf == buf) { ASSERT(buf->b_efunc == NULL); ASSERT(hdr->b_datacnt == 1); - hdr->b_flags |= ARC_BUF_AVAILABLE; + hdr->b_flags |= ARC_FLAG_BUF_AVAILABLE; } ASSERT(refcount_is_zero(&hdr->b_refcnt) || callback_list != NULL); if (zio->io_error != 0) { - hdr->b_flags |= ARC_IO_ERROR; + hdr->b_flags |= ARC_FLAG_IO_ERROR; if (hdr->b_state != arc_anon) arc_change_state(arc_anon, hdr, hash_lock); if (HDR_IN_HASH_TABLE(hdr)) @@ -2936,8 +2921,8 @@ arc_read_done(zio_t *zio) */ int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, - void *private, zio_priority_t priority, int zio_flags, uint32_t *arc_flags, - const zbookmark_phys_t *zb) + void *private, zio_priority_t priority, int zio_flags, + arc_flags_t *arc_flags, const zbookmark_phys_t *zb) { arc_buf_hdr_t *hdr = NULL; arc_buf_t *buf = NULL; @@ -2959,16 +2944,16 @@ top: if (hdr != NULL && hdr->b_datacnt > 0) { - *arc_flags |= ARC_CACHED; + *arc_flags |= ARC_FLAG_CACHED; if (HDR_IO_IN_PROGRESS(hdr)) { - if (*arc_flags & ARC_WAIT) { + if (*arc_flags & ARC_FLAG_WAIT) { cv_wait(&hdr->b_cv, hash_lock); mutex_exit(hash_lock); goto top; } - ASSERT(*arc_flags & ARC_NOWAIT); + ASSERT(*arc_flags & ARC_FLAG_NOWAIT); if (done) { arc_callback_t *acb = NULL; @@ -3006,24 +2991,24 @@ top: ASSERT(buf->b_data); if (HDR_BUF_AVAILABLE(hdr)) { ASSERT(buf->b_efunc == NULL); - hdr->b_flags &= ~ARC_BUF_AVAILABLE; + hdr->b_flags &= ~ARC_FLAG_BUF_AVAILABLE; } else { buf = arc_buf_clone(buf); } - } else if (*arc_flags & ARC_PREFETCH && + } else if (*arc_flags & ARC_FLAG_PREFETCH && refcount_count(&hdr->b_refcnt) == 0) { - hdr->b_flags |= ARC_PREFETCH; + hdr->b_flags |= ARC_FLAG_PREFETCH; } DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr); arc_access(hdr, hash_lock); - if (*arc_flags & ARC_L2CACHE) - hdr->b_flags |= ARC_L2CACHE; - if (*arc_flags & ARC_L2COMPRESS) - hdr->b_flags |= ARC_L2COMPRESS; + if (*arc_flags & ARC_FLAG_L2CACHE) + hdr->b_flags |= ARC_FLAG_L2CACHE; + if (*arc_flags & ARC_FLAG_L2COMPRESS) + hdr->b_flags |= ARC_FLAG_L2COMPRESS; mutex_exit(hash_lock); ARCSTAT_BUMP(arcstat_hits); - ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_PREFETCH), + ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_FLAG_PREFETCH), demand, prefetch, hdr->b_type != ARC_BUFC_METADATA, data, metadata, hits); @@ -3057,18 +3042,19 @@ top: (void) arc_buf_remove_ref(buf, private); goto top; /* restart the IO request */ } + /* if this is a prefetch, we don't have a reference */ - if (*arc_flags & ARC_PREFETCH) { + if (*arc_flags & ARC_FLAG_PREFETCH) { (void) remove_reference(hdr, hash_lock, private); - hdr->b_flags |= ARC_PREFETCH; + hdr->b_flags |= ARC_FLAG_PREFETCH; } - if (*arc_flags & ARC_L2CACHE) - hdr->b_flags |= ARC_L2CACHE; - if (*arc_flags & ARC_L2COMPRESS) - hdr->b_flags |= ARC_L2COMPRESS; + if (*arc_flags & ARC_FLAG_L2CACHE) + hdr->b_flags |= ARC_FLAG_L2CACHE; + if (*arc_flags & ARC_FLAG_L2COMPRESS) + hdr->b_flags |= ARC_FLAG_L2COMPRESS; if (BP_GET_LEVEL(bp) > 0) - hdr->b_flags |= ARC_INDIRECT; + hdr->b_flags |= ARC_FLAG_INDIRECT; } else { /* this block is in the ghost cache */ ASSERT(GHOST_STATE(hdr->b_state)); @@ -3077,14 +3063,14 @@ top: ASSERT(hdr->b_buf == NULL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 08:02:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 083715D2; Mon, 15 Dec 2014 08:02:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E8165688; Mon, 15 Dec 2014 08:02:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF82N3A022835; Mon, 15 Dec 2014 08:02:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF82Nvs022834; Mon, 15 Dec 2014 08:02:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412150802.sBF82Nvs022834@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Dec 2014 08:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275784 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:02:24 -0000 Author: delphij Date: Mon Dec 15 08:02:22 2014 New Revision: 275784 URL: https://svnweb.freebsd.org/changeset/base/275784 Log: 5427 memory leak in libzfs when doing rollback Reviewed by: Michael Tsymbalyuk Reviewed by: Steven Hartland Approved by: Dan McDonald Author: Jan Kryl illumos/illumos-gate@b7070b7dbcc2758a7f87cefb69ad42887a287152 Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Mon Dec 15 07:59:33 2014 (r275783) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Mon Dec 15 08:02:22 2014 (r275784) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #include @@ -186,9 +186,6 @@ zfs_iter_bookmarks(zfs_handle_t *zhp, zf fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATETXG)); fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATION)); - /* Allocate an nvlist to hold the bookmarks. */ - bmarks = fnvlist_alloc(); - if ((err = lzc_get_bookmarks(zhp->zfs_name, props, &bmarks)) != 0) goto out; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 08:26:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00C7E956; Mon, 15 Dec 2014 08:26:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E007F8AA; Mon, 15 Dec 2014 08:26:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF8QbrW033386; Mon, 15 Dec 2014 08:26:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8Qbte033385; Mon, 15 Dec 2014 08:26:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150826.sBF8Qbte033385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275785 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:26:38 -0000 Author: hselasky Date: Mon Dec 15 08:26:36 2014 New Revision: 275785 URL: https://svnweb.freebsd.org/changeset/base/275785 Log: MFC r275624: Add port routing support for Wildcat Point. PR: 195793 Modified: stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:02:22 2014 (r275784) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:26:36 2014 (r275785) @@ -249,6 +249,7 @@ xhci_pci_attach(device_t self) case 0x9c318086: /* Panther Point */ case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ + case 0x8cb18086: /* Wildcat Point */ sc->sc_port_route = &xhci_pci_port_route; sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; break; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 08:28:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1008AC6; Mon, 15 Dec 2014 08:28:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AC6798BD; Mon, 15 Dec 2014 08:28:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF8S1dh033681; Mon, 15 Dec 2014 08:28:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8S1Bc033679; Mon, 15 Dec 2014 08:28:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150828.sBF8S1Bc033679@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275786 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:28:01 -0000 Author: hselasky Date: Mon Dec 15 08:28:00 2014 New Revision: 275786 URL: https://svnweb.freebsd.org/changeset/base/275786 Log: MFC r275624: Add port routing support for Wildcat Point. PR: 195793 Modified: stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:26:36 2014 (r275785) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:28:00 2014 (r275786) @@ -233,6 +233,7 @@ xhci_pci_attach(device_t self) case 0x9c318086: /* Panther Point */ case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ + case 0x8cb18086: /* Wildcat Point */ sc->sc_port_route = &xhci_pci_port_route; sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; break; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 08:31:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B75ABC6F; Mon, 15 Dec 2014 08:31:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A2D02976; Mon, 15 Dec 2014 08:31:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF8VxTr037829; Mon, 15 Dec 2014 08:31:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8VxEx037828; Mon, 15 Dec 2014 08:31:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150831.sBF8VxEx037828@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r275787 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:31:59 -0000 Author: hselasky Date: Mon Dec 15 08:31:58 2014 New Revision: 275787 URL: https://svnweb.freebsd.org/changeset/base/275787 Log: MFC r275624: Add port routing support for Wildcat Point. PR: 195793 Modified: stable/8/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:28:00 2014 (r275786) +++ stable/8/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:31:58 2014 (r275787) @@ -231,6 +231,7 @@ xhci_pci_attach(device_t self) case 0x9c318086: /* Panther Point */ case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ + case 0x8cb18086: /* Wildcat Point */ sc->sc_port_route = &xhci_pci_port_route; sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; break; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 08:33:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75FAEDDF; Mon, 15 Dec 2014 08:33:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 474ED989; Mon, 15 Dec 2014 08:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF8Xt4f038189; Mon, 15 Dec 2014 08:33:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8XsWN038185; Mon, 15 Dec 2014 08:33:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150833.sBF8XsWN038185@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275788 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:33:55 -0000 Author: hselasky Date: Mon Dec 15 08:33:53 2014 New Revision: 275788 URL: https://svnweb.freebsd.org/changeset/base/275788 Log: MFC r275606: Add more U3G USB IDs. Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Mon Dec 15 08:31:58 2014 (r275787) +++ stable/9/sys/dev/usb/serial/u3g.c Mon Dec 15 08:33:53 2014 (r275788) @@ -400,7 +400,11 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMM2, GOBI2000_QDL, 0), U3G_DEV(QUALCOMM2, GOBI2000, 0), + U3G_DEV(QUALCOMM2, VT80N, 0), + U3G_DEV(QUALCOMM3, VFAST2, 0), U3G_DEV(QUALCOMMINC, AC2726, 0), + U3G_DEV(QUALCOMMINC, AC682_INIT, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, AC682, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GINIT_SCSIEJECT), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Dec 15 08:31:58 2014 (r275787) +++ stable/9/sys/dev/usb/usbdevs Mon Dec 15 08:33:53 2014 (r275788) @@ -695,6 +695,7 @@ vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor QUALCOMM3 0x19f5 Qualcomm, Inc. vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless @@ -3572,6 +3573,8 @@ product QUALCOMM2 VW110L 0x1000 Vertex W product QUALCOMM2 SIM5218 0x9000 SIM5218 product QUALCOMM2 GOBI2000_QDL 0x9204 Qualcomm Gobi 2000 QDL product QUALCOMM2 GOBI2000 0x9205 Qualcomm Gobi 2000 modem +product QUALCOMM2 VT80N 0x6500 Venus VT80N +product QUALCOMM3 VFAST2 0x9909 Venus Fast2 modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem @@ -3646,6 +3649,8 @@ product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem +product QUALCOMMINC AC682 0xffdd CDMA 1xEVDO USB modem +product QUALCOMMINC AC682_INIT 0xffde CDMA 1xEVDO USB modem (initial) product QUALCOMMINC AC8710 0xfff1 3G modem product QUALCOMMINC AC2726 0xfff5 3G modem product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 08:35:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21350FAF; Mon, 15 Dec 2014 08:35:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E67F899F; Mon, 15 Dec 2014 08:35:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF8Z8lb038466; Mon, 15 Dec 2014 08:35:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8Z8El038463; Mon, 15 Dec 2014 08:35:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150835.sBF8Z8El038463@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275789 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:35:09 -0000 Author: hselasky Date: Mon Dec 15 08:35:07 2014 New Revision: 275789 URL: https://svnweb.freebsd.org/changeset/base/275789 Log: MFC r275606: Add more U3G USB IDs. Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Mon Dec 15 08:33:53 2014 (r275788) +++ stable/10/sys/dev/usb/serial/u3g.c Mon Dec 15 08:35:07 2014 (r275789) @@ -399,7 +399,11 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMM2, GOBI2000_QDL, 0), U3G_DEV(QUALCOMM2, GOBI2000, 0), + U3G_DEV(QUALCOMM2, VT80N, 0), + U3G_DEV(QUALCOMM3, VFAST2, 0), U3G_DEV(QUALCOMMINC, AC2726, 0), + U3G_DEV(QUALCOMMINC, AC682_INIT, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, AC682, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GINIT_SCSIEJECT), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Mon Dec 15 08:33:53 2014 (r275788) +++ stable/10/sys/dev/usb/usbdevs Mon Dec 15 08:35:07 2014 (r275789) @@ -695,6 +695,7 @@ vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor QUALCOMM3 0x19f5 Qualcomm, Inc. vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless @@ -3572,6 +3573,8 @@ product QUALCOMM2 VW110L 0x1000 Vertex W product QUALCOMM2 SIM5218 0x9000 SIM5218 product QUALCOMM2 GOBI2000_QDL 0x9204 Qualcomm Gobi 2000 QDL product QUALCOMM2 GOBI2000 0x9205 Qualcomm Gobi 2000 modem +product QUALCOMM2 VT80N 0x6500 Venus VT80N +product QUALCOMM3 VFAST2 0x9909 Venus Fast2 modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem @@ -3646,6 +3649,8 @@ product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem +product QUALCOMMINC AC682 0xffdd CDMA 1xEVDO USB modem +product QUALCOMMINC AC682_INIT 0xffde CDMA 1xEVDO USB modem (initial) product QUALCOMMINC AC8710 0xfff1 3G modem product QUALCOMMINC AC2726 0xfff5 3G modem product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 09:23:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FC87C2F; Mon, 15 Dec 2014 09:23:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 61DEDE9B; Mon, 15 Dec 2014 09:23:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF9NfrB062341; Mon, 15 Dec 2014 09:23:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF9Ner4062339; Mon, 15 Dec 2014 09:23:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150923.sBF9Ner4062339@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 09:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275790 - in head/sys/dev/usb: net serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 09:23:41 -0000 Author: hselasky Date: Mon Dec 15 09:23:40 2014 New Revision: 275790 URL: https://svnweb.freebsd.org/changeset/base/275790 Log: Resolve USB driver identification conflict. Reported by: Anish Mistry MFC after: 1 week Modified: head/sys/dev/usb/net/if_urndis.c head/sys/dev/usb/serial/umodem.c Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Mon Dec 15 08:35:07 2014 (r275789) +++ head/sys/dev/usb/net/if_urndis.c Mon Dec 15 09:23:40 2014 (r275790) @@ -170,15 +170,15 @@ static const struct usb_ether_methods ur }; static const STRUCT_USB_HOST_ID urndis_host_devs[] = { -#if 0 - /* XXX this entry has a conflict an entry the umodem driver XXX */ - {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), - USB_IFACE_PROTOCOL(0xff)}, -#endif + /* Generic RNDIS class match */ {USB_IFACE_CLASS(UICLASS_WIRELESS), USB_IFACE_SUBCLASS(UISUBCLASS_RF), - USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, + USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(UISUBCLASS_SYNC), - USB_IFACE_PROTOCOL(UIPROTO_ACTIVESYNC)}, + USB_IFACE_PROTOCOL(UIPROTO_ACTIVESYNC)}, + /* HP-WebOS */ + {USB_VENDOR(USB_VENDOR_PALM), USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), + USB_IFACE_PROTOCOL(0xff)}, }; static int Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Mon Dec 15 08:35:07 2014 (r275789) +++ head/sys/dev/usb/serial/umodem.c Mon Dec 15 09:23:40 2014 (r275790) @@ -125,7 +125,7 @@ static const STRUCT_USB_HOST_ID umodem_d USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), USB_IFACE_PROTOCOL(UIPROTO_CDC_NONE)}, /* Huawei Modem class match */ - {USB_IFACE_CLASS(UICLASS_CDC), + {USB_VENDOR(USB_VENDOR_HUAWEI),USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), USB_IFACE_PROTOCOL(0xFF)}, /* Kyocera AH-K3001V */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 09:35:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8B0EF95; Mon, 15 Dec 2014 09:35:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C4D16FBD; Mon, 15 Dec 2014 09:35:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF9Zl0R067487; Mon, 15 Dec 2014 09:35:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF9Zlr1067486; Mon, 15 Dec 2014 09:35:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150935.sBF9Zlr1067486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 09:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275791 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 09:35:48 -0000 Author: hselasky Date: Mon Dec 15 09:35:46 2014 New Revision: 275791 URL: https://svnweb.freebsd.org/changeset/base/275791 Log: Regenerate usb.conf . MFC after: 1 week Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Mon Dec 15 09:23:40 2014 (r275790) +++ head/etc/devd/usb.conf Mon Dec 15 09:35:46 2014 (r275791) @@ -1017,7 +1017,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x056e"; - match "product" "(0x200c|0x4002|0x4005|0x400b|0x4010)"; + match "product" "(0x200c|0x4002|0x4005)"; + action "kldload -n if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "0x4008"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "(0x400b|0x4010)"; action "kldload -n if_aue"; }; @@ -1177,7 +1193,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05c6"; - match "product" "(0x1000|0x6000|0x6613|0x9000|0x9204|0x9205)"; + match "product" "(0x1000|0x6000|0x6500|0x6613|0x9000|0x9204|0x9205)"; action "kldload -n u3g"; }; @@ -2545,7 +2561,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8176|0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e)"; + match "product" "(0x8176|0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)"; action "kldload -n if_urtwn"; }; @@ -3617,7 +3633,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521)"; + match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14cf|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521|0x1526)"; action "kldload -n u3g"; }; @@ -4489,7 +4505,15 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x19d2"; - match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x1179|0x2000|0x2002|0x2003|0xfff1|0xfff5|0xfffe)"; + match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x1179|0x1181|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x19f5"; + match "product" "0x9909"; action "kldload -n u3g"; }; @@ -4609,7 +4633,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1cf1"; - match "product" "(0x0001|0x0004|0x0022)"; + match "product" "(0x0001|0x0004|0x001c|0x0022)"; action "kldload -n uftdi"; }; @@ -4697,7 +4721,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d|0x330f)"; + match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d|0x330f|0x3310)"; action "kldload -n if_urtwn"; }; @@ -4897,7 +4921,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x20f4"; - match "product" "(0x624d|0x648b)"; + match "product" "0x624d"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x20f4"; + match "product" "0x646b"; + action "kldload -n if_rsu"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x20f4"; + match "product" "0x648b"; action "kldload -n if_urtwn"; }; @@ -5294,6 +5334,16 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0830"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0xff"; + action "kldload -n if_urndis"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0a5c"; match "intclass" "0xff"; match "intsubclass" "0x01"; @@ -5305,6 +5355,16 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0xff"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; match "intclass" "0xff"; match "intsubclass" "0x02"; match "intprotocol" "0x16"; @@ -5352,15 +5412,6 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "intclass" "0x02"; - match "intsubclass" "0x02"; - match "intprotocol" "0xff"; - action "kldload -n umodem"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; match "intclass" "0x03"; match "intsubclass" "0x01"; match "intprotocol" "0x01"; @@ -5501,5 +5552,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2643 USB entries processed +# 2658 USB entries processed From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 09:40:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7507267; Mon, 15 Dec 2014 09:40:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B39AAFFA; Mon, 15 Dec 2014 09:40:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF9eQFU068193; Mon, 15 Dec 2014 09:40:26 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF9eQ3x068191; Mon, 15 Dec 2014 09:40:26 GMT (envelope-from br@FreeBSD.org) Message-Id: <201412150940.sBF9eQ3x068191@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 15 Dec 2014 09:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275792 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 09:40:26 -0000 Author: br Date: Mon Dec 15 09:40:25 2014 New Revision: 275792 URL: https://svnweb.freebsd.org/changeset/base/275792 Log: Eliminate fdt_data_verify(). The verification it proceed is wrong disallowing us to encode 64-bit register numbers. Discussed with: nwhitehorn, andrew Modified: head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Mon Dec 15 09:35:46 2014 (r275791) +++ head/sys/dev/fdt/fdt_common.c Mon Dec 15 09:40:25 2014 (r275792) @@ -102,10 +102,9 @@ fdt_get_range_by_busaddr(phandle_t node, tuple_size = addr_cells + par_addr_cells + size_cells; tuples = len / (tuple_size * sizeof(cell_t)); - if (fdt_ranges_verify(ranges, tuples, par_addr_cells, - addr_cells, size_cells)) { + if (par_addr_cells > 2 || addr_cells > 2 || size_cells > 2) return (ERANGE); - } + *base = 0; *size = 0; @@ -173,10 +172,9 @@ fdt_get_range(phandle_t node, int range_ size_cells); tuples = len / tuple_size; - if (fdt_ranges_verify(ranges, tuples, par_addr_cells, - addr_cells, size_cells)) { + if (par_addr_cells > 2 || addr_cells > 2 || size_cells > 2) return (ERANGE); - } + *base = 0; *size = 0; rangesptr = &ranges[range_id]; @@ -381,20 +379,6 @@ fdt_parent_addr_cells(phandle_t node) } int -fdt_data_verify(void *data, int cells) -{ - uint64_t d64; - - if (cells > 1) { - d64 = fdt64_to_cpu(*((uint64_t *)data)); - if (((d64 >> 32) & 0xffffffffull) != 0 || cells > 2) - return (ERANGE); - } - - return (0); -} - -int fdt_pm_is_enabled(phandle_t node) { int ret; @@ -441,61 +425,19 @@ fdt_addrsize_cells(phandle_t node, int * } int -fdt_ranges_verify(pcell_t *ranges, int tuples, int par_addr_cells, - int this_addr_cells, int this_size_cells) -{ - int i, rv, ulsz; - - if (par_addr_cells > 2 || this_addr_cells > 2 || this_size_cells > 2) - return (ERANGE); - - /* - * This is the max size the resource manager can handle for addresses - * and sizes. - */ - ulsz = sizeof(u_long); - if (par_addr_cells <= ulsz && this_addr_cells <= ulsz && - this_size_cells <= ulsz) - /* We can handle everything */ - return (0); - - rv = 0; - for (i = 0; i < tuples; i++) { - - if (fdt_data_verify((void *)ranges, par_addr_cells)) - goto err; - ranges += par_addr_cells; - - if (fdt_data_verify((void *)ranges, this_addr_cells)) - goto err; - ranges += this_addr_cells; - - if (fdt_data_verify((void *)ranges, this_size_cells)) - goto err; - ranges += this_size_cells; - } - - return (0); - -err: - debugf("using address range >%d-bit not supported\n", ulsz * 8); - return (ERANGE); -} - -int fdt_data_to_res(pcell_t *data, int addr_cells, int size_cells, u_long *start, u_long *count) { /* Address portion. */ - if (fdt_data_verify((void *)data, addr_cells)) + if (addr_cells > 2) return (ERANGE); *start = fdt_data_get((void *)data, addr_cells); data += addr_cells; /* Size portion. */ - if (fdt_data_verify((void *)data, size_cells)) + if (size_cells > 2) return (ERANGE); *count = fdt_data_get((void *)data, size_cells); Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Mon Dec 15 09:35:46 2014 (r275791) +++ head/sys/dev/fdt/fdt_common.h Mon Dec 15 09:40:25 2014 (r275792) @@ -79,7 +79,6 @@ extern u_char fdt_static_dtb; int fdt_addrsize_cells(phandle_t, int *, int *); u_long fdt_data_get(void *, int); int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *); -int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); phandle_t fdt_depth_search_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); @@ -94,7 +93,6 @@ int fdt_is_enabled(phandle_t); int fdt_pm_is_enabled(phandle_t); int fdt_is_type(phandle_t, const char *); int fdt_parent_addr_cells(phandle_t); -int fdt_ranges_verify(pcell_t *, int, int, int, int); int fdt_reg_to_rl(phandle_t, struct resource_list *); int fdt_pm(phandle_t); int fdt_get_unit(device_t); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 10:29:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69748B5C; Mon, 15 Dec 2014 10:29:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3B3927F5; Mon, 15 Dec 2014 10:29:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFAT3pL091730; Mon, 15 Dec 2014 10:29:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFAT3Ng091729; Mon, 15 Dec 2014 10:29:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151029.sBFAT3Ng091729@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 10:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275793 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 10:29:03 -0000 Author: kib Date: Mon Dec 15 10:29:02 2014 New Revision: 275793 URL: https://svnweb.freebsd.org/changeset/base/275793 Log: MFC r275615: When process is exiting, check for suspension regardless of multithreaded status of the process. Modified: stable/10/sys/kern/kern_exit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_exit.c ============================================================================== --- stable/10/sys/kern/kern_exit.c Mon Dec 15 09:40:25 2014 (r275792) +++ stable/10/sys/kern/kern_exit.c Mon Dec 15 10:29:02 2014 (r275793) @@ -183,14 +183,15 @@ exit1(struct thread *td, int rv) * MUST abort all other threads before proceeding past here. */ PROC_LOCK(p); + /* + * First check if some other thread or external request got + * here before us. If so, act appropriately: exit or suspend. + * We must ensure that stop requests are handled before we set + * P_WEXIT. + */ + thread_suspend_check(0); while (p->p_flag & P_HADTHREADS) { /* - * First check if some other thread got here before us. - * If so, act appropriately: exit or suspend. - */ - thread_suspend_check(0); - - /* * Kill off the other threads. This requires * some co-operation from other parts of the kernel * so it may not be instantaneous. With this state set @@ -208,12 +209,18 @@ exit1(struct thread *td, int rv) * either be suspended there or exit. */ if (!thread_single(SINGLE_EXIT)) + /* + * All other activity in this process is now + * stopped. Threading support has been turned + * off. + */ break; - /* - * All other activity in this process is now stopped. - * Threading support has been turned off. + * Recheck for new stop or suspend requests which + * might appear while process lock was dropped in + * thread_single(). */ + thread_suspend_check(0); } KASSERT(p->p_numthreads == 1, ("exit1: proc %p exiting with %d threads", p, p->p_numthreads)); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 10:46:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A69BFC3; Mon, 15 Dec 2014 10:46:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 756B69D4; Mon, 15 Dec 2014 10:46:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFAk9Pn001116; Mon, 15 Dec 2014 10:46:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFAk8dr001107; Mon, 15 Dec 2014 10:46:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151046.sBFAk8dr001107@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 10:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275794 - in stable/10/sys: kern powerpc/aim powerpc/booke sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 10:46:09 -0000 Author: kib Date: Mon Dec 15 10:46:07 2014 New Revision: 275794 URL: https://svnweb.freebsd.org/changeset/base/275794 Log: MFC r275616: Thread waiting for the vfork(2)-ed child to exec or exit, must allow for the suspension. MFC r275683 (by andreast): Fix build for powerpc(32|64) kernels. MFC r275686 (by andreast): Fix kernel build for booke. r275639 (by andrew) is not merged, since arm/arm/syscall.c is not present on the stable/10 branch, and arm/arm/trap.c already includes sys/kernel.h. Modified: stable/10/sys/kern/kern_thread.c stable/10/sys/kern/subr_syscall.c stable/10/sys/powerpc/aim/trap.c stable/10/sys/powerpc/booke/trap.c stable/10/sys/sys/proc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/kern/kern_thread.c Mon Dec 15 10:46:07 2014 (r275794) @@ -724,6 +724,19 @@ stopme: return (0); } +bool +thread_suspend_check_needed(void) +{ + struct proc *p; + struct thread *td; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + return (P_SHOULDSTOP(p) || ((p->p_flag & P_TRACED) != 0 && + (td->td_dbgflags & TDB_SUSPEND) != 0)); +} + /* * Called in from locations that can safely check to see * whether we have to suspend or at least throttle for a @@ -768,8 +781,7 @@ thread_suspend_check(int return_instead) p = td->td_proc; mtx_assert(&Giant, MA_NOTOWNED); PROC_LOCK_ASSERT(p, MA_OWNED); - while (P_SHOULDSTOP(p) || - ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) { + while (thread_suspend_check_needed()) { if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { KASSERT(p->p_singlethread != NULL, ("singlethread not set")); Modified: stable/10/sys/kern/subr_syscall.c ============================================================================== --- stable/10/sys/kern/subr_syscall.c Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/kern/subr_syscall.c Mon Dec 15 10:46:07 2014 (r275794) @@ -227,9 +227,20 @@ syscallret(struct thread *td, int error, */ td->td_pflags &= ~TDP_RFPPWAIT; p2 = td->td_rfppwait_p; +again: PROC_LOCK(p2); - while (p2->p_flag & P_PPWAIT) - cv_wait(&p2->p_pwait, &p2->p_mtx); + while (p2->p_flag & P_PPWAIT) { + PROC_LOCK(p); + if (thread_suspend_check_needed()) { + PROC_UNLOCK(p2); + thread_suspend_check(0); + PROC_UNLOCK(p); + goto again; + } else { + PROC_UNLOCK(p); + } + cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); + } PROC_UNLOCK(p2); } } Modified: stable/10/sys/powerpc/aim/trap.c ============================================================================== --- stable/10/sys/powerpc/aim/trap.c Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/powerpc/aim/trap.c Mon Dec 15 10:46:07 2014 (r275794) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/10/sys/powerpc/booke/trap.c ============================================================================== --- stable/10/sys/powerpc/booke/trap.c Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/powerpc/booke/trap.c Mon Dec 15 10:46:07 2014 (r275794) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/sys/proc.h Mon Dec 15 10:46:07 2014 (r275794) @@ -947,6 +947,7 @@ void childproc_stopped(struct proc *chil void childproc_continued(struct proc *child); void childproc_exited(struct proc *child); int thread_suspend_check(int how); +bool thread_suspend_check_needed(void); void thread_suspend_switch(struct thread *); void thread_suspend_one(struct thread *td); void thread_unlink(struct thread *td); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 10:50:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D7BF1CA; Mon, 15 Dec 2014 10:50:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 099DB9FF; Mon, 15 Dec 2014 10:50:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFAoRWb001876; Mon, 15 Dec 2014 10:50:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFAoR74001875; Mon, 15 Dec 2014 10:50:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151050.sBFAoR74001875@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 10:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275795 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 10:50:28 -0000 Author: kib Date: Mon Dec 15 10:50:26 2014 New Revision: 275795 URL: https://svnweb.freebsd.org/changeset/base/275795 Log: MFC r275617: Do some refactoring and minor cleanups of the thread_single() code. Modified: stable/10/sys/kern/kern_thread.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Mon Dec 15 10:46:07 2014 (r275794) +++ stable/10/sys/kern/kern_thread.c Mon Dec 15 10:50:26 2014 (r275795) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DECLARE(proc); SDT_PROBE_DEFINE(proc, , , lwp__exit); - /* * thread related storage. */ @@ -583,6 +582,46 @@ calc_remaining(struct proc *p, int mode) return (remaining); } +static int +remain_for_mode(int mode) +{ + + return (1); +} + +static int +weed_inhib(int mode, struct thread *td2, struct proc *p) +{ + int wakeup_swapper; + + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); + THREAD_LOCK_ASSERT(td2, MA_OWNED); + + wakeup_swapper = 0; + switch (mode) { + case SINGLE_EXIT: + if (TD_IS_SUSPENDED(td2)) + wakeup_swapper |= thread_unsuspend_one(td2); + if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) + wakeup_swapper |= sleepq_abort(td2, EINTR); + break; + case SINGLE_BOUNDARY: + if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) + wakeup_swapper |= thread_unsuspend_one(td2); + if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) + wakeup_swapper |= sleepq_abort(td2, ERESTART); + break; + case SINGLE_NO_EXIT: + if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) + wakeup_swapper |= thread_unsuspend_one(td2); + if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) + wakeup_swapper |= sleepq_abort(td2, ERESTART); + break; + } + return (wakeup_swapper); +} + /* * Enforce single-threading. * @@ -630,7 +669,7 @@ thread_single(int mode) PROC_SLOCK(p); p->p_singlethread = td; remaining = calc_remaining(p, mode); - while (remaining != 1) { + while (remaining != remain_for_mode(mode)) { if (P_SHOULDSTOP(p) != P_STOPPED_SINGLE) goto stopme; wakeup_swapper = 0; @@ -639,41 +678,8 @@ thread_single(int mode) continue; thread_lock(td2); td2->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; - if (TD_IS_INHIBITED(td2)) { - switch (mode) { - case SINGLE_EXIT: - if (TD_IS_SUSPENDED(td2)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2) && - (td2->td_flags & TDF_SINTR)) - wakeup_swapper |= - sleepq_abort(td2, EINTR); - break; - case SINGLE_BOUNDARY: - if (TD_IS_SUSPENDED(td2) && - !(td2->td_flags & TDF_BOUNDARY)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2) && - (td2->td_flags & TDF_SINTR)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); - break; - case SINGLE_NO_EXIT: - if (TD_IS_SUSPENDED(td2) && - !(td2->td_flags & TDF_BOUNDARY)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2) && - (td2->td_flags & TDF_SINTR)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); - break; - default: - break; - } - } + if (TD_IS_INHIBITED(td2)) + wakeup_swapper |= weed_inhib(mode, td2, p); #ifdef SMP else if (TD_IS_RUNNING(td2) && td != td2) { forward_signal(td2); @@ -688,7 +694,7 @@ thread_single(int mode) /* * Maybe we suspended some threads.. was it enough? */ - if (remaining == 1) + if (remaining == remain_for_mode(mode)) break; stopme: @@ -967,8 +973,7 @@ thread_single_end(void) struct proc *p; int wakeup_swapper; - td = curthread; - p = td->td_proc; + p = curproc; PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT | P_SINGLE_BOUNDARY); PROC_SLOCK(p); @@ -980,7 +985,8 @@ thread_single_end(void) * on the process. The single threader must be allowed * to continue however as this is a bad place to stop. */ - if ((p->p_numthreads != 1) && (!P_SHOULDSTOP(p))) { + if (p->p_numthreads != remain_for_mode(SINGLE_EXIT) && + !P_SHOULDSTOP(p)) { FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); if (TD_IS_SUSPENDED(td)) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 10:58:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FE213E6; Mon, 15 Dec 2014 10:58:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6C024ADD; Mon, 15 Dec 2014 10:58:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFAw34T006282; Mon, 15 Dec 2014 10:58:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFAw3rY006281; Mon, 15 Dec 2014 10:58:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151058.sBFAw3rY006281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 10:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275796 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 10:58:03 -0000 Author: kib Date: Mon Dec 15 10:58:02 2014 New Revision: 275796 URL: https://svnweb.freebsd.org/changeset/base/275796 Log: MFC r275618: Check for stop condition in nfsd threads. Modified: stable/10/sys/rpc/svc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc.c ============================================================================== --- stable/10/sys/rpc/svc.c Mon Dec 15 10:50:26 2014 (r275795) +++ stable/10/sys/rpc/svc.c Mon Dec 15 10:58:02 2014 (r275796) @@ -1101,6 +1101,7 @@ svc_run_internal(SVCGROUP *grp, bool_t i SVCXPRT *xprt; enum xprt_stat stat; struct svc_req *rqstp; + struct proc *p; size_t sz; int error; @@ -1183,11 +1184,22 @@ svc_run_internal(SVCGROUP *grp, bool_t i > grp->sg_minthreads) && !st->st_xprt) break; - } else if (error) { + } else if (error != 0) { + KASSERT(error == EINTR || error == ERESTART, + ("non-signal error %d", error)); mtx_unlock(&grp->sg_lock); - svc_exit(pool); - mtx_lock(&grp->sg_lock); - break; + p = curproc; + PROC_LOCK(p); + if (P_SHOULDSTOP(p)) { + thread_suspend_check(0); + PROC_UNLOCK(p); + mtx_lock(&grp->sg_lock); + } else { + PROC_UNLOCK(p); + svc_exit(pool); + mtx_lock(&grp->sg_lock); + break; + } } continue; } From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 11:00:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 577DA557; Mon, 15 Dec 2014 11:00:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 438DAAFD; Mon, 15 Dec 2014 11:00:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFB0v4C006870; Mon, 15 Dec 2014 11:00:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFB0vA3006869; Mon, 15 Dec 2014 11:00:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151100.sBFB0vA3006869@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 11:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275797 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 11:00:57 -0000 Author: kib Date: Mon Dec 15 11:00:56 2014 New Revision: 275797 URL: https://svnweb.freebsd.org/changeset/base/275797 Log: MFC r275619: Check for bo_bufobj->bo_object for NULL and cache the value in local variable to avoid NULL dereference in getnewbuf_reuse_bp(). The vnode owning the buffer is not locked there. Modified: stable/10/sys/kern/vfs_bio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Mon Dec 15 10:58:02 2014 (r275796) +++ stable/10/sys/kern/vfs_bio.c Mon Dec 15 11:00:56 2014 (r275797) @@ -1852,15 +1852,18 @@ out: static void vfs_vmio_release(struct buf *bp) { - int i; + vm_object_t obj; vm_page_t m; + int i; if ((bp->b_flags & B_UNMAPPED) == 0) { BUF_CHECK_MAPPED(bp); pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages); } else BUF_CHECK_UNMAPPED(bp); - VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); + obj = bp->b_bufobj->bo_object; + if (obj != NULL) + VM_OBJECT_WLOCK(obj); for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; bp->b_pages[i] = NULL; @@ -1885,7 +1888,8 @@ vfs_vmio_release(struct buf *bp) vm_page_try_to_cache(m); vm_page_unlock(m); } - VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); + if (obj != NULL) + VM_OBJECT_WUNLOCK(obj); if (bp->b_bufsize) { bufspacewakeup(); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 11:05:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E15CB6D2; Mon, 15 Dec 2014 11:05:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B3916BB7; Mon, 15 Dec 2014 11:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFB5sHi010960; Mon, 15 Dec 2014 11:05:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFB5sXX010958; Mon, 15 Dec 2014 11:05:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151105.sBFB5sXX010958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 11:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275798 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 11:05:55 -0000 Author: kib Date: Mon Dec 15 11:05:53 2014 New Revision: 275798 URL: https://svnweb.freebsd.org/changeset/base/275798 Log: MFC r275620: Add functions syncer_suspend() and syncer_resume(). MFC r275637: Remove local variable for real. Modified: stable/10/sys/kern/vfs_subr.c stable/10/sys/sys/mount.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon Dec 15 11:00:56 2014 (r275797) +++ stable/10/sys/kern/vfs_subr.c Mon Dec 15 11:05:53 2014 (r275798) @@ -1773,6 +1773,8 @@ sync_vnode(struct synclist *slp, struct return (0); } +static int first_printf = 1; + /* * System filesystem synchronizer daemon. */ @@ -1786,12 +1788,10 @@ sched_sync(void) int last_work_seen; int net_worklist_len; int syncer_final_iter; - int first_printf; int error; last_work_seen = 0; syncer_final_iter = 0; - first_printf = 1; syncer_state = SYNCER_RUNNING; starttime = time_uptime; td->td_pflags |= TDP_NORUNNINGBUF; @@ -1948,6 +1948,25 @@ syncer_shutdown(void *arg, int howto) kproc_shutdown(arg, howto); } +void +syncer_suspend(void) +{ + + syncer_shutdown(updateproc, 0); +} + +void +syncer_resume(void) +{ + + mtx_lock(&sync_mtx); + first_printf = 1; + syncer_state = SYNCER_RUNNING; + mtx_unlock(&sync_mtx); + cv_broadcast(&sync_wakeup); + kproc_resume(updateproc); +} + /* * Reassign a buffer from one vnode to another. * Used to assign file specific control information Modified: stable/10/sys/sys/mount.h ============================================================================== --- stable/10/sys/sys/mount.h Mon Dec 15 11:00:56 2014 (r275797) +++ stable/10/sys/sys/mount.h Mon Dec 15 11:05:53 2014 (r275798) @@ -919,6 +919,9 @@ vfs_uninit_t vfs_stduninit; vfs_extattrctl_t vfs_stdextattrctl; vfs_sysctl_t vfs_stdsysctl; +void syncer_suspend(void); +void syncer_resume(void); + #else /* !_KERNEL */ #include From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 11:57:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7CE5F61; Mon, 15 Dec 2014 11:57:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A42CA109; Mon, 15 Dec 2014 11:57:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFBve1S035215; Mon, 15 Dec 2014 11:57:40 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFBvejt035212; Mon, 15 Dec 2014 11:57:40 GMT (envelope-from br@FreeBSD.org) Message-Id: <201412151157.sBFBvejt035212@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 15 Dec 2014 11:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275799 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 11:57:40 -0000 Author: br Date: Mon Dec 15 11:57:39 2014 New Revision: 275799 URL: https://svnweb.freebsd.org/changeset/base/275799 Log: Follow r275792 eliminating fdt_data_verify(). Modified: head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Mon Dec 15 11:05:53 2014 (r275798) +++ head/sys/arm/mv/mv_common.c Mon Dec 15 11:57:39 2014 (r275799) @@ -1939,8 +1939,7 @@ fdt_get_ranges(const char *nodename, voi if (tuples_count <= 0) return (ERANGE); - if (fdt_ranges_verify(buf, tuples_count, par_addr_cells, - addr_cells, size_cells) != 0) + if (par_addr_cells > 2 || addr_cells > 2 || size_cells > 2) return (ERANGE); *tuples = tuples_count; Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Mon Dec 15 11:05:53 2014 (r275798) +++ head/sys/arm/mv/mv_pci.c Mon Dec 15 11:57:39 2014 (r275799) @@ -180,8 +180,7 @@ mv_pci_ranges_decode(phandle_t node, str rangesptr += offset_cells; } - if (fdt_data_verify((void *)rangesptr, par_addr_cells - - offset_cells)) { + if ((par_addr_cells - offset_cells) > 2) { rv = ERANGE; goto out; } @@ -189,7 +188,7 @@ mv_pci_ranges_decode(phandle_t node, str par_addr_cells - offset_cells); rangesptr += par_addr_cells - offset_cells; - if (fdt_data_verify((void *)rangesptr, size_cells)) { + if (size_cells > 2) rv = ERANGE; goto out; } From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 12:01:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C101375; Mon, 15 Dec 2014 12:01:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 65E5F1EA; Mon, 15 Dec 2014 12:01:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFC1js3039356; Mon, 15 Dec 2014 12:01:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFC1hDH039340; Mon, 15 Dec 2014 12:01:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151201.sBFC1hDH039340@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 12:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275800 - in head: lib/libc/sys sys/compat/freebsd32 sys/conf 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 12:01:45 -0000 Author: kib Date: Mon Dec 15 12:01:42 2014 New Revision: 275800 URL: https://svnweb.freebsd.org/changeset/base/275800 Log: Add a facility for non-init process to declare itself the reaper of the orphaned descendants. Base of the API is modelled after the same feature from the DragonFlyBSD. Requested by: bapt Reviewed by: jilles (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Added: head/sys/kern/kern_procctl.c - copied, changed from r275798, head/sys/kern/sys_process.c Modified: head/lib/libc/sys/procctl.2 head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/conf/files head/sys/kern/init_main.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/sys_process.c head/sys/sys/proc.h head/sys/sys/procctl.h Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Mon Dec 15 11:57:39 2014 (r275799) +++ head/lib/libc/sys/procctl.2 Mon Dec 15 12:01:42 2014 (r275800) @@ -2,6 +2,10 @@ .\" Written by: John H. Baldwin .\" All rights reserved. .\" +.\" Copyright (c) 2014 The FreeBSD Foundation +.\" Portions of this documentation were written 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: @@ -25,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2013 +.Dd December 15, 2014 .Dt PROCCTL 2 .Os .Sh NAME @@ -67,7 +71,7 @@ The control request to perform is specif .Fa cmd argument. The following commands are supported: -.Bl -tag -width "Dv PROC_SPROTECT" +.Bl -tag -width "Dv PROC_REAP_GETPIDS" .It Dv PROC_SPROTECT Set process protection state. This is used to mark a process as protected from being killed if the system @@ -95,6 +99,174 @@ When used with mark all future child processes of each selected process as protected. Future child processes will also mark all of their future child processes. .El +.It Dv PROC_REAP_ACQUIRE +Acquires the reaper status for the current process. +The status means that orphaned children by the reaper descendants, +forked after the acquisition of the status, are reparented to the +reaper. +After the system initialization, +.Xr init 8 +is the default reaper. +.Pp +.It Dv PROC_REAP_RELEASE +Releases the reaper state fpr the current process. +The reaper of the current process becomes the new reaper of the +current process descendants. +.It Dv PROC_REAP_STATUS +Provides the information about the reaper of the specified process, +or the process itself, in case it is a reaper. +The +.Fa data +argument must point to the +.Vt "struct procctl_reaper_status" , +which if filled by the syscall on successfull return. +.Bd -literal +struct procctl_reaper_status { + u_int rs_flags; + u_int rs_children; + u_int rs_descendants; + pid_t rs_reaper; + pid_t rs_pid; +}; +.Ed +The +.Fa rs_flags +may have the following flags returned: +.Bl -tag -width "Dv REAPER_STATUS_REALINIT" +.It Dv REAPER_STATUS_OWNED +The specified process has acquired the reaper status and did not +released it. +When the flag is returned, the +.Fa id +pid identifies reaper, otherwise the +.Fa rs_reaper +field of the structure is the pid of the reaper for passed process id. +.It Dv REAPER_STATUS_REALINIT +The specified process is the root of the reaper tree, i.e. +.Xr init 8. +.El +The +.Fa rs_children +returns the number of the children of the reaper. +The +.Fa rs_descendants +returns the total number of descendants of the reaper, +not counting descendants of the reapers in the subtree. +The +.Fa rs_reaper +returns the reaper pid. +The +.Fa rs_pid +returns pid of some reaper child if there is any descendant. +.It Dv PROC_REAP_GETPIDS +Queries the list of descendants of the reaper of the specified process. +The request takes the pointer to +.Vt "struct procctl_reaper_pids" +as +.Fa data . +.Bd -literal +struct procctl_reaper_pids { + u_int rp_count; + struct procctl_reaper_pidinfo *rp_pids; +}; +.Ed +On call, the +.Fa rp_pids +must point to the array of +.Vt procctl_reaper_pidinfo +structures, to be filled on return, +and the +.Fa rp_count +must specify the size of the array, +no more than rp_count elements is filled by kernel. +.Pp +The +.Vt "struct procctl_reaper_pidinfo" +structure provides some information about one reaper' descendant. +Note that for the descendant which is not child, it is the subject +of usual race with process exiting and pid reuse. +.Bd -literal +struct procctl_reaper_pidinfo { + pid_t pi_pid; + pid_t pi_subtree; + u_int pi_flags; +}; +.Ed +The +.Fa pi_pid +is the process id of the descendant. +The +.Fa pi_subtree +provides the pid of the child of the reaper, which is (grand-)parent +of the process. +The +.Fa pi_flags +returns the following flags, further describing the descendant: +.Bl -tag -width "Dv REAPER_PIDINFO_VALID" +.It Dv REAPER_PIDINFO_VALID +Set for the +.Vt procctl_reaper_pidinfo +structure, which was filled by kernel. +Zero-filling the +.Fa rp_pids +array and testing the flag allows the caller to detect the end +of returned array. +.It Dv REAPER_PIDINFO_CHILD +The +.Fa pi_pid +is the direct child of the reaper. +.El +.It Dv PROC_REAP_KILL +Request to deliver a signal to some subset of descendants of the reaper. +The +.Fa data +must point to +.Vt procctl_reaper_kill +structure, which is used both for parameters and status return. +.Bd -literal +struct procctl_reaper_kill { + int rk_sig; + u_int rk_flags; + pid_t rk_subtree; + u_int rk_killed; + pid_t rk_fpid; +}; +.Ed +The +.Fa rk_sig +specifies the signal to be delivered. +Zero is not a valid signal number, unlike +.Xr kill 2 . +The +.Fa rk_flags +further directs the operation. +It is or-ed from the following flags: +.Bl -tag -width "Dv REAPER_KILL_CHILDREN" +.It Dv REAPER_KILL_CHILDREN +Deliver the specified signal only to direct children of the reaper. +.It Dv REAPER_KILL_SUBTREE +Deliver the specified signal only to descendants which were forked by +the direct child with pid specified in +.Fa rk_subtree . +.El +If no +.Dv REAPER_KILL_CHILDREN +and +.Dv REAPER_KILL_SUBTREE +flags are specified, all current descendants of the reaper are signalled. +.Pp +If signal was delivered to any process, the return value from the request +is zero. +In this case, +.Fa rk_killed +field is filled with the count of processes signalled. +The +.Fa rk_fpid +field is set to the pid of the first process for which signal +delivery failed, e.g. due to the permission problems. +If no such process exist, the +.Fa rk_fpid +is set to -1. .El .Sh RETURN VALUES If an error occurs, a value of -1 is returned and @@ -132,11 +304,48 @@ An invalid operation or flag was passed for a .Dv PROC_SPROTECT command. +.It Bq Er EPERM +The +.Fa idtype +argument is not equal to +.Dv P_PID , +or +.Fa id +is not equal to the pid of the calling process, for +.Dv PROC_REAP_ACQUIRE +or +.Dv PROC_REAP_RELEASE +requests. +.It Bq Er EINVAL +Invalid or undefined flags were passed to +.Dv PROC_REAP_KILL +request. +.It Bq Er EINVAL +Invalid or zero signal number was requested for +.Dv PROC_REAP_KILL +request. +.It Bq Er EINVAL +The +.Dv PROC_REAP_RELEASE +request was issued by the +.Xr init 8 +process. +.It Bq Er EBUSY +The +.Dv PROC_REAP_ACQUIRE +request was issued by the process which already acquired reaper status +and did not released it. .El .Sh SEE ALSO -.Xr ptrace 2 +.Xr kill 2 , +.Xr ptrace 2 , +.Xr wait 2 , +.Xr init 8 .Sh HISTORY The .Fn procctl function appeared in .Fx 10.0 . +Reaper facility was created based on the similar feature of Linux and +DragonflyBSD, and first appeared in +.Fx 10.2 . Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Mon Dec 15 11:57:39 2014 (r275799) +++ head/sys/compat/freebsd32/freebsd32.h Mon Dec 15 12:01:42 2014 (r275800) @@ -390,4 +390,10 @@ struct kld32_file_stat { char pathname[MAXPATHLEN]; }; +struct procctl_reaper_pids32 { + u_int rp_count; + u_int rp_pad0[15]; + uint32_t rp_pids; +}; + #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */ Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Dec 15 11:57:39 2014 (r275799) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Dec 15 12:01:42 2014 (r275800) @@ -2957,20 +2957,63 @@ int freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) { void *data; - int error, flags; + union { + struct procctl_reaper_status rs; + struct procctl_reaper_pids rp; + struct procctl_reaper_kill rk; + } x; + union { + struct procctl_reaper_pids32 rp; + } x32; + int error, error1, flags; switch (uap->com) { case PROC_SPROTECT: error = copyin(PTRIN(uap->data), &flags, sizeof(flags)); - if (error) + if (error != 0) return (error); data = &flags; break; + case PROC_REAP_ACQUIRE: + case PROC_REAP_RELEASE: + if (uap->data != NULL) + return (EINVAL); + data = NULL; + break; + case PROC_REAP_STATUS: + data = &x.rs; + break; + case PROC_REAP_GETPIDS: + error = copyin(uap->data, &x32.rp, sizeof(x32.rp)); + if (error != 0) + return (error); + CP(x32.rp, x.rp, rp_count); + PTRIN_CP(x32.rp, x.rp, rp_pids); + data = &x.rp; + break; + case PROC_REAP_KILL: + error = copyin(uap->data, &x.rk, sizeof(x.rk)); + if (error != 0) + return (error); + data = &x.rk; + break; default: return (EINVAL); } - return (kern_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id), - uap->com, data)); + error = kern_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id), + uap->com, data); + switch (uap->com) { + case PROC_REAP_STATUS: + if (error == 0) + error = copyout(&x.rs, uap->data, sizeof(x.rs)); + break; + case PROC_REAP_KILL: + error1 = copyout(&x.rk, uap->data, sizeof(x.rk)); + if (error == 0) + error = error1; + break; + } + return (error); } int Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Dec 15 11:57:39 2014 (r275799) +++ head/sys/conf/files Mon Dec 15 12:01:42 2014 (r275800) @@ -2987,6 +2987,7 @@ kern/kern_pmc.c standard kern/kern_poll.c optional device_polling kern/kern_priv.c standard kern/kern_proc.c standard +kern/kern_procctl.c standard kern/kern_prot.c standard kern/kern_racct.c standard kern/kern_rangelock.c standard Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Mon Dec 15 11:57:39 2014 (r275799) +++ head/sys/kern/init_main.c Mon Dec 15 12:01:42 2014 (r275800) @@ -496,7 +496,8 @@ proc0_init(void *dummy __unused) prison0.pr_cpuset = cpuset_ref(td->td_cpuset); p->p_peers = 0; p->p_leader = p; - + p->p_reaper = p; + LIST_INIT(&p->p_reaplist); strncpy(p->p_comm, "kernel", sizeof (p->p_comm)); strncpy(td->td_name, "swapper", sizeof (td->td_name)); @@ -821,8 +822,11 @@ create_init(const void *udata __unused) KASSERT(initproc->p_pid == 1, ("create_init: initproc->p_pid != 1")); /* divorce init's credentials from the kernel's */ newcred = crget(); + sx_xlock(&proctree_lock); PROC_LOCK(initproc); initproc->p_flag |= P_SYSTEM | P_INMEM; + initproc->p_treeflag |= P_TREE_REAPER; + LIST_INSERT_HEAD(&initproc->p_reaplist, &proc0, p_reapsibling); oldcred = initproc->p_ucred; crcopy(newcred, oldcred); #ifdef MAC @@ -833,6 +837,7 @@ create_init(const void *udata __unused) #endif initproc->p_ucred = newcred; PROC_UNLOCK(initproc); + sx_xunlock(&proctree_lock); crfree(oldcred); cred_update_thread(FIRST_THREAD_IN_PROC(initproc)); cpu_set_fork_handler(FIRST_THREAD_IN_PROC(initproc), start_init, NULL); Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Dec 15 11:57:39 2014 (r275799) +++ head/sys/kern/kern_exit.c Mon Dec 15 12:01:42 2014 (r275800) @@ -123,6 +123,31 @@ proc_realparent(struct proc *child) return (parent); } +void +reaper_abandon_children(struct proc *p, bool exiting) +{ + struct proc *p1, *p2, *ptmp; + + sx_assert(&proctree_lock, SX_LOCKED); + KASSERT(p != initproc, ("reaper_abandon_children for initproc")); + if ((p->p_treeflag & P_TREE_REAPER) == 0) + return; + p1 = p->p_reaper; + LIST_FOREACH_SAFE(p2, &p->p_reaplist, p_reapsibling, ptmp) { + LIST_REMOVE(p2, p_reapsibling); + p2->p_reaper = p1; + p2->p_reapsubtree = p->p_reapsubtree; + LIST_INSERT_HEAD(&p1->p_reaplist, p2, p_reapsibling); + if (exiting && p2->p_pptr == p) { + PROC_LOCK(p2); + proc_reparent(p2, p1); + PROC_UNLOCK(p2); + } + } + KASSERT(LIST_EMPTY(&p->p_reaplist), ("p_reaplist not empty")); + p->p_treeflag &= ~P_TREE_REAPER; +} + static void clear_orphan(struct proc *p) { @@ -458,14 +483,14 @@ exit1(struct thread *td, int rv) sx_xlock(&proctree_lock); q = LIST_FIRST(&p->p_children); if (q != NULL) /* only need this if any child is S_ZOMB */ - wakeup(initproc); + wakeup(q->p_reaper); for (; q != NULL; q = nq) { nq = LIST_NEXT(q, p_sibling); PROC_LOCK(q); q->p_sigparent = SIGCHLD; if (!(q->p_flag & P_TRACED)) { - proc_reparent(q, initproc); + proc_reparent(q, q->p_reaper); } else { /* * Traced processes are killed since their existence @@ -473,7 +498,7 @@ exit1(struct thread *td, int rv) */ t = proc_realparent(q); if (t == p) { - proc_reparent(q, initproc); + proc_reparent(q, q->p_reaper); } else { PROC_LOCK(t); proc_reparent(q, t); @@ -562,7 +587,7 @@ exit1(struct thread *td, int rv) mtx_unlock(&p->p_pptr->p_sigacts->ps_mtx); pp = p->p_pptr; PROC_UNLOCK(pp); - proc_reparent(p, initproc); + proc_reparent(p, p->p_reaper); p->p_sigparent = SIGCHLD; PROC_LOCK(p->p_pptr); @@ -575,8 +600,8 @@ exit1(struct thread *td, int rv) } else mtx_unlock(&p->p_pptr->p_sigacts->ps_mtx); - if (p->p_pptr == initproc) - kern_psignal(p->p_pptr, SIGCHLD); + if (p->p_pptr == p->p_reaper || p->p_pptr == initproc) + childproc_exited(p); else if (p->p_sigparent != 0) { if (p->p_sigparent == SIGCHLD) childproc_exited(p); @@ -849,6 +874,8 @@ proc_reap(struct thread *td, struct proc LIST_REMOVE(p, p_list); /* off zombproc */ sx_xunlock(&allproc_lock); LIST_REMOVE(p, p_sibling); + reaper_abandon_children(p, true); + LIST_REMOVE(p, p_reapsibling); PROC_LOCK(p); clear_orphan(p); PROC_UNLOCK(p); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Dec 15 11:57:39 2014 (r275799) +++ head/sys/kern/kern_fork.c Mon Dec 15 12:01:42 2014 (r275800) @@ -261,11 +261,21 @@ retry: * Scan the active and zombie procs to check whether this pid * is in use. Remember the lowest pid that's greater * than trypid, so we can avoid checking for a while. + * + * Avoid reuse of the process group id, session id or + * the reaper subtree id. Note that for process group + * and sessions, the amount of reserved pids is + * limited by process limit. For the subtree ids, the + * id is kept reserved only while there is a + * non-reaped process in the subtree, so amount of + * reserved pids is limited by process limit times + * two. */ p = LIST_FIRST(&allproc); again: for (; p != NULL; p = LIST_NEXT(p, p_list)) { while (p->p_pid == trypid || + p->p_reapsubtree == trypid || (p->p_pgrp != NULL && (p->p_pgrp->pg_id == trypid || (p->p_session != NULL && @@ -611,12 +621,20 @@ do_fork(struct thread *td, int flags, st * of init. This effectively disassociates the child from the * parent. */ - if (flags & RFNOWAIT) - pptr = initproc; - else + if ((flags & RFNOWAIT) != 0) { + pptr = p1->p_reaper; + p2->p_reaper = pptr; + } else { + p2->p_reaper = (p1->p_treeflag & P_TREE_REAPER) != 0 ? + p1 : p1->p_reaper; pptr = p1; + } p2->p_pptr = pptr; LIST_INSERT_HEAD(&pptr->p_children, p2, p_sibling); + LIST_INIT(&p2->p_reaplist); + LIST_INSERT_HEAD(&p2->p_reaper->p_reaplist, p2, p_reapsibling); + if (p2->p_reaper == p1) + p2->p_reapsubtree = p2->p_pid; sx_xunlock(&proctree_lock); /* Inform accounting that we have forked. */ Copied and modified: head/sys/kern/kern_procctl.c (from r275798, head/sys/kern/sys_process.c) ============================================================================== --- head/sys/kern/sys_process.c Mon Dec 15 11:05:53 2014 (r275798, copy source) +++ head/sys/kern/kern_procctl.c Mon Dec 15 12:01:42 2014 (r275800) @@ -1,6 +1,9 @@ /*- - * Copyright (c) 1994, Sean Eric Fagan - * All rights reserved. + * Copyright (c) 2014 John Baldwin + * Copyright (c) 2014 The FreeBSD Foundation + * + * 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 @@ -10,11 +13,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Sean Eric Fagan. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -32,1208 +30,18 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include +#include #include #include -#include -#include -#include #include #include #include -#include -#include -#include #include -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef COMPAT_FREEBSD32 -#include -#include - -struct ptrace_io_desc32 { - int piod_op; - uint32_t piod_offs; - uint32_t piod_addr; - uint32_t piod_len; -}; - -struct ptrace_vm_entry32 { - int pve_entry; - int pve_timestamp; - uint32_t pve_start; - uint32_t pve_end; - uint32_t pve_offset; - u_int pve_prot; - u_int pve_pathlen; - int32_t pve_fileid; - u_int pve_fsid; - uint32_t pve_path; -}; - -struct ptrace_lwpinfo32 { - lwpid_t pl_lwpid; /* LWP described. */ - int pl_event; /* Event that stopped the LWP. */ - int pl_flags; /* LWP flags. */ - sigset_t pl_sigmask; /* LWP signal mask */ - sigset_t pl_siglist; /* LWP pending signal */ - struct siginfo32 pl_siginfo; /* siginfo for signal */ - char pl_tdname[MAXCOMLEN + 1]; /* LWP name. */ - int pl_child_pid; /* New child pid */ -}; - -#endif - -/* - * Functions implemented using PROC_ACTION(): - * - * proc_read_regs(proc, regs) - * Get the current user-visible register set from the process - * and copy it into the regs structure (). - * The process is stopped at the time read_regs is called. - * - * proc_write_regs(proc, regs) - * Update the current register set from the passed in regs - * structure. Take care to avoid clobbering special CPU - * registers or privileged bits in the PSL. - * Depending on the architecture this may have fix-up work to do, - * especially if the IAR or PCW are modified. - * The process is stopped at the time write_regs is called. - * - * proc_read_fpregs, proc_write_fpregs - * deal with the floating point register set, otherwise as above. - * - * proc_read_dbregs, proc_write_dbregs - * deal with the processor debug register set, otherwise as above. - * - * proc_sstep(proc) - * Arrange for the process to trap after executing a single instruction. - */ - -#define PROC_ACTION(action) do { \ - int error; \ - \ - PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); \ - if ((td->td_proc->p_flag & P_INMEM) == 0) \ - error = EIO; \ - else \ - error = (action); \ - return (error); \ -} while(0) - -int -proc_read_regs(struct thread *td, struct reg *regs) -{ - - PROC_ACTION(fill_regs(td, regs)); -} - -int -proc_write_regs(struct thread *td, struct reg *regs) -{ - - PROC_ACTION(set_regs(td, regs)); -} - -int -proc_read_dbregs(struct thread *td, struct dbreg *dbregs) -{ - - PROC_ACTION(fill_dbregs(td, dbregs)); -} - -int -proc_write_dbregs(struct thread *td, struct dbreg *dbregs) -{ - - PROC_ACTION(set_dbregs(td, dbregs)); -} - -/* - * Ptrace doesn't support fpregs at all, and there are no security holes - * or translations for fpregs, so we can just copy them. - */ -int -proc_read_fpregs(struct thread *td, struct fpreg *fpregs) -{ - - PROC_ACTION(fill_fpregs(td, fpregs)); -} - -int -proc_write_fpregs(struct thread *td, struct fpreg *fpregs) -{ - - PROC_ACTION(set_fpregs(td, fpregs)); -} - -#ifdef COMPAT_FREEBSD32 -/* For 32 bit binaries, we need to expose the 32 bit regs layouts. */ -int -proc_read_regs32(struct thread *td, struct reg32 *regs32) -{ - - PROC_ACTION(fill_regs32(td, regs32)); -} - -int -proc_write_regs32(struct thread *td, struct reg32 *regs32) -{ - - PROC_ACTION(set_regs32(td, regs32)); -} - -int -proc_read_dbregs32(struct thread *td, struct dbreg32 *dbregs32) -{ - - PROC_ACTION(fill_dbregs32(td, dbregs32)); -} - -int -proc_write_dbregs32(struct thread *td, struct dbreg32 *dbregs32) -{ - - PROC_ACTION(set_dbregs32(td, dbregs32)); -} - -int -proc_read_fpregs32(struct thread *td, struct fpreg32 *fpregs32) -{ - - PROC_ACTION(fill_fpregs32(td, fpregs32)); -} - -int -proc_write_fpregs32(struct thread *td, struct fpreg32 *fpregs32) -{ - - PROC_ACTION(set_fpregs32(td, fpregs32)); -} -#endif - -int -proc_sstep(struct thread *td) -{ - - PROC_ACTION(ptrace_single_step(td)); -} - -int -proc_rwmem(struct proc *p, struct uio *uio) -{ - vm_map_t map; - vm_offset_t pageno; /* page number */ - vm_prot_t reqprot; - int error, fault_flags, page_offset, writing; - - /* - * Assert that someone has locked this vmspace. (Should be - * curthread but we can't assert that.) This keeps the process - * from exiting out from under us until this operation completes. - */ - KASSERT(p->p_lock >= 1, ("%s: process %p (pid %d) not held", __func__, - p, p->p_pid)); - - /* - * The map we want... - */ - map = &p->p_vmspace->vm_map; - - /* - * If we are writing, then we request vm_fault() to create a private - * copy of each page. Since these copies will not be writeable by the - * process, we must explicity request that they be dirtied. - */ - writing = uio->uio_rw == UIO_WRITE; - reqprot = writing ? VM_PROT_COPY | VM_PROT_READ : VM_PROT_READ; - fault_flags = writing ? VM_FAULT_DIRTY : VM_FAULT_NORMAL; - - /* - * Only map in one page at a time. We don't have to, but it - * makes things easier. This way is trivial - right? - */ - do { - vm_offset_t uva; - u_int len; - vm_page_t m; - - uva = (vm_offset_t)uio->uio_offset; - - /* - * Get the page number of this segment. - */ - pageno = trunc_page(uva); - page_offset = uva - pageno; - - /* - * How many bytes to copy - */ - len = min(PAGE_SIZE - page_offset, uio->uio_resid); - - /* - * Fault and hold the page on behalf of the process. - */ - error = vm_fault_hold(map, pageno, reqprot, fault_flags, &m); - if (error != KERN_SUCCESS) { - if (error == KERN_RESOURCE_SHORTAGE) - error = ENOMEM; - else - error = EFAULT; - break; - } - - /* - * Now do the i/o move. - */ - error = uiomove_fromphys(&m, page_offset, len, uio); - - /* Make the I-cache coherent for breakpoints. */ - if (writing && error == 0) { - vm_map_lock_read(map); - if (vm_map_check_protection(map, pageno, pageno + - PAGE_SIZE, VM_PROT_EXECUTE)) - vm_sync_icache(map, uva, len); - vm_map_unlock_read(map); - } - - /* - * Release the page. - */ - vm_page_lock(m); - vm_page_unhold(m); - vm_page_unlock(m); - - } while (error == 0 && uio->uio_resid > 0); - - return (error); -} - -static int -ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) -{ - struct vattr vattr; - vm_map_t map; - vm_map_entry_t entry; - vm_object_t obj, tobj, lobj; - struct vmspace *vm; - struct vnode *vp; - char *freepath, *fullpath; - u_int pathlen; - int error, index; - - error = 0; - obj = NULL; - - vm = vmspace_acquire_ref(p); - map = &vm->vm_map; - vm_map_lock_read(map); - - do { - entry = map->header.next; - index = 0; - while (index < pve->pve_entry && entry != &map->header) { - entry = entry->next; - index++; - } - if (index != pve->pve_entry) { - error = EINVAL; - break; - } - while (entry != &map->header && - (entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { - entry = entry->next; - index++; - } - if (entry == &map->header) { - error = ENOENT; - break; - } - - /* We got an entry. */ - pve->pve_entry = index + 1; - pve->pve_timestamp = map->timestamp; - pve->pve_start = entry->start; - pve->pve_end = entry->end - 1; - pve->pve_offset = entry->offset; - pve->pve_prot = entry->protection; - - /* Backing object's path needed? */ - if (pve->pve_pathlen == 0) - break; - - pathlen = pve->pve_pathlen; - pve->pve_pathlen = 0; - - obj = entry->object.vm_object; - if (obj != NULL) - VM_OBJECT_RLOCK(obj); - } while (0); - - vm_map_unlock_read(map); - vmspace_free(vm); - - pve->pve_fsid = VNOVAL; - pve->pve_fileid = VNOVAL; - - if (error == 0 && obj != NULL) { - lobj = obj; - for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { - if (tobj != obj) - VM_OBJECT_RLOCK(tobj); - if (lobj != obj) - VM_OBJECT_RUNLOCK(lobj); - lobj = tobj; - pve->pve_offset += tobj->backing_object_offset; - } - vp = (lobj->type == OBJT_VNODE) ? lobj->handle : NULL; - if (vp != NULL) - vref(vp); - if (lobj != obj) - VM_OBJECT_RUNLOCK(lobj); - VM_OBJECT_RUNLOCK(obj); - - if (vp != NULL) { - freepath = NULL; - fullpath = NULL; - vn_fullpath(td, vp, &fullpath, &freepath); - vn_lock(vp, LK_SHARED | LK_RETRY); - if (VOP_GETATTR(vp, &vattr, td->td_ucred) == 0) { - pve->pve_fileid = vattr.va_fileid; - pve->pve_fsid = vattr.va_fsid; - } - vput(vp); - - if (fullpath != NULL) { - pve->pve_pathlen = strlen(fullpath) + 1; - if (pve->pve_pathlen <= pathlen) { - error = copyout(fullpath, pve->pve_path, - pve->pve_pathlen); - } else - error = ENAMETOOLONG; - } - if (freepath != NULL) - free(freepath, M_TEMP); - } - } - - return (error); -} - -#ifdef COMPAT_FREEBSD32 -static int -ptrace_vm_entry32(struct thread *td, struct proc *p, - struct ptrace_vm_entry32 *pve32) -{ - struct ptrace_vm_entry pve; - int error; - - pve.pve_entry = pve32->pve_entry; - pve.pve_pathlen = pve32->pve_pathlen; - pve.pve_path = (void *)(uintptr_t)pve32->pve_path; - - error = ptrace_vm_entry(td, p, &pve); - if (error == 0) { - pve32->pve_entry = pve.pve_entry; - pve32->pve_timestamp = pve.pve_timestamp; - pve32->pve_start = pve.pve_start; - pve32->pve_end = pve.pve_end; - pve32->pve_offset = pve.pve_offset; - pve32->pve_prot = pve.pve_prot; - pve32->pve_fileid = pve.pve_fileid; - pve32->pve_fsid = pve.pve_fsid; - } - - pve32->pve_pathlen = pve.pve_pathlen; - return (error); -} - -static void -ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl, - struct ptrace_lwpinfo32 *pl32) -{ - - pl32->pl_lwpid = pl->pl_lwpid; - pl32->pl_event = pl->pl_event; - pl32->pl_flags = pl->pl_flags; - pl32->pl_sigmask = pl->pl_sigmask; - pl32->pl_siglist = pl->pl_siglist; - siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo); - strcpy(pl32->pl_tdname, pl->pl_tdname); - pl32->pl_child_pid = pl->pl_child_pid; -} -#endif /* COMPAT_FREEBSD32 */ - -/* - * Process debugging system call. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 12:14:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 165DE6BF; Mon, 15 Dec 2014 12:14:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F2257328; Mon, 15 Dec 2014 12:14:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFCEg4o044657; Mon, 15 Dec 2014 12:14:42 GMT (envelope-from erwin@FreeBSD.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFCEgei044655; Mon, 15 Dec 2014 12:14:42 GMT (envelope-from erwin@FreeBSD.org) Message-Id: <201412151214.sBFCEgei044655@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: erwin set sender to erwin@FreeBSD.org using -f From: Erwin Lansing Date: Mon, 15 Dec 2014 12:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275801 - in vendor/bind9/dist: . bin/check bin/confgen bin/dig bin/dig/include/dig bin/dnssec bin/named bin/named/include/named bin/named/unix bin/nsupdate bin/rndc bin/tools doc/arm d... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 12:14:43 -0000 Author: erwin Date: Mon Dec 15 12:14:41 2014 New Revision: 275801 URL: https://svnweb.freebsd.org/changeset/base/275801 Log: Vendor import of BIND 9.9.6-P1 Sponsored by: DK Hostmaster A/S Added: vendor/bind9/dist/lib/dns/rdata/generic/caa_257.c (contents, props changed) vendor/bind9/dist/lib/dns/rdata/generic/caa_257.h (contents, props changed) vendor/bind9/dist/lib/dns/rdata/generic/cdnskey_60.c (contents, props changed) vendor/bind9/dist/lib/dns/rdata/generic/cdnskey_60.h (contents, props changed) vendor/bind9/dist/lib/dns/rdata/generic/cds_59.c (contents, props changed) vendor/bind9/dist/lib/dns/rdata/generic/cds_59.h (contents, props changed) vendor/bind9/dist/lib/isc/counter.c (contents, props changed) vendor/bind9/dist/lib/isc/include/isc/counter.h (contents, props changed) vendor/bind9/dist/lib/lwres/compat.c (contents, props changed) vendor/bind9/dist/lib/lwres/include/lwres/string.h (contents, props changed) Deleted: vendor/bind9/dist/lib/lwres/strtoul.c Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/FAQ vendor/bind9/dist/FAQ.xml vendor/bind9/dist/FREEBSD-Xlist vendor/bind9/dist/README vendor/bind9/dist/acconfig.h vendor/bind9/dist/aclocal.m4 vendor/bind9/dist/bin/check/Makefile.in vendor/bind9/dist/bin/check/named-checkconf.8 vendor/bind9/dist/bin/check/named-checkconf.c vendor/bind9/dist/bin/check/named-checkconf.docbook vendor/bind9/dist/bin/check/named-checkconf.html vendor/bind9/dist/bin/check/named-checkzone.8 vendor/bind9/dist/bin/check/named-checkzone.docbook vendor/bind9/dist/bin/check/named-checkzone.html vendor/bind9/dist/bin/confgen/ddns-confgen.8 vendor/bind9/dist/bin/confgen/ddns-confgen.c vendor/bind9/dist/bin/confgen/ddns-confgen.docbook vendor/bind9/dist/bin/confgen/ddns-confgen.html vendor/bind9/dist/bin/confgen/rndc-confgen.8 vendor/bind9/dist/bin/confgen/rndc-confgen.docbook vendor/bind9/dist/bin/confgen/rndc-confgen.html vendor/bind9/dist/bin/dig/dig.1 vendor/bind9/dist/bin/dig/dig.c vendor/bind9/dist/bin/dig/dig.docbook vendor/bind9/dist/bin/dig/dig.html vendor/bind9/dist/bin/dig/dighost.c vendor/bind9/dist/bin/dig/host.1 vendor/bind9/dist/bin/dig/host.c vendor/bind9/dist/bin/dig/host.docbook vendor/bind9/dist/bin/dig/host.html vendor/bind9/dist/bin/dig/include/dig/dig.h vendor/bind9/dist/bin/dig/nslookup.1 vendor/bind9/dist/bin/dig/nslookup.c vendor/bind9/dist/bin/dig/nslookup.docbook vendor/bind9/dist/bin/dig/nslookup.html vendor/bind9/dist/bin/dnssec/Makefile.in vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.8 vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.c vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.docbook vendor/bind9/dist/bin/dnssec/dnssec-dsfromkey.html vendor/bind9/dist/bin/dnssec/dnssec-importkey.8 vendor/bind9/dist/bin/dnssec/dnssec-importkey.c vendor/bind9/dist/bin/dnssec/dnssec-importkey.docbook vendor/bind9/dist/bin/dnssec/dnssec-importkey.html vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.8 vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.c vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.docbook vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.html vendor/bind9/dist/bin/dnssec/dnssec-keygen.8 vendor/bind9/dist/bin/dnssec/dnssec-keygen.c vendor/bind9/dist/bin/dnssec/dnssec-keygen.docbook vendor/bind9/dist/bin/dnssec/dnssec-keygen.html vendor/bind9/dist/bin/dnssec/dnssec-revoke.8 vendor/bind9/dist/bin/dnssec/dnssec-revoke.c vendor/bind9/dist/bin/dnssec/dnssec-revoke.docbook vendor/bind9/dist/bin/dnssec/dnssec-revoke.html vendor/bind9/dist/bin/dnssec/dnssec-settime.8 vendor/bind9/dist/bin/dnssec/dnssec-settime.c vendor/bind9/dist/bin/dnssec/dnssec-settime.docbook vendor/bind9/dist/bin/dnssec/dnssec-settime.html vendor/bind9/dist/bin/dnssec/dnssec-signzone.8 vendor/bind9/dist/bin/dnssec/dnssec-signzone.c vendor/bind9/dist/bin/dnssec/dnssec-signzone.docbook vendor/bind9/dist/bin/dnssec/dnssec-signzone.html vendor/bind9/dist/bin/dnssec/dnssec-verify.8 vendor/bind9/dist/bin/dnssec/dnssec-verify.c vendor/bind9/dist/bin/dnssec/dnssec-verify.docbook vendor/bind9/dist/bin/dnssec/dnssec-verify.html vendor/bind9/dist/bin/dnssec/dnssectool.c vendor/bind9/dist/bin/dnssec/dnssectool.h vendor/bind9/dist/bin/named/bind9.ver3.xsl vendor/bind9/dist/bin/named/bind9.ver3.xsl.h vendor/bind9/dist/bin/named/client.c vendor/bind9/dist/bin/named/config.c vendor/bind9/dist/bin/named/control.c vendor/bind9/dist/bin/named/controlconf.c vendor/bind9/dist/bin/named/include/named/query.h vendor/bind9/dist/bin/named/include/named/server.h vendor/bind9/dist/bin/named/lwresd.8 vendor/bind9/dist/bin/named/lwresd.docbook vendor/bind9/dist/bin/named/lwresd.html vendor/bind9/dist/bin/named/main.c vendor/bind9/dist/bin/named/named.8 vendor/bind9/dist/bin/named/named.conf.5 vendor/bind9/dist/bin/named/named.conf.docbook vendor/bind9/dist/bin/named/named.conf.html vendor/bind9/dist/bin/named/named.docbook vendor/bind9/dist/bin/named/named.html vendor/bind9/dist/bin/named/query.c vendor/bind9/dist/bin/named/server.c vendor/bind9/dist/bin/named/unix/dlz_dlopen_driver.c vendor/bind9/dist/bin/named/unix/os.c vendor/bind9/dist/bin/named/update.c vendor/bind9/dist/bin/named/zoneconf.c vendor/bind9/dist/bin/nsupdate/Makefile.in vendor/bind9/dist/bin/nsupdate/nsupdate.1 vendor/bind9/dist/bin/nsupdate/nsupdate.c vendor/bind9/dist/bin/nsupdate/nsupdate.docbook vendor/bind9/dist/bin/nsupdate/nsupdate.html vendor/bind9/dist/bin/rndc/rndc.8 vendor/bind9/dist/bin/rndc/rndc.c vendor/bind9/dist/bin/rndc/rndc.conf.5 vendor/bind9/dist/bin/rndc/rndc.conf.docbook vendor/bind9/dist/bin/rndc/rndc.conf.html vendor/bind9/dist/bin/rndc/rndc.docbook vendor/bind9/dist/bin/rndc/rndc.html vendor/bind9/dist/bin/tools/arpaname.1 vendor/bind9/dist/bin/tools/arpaname.docbook vendor/bind9/dist/bin/tools/arpaname.html vendor/bind9/dist/bin/tools/genrandom.8 vendor/bind9/dist/bin/tools/genrandom.c vendor/bind9/dist/bin/tools/genrandom.docbook vendor/bind9/dist/bin/tools/genrandom.html vendor/bind9/dist/bin/tools/isc-hmac-fixup.8 vendor/bind9/dist/bin/tools/isc-hmac-fixup.c vendor/bind9/dist/bin/tools/isc-hmac-fixup.docbook vendor/bind9/dist/bin/tools/isc-hmac-fixup.html vendor/bind9/dist/bin/tools/named-journalprint.8 vendor/bind9/dist/bin/tools/named-journalprint.docbook vendor/bind9/dist/bin/tools/named-journalprint.html vendor/bind9/dist/bin/tools/nsec3hash.8 vendor/bind9/dist/bin/tools/nsec3hash.c vendor/bind9/dist/bin/tools/nsec3hash.docbook vendor/bind9/dist/bin/tools/nsec3hash.html vendor/bind9/dist/config.h.in vendor/bind9/dist/configure.in vendor/bind9/dist/doc/arm/Bv9ARM-book.xml vendor/bind9/dist/doc/arm/Bv9ARM.ch01.html vendor/bind9/dist/doc/arm/Bv9ARM.ch02.html vendor/bind9/dist/doc/arm/Bv9ARM.ch03.html vendor/bind9/dist/doc/arm/Bv9ARM.ch04.html vendor/bind9/dist/doc/arm/Bv9ARM.ch05.html vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html vendor/bind9/dist/doc/arm/Bv9ARM.ch10.html vendor/bind9/dist/doc/arm/Bv9ARM.html vendor/bind9/dist/doc/arm/Bv9ARM.pdf vendor/bind9/dist/doc/arm/Makefile.in vendor/bind9/dist/doc/arm/libdns.xml vendor/bind9/dist/doc/arm/man.arpaname.html vendor/bind9/dist/doc/arm/man.ddns-confgen.html vendor/bind9/dist/doc/arm/man.dig.html vendor/bind9/dist/doc/arm/man.dnssec-checkds.html vendor/bind9/dist/doc/arm/man.dnssec-coverage.html vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html vendor/bind9/dist/doc/arm/man.dnssec-keygen.html vendor/bind9/dist/doc/arm/man.dnssec-revoke.html vendor/bind9/dist/doc/arm/man.dnssec-settime.html vendor/bind9/dist/doc/arm/man.dnssec-signzone.html vendor/bind9/dist/doc/arm/man.dnssec-verify.html vendor/bind9/dist/doc/arm/man.genrandom.html vendor/bind9/dist/doc/arm/man.host.html vendor/bind9/dist/doc/arm/man.isc-hmac-fixup.html vendor/bind9/dist/doc/arm/man.named-checkconf.html vendor/bind9/dist/doc/arm/man.named-checkzone.html vendor/bind9/dist/doc/arm/man.named-journalprint.html vendor/bind9/dist/doc/arm/man.named.html vendor/bind9/dist/doc/arm/man.nsec3hash.html vendor/bind9/dist/doc/arm/man.nsupdate.html vendor/bind9/dist/doc/arm/man.rndc-confgen.html vendor/bind9/dist/doc/arm/man.rndc.conf.html vendor/bind9/dist/doc/arm/man.rndc.html vendor/bind9/dist/doc/arm/pkcs11.xml vendor/bind9/dist/doc/misc/options vendor/bind9/dist/lib/bind9/Makefile.in vendor/bind9/dist/lib/bind9/api vendor/bind9/dist/lib/bind9/check.c vendor/bind9/dist/lib/bind9/getaddresses.c vendor/bind9/dist/lib/dns/Makefile.in vendor/bind9/dist/lib/dns/acl.c vendor/bind9/dist/lib/dns/adb.c vendor/bind9/dist/lib/dns/api vendor/bind9/dist/lib/dns/dispatch.c vendor/bind9/dist/lib/dns/dns64.c vendor/bind9/dist/lib/dns/dnssec.c vendor/bind9/dist/lib/dns/ecdb.c vendor/bind9/dist/lib/dns/gen.c vendor/bind9/dist/lib/dns/gssapictx.c vendor/bind9/dist/lib/dns/include/dns/Makefile.in vendor/bind9/dist/lib/dns/include/dns/adb.h vendor/bind9/dist/lib/dns/include/dns/dns64.h vendor/bind9/dist/lib/dns/include/dns/dnssec.h vendor/bind9/dist/lib/dns/include/dns/message.h vendor/bind9/dist/lib/dns/include/dns/rbt.h vendor/bind9/dist/lib/dns/include/dns/rdataset.h vendor/bind9/dist/lib/dns/include/dns/resolver.h vendor/bind9/dist/lib/dns/include/dns/view.h vendor/bind9/dist/lib/dns/keytable.c vendor/bind9/dist/lib/dns/master.c vendor/bind9/dist/lib/dns/message.c vendor/bind9/dist/lib/dns/name.c vendor/bind9/dist/lib/dns/nsec.c vendor/bind9/dist/lib/dns/nsec3.c vendor/bind9/dist/lib/dns/openssl_link.c vendor/bind9/dist/lib/dns/peer.c vendor/bind9/dist/lib/dns/rbt.c vendor/bind9/dist/lib/dns/rbtdb.c vendor/bind9/dist/lib/dns/rcode.c vendor/bind9/dist/lib/dns/rdata.c vendor/bind9/dist/lib/dns/rdata/generic/gpos_27.c vendor/bind9/dist/lib/dns/rdata/generic/hinfo_13.c vendor/bind9/dist/lib/dns/rdata/generic/hip_55.c vendor/bind9/dist/lib/dns/rdata/generic/isdn_20.c vendor/bind9/dist/lib/dns/rdata/generic/naptr_35.c vendor/bind9/dist/lib/dns/rdata/generic/nsec3_50.c vendor/bind9/dist/lib/dns/rdata/generic/opt_41.c vendor/bind9/dist/lib/dns/rdata/generic/spf_99.c vendor/bind9/dist/lib/dns/rdata/generic/tkey_249.c vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.c vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.h vendor/bind9/dist/lib/dns/rdata/generic/txt_16.c vendor/bind9/dist/lib/dns/rdata/generic/uri_256.c vendor/bind9/dist/lib/dns/rdata/generic/x25_19.c vendor/bind9/dist/lib/dns/rdataslab.c vendor/bind9/dist/lib/dns/resolver.c vendor/bind9/dist/lib/dns/rootns.c vendor/bind9/dist/lib/dns/rpz.c vendor/bind9/dist/lib/dns/rrl.c vendor/bind9/dist/lib/dns/time.c vendor/bind9/dist/lib/dns/tsig.c vendor/bind9/dist/lib/dns/validator.c vendor/bind9/dist/lib/dns/view.c vendor/bind9/dist/lib/dns/zone.c vendor/bind9/dist/lib/export/isc/Makefile.in vendor/bind9/dist/lib/export/samples/sample-update.c vendor/bind9/dist/lib/irs/Makefile.in vendor/bind9/dist/lib/irs/api vendor/bind9/dist/lib/irs/context.c vendor/bind9/dist/lib/irs/getaddrinfo.c vendor/bind9/dist/lib/irs/include/irs/Makefile.in vendor/bind9/dist/lib/isc/Makefile.in vendor/bind9/dist/lib/isc/api vendor/bind9/dist/lib/isc/backtrace.c vendor/bind9/dist/lib/isc/base32.c vendor/bind9/dist/lib/isc/event.c vendor/bind9/dist/lib/isc/hash.c vendor/bind9/dist/lib/isc/include/isc/Makefile.in vendor/bind9/dist/lib/isc/include/isc/base32.h vendor/bind9/dist/lib/isc/include/isc/buffer.h vendor/bind9/dist/lib/isc/include/isc/event.h vendor/bind9/dist/lib/isc/include/isc/file.h vendor/bind9/dist/lib/isc/include/isc/iterated_hash.h vendor/bind9/dist/lib/isc/include/isc/print.h vendor/bind9/dist/lib/isc/include/isc/result.h vendor/bind9/dist/lib/isc/include/isc/socket.h vendor/bind9/dist/lib/isc/include/isc/task.h vendor/bind9/dist/lib/isc/include/isc/timer.h vendor/bind9/dist/lib/isc/include/isc/types.h vendor/bind9/dist/lib/isc/lib.c vendor/bind9/dist/lib/isc/log.c vendor/bind9/dist/lib/isc/mem.c vendor/bind9/dist/lib/isc/netaddr.c vendor/bind9/dist/lib/isc/print.c vendor/bind9/dist/lib/isc/radix.c vendor/bind9/dist/lib/isc/random.c vendor/bind9/dist/lib/isc/regex.c vendor/bind9/dist/lib/isc/result.c vendor/bind9/dist/lib/isc/socket_api.c vendor/bind9/dist/lib/isc/task.c vendor/bind9/dist/lib/isc/task_api.c vendor/bind9/dist/lib/isc/timer.c vendor/bind9/dist/lib/isc/timer_api.c vendor/bind9/dist/lib/isc/tm.c vendor/bind9/dist/lib/isc/unix/app.c vendor/bind9/dist/lib/isc/unix/include/isc/Makefile.in vendor/bind9/dist/lib/isc/unix/include/isc/net.h vendor/bind9/dist/lib/isc/unix/include/isc/stat.h vendor/bind9/dist/lib/isc/unix/socket.c vendor/bind9/dist/lib/isccc/Makefile.in vendor/bind9/dist/lib/isccfg/Makefile.in vendor/bind9/dist/lib/isccfg/aclconf.c vendor/bind9/dist/lib/isccfg/api vendor/bind9/dist/lib/isccfg/include/isccfg/Makefile.in vendor/bind9/dist/lib/isccfg/include/isccfg/aclconf.h vendor/bind9/dist/lib/isccfg/namedconf.c vendor/bind9/dist/lib/isccfg/parser.c vendor/bind9/dist/lib/lwres/Makefile.in vendor/bind9/dist/lib/lwres/api vendor/bind9/dist/lib/lwres/gai_strerror.c vendor/bind9/dist/lib/lwres/getaddrinfo.c vendor/bind9/dist/lib/lwres/gethost.c vendor/bind9/dist/lib/lwres/include/lwres/Makefile.in vendor/bind9/dist/lib/lwres/include/lwres/lwres.h vendor/bind9/dist/lib/lwres/include/lwres/netdb.h.in vendor/bind9/dist/lib/lwres/include/lwres/platform.h.in vendor/bind9/dist/lib/lwres/include/lwres/stdlib.h vendor/bind9/dist/lib/lwres/lwconfig.c vendor/bind9/dist/lib/lwres/man/lwres.3 vendor/bind9/dist/lib/lwres/man/lwres.docbook vendor/bind9/dist/lib/lwres/man/lwres.html vendor/bind9/dist/lib/lwres/man/lwres_buffer.3 vendor/bind9/dist/lib/lwres/man/lwres_buffer.docbook vendor/bind9/dist/lib/lwres/man/lwres_buffer.html vendor/bind9/dist/lib/lwres/man/lwres_config.3 vendor/bind9/dist/lib/lwres/man/lwres_config.docbook vendor/bind9/dist/lib/lwres/man/lwres_config.html vendor/bind9/dist/lib/lwres/man/lwres_context.3 vendor/bind9/dist/lib/lwres/man/lwres_context.docbook vendor/bind9/dist/lib/lwres/man/lwres_context.html vendor/bind9/dist/lib/lwres/man/lwres_gabn.3 vendor/bind9/dist/lib/lwres/man/lwres_gabn.docbook vendor/bind9/dist/lib/lwres/man/lwres_gabn.html vendor/bind9/dist/lib/lwres/man/lwres_gai_strerror.3 vendor/bind9/dist/lib/lwres/man/lwres_gai_strerror.docbook vendor/bind9/dist/lib/lwres/man/lwres_gai_strerror.html vendor/bind9/dist/lib/lwres/man/lwres_getaddrinfo.3 vendor/bind9/dist/lib/lwres/man/lwres_getaddrinfo.docbook vendor/bind9/dist/lib/lwres/man/lwres_getaddrinfo.html vendor/bind9/dist/lib/lwres/man/lwres_gethostent.3 vendor/bind9/dist/lib/lwres/man/lwres_gethostent.docbook vendor/bind9/dist/lib/lwres/man/lwres_gethostent.html vendor/bind9/dist/lib/lwres/man/lwres_getipnode.3 vendor/bind9/dist/lib/lwres/man/lwres_getipnode.docbook vendor/bind9/dist/lib/lwres/man/lwres_getipnode.html vendor/bind9/dist/lib/lwres/man/lwres_getnameinfo.3 vendor/bind9/dist/lib/lwres/man/lwres_getnameinfo.docbook vendor/bind9/dist/lib/lwres/man/lwres_getnameinfo.html vendor/bind9/dist/lib/lwres/man/lwres_getrrsetbyname.3 vendor/bind9/dist/lib/lwres/man/lwres_getrrsetbyname.docbook vendor/bind9/dist/lib/lwres/man/lwres_getrrsetbyname.html vendor/bind9/dist/lib/lwres/man/lwres_gnba.3 vendor/bind9/dist/lib/lwres/man/lwres_gnba.docbook vendor/bind9/dist/lib/lwres/man/lwres_gnba.html vendor/bind9/dist/lib/lwres/man/lwres_hstrerror.3 vendor/bind9/dist/lib/lwres/man/lwres_hstrerror.docbook vendor/bind9/dist/lib/lwres/man/lwres_hstrerror.html vendor/bind9/dist/lib/lwres/man/lwres_inetntop.3 vendor/bind9/dist/lib/lwres/man/lwres_inetntop.docbook vendor/bind9/dist/lib/lwres/man/lwres_inetntop.html vendor/bind9/dist/lib/lwres/man/lwres_noop.3 vendor/bind9/dist/lib/lwres/man/lwres_noop.docbook vendor/bind9/dist/lib/lwres/man/lwres_noop.html vendor/bind9/dist/lib/lwres/man/lwres_packet.3 vendor/bind9/dist/lib/lwres/man/lwres_packet.docbook vendor/bind9/dist/lib/lwres/man/lwres_packet.html vendor/bind9/dist/lib/lwres/man/lwres_resutil.3 vendor/bind9/dist/lib/lwres/man/lwres_resutil.docbook vendor/bind9/dist/lib/lwres/man/lwres_resutil.html vendor/bind9/dist/lib/lwres/print.c vendor/bind9/dist/make/rules.in vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Mon Dec 15 12:01:42 2014 (r275800) +++ vendor/bind9/dist/CHANGES Mon Dec 15 12:14:41 2014 (r275801) @@ -1,3 +1,439 @@ + --- 9.9.6-P1 released --- + +4006. [security] A flaw in delegation handling could be exploited + to put named into an infinite loop. This has + been addressed by placing limits on the number + of levels of recursion named will allow (default 7), + and the number of iterative queries that it will + send (default 50) before terminating a recursive + query (CVE-2014-8500). + + The recursion depth limit is configured via the + "max-recursion-depth" option, and the query limit + via the "max-recursion-queries" option. [RT #37580] + + --- 9.9.6 released --- + +3950. [port] Changed the bin/python Makefile to work around a + bmake bug in FreeBSD 10 and NetBSD 6. [RT #36993] + + --- 9.9.6rc2 released --- + +3947. [cleanup] Set the executable bit on libraries when using + libtool. [RT #36786] + +3946. [cleanup] Improved "configure" search for a python interpreter. + [RT #36992] + +3945. [bug] Invalid wildcard expansions could be incorrectly + accepted by the validator. [RT #37093] + +3944. [test] Added a regression test for "server-id". [RT #37057] + +3942. [bug] Wildcard responses from a optout range should be + marked as insecure. [RT #37072] + +3941. [doc] Include the BIND version number in the ARM. [RT #37067] + + --- 9.9.6rc1 released --- + +3933. [bug] Corrected the implementation of dns_rdata_casecompare() + for the HIP rdata type. [RT #36911] + +3932. [test] Improved named-checkconf tests. [RT #36911] + +3931. [cleanup] Cleanup how dlz grammar is defined. [RT #36879] + +3929. [bug] 'host -a' needed to clear idnoptions. [RT #36963] + +3928. [test] Improve rndc system test. [RT #36898] + +3925. [bug] DS lookup of RFC 1918 empty zones failed. [RT #36917] + +3924. [bug] Improve 'rndc addzone' error reporting. [RT #35187] + +3923. [bug] Sanity check the xml2-config output. [RT #22246] + +3922. [bug] When resigning, dnssec-signzone was removing + all signatures from delegation nodes. It now + retains DS and (if applicable) NSEC signatures. + [RT #36946] + +3921. [bug] AD was inappropriately set on RPZ responses. [RT #36833] + +3919. [bug] dig: continue to next line if a address lookup fails + in batch mode. [RT #36755] + +3918. [doc] Update check-spf documentation. [RT #36910] + +3917. [bug] dig, nslookup and host now continue on names that are + too long after applying a search list elements. + [RT #36892] + +3916. [contrib] zone2sqlite checked wrong result code. Address + compiler warnings. [RT #36931] + + --- 9.9.6b2 released --- + +3914. [bug] Allow the URI target and CAA value fields to + be zero length. [RT #36737] + +3913. [bug] Address race issue in dispatch. [RT #36731] + +3910. [bug] Fix races to free event during shutdown. [RT #36720] + +3909. [bug] When computing the number of elements required for a + acl count_acl_elements could have a short count leading + to a assertion failure. Also zero out new acl elements + in dns_acl_merge. [RT #36675] + +3908. [bug] rndc now differentiates between a zone in multiple + views and a zone that doesn't exist at all. [RT #36691] + +3907. [cleanup] Alphabetize rndc help. [RT #36683] + +3906. [protocol] Update URI record format to comply with + draft-faltstrom-uri-08. [RT #36642] + +3905. [bug] Address deadlock between view.c and adb.c. [RT #36341] + +3904. [func] Add the RPZ SOA to the additional section. [RT36507] + +3903. [bug] Improve the accuracy of DiG's reported round trip + time. [RT 36611] + +3902. [bug] liblwres wasn't handling link-local addresses in + nameserver clauses in resolv.conf. [RT #36039] + +3901. [protocol] Added support for CAA record type (RFC 6844). + [RT #36625] + +3900. [bug] Fix a crash in PostgreSQL DLZ driver. [RT #36637] + +3899. [bug] "request-ixfr" is only applicable to slave and redirect + zones. [RT #36608] + +3898. [bug] Too small a buffer in tohexstr() calls in test code. + [RT #36598] + +3894. [bug] Buffers in isc_print_vsnprintf were not properly + initialized leading to potential overflows when + printing out quad values. [RT #36505] + +3892. [bug] Setting '-t aaaa' in .digrc had unintended side + effects. [RT #36452] + +3891. [bug] Use ${INSTALL_SCRIPT} rather than ${INSTALL_PROGRAM} + to install python programs. + +3890. [bug] RRSIG sets that were not loaded in a single transaction + at start up where not being correctly added to + re-signing heaps. [RT #36302] + +3889. [port] hurd: configure fixes as per: + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746540 + +3887. [cleanup] Make all static symbols in rbtdb64 end in "64" so + they are easier to use in a debugger. [RT #36373] + + --- 9.9.6b1 released --- + +3885. [port] Use 'open()' rather than 'file()' to open files in + python. + +3884. [protocol] Add CDS and CDNSKEY record types. [RT #36333] + +3881. [bug] Address memory leak with UPDATE error handling. + [RT #36303] + +3880. [test] Update ans.pl to work with new TSIG support in + Net::DNS; add additional Net::DNS version prerequisite + checks. [RT #36327] + +3879. [func] Add version printing option to various BIND utilities. + [RT #10686] + +3878. [bug] Using the incorrect filename for a DLZ module + caused a segmentation fault on startup. [RT #36286] + +3874. [test] Check that only "check-names master" is needed for + updates to be accepted. + +3873. [protocol] Only warn for SPF without TXT spf record. [RT #36210] + +3872. [bug] Address issues found by static analysis. [RT #36209] + +3871. [bug] Don't publish an activated key automatically before + its publish time. [RT #35063] + +3870. [placeholder] + +3869. [placeholder] + +3868. [bug] isc_mem_setwater incorrectly cleared hi_called + potentially leaving over memory cleaner running. + [RT #35270] + +3866. [bug] Named could die on disk full in generate_session_key. + [RT #36119] + +3864. [bug] RPZ didn't work well when being used as forwarder. + [RT #36060] + +3862. [cleanup] Return immediately if we are not going to log the + message in ns_client_dumpmessage. + +3861. [bug] Benign missing isc_buffer_availablelength check in + dns_message_pseudosectiontotext. [RT #36078] + +3860. [bug] ioctl(DP_POLL) array size needs to be determined + at run time as it is limited to {OPEN_MAX}. + [RT #35878] + +3858. [bug] Disable GCC 4.9 "delete null pointer check". + [RT #35968] + +3857. [bug] Make it harder for a incorrect NOEDNS classification + to be made. [RT #36020] + +3855. [bug] Limit smoothed round trip time aging to no more than + once a second. [RT #32909] + +3854. [cleanup] Report unrecognized options, if any, in the final + configure summary. [RT #36014] + +3853. [cleanup] Refactor dns_rdataslab_fromrdataset to separate out + the handling of a rdataset with no records. [RT #35968] + +3849. [doc] Alphabetized dig's +options. [RT #35992] + +3847. [bug] 'configure --with-dlz-postgres' failed to fail when + there is not support available. + +3846. [bug] "dig +notcp ixfr=" should result in a UDP + ixfr query. [RT #35980] + +3844. [bug] Use the x64 version of the Microsoft Visual C++ + Redistributable when built for 64 bit Windows. + [RT #35973] + +3843. [protocol] Check EDNS EXPIRE option in dns_rdata_fromwire. + [RT #35969] + +3842. [bug] Adjust RRL log-only logging category. [RT #35945] + +3841. [cleanup] Refactor zone.c:add_opt to use dns_message_buildopt. + [RT #35924] + +3840. [port] Check for arc4random_addrandom() before using it; + it's been removed from OpenBSD 5.5. [RT #35907] + +3839. [test] Use only posix-compatible shell in system tests. + [RT #35625] + +3838. [protocol] EDNS EXPIRE as been assigned a code point of 9. + +3836. [bug] Address C++ keyword usage in header file. + +3834. [bug] The re-signing heaps were not being updated soon enough + leading to multiple re-generations of the same RRSIG + when a zone transfer was in progress. [RT #35273] + +3833. [bug] Cross compiling was broken due to calling genrandom at + build time. [RT #35869] + +3827. [contrib] The example DLZ driver (a version of which is + also used in the dlzexternal system test) could + use absolute names as relative. [RT #35802] + +3826. [bug] Corrected bad INSIST logic in isc_radix_remove(). + [RT #35870] + +3825. [bug] Address sign extension bug in isc_regex_validate. + [RT #35758] + +3824. [bug] A collision between two flag values could cause + problems with cache cleaning. [RT #35858] + +3822. [bug] Log the correct type of static-stub zones when + removing them. [RT #35842] + +3819. [bug] NSEC3 hashes need to be able to be entered and + displayed without padding. This is not a issue for + currently defined algorithms but may be for future + hash algorithms. [RT #27925] + +3818. [bug] Stop lying to the optimizer that 'void *arg' is a + constant in isc_event_allocate. + +3815. [doc] Clarify "nsupdate -y" usage in man page. [RT #35808] + +3809. [doc] Fix NSID documentation. + +3807. [bug] Fix sign extension bug in dns_name_fromtext when + lowercase is set. [RT #35743] + +3806. [test] Improved system test portability. [RT #35625] + +3805. [contrib] Added contrib/perftcpdns, a performance testing tool + for DNS over TCP. [RT #35710] + +3804. [bug] Corrected a race condition in dispatch.c in which + portentry could be reset leading to an assertion + failure in socket_search(). (Change #3708 + addressed the same issue but was incomplete.) + [RT #35128] + +3803. [bug] "named-checkconf -z" incorrectly rejected zones + using alternate data sources for not having a "file" + option. [RT #35685] + +3802. [bug] Various header files were not being installed. + +3801. [port] Fix probing for gssapi support on FreeBSD. [RT #35615] + +3799. [bug] Improve named's command line error reporting. + [RT #35603] + +3796. [bug] Register dns error codes. [RT #35629] + +3795. [bug] Make named-checkconf detect raw masterfiles for + hint zones and reject them. [RT #35268] + +3794. [maint] Added AAAA for C.ROOT-SERVERS.NET. + +3793. [bug] zone.c:save_nsec3param() could assert when out of + memory. [RT #35621] + +3792. [func] Provide links to the alternate statistics views when + displaying in a browser. [RT #35605] + +3791. [bug] solaris: remove extraneous return. [RT #35589] + +3787. [bug] The code that checks whether "auto-dnssec" is + allowed was ignoring "allow-update" ACLs set at + the options or view level. [RT #29536] + +3780. [bug] $GENERATE handled negative numbers incorrectly. + [RT #25528] + +3779. [cleanup] Clarify the error message when using an option + that was not enabled at compile time. [RT #35504] + +3778. [bug] Log a warning when the wrong address family is + used in "listen-on" or "listen-on-v6". [RT #17848] + +3775. [bug] dlz_dlopen driver could return the wrong error + code on API version mismatch, leading to a segfault. + [RT #35495] + +3773. [func] "host", "nslookup" and "nsupdate" now have + options to print the version number and exit. + [RT #26057] + +3770. [bug] "dig +trace" could fail with an assertion when it + needed to fall back to TCP due to a truncated + response. [RT #24660] + +3769. [doc] Improved documentation of "rndc signing -list". + [RT #30652] + +3768. [bug] "dnssec-checkds" was missing the SHA-384 digest + algorithm. [RT #34000] + +3767. [func] Log explicitly when using rndc.key to configure + command channel. [RT #35316] + +3765. [bug] Fixed a bug in "rndc secroots" that could crash + named when dumping an empty keynode. [RT #35469] + +3764. [bug] The dnssec-keygen/settime -S and -i options + (to set up a successor key and set the prepublication + interval) were missing from dnssec-keyfromlabel. + [RT #35394] + +3761. [bug] Address dangling reference bug in dns_keytable_add. + [RT #35471] + +3757. [port] Enable Python tools (dnssec-coverage, + dnssec-checkds) to run on Windows. [RT #34355] + +3756. [bug] GSSAPI Kerberos realm checking was broken in + check_config leading to spurious messages being + logged. [RT #35443] + +3754. [cleanup] win32: Installer now places files in the + Program Files area rather than system services. + [RT #35361] + +3753. [bug] allow-notify was ignoring keys. [RT #35425] + +3751. [tuning] The default setting for the -U option (setting + the number of UDP listeners per interface) has + been adjusted to improve performance. [RT #35417] + +3747. [bug] A race condition could lead to a core dump when + destroying a resolver fetch object. [RT #35385] + +3743. [bug] delegation-only flag wasn't working in forward zone + declarations despite being documented. This is + needed to support turning off forwarding and turning + on delegation only at the same name. [RT #35392] + +3742. [port] linux: libcap support: declare curval at start of + block. [RT #35387] + +3740. [contrib] Minor fixes to configure --with-dlz-bdb, + --with-dlz-postgres and --with-dlz-odbc. [RT #35340] + +3737. [bug] 'rndc retransfer' could trigger a assertion failure + with inline zones. [RT #35353] + +3736. [bug] nsupdate: When specifying a server by name, + fall back to alternate addresses if the first + address for that name is not reachable. [RT #25784] + +3734. [bug] Improve building with libtool. [RT #35314] + +3732. [contrib] Fixed a type mismatch causing the ODBC DLZ + driver to dump core on 64-bit systems. [RT #35324] + +3731. [func] Added a "no-case-compress" ACL, which causes + named to use case-insensitive compression + (disabling change #3645) for specified + clients. (This is useful when dealing + with broken client implementations that + use case-sensitive name comparisons, + rejecting responses that fail to match the + capitalization of the query that was sent.) + [RT #35300] + +3730. [cleanup] Added "never" as a synonym for "none" when + configuring key event dates in the dnssec tools. + [RT #35277] + +3729. [bug] dnssec-keygen could set the publication date + incorrectly when only the activation date was + specified on the command line. [RT #35278] + +3724. [bug] win32: Fixed a bug that prevented dig and + host from exiting properly after completing + a UDP query. [RT #35288] + +3720. [bug] Address compiler warnings. [RT #35261] + +3719. [bug] Address memory leak in in peer.c. [RT #35255] + +3718. [bug] A missing ISC_LINK_INIT in log.c. [RT #35260] + +3714. [test] System tests that need to test for cryptography + support before running can now use a common + "testcrypto.sh" script to do so. [RT #35213] + +3713. [bug] Save memory by not storing "also-notify" addresses + in zone objects that are configured not to send + notify requests. [RT #35195] + --- 9.9.5 released --- --- 9.9.5rc2 released --- @@ -163,7 +599,7 @@ 3660. [cleanup] Changed the name of "isc-config.sh" to "bind9-config". [RT #23825] -3659. [port] solaris: don't add explict dependancies/rules for +3659. [port] solaris: don't add explicit dependencies/rules for python programs as make won't use the implicit rules. [RT #34835] @@ -1015,7 +1451,7 @@ when queryperf is available. - the encoding of PASSTHRU action to "rpz-passthru". (The old encoding is still accepted.) - [RT #26172] + [RT #26172] 3329. [bug] Handle RRSIG signer-name case consistently: We @@ -1279,7 +1715,7 @@ timestamp. [RT #26883] 3238. [bug] keyrdata was not being reinitialized in - lib/dns/rbtdb.c:iszonesecure. [RT#26913] + lib/dns/rbtdb.c:iszonesecure. [RT #26913] 3237. [bug] dig -6 didn't work with +trace. [RT #26906] @@ -1531,7 +1967,7 @@ 3162. [test] start.pl: modified to allow for "named.args" in ns*/ subdirectory to override stock arguments to - named. Largely from RT#26044, but no separate ticket. + named. Largely from RT #26044, but no separate ticket. 3161. [bug] zone.c:del_sigs failed to always reset rdata leading assertion failures. [RT #25880] @@ -1787,7 +2223,7 @@ 3090. [func] Make --with-gssapi default [RT #23738] 3089. [func] dnssec-dsfromkey now supports reading keys from - standard input "dnssec-dsfromkey -f -". [RT# 20662] + standard input "dnssec-dsfromkey -f -". [RT #20662] 3088. [bug] Remove bin/tests/system/logfileconfig/ns1/named.conf and add setup.sh in order to resolve changing @@ -2313,13 +2749,13 @@ 2939. [func] Check that named successfully skips NSEC3 records that fail to match the NSEC3PARAM record currently - in use. [RT# 21868] + in use. [RT #21868] 2938. [bug] When generating signed responses, from a signed zone that uses NSEC3, named would use a uninitialized pointer if it needed to skip a NSEC3 record because it didn't match the selected NSEC3PARAM record for - zone. [RT# 21868] + zone. [RT #21868] 2937. [bug] Worked around an apparent race condition in over memory conditions. Without this fix a DNS cache DB or @@ -2398,7 +2834,7 @@ 2926. [placeholder] 2925. [bug] Named failed to accept uncachable negative responses - from insecure zones. [RT# 21555] + from insecure zones. [RT #21555] 2924. [func] 'rndc secroots' dump a combined summary of the current managed keys combined with trusted keys. @@ -2458,7 +2894,7 @@ 2904. [bug] When using DLV, sub-zones of the zones in the DLV, could be incorrectly marked as insecure instead of secure leading to negative proofs failing. This was - a unintended outcome from change 2890. [RT# 21392] + a unintended outcome from change 2890. [RT #21392] 2903. [bug] managed-keys-directory missing from namedconf.c. [RT #21370] @@ -2493,7 +2929,7 @@ 2892. [bug] Handle REVOKED keys better. [RT #20961] 2891. [maint] Update empty-zones list to match - draft-ietf-dnsop-default-local-zones-13. [RT# 21099] + draft-ietf-dnsop-default-local-zones-13. [RT #21099] 2890. [bug] Handle the introduction of new trusted-keys and DS, DLV RRsets better. [RT #21097] @@ -2904,7 +3340,7 @@ 2761. [cleanup] Enable internal symbol table for backtrace only for systems that are known to work. Currently, BSD - variants, Linux and Solaris are supported. [RT# 20202] + variants, Linux and Solaris are supported. [RT #20202] 2760. [cleanup] Corrected named-compilezone usage summary. [RT #20533] @@ -2918,7 +3354,7 @@ 2757. [bug] dig: assertion failure could occur in connect timeout. [RT #20599] -2756. [bug] Fixed corrupt logfile message in update.c. [RT# 20597] +2756. [bug] Fixed corrupt logfile message in update.c. [RT #20597] 2755. [placeholder] @@ -3913,7 +4349,7 @@ glue when sibling checks were disabled. [RT #18768] 2470. [bug] Elements of the isc_radix_node_t could be incorrectly - overwritten. [RT# 18719] + overwritten. [RT #18719] 2469. [port] solaris: Work around Solaris's select() limitations. [RT #18769] @@ -3986,7 +4422,7 @@ 2446. [func] Add a new log message about build options on startup. A new command-line option '-V' for named is also - provided to show this information. [RT# 18645] + provided to show this information. [RT #18645] 2445. [doc] ARM out-of-date on empty reverse zones (list includes RFC1918 address, but these are not yet compiled in). @@ -4000,7 +4436,7 @@ Fix this by doing an immediate WSAConnect() rather than an io completion port type for UDP. -2442. [bug] A lock could be destroyed twice. [RT# 18626] +2442. [bug] A lock could be destroyed twice. [RT #18626] 2441. [bug] isc_radix_insert() could copy radix tree nodes incompletely. [RT #18573] @@ -4237,7 +4673,7 @@ [RT #18054] 2368. [port] Linux: use libcap for capability management if - possible. [RT# 18026] + possible. [RT #18026] 2367. [bug] Improve counting of dns_resstatscounter_retry [RT #18030] @@ -4515,7 +4951,7 @@ 2277. [bug] Empty zone names were not correctly being caught at in the post parse checks. [RT #17357] -2276. [bug] Install . [RT# 17359] +2276. [bug] Install . [RT #17359] 2275. [func] Add support to dig to perform IXFR queries over UDP. [RT #17235] @@ -4523,7 +4959,7 @@ 2274. [func] Log zone transfer statistics. [RT #17336] 2273. [bug] Adjust log level to WARNING when saving inconsistent - stub/slave master and journal files. [RT# 17279] + stub/slave master and journal files. [RT #17279] 2272. [bug] Handle illegal dnssec-lookaside trust-anchor names. [RT #17262] @@ -4949,7 +5385,7 @@ packet was sent to. [RT #16613] 2142. [bug] Handle master files with a modification time that - matches the epoch. [RT# 16612] + matches the epoch. [RT #16612] 2141. [bug] dig/host should not be setting IDN_ASCCHECK (IDN equivalent of LDH checks). [RT #16609] @@ -4963,12 +5399,12 @@ 2138. [bug] Lock order reversal in resolver.c. [RT #16653] 2137. [port] Mips little endian and/or mips 64 bit are now - supported for atomic operations. [RT#16648] + supported for atomic operations. [RT #16648] 2136. [bug] nslookup/host looped if there was no search list and the host didn't exist. [RT #16657] -2135. [bug] Uninitialized rdataset in sdlz.c. [RT# 16656] +2135. [bug] Uninitialized rdataset in sdlz.c. [RT #16656] 2134. [func] Additional statistics support. [RT #16666] @@ -5036,7 +5472,7 @@ labels were failing. [RT #16447] 2113. [bug] nsupdate: if a zone is specified it should be used - for server discover. [RT# 16455] + for server discover. [RT #16455] 2112. [security] Warn if weak RSA exponent is used. [RT #16460] @@ -5084,7 +5520,7 @@ 2095. [port] libbind: alway prototype inet_cidr_ntop_ipv6() and net_cidr_ntop_ipv6(). [RT #16388] -2094. [contrib] Update named-bootconf. [RT# 16404] +2094. [contrib] Update named-bootconf. [RT #16404] 2093. [bug] named-checkzone -s was broken. @@ -5236,7 +5672,7 @@ [RT #16179] 2043. [port] nsupdate/nslookup: Force the flushing of the prompt - for interactive sessions. [RT#16148] + for interactive sessions. [RT #16148] 2042. [bug] named-checkconf was incorrectly rejecting the logging category "config". [RT #16117] @@ -5608,7 +6044,7 @@ 1927. [bug] Access to soanode or nsnode in rbtdb violated the lock order rule and could cause a dead lock. - [RT# 15518] + [RT #15518] 1926. [bug] The Windows installer did not check for empty passwords. BINDinstall was being installed in @@ -5625,7 +6061,7 @@ dns_log_setcontext(). 1921. [bug] Client memory contexts were not using internal - malloc. [RT# 15434] + malloc. [RT #15434] 1920. [bug] The cache rbtdb lock array was too small to have the desired performance characteristics. @@ -5897,7 +6333,7 @@ 1832. [bug] named fails to return BADKEY on unknown TSIG algorithm. [RT #13620] -1831. [doc] Update named-checkzone documentation. [RT#13604] +1831. [doc] Update named-checkzone documentation. [RT #13604] 1830. [bug] adb lame cache has sence of test reversed. [RT #13600] @@ -5918,7 +6354,7 @@ [RT #13510] 1823. [bug] Wrong macro used to check for point to point interface. - [RT#13418] + [RT #13418] 1822. [bug] check-names test for RT was reversed. [RT #13382] @@ -6078,7 +6514,7 @@ 1771. [placeholder] 1770. [bug] named-checkconf failed to report missing a missing - file clause for rbt{64} master/hint zones. [RT#13009] + file clause for rbt{64} master/hint zones. [RT #13009] 1769. [port] win32: change compiler flags /MTd ==> /MDd, /MT ==> /MD. @@ -6090,7 +6526,7 @@ support for (struct in6_pktinfo) failed. [RT #13077] 1766. [bug] Update the master file timestamp on successful refresh - as well as the journal's timestamp. [RT# 13062] + as well as the journal's timestamp. [RT #13062] 1765. [bug] configure --with-openssl=auto failed. [RT #12937] @@ -6243,7 +6679,7 @@ "ifconfig.sh down" didn't work for Solaris 9. 1716. [doc] named.conf(5) was being installed in the wrong - location. [RT# 12441] + location. [RT #12441] 1715. [func] 'dig +trace' now randomly selects the next servers to try. Report if there is a bad delegation. @@ -6312,7 +6748,7 @@ are defined in named.conf. [RT #12023] 1693. [bug] max-journal-size was not effective for master zones - with ixfr-from-differences set. [RT# 12024] + with ixfr-from-differences set. [RT #12024] 1692. [bug] Don't set -I, -L and -R flags when libcrypto is in /usr/lib. [RT #11971] @@ -6378,7 +6814,7 @@ 1671. [contrib] queryperf: add NAPTR to the list of known types. 1670. [func] Log UPDATE requests to slave zones without an acl as - "disabled" at debug level 3. [RT# 11657] + "disabled" at debug level 3. [RT #11657] 1669. [placeholder] @@ -6445,7 +6881,7 @@ [RT #11445] 1646. [bug] win32: logging file versions didn't work with - non-UNC filenames. [RT#11486] + non-UNC filenames. [RT #11486] 1645. [bug] named could trigger a REQUIRE failure if multiple masters with keys are specified. @@ -6495,17 +6931,17 @@ 1629. [func] dig now supports IPv6 scoped addresses with the extended format in the local-server part. [RT #8753] -1628. [bug] Typo in Compaq Trucluster support. [RT# 11264] +1628. [bug] Typo in Compaq Trucluster support. [RT #11264] 1627. [bug] win32: sockets were not being closed when the - last external reference was removed. [RT# 11179] + last external reference was removed. [RT #11179] -1626. [bug] --enable-getifaddrs was broken. [RT#11259] +1626. [bug] --enable-getifaddrs was broken. [RT #11259] 1625. [bug] named failed to load/transfer RFC2535 signed zones - which contained CNAMES. [RT# 11237] + which contained CNAMES. [RT #11237] -1624. [bug] zonemgr_putio() call should be locked. [RT# 11163] +1624. [bug] zonemgr_putio() call should be locked. [RT #11163] 1623. [bug] A serial number of zero was being displayed in the "sending notifies" log message when also-notify was @@ -6515,12 +6951,12 @@ available, and suppress wildcard binding if not. 1621. [bug] match-destinations did not work for IPv6 TCP queries. - [RT# 11156] + [RT #11156] 1620. [func] When loading a zone report if it is signed. [RT #11149] 1619. [bug] Missing ISC_LIST_UNLINK in end_reserved_dispatches(). - [RT# 11118] + [RT #11118] 1618. [bug] Fencepost errors in dns_name_ishostname() and dns_name_ismailbox() could trigger a INSIST(). @@ -6533,14 +6969,14 @@ 1615. [port] Define ISC_SOCKADDR_LEN_T based on _BSD_SOCKLEN_T_ if it is defined. -1614. [port] win32: silence resource limit messages. [RT# 11101] +1614. [port] win32: silence resource limit messages. [RT #11101] 1613. [bug] Builds would fail on machines w/o a if_nametoindex(). Missing #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX/#endif. [RT #11119] 1612. [bug] check-names at the option/view level could trigger - an INSIST. [RT# 11116] + an INSIST. [RT #11116] 1611. [bug] solaris: IPv6 interface scanning failed to cope with no active IPv6 interfaces. @@ -6560,7 +6996,7 @@ to use when making queries. 1607. [bug] dig, host and nslookup were still using random() - to generate query ids. [RT# 11013] + to generate query ids. [RT #11013] 1606. [bug] DLV insecurity proof was failing. @@ -6571,14 +7007,14 @@ partially initialized structure. 1603. [bug] nsupdate: set interactive based on isatty(). - [RT# 10929] + [RT #10929] 1602. [bug] Logging to a file failed unless a size was specified. - [RT# 10925] + [RT #10925] 1601. [bug] Silence spurious warning 'both "recursion no;" and "allow-recursion" active' warning from view "_bind". - [RT# 10920] + [RT #10920] 1600. [bug] Duplicate zone pre-load checks were not case insensitive. @@ -6601,9 +7037,9 @@ queries while the dump was in progress. [RT #10565] 1593. [bug] rndc should return "unknown command" to unknown - commands. [RT# 10642] + commands. [RT #10642] -1592. [bug] configure_view() could leak a dispatch. [RT# 10675] +1592. [bug] configure_view() could leak a dispatch. [RT #10675] 1591. [bug] libbind: updated to BIND 8.4.5. @@ -6644,7 +7080,7 @@ workaround code. [RT #10331] 1576. [bug] Race condition in dns_dispatch_addresponse(). - [RT# 10272] + [RT #10272] 1575. [func] Log TSIG name on TSIG verify failure. [RT #4404] @@ -6669,7 +7105,7 @@ complete answer message to the last update. 1568. [bug] nsupdate now reports that the update failed in - interactive mode. [RT# 10236] + interactive mode. [RT #10236] 1567. [maint] B.ROOT-SERVERS.NET is now 192.228.79.201. @@ -6720,7 +7156,7 @@ were specified in /etc/resolv.conf. [RT #8232] 1553. [bug] The windows socket code could stop accepting - connections. [RT#10115] + connections. [RT #10115] 1552. [bug] Accept NOTIFY requests from mapped masters if matched-mapped is set. [RT #10049] @@ -6733,7 +7169,7 @@ in a easily parsable format (-D and -o). 1548. [bug] When parsing APL records it was possible to silently - accept out of range ADDRESSFAMILY values. [RT# 9979] + accept out of range ADDRESSFAMILY values. [RT #9979] 1547. [bug] Named wasted memory recording duplicate lame zone entries. [RT #9341] @@ -6770,10 +7206,10 @@ 1535. [placeholder] -1534. [bug] Race condition when priming cache. [RT# 9940] +1534. [bug] Race condition when priming cache. [RT #9940] 1533. [func] Warn if both "recursion no;" and "allow-recursion" - are active. [RT# 4389] + are active. [RT #4389] 1532. [port] netbsd: the configure test for requires . @@ -6785,7 +7221,7 @@ moment. [RT #9462] 1529. [bug] "notify explicit;" failed to log that NOTIFY messages - were being sent for the zone. [RT# 9442] + were being sent for the zone. [RT #9442] 1528. [cleanup] Simplify some dns_name_ functions based on the deprecation of bitstring labels. @@ -6801,18 +7237,18 @@ 1525. [bug] dns_cache_create() could trigger a REQUIRE failure in isc_mem_put() during error cleanup. - [RT# 9360] + [RT #9360] 1524. [port] AIX needs to be able to resolve all symbols when creating shared libraries (--with-libtool). -1523. [bug] Fix race condition in rbtdb. [RT# 9189] +1523. [bug] Fix race condition in rbtdb. [RT #9189] 1522. [bug] dns_db_findnode() relax the requirements on 'name'. - [RT# 9286] + [RT #9286] 1521. [bug] dns_view_createresolver() failed to check the - result from isc_mem_create(). [RT# 9294] + result from isc_mem_create(). [RT #9294] 1520. [protocol] Add SSHFP (SSH Finger Print) type. @@ -6912,7 +7348,7 @@ [RT #6189] 1486. [bug] isc_print_snprintf() '%%' consumed one too many format - characters. [RT# 8230] + characters. [RT #8230] 1485. [bug] gen failed to handle high type values. [RT #6225] @@ -7249,7 +7685,7 @@ 1372. [bug] named crashes with an assertion failure on exit when sharing the same port for listening and querying, and - changing listening addresses several times. [RT# 3509] + changing listening addresses several times. [RT #3509] 1371. [bug] notify-source-v6, transfer-source-v6 and query-source-v6 with explicit addresses and using the @@ -7272,7 +7708,7 @@ addresses / prefixes. 1364. [func] Log file name when unable to open memory statistics - and dump database files. [RT# 3437] + and dump database files. [RT #3437] 1363. [func] Listen-on-v6 now supports specific addresses. @@ -7584,7 +8020,7 @@ 1252. [bug] Dig, host and nslookup were not checking the address the answer was coming from against the address it was - sent to. [RT# 2692] + sent to. [RT #2692] 1251. [port] win32: a make file contained absolute version specific references. @@ -7656,7 +8092,7 @@ 1227. [bug] dns_lex_getmastertoken() now returns ISC_R_BADNUMBER if a number was expected and some other token was - found. [RT#2532] + found. [RT #2532] 1226. [func] Use EDNS for zone refresh queries. [RT #2551] @@ -9269,7 +9705,7 @@ 729. [port] pthread_setconcurrency() needs to be called on Solaris. 728. [bug] Fix comment processing on master file directives. - [RT# 757] + [RT #757] 727. [port] Work around OS bug where accept() succeeds but fails to fill in the peer address of the accepted @@ -9311,7 +9747,7 @@ failure in adb.c. [RT #738] 714. [bug] Preserve interval timers across reloads unless changed. - [RT# 729] + [RT #729] 713. [func] named-checkconf takes '-t directory' similar to named. [RT #726] @@ -9531,7 +9967,7 @@ 644. [bug] #622 needed more work. [RT #562] 643. [bug] xfrin error messages made more verbose, added class - of the zone. [RT# 599] + of the zone. [RT #599] 642. [bug] Break the exit_check() race in the zone module. [RT #598] @@ -9959,7 +10395,7 @@ assertion. [RT #399] 515. [bug] The ssu table was not being attached / detached - by dns_zone_[sg]etssutable. [RT#397] + by dns_zone_[sg]etssutable. [RT #397] 514. [func] Retry refresh and notify queries if they timeout. [RT #388] @@ -10293,7 +10729,7 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 12:15:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CDC87EE; Mon, 15 Dec 2014 12:15:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 49C9332E; Mon, 15 Dec 2014 12:15:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFCFJi1044861; Mon, 15 Dec 2014 12:15:19 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFCFJrY044860; Mon, 15 Dec 2014 12:15:19 GMT (envelope-from br@FreeBSD.org) Message-Id: <201412151215.sBFCFJrY044860@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 15 Dec 2014 12:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275802 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 12:15:19 -0000 Author: br Date: Mon Dec 15 12:15:18 2014 New Revision: 275802 URL: https://svnweb.freebsd.org/changeset/base/275802 Log: Fix typo. Modified: head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Mon Dec 15 12:14:41 2014 (r275801) +++ head/sys/arm/mv/mv_pci.c Mon Dec 15 12:15:18 2014 (r275802) @@ -188,7 +188,7 @@ mv_pci_ranges_decode(phandle_t node, str par_addr_cells - offset_cells); rangesptr += par_addr_cells - offset_cells; - if (size_cells > 2) + if (size_cells > 2) { rv = ERANGE; goto out; } From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 12:16:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FA52936; Mon, 15 Dec 2014 12:16:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4220133C; Mon, 15 Dec 2014 12:16:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFCGAUF045031; Mon, 15 Dec 2014 12:16:10 GMT (envelope-from erwin@FreeBSD.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFCGAlj045030; Mon, 15 Dec 2014 12:16:10 GMT (envelope-from erwin@FreeBSD.org) Message-Id: <201412151216.sBFCGAlj045030@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: erwin set sender to erwin@FreeBSD.org using -f From: Erwin Lansing Date: Mon, 15 Dec 2014 12:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275803 - vendor/bind9/9.9.6-P1 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 12:16:10 -0000 Author: erwin Date: Mon Dec 15 12:16:09 2014 New Revision: 275803 URL: https://svnweb.freebsd.org/changeset/base/275803 Log: Tag the 9.9.6-P1 release Sponsored by: DK Hostmaster A/S Added: vendor/bind9/9.9.6-P1/ - copied from r275802, vendor/bind9/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 14:25:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87FA7517; Mon, 15 Dec 2014 14:25:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 73ACE347; Mon, 15 Dec 2014 14:25:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFEPhP0009027; Mon, 15 Dec 2014 14:25:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFEPhhs009026; Mon, 15 Dec 2014 14:25:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412151425.sBFEPhhs009026@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Dec 2014 14:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275804 - head/gnu/usr.bin/cc/cc1plus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 14:25:43 -0000 Author: emaste Date: Mon Dec 15 14:25:42 2014 New Revision: 275804 URL: https://svnweb.freebsd.org/changeset/base/275804 Log: Remove empty generated file upon gperf failure Prior to this change the build could fail as follows, if gperf is not available (or fails): - make(1) stops due to the gperf error, but an empty target file (cfns.h) is still created - the empty cfns.h is newer than the source cfns.gperf so it is not regenerated on subsequent builds - the gcc build fails (undefined reference to libc_name_p) Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/gnu/usr.bin/cc/cc1plus/Makefile Modified: head/gnu/usr.bin/cc/cc1plus/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc1plus/Makefile Mon Dec 15 12:16:09 2014 (r275803) +++ head/gnu/usr.bin/cc/cc1plus/Makefile Mon Dec 15 14:25:42 2014 (r275804) @@ -30,7 +30,7 @@ LDADD= ${LIBBACKEND} ${LIBCPP} ${LIBDECN # C++ parser cfns.h: cfns.gperf gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ - ${.ALLSRC} > ${.TARGET} + ${.ALLSRC} > ${.TARGET} || (rm -f ${.TARGET}; false) CLEANFILES= cfns.h DOBJS+= ${SRCS:N*.h:R:S/$/.o/g} From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 14:36:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 295A395A; Mon, 15 Dec 2014 14:36:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 15006669; Mon, 15 Dec 2014 14:36:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFEa5K9014088; Mon, 15 Dec 2014 14:36:05 GMT (envelope-from kuriyama@FreeBSD.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFEa5oX014087; Mon, 15 Dec 2014 14:36:05 GMT (envelope-from kuriyama@FreeBSD.org) Message-Id: <201412151436.sBFEa5oX014087@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kuriyama set sender to kuriyama@FreeBSD.org using -f From: Jun Kuriyama Date: Mon, 15 Dec 2014 14:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275805 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 14:36:06 -0000 Author: kuriyama Date: Mon Dec 15 14:36:04 2014 New Revision: 275805 URL: https://svnweb.freebsd.org/changeset/base/275805 Log: Fix incorrect type of "invalids" argument in __iconv() prototype. Modified: head/lib/libc/iconv/iconv.3 Modified: head/lib/libc/iconv/iconv.3 ============================================================================== --- head/lib/libc/iconv/iconv.3 Mon Dec 15 14:25:42 2014 (r275804) +++ head/lib/libc/iconv/iconv.3 Mon Dec 15 14:36:04 2014 (r275805) @@ -48,7 +48,7 @@ .Ft size_t .Fn iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" .Ft size_t -.Fn __iconv "iconv_t cd" "const char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t invalids" +.Fn __iconv "iconv_t cd" "const char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids" .Sh DESCRIPTION The .Fn iconv_open From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 14:47:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B14DE10; Mon, 15 Dec 2014 14:47:32 +0000 (UTC) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30C9D7E9; Mon, 15 Dec 2014 14:47:32 +0000 (UTC) Received: by mail-ig0-f169.google.com with SMTP id hl2so6044223igb.0; Mon, 15 Dec 2014 06:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=RYyGMV3Mq5RnGVRcdiNLyNNUMdCw/5t2aWt568c3ejE=; b=pGjI6ux2VXs59XnhihnaCPKbu3WogRIdfBxuNfFMjfBWK3wUndLTHmskJvlg3k+4wB rsUvZExwwDjZMO3IIZHM2Y1D6mgKbvL1gq4nDMF1a2TlC30Qvz/MCuUy/nk6WSIEAvis tVlxV7lVCQcLHsGl+h4CvzzZt5OJPsbRqaD9gghKVW2N+dcyOiG9drITM8MMPNstSHsQ oeuZ4fAqpHAeunwam2sE82+lLlc3C0uXMHlZhC2tfhDeirb98dLCokE04HPKnXZ8HfCk hkEqikobvx28bLCgOWhIwrKJu7qEC7ZUqlWQ1DXNz2f4fAhInCijYgvhW/rPewODuppn TkBw== X-Received: by 10.50.142.98 with SMTP id rv2mr17943090igb.19.1418654851523; Mon, 15 Dec 2014 06:47:31 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.0.85 with HTTP; Mon, 15 Dec 2014 06:47:11 -0800 (PST) In-Reply-To: <201412151425.sBFEPhhs009026@svn.freebsd.org> References: <201412151425.sBFEPhhs009026@svn.freebsd.org> From: Ed Maste Date: Mon, 15 Dec 2014 09:47:11 -0500 X-Google-Sender-Auth: sk5tARbcqIRFAIJDi_3nz0_lgqM Message-ID: Subject: Re: svn commit: r275804 - head/gnu/usr.bin/cc/cc1plus 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 14:47:32 -0000 On 15 December 2014 at 09:25, Ed Maste wrote: > Author: emaste > Date: Mon Dec 15 14:25:42 2014 > New Revision: 275804 > URL: https://svnweb.freebsd.org/changeset/base/275804 > > Log: > Remove empty generated file upon gperf failure >... > - ${.ALLSRC} > ${.TARGET} > + ${.ALLSRC} > ${.TARGET} || (rm -f ${.TARGET}; false) There are additional cases of this potential issue in the tree. In most cases I examined the target invokes tools that are expected to exist on the build host (such as sed or awk) so should not be a problem in practice. There are some cases (gensnmptree, make-roken) that we may want to revisit as part of a more holistic build infrastructure project. From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 14:58:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F39781D9; Mon, 15 Dec 2014 14:58:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D4E3791E; Mon, 15 Dec 2014 14:58:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFEwBOo024742; Mon, 15 Dec 2014 14:58:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFEwBU6024741; Mon, 15 Dec 2014 14:58:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151458.sBFEwBU6024741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 14:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275806 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 14:58:12 -0000 Author: kib Date: Mon Dec 15 14:58:10 2014 New Revision: 275806 URL: https://svnweb.freebsd.org/changeset/base/275806 Log: Markup fixes for kqueue(2), no content changes. Reviewed by: brueffer (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Mon Dec 15 14:36:04 2014 (r275805) +++ head/lib/libc/sys/kqueue.2 Mon Dec 15 14:58:10 2014 (r275806) @@ -162,56 +162,56 @@ struct kevent { The fields of .Fa struct kevent are: -.Bl -tag -width XXXfilter -.It ident +.Bl -tag -width "Fa filter" +.It Fa ident Value used to identify this event. The exact interpretation is determined by the attached filter, but often is a file descriptor. -.It filter +.It Fa filter Identifies the kernel filter used to process this event. The pre-defined system filters are described below. -.It flags +.It Fa flags Actions to perform on the event. -.It fflags +.It Fa fflags Filter-specific flags. -.It data +.It Fa data Filter-specific data value. -.It udata +.It Fa udata Opaque user-defined value passed through the kernel unchanged. .El .Pp The .Va flags field can contain the following values: -.Bl -tag -width XXXEV_ONESHOT -.It EV_ADD +.Bl -tag -width EV_DISPATCH +.It Dv EV_ADD Adds the event to the kqueue. Re-adding an existing event will modify the parameters of the original event, and not result in a duplicate entry. Adding an event automatically enables it, unless overridden by the EV_DISABLE flag. -.It EV_ENABLE +.It Dv EV_ENABLE Permit .Fn kevent to return the event if it is triggered. -.It EV_DISABLE +.It Dv EV_DISABLE Disable the event so .Fn kevent will not return it. The filter itself is not disabled. -.It EV_DISPATCH +.It Dv EV_DISPATCH Disable the event source immediately after delivery of an event. See .Dv EV_DISABLE above. -.It EV_DELETE +.It Dv EV_DELETE Removes the event from the kqueue. Events which are attached to file descriptors are automatically deleted on the last close of the descriptor. -.It EV_RECEIPT +.It Dv EV_RECEIPT This flag is useful for making bulk changes to a kqueue without draining any pending events. When passed as input, it forces @@ -220,20 +220,20 @@ to always be returned. When a filter is successfully added the .Va data field will be zero. -.It EV_ONESHOT +.It Dv EV_ONESHOT Causes the event to return only the first occurrence of the filter being triggered. After the user retrieves the event from the kqueue, it is deleted. -.It EV_CLEAR +.It Dv EV_CLEAR After the event is retrieved by the user, its state is reset. This is useful for filters which report state transitions instead of the current state. Note that some filters may automatically set this flag internally. -.It EV_EOF +.It Dv EV_EOF Filters may set this flag to indicate filter-specific EOF condition. -.It EV_ERROR +.It Dv EV_ERROR See .Sx RETURN VALUES below. @@ -245,8 +245,8 @@ Arguments may be passed to and from the and .Va data fields in the kevent structure. -.Bl -tag -width EVFILT_PROCDESC -.It EVFILT_READ +.Bl -tag -width "Dv EVFILT_PROCDESC" +.It Dv EVFILT_READ Takes a descriptor as the identifier, and returns whenever there is data available to read. The behavior of the filter is slightly different depending @@ -265,7 +265,7 @@ subject to the value of the socket buffer. This may be overridden with a per-filter low water mark at the time the filter is added by setting the -NOTE_LOWAT +.Dv NOTE_LOWAT flag in .Va fflags , and specifying the new low water mark in @@ -275,7 +275,9 @@ On return, contains the number of bytes of protocol data available to read. .Pp If the read direction of the socket has shutdown, then the filter -also sets EV_EOF in +also sets +.Dv EV_EOF +in .Va flags , and returns the socket error (if any) in .Va fflags . @@ -291,9 +293,13 @@ Returns when the there is data to read; .Va data contains the number of bytes available. .Pp -When the last writer disconnects, the filter will set EV_EOF in +When the last writer disconnects, the filter will set +.Dv EV_EOF +in .Va flags . -This may be cleared by passing in EV_CLEAR, at which point the +This may be cleared by passing in +.Dv EV_CLEAR , +at which point the filter will resume waiting for data to become available before returning. .It "BPF devices" @@ -304,7 +310,7 @@ enabled and there is any data to read; .Va data contains the number of bytes available. .El -.It EVFILT_WRITE +.It Dv EVFILT_WRITE Takes a descriptor as the identifier, and returns whenever it is possible to write to the descriptor. For sockets, pipes @@ -312,23 +318,30 @@ and fifos, .Va data will contain the amount of space remaining in the write buffer. The filter will set EV_EOF when the reader disconnects, and for -the fifo case, this may be cleared by use of EV_CLEAR. +the fifo case, this may be cleared by use of +.Dv EV_CLEAR . Note that this filter is not supported for vnodes or BPF devices. .Pp For sockets, the low water mark and socket error handling is -identical to the EVFILT_READ case. -.It EVFILT_AIO +identical to the +.Dv EVFILT_READ +case. +.It Dv EVFILT_AIO The sigevent portion of the AIO request is filled in, with .Va sigev_notify_kqueue containing the descriptor of the kqueue that the event should be attached to, .Va sigev_notify_kevent_flags -containing the kevent flags which should be EV_ONESHOT, EV_CLEAR or -EV_DISPATCH, +containing the kevent flags which should be +.Dv EV_ONESHOT , +.Dv EV_CLEAR +or +.Dv EV_DISPATCH , .Va sigev_value containing the udata value, and .Va sigev_notify -set to SIGEV_KEVENT. +set to +.Dv SIGEV_KEVENT . When the .Fn aio_* system call is made, the event will be registered @@ -339,29 +352,30 @@ argument set to the returned by the .Fn aio_* system call. -The filter returns under the same conditions as aio_error. -.It EVFILT_VNODE +The filter returns under the same conditions as +.Fn aio_error . +.It Dv EVFILT_VNODE Takes a file descriptor as the identifier and the events to watch for in .Va fflags , and returns when one or more of the requested events occurs on the descriptor. The events to monitor are: -.Bl -tag -width XXNOTE_RENAME -.It NOTE_DELETE +.Bl -tag -width "Dv NOTE_RENAME" +.It Dv NOTE_DELETE The .Fn unlink system call was called on the file referenced by the descriptor. -.It NOTE_WRITE +.It Dv NOTE_WRITE A write occurred on the file referenced by the descriptor. -.It NOTE_EXTEND +.It Dv NOTE_EXTEND The file referenced by the descriptor was extended. -.It NOTE_ATTRIB +.It Dv NOTE_ATTRIB The file referenced by the descriptor had its attributes changed. -.It NOTE_LINK +.It Dv NOTE_LINK The link count on the file changed. -.It NOTE_RENAME +.It Dv NOTE_RENAME The file referenced by the descriptor was renamed. -.It NOTE_REVOKE +.It Dv NOTE_REVOKE Access to the file was revoked via .Xr revoke 2 or the underlying file system was unmounted. @@ -370,26 +384,26 @@ or the underlying file system was unmoun On return, .Va fflags contains the events which triggered the filter. -.It EVFILT_PROC +.It Dv EVFILT_PROC Takes the process ID to monitor as the identifier and the events to watch for in .Va fflags , and returns when the process performs one or more of the requested events. If a process can normally see another process, it can attach an event to it. The events to monitor are: -.Bl -tag -width XXNOTE_TRACKERR -.It NOTE_EXIT +.Bl -tag -width "Dv NOTE_TRACKERR" +.It Dv NOTE_EXIT The process has exited. The exit status will be stored in .Va data . -.It NOTE_FORK +.It Dv NOTE_FORK The process has called .Fn fork . -.It NOTE_EXEC +.It Dv NOTE_EXEC The process has executed a new process via .Xr execve 2 or a similar call. -.It NOTE_TRACK +.It Dv NOTE_TRACK Follow a process across .Fn fork calls. @@ -397,22 +411,28 @@ The parent process registers a new keven using the same .Va fflags as the original event. -The child process will signal an event with NOTE_CHILD set in +The child process will signal an event with +.Dv NOTE_CHILD +set in .Va fflags and the parent PID in .Va data . .Pp If the parent process fails to register a new kevent .Pq usually due to resource limitations , -it will signal an event with NOTE_TRACKERR set in +it will signal an event with +.Dv NOTE_TRACKERR +set in .Va fflags , -and the child process will not signal a NOTE_CHILD event. +and the child process will not signal a +.Dv NOTE_CHILD +event. .El .Pp On return, .Va fflags contains the events which triggered the filter. -.It EVFILT_PROCDESC +.It Dv EVFILT_PROCDESC Takes the process descriptor created by .Xr pdfork 2 to monitor as the identifier and the events to watch for in @@ -420,8 +440,8 @@ to monitor as the identifier and the eve and returns when the associated process performs one or more of the requested events. The events to monitor are: -.Bl -tag -width XXNOTE_EXIT -.It NOTE_EXIT +.Bl -tag -width "Dv NOTE_EXIT" +.It Dv NOTE_EXIT The process has exited. The exit status will be stored in .Va data . @@ -430,7 +450,7 @@ The exit status will be stored in On return, .Va fflags contains the events which triggered the filter. -.It EVFILT_SIGNAL +.It Dv EVFILT_SIGNAL Takes the signal number to monitor as the identifier and returns when the given signal is delivered to the process. This coexists with the @@ -440,7 +460,9 @@ and facilities, and has a lower precedence. The filter will record all attempts to deliver a signal to a process, even if the signal has -been marked as SIG_IGN, except for the +been marked as +.Dv SIG_IGN , +except for the .Dv SIGCHLD signal, which, if ignored, won't be recorded by the filter. Event notification happens after normal @@ -448,14 +470,18 @@ signal delivery processing. .Va data returns the number of times the signal has occurred since the last call to .Fn kevent . -This filter automatically sets the EV_CLEAR flag internally. -.It EVFILT_TIMER +This filter automatically sets the +.Dv EV_CLEAR +flag internally. +.It Dv EVFILT_TIMER Establishes an arbitrary timer identified by .Va ident . When adding a timer, .Va data specifies the timeout period. -The timer will be periodic unless EV_ONESHOT is specified. +The timer will be periodic unless +.Dv EV_ONESHOT +is specified. On return, .Va data contains the number of times the timeout has expired since the last call to @@ -465,7 +491,7 @@ There is a system wide limit on the numb which is controlled by the .Va kern.kq_calloutmax sysctl. -.Bl -tag -width XXNOTE_USECONDS +.Bl -tag -width "Dv NOTE_USECONDS" .It Dv NOTE_SECONDS .Va data is in seconds. @@ -493,7 +519,7 @@ user level code. The lower 24 bits of the .Va fflags may be used for user defined flags and manipulated using the following: -.Bl -tag -width XXNOTE_FFLAGSMASK +.Bl -tag -width "Dv NOTE_FFLAGSMASK" .It Dv NOTE_FFNOP Ignore the input .Va fflags . @@ -515,7 +541,7 @@ User defined flag mask for .El .Pp A user event is triggered for output with the following: -.Bl -tag -width XXNOTE_FFLAGSMASK +.Bl -tag -width "Dv NOTE_FFLAGSMASK" .It Dv NOTE_TRIGGER Cause the event to be triggered. .El From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 16:14:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDFDD2BA; Mon, 15 Dec 2014 16:14:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9F1D818A; Mon, 15 Dec 2014 16:14:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFGEols063239; Mon, 15 Dec 2014 16:14:50 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFGEo1q063237; Mon, 15 Dec 2014 16:14:50 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201412151614.sBFGEo1q063237@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 15 Dec 2014 16:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275807 - in stable/10: . sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 16:14:50 -0000 Author: sbruno Date: Mon Dec 15 16:14:49 2014 New Revision: 275807 URL: https://svnweb.freebsd.org/changeset/base/275807 Log: MFC r271982 and r271990 to support CentOS 6 ports. Modified: stable/10/UPDATING stable/10/sys/compat/linux/linux_mib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Dec 15 14:58:10 2014 (r275806) +++ stable/10/UPDATING Mon Dec 15 16:14:49 2014 (r275807) @@ -16,6 +16,16 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20141215: + At svn r271982, The default linux compat kernel ABI has been adjusted + to 2.6.18 in support of the linux-c6 compat ports infrastructure + update. If you wish to continue using the linux-f10 compat ports, + add compat.linux.osrelease=2.6.16 to your local sysctl.conf. Users are + encouraged to update their linux-compat packages to linux-c6 during + their next update cycle. + + See ports/UPDATING 20141202 on migration to CentOS 6 ports. + 20141205: pjdfstest has been integrated into kyua as an opt-in test suite. Please see share/doc/pjdfstest/README for a more details on how to Modified: stable/10/sys/compat/linux/linux_mib.c ============================================================================== --- stable/10/sys/compat/linux/linux_mib.c Mon Dec 15 14:58:10 2014 (r275806) +++ stable/10/sys/compat/linux/linux_mib.c Mon Dec 15 16:14:49 2014 (r275807) @@ -130,9 +130,9 @@ struct linux_prison { static struct linux_prison lprison0 = { .pr_osname = "Linux", - .pr_osrelease = "2.6.16", + .pr_osrelease = "2.6.18", .pr_oss_version = 0x030600, - .pr_osrel = 2006016 + .pr_osrel = 2006018 }; static unsigned linux_osd_jail_slot; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 17:52:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53870894; Mon, 15 Dec 2014 17:52:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3F94FEFB; Mon, 15 Dec 2014 17:52:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFHqAJ8011961; Mon, 15 Dec 2014 17:52:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFHq9VC011956; Mon, 15 Dec 2014 17:52:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412151752.sBFHq9VC011956@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Dec 2014 17:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275808 - in head/sys: dev/cxgbe/tom kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 17:52:10 -0000 Author: jhb Date: Mon Dec 15 17:52:08 2014 New Revision: 275808 URL: https://svnweb.freebsd.org/changeset/base/275808 Log: Check for SS_NBIO in so->so_state instead of sb->sb_flags in soreceive_stream(). Differential Revision: https://reviews.freebsd.org/D1299 Reviewed by: bz, gnn MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/kern/uipc_socket.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Mon Dec 15 16:14:49 2014 (r275807) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Mon Dec 15 17:52:08 2014 (r275808) @@ -1173,7 +1173,7 @@ restart: /* Socket buffer got some data that we shall deliver now. */ if (sbused(sb) && !(flags & MSG_WAITALL) && - ((sb->sb_flags & SS_NBIO) || + ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)) || sbused(sb) >= sb->sb_lowat || sbused(sb) >= uio->uio_resid || Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Dec 15 16:14:49 2014 (r275807) +++ head/sys/kern/uipc_socket.c Mon Dec 15 17:52:08 2014 (r275808) @@ -2002,7 +2002,7 @@ restart: /* Socket buffer got some data that we shall deliver now. */ if (sbavail(sb) > 0 && !(flags & MSG_WAITALL) && - ((sb->sb_flags & SS_NBIO) || + ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)) || sbavail(sb) >= sb->sb_lowat || sbavail(sb) >= uio->uio_resid || From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 18:13:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFB64FE6; Mon, 15 Dec 2014 18:13:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9B0CB1E2; Mon, 15 Dec 2014 18:13:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFID4G8022059; Mon, 15 Dec 2014 18:13:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFID4g8022058; Mon, 15 Dec 2014 18:13:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412151813.sBFID4g8022058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Dec 2014 18:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275809 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 18:13:04 -0000 Author: andrew Date: Mon Dec 15 18:13:03 2014 New Revision: 275809 URL: https://svnweb.freebsd.org/changeset/base/275809 Log: Revert r275778, gcc 4.2.1 doesn't handle -march=armv7. Modified: stable/10/share/mk/bsd.cpu.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.cpu.mk ============================================================================== --- stable/10/share/mk/bsd.cpu.mk Mon Dec 15 17:52:08 2014 (r275808) +++ stable/10/share/mk/bsd.cpu.mk Mon Dec 15 18:13:03 2014 (r275809) @@ -101,7 +101,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ . elif ${CPUTYPE} == "armv6" _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" -_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp +_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp . else _CPUCFLAGS = -mcpu=${CPUTYPE} . endif From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 18:18:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58A912A0; Mon, 15 Dec 2014 18:18:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 449EC239; Mon, 15 Dec 2014 18:18:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFIIwoS023000; Mon, 15 Dec 2014 18:18:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFIIwYM022999; Mon, 15 Dec 2014 18:18:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412151818.sBFIIwYM022999@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Dec 2014 18:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275810 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 18:18:58 -0000 Author: emaste Date: Mon Dec 15 18:18:57 2014 New Revision: 275810 URL: https://svnweb.freebsd.org/changeset/base/275810 Log: Correct elftoolchain strip(1) memory size calculation Calculate the segment's memory size (p_memsz) using the virtual addresses, not the file offsets. Otherwise padding preceeding SHT_NOBITS sections may be excluded from the calculation, resulting in a segment that is too small. PR: 195653 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/elfcopy/segments.c Modified: head/contrib/elftoolchain/elfcopy/segments.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/segments.c Mon Dec 15 18:13:03 2014 (r275809) +++ head/contrib/elftoolchain/elfcopy/segments.c Mon Dec 15 18:18:57 2014 (r275810) @@ -439,7 +439,7 @@ copy_phdr(struct elfcopy *ecp) seg->fsz = seg->msz = 0; for (i = 0; i < seg->nsec; i++) { s = seg->v_sec[i]; - seg->msz = s->off + s->sz - seg->off; + seg->msz = s->vma + s->sz - seg->addr; if (s->type != SHT_NOBITS) seg->fsz = seg->msz; } From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 18:22:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25DB4525; Mon, 15 Dec 2014 18:22:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0FDDF335; Mon, 15 Dec 2014 18:22:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFIMlqd027026; Mon, 15 Dec 2014 18:22:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFIMkwE027020; Mon, 15 Dec 2014 18:22:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412151822.sBFIMkwE027020@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Dec 2014 18:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275811 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 18:22:47 -0000 Author: delphij Date: Mon Dec 15 18:22:45 2014 New Revision: 275811 URL: https://svnweb.freebsd.org/changeset/base/275811 Log: MFV r275783: Convert ARC flags to use enum. Previously, public flags are defined in arc.h and private flags are defined in arc.c which can lead to confusion and programming errors. Consistently use 'hdr' (when referencing arc_buf_hdr_t) instead of 'buf' or 'ab' because arc_buf_t are often named 'buf' as well. Illumos issue: 5369 arc flags should be an enum 5370 consistent arc_buf_hdr_t naming scheme MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Dec 15 18:18:57 2014 (r275810) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Dec 15 18:22:45 2014 (r275811) @@ -1184,7 +1184,7 @@ visit_indirect(spa_t *spa, const dnode_p print_indirect(bp, zb, dnp); if (BP_GET_LEVEL(bp) > 0 && !BP_IS_HOLE(bp)) { - uint32_t flags = ARC_WAIT; + arc_flags_t flags = ARC_FLAG_WAIT; int i; blkptr_t *cbp; int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Dec 15 18:18:57 2014 (r275810) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Dec 15 18:22:45 2014 (r275811) @@ -618,7 +618,7 @@ struct arc_buf_hdr { arc_buf_hdr_t *b_hash_next; arc_buf_t *b_buf; - uint32_t b_flags; + arc_flags_t b_flags; uint32_t b_datacnt; arc_callback_t *b_acb; @@ -666,52 +666,26 @@ sysctl_vfs_zfs_arc_meta_limit(SYSCTL_HAN static arc_buf_t *arc_eviction_list; static kmutex_t arc_eviction_mtx; static arc_buf_hdr_t arc_eviction_hdr; -static void arc_get_data_buf(arc_buf_t *buf); -static void arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock); -static int arc_evict_needed(arc_buf_contents_t type); -static void arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes); -#ifdef illumos -static void arc_buf_watch(arc_buf_t *buf); -#endif /* illumos */ - -static boolean_t l2arc_write_eligible(uint64_t spa_guid, arc_buf_hdr_t *ab); #define GHOST_STATE(state) \ ((state) == arc_mru_ghost || (state) == arc_mfu_ghost || \ (state) == arc_l2c_only) -/* - * Private ARC flags. These flags are private ARC only flags that will show up - * in b_flags in the arc_hdr_buf_t. Some flags are publicly declared, and can - * be passed in as arc_flags in things like arc_read. However, these flags - * should never be passed and should only be set by ARC code. When adding new - * public flags, make sure not to smash the private ones. - */ - -#define ARC_IN_HASH_TABLE (1 << 9) /* this buffer is hashed */ -#define ARC_IO_IN_PROGRESS (1 << 10) /* I/O in progress for buf */ -#define ARC_IO_ERROR (1 << 11) /* I/O failed for buf */ -#define ARC_FREED_IN_READ (1 << 12) /* buf freed while in read */ -#define ARC_BUF_AVAILABLE (1 << 13) /* block not in active use */ -#define ARC_INDIRECT (1 << 14) /* this is an indirect block */ -#define ARC_FREE_IN_PROGRESS (1 << 15) /* hdr about to be freed */ -#define ARC_L2_WRITING (1 << 16) /* L2ARC write in progress */ -#define ARC_L2_EVICTED (1 << 17) /* evicted during I/O */ -#define ARC_L2_WRITE_HEAD (1 << 18) /* head of write list */ - -#define HDR_IN_HASH_TABLE(hdr) ((hdr)->b_flags & ARC_IN_HASH_TABLE) -#define HDR_IO_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_IO_IN_PROGRESS) -#define HDR_IO_ERROR(hdr) ((hdr)->b_flags & ARC_IO_ERROR) -#define HDR_PREFETCH(hdr) ((hdr)->b_flags & ARC_PREFETCH) -#define HDR_FREED_IN_READ(hdr) ((hdr)->b_flags & ARC_FREED_IN_READ) -#define HDR_BUF_AVAILABLE(hdr) ((hdr)->b_flags & ARC_BUF_AVAILABLE) -#define HDR_FREE_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_FREE_IN_PROGRESS) -#define HDR_L2CACHE(hdr) ((hdr)->b_flags & ARC_L2CACHE) -#define HDR_L2_READING(hdr) ((hdr)->b_flags & ARC_IO_IN_PROGRESS && \ - (hdr)->b_l2hdr != NULL) -#define HDR_L2_WRITING(hdr) ((hdr)->b_flags & ARC_L2_WRITING) -#define HDR_L2_EVICTED(hdr) ((hdr)->b_flags & ARC_L2_EVICTED) -#define HDR_L2_WRITE_HEAD(hdr) ((hdr)->b_flags & ARC_L2_WRITE_HEAD) +#define HDR_IN_HASH_TABLE(hdr) ((hdr)->b_flags & ARC_FLAG_IN_HASH_TABLE) +#define HDR_IO_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS) +#define HDR_IO_ERROR(hdr) ((hdr)->b_flags & ARC_FLAG_IO_ERROR) +#define HDR_PREFETCH(hdr) ((hdr)->b_flags & ARC_FLAG_PREFETCH) +#define HDR_FREED_IN_READ(hdr) ((hdr)->b_flags & ARC_FLAG_FREED_IN_READ) +#define HDR_BUF_AVAILABLE(hdr) ((hdr)->b_flags & ARC_FLAG_BUF_AVAILABLE) +#define HDR_FREE_IN_PROGRESS(hdr) \ + ((hdr)->b_flags & ARC_FLAG_FREE_IN_PROGRESS) +#define HDR_L2CACHE(hdr) ((hdr)->b_flags & ARC_FLAG_L2CACHE) +#define HDR_L2_READING(hdr) \ + ((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS && \ + (hdr)->b_l2hdr != NULL) +#define HDR_L2_WRITING(hdr) ((hdr)->b_flags & ARC_FLAG_L2_WRITING) +#define HDR_L2_EVICTED(hdr) ((hdr)->b_flags & ARC_FLAG_L2_EVICTED) +#define HDR_L2_WRITE_HEAD(hdr) ((hdr)->b_flags & ARC_FLAG_L2_WRITE_HEAD) /* * Other sizes @@ -903,14 +877,20 @@ static kmutex_t l2arc_feed_thr_lock; static kcondvar_t l2arc_feed_thr_cv; static uint8_t l2arc_thread_exit; -static void l2arc_read_done(zio_t *zio); +static void arc_get_data_buf(arc_buf_t *); +static void arc_access(arc_buf_hdr_t *, kmutex_t *); +static int arc_evict_needed(arc_buf_contents_t); +static void arc_evict_ghost(arc_state_t *, uint64_t, int64_t); +static void arc_buf_watch(arc_buf_t *); + +static boolean_t l2arc_write_eligible(uint64_t, arc_buf_hdr_t *); +static void l2arc_read_done(zio_t *); static void l2arc_hdr_stat_add(void); static void l2arc_hdr_stat_remove(void); -static boolean_t l2arc_compress_buf(l2arc_buf_hdr_t *l2hdr); -static void l2arc_decompress_zio(zio_t *zio, arc_buf_hdr_t *hdr, - enum zio_compress c); -static void l2arc_release_cdata_buf(arc_buf_hdr_t *ab); +static boolean_t l2arc_compress_buf(l2arc_buf_hdr_t *); +static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); +static void l2arc_release_cdata_buf(arc_buf_hdr_t *); static uint64_t buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth) @@ -955,14 +935,14 @@ buf_hash_find(uint64_t spa, const blkptr uint64_t birth = BP_PHYSICAL_BIRTH(bp); uint64_t idx = BUF_HASH_INDEX(spa, dva, birth); kmutex_t *hash_lock = BUF_HASH_LOCK(idx); - arc_buf_hdr_t *buf; + arc_buf_hdr_t *hdr; mutex_enter(hash_lock); - for (buf = buf_hash_table.ht_table[idx]; buf != NULL; - buf = buf->b_hash_next) { - if (BUF_EQUAL(spa, dva, birth, buf)) { + for (hdr = buf_hash_table.ht_table[idx]; hdr != NULL; + hdr = hdr->b_hash_next) { + if (BUF_EQUAL(spa, dva, birth, hdr)) { *lockp = hash_lock; - return (buf); + return (hdr); } } mutex_exit(hash_lock); @@ -977,27 +957,27 @@ buf_hash_find(uint64_t spa, const blkptr * Otherwise returns NULL. */ static arc_buf_hdr_t * -buf_hash_insert(arc_buf_hdr_t *buf, kmutex_t **lockp) +buf_hash_insert(arc_buf_hdr_t *hdr, kmutex_t **lockp) { - uint64_t idx = BUF_HASH_INDEX(buf->b_spa, &buf->b_dva, buf->b_birth); + uint64_t idx = BUF_HASH_INDEX(hdr->b_spa, &hdr->b_dva, hdr->b_birth); kmutex_t *hash_lock = BUF_HASH_LOCK(idx); - arc_buf_hdr_t *fbuf; + arc_buf_hdr_t *fhdr; uint32_t i; - ASSERT(!DVA_IS_EMPTY(&buf->b_dva)); - ASSERT(buf->b_birth != 0); - ASSERT(!HDR_IN_HASH_TABLE(buf)); + ASSERT(!DVA_IS_EMPTY(&hdr->b_dva)); + ASSERT(hdr->b_birth != 0); + ASSERT(!HDR_IN_HASH_TABLE(hdr)); *lockp = hash_lock; mutex_enter(hash_lock); - for (fbuf = buf_hash_table.ht_table[idx], i = 0; fbuf != NULL; - fbuf = fbuf->b_hash_next, i++) { - if (BUF_EQUAL(buf->b_spa, &buf->b_dva, buf->b_birth, fbuf)) - return (fbuf); + for (fhdr = buf_hash_table.ht_table[idx], i = 0; fhdr != NULL; + fhdr = fhdr->b_hash_next, i++) { + if (BUF_EQUAL(hdr->b_spa, &hdr->b_dva, hdr->b_birth, fhdr)) + return (fhdr); } - buf->b_hash_next = buf_hash_table.ht_table[idx]; - buf_hash_table.ht_table[idx] = buf; - buf->b_flags |= ARC_IN_HASH_TABLE; + hdr->b_hash_next = buf_hash_table.ht_table[idx]; + buf_hash_table.ht_table[idx] = hdr; + hdr->b_flags |= ARC_FLAG_IN_HASH_TABLE; /* collect some hash table performance data */ if (i > 0) { @@ -1015,22 +995,22 @@ buf_hash_insert(arc_buf_hdr_t *buf, kmut } static void -buf_hash_remove(arc_buf_hdr_t *buf) +buf_hash_remove(arc_buf_hdr_t *hdr) { - arc_buf_hdr_t *fbuf, **bufp; - uint64_t idx = BUF_HASH_INDEX(buf->b_spa, &buf->b_dva, buf->b_birth); + arc_buf_hdr_t *fhdr, **hdrp; + uint64_t idx = BUF_HASH_INDEX(hdr->b_spa, &hdr->b_dva, hdr->b_birth); ASSERT(MUTEX_HELD(BUF_HASH_LOCK(idx))); - ASSERT(HDR_IN_HASH_TABLE(buf)); + ASSERT(HDR_IN_HASH_TABLE(hdr)); - bufp = &buf_hash_table.ht_table[idx]; - while ((fbuf = *bufp) != buf) { - ASSERT(fbuf != NULL); - bufp = &fbuf->b_hash_next; - } - *bufp = buf->b_hash_next; - buf->b_hash_next = NULL; - buf->b_flags &= ~ARC_IN_HASH_TABLE; + hdrp = &buf_hash_table.ht_table[idx]; + while ((fhdr = *hdrp) != hdr) { + ASSERT(fhdr != NULL); + hdrp = &fhdr->b_hash_next; + } + *hdrp = hdr->b_hash_next; + hdr->b_hash_next = NULL; + hdr->b_flags &= ~ARC_FLAG_IN_HASH_TABLE; /* collect some hash table performance data */ ARCSTAT_BUMPDOWN(arcstat_hash_elements); @@ -1067,12 +1047,12 @@ buf_fini(void) static int hdr_cons(void *vbuf, void *unused, int kmflag) { - arc_buf_hdr_t *buf = vbuf; + arc_buf_hdr_t *hdr = vbuf; - bzero(buf, sizeof (arc_buf_hdr_t)); - refcount_create(&buf->b_refcnt); - cv_init(&buf->b_cv, NULL, CV_DEFAULT, NULL); - mutex_init(&buf->b_freeze_lock, NULL, MUTEX_DEFAULT, NULL); + bzero(hdr, sizeof (arc_buf_hdr_t)); + refcount_create(&hdr->b_refcnt); + cv_init(&hdr->b_cv, NULL, CV_DEFAULT, NULL); + mutex_init(&hdr->b_freeze_lock, NULL, MUTEX_DEFAULT, NULL); arc_space_consume(sizeof (arc_buf_hdr_t), ARC_SPACE_HDRS); return (0); @@ -1099,12 +1079,12 @@ buf_cons(void *vbuf, void *unused, int k static void hdr_dest(void *vbuf, void *unused) { - arc_buf_hdr_t *buf = vbuf; + arc_buf_hdr_t *hdr = vbuf; - ASSERT(BUF_EMPTY(buf)); - refcount_destroy(&buf->b_refcnt); - cv_destroy(&buf->b_cv); - mutex_destroy(&buf->b_freeze_lock); + ASSERT(BUF_EMPTY(hdr)); + refcount_destroy(&hdr->b_refcnt); + cv_destroy(&hdr->b_cv); + mutex_destroy(&hdr->b_freeze_lock); arc_space_return(sizeof (arc_buf_hdr_t), ARC_SPACE_HDRS); } @@ -1186,7 +1166,7 @@ arc_cksum_verify(arc_buf_t *buf) mutex_enter(&buf->b_hdr->b_freeze_lock); if (buf->b_hdr->b_freeze_cksum == NULL || - (buf->b_hdr->b_flags & ARC_IO_ERROR)) { + (buf->b_hdr->b_flags & ARC_FLAG_IO_ERROR)) { mutex_exit(&buf->b_hdr->b_freeze_lock); return; } @@ -1281,7 +1261,7 @@ arc_buf_thaw(arc_buf_t *buf) if (zfs_flags & ZFS_DEBUG_MODIFY) { if (buf->b_hdr->b_state != arc_anon) panic("modifying non-anon buffer!"); - if (buf->b_hdr->b_flags & ARC_IO_IN_PROGRESS) + if (buf->b_hdr->b_flags & ARC_FLAG_IO_IN_PROGRESS) panic("modifying buffer while i/o in progress!"); arc_cksum_verify(buf); } @@ -1324,11 +1304,11 @@ arc_buf_freeze(arc_buf_t *buf) } static void -get_buf_info(arc_buf_hdr_t *ab, arc_state_t *state, list_t **list, kmutex_t **lock) +get_buf_info(arc_buf_hdr_t *hdr, arc_state_t *state, list_t **list, kmutex_t **lock) { - uint64_t buf_hashid = buf_hash(ab->b_spa, &ab->b_dva, ab->b_birth); + uint64_t buf_hashid = buf_hash(hdr->b_spa, &hdr->b_dva, hdr->b_birth); - if (ab->b_type == ARC_BUFC_METADATA) + if (hdr->b_type == ARC_BUFC_METADATA) buf_hashid &= (ARC_BUFC_NUMMETADATALISTS - 1); else { buf_hashid &= (ARC_BUFC_NUMDATALISTS - 1); @@ -1341,59 +1321,59 @@ get_buf_info(arc_buf_hdr_t *ab, arc_stat static void -add_reference(arc_buf_hdr_t *ab, kmutex_t *hash_lock, void *tag) +add_reference(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, void *tag) { ASSERT(MUTEX_HELD(hash_lock)); - if ((refcount_add(&ab->b_refcnt, tag) == 1) && - (ab->b_state != arc_anon)) { - uint64_t delta = ab->b_size * ab->b_datacnt; - uint64_t *size = &ab->b_state->arcs_lsize[ab->b_type]; + if ((refcount_add(&hdr->b_refcnt, tag) == 1) && + (hdr->b_state != arc_anon)) { + uint64_t delta = hdr->b_size * hdr->b_datacnt; + uint64_t *size = &hdr->b_state->arcs_lsize[hdr->b_type]; list_t *list; kmutex_t *lock; - get_buf_info(ab, ab->b_state, &list, &lock); + get_buf_info(hdr, hdr->b_state, &list, &lock); ASSERT(!MUTEX_HELD(lock)); mutex_enter(lock); - ASSERT(list_link_active(&ab->b_arc_node)); - list_remove(list, ab); - if (GHOST_STATE(ab->b_state)) { - ASSERT0(ab->b_datacnt); - ASSERT3P(ab->b_buf, ==, NULL); - delta = ab->b_size; + ASSERT(list_link_active(&hdr->b_arc_node)); + list_remove(list, hdr); + if (GHOST_STATE(hdr->b_state)) { + ASSERT0(hdr->b_datacnt); + ASSERT3P(hdr->b_buf, ==, NULL); + delta = hdr->b_size; } ASSERT(delta > 0); ASSERT3U(*size, >=, delta); atomic_add_64(size, -delta); mutex_exit(lock); /* remove the prefetch flag if we get a reference */ - if (ab->b_flags & ARC_PREFETCH) - ab->b_flags &= ~ARC_PREFETCH; + if (hdr->b_flags & ARC_FLAG_PREFETCH) + hdr->b_flags &= ~ARC_FLAG_PREFETCH; } } static int -remove_reference(arc_buf_hdr_t *ab, kmutex_t *hash_lock, void *tag) +remove_reference(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, void *tag) { int cnt; - arc_state_t *state = ab->b_state; + arc_state_t *state = hdr->b_state; ASSERT(state == arc_anon || MUTEX_HELD(hash_lock)); ASSERT(!GHOST_STATE(state)); - if (((cnt = refcount_remove(&ab->b_refcnt, tag)) == 0) && + if (((cnt = refcount_remove(&hdr->b_refcnt, tag)) == 0) && (state != arc_anon)) { - uint64_t *size = &state->arcs_lsize[ab->b_type]; + uint64_t *size = &state->arcs_lsize[hdr->b_type]; list_t *list; kmutex_t *lock; - get_buf_info(ab, state, &list, &lock); + get_buf_info(hdr, state, &list, &lock); ASSERT(!MUTEX_HELD(lock)); mutex_enter(lock); - ASSERT(!list_link_active(&ab->b_arc_node)); - list_insert_head(list, ab); - ASSERT(ab->b_datacnt > 0); - atomic_add_64(size, ab->b_size * ab->b_datacnt); + ASSERT(!list_link_active(&hdr->b_arc_node)); + list_insert_head(list, hdr); + ASSERT(hdr->b_datacnt > 0); + atomic_add_64(size, hdr->b_size * hdr->b_datacnt); mutex_exit(lock); } return (cnt); @@ -1404,21 +1384,22 @@ remove_reference(arc_buf_hdr_t *ab, kmut * for the buffer must be held by the caller. */ static void -arc_change_state(arc_state_t *new_state, arc_buf_hdr_t *ab, kmutex_t *hash_lock) +arc_change_state(arc_state_t *new_state, arc_buf_hdr_t *hdr, + kmutex_t *hash_lock) { - arc_state_t *old_state = ab->b_state; - int64_t refcnt = refcount_count(&ab->b_refcnt); + arc_state_t *old_state = hdr->b_state; + int64_t refcnt = refcount_count(&hdr->b_refcnt); uint64_t from_delta, to_delta; list_t *list; kmutex_t *lock; ASSERT(MUTEX_HELD(hash_lock)); ASSERT3P(new_state, !=, old_state); - ASSERT(refcnt == 0 || ab->b_datacnt > 0); - ASSERT(ab->b_datacnt == 0 || !GHOST_STATE(new_state)); - ASSERT(ab->b_datacnt <= 1 || old_state != arc_anon); + ASSERT(refcnt == 0 || hdr->b_datacnt > 0); + ASSERT(hdr->b_datacnt == 0 || !GHOST_STATE(new_state)); + ASSERT(hdr->b_datacnt <= 1 || old_state != arc_anon); - from_delta = to_delta = ab->b_datacnt * ab->b_size; + from_delta = to_delta = hdr->b_datacnt * hdr->b_size; /* * If this buffer is evictable, transfer it from the @@ -1427,24 +1408,24 @@ arc_change_state(arc_state_t *new_state, if (refcnt == 0) { if (old_state != arc_anon) { int use_mutex; - uint64_t *size = &old_state->arcs_lsize[ab->b_type]; + uint64_t *size = &old_state->arcs_lsize[hdr->b_type]; - get_buf_info(ab, old_state, &list, &lock); + get_buf_info(hdr, old_state, &list, &lock); use_mutex = !MUTEX_HELD(lock); if (use_mutex) mutex_enter(lock); - ASSERT(list_link_active(&ab->b_arc_node)); - list_remove(list, ab); + ASSERT(list_link_active(&hdr->b_arc_node)); + list_remove(list, hdr); /* * If prefetching out of the ghost cache, * we will have a non-zero datacnt. */ - if (GHOST_STATE(old_state) && ab->b_datacnt == 0) { + if (GHOST_STATE(old_state) && hdr->b_datacnt == 0) { /* ghost elements have a ghost size */ - ASSERT(ab->b_buf == NULL); - from_delta = ab->b_size; + ASSERT(hdr->b_buf == NULL); + from_delta = hdr->b_size; } ASSERT3U(*size, >=, from_delta); atomic_add_64(size, -from_delta); @@ -1454,20 +1435,20 @@ arc_change_state(arc_state_t *new_state, } if (new_state != arc_anon) { int use_mutex; - uint64_t *size = &new_state->arcs_lsize[ab->b_type]; + uint64_t *size = &new_state->arcs_lsize[hdr->b_type]; - get_buf_info(ab, new_state, &list, &lock); + get_buf_info(hdr, new_state, &list, &lock); use_mutex = !MUTEX_HELD(lock); if (use_mutex) mutex_enter(lock); - list_insert_head(list, ab); + list_insert_head(list, hdr); /* ghost elements have a ghost size */ if (GHOST_STATE(new_state)) { - ASSERT(ab->b_datacnt == 0); - ASSERT(ab->b_buf == NULL); - to_delta = ab->b_size; + ASSERT(hdr->b_datacnt == 0); + ASSERT(hdr->b_buf == NULL); + to_delta = hdr->b_size; } atomic_add_64(size, to_delta); @@ -1476,9 +1457,9 @@ arc_change_state(arc_state_t *new_state, } } - ASSERT(!BUF_EMPTY(ab)); - if (new_state == arc_anon && HDR_IN_HASH_TABLE(ab)) - buf_hash_remove(ab); + ASSERT(!BUF_EMPTY(hdr)); + if (new_state == arc_anon && HDR_IN_HASH_TABLE(hdr)) + buf_hash_remove(hdr); /* adjust state sizes */ if (to_delta) @@ -1487,7 +1468,7 @@ arc_change_state(arc_state_t *new_state, ASSERT3U(old_state->arcs_size, >=, from_delta); atomic_add_64(&old_state->arcs_size, -from_delta); } - ab->b_state = new_state; + hdr->b_state = new_state; /* adjust l2arc hdr stats */ if (new_state == arc_l2c_only) @@ -1689,7 +1670,7 @@ arc_buf_add_ref(arc_buf_t *buf, void* ta arc_access(hdr, hash_lock); mutex_exit(hash_lock); ARCSTAT_BUMP(arcstat_hits); - ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_PREFETCH), + ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_FLAG_PREFETCH), demand, prefetch, hdr->b_type != ARC_BUFC_METADATA, data, metadata, hits); } @@ -1920,7 +1901,7 @@ arc_buf_free(arc_buf_t *buf, void *tag) } else { ASSERT(buf == hdr->b_buf); ASSERT(buf->b_efunc == NULL); - hdr->b_flags |= ARC_BUF_AVAILABLE; + hdr->b_flags |= ARC_FLAG_BUF_AVAILABLE; } mutex_exit(hash_lock); } else if (HDR_IO_IN_PROGRESS(hdr)) { @@ -1971,7 +1952,7 @@ arc_buf_remove_ref(arc_buf_t *buf, void* } else if (no_callback) { ASSERT(hdr->b_buf == buf && buf->b_next == NULL); ASSERT(buf->b_efunc == NULL); - hdr->b_flags |= ARC_BUF_AVAILABLE; + hdr->b_flags |= ARC_FLAG_BUF_AVAILABLE; } ASSERT(no_callback || hdr->b_datacnt > 1 || refcount_is_zero(&hdr->b_refcnt)); @@ -2047,7 +2028,7 @@ arc_evict(arc_state_t *state, uint64_t s arc_state_t *evicted_state; uint64_t bytes_evicted = 0, skipped = 0, missed = 0; int64_t bytes_remaining; - arc_buf_hdr_t *ab, *ab_prev = NULL; + arc_buf_hdr_t *hdr, *hdr_prev = NULL; list_t *evicted_list, *list, *evicted_list_start, *list_start; kmutex_t *lock, *evicted_lock; kmutex_t *hash_lock; @@ -2130,25 +2111,25 @@ evict_start: mutex_enter(lock); mutex_enter(evicted_lock); - for (ab = list_tail(list); ab; ab = ab_prev) { - ab_prev = list_prev(list, ab); - bytes_remaining -= (ab->b_size * ab->b_datacnt); + for (hdr = list_tail(list); hdr; hdr = hdr_prev) { + hdr_prev = list_prev(list, hdr); + bytes_remaining -= (hdr->b_size * hdr->b_datacnt); /* prefetch buffers have a minimum lifespan */ - if (HDR_IO_IN_PROGRESS(ab) || - (spa && ab->b_spa != spa) || - (ab->b_flags & (ARC_PREFETCH|ARC_INDIRECT) && - ddi_get_lbolt() - ab->b_arc_access < + if (HDR_IO_IN_PROGRESS(hdr) || + (spa && hdr->b_spa != spa) || + (hdr->b_flags & (ARC_FLAG_PREFETCH | ARC_FLAG_INDIRECT) && + ddi_get_lbolt() - hdr->b_arc_access < arc_min_prefetch_lifespan)) { skipped++; continue; } /* "lookahead" for better eviction candidate */ - if (recycle && ab->b_size != bytes && - ab_prev && ab_prev->b_size == bytes) + if (recycle && hdr->b_size != bytes && + hdr_prev && hdr_prev->b_size == bytes) continue; /* ignore markers */ - if (ab->b_spa == 0) + if (hdr->b_spa == 0) continue; /* @@ -2161,34 +2142,34 @@ evict_start: * the hot code path, so don't sleep. */ if (!recycle && count++ > arc_evict_iterations) { - list_insert_after(list, ab, &marker); + list_insert_after(list, hdr, &marker); mutex_exit(evicted_lock); mutex_exit(lock); kpreempt(KPREEMPT_SYNC); mutex_enter(lock); mutex_enter(evicted_lock); - ab_prev = list_prev(list, &marker); + hdr_prev = list_prev(list, &marker); list_remove(list, &marker); count = 0; continue; } - hash_lock = HDR_LOCK(ab); + hash_lock = HDR_LOCK(hdr); have_lock = MUTEX_HELD(hash_lock); if (have_lock || mutex_tryenter(hash_lock)) { - ASSERT0(refcount_count(&ab->b_refcnt)); - ASSERT(ab->b_datacnt > 0); - while (ab->b_buf) { - arc_buf_t *buf = ab->b_buf; + ASSERT0(refcount_count(&hdr->b_refcnt)); + ASSERT(hdr->b_datacnt > 0); + while (hdr->b_buf) { + arc_buf_t *buf = hdr->b_buf; if (!mutex_tryenter(&buf->b_evict_lock)) { missed += 1; break; } if (buf->b_data) { - bytes_evicted += ab->b_size; - if (recycle && ab->b_type == type && - ab->b_size == bytes && - !HDR_L2_WRITING(ab)) { + bytes_evicted += hdr->b_size; + if (recycle && hdr->b_type == type && + hdr->b_size == bytes && + !HDR_L2_WRITING(hdr)) { stolen = buf->b_data; recycle = FALSE; } @@ -2197,7 +2178,7 @@ evict_start: mutex_enter(&arc_eviction_mtx); arc_buf_destroy(buf, buf->b_data == stolen, FALSE); - ab->b_buf = buf->b_next; + hdr->b_buf = buf->b_next; buf->b_hdr = &arc_eviction_hdr; buf->b_next = arc_eviction_list; arc_eviction_list = buf; @@ -2210,26 +2191,26 @@ evict_start: } } - if (ab->b_l2hdr) { + if (hdr->b_l2hdr) { ARCSTAT_INCR(arcstat_evict_l2_cached, - ab->b_size); + hdr->b_size); } else { - if (l2arc_write_eligible(ab->b_spa, ab)) { + if (l2arc_write_eligible(hdr->b_spa, hdr)) { ARCSTAT_INCR(arcstat_evict_l2_eligible, - ab->b_size); + hdr->b_size); } else { ARCSTAT_INCR( arcstat_evict_l2_ineligible, - ab->b_size); + hdr->b_size); } } - if (ab->b_datacnt == 0) { - arc_change_state(evicted_state, ab, hash_lock); - ASSERT(HDR_IN_HASH_TABLE(ab)); - ab->b_flags |= ARC_IN_HASH_TABLE; - ab->b_flags &= ~ARC_BUF_AVAILABLE; - DTRACE_PROBE1(arc__evict, arc_buf_hdr_t *, ab); + if (hdr->b_datacnt == 0) { + arc_change_state(evicted_state, hdr, hash_lock); + ASSERT(HDR_IN_HASH_TABLE(hdr)); + hdr->b_flags |= ARC_FLAG_IN_HASH_TABLE; + hdr->b_flags &= ~ARC_FLAG_BUF_AVAILABLE; + DTRACE_PROBE1(arc__evict, arc_buf_hdr_t *, hdr); } if (!have_lock) mutex_exit(hash_lock); @@ -2290,7 +2271,7 @@ evict_start: static void arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes) { - arc_buf_hdr_t *ab, *ab_prev; + arc_buf_hdr_t *hdr, *hdr_prev; arc_buf_hdr_t marker = { 0 }; list_t *list, *list_start; kmutex_t *hash_lock, *lock; @@ -2315,18 +2296,18 @@ evict_start: lock = ARCS_LOCK(state, idx + offset); mutex_enter(lock); - for (ab = list_tail(list); ab; ab = ab_prev) { - ab_prev = list_prev(list, ab); - if (ab->b_type > ARC_BUFC_NUMTYPES) - panic("invalid ab=%p", (void *)ab); - if (spa && ab->b_spa != spa) + for (hdr = list_tail(list); hdr; hdr = hdr_prev) { + hdr_prev = list_prev(list, hdr); + if (hdr->b_type > ARC_BUFC_NUMTYPES) + panic("invalid hdr=%p", (void *)hdr); + if (spa && hdr->b_spa != spa) continue; /* ignore markers */ - if (ab->b_spa == 0) + if (hdr->b_spa == 0) continue; - hash_lock = HDR_LOCK(ab); + hash_lock = HDR_LOCK(hdr); /* caller may be trying to modify this buffer, skip it */ if (MUTEX_HELD(hash_lock)) continue; @@ -2338,35 +2319,35 @@ evict_start: * before reacquiring the lock. */ if (count++ > arc_evict_iterations) { - list_insert_after(list, ab, &marker); + list_insert_after(list, hdr, &marker); mutex_exit(lock); kpreempt(KPREEMPT_SYNC); mutex_enter(lock); - ab_prev = list_prev(list, &marker); + hdr_prev = list_prev(list, &marker); list_remove(list, &marker); count = 0; continue; } if (mutex_tryenter(hash_lock)) { - ASSERT(!HDR_IO_IN_PROGRESS(ab)); - ASSERT(ab->b_buf == NULL); + ASSERT(!HDR_IO_IN_PROGRESS(hdr)); + ASSERT(hdr->b_buf == NULL); ARCSTAT_BUMP(arcstat_deleted); - bytes_deleted += ab->b_size; + bytes_deleted += hdr->b_size; - if (ab->b_l2hdr != NULL) { + if (hdr->b_l2hdr != NULL) { /* * This buffer is cached on the 2nd Level ARC; * don't destroy the header. */ - arc_change_state(arc_l2c_only, ab, hash_lock); + arc_change_state(arc_l2c_only, hdr, hash_lock); mutex_exit(hash_lock); } else { - arc_change_state(arc_anon, ab, hash_lock); + arc_change_state(arc_anon, hdr, hash_lock); mutex_exit(hash_lock); - arc_hdr_destroy(ab); + arc_hdr_destroy(hdr); } - DTRACE_PROBE1(arc__delete, arc_buf_hdr_t *, ab); + DTRACE_PROBE1(arc__delete, arc_buf_hdr_t *, hdr); if (bytes >= 0 && bytes_deleted >= bytes) break; } else if (bytes < 0) { @@ -2375,12 +2356,12 @@ evict_start: * hash lock to become available. Once its * available, restart from where we left off. */ - list_insert_after(list, ab, &marker); + list_insert_after(list, hdr, &marker); mutex_exit(lock); mutex_enter(hash_lock); mutex_exit(hash_lock); mutex_enter(lock); - ab_prev = list_prev(list, &marker); + hdr_prev = list_prev(list, &marker); list_remove(list, &marker); } else { bufs_skipped += 1; @@ -2965,7 +2946,8 @@ arc_get_data_buf(arc_buf_t *buf) * will end up on the mru list; so steal space from there. */ if (state == arc_mfu_ghost) - state = buf->b_hdr->b_flags & ARC_PREFETCH ? arc_mru : arc_mfu; + state = buf->b_hdr->b_flags & ARC_FLAG_PREFETCH ? + arc_mru : arc_mfu; else if (state == arc_mru_ghost) state = arc_mru; @@ -3021,25 +3003,25 @@ out: * NOTE: the hash lock is dropped in this function. */ static void -arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock) +arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) { clock_t now; ASSERT(MUTEX_HELD(hash_lock)); - if (buf->b_state == arc_anon) { + if (hdr->b_state == arc_anon) { /* * This buffer is not in the cache, and does not * appear in our "ghost" list. Add the new buffer * to the MRU state. */ - ASSERT(buf->b_arc_access == 0); - buf->b_arc_access = ddi_get_lbolt(); - DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, buf); - arc_change_state(arc_mru, buf, hash_lock); + ASSERT(hdr->b_arc_access == 0); + hdr->b_arc_access = ddi_get_lbolt(); + DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, hdr); + arc_change_state(arc_mru, hdr, hash_lock); - } else if (buf->b_state == arc_mru) { + } else if (hdr->b_state == arc_mru) { now = ddi_get_lbolt(); /* @@ -3050,14 +3032,14 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * - move the buffer to the head of the list if this is * another prefetch (to make it less likely to be evicted). */ - if ((buf->b_flags & ARC_PREFETCH) != 0) { - if (refcount_count(&buf->b_refcnt) == 0) { - ASSERT(list_link_active(&buf->b_arc_node)); + if ((hdr->b_flags & ARC_FLAG_PREFETCH) != 0) { + if (refcount_count(&hdr->b_refcnt) == 0) { + ASSERT(list_link_active(&hdr->b_arc_node)); } else { - buf->b_flags &= ~ARC_PREFETCH; + hdr->b_flags &= ~ARC_FLAG_PREFETCH; ARCSTAT_BUMP(arcstat_mru_hits); } - buf->b_arc_access = now; + hdr->b_arc_access = now; return; } @@ -3066,18 +3048,18 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * but it is still in the cache. Move it to the MFU * state. */ - if (now > buf->b_arc_access + ARC_MINTIME) { + if (now > hdr->b_arc_access + ARC_MINTIME) { /* * More than 125ms have passed since we * instantiated this buffer. Move it to the * most frequently used state. */ - buf->b_arc_access = now; - DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); - arc_change_state(arc_mfu, buf, hash_lock); + hdr->b_arc_access = now; + DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); + arc_change_state(arc_mfu, hdr, hash_lock); } ARCSTAT_BUMP(arcstat_mru_hits); - } else if (buf->b_state == arc_mru_ghost) { + } else if (hdr->b_state == arc_mru_ghost) { arc_state_t *new_state; /* * This buffer has been "accessed" recently, but @@ -3085,21 +3067,21 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * MFU state. */ - if (buf->b_flags & ARC_PREFETCH) { + if (hdr->b_flags & ARC_FLAG_PREFETCH) { new_state = arc_mru; - if (refcount_count(&buf->b_refcnt) > 0) - buf->b_flags &= ~ARC_PREFETCH; - DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, buf); + if (refcount_count(&hdr->b_refcnt) > 0) + hdr->b_flags &= ~ARC_FLAG_PREFETCH; + DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, hdr); } else { new_state = arc_mfu; - DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); + DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); } - buf->b_arc_access = ddi_get_lbolt(); - arc_change_state(new_state, buf, hash_lock); + hdr->b_arc_access = ddi_get_lbolt(); + arc_change_state(new_state, hdr, hash_lock); ARCSTAT_BUMP(arcstat_mru_ghost_hits); - } else if (buf->b_state == arc_mfu) { + } else if (hdr->b_state == arc_mfu) { /* * This buffer has been accessed more than once and is * still in the cache. Keep it in the MFU state. @@ -3109,13 +3091,13 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * If it was a prefetch, we will explicitly move it to * the head of the list now. */ - if ((buf->b_flags & ARC_PREFETCH) != 0) { - ASSERT(refcount_count(&buf->b_refcnt) == 0); - ASSERT(list_link_active(&buf->b_arc_node)); + if ((hdr->b_flags & ARC_FLAG_PREFETCH) != 0) { + ASSERT(refcount_count(&hdr->b_refcnt) == 0); + ASSERT(list_link_active(&hdr->b_arc_node)); } ARCSTAT_BUMP(arcstat_mfu_hits); - buf->b_arc_access = ddi_get_lbolt(); - } else if (buf->b_state == arc_mfu_ghost) { + hdr->b_arc_access = ddi_get_lbolt(); + } else if (hdr->b_state == arc_mfu_ghost) { arc_state_t *new_state = arc_mfu; /* * This buffer has been accessed more than once but has @@ -3123,28 +3105,28 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t * MFU state. */ - if (buf->b_flags & ARC_PREFETCH) { + if (hdr->b_flags & ARC_FLAG_PREFETCH) { /* * This is a prefetch access... * move this block back to the MRU state. */ - ASSERT0(refcount_count(&buf->b_refcnt)); + ASSERT0(refcount_count(&hdr->b_refcnt)); new_state = arc_mru; } - buf->b_arc_access = ddi_get_lbolt(); - DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); - arc_change_state(new_state, buf, hash_lock); + hdr->b_arc_access = ddi_get_lbolt(); + DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); + arc_change_state(new_state, hdr, hash_lock); ARCSTAT_BUMP(arcstat_mfu_ghost_hits); - } else if (buf->b_state == arc_l2c_only) { + } else if (hdr->b_state == arc_l2c_only) { /* * This buffer is on the 2nd Level ARC. */ - buf->b_arc_access = ddi_get_lbolt(); - DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); - arc_change_state(arc_mfu, buf, hash_lock); + hdr->b_arc_access = ddi_get_lbolt(); + DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); + arc_change_state(arc_mfu, hdr, hash_lock); } else { ASSERT(!"invalid arc state"); } @@ -3212,9 +3194,9 @@ arc_read_done(zio_t *zio) (found == hdr && HDR_L2_READING(hdr))); } - hdr->b_flags &= ~ARC_L2_EVICTED; - if (l2arc_noprefetch && (hdr->b_flags & ARC_PREFETCH)) - hdr->b_flags &= ~ARC_L2CACHE; + hdr->b_flags &= ~ARC_FLAG_L2_EVICTED; + if (l2arc_noprefetch && (hdr->b_flags & ARC_FLAG_PREFETCH)) + hdr->b_flags &= ~ARC_FLAG_L2CACHE; /* byteswap if necessary */ callback_list = hdr->b_acb; @@ -3256,18 +3238,18 @@ arc_read_done(zio_t *zio) } } hdr->b_acb = NULL; - hdr->b_flags &= ~ARC_IO_IN_PROGRESS; + hdr->b_flags &= ~ARC_FLAG_IO_IN_PROGRESS; ASSERT(!HDR_BUF_AVAILABLE(hdr)); if (abuf == buf) { ASSERT(buf->b_efunc == NULL); ASSERT(hdr->b_datacnt == 1); - hdr->b_flags |= ARC_BUF_AVAILABLE; + hdr->b_flags |= ARC_FLAG_BUF_AVAILABLE; } ASSERT(refcount_is_zero(&hdr->b_refcnt) || callback_list != NULL); if (zio->io_error != 0) { - hdr->b_flags |= ARC_IO_ERROR; + hdr->b_flags |= ARC_FLAG_IO_ERROR; if (hdr->b_state != arc_anon) arc_change_state(arc_anon, hdr, hash_lock); if (HDR_IN_HASH_TABLE(hdr)) @@ -3333,8 +3315,8 @@ arc_read_done(zio_t *zio) */ int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, - void *private, zio_priority_t priority, int zio_flags, uint32_t *arc_flags, - const zbookmark_phys_t *zb) + void *private, zio_priority_t priority, int zio_flags, + arc_flags_t *arc_flags, const zbookmark_phys_t *zb) { arc_buf_hdr_t *hdr = NULL; arc_buf_t *buf = NULL; @@ -3356,16 +3338,16 @@ top: if (hdr != NULL && hdr->b_datacnt > 0) { - *arc_flags |= ARC_CACHED; + *arc_flags |= ARC_FLAG_CACHED; if (HDR_IO_IN_PROGRESS(hdr)) { - if (*arc_flags & ARC_WAIT) { + if (*arc_flags & ARC_FLAG_WAIT) { cv_wait(&hdr->b_cv, hash_lock); mutex_exit(hash_lock); goto top; } - ASSERT(*arc_flags & ARC_NOWAIT); + ASSERT(*arc_flags & ARC_FLAG_NOWAIT); if (done) { arc_callback_t *acb = NULL; @@ -3403,24 +3385,24 @@ top: ASSERT(buf->b_data); if (HDR_BUF_AVAILABLE(hdr)) { ASSERT(buf->b_efunc == NULL); - hdr->b_flags &= ~ARC_BUF_AVAILABLE; + hdr->b_flags &= ~ARC_FLAG_BUF_AVAILABLE; } else { buf = arc_buf_clone(buf); } - } else if (*arc_flags & ARC_PREFETCH && + } else if (*arc_flags & ARC_FLAG_PREFETCH && refcount_count(&hdr->b_refcnt) == 0) { - hdr->b_flags |= ARC_PREFETCH; + hdr->b_flags |= ARC_FLAG_PREFETCH; } DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr); arc_access(hdr, hash_lock); - if (*arc_flags & ARC_L2CACHE) - hdr->b_flags |= ARC_L2CACHE; - if (*arc_flags & ARC_L2COMPRESS) - hdr->b_flags |= ARC_L2COMPRESS; + if (*arc_flags & ARC_FLAG_L2CACHE) + hdr->b_flags |= ARC_FLAG_L2CACHE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 18:28:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 948C56BA; Mon, 15 Dec 2014 18:28:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 80FD136A; Mon, 15 Dec 2014 18:28:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFISNsE027987; Mon, 15 Dec 2014 18:28:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFISNdI027986; Mon, 15 Dec 2014 18:28:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412151828.sBFISNdI027986@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Dec 2014 18:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275812 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 18:28:23 -0000 Author: delphij Date: Mon Dec 15 18:28:22 2014 New Revision: 275812 URL: https://svnweb.freebsd.org/changeset/base/275812 Log: MFV r275784: Plug a memory leak in libzfs. In zfs_iter_bookmarks, an nvlist is allocated before calling lzc_get_bookmarks, which allocates the nvlist again (and overwrites the pointer to previously allocated list). Illumos issue: 5427 memory leak in libzfs when doing rollback MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Mon Dec 15 18:22:45 2014 (r275811) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Mon Dec 15 18:28:22 2014 (r275812) @@ -24,7 +24,7 @@ * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #include @@ -193,9 +193,6 @@ zfs_iter_bookmarks(zfs_handle_t *zhp, zf fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATETXG)); fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATION)); - /* Allocate an nvlist to hold the bookmarks. */ - bmarks = fnvlist_alloc(); - if ((err = lzc_get_bookmarks(zhp->zfs_name, props, &bmarks)) != 0) goto out; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 20:48:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDC2EE8; Mon, 15 Dec 2014 20:48:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D9CE5861; Mon, 15 Dec 2014 20:48:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFKm7iI097390; Mon, 15 Dec 2014 20:48:07 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFKm7du097388; Mon, 15 Dec 2014 20:48:07 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201412152048.sBFKm7du097388@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 15 Dec 2014 20:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275813 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 20:48:08 -0000 Author: dchagin Date: Mon Dec 15 20:48:06 2014 New Revision: 275813 URL: https://svnweb.freebsd.org/changeset/base/275813 Log: Properly sort Xr to silence mandoc warnings. Differential Revision: https://reviews.freebsd.org/D1314 Reviewed by: wblock MFC after: 1 Month Modified: head/share/man/man9/rmlock.9 head/share/man/man9/sx.9 Modified: head/share/man/man9/rmlock.9 ============================================================================== --- head/share/man/man9/rmlock.9 Mon Dec 15 18:28:22 2014 (r275812) +++ head/share/man/man9/rmlock.9 Mon Dec 15 20:48:06 2014 (r275813) @@ -289,8 +289,8 @@ Assert that the current thread does not .Xr mutex 9 , .Xr panic 9 , .Xr rwlock 9 , -.Xr sleep 9 , .Xr sema 9 , +.Xr sleep 9 , .Xr sx 9 .Sh HISTORY These Modified: head/share/man/man9/sx.9 ============================================================================== --- head/share/man/man9/sx.9 Mon Dec 15 18:28:22 2014 (r275812) +++ head/share/man/man9/sx.9 Mon Dec 15 20:48:06 2014 (r275813) @@ -315,8 +315,8 @@ lock while another thread blocked on the lock after acquiring a mutex, then the second thread would effectively end up sleeping while holding a mutex, which is not allowed. .Sh SEE ALSO -.Xr locking 9 , .Xr lock 9 , +.Xr locking 9 , .Xr mutex 9 , .Xr panic 9 , .Xr rwlock 9 , From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 21:04:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9A1D4F6; Mon, 15 Dec 2014 21:04:53 +0000 (UTC) Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com [IPv6:2a00:1450:4010:c04::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69EEDA44; Mon, 15 Dec 2014 21:04:53 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id 10so9957050lbg.1 for ; Mon, 15 Dec 2014 13:04:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=lTQ1RTHsecxXPKf3WveM00tPZ3Y27BXqphhpll1KLQU=; b=0yms5yjN1kTOF86l5hQ+H9W3N4SobBFiF5FxJotjIGg6KZ0mEjd1K+HWTZNPOXN55V NN8JU1StYKeQk3MSra/ZpbODStfUy/Gx20sT+YBclh8n/gE54ztlK2/e/LFzmLwjGlqk uDW+7fBQ2ElRosBk8pxeBawG/8eSSO8W4TTpxPSlCLR+MsekhgoD/CXnap45YwXjlnKo FXqzpavSzDqwBpee2M6hQXqzQ0BnlqxbCgpBC9GhDNqJjApLavEXpfEIvjkWc4nvvhfE bG+taEWuv1ahDJb6xuc5O0UomsoD0OHpzkBwuawJfcdOUP6MMDg5C6Nce8FuOfBQ9bp0 u9hA== MIME-Version: 1.0 X-Received: by 10.152.121.65 with SMTP id li1mr31978018lab.17.1418677491561; Mon, 15 Dec 2014 13:04:51 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.130.168 with HTTP; Mon, 15 Dec 2014 13:04:51 -0800 (PST) In-Reply-To: <201412151425.sBFEPhhs009026@svn.freebsd.org> References: <201412151425.sBFEPhhs009026@svn.freebsd.org> Date: Mon, 15 Dec 2014 13:04:51 -0800 X-Google-Sender-Auth: y8e-RrWvb26Dq7m93h7CW6kW39o Message-ID: Subject: Re: svn commit: r275804 - head/gnu/usr.bin/cc/cc1plus From: Craig Rodrigues To: Ed Maste Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 21:04:54 -0000 On Mon, Dec 15, 2014 at 6:25 AM, Ed Maste wrote: > > cfns.h: cfns.gperf > gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ > - ${.ALLSRC} > ${.TARGET} > + ${.ALLSRC} > ${.TARGET} || (rm -f ${.TARGET}; false) > > Instead of removing the target you could have done something like: cfns.h: cfns.gperf gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ ${.ALLSRC} > ${.TARGET}_temp mv ${.TARGET}_temp ${.TARGET} -- Craig From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 21:22:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 541B9BC1; Mon, 15 Dec 2014 21:22:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3FED1C71; Mon, 15 Dec 2014 21:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFLMh98016162; Mon, 15 Dec 2014 21:22:43 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFLMh9b016161; Mon, 15 Dec 2014 21:22:43 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201412152122.sBFLMh9b016161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 15 Dec 2014 21:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275814 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 21:22:43 -0000 Author: sbruno Date: Mon Dec 15 21:22:42 2014 New Revision: 275814 URL: https://svnweb.freebsd.org/changeset/base/275814 Log: Correct to the stable/10 commit in UPDATING and specify the correct ports/UPDATING note. Modified: stable/10/UPDATING Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Dec 15 20:48:06 2014 (r275813) +++ stable/10/UPDATING Mon Dec 15 21:22:42 2014 (r275814) @@ -17,14 +17,14 @@ stable/10, and then rebuild without this older version of current is a bit fragile. 20141215: - At svn r271982, The default linux compat kernel ABI has been adjusted + At svn r275807, The default linux compat kernel ABI has been adjusted to 2.6.18 in support of the linux-c6 compat ports infrastructure update. If you wish to continue using the linux-f10 compat ports, add compat.linux.osrelease=2.6.16 to your local sysctl.conf. Users are encouraged to update their linux-compat packages to linux-c6 during their next update cycle. - See ports/UPDATING 20141202 on migration to CentOS 6 ports. + See ports/UPDATING 20141209 and 20141215 on migration to CentOS 6 ports. 20141205: pjdfstest has been integrated into kyua as an opt-in test suite. From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 21:38:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFBF1217; Mon, 15 Dec 2014 21:38:25 +0000 (UTC) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74A13DF6; Mon, 15 Dec 2014 21:38:25 +0000 (UTC) Received: by mail-ig0-f179.google.com with SMTP id r2so5897428igi.6 for ; Mon, 15 Dec 2014 13:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=sIVo5vUZkSJQOYXk5S1PmQ1fI/Pl0iAT8cAgOAAk5pA=; b=zpoAIVNpjhi1Eot/hQ8ZNo74Tgc9/YDPcIPMCgNb80JhWJR+s9+ZSMW1yhDHH0KPB5 uoRJgrt0s45ztwQAWoxrtyOq0E9biz9FDAXqEqDojI/VtoLyrWDB6zswM1NpKxcgZ7nU 0Yj6XHj+x15YXueH+IL9f+WOAvGJ5VyUApYYy4lPB2Xntq/Y1OFyeYw0l1VcV58wjmyO ff1h6uUeLcs/tPk6K5kwATe62OAIs7ruRoR2EdtK4u6OyzQxuRpFScrxn32SU3mcdvZ4 tbmDgxTkPkp3tVA1pweWKqBP5XlkL9vnSs2GXNrIfhfOjvEB5Q8aDRs0Eufr+QbVoOfD CqIQ== X-Received: by 10.50.143.101 with SMTP id sd5mr20343187igb.40.1418679504857; Mon, 15 Dec 2014 13:38:24 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.0.85 with HTTP; Mon, 15 Dec 2014 13:38:04 -0800 (PST) In-Reply-To: References: <201412151425.sBFEPhhs009026@svn.freebsd.org> From: Ed Maste Date: Mon, 15 Dec 2014 16:38:04 -0500 X-Google-Sender-Auth: cOH6ljH6XxEyPnyErww6u1vnGro Message-ID: Subject: Re: svn commit: r275804 - head/gnu/usr.bin/cc/cc1plus To: Craig Rodrigues Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 21:38:25 -0000 On 15 December 2014 at 16:04, Craig Rodrigues wrote: > > > On Mon, Dec 15, 2014 at 6:25 AM, Ed Maste wrote: >> >> cfns.h: cfns.gperf >> gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ >> - ${.ALLSRC} > ${.TARGET} >> + ${.ALLSRC} > ${.TARGET} || (rm -f ${.TARGET}; false) >> > > Instead of removing the target you could have done something like: > > cfns.h: cfns.gperf > gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ > ${.ALLSRC} > ${.TARGET}_temp > mv ${.TARGET}_temp ${.TARGET} Yeah. There are already examples of both approaches in the tree; I don't see a reason to strongly prefer one over the other. From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 21:44:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CE8A42F; Mon, 15 Dec 2014 21:44:41 +0000 (UTC) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04CB5EBD; Mon, 15 Dec 2014 21:44:41 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id pv20so10159575lab.27 for ; Mon, 15 Dec 2014 13:44:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=H9Gtt/qHkPCTNrAj8/uiufgLeW6+LLp4bDIbX1MRz2I=; b=kpqsDg274vIeDpcMDuuvWJOkDSccyJlYyUw1t9ITxRi0wSetyqrH7heLa97IStDj/i DvaTr6V1PxhXJDpSd/+cW29rGP0AM+t/zUNBERuSZmZqQiJXj3aE3XHWMb5TpyFC271q n7sF4qXg5hyDTr5D7dDN4bE1Js3UQgKx2DtWUYSEd9OZQsHioVvyDY20AUBpFI2xytFK yTV9aaSzaRkMK85Dt5Wqef4ey8PlN+xjbf0knKpQptqOd5jtOH6Rh4z7i/YdEDtHyIn8 o94pjDQW/Uepva80lE+zFFVe/tmGHkucKdtvJ+gkwkPV9GEI6KUe8b2u2kgwmNX4hIz8 vo7Q== MIME-Version: 1.0 X-Received: by 10.152.121.65 with SMTP id li1mr32117921lab.17.1418679878405; Mon, 15 Dec 2014 13:44:38 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.130.168 with HTTP; Mon, 15 Dec 2014 13:44:38 -0800 (PST) In-Reply-To: References: <201412151425.sBFEPhhs009026@svn.freebsd.org> Date: Mon, 15 Dec 2014 13:44:38 -0800 X-Google-Sender-Auth: eI59YGS-GpvZMZNpQG9rxn1QJxc Message-ID: Subject: Re: svn commit: r275804 - head/gnu/usr.bin/cc/cc1plus From: Craig Rodrigues To: Ed Maste Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 21:44:41 -0000 On Mon, Dec 15, 2014 at 1:38 PM, Ed Maste wrote: > > > > cfns.h: cfns.gperf > > gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ > > ${.ALLSRC} > ${.TARGET}_temp > > mv ${.TARGET}_temp ${.TARGET} > > Yeah. There are already examples of both approaches in the tree; I > don't see a reason to strongly prefer one over the other. > For very large build systems, sometimes it is easier to debug weird build problems when the make operations do not have conditional logic in them. Also, not removing temporary files upon failure makes things easier to debug. -- Craig From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 22:20:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EECEF16; Mon, 15 Dec 2014 22:20:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 21389338; Mon, 15 Dec 2014 22:20:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFMKGvH041966; Mon, 15 Dec 2014 22:20:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFMKFhU041965; Mon, 15 Dec 2014 22:20:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412152220.sBFMKFhU041965@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Dec 2014 22:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275815 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 22:20:16 -0000 Author: emaste Date: Mon Dec 15 22:20:14 2014 New Revision: 275815 URL: https://svnweb.freebsd.org/changeset/base/275815 Log: Use standard BSD license disclaimer text Approved by: benno, nwhitehorn Modified: head/sys/dev/ofw/ofw_cpu.c Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Mon Dec 15 21:22:42 2014 (r275814) +++ head/sys/dev/ofw/ofw_cpu.c Mon Dec 15 22:20:14 2014 (r275815) @@ -11,16 +11,17 @@ * 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 Benno Rice ``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 TOOLS GMBH 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. + * 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 From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 22:30:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F82A5B7; Mon, 15 Dec 2014 22:30:32 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 3F15065C; Mon, 15 Dec 2014 22:30:32 +0000 (UTC) Received: from u10-2-32-011.office.norse-data.com (unknown [50.204.88.51]) by elvis.mu.org (Postfix) with ESMTPSA id 53E19341F83D; Mon, 15 Dec 2014 14:30:31 -0800 (PST) Message-ID: <548F6107.7030509@freebsd.org> Date: Mon, 15 Dec 2014 14:30:31 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Craig Rodrigues , Ed Maste Subject: Re: svn commit: r275804 - head/gnu/usr.bin/cc/cc1plus References: <201412151425.sBFEPhhs009026@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 22:30:32 -0000 On 12/15/14 1:44 PM, Craig Rodrigues wrote: > > > On Mon, Dec 15, 2014 at 1:38 PM, Ed Maste > wrote: > > > > cfns.h: cfns.gperf > > gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L > ANSI-C \ > > ${.ALLSRC} > ${.TARGET}_temp > > mv ${.TARGET}_temp ${.TARGET} > > Yeah. There are already examples of both approaches in the tree; I > don't see a reason to strongly prefer one over the other. > > > For very large build systems, sometimes it is easier to debug > weird build problems when the make operations do not have > conditional logic in them. +1 > Also, not removing temporary files upon failure > makes things easier to debug. +100 > > -- > Craig From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 23:01:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EEC5FC; Mon, 15 Dec 2014 23:01:35 +0000 (UTC) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5299B9AC; Mon, 15 Dec 2014 23:01:35 +0000 (UTC) Received: by mail-ig0-f182.google.com with SMTP id hn15so6007050igb.15 for ; Mon, 15 Dec 2014 15:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=V72h16qr9VefIhyxNPmm9b1zDEE9h29XxVf+CJX9nX4=; b=lakPOGiGM/3yznAZqaic7kL5QCVedHP7TTY1noPRx0KQpxJFIGruwlc9xZwipSbmrk sA0vghdpUzhi/KIAZOVljhIjy2Gv+IEpO+k5TJ2kJadplpn0VIyjeTwPGmR8kkN3rf5g rYdgVgSMZQsmKCI3u+Vlh4aWIs0pyflApiQbZnhdgFey+N4MlsaYRU0hv3XglEN4yiEN fbZL7OCpomQgpTS4ZZKYNiEH4g+9PcwTXMUVn/vGEcODG/gjpHRzmbgHiLHfOfuSxBmi uS5jCM239ddVuiEJIjWjbYycD4MVNjTsExMJDNrgIv42u5xWCdwQVbj+M+Fkuvehgt1k u4NQ== X-Received: by 10.107.158.70 with SMTP id h67mr10109502ioe.37.1418684494753; Mon, 15 Dec 2014 15:01:34 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.0.85 with HTTP; Mon, 15 Dec 2014 15:01:14 -0800 (PST) In-Reply-To: <548F6107.7030509@freebsd.org> References: <201412151425.sBFEPhhs009026@svn.freebsd.org> <548F6107.7030509@freebsd.org> From: Ed Maste Date: Mon, 15 Dec 2014 18:01:14 -0500 X-Google-Sender-Auth: KcWDCQ4ExglwTpA5Ijo5Tam3d_E Message-ID: Subject: Re: svn commit: r275804 - head/gnu/usr.bin/cc/cc1plus To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 Cc: Craig Rodrigues , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 23:01:35 -0000 >> Also, not removing temporary files upon failure >> makes things easier to debug. > > +100 In general I agree completely. In this case though such a change would just create an empty temporary file upon failure, which provides no additional help in tracking down the failure over the "gperf: not found" error that is already emitted. From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 06:13:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C169681; Tue, 16 Dec 2014 06:13:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 67D7EB9D; Tue, 16 Dec 2014 06:13:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBG6DV5a073827; Tue, 16 Dec 2014 06:13:31 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBG6DVDa073826; Tue, 16 Dec 2014 06:13:31 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201412160613.sBG6DVDa073826@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Tue, 16 Dec 2014 06:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275816 - head/sys/dev/sis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 06:13:31 -0000 Author: yongari Date: Tue Dec 16 06:13:30 2014 New Revision: 275816 URL: https://svnweb.freebsd.org/changeset/base/275816 Log: Fix a bug introdiced in r217548. According to NS DP83815 data sheet, RX filter should be disabled before programming. Previously it was clearing wrong bits so RX filter was not disabled in RX filter configuration. Reported by: brad@OpenBSD.org Modified: head/sys/dev/sis/if_sis.c Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Mon Dec 15 22:20:14 2014 (r275815) +++ head/sys/dev/sis/if_sis.c Tue Dec 16 06:13:30 2014 (r275816) @@ -780,7 +780,7 @@ sis_rxfilter_sis(struct sis_softc *sc) filter = CSR_READ_4(sc, SIS_RXFILT_CTL); if (filter & SIS_RXFILTCTL_ENABLE) { - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE); CSR_READ_4(sc, SIS_RXFILT_CTL); } filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 06:33:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35540B2D; Tue, 16 Dec 2014 06:33:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 21D45DAA; Tue, 16 Dec 2014 06:33:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBG6Xxlo083738; Tue, 16 Dec 2014 06:33:59 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBG6XwA5083737; Tue, 16 Dec 2014 06:33:58 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412160633.sBG6XwA5083737@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Tue, 16 Dec 2014 06:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275817 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 06:33:59 -0000 Author: neel Date: Tue Dec 16 06:33:57 2014 New Revision: 275817 URL: https://svnweb.freebsd.org/changeset/base/275817 Log: For level triggered interrupts clear the PIC IRR bit when the interrupt pin is deasserted. Prior to this change each assertion on a level triggered irq pin resulted in two interrupts being delivered to the CPU. Differential Revision: https://reviews.freebsd.org/D1310 Reviewed by: tychon MFC after: 1 week Modified: head/sys/amd64/vmm/io/vatpic.c Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Tue Dec 16 06:13:30 2014 (r275816) +++ head/sys/amd64/vmm/io/vatpic.c Tue Dec 16 06:33:57 2014 (r275817) @@ -388,6 +388,8 @@ vatpic_set_pinstate(struct vatpic *vatpi } else if (oldcnt == 1 && newcnt == 0) { /* falling edge */ VATPIC_CTR1(vatpic, "atpic pin%d: deasserted", pin); + if (level) + atpic->request &= ~(1 << (pin & 0x7)); } else { VATPIC_CTR3(vatpic, "atpic pin%d: %s, ignored, acnt %d", pin, newstate ? "asserted" : "deasserted", newcnt); From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 08:29:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4255998; Tue, 16 Dec 2014 08:29:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 84D80A93; Tue, 16 Dec 2014 08:29:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBG8T3gZ036724; Tue, 16 Dec 2014 08:29:03 GMT (envelope-from gleb@FreeBSD.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBG8T3oi036722; Tue, 16 Dec 2014 08:29:03 GMT (envelope-from gleb@FreeBSD.org) Message-Id: <201412160829.sBG8T3oi036722@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gleb set sender to gleb@FreeBSD.org using -f From: Gleb Kurtsou Date: Tue, 16 Dec 2014 08:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275818 - head/sbin/shutdown X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 08:29:03 -0000 Author: gleb Date: Tue Dec 16 08:29:02 2014 New Revision: 275818 URL: https://svnweb.freebsd.org/changeset/base/275818 Log: sbin/shutdown: Support time units as in 'shutdown -r +5sec' Units supported: s, sec, m, min, h, hour. Differential Revision: https://reviews.freebsd.org/D1272 Modified: head/sbin/shutdown/shutdown.8 head/sbin/shutdown/shutdown.c Modified: head/sbin/shutdown/shutdown.8 ============================================================================== --- head/sbin/shutdown/shutdown.8 Tue Dec 16 06:33:57 2014 (r275817) +++ head/sbin/shutdown/shutdown.8 Tue Dec 16 08:29:02 2014 (r275818) @@ -28,7 +28,7 @@ .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd December 15, 2014 .Dt SHUTDOWN 8 .Os .Sh NAME @@ -118,6 +118,15 @@ to the current system values. The first form brings the system down in .Ar number minutes and the second at the absolute time specified. +.Ar +number +may be specified in units other than minutes by appending the corresponding +suffix: +.Dq Li s , +.Dq Li sec , +.Dq Li m , +.Dq Li min . +.Dq Li h , +.Dq Li hour . .It Ar warning-message Any other arguments comprise the warning message that is broadcast to users currently logged into the system. Modified: head/sbin/shutdown/shutdown.c ============================================================================== --- head/sbin/shutdown/shutdown.c Tue Dec 16 06:33:57 2014 (r275817) +++ head/sbin/shutdown/shutdown.c Tue Dec 16 08:29:02 2014 (r275818) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -322,7 +323,8 @@ timewarn(int timeleft) (void)fprintf(pf, "System going down in %d minute%s\n\n", timeleft / 60, (timeleft > 60) ? "s" : ""); else if (timeleft) - (void)fprintf(pf, "System going down in 30 seconds\n\n"); + (void)fprintf(pf, "System going down in %s30 seconds\n\n", + (offset > 0 && offset < 30 ? "less than " : "")); else (void)fprintf(pf, "System going down IMMEDIATELY\n\n"); @@ -415,6 +417,7 @@ getoffset(char *timearg) char *p; time_t now; int this_year; + char *timeunit; (void)time(&now); @@ -427,8 +430,25 @@ getoffset(char *timearg) if (*timearg == '+') { /* +minutes */ if (!isdigit(*++timearg)) badtime(); - if ((offset = atoi(timearg) * 60) < 0) + errno = 0; + offset = strtol(timearg, &timeunit, 10); + if (offset < 0 || offset == LONG_MAX || errno != 0) badtime(); + if (timeunit[0] == '\0' || strcasecmp(timeunit, "m") == 0 || + strcasecmp(timeunit, "min") == 0 || + strcasecmp(timeunit, "mins") == 0) { + offset *= 60; + } else if (strcasecmp(timeunit, "h") == 0 || + strcasecmp(timeunit, "hour") == 0 || + strcasecmp(timeunit, "hours") == 0) { + offset *= 60 * 60; + } else if (strcasecmp(timeunit, "s") == 0 || + strcasecmp(timeunit, "sec") == 0 || + strcasecmp(timeunit, "secs") == 0) { + offset *= 1; + } else { + badtime(); + } shuttime = now + offset; return; } From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 09:22:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E008F5B1; Tue, 16 Dec 2014 09:22:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CA60795; Tue, 16 Dec 2014 09:22:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBG9M2XD065032; Tue, 16 Dec 2014 09:22:02 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBG9LvFY064961; Tue, 16 Dec 2014 09:21:57 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201412160921.sBG9LvFY064961@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 16 Dec 2014 09:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275819 - in head/lib/msun: ld128 ld80 src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 09:22:03 -0000 Author: ed Date: Tue Dec 16 09:21:56 2014 New Revision: 275819 URL: https://svnweb.freebsd.org/changeset/base/275819 Log: Rename cpack*() to CMPLX*(). The C11 standard introduced a set of macros (CMPLX, CMPLXF, CMPLXL) that can be used to construct complex numbers from a pair of real and imaginary numbers. Unfortunately, they require some compiler support, which is why we only define them for Clang and GCC>=4.7. The cpack() function in libm performs the same task as CMPLX(), but cannot be used to generate compile-time constants. This means that all invocations of cpack() can safely be replaced by C11's CMPLX(). To keep the code building with GCC 4.2, provide copies of CMPLX() that can at least be used to generate run-time complex numbers. This makes it easier to build some of the functions outside of libm. Modified: head/lib/msun/ld128/k_expl.h head/lib/msun/ld80/k_expl.h head/lib/msun/src/catrig.c head/lib/msun/src/catrigf.c head/lib/msun/src/k_exp.c head/lib/msun/src/k_expf.c head/lib/msun/src/math_private.h head/lib/msun/src/s_ccosh.c head/lib/msun/src/s_ccoshf.c head/lib/msun/src/s_cexp.c head/lib/msun/src/s_cexpf.c head/lib/msun/src/s_conj.c head/lib/msun/src/s_conjf.c head/lib/msun/src/s_conjl.c head/lib/msun/src/s_cproj.c head/lib/msun/src/s_cprojf.c head/lib/msun/src/s_cprojl.c head/lib/msun/src/s_csinh.c head/lib/msun/src/s_csinhf.c head/lib/msun/src/s_csqrt.c head/lib/msun/src/s_csqrtf.c head/lib/msun/src/s_csqrtl.c head/lib/msun/src/s_ctanh.c head/lib/msun/src/s_ctanhf.c Modified: head/lib/msun/ld128/k_expl.h ============================================================================== --- head/lib/msun/ld128/k_expl.h Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/ld128/k_expl.h Tue Dec 16 09:21:56 2014 (r275819) @@ -322,7 +322,7 @@ __ldexp_cexpl(long double complex z, int scale2 = 1; SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt); - return (cpackl(cos(y) * exp_x * scale1 * scale2, + return (CMPLXL(cos(y) * exp_x * scale1 * scale2, sinl(y) * exp_x * scale1 * scale2)); } #endif /* _COMPLEX_H */ Modified: head/lib/msun/ld80/k_expl.h ============================================================================== --- head/lib/msun/ld80/k_expl.h Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/ld80/k_expl.h Tue Dec 16 09:21:56 2014 (r275819) @@ -299,7 +299,7 @@ __ldexp_cexpl(long double complex z, int scale2 = 1; SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt); - return (cpackl(cos(y) * exp_x * scale1 * scale2, + return (CMPLXL(cos(y) * exp_x * scale1 * scale2, sinl(y) * exp_x * scale1 * scale2)); } #endif /* _COMPLEX_H */ Modified: head/lib/msun/src/catrig.c ============================================================================== --- head/lib/msun/src/catrig.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/catrig.c Tue Dec 16 09:21:56 2014 (r275819) @@ -286,19 +286,19 @@ casinh(double complex z) if (isnan(x) || isnan(y)) { /* casinh(+-Inf + I*NaN) = +-Inf + I*NaN */ if (isinf(x)) - return (cpack(x, y + y)); + return (CMPLX(x, y + y)); /* casinh(NaN + I*+-Inf) = opt(+-)Inf + I*NaN */ if (isinf(y)) - return (cpack(y, x + x)); + return (CMPLX(y, x + x)); /* casinh(NaN + I*0) = NaN + I*0 */ if (y == 0) - return (cpack(x + x, y)); + return (CMPLX(x + x, y)); /* * All other cases involving NaN return NaN + I*NaN. * C99 leaves it optional whether to raise invalid if one of * the arguments is not NaN, so we opt not to raise it. */ - return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLX(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { @@ -307,7 +307,7 @@ casinh(double complex z) w = clog_for_large_values(z) + m_ln2; else w = clog_for_large_values(-z) + m_ln2; - return (cpack(copysign(creal(w), x), copysign(cimag(w), y))); + return (CMPLX(copysign(creal(w), x), copysign(cimag(w), y))); } /* Avoid spuriously raising inexact for z = 0. */ @@ -325,7 +325,7 @@ casinh(double complex z) ry = asin(B); else ry = atan2(new_y, sqrt_A2my2); - return (cpack(copysign(rx, x), copysign(ry, y))); + return (CMPLX(copysign(rx, x), copysign(ry, y))); } /* @@ -335,9 +335,9 @@ casinh(double complex z) double complex casin(double complex z) { - double complex w = casinh(cpack(cimag(z), creal(z))); + double complex w = casinh(CMPLX(cimag(z), creal(z))); - return (cpack(cimag(w), creal(w))); + return (CMPLX(cimag(w), creal(w))); } /* @@ -370,19 +370,19 @@ cacos(double complex z) if (isnan(x) || isnan(y)) { /* cacos(+-Inf + I*NaN) = NaN + I*opt(-)Inf */ if (isinf(x)) - return (cpack(y + y, -INFINITY)); + return (CMPLX(y + y, -INFINITY)); /* cacos(NaN + I*+-Inf) = NaN + I*-+Inf */ if (isinf(y)) - return (cpack(x + x, -y)); + return (CMPLX(x + x, -y)); /* cacos(0 + I*NaN) = PI/2 + I*NaN with inexact */ if (x == 0) - return (cpack(pio2_hi + pio2_lo, y + y)); + return (CMPLX(pio2_hi + pio2_lo, y + y)); /* * All other cases involving NaN return NaN + I*NaN. * C99 leaves it optional whether to raise invalid if one of * the arguments is not NaN, so we opt not to raise it. */ - return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLX(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { @@ -392,18 +392,18 @@ cacos(double complex z) ry = creal(w) + m_ln2; if (sy == 0) ry = -ry; - return (cpack(rx, ry)); + return (CMPLX(rx, ry)); } /* Avoid spuriously raising inexact for z = 1. */ if (x == 1 && y == 0) - return (cpack(0, -y)); + return (CMPLX(0, -y)); /* All remaining cases are inexact. */ raise_inexact(); if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4) - return (cpack(pio2_hi - (x - pio2_lo), -y)); + return (CMPLX(pio2_hi - (x - pio2_lo), -y)); do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x); if (B_is_usable) { @@ -419,7 +419,7 @@ cacos(double complex z) } if (sy == 0) ry = -ry; - return (cpack(rx, ry)); + return (CMPLX(rx, ry)); } /* @@ -437,15 +437,15 @@ cacosh(double complex z) ry = cimag(w); /* cacosh(NaN + I*NaN) = NaN + I*NaN */ if (isnan(rx) && isnan(ry)) - return (cpack(ry, rx)); + return (CMPLX(ry, rx)); /* cacosh(NaN + I*+-Inf) = +Inf + I*NaN */ /* cacosh(+-Inf + I*NaN) = +Inf + I*NaN */ if (isnan(rx)) - return (cpack(fabs(ry), rx)); + return (CMPLX(fabs(ry), rx)); /* cacosh(0 + I*NaN) = NaN + I*NaN */ if (isnan(ry)) - return (cpack(ry, ry)); - return (cpack(fabs(ry), copysign(rx, cimag(z)))); + return (CMPLX(ry, ry)); + return (CMPLX(fabs(ry), copysign(rx, cimag(z)))); } /* @@ -475,16 +475,16 @@ clog_for_large_values(double complex z) * this method is still poor since it is uneccessarily slow. */ if (ax > DBL_MAX / 2) - return (cpack(log(hypot(x / m_e, y / m_e)) + 1, atan2(y, x))); + return (CMPLX(log(hypot(x / m_e, y / m_e)) + 1, atan2(y, x))); /* * Avoid overflow when x or y is large. Avoid underflow when x or * y is small. */ if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN) - return (cpack(log(hypot(x, y)), atan2(y, x))); + return (CMPLX(log(hypot(x, y)), atan2(y, x))); - return (cpack(log(ax * ax + ay * ay) / 2, atan2(y, x))); + return (CMPLX(log(ax * ax + ay * ay) / 2, atan2(y, x))); } /* @@ -575,30 +575,30 @@ catanh(double complex z) /* This helps handle many cases. */ if (y == 0 && ax <= 1) - return (cpack(atanh(x), y)); + return (CMPLX(atanh(x), y)); /* To ensure the same accuracy as atan(), and to filter out z = 0. */ if (x == 0) - return (cpack(x, atan(y))); + return (CMPLX(x, atan(y))); if (isnan(x) || isnan(y)) { /* catanh(+-Inf + I*NaN) = +-0 + I*NaN */ if (isinf(x)) - return (cpack(copysign(0, x), y + y)); + return (CMPLX(copysign(0, x), y + y)); /* catanh(NaN + I*+-Inf) = sign(NaN)0 + I*+-PI/2 */ if (isinf(y)) - return (cpack(copysign(0, x), + return (CMPLX(copysign(0, x), copysign(pio2_hi + pio2_lo, y))); /* * All other cases involving NaN return NaN + I*NaN. * C99 leaves it optional whether to raise invalid if one of * the arguments is not NaN, so we opt not to raise it. */ - return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLX(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) - return (cpack(real_part_reciprocal(x, y), + return (CMPLX(real_part_reciprocal(x, y), copysign(pio2_hi + pio2_lo, y))); if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) { @@ -623,7 +623,7 @@ catanh(double complex z) else ry = atan2(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2; - return (cpack(copysign(rx, x), copysign(ry, y))); + return (CMPLX(copysign(rx, x), copysign(ry, y))); } /* @@ -633,7 +633,7 @@ catanh(double complex z) double complex catan(double complex z) { - double complex w = catanh(cpack(cimag(z), creal(z))); + double complex w = catanh(CMPLX(cimag(z), creal(z))); - return (cpack(cimag(w), creal(w))); + return (CMPLX(cimag(w), creal(w))); } Modified: head/lib/msun/src/catrigf.c ============================================================================== --- head/lib/msun/src/catrigf.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/catrigf.c Tue Dec 16 09:21:56 2014 (r275819) @@ -156,12 +156,12 @@ casinhf(float complex z) if (isnan(x) || isnan(y)) { if (isinf(x)) - return (cpackf(x, y + y)); + return (CMPLXF(x, y + y)); if (isinf(y)) - return (cpackf(y, x + x)); + return (CMPLXF(y, x + x)); if (y == 0) - return (cpackf(x + x, y)); - return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLXF(x + x, y)); + return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { @@ -169,7 +169,7 @@ casinhf(float complex z) w = clog_for_large_values(z) + m_ln2; else w = clog_for_large_values(-z) + m_ln2; - return (cpackf(copysignf(crealf(w), x), + return (CMPLXF(copysignf(crealf(w), x), copysignf(cimagf(w), y))); } @@ -186,15 +186,15 @@ casinhf(float complex z) ry = asinf(B); else ry = atan2f(new_y, sqrt_A2my2); - return (cpackf(copysignf(rx, x), copysignf(ry, y))); + return (CMPLXF(copysignf(rx, x), copysignf(ry, y))); } float complex casinf(float complex z) { - float complex w = casinhf(cpackf(cimagf(z), crealf(z))); + float complex w = casinhf(CMPLXF(cimagf(z), crealf(z))); - return (cpackf(cimagf(w), crealf(w))); + return (CMPLXF(cimagf(w), crealf(w))); } float complex @@ -214,12 +214,12 @@ cacosf(float complex z) if (isnan(x) || isnan(y)) { if (isinf(x)) - return (cpackf(y + y, -INFINITY)); + return (CMPLXF(y + y, -INFINITY)); if (isinf(y)) - return (cpackf(x + x, -y)); + return (CMPLXF(x + x, -y)); if (x == 0) - return (cpackf(pio2_hi + pio2_lo, y + y)); - return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLXF(pio2_hi + pio2_lo, y + y)); + return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { @@ -228,16 +228,16 @@ cacosf(float complex z) ry = crealf(w) + m_ln2; if (sy == 0) ry = -ry; - return (cpackf(rx, ry)); + return (CMPLXF(rx, ry)); } if (x == 1 && y == 0) - return (cpackf(0, -y)); + return (CMPLXF(0, -y)); raise_inexact(); if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4) - return (cpackf(pio2_hi - (x - pio2_lo), -y)); + return (CMPLXF(pio2_hi - (x - pio2_lo), -y)); do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x); if (B_is_usable) { @@ -253,7 +253,7 @@ cacosf(float complex z) } if (sy == 0) ry = -ry; - return (cpackf(rx, ry)); + return (CMPLXF(rx, ry)); } float complex @@ -266,12 +266,12 @@ cacoshf(float complex z) rx = crealf(w); ry = cimagf(w); if (isnan(rx) && isnan(ry)) - return (cpackf(ry, rx)); + return (CMPLXF(ry, rx)); if (isnan(rx)) - return (cpackf(fabsf(ry), rx)); + return (CMPLXF(fabsf(ry), rx)); if (isnan(ry)) - return (cpackf(ry, ry)); - return (cpackf(fabsf(ry), copysignf(rx, cimagf(z)))); + return (CMPLXF(ry, ry)); + return (CMPLXF(fabsf(ry), copysignf(rx, cimagf(z)))); } static float complex @@ -291,13 +291,13 @@ clog_for_large_values(float complex z) } if (ax > FLT_MAX / 2) - return (cpackf(logf(hypotf(x / m_e, y / m_e)) + 1, + return (CMPLXF(logf(hypotf(x / m_e, y / m_e)) + 1, atan2f(y, x))); if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN) - return (cpackf(logf(hypotf(x, y)), atan2f(y, x))); + return (CMPLXF(logf(hypotf(x, y)), atan2f(y, x))); - return (cpackf(logf(ax * ax + ay * ay) / 2, atan2f(y, x))); + return (CMPLXF(logf(ax * ax + ay * ay) / 2, atan2f(y, x))); } static inline float @@ -346,22 +346,22 @@ catanhf(float complex z) ay = fabsf(y); if (y == 0 && ax <= 1) - return (cpackf(atanhf(x), y)); + return (CMPLXF(atanhf(x), y)); if (x == 0) - return (cpackf(x, atanf(y))); + return (CMPLXF(x, atanf(y))); if (isnan(x) || isnan(y)) { if (isinf(x)) - return (cpackf(copysignf(0, x), y + y)); + return (CMPLXF(copysignf(0, x), y + y)); if (isinf(y)) - return (cpackf(copysignf(0, x), + return (CMPLXF(copysignf(0, x), copysignf(pio2_hi + pio2_lo, y))); - return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) - return (cpackf(real_part_reciprocal(x, y), + return (CMPLXF(real_part_reciprocal(x, y), copysignf(pio2_hi + pio2_lo, y))); if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) { @@ -381,13 +381,13 @@ catanhf(float complex z) else ry = atan2f(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2; - return (cpackf(copysignf(rx, x), copysignf(ry, y))); + return (CMPLXF(copysignf(rx, x), copysignf(ry, y))); } float complex catanf(float complex z) { - float complex w = catanhf(cpackf(cimagf(z), crealf(z))); + float complex w = catanhf(CMPLXF(cimagf(z), crealf(z))); - return (cpackf(cimagf(w), crealf(w))); + return (CMPLXF(cimagf(w), crealf(w))); } Modified: head/lib/msun/src/k_exp.c ============================================================================== --- head/lib/msun/src/k_exp.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/k_exp.c Tue Dec 16 09:21:56 2014 (r275819) @@ -103,6 +103,6 @@ __ldexp_cexp(double complex z, int expt) half_expt = expt - half_expt; INSERT_WORDS(scale2, (0x3ff + half_expt) << 20, 0); - return (cpack(cos(y) * exp_x * scale1 * scale2, + return (CMPLX(cos(y) * exp_x * scale1 * scale2, sin(y) * exp_x * scale1 * scale2)); } Modified: head/lib/msun/src/k_expf.c ============================================================================== --- head/lib/msun/src/k_expf.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/k_expf.c Tue Dec 16 09:21:56 2014 (r275819) @@ -82,6 +82,6 @@ __ldexp_cexpf(float complex z, int expt) half_expt = expt - half_expt; SET_FLOAT_WORD(scale2, (0x7f + half_expt) << 23); - return (cpackf(cosf(y) * exp_x * scale1 * scale2, + return (CMPLXF(cosf(y) * exp_x * scale1 * scale2, sinf(y) * exp_x * scale1 * scale2)); } Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/math_private.h Tue Dec 16 09:21:56 2014 (r275819) @@ -454,9 +454,16 @@ typedef union { * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product. * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted * to -0.0+I*0.0. + * + * The C11 standard introduced the macros CMPLX(), CMPLXF() and CMPLXL() + * to construct complex values. The functions below are modelled after + * these macros, with the exception that they cannot be used to + * construct compile-time complex values. */ + +#ifndef CMPLXF static __inline float complex -cpackf(float x, float y) +CMPLXF(float x, float y) { float_complex z; @@ -464,9 +471,11 @@ cpackf(float x, float y) IMAGPART(z) = y; return (z.f); } +#endif +#ifndef CMPLX static __inline double complex -cpack(double x, double y) +CMPLX(double x, double y) { double_complex z; @@ -474,9 +483,11 @@ cpack(double x, double y) IMAGPART(z) = y; return (z.f); } +#endif +#ifndef CMPLXL static __inline long double complex -cpackl(long double x, long double y) +CMPLXL(long double x, long double y) { long_double_complex z; @@ -484,6 +495,8 @@ cpackl(long double x, long double y) IMAGPART(z) = y; return (z.f); } +#endif + #endif /* _COMPLEX_H */ #ifdef __GNUCLIKE_ASM Modified: head/lib/msun/src/s_ccosh.c ============================================================================== --- head/lib/msun/src/s_ccosh.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_ccosh.c Tue Dec 16 09:21:56 2014 (r275819) @@ -62,23 +62,23 @@ ccosh(double complex z) /* Handle the nearly-non-exceptional cases where x and y are finite. */ if (ix < 0x7ff00000 && iy < 0x7ff00000) { if ((iy | ly) == 0) - return (cpack(cosh(x), x * y)); + return (CMPLX(cosh(x), x * y)); if (ix < 0x40360000) /* small x: normal case */ - return (cpack(cosh(x) * cos(y), sinh(x) * sin(y))); + return (CMPLX(cosh(x) * cos(y), sinh(x) * sin(y))); /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if (ix < 0x40862e42) { /* x < 710: exp(|x|) won't overflow */ h = exp(fabs(x)) * 0.5; - return (cpack(h * cos(y), copysign(h, x) * sin(y))); + return (CMPLX(h * cos(y), copysign(h, x) * sin(y))); } else if (ix < 0x4096bbaa) { /* x < 1455: scale to avoid overflow */ - z = __ldexp_cexp(cpack(fabs(x), y), -1); - return (cpack(creal(z), cimag(z) * copysign(1, x))); + z = __ldexp_cexp(CMPLX(fabs(x), y), -1); + return (CMPLX(creal(z), cimag(z) * copysign(1, x))); } else { /* x >= 1455: the result always overflows */ h = huge * x; - return (cpack(h * h * cos(y), h * sin(y))); + return (CMPLX(h * h * cos(y), h * sin(y))); } } @@ -92,7 +92,7 @@ ccosh(double complex z) * the same as d(NaN). */ if ((ix | lx) == 0 && iy >= 0x7ff00000) - return (cpack(y - y, copysign(0, x * (y - y)))); + return (CMPLX(y - y, copysign(0, x * (y - y)))); /* * cosh(+-Inf +- I 0) = +Inf + I (+-)(+-)0. @@ -102,8 +102,8 @@ ccosh(double complex z) */ if ((iy | ly) == 0 && ix >= 0x7ff00000) { if (((hx & 0xfffff) | lx) == 0) - return (cpack(x * x, copysign(0, x) * y)); - return (cpack(x * x, copysign(0, (x + x) * y))); + return (CMPLX(x * x, copysign(0, x) * y)); + return (CMPLX(x * x, copysign(0, (x + x) * y))); } /* @@ -115,7 +115,7 @@ ccosh(double complex z) * nonzero x. Choice = don't raise (except for signaling NaNs). */ if (ix < 0x7ff00000 && iy >= 0x7ff00000) - return (cpack(y - y, x * (y - y))); + return (CMPLX(y - y, x * (y - y))); /* * cosh(+-Inf + I NaN) = +Inf + I d(NaN). @@ -128,8 +128,8 @@ ccosh(double complex z) */ if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0) { if (iy >= 0x7ff00000) - return (cpack(x * x, x * (y - y))); - return (cpack((x * x) * cos(y), x * sin(y))); + return (CMPLX(x * x, x * (y - y))); + return (CMPLX((x * x) * cos(y), x * sin(y))); } /* @@ -143,7 +143,7 @@ ccosh(double complex z) * Optionally raises the invalid floating-point exception for finite * nonzero y. Choice = don't raise (except for signaling NaNs). */ - return (cpack((x * x) * (y - y), (x + x) * (y - y))); + return (CMPLX((x * x) * (y - y), (x + x) * (y - y))); } double complex @@ -151,5 +151,5 @@ ccos(double complex z) { /* ccos(z) = ccosh(I * z) */ - return (ccosh(cpack(-cimag(z), creal(z)))); + return (ccosh(CMPLX(-cimag(z), creal(z)))); } Modified: head/lib/msun/src/s_ccoshf.c ============================================================================== --- head/lib/msun/src/s_ccoshf.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_ccoshf.c Tue Dec 16 09:21:56 2014 (r275819) @@ -55,50 +55,50 @@ ccoshf(float complex z) if (ix < 0x7f800000 && iy < 0x7f800000) { if (iy == 0) - return (cpackf(coshf(x), x * y)); + return (CMPLXF(coshf(x), x * y)); if (ix < 0x41100000) /* small x: normal case */ - return (cpackf(coshf(x) * cosf(y), sinhf(x) * sinf(y))); + return (CMPLXF(coshf(x) * cosf(y), sinhf(x) * sinf(y))); /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if (ix < 0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ h = expf(fabsf(x)) * 0.5f; - return (cpackf(h * cosf(y), copysignf(h, x) * sinf(y))); + return (CMPLXF(h * cosf(y), copysignf(h, x) * sinf(y))); } else if (ix < 0x4340b1e7) { /* x < 192.7: scale to avoid overflow */ - z = __ldexp_cexpf(cpackf(fabsf(x), y), -1); - return (cpackf(crealf(z), cimagf(z) * copysignf(1, x))); + z = __ldexp_cexpf(CMPLXF(fabsf(x), y), -1); + return (CMPLXF(crealf(z), cimagf(z) * copysignf(1, x))); } else { /* x >= 192.7: the result always overflows */ h = huge * x; - return (cpackf(h * h * cosf(y), h * sinf(y))); + return (CMPLXF(h * h * cosf(y), h * sinf(y))); } } if (ix == 0 && iy >= 0x7f800000) - return (cpackf(y - y, copysignf(0, x * (y - y)))); + return (CMPLXF(y - y, copysignf(0, x * (y - y)))); if (iy == 0 && ix >= 0x7f800000) { if ((hx & 0x7fffff) == 0) - return (cpackf(x * x, copysignf(0, x) * y)); - return (cpackf(x * x, copysignf(0, (x + x) * y))); + return (CMPLXF(x * x, copysignf(0, x) * y)); + return (CMPLXF(x * x, copysignf(0, (x + x) * y))); } if (ix < 0x7f800000 && iy >= 0x7f800000) - return (cpackf(y - y, x * (y - y))); + return (CMPLXF(y - y, x * (y - y))); if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) { if (iy >= 0x7f800000) - return (cpackf(x * x, x * (y - y))); - return (cpackf((x * x) * cosf(y), x * sinf(y))); + return (CMPLXF(x * x, x * (y - y))); + return (CMPLXF((x * x) * cosf(y), x * sinf(y))); } - return (cpackf((x * x) * (y - y), (x + x) * (y - y))); + return (CMPLXF((x * x) * (y - y), (x + x) * (y - y))); } float complex ccosf(float complex z) { - return (ccoshf(cpackf(-cimagf(z), crealf(z)))); + return (ccoshf(CMPLXF(-cimagf(z), crealf(z)))); } Modified: head/lib/msun/src/s_cexp.c ============================================================================== --- head/lib/msun/src/s_cexp.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_cexp.c Tue Dec 16 09:21:56 2014 (r275819) @@ -50,22 +50,22 @@ cexp(double complex z) /* cexp(x + I 0) = exp(x) + I 0 */ if ((hy | ly) == 0) - return (cpack(exp(x), y)); + return (CMPLX(exp(x), y)); EXTRACT_WORDS(hx, lx, x); /* cexp(0 + I y) = cos(y) + I sin(y) */ if (((hx & 0x7fffffff) | lx) == 0) - return (cpack(cos(y), sin(y))); + return (CMPLX(cos(y), sin(y))); if (hy >= 0x7ff00000) { if (lx != 0 || (hx & 0x7fffffff) != 0x7ff00000) { /* cexp(finite|NaN +- I Inf|NaN) = NaN + I NaN */ - return (cpack(y - y, y - y)); + return (CMPLX(y - y, y - y)); } else if (hx & 0x80000000) { /* cexp(-Inf +- I Inf|NaN) = 0 + I 0 */ - return (cpack(0.0, 0.0)); + return (CMPLX(0.0, 0.0)); } else { /* cexp(+Inf +- I Inf|NaN) = Inf + I NaN */ - return (cpack(x, y - y)); + return (CMPLX(x, y - y)); } } @@ -84,6 +84,6 @@ cexp(double complex z) * - x = NaN (spurious inexact exception from y) */ exp_x = exp(x); - return (cpack(exp_x * cos(y), exp_x * sin(y))); + return (CMPLX(exp_x * cos(y), exp_x * sin(y))); } } Modified: head/lib/msun/src/s_cexpf.c ============================================================================== --- head/lib/msun/src/s_cexpf.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_cexpf.c Tue Dec 16 09:21:56 2014 (r275819) @@ -50,22 +50,22 @@ cexpf(float complex z) /* cexp(x + I 0) = exp(x) + I 0 */ if (hy == 0) - return (cpackf(expf(x), y)); + return (CMPLXF(expf(x), y)); GET_FLOAT_WORD(hx, x); /* cexp(0 + I y) = cos(y) + I sin(y) */ if ((hx & 0x7fffffff) == 0) - return (cpackf(cosf(y), sinf(y))); + return (CMPLXF(cosf(y), sinf(y))); if (hy >= 0x7f800000) { if ((hx & 0x7fffffff) != 0x7f800000) { /* cexp(finite|NaN +- I Inf|NaN) = NaN + I NaN */ - return (cpackf(y - y, y - y)); + return (CMPLXF(y - y, y - y)); } else if (hx & 0x80000000) { /* cexp(-Inf +- I Inf|NaN) = 0 + I 0 */ - return (cpackf(0.0, 0.0)); + return (CMPLXF(0.0, 0.0)); } else { /* cexp(+Inf +- I Inf|NaN) = Inf + I NaN */ - return (cpackf(x, y - y)); + return (CMPLXF(x, y - y)); } } @@ -84,6 +84,6 @@ cexpf(float complex z) * - x = NaN (spurious inexact exception from y) */ exp_x = expf(x); - return (cpackf(exp_x * cosf(y), exp_x * sinf(y))); + return (CMPLXF(exp_x * cosf(y), exp_x * sinf(y))); } } Modified: head/lib/msun/src/s_conj.c ============================================================================== --- head/lib/msun/src/s_conj.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_conj.c Tue Dec 16 09:21:56 2014 (r275819) @@ -34,5 +34,5 @@ double complex conj(double complex z) { - return (cpack(creal(z), -cimag(z))); + return (CMPLX(creal(z), -cimag(z))); } Modified: head/lib/msun/src/s_conjf.c ============================================================================== --- head/lib/msun/src/s_conjf.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_conjf.c Tue Dec 16 09:21:56 2014 (r275819) @@ -34,5 +34,5 @@ float complex conjf(float complex z) { - return (cpackf(crealf(z), -cimagf(z))); + return (CMPLXF(crealf(z), -cimagf(z))); } Modified: head/lib/msun/src/s_conjl.c ============================================================================== --- head/lib/msun/src/s_conjl.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_conjl.c Tue Dec 16 09:21:56 2014 (r275819) @@ -34,5 +34,5 @@ long double complex conjl(long double complex z) { - return (cpackl(creall(z), -cimagl(z))); + return (CMPLXL(creall(z), -cimagl(z))); } Modified: head/lib/msun/src/s_cproj.c ============================================================================== --- head/lib/msun/src/s_cproj.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_cproj.c Tue Dec 16 09:21:56 2014 (r275819) @@ -39,7 +39,7 @@ cproj(double complex z) if (!isinf(creal(z)) && !isinf(cimag(z))) return (z); else - return (cpack(INFINITY, copysign(0.0, cimag(z)))); + return (CMPLX(INFINITY, copysign(0.0, cimag(z)))); } #if LDBL_MANT_DIG == 53 Modified: head/lib/msun/src/s_cprojf.c ============================================================================== --- head/lib/msun/src/s_cprojf.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_cprojf.c Tue Dec 16 09:21:56 2014 (r275819) @@ -39,5 +39,5 @@ cprojf(float complex z) if (!isinf(crealf(z)) && !isinf(cimagf(z))) return (z); else - return (cpackf(INFINITY, copysignf(0.0, cimagf(z)))); + return (CMPLXF(INFINITY, copysignf(0.0, cimagf(z)))); } Modified: head/lib/msun/src/s_cprojl.c ============================================================================== --- head/lib/msun/src/s_cprojl.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_cprojl.c Tue Dec 16 09:21:56 2014 (r275819) @@ -39,5 +39,5 @@ cprojl(long double complex z) if (!isinf(creall(z)) && !isinf(cimagl(z))) return (z); else - return (cpackl(INFINITY, copysignl(0.0, cimagl(z)))); + return (CMPLXL(INFINITY, copysignl(0.0, cimagl(z)))); } Modified: head/lib/msun/src/s_csinh.c ============================================================================== --- head/lib/msun/src/s_csinh.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_csinh.c Tue Dec 16 09:21:56 2014 (r275819) @@ -62,23 +62,23 @@ csinh(double complex z) /* Handle the nearly-non-exceptional cases where x and y are finite. */ if (ix < 0x7ff00000 && iy < 0x7ff00000) { if ((iy | ly) == 0) - return (cpack(sinh(x), y)); + return (CMPLX(sinh(x), y)); if (ix < 0x40360000) /* small x: normal case */ - return (cpack(sinh(x) * cos(y), cosh(x) * sin(y))); + return (CMPLX(sinh(x) * cos(y), cosh(x) * sin(y))); /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if (ix < 0x40862e42) { /* x < 710: exp(|x|) won't overflow */ h = exp(fabs(x)) * 0.5; - return (cpack(copysign(h, x) * cos(y), h * sin(y))); + return (CMPLX(copysign(h, x) * cos(y), h * sin(y))); } else if (ix < 0x4096bbaa) { /* x < 1455: scale to avoid overflow */ - z = __ldexp_cexp(cpack(fabs(x), y), -1); - return (cpack(creal(z) * copysign(1, x), cimag(z))); + z = __ldexp_cexp(CMPLX(fabs(x), y), -1); + return (CMPLX(creal(z) * copysign(1, x), cimag(z))); } else { /* x >= 1455: the result always overflows */ h = huge * x; - return (cpack(h * cos(y), h * h * sin(y))); + return (CMPLX(h * cos(y), h * h * sin(y))); } } @@ -92,7 +92,7 @@ csinh(double complex z) * the same as d(NaN). */ if ((ix | lx) == 0 && iy >= 0x7ff00000) - return (cpack(copysign(0, x * (y - y)), y - y)); + return (CMPLX(copysign(0, x * (y - y)), y - y)); /* * sinh(+-Inf +- I 0) = +-Inf + I +-0. @@ -101,8 +101,8 @@ csinh(double complex z) */ if ((iy | ly) == 0 && ix >= 0x7ff00000) { if (((hx & 0xfffff) | lx) == 0) - return (cpack(x, y)); - return (cpack(x, copysign(0, y))); + return (CMPLX(x, y)); + return (CMPLX(x, copysign(0, y))); } /* @@ -114,7 +114,7 @@ csinh(double complex z) * nonzero x. Choice = don't raise (except for signaling NaNs). */ if (ix < 0x7ff00000 && iy >= 0x7ff00000) - return (cpack(y - y, x * (y - y))); + return (CMPLX(y - y, x * (y - y))); /* * sinh(+-Inf + I NaN) = +-Inf + I d(NaN). @@ -129,8 +129,8 @@ csinh(double complex z) */ if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0) { if (iy >= 0x7ff00000) - return (cpack(x * x, x * (y - y))); - return (cpack(x * cos(y), INFINITY * sin(y))); + return (CMPLX(x * x, x * (y - y))); + return (CMPLX(x * cos(y), INFINITY * sin(y))); } /* @@ -144,7 +144,7 @@ csinh(double complex z) * Optionally raises the invalid floating-point exception for finite * nonzero y. Choice = don't raise (except for signaling NaNs). */ - return (cpack((x * x) * (y - y), (x + x) * (y - y))); + return (CMPLX((x * x) * (y - y), (x + x) * (y - y))); } double complex @@ -152,6 +152,6 @@ csin(double complex z) { /* csin(z) = -I * csinh(I * z) */ - z = csinh(cpack(-cimag(z), creal(z))); - return (cpack(cimag(z), -creal(z))); + z = csinh(CMPLX(-cimag(z), creal(z))); + return (CMPLX(cimag(z), -creal(z))); } Modified: head/lib/msun/src/s_csinhf.c ============================================================================== --- head/lib/msun/src/s_csinhf.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_csinhf.c Tue Dec 16 09:21:56 2014 (r275819) @@ -55,51 +55,51 @@ csinhf(float complex z) if (ix < 0x7f800000 && iy < 0x7f800000) { if (iy == 0) - return (cpackf(sinhf(x), y)); + return (CMPLXF(sinhf(x), y)); if (ix < 0x41100000) /* small x: normal case */ - return (cpackf(sinhf(x) * cosf(y), coshf(x) * sinf(y))); + return (CMPLXF(sinhf(x) * cosf(y), coshf(x) * sinf(y))); /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if (ix < 0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ h = expf(fabsf(x)) * 0.5f; - return (cpackf(copysignf(h, x) * cosf(y), h * sinf(y))); + return (CMPLXF(copysignf(h, x) * cosf(y), h * sinf(y))); } else if (ix < 0x4340b1e7) { /* x < 192.7: scale to avoid overflow */ - z = __ldexp_cexpf(cpackf(fabsf(x), y), -1); - return (cpackf(crealf(z) * copysignf(1, x), cimagf(z))); + z = __ldexp_cexpf(CMPLXF(fabsf(x), y), -1); + return (CMPLXF(crealf(z) * copysignf(1, x), cimagf(z))); } else { /* x >= 192.7: the result always overflows */ h = huge * x; - return (cpackf(h * cosf(y), h * h * sinf(y))); + return (CMPLXF(h * cosf(y), h * h * sinf(y))); } } if (ix == 0 && iy >= 0x7f800000) - return (cpackf(copysignf(0, x * (y - y)), y - y)); + return (CMPLXF(copysignf(0, x * (y - y)), y - y)); if (iy == 0 && ix >= 0x7f800000) { if ((hx & 0x7fffff) == 0) - return (cpackf(x, y)); - return (cpackf(x, copysignf(0, y))); + return (CMPLXF(x, y)); + return (CMPLXF(x, copysignf(0, y))); } if (ix < 0x7f800000 && iy >= 0x7f800000) - return (cpackf(y - y, x * (y - y))); + return (CMPLXF(y - y, x * (y - y))); if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) { if (iy >= 0x7f800000) - return (cpackf(x * x, x * (y - y))); - return (cpackf(x * cosf(y), INFINITY * sinf(y))); + return (CMPLXF(x * x, x * (y - y))); + return (CMPLXF(x * cosf(y), INFINITY * sinf(y))); } - return (cpackf((x * x) * (y - y), (x + x) * (y - y))); + return (CMPLXF((x * x) * (y - y), (x + x) * (y - y))); } float complex csinf(float complex z) { - z = csinhf(cpackf(-cimagf(z), crealf(z))); - return (cpackf(cimagf(z), -crealf(z))); + z = csinhf(CMPLXF(-cimagf(z), crealf(z))); + return (CMPLXF(cimagf(z), -crealf(z))); } Modified: head/lib/msun/src/s_csqrt.c ============================================================================== --- head/lib/msun/src/s_csqrt.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_csqrt.c Tue Dec 16 09:21:56 2014 (r275819) @@ -58,12 +58,12 @@ csqrt(double complex z) /* Handle special cases. */ if (z == 0) - return (cpack(0, b)); + return (CMPLX(0, b)); if (isinf(b)) - return (cpack(INFINITY, b)); + return (CMPLX(INFINITY, b)); if (isnan(a)) { t = (b - b) / (b - b); /* raise invalid if b is not a NaN */ - return (cpack(a, t)); /* return NaN + NaN i */ + return (CMPLX(a, t)); /* return NaN + NaN i */ } if (isinf(a)) { /* @@ -73,9 +73,9 @@ csqrt(double complex z) * csqrt(-inf + y i) = 0 + inf i */ if (signbit(a)) - return (cpack(fabs(b - b), copysign(a, b))); + return (CMPLX(fabs(b - b), copysign(a, b))); else - return (cpack(a, copysign(b - b, b))); + return (CMPLX(a, copysign(b - b, b))); } /* * The remaining special case (b is NaN) is handled just fine by @@ -94,10 +94,10 @@ csqrt(double complex z) /* Algorithm 312, CACM vol 10, Oct 1967. */ if (a >= 0) { t = sqrt((a + hypot(a, b)) * 0.5); - result = cpack(t, b / (2 * t)); + result = CMPLX(t, b / (2 * t)); } else { t = sqrt((-a + hypot(a, b)) * 0.5); - result = cpack(fabs(b) / (2 * t), copysign(t, b)); + result = CMPLX(fabs(b) / (2 * t), copysign(t, b)); } /* Rescale. */ Modified: head/lib/msun/src/s_csqrtf.c ============================================================================== --- head/lib/msun/src/s_csqrtf.c Tue Dec 16 08:29:02 2014 (r275818) +++ head/lib/msun/src/s_csqrtf.c Tue Dec 16 09:21:56 2014 (r275819) @@ -49,12 +49,12 @@ csqrtf(float complex z) /* Handle special cases. */ if (z == 0) - return (cpackf(0, b)); + return (CMPLXF(0, b)); if (isinf(b)) - return (cpackf(INFINITY, b)); + return (CMPLXF(INFINITY, b)); if (isnan(a)) { t = (b - b) / (b - b); /* raise invalid if b is not a NaN */ - return (cpackf(a, t)); /* return NaN + NaN i */ + return (CMPLXF(a, t)); /* return NaN + NaN i */ } if (isinf(a)) { /* @@ -64,9 +64,9 @@ csqrtf(float complex z) * csqrtf(-inf + y i) = 0 + inf i */ if (signbit(a)) - return (cpackf(fabsf(b - b), copysignf(a, b))); + return (CMPLXF(fabsf(b - b), copysignf(a, b))); else - return (cpackf(a, copysignf(b - b, b))); + return (CMPLXF(a, copysignf(b - b, b))); } /* * The remaining special case (b is NaN) is handled just fine by @@ -80,9 +80,9 @@ csqrtf(float complex z) */ if (a >= 0) { t = sqrt((a + hypot(a, b)) * 0.5); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 11:19:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF6EFD7E; Tue, 16 Dec 2014 11:19:21 +0000 (UTC) Received: from svn.freebsd.org (unknown [IPv6:2001:1900:2254:2068::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 825B1323; Tue, 16 Dec 2014 09:49:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBG9n8u6075661; Tue, 16 Dec 2014 09:49:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBG9n86N075660; Tue, 16 Dec 2014 09:49:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412160949.sBG9n86N075660@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Dec 2014 09:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275821 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:19:21 -0000 Author: kib Date: Tue Dec 16 09:49:07 2014 New Revision: 275821 URL: https://svnweb.freebsd.org/changeset/base/275821 Log: Add missed break. CID: 1258587 Sponsored by: The FreeBSD Foundation MFC after: 20 days Modified: head/sys/kern/kern_procctl.c Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Tue Dec 16 09:48:23 2014 (r275820) +++ head/sys/kern/kern_procctl.c Tue Dec 16 09:49:07 2014 (r275821) @@ -336,6 +336,7 @@ sys_procctl(struct thread *td, struct pr case PROC_REAP_STATUS: if (error == 0) error = copyout(&x.rs, uap->data, sizeof(x.rs)); + break; case PROC_REAP_KILL: error1 = copyout(&x.rk, uap->data, sizeof(x.rk)); if (error == 0) From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 11:24:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F16EFA5B; Tue, 16 Dec 2014 11:24:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DD75C11B1; Tue, 16 Dec 2014 11:24:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGBO8W2024825; Tue, 16 Dec 2014 11:24:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBO8fJ024824; Tue, 16 Dec 2014 11:24:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161124.sBGBO8fJ024824@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275822 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:24:09 -0000 Author: ae Date: Tue Dec 16 11:24:07 2014 New Revision: 275822 URL: https://svnweb.freebsd.org/changeset/base/275822 Log: MFC r275575: key_getspacq() returns holding the spacq_lock. Unlock it in all cases. Sponsored by: Yandex LLC Modified: stable/10/sys/netipsec/key.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/key.c ============================================================================== --- stable/10/sys/netipsec/key.c Tue Dec 16 09:49:07 2014 (r275821) +++ stable/10/sys/netipsec/key.c Tue Dec 16 11:24:07 2014 (r275822) @@ -2336,7 +2336,8 @@ key_spdacquire(sp) } else { /* increment counter and do nothing. */ newspacq->count++; - return 0; + SPACQ_UNLOCK(); + return (0); } SPACQ_UNLOCK(); } else { From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 11:30:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 881651286; Tue, 16 Dec 2014 11:30:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 73E5F124E; Tue, 16 Dec 2014 11:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGBUUA4026188; Tue, 16 Dec 2014 11:30:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBUUsJ026187; Tue, 16 Dec 2014 11:30:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161130.sBGBUUsJ026187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275824 - stable/9/sys/netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:30:30 -0000 Author: ae Date: Tue Dec 16 11:30:29 2014 New Revision: 275824 URL: https://svnweb.freebsd.org/changeset/base/275824 Log: MFC r275575: key_getspacq() returns holding the spacq_lock. Unlock it in all cases. Sponsored by: Yandex LLC Modified: stable/9/sys/netipsec/key.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/key.c ============================================================================== --- stable/9/sys/netipsec/key.c Tue Dec 16 11:25:12 2014 (r275823) +++ stable/9/sys/netipsec/key.c Tue Dec 16 11:30:29 2014 (r275824) @@ -2328,7 +2328,8 @@ key_spdacquire(sp) } else { /* increment counter and do nothing. */ newspacq->count++; - return 0; + SPACQ_UNLOCK(); + return (0); } SPACQ_UNLOCK(); } else { From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 11:32:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21A0513DF; Tue, 16 Dec 2014 11:32:00 +0000 (UTC) Received: from svn.freebsd.org (unknown [IPv6:2001:1900:2254:2068::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 5B3E0320; Tue, 16 Dec 2014 09:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBG9mODE075518; Tue, 16 Dec 2014 09:48:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBG9mOoj075517; Tue, 16 Dec 2014 09:48:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412160948.sBG9mOoj075517@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Dec 2014 09:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275820 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:32:00 -0000 Author: kib Date: Tue Dec 16 09:48:23 2014 New Revision: 275820 URL: https://svnweb.freebsd.org/changeset/base/275820 Log: Add missed break. CID: 1258586 Sponsored by: The FreeBSD Foundation MFC after: 4 days Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue Dec 16 09:21:56 2014 (r275819) +++ head/sys/kern/kern_thread.c Tue Dec 16 09:48:23 2014 (r275820) @@ -618,6 +618,7 @@ weed_inhib(int mode, struct thread *td2, wakeup_swapper |= thread_unsuspend_one(td2, p); if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) wakeup_swapper |= sleepq_abort(td2, ERESTART); + break; case SINGLE_ALLPROC: /* * ALLPROC suspend tries to avoid spurious EINTR for From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 11:45:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D323247; Tue, 16 Dec 2014 11:45:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 18C0F159A; Tue, 16 Dec 2014 11:45:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGBjXk1035609; Tue, 16 Dec 2014 11:45:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBjXxe035608; Tue, 16 Dec 2014 11:45:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161145.sBGBjXxe035608@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275825 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:45:34 -0000 Author: ae Date: Tue Dec 16 11:45:33 2014 New Revision: 275825 URL: https://svnweb.freebsd.org/changeset/base/275825 Log: MFC r275393: Remove unneded check. No need to do m_pullup to the size that we prepended. MFC r275473: Fix style(9) and remove m_freem(NULL). Add XXX comment, it looks incorrect, because m_pkthdr.len is already incremented by M_PREPEND(). Sponsored by: Yandex LLC Modified: stable/10/sys/netipsec/keysock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/keysock.c ============================================================================== --- stable/10/sys/netipsec/keysock.c Tue Dec 16 11:30:29 2014 (r275824) +++ stable/10/sys/netipsec/keysock.c Tue Dec 16 11:45:33 2014 (r275825) @@ -149,14 +149,11 @@ key_sendup0(rp, m, promisc) struct sadb_msg *pmsg; M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); - if (m && m->m_len < sizeof(struct sadb_msg)) - m = m_pullup(m, sizeof(struct sadb_msg)); - if (!m) { + if (m == NULL) { PFKEYSTAT_INC(in_nomem); - m_freem(m); - return ENOBUFS; + return (ENOBUFS); } - m->m_pkthdr.len += sizeof(*pmsg); + m->m_pkthdr.len += sizeof(*pmsg); /* XXX: is this correct? */ pmsg = mtod(m, struct sadb_msg *); bzero(pmsg, sizeof(*pmsg)); From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 11:49:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9031242A; Tue, 16 Dec 2014 11:49:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7BFD915E4; Tue, 16 Dec 2014 11:49:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGBnaBi036196; Tue, 16 Dec 2014 11:49:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBna9r036195; Tue, 16 Dec 2014 11:49:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161149.sBGBna9r036195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275826 - stable/9/sys/netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:49:36 -0000 Author: ae Date: Tue Dec 16 11:49:35 2014 New Revision: 275826 URL: https://svnweb.freebsd.org/changeset/base/275826 Log: MFC r275393: Remove unneded check. No need to do m_pullup to the size that we prepended. MFC r275473: Fix style(9) and remove m_freem(NULL). Add XXX comment, it looks incorrect, because m_pkthdr.len is already incremented by M_PREPEND(). Sponsored by: Yandex LLC Modified: stable/9/sys/netipsec/keysock.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/keysock.c ============================================================================== --- stable/9/sys/netipsec/keysock.c Tue Dec 16 11:45:33 2014 (r275825) +++ stable/9/sys/netipsec/keysock.c Tue Dec 16 11:49:35 2014 (r275826) @@ -144,14 +144,11 @@ key_sendup0(rp, m, promisc) struct sadb_msg *pmsg; M_PREPEND(m, sizeof(struct sadb_msg), M_DONTWAIT); - if (m && m->m_len < sizeof(struct sadb_msg)) - m = m_pullup(m, sizeof(struct sadb_msg)); - if (!m) { + if (m == NULL) { PFKEYSTAT_INC(in_nomem); - m_freem(m); - return ENOBUFS; + return (ENOBUFS); } - m->m_pkthdr.len += sizeof(*pmsg); + m->m_pkthdr.len += sizeof(*pmsg); /* XXX: is this correct? */ pmsg = mtod(m, struct sadb_msg *); bzero(pmsg, sizeof(*pmsg)); From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 11:52:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82FDD5A4; Tue, 16 Dec 2014 11:52:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6EFCF169C; Tue, 16 Dec 2014 11:52:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGBqHSr040034; Tue, 16 Dec 2014 11:52:17 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBqH6O040031; Tue, 16 Dec 2014 11:52:17 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161152.sBGBqH6O040031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275827 - in stable/9/sys: net netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:52:17 -0000 Author: ae Date: Tue Dec 16 11:52:15 2014 New Revision: 275827 URL: https://svnweb.freebsd.org/changeset/base/275827 Log: MFC r275394: Remove unneded check. No need to do m_pullup to the size that we prepended. Sponsored by: Yandex LLC Modified: stable/9/sys/net/if_stf.c stable/9/sys/netinet6/icmp6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_stf.c ============================================================================== --- stable/9/sys/net/if_stf.c Tue Dec 16 11:49:35 2014 (r275826) +++ stable/9/sys/net/if_stf.c Tue Dec 16 11:52:15 2014 (r275827) @@ -511,8 +511,6 @@ stf_output(ifp, m, dst, ro) } M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); - if (m && m->m_len < sizeof(struct ip)) - m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { ifa_free(&ia6->ia_ifa); ifp->if_oerrors++; Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Tue Dec 16 11:49:35 2014 (r275826) +++ stable/9/sys/netinet6/icmp6.c Tue Dec 16 11:52:15 2014 (r275827) @@ -361,8 +361,6 @@ icmp6_error(struct mbuf *m, int type, in preplen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr); M_PREPEND(m, preplen, M_DONTWAIT); /* FIB is also copied over. */ - if (m && m->m_len < preplen) - m = m_pullup(m, preplen); if (m == NULL) { nd6log((LOG_DEBUG, "ENOBUFS in icmp6_error %d\n", __LINE__)); return; From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 11:53:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E4946EE; Tue, 16 Dec 2014 11:53:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 57E6116AC; Tue, 16 Dec 2014 11:53:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGBrlkW040279; Tue, 16 Dec 2014 11:53:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBrkTW040277; Tue, 16 Dec 2014 11:53:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161153.sBGBrkTW040277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275828 - in stable/10/sys: net netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:53:47 -0000 Author: ae Date: Tue Dec 16 11:53:45 2014 New Revision: 275828 URL: https://svnweb.freebsd.org/changeset/base/275828 Log: MFC r275394: Remove unneded check. No need to do m_pullup to the size that we prepended. Sponsored by: Yandex LLC Modified: stable/10/sys/net/if_stf.c stable/10/sys/netinet6/icmp6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_stf.c ============================================================================== --- stable/10/sys/net/if_stf.c Tue Dec 16 11:52:15 2014 (r275827) +++ stable/10/sys/net/if_stf.c Tue Dec 16 11:53:45 2014 (r275828) @@ -499,8 +499,6 @@ stf_output(struct ifnet *ifp, struct mbu } M_PREPEND(m, sizeof(struct ip), M_NOWAIT); - if (m && m->m_len < sizeof(struct ip)) - m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { ifa_free(&ia6->ia_ifa); ifp->if_oerrors++; Modified: stable/10/sys/netinet6/icmp6.c ============================================================================== --- stable/10/sys/netinet6/icmp6.c Tue Dec 16 11:52:15 2014 (r275827) +++ stable/10/sys/netinet6/icmp6.c Tue Dec 16 11:53:45 2014 (r275828) @@ -366,8 +366,6 @@ icmp6_error(struct mbuf *m, int type, in preplen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr); M_PREPEND(m, preplen, M_NOWAIT); /* FIB is also copied over. */ - if (m && m->m_len < preplen) - m = m_pullup(m, preplen); if (m == NULL) { nd6log((LOG_DEBUG, "ENOBUFS in icmp6_error %d\n", __LINE__)); return; From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 14:50:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BED882A9; Tue, 16 Dec 2014 14:50:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A12A0BE3; Tue, 16 Dec 2014 14:50:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGEoYVb026381; Tue, 16 Dec 2014 14:50:34 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGEoYCX026379; Tue, 16 Dec 2014 14:50:34 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201412161450.sBGEoYCX026379@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 16 Dec 2014 14:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275829 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 14:50:35 -0000 Author: brd (doc committer) Date: Tue Dec 16 14:50:33 2014 New Revision: 275829 URL: https://svnweb.freebsd.org/changeset/base/275829 Log: Add tests for pw -N PR: 150449 Submitted by: Robert O'Neil Approved by: will Modified: head/usr.sbin/pw/tests/pw_useradd.sh head/usr.sbin/pw/tests/pw_usermod.sh Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Tue Dec 16 11:53:45 2014 (r275828) +++ head/usr.sbin/pw/tests/pw_useradd.sh Tue Dec 16 14:50:33 2014 (r275829) @@ -13,7 +13,16 @@ user_add_body() { grep "^test:.*" $HOME/master.passwd } +# Test add user with option -N +atf_test_case user_add_noupdate +user_add_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 -o match:"^test:.*" ${PW} useradd test -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} +# Test add user with comments atf_test_case user_add_comments user_add_comments_body() { populate_etc_skel @@ -23,6 +32,17 @@ user_add_comments_body() { grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd } +# Test add user with comments and option -N +atf_test_case user_add_comments_noupdate +user_add_comments_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ + ${PW} useradd test -c "Test User,work,123,456" -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} + +# Test add user with invalid comments atf_test_case user_add_comments_invalid user_add_comments_invalid_body() { populate_etc_skel @@ -33,8 +53,21 @@ user_add_comments_invalid_body() { grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd } +# Test add user with invalid comments and option -N +atf_test_case user_add_comments_invalid_noupdate +user_add_comments_invalid_noupdate_body() { + populate_etc_skel + + atf_check -s exit:65 -e match:"invalid character" \ + ${PW} useradd test -c "Test User,work,123:456,456" -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} + atf_init_test_cases() { atf_add_test_case user_add + atf_add_test_case user_add_noupdate atf_add_test_case user_add_comments + atf_add_test_case user_add_comments_noupdate atf_add_test_case user_add_comments_invalid + atf_add_test_case user_add_comments_invalid_noupdate } Modified: head/usr.sbin/pw/tests/pw_usermod.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_usermod.sh Tue Dec 16 11:53:45 2014 (r275828) +++ head/usr.sbin/pw/tests/pw_usermod.sh Tue Dec 16 14:50:33 2014 (r275829) @@ -15,6 +15,18 @@ user_mod_body() { grep "^test:.*" $HOME/master.passwd } +# Test modifying a user with option -N +atf_test_case user_mod_noupdate +user_mod_noupdate_body() { + populate_etc_skel + + atf_check -s exit:67 -e match:"no such user" ${PW} usermod test -N + atf_check -s exit:0 ${PW} useradd test + atf_check -s exit:0 -o match:"^test:.*" ${PW} usermod test -N + atf_check -s exit:0 -o match:"^test:.*" \ + grep "^test:.*" $HOME/master.passwd +} + # Test modifying a user with comments atf_test_case user_mod_comments user_mod_comments_body() { @@ -26,6 +38,18 @@ user_mod_comments_body() { grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd } +# Test modifying a user with comments with option -N +atf_test_case user_mod_comments_noupdate +user_mod_comments_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456" + atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ + ${PW} usermod test -c "Test User,work,123,456" -N + atf_check -s exit:0 -o match:"^test:.*:Test User,home,123,456:" \ + grep "^test:.*:Test User,home,123,456:" $HOME/master.passwd +} + # Test modifying a user with invalid comments atf_test_case user_mod_comments_invalid user_mod_comments_invalid_body() { @@ -36,6 +60,22 @@ user_mod_comments_invalid_body() { ${PW} usermod test -c "Test User,work,123:456,456" atf_check -s exit:1 -o empty \ grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd + atf_check -s exit:0 -o match:"^test:\*" \ + grep "^test:\*" $HOME/master.passwd +} + +# Test modifying a user with invalid comments with option -N +atf_test_case user_mod_comments_invalid_noupdate +user_mod_comments_invalid_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test + atf_check -s exit:65 -e match:"invalid character" \ + ${PW} usermod test -c "Test User,work,123:456,456" -N + atf_check -s exit:1 -o empty \ + grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd + atf_check -s exit:0 -o match:"^test:\*" \ + grep "^test:\*" $HOME/master.passwd } # Test modifying a user name with -l @@ -48,9 +88,25 @@ user_mod_name_body() { atf_check -s exit:0 -o match:"^bar:.*" \ grep "^bar:.*" $HOME/master.passwd } + +# Test modifying a user name with -l with option -N +atf_test_case user_mod_name_noupdate +user_mod_name_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 -o match:"^bar:.*" ${PW} usermod foo -l "bar" -N + atf_check -s exit:0 -o match:"^foo:.*" \ + grep "^foo:.*" $HOME/master.passwd +} + atf_init_test_cases() { atf_add_test_case user_mod + atf_add_test_case user_mod_noupdate atf_add_test_case user_mod_comments + atf_add_test_case user_mod_comments_noupdate atf_add_test_case user_mod_comments_invalid + atf_add_test_case user_mod_comments_invalid_noupdate atf_add_test_case user_mod_name + atf_add_test_case user_mod_name_noupdate } From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 14:59:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57F3E5C0; Tue, 16 Dec 2014 14:59:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 446DDCE8; Tue, 16 Dec 2014 14:59:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGExLgg029309; Tue, 16 Dec 2014 14:59:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGExLov029308; Tue, 16 Dec 2014 14:59:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161459.sBGExLov029308@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 14:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275830 - head/sbin/ping6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 14:59:21 -0000 Author: ae Date: Tue Dec 16 14:59:20 2014 New Revision: 275830 URL: https://svnweb.freebsd.org/changeset/base/275830 Log: Add ability to not specify a zone identifier twice, when both source and destination addresses are specified. For example: # ping6 -S fe80::1%ix0 ff02::1 or # ping6 -S fe80::1 fe80::2%ix0 Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Tue Dec 16 14:50:33 2014 (r275829) +++ head/sbin/ping6/ping6.c Tue Dec 16 14:59:20 2014 (r275830) @@ -648,11 +648,20 @@ main(int argc, char *argv[]) err(1, "socket"); /* set the source address if specified. */ - if ((options & F_SRCADDR) && - bind(s, (struct sockaddr *)&src, srclen) != 0) { - err(1, "bind"); + if ((options & F_SRCADDR) != 0) { + /* properly fill sin6_scope_id */ + if (IN6_IS_ADDR_LINKLOCAL(&src.sin6_addr) && ( + IN6_IS_ADDR_LINKLOCAL(&dst.sin6_addr) || + IN6_IS_ADDR_MC_LINKLOCAL(&dst.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&dst.sin6_addr))) { + if (src.sin6_scope_id == 0) + src.sin6_scope_id = dst.sin6_scope_id; + if (dst.sin6_scope_id == 0) + dst.sin6_scope_id = src.sin6_scope_id; + } + if (bind(s, (struct sockaddr *)&src, srclen) != 0) + err(1, "bind"); } - /* set the gateway (next hop) if specified */ if (gateway) { memset(&hints, 0, sizeof(hints)); From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 16:22:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC567979; Tue, 16 Dec 2014 16:22:46 +0000 (UTC) Received: from valentine.liquidneon.com (valentine.liquidneon.com [216.87.78.132]) by mx1.freebsd.org (Postfix) with ESMTP id B4ECA8E2; Tue, 16 Dec 2014 16:22:46 +0000 (UTC) Received: by valentine.liquidneon.com (Postfix, from userid 1018) id 5D92C8FFB2; Tue, 16 Dec 2014 09:22:38 -0700 (MST) Date: Tue, 16 Dec 2014 09:22:38 -0700 From: Brad Davis To: Brad Davis Subject: Re: svn commit: r275829 - head/usr.sbin/pw/tests Message-ID: <20141216162238.GE29350@valentine.liquidneon.com> References: <201412161450.sBGEoYCX026379@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412161450.sBGEoYCX026379@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 16:22:46 -0000 On Tue, Dec 16, 2014 at 02:50:34PM +0000, Brad Davis wrote: > Author: brd (doc committer) > Date: Tue Dec 16 14:50:33 2014 > New Revision: 275829 > URL: https://svnweb.freebsd.org/changeset/base/275829 > > Log: > Add tests for pw -N > > PR: 150449 Err, this should actually be: PR: 195865 Regards, Brad Davis From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 16:23:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57F26ABA; Tue, 16 Dec 2014 16:23:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2A54A8EA; Tue, 16 Dec 2014 16:23:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGGNtVX071888; Tue, 16 Dec 2014 16:23:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGGNtkl071887; Tue, 16 Dec 2014 16:23:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412161623.sBGGNtkl071887@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 16 Dec 2014 16:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275831 - head/contrib/elftoolchain/readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 16:23:55 -0000 Author: emaste Date: Tue Dec 16 16:23:54 2014 New Revision: 275831 URL: https://svnweb.freebsd.org/changeset/base/275831 Log: Copy elftoolchain readelf from vendor branch Added: head/contrib/elftoolchain/readelf/ - copied from r275830, vendor/elftoolchain/dist/readelf/ From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 16:27:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CE06C73; Tue, 16 Dec 2014 16:27:43 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ACDA91D; Tue, 16 Dec 2014 16:27:43 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sBGGKtuA066425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Dec 2014 08:20:55 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sBGGKtJ3066424; Tue, 16 Dec 2014 08:20:55 -0800 (PST) (envelope-from sgk) Date: Tue, 16 Dec 2014 08:20:55 -0800 From: Steve Kargl To: Ed Schouten Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src Message-ID: <20141216162055.GA64273@troutmask.apl.washington.edu> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412160921.sBG9LvFY064961@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 16:27:43 -0000 On Tue, Dec 16, 2014 at 09:21:57AM +0000, Ed Schouten wrote: > Author: ed > Date: Tue Dec 16 09:21:56 2014 > New Revision: 275819 > URL: https://svnweb.freebsd.org/changeset/base/275819 > > Log: > Rename cpack*() to CMPLX*(). This seems like a lot of code churn for very little benefit. In particular, I know that the one person working on fixing problems with FreeBSD's libm has a private repo and the openlibm and android developers base their libm off of FreeBSD's libm and now they'll need to resync their codebases and resolve conflicts. > Modified: head/lib/msun/src/math_private.h > ============================================================================== > --- head/lib/msun/src/math_private.h Tue Dec 16 08:29:02 2014 (r275818) > +++ head/lib/msun/src/math_private.h Tue Dec 16 09:21:56 2014 (r275819) > @@ -454,9 +454,16 @@ typedef union { > * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product. > * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted > * to -0.0+I*0.0. > + * > + * The C11 standard introduced the macros CMPLX(), CMPLXF() and CMPLXL() > + * to construct complex values. The functions below are modelled after > + * these macros, with the exception that they cannot be used to > + * construct compile-time complex values. This comment isn't true! These functions pre-date C11 by years. See r151865. These functions were designed to deal with gcc's poorly implemented I. See the paragraph above your comment. > */ > + > +#ifndef CMPLXF > static __inline float complex > -cpackf(float x, float y) > +CMPLXF(float x, float y) > { > float_complex z; > > @@ -464,9 +471,11 @@ cpackf(float x, float y) > IMAGPART(z) = y; > return (z.f); > } > +#endif Why not use a much less invasive change? #ifdef CMPLXF #define cpackf(x, y) CMPLXF((x), (y)) #else static __inline float complex cpackf(float x, float y) { float_complex z; REALPART(z) = x; IMAGPART(z) = y; return (z.f); } #endif -- steve From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 17:59:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5703443; Tue, 16 Dec 2014 17:59:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 902DE374; Tue, 16 Dec 2014 17:59:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGHx6WX016024; Tue, 16 Dec 2014 17:59:06 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGHx6ZL016021; Tue, 16 Dec 2014 17:59:06 GMT (envelope-from will@FreeBSD.org) Message-Id: <201412161759.sBGHx6ZL016021@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Tue, 16 Dec 2014 17:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275832 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 17:59:06 -0000 Author: will Date: Tue Dec 16 17:59:05 2014 New Revision: 275832 URL: https://svnweb.freebsd.org/changeset/base/275832 Log: Make NanoBSD source-able from other scripts. Summary: This change converts NanoBSD into a two-script bundle. - defaults.sh contains all non-CLI code. Most NanoBSD code is moved into this file. - nanobsd.sh now consists just of a command line interface that calls into functions in defaults.sh. Test Plan: Run NanoBSD using a previously-working configuration. Reviewers: imp Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D1321 Added: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/nanobsd.sh Added: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/defaults.sh Tue Dec 16 17:59:05 2014 (r275832) @@ -0,0 +1,983 @@ +#!/bin/sh +# +# Copyright (c) 2005 Poul-Henning Kamp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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$ +# + +set -e + +####################################################################### +# +# Setup default values for all controlling variables. +# These values can be overridden from the config file(s) +# +####################################################################### + +# Name of this NanoBSD build. (Used to construct workdir names) +NANO_NAME=full + +# Source tree directory +NANO_SRC=/usr/src + +# Where nanobsd additional files live under the source tree +NANO_TOOLS=tools/tools/nanobsd + +# Where cust_pkg() finds packages to install +NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg +NANO_PACKAGE_LIST="*" + +# where package metadata gets placed +NANO_PKG_META_BASE=/var/db + +# Object tree directory +# default is subdir of /usr/obj +#NANO_OBJ="" + +# The directory to put the final images +# default is ${NANO_OBJ} +#NANO_DISKIMGDIR="" + +# Make & parallel Make +NANO_MAKE="make" +NANO_PMAKE="make -j 3" + +# The default name for any image we create. +NANO_IMGNAME="_.disk.full" + +# Options to put in make.conf during buildworld only +CONF_BUILD=' ' + +# Options to put in make.conf during installworld only +CONF_INSTALL=' ' + +# Options to put in make.conf during both build- & installworld. +CONF_WORLD=' ' + +# Kernel config file to use +NANO_KERNEL=GENERIC + +# Kernel modules to install. If empty, no modules are installed. +# Use "default" to install all built modules. +NANO_MODULES= + +# Customize commands. +NANO_CUSTOMIZE="" + +# Late customize commands. +NANO_LATE_CUSTOMIZE="" + +# Newfs paramters to use +NANO_NEWFS="-b 4096 -f 512 -i 8192 -U" + +# The drive name of the media at runtime +NANO_DRIVE=ad0 + +# Target media size in 512 bytes sectors +NANO_MEDIASIZE=2000000 + +# Number of code images on media (1 or 2) +NANO_IMAGES=2 + +# 0 -> Leave second image all zeroes so it compresses better. +# 1 -> Initialize second image with a copy of the first +NANO_INIT_IMG2=1 + +# Size of code file system in 512 bytes sectors +# If zero, size will be as large as possible. +NANO_CODESIZE=0 + +# Size of configuration file system in 512 bytes sectors +# Cannot be zero. +NANO_CONFSIZE=2048 + +# Size of data file system in 512 bytes sectors +# If zero: no partition configured. +# If negative: max size possible +NANO_DATASIZE=0 + +# Size of the /etc ramdisk in 512 bytes sectors +NANO_RAM_ETCSIZE=10240 + +# Size of the /tmp+/var ramdisk in 512 bytes sectors +NANO_RAM_TMPVARSIZE=10240 + +# Media geometry, only relevant if bios doesn't understand LBA. +NANO_SECTS=63 +NANO_HEADS=16 + +# boot0 flags/options and configuration +NANO_BOOT0CFG="-o packet -s 1 -m 3" +NANO_BOOTLOADER="boot/boot0sio" + +# boot2 flags/options +# default force serial console +NANO_BOOT2CFG="-h" + +# Backing type of md(4) device +# Can be "file" or "swap" +NANO_MD_BACKING="file" + +# for swap type md(4) backing, write out the mbr only +NANO_IMAGE_MBRONLY=true + +# Progress Print level +PPLEVEL=3 + +# Set NANO_LABEL to non-blank to form the basis for using /dev/ufs/label +# in preference to /dev/${NANO_DRIVE} +# Root partition will be ${NANO_LABEL}s{1,2} +# /cfg partition will be ${NANO_LABEL}s3 +# /data partition will be ${NANO_LABEL}s4 +NANO_LABEL="" + +####################################################################### +# Architecture to build. Corresponds to TARGET_ARCH in a buildworld. +# Unfortunately, there's no way to set TARGET at this time, and it +# conflates the two, so architectures where TARGET != TARGET_ARCH do +# not work. This defaults to the arch of the current machine. + +NANO_ARCH=`uname -p` + +# Directory to populate /cfg from +NANO_CFGDIR="" + +# Directory to populate /data from +NANO_DATADIR="" + +# src.conf to use when building the image. Defaults to /dev/null for the sake +# of determinism. +SRCCONF=${SRCCONF:=/dev/null} + +####################################################################### +# +# The functions which do the real work. +# Can be overridden from the config file(s) +# +####################################################################### + +# rm doesn't know -x prior to FreeBSD 10, so cope with a variety of build +# hosts for now. +nano_rm ( ) { + case $(uname -r) in + 7*|8*|9*) rm $* ;; + *) rm -x $* ;; + esac +} + +# run in the world chroot, errors fatal +CR() +{ + chroot ${NANO_WORLDDIR} /bin/sh -exc "$*" +} + +# run in the world chroot, errors not fatal +CR0() +{ + chroot ${NANO_WORLDDIR} /bin/sh -c "$*" || true +} + +nano_cleanup ( ) ( + if [ $? -ne 0 ]; then + echo "Error encountered. Check for errors in last log file." 1>&2 + fi + exit $? +) + +clean_build ( ) ( + pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" + + if ! nano_rm -rf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then + chflags -R noschg ${MAKEOBJDIRPREFIX}/ + nano_rm -r ${MAKEOBJDIRPREFIX}/ + fi +) + +make_conf_build ( ) ( + pprint 2 "Construct build make.conf ($NANO_MAKE_CONF_BUILD)" + + mkdir -p ${MAKEOBJDIRPREFIX} + printenv > ${MAKEOBJDIRPREFIX}/_.env + + echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD} + echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD} +) + +build_world ( ) ( + pprint 2 "run buildworld" + pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bw" + + cd ${NANO_SRC} + env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \ + SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_BUILD} buildworld \ + > ${MAKEOBJDIRPREFIX}/_.bw 2>&1 +) + +build_kernel ( ) ( + local extra + + pprint 2 "build kernel ($NANO_KERNEL)" + pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk" + + ( + if [ -f ${NANO_KERNEL} ] ; then + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" + kernconf=$(basename ${NANO_KERNEL}) + else + kernconf=${NANO_KERNEL} + fi + + cd ${NANO_SRC}; + # unset these just in case to avoid compiler complaints + # when cross-building + unset TARGET_CPUTYPE + # Note: We intentionally build all modules, not only the ones in + # NANO_MODULES so the built world can be reused by multiple images. + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ + SRCCONF='${SRCCONF}' \ + __MAKE_CONF='${NANO_MAKE_CONF_BUILD}' \ + ${kernconfdir_arg} KERNCONF=${kernconf}" + ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 +) + +clean_world ( ) ( + if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then + pprint 2 "Clean and create object directory (${NANO_OBJ})" + if ! nano_rm -rf ${NANO_OBJ}/ > /dev/null 2>&1 ; then + chflags -R noschg ${NANO_OBJ} + nano_rm -r ${NANO_OBJ}/ + fi + mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR} + printenv > ${NANO_OBJ}/_.env + else + pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" + if ! nano_rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then + chflags -R noschg ${NANO_WORLDDIR} + nano_rm -rf ${NANO_WORLDDIR}/ + fi + mkdir -p ${NANO_WORLDDIR} + fi +) + +make_conf_install ( ) ( + pprint 2 "Construct install make.conf ($NANO_MAKE_CONF_INSTALL)" + + echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_INSTALL} + echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF_INSTALL} +) + +install_world ( ) ( + pprint 2 "installworld" + pprint 3 "log: ${NANO_OBJ}/_.iw" + + cd ${NANO_SRC} + env TARGET_ARCH=${NANO_ARCH} \ + ${NANO_MAKE} SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ + DESTDIR=${NANO_WORLDDIR} \ + > ${NANO_OBJ}/_.iw 2>&1 + chflags -R noschg ${NANO_WORLDDIR} +) + +install_etc ( ) ( + + pprint 2 "install /etc" + pprint 3 "log: ${NANO_OBJ}/_.etc" + + cd ${NANO_SRC} + env TARGET_ARCH=${NANO_ARCH} \ + ${NANO_MAKE} SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ + DESTDIR=${NANO_WORLDDIR} \ + > ${NANO_OBJ}/_.etc 2>&1 + # make.conf doesn't get created by default, but some ports need it + # so they can spam it. + cp /dev/null ${NANO_WORLDDIR}/etc/make.conf +) + +install_kernel ( ) ( + local extra + + pprint 2 "install kernel ($NANO_KERNEL)" + pprint 3 "log: ${NANO_OBJ}/_.ik" + + ( + if [ -f ${NANO_KERNEL} ] ; then + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" + kernconf=$(basename ${NANO_KERNEL}) + else + kernconf=${NANO_KERNEL} + fi + + # Install all built modules if NANO_MODULES=default, + # else install only listed modules (none if NANO_MODULES is empty). + if [ "${NANO_MODULES}" != "default" ]; then + modules_override_arg="MODULES_OVERRIDE='${NANO_MODULES}'" + fi + + cd ${NANO_SRC} + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ + DESTDIR='${NANO_WORLDDIR}' \ + SRCCONF='${SRCCONF}' \ + __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \ + ${kernconfdir_arg} KERNCONF=${kernconf} \ + ${modules_override_arg}" + ) > ${NANO_OBJ}/_.ik 2>&1 +) + +native_xtools ( ) ( + print 2 "Installing the optimized native build tools for cross env" + pprint 3 "log: ${NANO_OBJ}/_.native_xtools" + + cd ${NANO_SRC} + env TARGET_ARCH=${NANO_ARCH} \ + ${NANO_MAKE} SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} native-xtools \ + DESTDIR=${NANO_WORLDDIR} \ + > ${NANO_OBJ}/_.native_xtools 2>&1 +) + +run_customize() ( + + pprint 2 "run customize scripts" + for c in $NANO_CUSTOMIZE + do + pprint 2 "customize \"$c\"" + pprint 3 "log: ${NANO_OBJ}/_.cust.$c" + pprint 4 "`type $c`" + ( set -x ; $c ) > ${NANO_OBJ}/_.cust.$c 2>&1 + done +) + +run_late_customize() ( + + pprint 2 "run late customize scripts" + for c in $NANO_LATE_CUSTOMIZE + do + pprint 2 "late customize \"$c\"" + pprint 3 "log: ${NANO_OBJ}/_.late_cust.$c" + pprint 4 "`type $c`" + ( set -x ; $c ) > ${NANO_OBJ}/_.late_cust.$c 2>&1 + done +) + +setup_nanobsd ( ) ( + pprint 2 "configure nanobsd setup" + pprint 3 "log: ${NANO_OBJ}/_.dl" + + ( + cd ${NANO_WORLDDIR} + + # Move /usr/local/etc to /etc/local so that the /cfg stuff + # can stomp on it. Otherwise packages like ipsec-tools which + # have hardcoded paths under ${prefix}/etc are not tweakable. + if [ -d usr/local/etc ] ; then + ( + mkdir -p etc/local + cd usr/local/etc + find . -print | cpio -dumpl ../../../etc/local + cd .. + nano_rm -rf etc + ln -s ../../etc/local etc + ) + fi + + for d in var etc + do + # link /$d under /conf + # we use hard links so we have them both places. + # the files in /$d will be hidden by the mount. + # XXX: configure /$d ramdisk size + mkdir -p conf/base/$d conf/default/$d + find $d -print | cpio -dumpl conf/base/ + done + + echo "$NANO_RAM_ETCSIZE" > conf/base/etc/md_size + echo "$NANO_RAM_TMPVARSIZE" > conf/base/var/md_size + + # pick up config files from the special partition + echo "mount -o ro /dev/${NANO_DRIVE}s3" > conf/default/etc/remount + + # Put /tmp on the /var ramdisk (could be symlink already) + nano_rm -rf tmp + ln -s var/tmp tmp + + ) > ${NANO_OBJ}/_.dl 2>&1 +) + +setup_nanobsd_etc ( ) ( + pprint 2 "configure nanobsd /etc" + + ( + cd ${NANO_WORLDDIR} + + # create diskless marker file + touch etc/diskless + + # Make root filesystem R/O by default + echo "root_rw_mount=NO" >> etc/defaults/rc.conf + + # save config file for scripts + echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf + + echo "/dev/${NANO_DRIVE}s1a / ufs ro 1 1" > etc/fstab + echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab + mkdir -p cfg + ) +) + +prune_usr() ( + + # Remove all empty directories in /usr + find ${NANO_WORLDDIR}/usr -type d -depth -print | + while read d + do + rmdir $d > /dev/null 2>&1 || true + done +) + +newfs_part ( ) ( + local dev mnt lbl + dev=$1 + mnt=$2 + lbl=$3 + echo newfs ${NANO_NEWFS} ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev} + newfs ${NANO_NEWFS} ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev} + mount -o async ${dev} ${mnt} +) + +# Convenient spot to work around any umount issues that your build environment +# hits by overriding this method. +nano_umount () ( + umount ${1} +) + +populate_slice ( ) ( + local dev dir mnt lbl + dev=$1 + dir=$2 + mnt=$3 + lbl=$4 + echo "Creating ${dev} (mounting on ${mnt})" + newfs_part ${dev} ${mnt} ${lbl} + if [ -n "${dir}" -a -d "${dir}" ]; then + echo "Populating ${lbl} from ${dir}" + cd ${dir} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${mnt} + fi + df -i ${mnt} + nano_umount ${mnt} +) + +populate_cfg_slice ( ) ( + populate_slice "$1" "$2" "$3" "$4" +) + +populate_data_slice ( ) ( + populate_slice "$1" "$2" "$3" "$4" +) + +create_diskimage ( ) ( + pprint 2 "build diskimage" + pprint 3 "log: ${NANO_OBJ}/_.di" + + ( + echo $NANO_MEDIASIZE $NANO_IMAGES \ + $NANO_SECTS $NANO_HEADS \ + $NANO_CODESIZE $NANO_CONFSIZE $NANO_DATASIZE | + awk ' + { + printf "# %s\n", $0 + + # size of cylinder in sectors + cs = $3 * $4 + + # number of full cylinders on media + cyl = int ($1 / cs) + + # output fdisk geometry spec, truncate cyls to 1023 + if (cyl <= 1023) + print "g c" cyl " h" $4 " s" $3 + else + print "g c" 1023 " h" $4 " s" $3 + + if ($7 > 0) { + # size of data partition in full cylinders + dsl = int (($7 + cs - 1) / cs) + } else { + dsl = 0; + } + + # size of config partition in full cylinders + csl = int (($6 + cs - 1) / cs) + + if ($5 == 0) { + # size of image partition(s) in full cylinders + isl = int ((cyl - dsl - csl) / $2) + } else { + isl = int (($5 + cs - 1) / cs) + } + + # First image partition start at second track + print "p 1 165 " $3, isl * cs - $3 + c = isl * cs; + + # Second image partition (if any) also starts offset one + # track to keep them identical. + if ($2 > 1) { + print "p 2 165 " $3 + c, isl * cs - $3 + c += isl * cs; + } + + # Config partition starts at cylinder boundary. + print "p 3 165 " c, csl * cs + c += csl * cs + + # Data partition (if any) starts at cylinder boundary. + if ($7 > 0) { + print "p 4 165 " c, dsl * cs + } else if ($7 < 0 && $1 > c) { + print "p 4 165 " c, $1 - c + } else if ($1 < c) { + print "Disk space overcommitted by", \ + c - $1, "sectors" > "/dev/stderr" + exit 2 + } + + # Force slice 1 to be marked active. This is necessary + # for booting the image from a USB device to work. + print "a 1" + } + ' > ${NANO_OBJ}/_.fdisk + + IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} + MNT=${NANO_OBJ}/_.mnt + mkdir -p ${MNT} + + if [ "${NANO_MD_BACKING}" = "swap" ] ; then + MD=`mdconfig -a -t swap -s ${NANO_MEDIASIZE} -x ${NANO_SECTS} \ + -y ${NANO_HEADS}` + else + echo "Creating md backing file..." + nano_rm -f ${IMG} + dd if=/dev/zero of=${IMG} seek=${NANO_MEDIASIZE} count=0 + MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ + -y ${NANO_HEADS}` + fi + + trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT + + fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} + fdisk ${MD} + # XXX: params + # XXX: pick up cached boot* files, they may not be in image anymore. + if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then + boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} + fi + if [ -f ${NANO_WORLDDIR}/boot/boot ]; then + bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}s1 + else + bsdlabel -w ${MD}s1 + fi + bsdlabel ${MD}s1 + + # Create first image + populate_slice /dev/${MD}s1a ${NANO_WORLDDIR} ${MNT} "s1a" + mount /dev/${MD}s1a ${MNT} + echo "Generating mtree..." + ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree + ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du + nano_umount ${MNT} + + if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then + # Duplicate to second image (if present) + echo "Duplicating to second image..." + dd conv=sparse if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k + mount /dev/${MD}s2a ${MNT} + for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab + do + sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f + done + nano_umount ${MNT} + # Override the label from the first partition so we + # don't confuse glabel with duplicates. + if [ ! -z ${NANO_LABEL} ]; then + tunefs -L ${NANO_LABEL}"s2a" /dev/${MD}s2a + fi + fi + + # Create Config slice + populate_cfg_slice /dev/${MD}s3 "${NANO_CFGDIR}" ${MNT} "s3" + + # Create Data slice, if any. + if [ $NANO_DATASIZE -ne 0 ] ; then + populate_data_slice /dev/${MD}s4 "${NANO_DATADIR}" ${MNT} "s4" + fi + + if [ "${NANO_MD_BACKING}" = "swap" ] ; then + if [ ${NANO_IMAGE_MBRONLY} ]; then + echo "Writing out _.disk.mbr..." + dd if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.mbr bs=512 count=1 + else + echo "Writing out ${NANO_IMGNAME}..." + dd if=/dev/${MD} of=${IMG} bs=64k + fi + + echo "Writing out ${NANO_IMGNAME}..." + dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k + fi + + if ${do_copyout_partition} ; then + echo "Writing out _.disk.image..." + dd conv=sparse if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + fi + mdconfig -d -u $MD + + trap - 1 2 15 + trap nano_cleanup EXIT + + ) > ${NANO_OBJ}/_.di 2>&1 +) + +last_orders () ( + # Redefine this function with any last orders you may have + # after the build completed, for instance to copy the finished + # image to a more convenient place: + # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk + true +) + +####################################################################### +# +# Optional convenience functions. +# +####################################################################### + +####################################################################### +# Common Flash device geometries +# + +FlashDevice () { + if [ -d ${NANO_TOOLS} ] ; then + . ${NANO_TOOLS}/FlashDevice.sub + else + . ${NANO_SRC}/${NANO_TOOLS}/FlashDevice.sub + fi + sub_FlashDevice $1 $2 +} + +####################################################################### +# USB device geometries +# +# Usage: +# UsbDevice Generic 1000 # a generic flash key sold as having 1GB +# +# This function will set NANO_MEDIASIZE, NANO_HEADS and NANO_SECTS for you. +# +# Note that the capacity of a flash key is usually advertised in MB or +# GB, *not* MiB/GiB. As such, the precise number of cylinders available +# for C/H/S geometry may vary depending on the actual flash geometry. +# +# The following generic device layouts are understood: +# generic An alias for generic-hdd. +# generic-hdd 255H 63S/T xxxxC with no MBR restrictions. +# generic-fdd 64H 32S/T xxxxC with no MBR restrictions. +# +# The generic-hdd device is preferred for flash devices larger than 1GB. +# + +UsbDevice () { + a1=`echo $1 | tr '[:upper:]' '[:lower:]'` + case $a1 in + generic-fdd) + NANO_HEADS=64 + NANO_SECTS=32 + NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 )) + ;; + generic|generic-hdd) + NANO_HEADS=255 + NANO_SECTS=63 + NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 )) + ;; + *) + echo "Unknown USB flash device" + exit 2 + ;; + esac +} + +####################################################################### +# Setup serial console + +cust_comconsole () ( + # Enable getty on console + sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys + + # Disable getty on syscons devices + sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${NANO_WORLDDIR}/etc/ttys + + # Tell loader to use serial console early. + echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config +) + +####################################################################### +# Allow root login via ssh + +cust_allow_ssh_root () ( + sed -i "" -e '/PermitRootLogin/s/.*/PermitRootLogin yes/' \ + ${NANO_WORLDDIR}/etc/ssh/sshd_config +) + +####################################################################### +# Install the stuff under ./Files + +cust_install_files () ( + cd ${NANO_TOOLS}/Files + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR} +) + +####################################################################### +# Install packages from ${NANO_PACKAGE_DIR} + +cust_pkg () ( + + # If the package directory doesn't exist, we're done. + if [ ! -d ${NANO_PACKAGE_DIR} ]; then + echo "DONE 0 packages" + return 0 + fi + + # Copy packages into chroot + mkdir -p ${NANO_WORLDDIR}/Pkg ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg + ( + cd ${NANO_PACKAGE_DIR} + find ${NANO_PACKAGE_LIST} -print | + cpio -Ldumpv ${NANO_WORLDDIR}/Pkg + ) + + # Count & report how many we have to install + todo=`ls ${NANO_WORLDDIR}/Pkg | wc -l` + echo "=== TODO: $todo" + ls ${NANO_WORLDDIR}/Pkg + echo "===" + while true + do + # Record how many we have now + have=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` + + # Attempt to install more packages + # ...but no more than 200 at a time due to pkg_add's internal + # limitations. + CR0 'ls Pkg/*tbz | xargs -n 200 env PKG_DBDIR='${NANO_PKG_META_BASE}'/pkg pkg_add -v -F' + + # See what that got us + now=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` + echo "=== NOW $now" + ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg + echo "===" + + + if [ $now -eq $todo ] ; then + echo "DONE $now packages" + break + elif [ $now -eq $have ] ; then + echo "FAILED: Nothing happened on this pass" + exit 2 + fi + done + nano_rm -rf ${NANO_WORLDDIR}/Pkg +) + +cust_pkgng () ( + + # If the package directory doesn't exist, we're done. + if [ ! -d ${NANO_PACKAGE_DIR} ]; then + echo "DONE 0 packages" + return 0 + fi + + # Find a pkg-* package + for x in `find -s ${NANO_PACKAGE_DIR} -iname 'pkg-*'`; do + _NANO_PKG_PACKAGE=`basename "$x"` + done + if [ -z "${_NANO_PKG_PACKAGE}" -o ! -f "${NANO_PACKAGE_DIR}/${_NANO_PKG_PACKAGE}" ]; then + echo "FAILED: need a pkg/ package for bootstrapping" + exit 2 + fi + + # Copy packages into chroot + mkdir -p ${NANO_WORLDDIR}/Pkg + ( + cd ${NANO_PACKAGE_DIR} + find ${NANO_PACKAGE_LIST} -print | + cpio -Ldumpv ${NANO_WORLDDIR}/Pkg + ) + + #Bootstrap pkg + CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /Pkg/${_NANO_PKG_PACKAGE} + CR pkg -N >/dev/null 2>&1 + if [ "$?" -ne "0" ]; then + echo "FAILED: pkg bootstrapping faied" + exit 2 + fi + nano_rm -f ${NANO_WORLDDIR}/Pkg/pkg-* + + # Count & report how many we have to install + todo=`ls ${NANO_WORLDDIR}/Pkg | /usr/bin/wc -l` + todo=$(expr $todo + 1) # add one for pkg since it is installed already + echo "=== TODO: $todo" + ls ${NANO_WORLDDIR}/Pkg + echo "===" + while true + do + # Record how many we have now + have=$(CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l) + + # Attempt to install more packages + CR0 'ls 'Pkg/*txz' | xargs env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg add' + + # See what that got us + now=$(CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l) + echo "=== NOW $now" + CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info + echo "===" + if [ $now -eq $todo ] ; then + echo "DONE $now packages" + break + elif [ $now -eq $have ] ; then + echo "FAILED: Nothing happened on this pass" + exit 2 + fi + done + nano_rm -rf ${NANO_WORLDDIR}/Pkg +) + +####################################################################### +# Convenience function: +# Register all args as customize function. + +customize_cmd () { + NANO_CUSTOMIZE="$NANO_CUSTOMIZE $*" +} + +####################################################################### +# Convenience function: +# Register all args as late customize function to run just before +# image creation. + +late_customize_cmd () { + NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $*" +} + +####################################################################### +# +# All set up to go... +# +####################################################################### + +# Progress Print +# Print $2 at level $1. +pprint() ( + if [ "$1" -le $PPLEVEL ]; then + runtime=$(( `date +%s` - $NANO_STARTTIME )) + printf "%s %.${1}s %s\n" "`date -u -r $runtime +%H:%M:%S`" "#####" "$2" 1>&3 + fi +) + +usage () { + ( + echo "Usage: $0 [-bfiKknqvw] [-c config_file]" + echo " -b suppress builds (both kernel and world)" + echo " -c specify config file" + echo " -f suppress code slice extraction" + echo " -i suppress disk image build" + echo " -K suppress installkernel" + echo " -k suppress buildkernel" + echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" + echo " -q make output more quiet" + echo " -v make output more verbose" + echo " -w suppress buildworld" + ) 1>&2 + exit 2 +} + +####################################################################### +# Setup and Export Internal variables +# + +export_var() { + var=$1 + # Lookup value of the variable. + eval val=\$$var + pprint 3 "Setting variable: $var=\"$val\"" + export $1 +} + +# Call this function to set defaults _after_ parsing options. +set_defaults_and_export() { + test -n "${NANO_OBJ}" || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME} + test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=${NANO_OBJ} + test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=${NANO_OBJ} + NANO_WORLDDIR=${NANO_OBJ}/_.w + NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build + NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install + + # Override user's NANO_DRIVE if they specified a NANO_LABEL + [ ! -z "${NANO_LABEL}" ] && NANO_DRIVE="ufs/${NANO_LABEL}" + + # Set a default NANO_TOOLS to NANO_SRC/NANO_TOOLS if it exists. + [ ! -d "${NANO_TOOLS}" ] && [ -d "${NANO_SRC}/${NANO_TOOLS}" ] && \ + NANO_TOOLS="${NANO_SRC}/${NANO_TOOLS}" + + NANO_STARTTIME=`date +%s` + pprint 3 "Exporting NanoBSD variables" + export_var MAKEOBJDIRPREFIX + export_var NANO_ARCH + export_var NANO_CODESIZE + export_var NANO_CONFSIZE + export_var NANO_CUSTOMIZE + export_var NANO_DATASIZE + export_var NANO_DRIVE + export_var NANO_HEADS + export_var NANO_IMAGES + export_var NANO_IMGNAME + export_var NANO_MAKE + export_var NANO_MAKE_CONF_BUILD + export_var NANO_MAKE_CONF_INSTALL + export_var NANO_MEDIASIZE + export_var NANO_NAME + export_var NANO_NEWFS + export_var NANO_OBJ + export_var NANO_PMAKE + export_var NANO_SECTS + export_var NANO_SRC + export_var NANO_TOOLS + export_var NANO_WORLDDIR + export_var NANO_BOOT0CFG + export_var NANO_BOOTLOADER + export_var NANO_LABEL + export_var NANO_MODULES +} Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Dec 16 16:23:54 2014 (r275831) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Dec 16 17:59:05 2014 (r275832) @@ -29,900 +29,9 @@ set -e -####################################################################### -# -# Setup default values for all controlling variables. -# These values can be overridden from the config file(s) -# -####################################################################### - -# Name of this NanoBSD build. (Used to construct workdir names) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 18:04:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2D5A609; Tue, 16 Dec 2014 18:04:43 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C0A91644; Tue, 16 Dec 2014 18:04:43 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sBGI4gH6078214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Dec 2014 10:04:42 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sBGI4gUA078213; Tue, 16 Dec 2014 10:04:42 -0800 (PST) (envelope-from sgk) Date: Tue, 16 Dec 2014 10:04:42 -0800 From: Steve Kargl To: Ed Schouten Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src Message-ID: <20141216180442.GA78155@troutmask.apl.washington.edu> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412160921.sBG9LvFY064961@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 18:04:44 -0000 On Tue, Dec 16, 2014 at 09:21:57AM +0000, Ed Schouten wrote: > Author: ed > Date: Tue Dec 16 09:21:56 2014 > New Revision: 275819 > URL: https://svnweb.freebsd.org/changeset/base/275819 > > Log: > Rename cpack*() to CMPLX*(). > > The C11 standard introduced a set of macros (CMPLX, CMPLXF, CMPLXL) that > can be used to construct complex numbers from a pair of real and > imaginary numbers. Unfortunately, they require some compiler support, > which is why we only define them for Clang and GCC>=4.7. > > The cpack() function in libm performs the same task as CMPLX(), but > cannot be used to generate compile-time constants. This means that all > invocations of cpack() can safely be replaced by C11's CMPLX(). To keep > the code building with GCC 4.2, provide copies of CMPLX() that can at > least be used to generate run-time complex numbers. > Upon further inspection with md5, this change affects only a single file. This last paragraph appears to be an excuse for a drive-by commit. troutmask:fvwm:kargl[344] diff -u /tmp/z1 /tmp/z2 --- /tmp/z1 2014-12-16 09:55:43.000000000 -0800 +++ /tmp/z2 2014-12-16 09:56:56.000000000 -0800 @@ -120,7 +120,7 @@ MD5 (s_creall.o) = f6b01801ab3f8f25ff99af82b6d4e9eb MD5 (s_csinh.o) = 76f7f5b02b7819b519128601460fcf73 MD5 (s_csinhf.o) = 96c92bc7a55d07f1f75b81f18dce8a44 -MD5 (s_csqrt.o) = 4977fe45f768c5e9810acce3b8a140aa +MD5 (s_csqrt.o) = 021c7865dd71345c72410197a6b09590 MD5 (s_csqrtf.o) = 13a79f36965a044df8f983f341a3efcc MD5 (s_csqrtl.o) = dbd00142793a2e51dc3df756f3aab42f MD5 (s_ctanh.o) = cb5055264c9bad7352e7406b4d9520f1 -- steve From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 18:07:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B060789 for ; Tue, 16 Dec 2014 18:07:53 +0000 (UTC) Received: from mail-qc0-f176.google.com (mail-qc0-f176.google.com [209.85.216.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7243667 for ; Tue, 16 Dec 2014 18:07:52 +0000 (UTC) Received: by mail-qc0-f176.google.com with SMTP id i17so10761992qcy.21 for ; Tue, 16 Dec 2014 10:07:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=sGjl8zYNgIGGL9HsAl/CJU1klzNq8k+1M+OdmARE/oI=; b=jp2FgQfUM8LrwHeJrnjCLgQxJaFCNKdls7wSf2LvyUzF5/3MQCU05TDtN9j9XVEdih sm0FLG5OFoI+orqgDvHNQzOmVAb2vRTqYg9tTGf2cI4sviZXQw1RMYv8fwwK5/atGaUJ XaDXr0T7pgq/1Md4zp33rX90nyZmpm1/KhpkWHUJST+ZdCVDNQzsozAMA+auHNeh7w4Z kp5zfP9GAf4tWwSBI4ladKWbtrcHl/h3X4Hm3J/faiilNJ/wc2Fk2JRKa3mDviqeUAUf pA66QfW6i9jNZuWWjluAx371tePdmsjujkvPaq5ci3feU2PqfMRxJPvL7PuLj5gp0KAr 4xfQ== X-Gm-Message-State: ALoCoQlmhbFDYohJ+JhvjLcmao6KIXwKZuUoXVkSQUTamsfLfN2aaOZnrStCVpBCP5PgVceEHBVo MIME-Version: 1.0 X-Received: by 10.140.95.52 with SMTP id h49mr63203358qge.97.1418753266326; Tue, 16 Dec 2014 10:07:46 -0800 (PST) Received: by 10.140.88.103 with HTTP; Tue, 16 Dec 2014 10:07:46 -0800 (PST) In-Reply-To: <201412161759.sBGHx6ZL016021@svn.freebsd.org> References: <201412161759.sBGHx6ZL016021@svn.freebsd.org> Date: Tue, 16 Dec 2014 11:07:46 -0700 Message-ID: Subject: Re: svn commit: r275832 - head/tools/tools/nanobsd From: Will Andrews 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 18:07:53 -0000 This change was committed with 'arc commit'. I had intended to note in the commit message that this change does not make any sort of API guarantee. It is just intended to enable reuse. --Will. On Tue, Dec 16, 2014 at 10:59 AM, Will Andrews wrote: > Author: will > Date: Tue Dec 16 17:59:05 2014 > New Revision: 275832 > URL: https://svnweb.freebsd.org/changeset/base/275832 > > Log: > Make NanoBSD source-able from other scripts. > > Summary: > This change converts NanoBSD into a two-script bundle. > - defaults.sh contains all non-CLI code. Most NanoBSD code is moved into > this file. > - nanobsd.sh now consists just of a command line interface that calls into > functions in defaults.sh. > > Test Plan: Run NanoBSD using a previously-working configuration. > > Reviewers: imp > > Reviewed By: imp > > Differential Revision: https://reviews.freebsd.org/D1321 > > Added: > head/tools/tools/nanobsd/defaults.sh (contents, props changed) > Modified: > head/tools/tools/nanobsd/nanobsd.sh > > Added: head/tools/tools/nanobsd/defaults.sh > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/tools/nanobsd/defaults.sh Tue Dec 16 17:59:05 2014 (r275832) > @@ -0,0 +1,983 @@ > +#!/bin/sh > +# > +# Copyright (c) 2005 Poul-Henning Kamp. > +# All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without > +# modification, are permitted provided that the following conditions > +# are met: > +# 1. Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# 2. Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in the > +# documentation and/or other materials provided with the distribution. > +# > +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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$ > +# > + > +set -e > + > +####################################################################### > +# > +# Setup default values for all controlling variables. > +# These values can be overridden from the config file(s) > +# > +####################################################################### > + > +# Name of this NanoBSD build. (Used to construct workdir names) > +NANO_NAME=full > + > +# Source tree directory > +NANO_SRC=/usr/src > + > +# Where nanobsd additional files live under the source tree > +NANO_TOOLS=tools/tools/nanobsd > + > +# Where cust_pkg() finds packages to install > +NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg > +NANO_PACKAGE_LIST="*" > + > +# where package metadata gets placed > +NANO_PKG_META_BASE=/var/db > + > +# Object tree directory > +# default is subdir of /usr/obj > +#NANO_OBJ="" > + > +# The directory to put the final images > +# default is ${NANO_OBJ} > +#NANO_DISKIMGDIR="" > + > +# Make & parallel Make > +NANO_MAKE="make" > +NANO_PMAKE="make -j 3" > + > +# The default name for any image we create. > +NANO_IMGNAME="_.disk.full" > + > +# Options to put in make.conf during buildworld only > +CONF_BUILD=' ' > + > +# Options to put in make.conf during installworld only > +CONF_INSTALL=' ' > + > +# Options to put in make.conf during both build- & installworld. > +CONF_WORLD=' ' > + > +# Kernel config file to use > +NANO_KERNEL=GENERIC > + > +# Kernel modules to install. If empty, no modules are installed. > +# Use "default" to install all built modules. > +NANO_MODULES= > + > +# Customize commands. > +NANO_CUSTOMIZE="" > + > +# Late customize commands. > +NANO_LATE_CUSTOMIZE="" > + > +# Newfs paramters to use > +NANO_NEWFS="-b 4096 -f 512 -i 8192 -U" > + > +# The drive name of the media at runtime > +NANO_DRIVE=ad0 > + > +# Target media size in 512 bytes sectors > +NANO_MEDIASIZE=2000000 > + > +# Number of code images on media (1 or 2) > +NANO_IMAGES=2 > + > +# 0 -> Leave second image all zeroes so it compresses better. > +# 1 -> Initialize second image with a copy of the first > +NANO_INIT_IMG2=1 > + > +# Size of code file system in 512 bytes sectors > +# If zero, size will be as large as possible. > +NANO_CODESIZE=0 > + > +# Size of configuration file system in 512 bytes sectors > +# Cannot be zero. > +NANO_CONFSIZE=2048 > + > +# Size of data file system in 512 bytes sectors > +# If zero: no partition configured. > +# If negative: max size possible > +NANO_DATASIZE=0 > + > +# Size of the /etc ramdisk in 512 bytes sectors > +NANO_RAM_ETCSIZE=10240 > + > +# Size of the /tmp+/var ramdisk in 512 bytes sectors > +NANO_RAM_TMPVARSIZE=10240 > + > +# Media geometry, only relevant if bios doesn't understand LBA. > +NANO_SECTS=63 > +NANO_HEADS=16 > + > +# boot0 flags/options and configuration > +NANO_BOOT0CFG="-o packet -s 1 -m 3" > +NANO_BOOTLOADER="boot/boot0sio" > + > +# boot2 flags/options > +# default force serial console > +NANO_BOOT2CFG="-h" > + > +# Backing type of md(4) device > +# Can be "file" or "swap" > +NANO_MD_BACKING="file" > + > +# for swap type md(4) backing, write out the mbr only > +NANO_IMAGE_MBRONLY=true > + > +# Progress Print level > +PPLEVEL=3 > + > +# Set NANO_LABEL to non-blank to form the basis for using /dev/ufs/label > +# in preference to /dev/${NANO_DRIVE} > +# Root partition will be ${NANO_LABEL}s{1,2} > +# /cfg partition will be ${NANO_LABEL}s3 > +# /data partition will be ${NANO_LABEL}s4 > +NANO_LABEL="" > + > +####################################################################### > +# Architecture to build. Corresponds to TARGET_ARCH in a buildworld. > +# Unfortunately, there's no way to set TARGET at this time, and it > +# conflates the two, so architectures where TARGET != TARGET_ARCH do > +# not work. This defaults to the arch of the current machine. > + > +NANO_ARCH=`uname -p` > + > +# Directory to populate /cfg from > +NANO_CFGDIR="" > + > +# Directory to populate /data from > +NANO_DATADIR="" > + > +# src.conf to use when building the image. Defaults to /dev/null for the sake > +# of determinism. > +SRCCONF=${SRCCONF:=/dev/null} > + > +####################################################################### > +# > +# The functions which do the real work. > +# Can be overridden from the config file(s) > +# > +####################################################################### > + > +# rm doesn't know -x prior to FreeBSD 10, so cope with a variety of build > +# hosts for now. > +nano_rm ( ) { > + case $(uname -r) in > + 7*|8*|9*) rm $* ;; > + *) rm -x $* ;; > + esac > +} > + > +# run in the world chroot, errors fatal > +CR() > +{ > + chroot ${NANO_WORLDDIR} /bin/sh -exc "$*" > +} > + > +# run in the world chroot, errors not fatal > +CR0() > +{ > + chroot ${NANO_WORLDDIR} /bin/sh -c "$*" || true > +} > + > +nano_cleanup ( ) ( > + if [ $? -ne 0 ]; then > + echo "Error encountered. Check for errors in last log file." 1>&2 > + fi > + exit $? > +) > + > +clean_build ( ) ( > + pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" > + > + if ! nano_rm -rf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then > + chflags -R noschg ${MAKEOBJDIRPREFIX}/ > + nano_rm -r ${MAKEOBJDIRPREFIX}/ > + fi > +) > + > +make_conf_build ( ) ( > + pprint 2 "Construct build make.conf ($NANO_MAKE_CONF_BUILD)" > + > + mkdir -p ${MAKEOBJDIRPREFIX} > + printenv > ${MAKEOBJDIRPREFIX}/_.env > + > + echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD} > + echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD} > +) > + > +build_world ( ) ( > + pprint 2 "run buildworld" > + pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bw" > + > + cd ${NANO_SRC} > + env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \ > + SRCCONF=${SRCCONF} \ > + __MAKE_CONF=${NANO_MAKE_CONF_BUILD} buildworld \ > + > ${MAKEOBJDIRPREFIX}/_.bw 2>&1 > +) > + > +build_kernel ( ) ( > + local extra > + > + pprint 2 "build kernel ($NANO_KERNEL)" > + pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk" > + > + ( > + if [ -f ${NANO_KERNEL} ] ; then > + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" > + kernconf=$(basename ${NANO_KERNEL}) > + else > + kernconf=${NANO_KERNEL} > + fi > + > + cd ${NANO_SRC}; > + # unset these just in case to avoid compiler complaints > + # when cross-building > + unset TARGET_CPUTYPE > + # Note: We intentionally build all modules, not only the ones in > + # NANO_MODULES so the built world can be reused by multiple images. > + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ > + SRCCONF='${SRCCONF}' \ > + __MAKE_CONF='${NANO_MAKE_CONF_BUILD}' \ > + ${kernconfdir_arg} KERNCONF=${kernconf}" > + ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 > +) > + > +clean_world ( ) ( > + if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then > + pprint 2 "Clean and create object directory (${NANO_OBJ})" > + if ! nano_rm -rf ${NANO_OBJ}/ > /dev/null 2>&1 ; then > + chflags -R noschg ${NANO_OBJ} > + nano_rm -r ${NANO_OBJ}/ > + fi > + mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR} > + printenv > ${NANO_OBJ}/_.env > + else > + pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" > + if ! nano_rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then > + chflags -R noschg ${NANO_WORLDDIR} > + nano_rm -rf ${NANO_WORLDDIR}/ > + fi > + mkdir -p ${NANO_WORLDDIR} > + fi > +) > + > +make_conf_install ( ) ( > + pprint 2 "Construct install make.conf ($NANO_MAKE_CONF_INSTALL)" > + > + echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_INSTALL} > + echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF_INSTALL} > +) > + > +install_world ( ) ( > + pprint 2 "installworld" > + pprint 3 "log: ${NANO_OBJ}/_.iw" > + > + cd ${NANO_SRC} > + env TARGET_ARCH=${NANO_ARCH} \ > + ${NANO_MAKE} SRCCONF=${SRCCONF} \ > + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ > + DESTDIR=${NANO_WORLDDIR} \ > + > ${NANO_OBJ}/_.iw 2>&1 > + chflags -R noschg ${NANO_WORLDDIR} > +) > + > +install_etc ( ) ( > + > + pprint 2 "install /etc" > + pprint 3 "log: ${NANO_OBJ}/_.etc" > + > + cd ${NANO_SRC} > + env TARGET_ARCH=${NANO_ARCH} \ > + ${NANO_MAKE} SRCCONF=${SRCCONF} \ > + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ > + DESTDIR=${NANO_WORLDDIR} \ > + > ${NANO_OBJ}/_.etc 2>&1 > + # make.conf doesn't get created by default, but some ports need it > + # so they can spam it. > + cp /dev/null ${NANO_WORLDDIR}/etc/make.conf > +) > + > +install_kernel ( ) ( > + local extra > + > + pprint 2 "install kernel ($NANO_KERNEL)" > + pprint 3 "log: ${NANO_OBJ}/_.ik" > + > + ( > + if [ -f ${NANO_KERNEL} ] ; then > + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" > + kernconf=$(basename ${NANO_KERNEL}) > + else > + kernconf=${NANO_KERNEL} > + fi > + > + # Install all built modules if NANO_MODULES=default, > + # else install only listed modules (none if NANO_MODULES is empty). > + if [ "${NANO_MODULES}" != "default" ]; then > + modules_override_arg="MODULES_OVERRIDE='${NANO_MODULES}'" > + fi > + > + cd ${NANO_SRC} > + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ > + DESTDIR='${NANO_WORLDDIR}' \ > + SRCCONF='${SRCCONF}' \ > + __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \ > + ${kernconfdir_arg} KERNCONF=${kernconf} \ > + ${modules_override_arg}" > + ) > ${NANO_OBJ}/_.ik 2>&1 > +) > + > +native_xtools ( ) ( > + print 2 "Installing the optimized native build tools for cross env" > + pprint 3 "log: ${NANO_OBJ}/_.native_xtools" > + > + cd ${NANO_SRC} > + env TARGET_ARCH=${NANO_ARCH} \ > + ${NANO_MAKE} SRCCONF=${SRCCONF} \ > + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} native-xtools \ > + DESTDIR=${NANO_WORLDDIR} \ > + > ${NANO_OBJ}/_.native_xtools 2>&1 > +) > + > +run_customize() ( > + > + pprint 2 "run customize scripts" > + for c in $NANO_CUSTOMIZE > + do > + pprint 2 "customize \"$c\"" > + pprint 3 "log: ${NANO_OBJ}/_.cust.$c" > + pprint 4 "`type $c`" > + ( set -x ; $c ) > ${NANO_OBJ}/_.cust.$c 2>&1 > + done > +) > + > +run_late_customize() ( > + > + pprint 2 "run late customize scripts" > + for c in $NANO_LATE_CUSTOMIZE > + do > + pprint 2 "late customize \"$c\"" > + pprint 3 "log: ${NANO_OBJ}/_.late_cust.$c" > + pprint 4 "`type $c`" > + ( set -x ; $c ) > ${NANO_OBJ}/_.late_cust.$c 2>&1 > + done > +) > + > +setup_nanobsd ( ) ( > + pprint 2 "configure nanobsd setup" > + pprint 3 "log: ${NANO_OBJ}/_.dl" > + > + ( > + cd ${NANO_WORLDDIR} > + > + # Move /usr/local/etc to /etc/local so that the /cfg stuff > + # can stomp on it. Otherwise packages like ipsec-tools which > + # have hardcoded paths under ${prefix}/etc are not tweakable. > + if [ -d usr/local/etc ] ; then > + ( > + mkdir -p etc/local > + cd usr/local/etc > + find . -print | cpio -dumpl ../../../etc/local > + cd .. > + nano_rm -rf etc > + ln -s ../../etc/local etc > + ) > + fi > + > + for d in var etc > + do > + # link /$d under /conf > + # we use hard links so we have them both places. > + # the files in /$d will be hidden by the mount. > + # XXX: configure /$d ramdisk size > + mkdir -p conf/base/$d conf/default/$d > + find $d -print | cpio -dumpl conf/base/ > + done > + > + echo "$NANO_RAM_ETCSIZE" > conf/base/etc/md_size > + echo "$NANO_RAM_TMPVARSIZE" > conf/base/var/md_size > + > + # pick up config files from the special partition > + echo "mount -o ro /dev/${NANO_DRIVE}s3" > conf/default/etc/remount > + > + # Put /tmp on the /var ramdisk (could be symlink already) > + nano_rm -rf tmp > + ln -s var/tmp tmp > + > + ) > ${NANO_OBJ}/_.dl 2>&1 > +) > + > +setup_nanobsd_etc ( ) ( > + pprint 2 "configure nanobsd /etc" > + > + ( > + cd ${NANO_WORLDDIR} > + > + # create diskless marker file > + touch etc/diskless > + > + # Make root filesystem R/O by default > + echo "root_rw_mount=NO" >> etc/defaults/rc.conf > + > + # save config file for scripts > + echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf > + > + echo "/dev/${NANO_DRIVE}s1a / ufs ro 1 1" > etc/fstab > + echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab > + mkdir -p cfg > + ) > +) > + > +prune_usr() ( > + > + # Remove all empty directories in /usr > + find ${NANO_WORLDDIR}/usr -type d -depth -print | > + while read d > + do > + rmdir $d > /dev/null 2>&1 || true > + done > +) > + > +newfs_part ( ) ( > + local dev mnt lbl > + dev=$1 > + mnt=$2 > + lbl=$3 > + echo newfs ${NANO_NEWFS} ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev} > + newfs ${NANO_NEWFS} ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev} > + mount -o async ${dev} ${mnt} > +) > + > +# Convenient spot to work around any umount issues that your build environment > +# hits by overriding this method. > +nano_umount () ( > + umount ${1} > +) > + > +populate_slice ( ) ( > + local dev dir mnt lbl > + dev=$1 > + dir=$2 > + mnt=$3 > + lbl=$4 > + echo "Creating ${dev} (mounting on ${mnt})" > + newfs_part ${dev} ${mnt} ${lbl} > + if [ -n "${dir}" -a -d "${dir}" ]; then > + echo "Populating ${lbl} from ${dir}" > + cd ${dir} > + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${mnt} > + fi > + df -i ${mnt} > + nano_umount ${mnt} > +) > + > +populate_cfg_slice ( ) ( > + populate_slice "$1" "$2" "$3" "$4" > +) > + > +populate_data_slice ( ) ( > + populate_slice "$1" "$2" "$3" "$4" > +) > + > +create_diskimage ( ) ( > + pprint 2 "build diskimage" > + pprint 3 "log: ${NANO_OBJ}/_.di" > + > + ( > + echo $NANO_MEDIASIZE $NANO_IMAGES \ > + $NANO_SECTS $NANO_HEADS \ > + $NANO_CODESIZE $NANO_CONFSIZE $NANO_DATASIZE | > + awk ' > + { > + printf "# %s\n", $0 > + > + # size of cylinder in sectors > + cs = $3 * $4 > + > + # number of full cylinders on media > + cyl = int ($1 / cs) > + > + # output fdisk geometry spec, truncate cyls to 1023 > + if (cyl <= 1023) > + print "g c" cyl " h" $4 " s" $3 > + else > + print "g c" 1023 " h" $4 " s" $3 > + > + if ($7 > 0) { > + # size of data partition in full cylinders > + dsl = int (($7 + cs - 1) / cs) > + } else { > + dsl = 0; > + } > + > + # size of config partition in full cylinders > + csl = int (($6 + cs - 1) / cs) > + > + if ($5 == 0) { > + # size of image partition(s) in full cylinders > + isl = int ((cyl - dsl - csl) / $2) > + } else { > + isl = int (($5 + cs - 1) / cs) > + } > + > + # First image partition start at second track > + print "p 1 165 " $3, isl * cs - $3 > + c = isl * cs; > + > + # Second image partition (if any) also starts offset one > + # track to keep them identical. > + if ($2 > 1) { > + print "p 2 165 " $3 + c, isl * cs - $3 > + c += isl * cs; > + } > + > + # Config partition starts at cylinder boundary. > + print "p 3 165 " c, csl * cs > + c += csl * cs > + > + # Data partition (if any) starts at cylinder boundary. > + if ($7 > 0) { > + print "p 4 165 " c, dsl * cs > + } else if ($7 < 0 && $1 > c) { > + print "p 4 165 " c, $1 - c > + } else if ($1 < c) { > + print "Disk space overcommitted by", \ > + c - $1, "sectors" > "/dev/stderr" > + exit 2 > + } > + > + # Force slice 1 to be marked active. This is necessary > + # for booting the image from a USB device to work. > + print "a 1" > + } > + ' > ${NANO_OBJ}/_.fdisk > + > + IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} > + MNT=${NANO_OBJ}/_.mnt > + mkdir -p ${MNT} > + > + if [ "${NANO_MD_BACKING}" = "swap" ] ; then > + MD=`mdconfig -a -t swap -s ${NANO_MEDIASIZE} -x ${NANO_SECTS} \ > + -y ${NANO_HEADS}` > + else > + echo "Creating md backing file..." > + nano_rm -f ${IMG} > + dd if=/dev/zero of=${IMG} seek=${NANO_MEDIASIZE} count=0 > + MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ > + -y ${NANO_HEADS}` > + fi > + > + trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT > + > + fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} > + fdisk ${MD} > + # XXX: params > + # XXX: pick up cached boot* files, they may not be in image anymore. > + if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then > + boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} > + fi > + if [ -f ${NANO_WORLDDIR}/boot/boot ]; then > + bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}s1 > + else > + bsdlabel -w ${MD}s1 > + fi > + bsdlabel ${MD}s1 > + > + # Create first image > + populate_slice /dev/${MD}s1a ${NANO_WORLDDIR} ${MNT} "s1a" > + mount /dev/${MD}s1a ${MNT} > + echo "Generating mtree..." > + ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree > + ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du > + nano_umount ${MNT} > + > + if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then > + # Duplicate to second image (if present) > + echo "Duplicating to second image..." > + dd conv=sparse if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k > + mount /dev/${MD}s2a ${MNT} > + for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab > + do > + sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f > + done > + nano_umount ${MNT} > + # Override the label from the first partition so we > + # don't confuse glabel with duplicates. > + if [ ! -z ${NANO_LABEL} ]; then > + tunefs -L ${NANO_LABEL}"s2a" /dev/${MD}s2a > + fi > + fi > + > + # Create Config slice > + populate_cfg_slice /dev/${MD}s3 "${NANO_CFGDIR}" ${MNT} "s3" > + > + # Create Data slice, if any. > + if [ $NANO_DATASIZE -ne 0 ] ; then > + populate_data_slice /dev/${MD}s4 "${NANO_DATADIR}" ${MNT} "s4" > + fi > + > + if [ "${NANO_MD_BACKING}" = "swap" ] ; then > + if [ ${NANO_IMAGE_MBRONLY} ]; then > + echo "Writing out _.disk.mbr..." > + dd if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.mbr bs=512 count=1 > + else > + echo "Writing out ${NANO_IMGNAME}..." > + dd if=/dev/${MD} of=${IMG} bs=64k > + fi > + > + echo "Writing out ${NANO_IMGNAME}..." > + dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k > + fi > + > + if ${do_copyout_partition} ; then > + echo "Writing out _.disk.image..." > + dd conv=sparse if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k > + fi > + mdconfig -d -u $MD > + > + trap - 1 2 15 > + trap nano_cleanup EXIT > + > + ) > ${NANO_OBJ}/_.di 2>&1 > +) > + > +last_orders () ( > + # Redefine this function with any last orders you may have > + # after the build completed, for instance to copy the finished > + # image to a more convenient place: > + # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk > + true > +) > + > +####################################################################### > +# > +# Optional convenience functions. > +# > +####################################################################### > + > +####################################################################### > +# Common Flash device geometries > +# > + > +FlashDevice () { > + if [ -d ${NANO_TOOLS} ] ; then > + . ${NANO_TOOLS}/FlashDevice.sub > + else > + . ${NANO_SRC}/${NANO_TOOLS}/FlashDevice.sub > + fi > + sub_FlashDevice $1 $2 > +} > + > +####################################################################### > +# USB device geometries > +# > +# Usage: > +# UsbDevice Generic 1000 # a generic flash key sold as having 1GB > +# > +# This function will set NANO_MEDIASIZE, NANO_HEADS and NANO_SECTS for you. > +# > +# Note that the capacity of a flash key is usually advertised in MB or > +# GB, *not* MiB/GiB. As such, the precise number of cylinders available > +# for C/H/S geometry may vary depending on the actual flash geometry. > +# > +# The following generic device layouts are understood: > +# generic An alias for generic-hdd. > +# generic-hdd 255H 63S/T xxxxC with no MBR restrictions. > +# generic-fdd 64H 32S/T xxxxC with no MBR restrictions. > +# > +# The generic-hdd device is preferred for flash devices larger than 1GB. > +# > + > +UsbDevice () { > + a1=`echo $1 | tr '[:upper:]' '[:lower:]'` > + case $a1 in > + generic-fdd) > + NANO_HEADS=64 > + NANO_SECTS=32 > + NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 )) > + ;; > + generic|generic-hdd) > + NANO_HEADS=255 > + NANO_SECTS=63 > + NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 )) > + ;; > + *) > + echo "Unknown USB flash device" > + exit 2 > + ;; > + esac > +} > + > +####################################################################### > +# Setup serial console > + > +cust_comconsole () ( > + # Enable getty on console > + sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys > + > + # Disable getty on syscons devices > + sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${NANO_WORLDDIR}/etc/ttys > + > + # Tell loader to use serial console early. > + echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config > +) > + > +####################################################################### > +# Allow root login via ssh > + > +cust_allow_ssh_root () ( > + sed -i "" -e '/PermitRootLogin/s/.*/PermitRootLogin yes/' \ > + ${NANO_WORLDDIR}/etc/ssh/sshd_config > +) > + > +####################################################################### > +# Install the stuff under ./Files > + > +cust_install_files () ( > + cd ${NANO_TOOLS}/Files > + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR} > +) > + > +####################################################################### > +# Install packages from ${NANO_PACKAGE_DIR} > + > +cust_pkg () ( > + > + # If the package directory doesn't exist, we're done. > + if [ ! -d ${NANO_PACKAGE_DIR} ]; then > + echo "DONE 0 packages" > + return 0 > + fi > + > + # Copy packages into chroot > + mkdir -p ${NANO_WORLDDIR}/Pkg ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg > + ( > + cd ${NANO_PACKAGE_DIR} > + find ${NANO_PACKAGE_LIST} -print | > + cpio -Ldumpv ${NANO_WORLDDIR}/Pkg > + ) > + > + # Count & report how many we have to install > + todo=`ls ${NANO_WORLDDIR}/Pkg | wc -l` > + echo "=== TODO: $todo" > + ls ${NANO_WORLDDIR}/Pkg > + echo "===" > + while true > + do > + # Record how many we have now > + have=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` > + > + # Attempt to install more packages > + # ...but no more than 200 at a time due to pkg_add's internal > + # limitations. > + CR0 'ls Pkg/*tbz | xargs -n 200 env PKG_DBDIR='${NANO_PKG_META_BASE}'/pkg pkg_add -v -F' > + > + # See what that got us > + now=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` > + echo "=== NOW $now" > + ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg > + echo "===" > + > + > + if [ $now -eq $todo ] ; then > + echo "DONE $now packages" > + break > + elif [ $now -eq $have ] ; then > + echo "FAILED: Nothing happened on this pass" > + exit 2 > + fi > + done > + nano_rm -rf ${NANO_WORLDDIR}/Pkg > +) > + > +cust_pkgng () ( > + > + # If the package directory doesn't exist, we're done. > + if [ ! -d ${NANO_PACKAGE_DIR} ]; then > + echo "DONE 0 packages" > + return 0 > + fi > + > + # Find a pkg-* package > + for x in `find -s ${NANO_PACKAGE_DIR} -iname 'pkg-*'`; do > + _NANO_PKG_PACKAGE=`basename "$x"` > + done > + if [ -z "${_NANO_PKG_PACKAGE}" -o ! -f "${NANO_PACKAGE_DIR}/${_NANO_PKG_PACKAGE}" ]; then > + echo "FAILED: need a pkg/ package for bootstrapping" > + exit 2 > + fi > + > + # Copy packages into chroot > + mkdir -p ${NANO_WORLDDIR}/Pkg > + ( > + cd ${NANO_PACKAGE_DIR} > + find ${NANO_PACKAGE_LIST} -print | > + cpio -Ldumpv ${NANO_WORLDDIR}/Pkg > + ) > + > + #Bootstrap pkg > + CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /Pkg/${_NANO_PKG_PACKAGE} > + CR pkg -N >/dev/null 2>&1 > + if [ "$?" -ne "0" ]; then > + echo "FAILED: pkg bootstrapping faied" > + exit 2 > + fi > + nano_rm -f ${NANO_WORLDDIR}/Pkg/pkg-* > + > + # Count & report how many we have to install > + todo=`ls ${NANO_WORLDDIR}/Pkg | /usr/bin/wc -l` > + todo=$(expr $todo + 1) # add one for pkg since it is installed already > + echo "=== TODO: $todo" > + ls ${NANO_WORLDDIR}/Pkg > + echo "===" > + while true > + do > + # Record how many we have now > + have=$(CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l) > + > + # Attempt to install more packages > + CR0 'ls 'Pkg/*txz' | xargs env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg add' > + > + # See what that got us > + now=$(CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l) > + echo "=== NOW $now" > + CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info > + echo "===" > + if [ $now -eq $todo ] ; then > + echo "DONE $now packages" > + break > + elif [ $now -eq $have ] ; then > + echo "FAILED: Nothing happened on this pass" > + exit 2 > + fi > + done > + nano_rm -rf ${NANO_WORLDDIR}/Pkg > +) > + > +####################################################################### > +# Convenience function: > +# Register all args as customize function. > + > +customize_cmd () { > + NANO_CUSTOMIZE="$NANO_CUSTOMIZE $*" > +} > + > +####################################################################### > +# Convenience function: > +# Register all args as late customize function to run just before > +# image creation. > + > +late_customize_cmd () { > + NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $*" > +} > + > +####################################################################### > +# > +# All set up to go... > +# > +####################################################################### > + > +# Progress Print > +# Print $2 at level $1. > +pprint() ( > + if [ "$1" -le $PPLEVEL ]; then > + runtime=$(( `date +%s` - $NANO_STARTTIME )) > + printf "%s %.${1}s %s\n" "`date -u -r $runtime +%H:%M:%S`" "#####" "$2" 1>&3 > + fi > +) > + > +usage () { > + ( > + echo "Usage: $0 [-bfiKknqvw] [-c config_file]" > + echo " -b suppress builds (both kernel and world)" > + echo " -c specify config file" > + echo " -f suppress code slice extraction" > + echo " -i suppress disk image build" > + echo " -K suppress installkernel" > + echo " -k suppress buildkernel" > + echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" > + echo " -q make output more quiet" > + echo " -v make output more verbose" > + echo " -w suppress buildworld" > + ) 1>&2 > + exit 2 > +} > + > +####################################################################### > +# Setup and Export Internal variables > +# > + > +export_var() { > + var=$1 > + # Lookup value of the variable. > + eval val=\$$var > + pprint 3 "Setting variable: $var=\"$val\"" > + export $1 > +} > + > +# Call this function to set defaults _after_ parsing options. > +set_defaults_and_export() { > + test -n "${NANO_OBJ}" || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME} > + test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=${NANO_OBJ} > + test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=${NANO_OBJ} > + NANO_WORLDDIR=${NANO_OBJ}/_.w > + NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build > + NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install > + > + # Override user's NANO_DRIVE if they specified a NANO_LABEL > + [ ! -z "${NANO_LABEL}" ] && NANO_DRIVE="ufs/${NANO_LABEL}" > + > + # Set a default NANO_TOOLS to NANO_SRC/NANO_TOOLS if it exists. > + [ ! -d "${NANO_TOOLS}" ] && [ -d "${NANO_SRC}/${NANO_TOOLS}" ] && \ > + NANO_TOOLS="${NANO_SRC}/${NANO_TOOLS}" > + > + NANO_STARTTIME=`date +%s` > + pprint 3 "Exporting NanoBSD variables" > + export_var MAKEOBJDIRPREFIX > + export_var NANO_ARCH > + export_var NANO_CODESIZE > + export_var NANO_CONFSIZE > + export_var NANO_CUSTOMIZE > + export_var NANO_DATASIZE > + export_var NANO_DRIVE > + export_var NANO_HEADS > + export_var NANO_IMAGES > + export_var NANO_IMGNAME > + export_var NANO_MAKE > + export_var NANO_MAKE_CONF_BUILD > + export_var NANO_MAKE_CONF_INSTALL > + export_var NANO_MEDIASIZE > + export_var NANO_NAME > + export_var NANO_NEWFS > + export_var NANO_OBJ > + export_var NANO_PMAKE > + export_var NANO_SECTS > + export_var NANO_SRC > + export_var NANO_TOOLS > + export_var NANO_WORLDDIR > + export_var NANO_BOOT0CFG > + export_var NANO_BOOTLOADER > + export_var NANO_LABEL > + export_var NANO_MODULES > +} > > Modified: head/tools/tools/nanobsd/nanobsd.sh > ============================================================================== > --- head/tools/tools/nanobsd/nanobsd.sh Tue Dec 16 16:23:54 2014 (r275831) > +++ head/tools/tools/nanobsd/nanobsd.sh Tue Dec 16 17:59:05 2014 (r275832) > @@ -29,900 +29,9 @@ > > set -e > > -####################################################################### > -# > -# Setup default values for all controlling variables. > -# These values can be overridden from the config file(s) > -# > -####################################################################### > - > -# Name of this NanoBSD build. (Used to construct workdir names) > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 18:28:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 477D6A05; Tue, 16 Dec 2014 18:28:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 338078DC; Tue, 16 Dec 2014 18:28:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGISYxV030661; Tue, 16 Dec 2014 18:28:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGISYtL030660; Tue, 16 Dec 2014 18:28:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412161828.sBGISYtL030660@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Dec 2014 18:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275833 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 18:28:34 -0000 Author: kib Date: Tue Dec 16 18:28:33 2014 New Revision: 275833 URL: https://svnweb.freebsd.org/changeset/base/275833 Log: The iret instruction may generate #np and #ss fault, besides #gp. When returning to usermode, the handler for that exceptions is also executed with wrong gs base. Handle all three possible faults in the same way, checking for iret fault, and performing full iret. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Tue Dec 16 17:59:05 2014 (r275832) +++ head/sys/amd64/amd64/exception.S Tue Dec 16 18:28:33 2014 (r275833) @@ -153,9 +153,13 @@ IDTVEC(xmm) IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) - TRAP_ERR(T_SEGNPFLT) + subq $TF_ERR,%rsp + movl $T_SEGNPFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(stk) - TRAP_ERR(T_STKFLT) + subq $TF_ERR,%rsp + movl $T_STKFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(align) TRAP_ERR(T_ALIGNFLT) @@ -318,6 +322,7 @@ IDTVEC(page) IDTVEC(prot) subq $TF_ERR,%rsp movl $T_PROTFLT,TF_TRAPNO(%rsp) +prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ leaq doreti_iret(%rip),%rdi From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 18:45:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE15A10C; Tue, 16 Dec 2014 18:45:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7F41BADC; Tue, 16 Dec 2014 18:45:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGIjWnF039999; Tue, 16 Dec 2014 18:45:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGIjWX6039998; Tue, 16 Dec 2014 18:45:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412161845.sBGIjWX6039998@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Dec 2014 18:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275834 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 18:45:32 -0000 Author: pfg Date: Tue Dec 16 18:45:31 2014 New Revision: 275834 URL: https://svnweb.freebsd.org/changeset/base/275834 Log: MFC r275645; ext2fs: Fix old out-of-bounds access. Overrunning buffer pointed to by (caddr_t)&oip->i_db[0] of 48 bytes by passing it to a function which accesses it at byte offset 59 using argument 60UL. The issue was inherited from an older FFS implementation and fixed there with by merging UFS2 in r98542. We follow the FFS fix. CID: 1007665 Discussed with: bde Modified: stable/10/sys/fs/ext2fs/ext2_inode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_inode.c Tue Dec 16 18:28:33 2014 (r275833) +++ stable/10/sys/fs/ext2fs/ext2_inode.c Tue Dec 16 18:45:31 2014 (r275834) @@ -224,14 +224,18 @@ ext2_truncate(struct vnode *vp, off_t le * will be returned to the free list. lastiblock values are also * normalized to -1 for calls to ext2_indirtrunc below. */ - bcopy((caddr_t)&oip->i_db[0], (caddr_t)oldblks, sizeof(oldblks)); - for (level = TRIPLE; level >= SINGLE; level--) + for (level = TRIPLE; level >= SINGLE; level--) { + oldblks[NDADDR + level] = oip->i_ib[level]; if (lastiblock[level] < 0) { oip->i_ib[level] = 0; lastiblock[level] = -1; } - for (i = NDADDR - 1; i > lastblock; i--) - oip->i_db[i] = 0; + } + for (i = 0; i < NDADDR; i++) { + oldblks[i] = oip->i_db[i]; + if (i > lastblock) + oip->i_db[i] = 0; + } oip->i_flag |= IN_CHANGE | IN_UPDATE; allerror = ext2_update(ovp, !DOINGASYNC(ovp)); @@ -241,8 +245,14 @@ ext2_truncate(struct vnode *vp, off_t le * Note that we save the new block configuration so we can check it * when we are done. */ - bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof(newblks)); - bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof(oldblks)); + for (i = 0; i < NDADDR; i++) { + newblks[i] = oip->i_db[i]; + oip->i_db[i] = oldblks[i]; + } + for (i = 0; i < NIADDR; i++) { + newblks[NDADDR + i] = oip->i_ib[i]; + oip->i_ib[i] = oldblks[NDADDR + i]; + } oip->i_size = osize; error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize); if (error && (allerror == 0)) From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 19:45:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C8E54DC; Tue, 16 Dec 2014 19:45:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4CEE81CD; Tue, 16 Dec 2014 19:45:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGJjvTd069479; Tue, 16 Dec 2014 19:45:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGJjv7n069478; Tue, 16 Dec 2014 19:45:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412161945.sBGJjv7n069478@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 19:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275836 - in stable: 10/sys/dev/e1000 9/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 19:45:57 -0000 Author: jhb Date: Tue Dec 16 19:45:56 2014 New Revision: 275836 URL: https://svnweb.freebsd.org/changeset/base/275836 Log: MFC 272897: Various fixes to stats: - Read the counts of received, dropped, and transmitted management packets and add sysctl nodes for them. - Fix the total octets received/transmitted to read all 64 bits of the counters. - Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot. - Remove spurious spaces. Modified: stable/10/sys/dev/e1000/if_igb.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/e1000/if_igb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Tue Dec 16 18:57:42 2014 (r275835) +++ stable/10/sys/dev/e1000/if_igb.c Tue Dec 16 19:45:56 2014 (r275836) @@ -5422,8 +5422,14 @@ igb_update_stats_counters(struct adapter stats->roc += E1000_READ_REG(hw, E1000_ROC); stats->rjc += E1000_READ_REG(hw, E1000_RJC); - stats->tor += E1000_READ_REG(hw, E1000_TORH); - stats->tot += E1000_READ_REG(hw, E1000_TOTH); + stats->mgprc += E1000_READ_REG(hw, E1000_MGTPRC); + stats->mgpdc += E1000_READ_REG(hw, E1000_MGTPDC); + stats->mgptc += E1000_READ_REG(hw, E1000_MGTPTC); + + stats->tor += E1000_READ_REG(hw, E1000_TORL) + + ((u64)E1000_READ_REG(hw, E1000_TORH) << 32); + stats->tot += E1000_READ_REG(hw, E1000_TOTL) + + ((u64)E1000_READ_REG(hw, E1000_TOTH) << 32); stats->tpr += E1000_READ_REG(hw, E1000_TPR); stats->tpt += E1000_READ_REG(hw, E1000_TPT); @@ -5750,6 +5756,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "missed_packets", CTLFLAG_RD, &stats->mpc, "Missed Packets"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_length_errors", + CTLFLAG_RD, &stats->rlec, + "Receive Length Errors"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", CTLFLAG_RD, &stats->rnbc, "Receive No Buffers"); @@ -5758,7 +5767,7 @@ igb_add_hw_stats(struct adapter *adapter "Receive Undersize"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_fragmented", CTLFLAG_RD, &stats->rfc, - "Fragmented Packets Received "); + "Fragmented Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_oversize", CTLFLAG_RD, &stats->roc, "Oversized Packets Received"); @@ -5774,6 +5783,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "alignment_errs", CTLFLAG_RD, &stats->algnerrc, "Alignment Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_no_crs", + CTLFLAG_RD, &stats->tncrs, + "Transmit with No CRS"); /* On 82575 these are collision counts */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", CTLFLAG_RD, &stats->cexterr, @@ -5790,10 +5802,22 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", CTLFLAG_RD, &stats->xofftxc, "XOFF Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "unsupported_fc_recvd", + CTLFLAG_RD, &stats->fcruc, + "Unsupported Flow Control Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_recvd", + CTLFLAG_RD, &stats->mgprc, + "Management Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_drop", + CTLFLAG_RD, &stats->mgpdc, + "Management Packets Dropped"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_txd", + CTLFLAG_RD, &stats->mgptc, + "Management Packets Transmitted"); /* Packet Reception Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", CTLFLAG_RD, &stats->tpr, - "Total Packets Received "); + "Total Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", CTLFLAG_RD, &stats->gprc, "Good Packets Received"); @@ -5805,7 +5829,7 @@ igb_add_hw_stats(struct adapter *adapter "Multicast Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_64", CTLFLAG_RD, &stats->prc64, - "64 byte frames received "); + "64 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_65_127", CTLFLAG_RD, &stats->prc127, "65-127 byte frames received"); @@ -5823,12 +5847,18 @@ igb_add_hw_stats(struct adapter *adapter "1023-1522 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", CTLFLAG_RD, &stats->gorc, - "Good Octets Received"); + "Good Octets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_recvd", + CTLFLAG_RD, &stats->tor, + "Total Octets Received"); /* Packet Transmission Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", CTLFLAG_RD, &stats->gotc, "Good Octets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_txd", + CTLFLAG_RD, &stats->tot, + "Total Octets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", CTLFLAG_RD, &stats->tpt, "Total Packets Transmitted"); @@ -5843,7 +5873,7 @@ igb_add_hw_stats(struct adapter *adapter "Multicast Packets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_64", CTLFLAG_RD, &stats->ptc64, - "64 byte frames transmitted "); + "64 byte frames transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_65_127", CTLFLAG_RD, &stats->ptc127, "65-127 byte frames transmitted"); From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 19:45:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E158F4DF; Tue, 16 Dec 2014 19:45:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C280A1CF; Tue, 16 Dec 2014 19:45:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGJjvPL069487; Tue, 16 Dec 2014 19:45:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGJjvTU069486; Tue, 16 Dec 2014 19:45:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412161945.sBGJjvTU069486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 19:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275836 - in stable: 10/sys/dev/e1000 9/sys/dev/e1000 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 19:45:58 -0000 Author: jhb Date: Tue Dec 16 19:45:56 2014 New Revision: 275836 URL: https://svnweb.freebsd.org/changeset/base/275836 Log: MFC 272897: Various fixes to stats: - Read the counts of received, dropped, and transmitted management packets and add sysctl nodes for them. - Fix the total octets received/transmitted to read all 64 bits of the counters. - Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot. - Remove spurious spaces. Modified: stable/9/sys/dev/e1000/if_igb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/e1000/if_igb.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Tue Dec 16 18:57:42 2014 (r275835) +++ stable/9/sys/dev/e1000/if_igb.c Tue Dec 16 19:45:56 2014 (r275836) @@ -5410,8 +5410,14 @@ igb_update_stats_counters(struct adapter stats->roc += E1000_READ_REG(hw, E1000_ROC); stats->rjc += E1000_READ_REG(hw, E1000_RJC); - stats->tor += E1000_READ_REG(hw, E1000_TORH); - stats->tot += E1000_READ_REG(hw, E1000_TOTH); + stats->mgprc += E1000_READ_REG(hw, E1000_MGTPRC); + stats->mgpdc += E1000_READ_REG(hw, E1000_MGTPDC); + stats->mgptc += E1000_READ_REG(hw, E1000_MGTPTC); + + stats->tor += E1000_READ_REG(hw, E1000_TORL) + + ((u64)E1000_READ_REG(hw, E1000_TORH) << 32); + stats->tot += E1000_READ_REG(hw, E1000_TOTL) + + ((u64)E1000_READ_REG(hw, E1000_TOTH) << 32); stats->tpr += E1000_READ_REG(hw, E1000_TPR); stats->tpt += E1000_READ_REG(hw, E1000_TPT); @@ -5738,6 +5744,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "missed_packets", CTLFLAG_RD, &stats->mpc, "Missed Packets"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_length_errors", + CTLFLAG_RD, &stats->rlec, + "Receive Length Errors"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", CTLFLAG_RD, &stats->rnbc, "Receive No Buffers"); @@ -5746,7 +5755,7 @@ igb_add_hw_stats(struct adapter *adapter "Receive Undersize"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_fragmented", CTLFLAG_RD, &stats->rfc, - "Fragmented Packets Received "); + "Fragmented Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_oversize", CTLFLAG_RD, &stats->roc, "Oversized Packets Received"); @@ -5762,6 +5771,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "alignment_errs", CTLFLAG_RD, &stats->algnerrc, "Alignment Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_no_crs", + CTLFLAG_RD, &stats->tncrs, + "Transmit with No CRS"); /* On 82575 these are collision counts */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", CTLFLAG_RD, &stats->cexterr, @@ -5778,10 +5790,22 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", CTLFLAG_RD, &stats->xofftxc, "XOFF Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "unsupported_fc_recvd", + CTLFLAG_RD, &stats->fcruc, + "Unsupported Flow Control Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_recvd", + CTLFLAG_RD, &stats->mgprc, + "Management Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_drop", + CTLFLAG_RD, &stats->mgpdc, + "Management Packets Dropped"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_txd", + CTLFLAG_RD, &stats->mgptc, + "Management Packets Transmitted"); /* Packet Reception Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", CTLFLAG_RD, &stats->tpr, - "Total Packets Received "); + "Total Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", CTLFLAG_RD, &stats->gprc, "Good Packets Received"); @@ -5793,7 +5817,7 @@ igb_add_hw_stats(struct adapter *adapter "Multicast Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_64", CTLFLAG_RD, &stats->prc64, - "64 byte frames received "); + "64 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_65_127", CTLFLAG_RD, &stats->prc127, "65-127 byte frames received"); @@ -5811,12 +5835,18 @@ igb_add_hw_stats(struct adapter *adapter "1023-1522 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", CTLFLAG_RD, &stats->gorc, - "Good Octets Received"); + "Good Octets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_recvd", + CTLFLAG_RD, &stats->tor, + "Total Octets Received"); /* Packet Transmission Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", CTLFLAG_RD, &stats->gotc, "Good Octets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_txd", + CTLFLAG_RD, &stats->tot, + "Total Octets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", CTLFLAG_RD, &stats->tpt, "Total Packets Transmitted"); @@ -5831,7 +5861,7 @@ igb_add_hw_stats(struct adapter *adapter "Multicast Packets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_64", CTLFLAG_RD, &stats->ptc64, - "64 byte frames transmitted "); + "64 byte frames transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_65_127", CTLFLAG_RD, &stats->ptc127, "65-127 byte frames transmitted"); From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 20:05:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20BF2D62; Tue, 16 Dec 2014 20:05:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E6B9F698; Tue, 16 Dec 2014 20:05:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGK5BsS079494; Tue, 16 Dec 2014 20:05:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGK5BFC079493; Tue, 16 Dec 2014 20:05:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412162005.sBGK5BFC079493@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 20:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275837 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 20:05:12 -0000 Author: jhb Date: Tue Dec 16 20:05:10 2014 New Revision: 275837 URL: https://svnweb.freebsd.org/changeset/base/275837 Log: MFC 271635,271722: - Only the manpage updates from 271635 are merged to give additional heads up for the stricter checks in 11, but the kernel in 10 remains permissive. - Fail with EINVAL if an invalid protection mask is passed to mmap(). - Fail with EINVAL if an unknown flag is passed to mmap(). - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap(). - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. - Remove mention of MAP_INHERIT. It hasn't been implemented for thirteen years. - Remove mention of unimplemented MAP_SWAP. There are no future plans to implement it. Modified: stable/10/lib/libc/sys/mmap.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/mmap.2 ============================================================================== --- stable/10/lib/libc/sys/mmap.2 Tue Dec 16 19:45:56 2014 (r275836) +++ stable/10/lib/libc/sys/mmap.2 Tue Dec 16 20:05:10 2014 (r275837) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd June 19, 2014 +.Dd September 17, 2014 .Dt MMAP 2 .Os .Sh NAME @@ -176,11 +176,6 @@ already exists within the range. .It Dv MAP_HASSEMAPHORE Notify the kernel that the region may contain semaphores and that special handling may be necessary. -.It Dv MAP_INHERIT -This flag never operated as advertised and is no longer supported. -Please refer to -.Xr minherit 2 -for further information. .It Dv MAP_NOCORE Region is not included in a core file. .It Dv MAP_NOSYNC @@ -300,14 +295,6 @@ The system call does not unmap pages, see .Xr munmap 2 for further information. -.Pp -The current design does not allow a process to specify the location of -swap space. -In the future we may define an additional mapping type, -.Dv MAP_SWAP , -in which -the file descriptor argument specifies a file or device to which swapping -should be done. .Sh NOTES Although this implementation does not impose any alignment restrictions on the @@ -372,6 +359,29 @@ The argument is not a valid open file descriptor. .It Bq Er EINVAL +An invalid value was passed in the +.Fa prot +argument. +.It Bq Er EINVAL +An undefined option was set in the +.Fa flags +argument. +.It Bq Er EINVAL +Both +.Dv MAP_PRIVATE +and +.Dv MAP_SHARED +were specified. +.It Bq Er EINVAL +None of +.Dv MAP_ANON , +.Dv MAP_PRIVATE , +.Dv MAP_SHARED , +or +.Dv MAP_STACK +was specified. +At least one of these flags must be included. +.It Bq Er EINVAL .Dv MAP_FIXED was specified and the .Fa addr From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 20:26:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86561547; Tue, 16 Dec 2014 20:26:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 728E2968; Tue, 16 Dec 2014 20:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGKQCrn089592; Tue, 16 Dec 2014 20:26:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGKQCr6089591; Tue, 16 Dec 2014 20:26:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412162026.sBGKQCr6089591@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Dec 2014 20:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275838 - head/usr.bin/sed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 20:26:12 -0000 Author: pfg Date: Tue Dec 16 20:26:11 2014 New Revision: 275838 URL: https://svnweb.freebsd.org/changeset/base/275838 Log: sed: Bounds check the file path used in the 'w' command. Modified version of a diff from Sebastien Marie to prevent a crash found with the afl fuzzer. Obtained from: OpenBSD (CVS Rev. 1.37) MFC after: 1 week Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Tue Dec 16 20:05:10 2014 (r275837) +++ head/usr.bin/sed/compile.c Tue Dec 16 20:26:11 2014 (r275838) @@ -558,7 +558,7 @@ compile_flags(char *p, struct s_subst *s { int gn; /* True if we have seen g or n */ unsigned long nval; - char wfile[_POSIX2_LINE_MAX + 1], *q; + char wfile[_POSIX2_LINE_MAX + 1], *q, *eq; s->n = 1; /* Default */ s->p = 0; @@ -611,9 +611,12 @@ compile_flags(char *p, struct s_subst *s #endif EATSPACE(); q = wfile; + eq = wfile + sizeof(wfile) - 1; while (*p) { if (*p == '\n') break; + if (q >= eq) + err(1, "wfile too long"); *q++ = *p++; } *q = '\0'; From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 20:45:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD2FED06; Tue, 16 Dec 2014 20:45:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A9858DBD; Tue, 16 Dec 2014 20:45:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGKjI2k099148; Tue, 16 Dec 2014 20:45:18 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGKjIwl099146; Tue, 16 Dec 2014 20:45:18 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412162045.sBGKjIwl099146@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 16 Dec 2014 20:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275839 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 20:45:18 -0000 Author: brooks Date: Tue Dec 16 20:45:17 2014 New Revision: 275839 URL: https://svnweb.freebsd.org/changeset/base/275839 Log: Add an UPDATING entry and warning about the change in r274807 to help users transition to the new behavior. Discussed with: jmallett Sponsored by: DARPA, AFRL Modified: head/Makefile.inc1 head/UPDATING Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Dec 16 20:26:11 2014 (r275838) +++ head/Makefile.inc1 Tue Dec 16 20:45:17 2014 (r275839) @@ -113,6 +113,8 @@ _REDUNDENT_LIB_DIRS+= ${LOCAL_LIB_DIR .for _DIR in ${LOCAL_LIB_DIRS} .if empty(_REDUNDENT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile) SUBDIR+= ${_DIR} +.else +.warning ${_DIR} not added to SUBDIR list. See UPDATING 20141121. .endif .endfor .endif Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Dec 16 20:26:11 2014 (r275838) +++ head/UPDATING Tue Dec 16 20:45:17 2014 (r275839) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20141121: + The handling of LOCAL_LIB_DIRS has been altered to skip addition of + directories to top level SUBDIR variable when their parent + directory is included in LOCAL_DIRS. Users with build systems with + such hierarchies and without SUBDIR entries in the parent + directory Makefiles should add them or add the directories to + LOCAL_DIRS. + 20141109: faith(4) and faithd(8) has been removed from base system. It has been obsolete for a very long time. From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 21:05:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C1D0218; Tue, 16 Dec 2014 21:05:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 579EBEB; Tue, 16 Dec 2014 21:05:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGL5UOY009087; Tue, 16 Dec 2014 21:05:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGL5TEE009084; Tue, 16 Dec 2014 21:05:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412162105.sBGL5TEE009084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Dec 2014 21:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275840 - stable/10/usr.bin/patch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 21:05:30 -0000 Author: pfg Date: Tue Dec 16 21:05:28 2014 New Revision: 275840 URL: https://svnweb.freebsd.org/changeset/base/275840 Log: MFC r275531, r275581, r275582; patch(1): Small changes to sync with OpenBSD Update OpenBSD CVS revision tag for our r255232. Prefer setvbuf() to setlinebuf(). Small space changes, mostly to keep in sync with OpenBSD Obtained from: OpenBSD Modified: stable/10/usr.bin/patch/patch.c stable/10/usr.bin/patch/pch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/patch.c ============================================================================== --- stable/10/usr.bin/patch/patch.c Tue Dec 16 20:45:17 2014 (r275839) +++ stable/10/usr.bin/patch/patch.c Tue Dec 16 21:05:28 2014 (r275840) @@ -23,7 +23,7 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $ + * $OpenBSD: patch.c,v 1.52 2014/11/26 18:34:51 millert Exp $ * $FreeBSD$ * */ @@ -150,8 +150,8 @@ main(int argc, char *argv[]) const char *tmpdir; char *v; - setlinebuf(stdout); - setlinebuf(stderr); + setvbuf(stdout, NULL, _IOLBF, 0); + setvbuf(stderr, NULL, _IOLBF, 0); for (i = 0; i < MAXFILEC; i++) filearg[i] = NULL; Modified: stable/10/usr.bin/patch/pch.c ============================================================================== --- stable/10/usr.bin/patch/pch.c Tue Dec 16 20:45:17 2014 (r275839) +++ stable/10/usr.bin/patch/pch.c Tue Dec 16 21:05:28 2014 (r275840) @@ -24,7 +24,7 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: pch.c,v 1.39 2012/04/11 08:07:13 ajacoutot Exp $ + * $OpenBSD: pch.c,v 1.43 2014/11/18 17:03:35 tobias Exp $ * $FreeBSD$ */ @@ -318,7 +318,8 @@ intuit_diff_type(void) for (t = s + 7; isspace((unsigned char)*t); t++) ; revision = savestr(t); - for (t = revision; *t && !isspace((unsigned char)*t); t++) + for (t = revision; + *t && !isspace((unsigned char)*t); t++) ; *t = '\0'; if (*revision == '\0') { @@ -583,7 +584,8 @@ another_hunk(void) p_end--; return false; } - for (s = buf; *s && !isdigit((unsigned char)*s); s++) + for (s = buf; + *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); @@ -593,7 +595,8 @@ another_hunk(void) while (isdigit((unsigned char)*s)) s++; if (*s == ',') { - for (; *s && !isdigit((unsigned char)*s); s++) + for (; + *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); @@ -690,8 +693,8 @@ another_hunk(void) change_line: if (buf[1] == '\n' && canonicalize) strlcpy(buf + 1, " \n", buf_size - 1); - if (!isspace((unsigned char)buf[1]) && buf[1] != '>' && - buf[1] != '<' && + if (!isspace((unsigned char)buf[1]) && + buf[1] != '>' && buf[1] != '<' && repl_beginning && repl_could_be_missing) { repl_missing = true; goto hunk_done; @@ -1420,8 +1423,8 @@ do_ed_script(void) for (t = buf; isdigit((unsigned char)*t) || *t == ','; t++) ; /* POSIX defines allowed commands as {a,c,d,i,s} */ - if (isdigit((unsigned char)*buf) && (*t == 'a' || *t == 'c' || - *t == 'd' || *t == 'i' || *t == 's')) { + if (isdigit((unsigned char)*buf) && + (*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i' || *t == 's')) { if (pipefp != NULL) fputs(buf, pipefp); if (*t != 'd') { From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 21:13:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B10D502; Tue, 16 Dec 2014 21:13:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 75BBD1EB; Tue, 16 Dec 2014 21:13:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGLDuN2013743; Tue, 16 Dec 2014 21:13:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGLDuMZ013739; Tue, 16 Dec 2014 21:13:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412162113.sBGLDuMZ013739@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Dec 2014 21:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275841 - stable/10/usr.bin/patch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 21:13:56 -0000 Author: pfg Date: Tue Dec 16 21:13:55 2014 New Revision: 275841 URL: https://svnweb.freebsd.org/changeset/base/275841 Log: MFC r275553, r275612; patch(1): Bring fixes from OpenBSD Check fstat return value. Use off_t for file size and offsets. Avoid iterating over end of string. Introduce strtolinenum to properly check line numbers while parsing: no signs, no spaces, just digits, 0 <= x <= LONG_MAX Properly validate line ranges supplied in diff file to prevent overflows. Also fixes an out of boundary memory access because the resulting values are used as array indices. PR: 195436 Obtained from: OpenBSD Modified: stable/10/usr.bin/patch/common.h stable/10/usr.bin/patch/pch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/common.h ============================================================================== --- stable/10/usr.bin/patch/common.h Tue Dec 16 21:05:28 2014 (r275840) +++ stable/10/usr.bin/patch/common.h Tue Dec 16 21:13:55 2014 (r275841) @@ -40,6 +40,7 @@ #define INITHUNKMAX 125 /* initial dynamic allocation size */ #define INITLINELEN 4096 #define BUFFERSIZE 4096 +#define LINENUM_MAX LONG_MAX #define SCCSPREFIX "s." #define GET "get -e %s" Modified: stable/10/usr.bin/patch/pch.c ============================================================================== --- stable/10/usr.bin/patch/pch.c Tue Dec 16 21:05:28 2014 (r275840) +++ stable/10/usr.bin/patch/pch.c Tue Dec 16 21:13:55 2014 (r275841) @@ -46,7 +46,7 @@ /* Patch (diff listing) abstract type. */ -static long p_filesize; /* size of the patch file */ +static off_t p_filesize; /* size of the patch file */ static LINENUM p_first; /* 1st line number */ static LINENUM p_newfirst; /* 1st line number of replacement */ static LINENUM p_ptrn_lines; /* # lines in pattern */ @@ -60,9 +60,9 @@ static unsigned short *p_len = NULL; /* static char *p_char = NULL; /* +, -, and ! */ static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with */ static int p_indent; /* indent to patch */ -static LINENUM p_base; /* where to intuit this time */ +static off_t p_base; /* where to intuit this time */ static LINENUM p_bline; /* line # of p_base */ -static LINENUM p_start; /* where intuit found a patch */ +static off_t p_start; /* where intuit found a patch */ static LINENUM p_sline; /* and the line number for it */ static LINENUM p_hunk_beg; /* line number of current hunk */ static LINENUM p_efake = -1; /* end of faked up lines--don't free */ @@ -72,12 +72,13 @@ static char *bestguess = NULL; /* guess static void grow_hunkmax(void); static int intuit_diff_type(void); -static void next_intuit_at(LINENUM, LINENUM); -static void skip_to(LINENUM, LINENUM); +static void next_intuit_at(off_t, LINENUM); +static void skip_to(off_t, LINENUM); static size_t pgets(bool _do_indent); static char *best_name(const struct file_name *, bool); static char *posix_name(const struct file_name *, bool); static size_t num_components(const char *); +static LINENUM strtolinenum(char *, char **); /* * Prepare to look for the next patch in the patch file. @@ -119,9 +120,10 @@ open_patch_file(const char *filename) pfp = fopen(filename, "r"); if (pfp == NULL) pfatal("patch file %s not found", filename); - fstat(fileno(pfp), &filestat); + if (fstat(fileno(pfp), &filestat)) + pfatal("can't stat %s", filename); p_filesize = filestat.st_size; - next_intuit_at(0L, 1L); /* start at the beginning */ + next_intuit_at(0, 1L); /* start at the beginning */ set_hunkmax(); } @@ -172,7 +174,7 @@ there_is_another_patch(void) { bool exists = false; - if (p_base != 0L && p_base >= p_filesize) { + if (p_base != 0 && p_base >= p_filesize) { if (verbose) say("done\n"); return false; @@ -181,7 +183,7 @@ there_is_another_patch(void) say("Hmm..."); diff_type = intuit_diff_type(); if (!diff_type) { - if (p_base != 0L) { + if (p_base != 0) { if (verbose) say(" Ignoring the trailing garbage.\ndone\n"); } else @@ -190,7 +192,7 @@ there_is_another_patch(void) } if (verbose) say(" %sooks like %s to me...\n", - (p_base == 0L ? "L" : "The next patch l"), + (p_base == 0 ? "L" : "The next patch l"), diff_type == UNI_DIFF ? "a unified diff" : diff_type == CONTEXT_DIFF ? "a context diff" : diff_type == NEW_CONTEXT_DIFF ? "a new-style context diff" : @@ -252,8 +254,8 @@ p4_fetchname(struct file_name *name, cha static int intuit_diff_type(void) { - long this_line = 0, previous_line; - long first_command_line = -1; + off_t this_line = 0, previous_line; + off_t first_command_line = -1; LINENUM fcl_line = -1; bool last_line_was_command = false, this_is_a_command = false; bool stars_last_line = false, stars_this_line = false; @@ -263,17 +265,17 @@ intuit_diff_type(void) memset(names, 0, sizeof(names)); ok_to_create_file = false; - fseek(pfp, p_base, SEEK_SET); + fseeko(pfp, p_base, SEEK_SET); p_input_line = p_bline - 1; for (;;) { previous_line = this_line; last_line_was_command = this_is_a_command; stars_last_line = stars_this_line; - this_line = ftell(pfp); + this_line = ftello(pfp); indent = 0; p_input_line++; if (pgets(false) == 0) { - if (first_command_line >= 0L) { + if (first_command_line >= 0) { /* nothing but deletes!? */ p_start = first_command_line; p_sline = fcl_line; @@ -296,7 +298,7 @@ intuit_diff_type(void) ; this_is_a_command = (isdigit((unsigned char)*s) && (*t == 'd' || *t == 'c' || *t == 'a')); - if (first_command_line < 0L && this_is_a_command) { + if (first_command_line < 0 && this_is_a_command) { first_command_line = this_line; fcl_line = p_input_line; p_indent = indent; /* assume this for now */ @@ -333,7 +335,7 @@ intuit_diff_type(void) p4_fetchname(&names[OLD_FILE], s + 5); } if ((!diff_type || diff_type == ED_DIFF) && - first_command_line >= 0L && + first_command_line >= 0 && strEQ(s, ".\n")) { p_indent = indent; p_start = first_command_line; @@ -353,13 +355,13 @@ intuit_diff_type(void) stars_this_line = strnEQ(s, "********", 8); if ((!diff_type || diff_type == CONTEXT_DIFF) && stars_last_line && strnEQ(s, "*** ", 4)) { - if (atol(s + 4) == 0) + if (strtolinenum(s + 4, &s) == 0) ok_to_create_file = true; /* * If this is a new context diff the character just - * before the newline is a '*'. + * at the end of the line is a '*'. */ - while (*s != '\n') + while (*s && *s != '\n') s++; p_indent = indent; p_start = previous_line; @@ -423,26 +425,27 @@ scan_exit: * Remember where this patch ends so we know where to start up again. */ static void -next_intuit_at(LINENUM file_pos, LINENUM file_line) +next_intuit_at(off_t file_pos, LINENUM file_line) { p_base = file_pos; p_bline = file_line; } /* - * Basically a verbose fseek() to the actual diff listing. + * Basically a verbose fseeko() to the actual diff listing. */ static void -skip_to(LINENUM file_pos, LINENUM file_line) +skip_to(off_t file_pos, LINENUM file_line) { size_t len; if (p_base > file_pos) - fatal("Internal error: seek %ld>%ld\n", p_base, file_pos); + fatal("Internal error: seek %lld>%lld\n", + (long long)p_base, (long long)file_pos); if (verbose && p_base < file_pos) { - fseek(pfp, p_base, SEEK_SET); + fseeko(pfp, p_base, SEEK_SET); say("The text leading up to this was:\n--------------------------\n"); - while (ftell(pfp) < file_pos) { + while (ftello(pfp) < file_pos) { len = pgets(false); if (len == 0) fatal("Unexpected end of file\n"); @@ -450,7 +453,7 @@ skip_to(LINENUM file_pos, LINENUM file_l } say("--------------------------\n"); } else - fseek(pfp, file_pos, SEEK_SET); + fseeko(pfp, file_pos, SEEK_SET); p_input_line = file_line - 1; } @@ -480,7 +483,7 @@ remove_special_line(void) return true; } if (c != EOF) - fseek(pfp, -1L, SEEK_CUR); + fseeko(pfp, -1, SEEK_CUR); return false; } @@ -491,7 +494,7 @@ remove_special_line(void) bool another_hunk(void) { - long line_beginning; /* file pos of the current line */ + off_t line_beginning; /* file pos of the current line */ LINENUM repl_beginning; /* index of --- line */ LINENUM fillcnt; /* #lines of missing ptrn or repl */ LINENUM fillsrc; /* index of first line to copy */ @@ -499,7 +502,7 @@ another_hunk(void) bool ptrn_spaces_eaten; /* ptrn was slightly misformed */ bool repl_could_be_missing; /* no + or ! lines in this hunk */ bool repl_missing; /* we are now backtracking */ - long repl_backtrack_position; /* file pos of first repl line */ + off_t repl_backtrack_position; /* file pos of first repl line */ LINENUM repl_patch_line; /* input line number for same */ LINENUM ptrn_copiable; /* # of copiable lines in ptrn */ char *s; @@ -517,7 +520,7 @@ another_hunk(void) p_max = hunkmax; /* gets reduced when --- found */ if (diff_type == CONTEXT_DIFF || diff_type == NEW_CONTEXT_DIFF) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); repl_beginning = 0; fillcnt = 0; fillsrc = 0; @@ -538,7 +541,7 @@ another_hunk(void) p_context = 100; p_hunk_beg = p_input_line + 1; while (p_end < p_max) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); len = pgets(true); p_input_line++; if (len == 0) { @@ -591,22 +594,25 @@ another_hunk(void) malformed(); if (strnEQ(s, "0,0", 3)) memmove(s, s + 2, strlen(s + 2) + 1); - p_first = (LINENUM) atol(s); - while (isdigit((unsigned char)*s)) - s++; + p_first = strtolinenum(s, &s); if (*s == ',') { for (; *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); - p_ptrn_lines = ((LINENUM) atol(s)) - p_first + 1; + p_ptrn_lines = strtolinenum(s, &s) - p_first + 1; + if (p_ptrn_lines < 0) + malformed(); } else if (p_first) p_ptrn_lines = 1; else { p_ptrn_lines = 0; p_first = 1; } + if (p_first >= LINENUM_MAX - p_ptrn_lines || + p_ptrn_lines >= LINENUM_MAX - 6) + malformed(); /* we need this much at least */ p_max = p_ptrn_lines + 6; @@ -647,7 +653,7 @@ another_hunk(void) } } repl_beginning = p_end; - repl_backtrack_position = ftell(pfp); + repl_backtrack_position = ftello(pfp); repl_patch_line = p_input_line; p_line[p_end] = savestr(buf); if (out_of_mem) { @@ -659,22 +665,25 @@ another_hunk(void) ; if (!*s) malformed(); - p_newfirst = (LINENUM) atol(s); - while (isdigit((unsigned char)*s)) - s++; + p_newfirst = strtolinenum(s, &s); if (*s == ',') { for (; *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); - p_repl_lines = ((LINENUM) atol(s)) - + p_repl_lines = strtolinenum(s, &s) - p_newfirst + 1; + if (p_repl_lines < 0) + malformed(); } else if (p_newfirst) p_repl_lines = 1; else { p_repl_lines = 0; p_newfirst = 1; } + if (p_newfirst >= LINENUM_MAX - p_repl_lines || + p_repl_lines >= LINENUM_MAX - p_end) + malformed(); p_max = p_repl_lines + p_end; if (p_max > MAXHUNKSIZE) fatal("hunk too large (%ld lines) at line %ld: %s", @@ -779,7 +788,7 @@ hunk_done: p_input_line = repl_patch_line; for (p_end--; p_end > repl_beginning; p_end--) free(p_line[p_end]); - fseek(pfp, repl_backtrack_position, SEEK_SET); + fseeko(pfp, repl_backtrack_position, SEEK_SET); /* redundant 'new' context lines were omitted - set */ /* up to fill them in from the old file context */ @@ -857,7 +866,7 @@ hunk_done: LINENUM fillnew; /* index of new lines */ char ch; - line_beginning = ftell(pfp); /* file pos of the current line */ + line_beginning = ftello(pfp); /* file pos of the current line */ len = pgets(true); p_input_line++; if (len == 0 || strnNE(buf, "@@ -", 4)) { @@ -867,32 +876,28 @@ hunk_done: s = buf + 4; if (!*s) malformed(); - p_first = (LINENUM) atol(s); - while (isdigit((unsigned char)*s)) - s++; + p_first = strtolinenum(s, &s); if (*s == ',') { - p_ptrn_lines = (LINENUM) atol(++s); - while (isdigit((unsigned char)*s)) - s++; + p_ptrn_lines = strtolinenum(s + 1, &s); } else p_ptrn_lines = 1; if (*s == ' ') s++; if (*s != '+' || !*++s) malformed(); - p_newfirst = (LINENUM) atol(s); - while (isdigit((unsigned char)*s)) - s++; + p_newfirst = strtolinenum(s, &s); if (*s == ',') { - p_repl_lines = (LINENUM) atol(++s); - while (isdigit((unsigned char)*s)) - s++; + p_repl_lines = strtolinenum(s + 1, &s); } else p_repl_lines = 1; if (*s == ' ') s++; if (*s != '@') malformed(); + if (p_first >= LINENUM_MAX - p_ptrn_lines || + p_newfirst > LINENUM_MAX - p_repl_lines || + p_ptrn_lines >= LINENUM_MAX - p_repl_lines - 1) + malformed(); if (!p_ptrn_lines) p_first++; /* do append rather than insert */ p_max = p_ptrn_lines + p_repl_lines + 1; @@ -921,7 +926,7 @@ hunk_done: context = 0; p_hunk_beg = p_input_line + 1; while (fillold <= p_ptrn_lines || fillnew <= p_end) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); len = pgets(true); p_input_line++; if (len == 0) { @@ -1024,7 +1029,7 @@ hunk_done: int i; LINENUM min, max; - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); p_context = 0; len = pgets(true); p_input_line++; @@ -1032,35 +1037,36 @@ hunk_done: next_intuit_at(line_beginning, p_input_line); return false; } - p_first = (LINENUM) atol(buf); - for (s = buf; isdigit((unsigned char)*s); s++) - ; + p_first = strtolinenum(buf, &s); if (*s == ',') { - p_ptrn_lines = (LINENUM) atol(++s) - p_first + 1; - while (isdigit((unsigned char)*s)) - s++; + p_ptrn_lines = strtolinenum(s + 1, &s) - p_first + 1; + if (p_ptrn_lines < 0) + malformed(); } else p_ptrn_lines = (*s != 'a'); hunk_type = *s; if (hunk_type == 'a') p_first++; /* do append rather than insert */ - min = (LINENUM) atol(++s); - for (; isdigit((unsigned char)*s); s++) - ; + min = strtolinenum(s + 1, &s); if (*s == ',') - max = (LINENUM) atol(++s); + max = strtolinenum(s + 1, &s); else max = min; + if (min < 0 || min > max || max - min == LINENUM_MAX) + malformed(); if (hunk_type == 'd') min++; - p_end = p_ptrn_lines + 1 + max - min + 1; + p_newfirst = min; + p_repl_lines = max - min + 1; + if (p_newfirst > LINENUM_MAX - p_repl_lines || + p_ptrn_lines >= LINENUM_MAX - p_repl_lines - 1) + malformed(); + p_end = p_ptrn_lines + p_repl_lines + 1; if (p_end > MAXHUNKSIZE) fatal("hunk too large (%ld lines) at line %ld: %s", p_end, p_input_line, buf); while (p_end >= hunkmax) grow_hunkmax(); - p_newfirst = min; - p_repl_lines = max - min + 1; snprintf(buf, buf_size, "*** %ld,%ld\n", p_first, p_first + p_ptrn_lines - 1); p_line[0] = savestr(buf); @@ -1401,7 +1407,7 @@ void do_ed_script(void) { char *t; - long beginning_of_this_line; + off_t beginning_of_this_line; FILE *pipefp = NULL; if (!skip_rest_of_patch) { @@ -1414,7 +1420,7 @@ do_ed_script(void) pipefp = popen(buf, "w"); } for (;;) { - beginning_of_this_line = ftell(pfp); + beginning_of_this_line = ftello(pfp); if (pgets(true) == 0) { next_intuit_at(beginning_of_this_line, p_input_line); break; @@ -1580,3 +1586,36 @@ num_components(const char *path) } return n; } + +/* + * Convert number at NPTR into LINENUM and save address of first + * character that is not a digit in ENDPTR. If conversion is not + * possible, call fatal. + */ +static LINENUM +strtolinenum(char *nptr, char **endptr) +{ + LINENUM rv; + char c; + char *p; + const char *errstr; + + for (p = nptr; isdigit((unsigned char)*p); p++) + ; + + if (p == nptr) + malformed(); + + c = *p; + *p = '\0'; + + rv = strtonum(nptr, 0, LINENUM_MAX, &errstr); + if (errstr != NULL) + fatal("invalid line number at line %ld: `%s' is %s\n", + p_input_line, nptr, errstr); + + *p = c; + *endptr = p; + + return rv; +} From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 21:51:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B6D3C9; Tue, 16 Dec 2014 21:51:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 677C18D0; Tue, 16 Dec 2014 21:51:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGLpMVR030584; Tue, 16 Dec 2014 21:51:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGLpM8B030583; Tue, 16 Dec 2014 21:51:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412162151.sBGLpM8B030583@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 16 Dec 2014 21:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275842 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 21:51:22 -0000 Author: mav Date: Tue Dec 16 21:51:21 2014 New Revision: 275842 URL: https://svnweb.freebsd.org/changeset/base/275842 Log: Do not count RCTD bit set as an error. We can not really implement it, but specification tells that it "shall" work, so it can be safely ignored. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_cmd_table.c Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Tue Dec 16 21:13:55 2014 (r275841) +++ head/sys/cam/ctl/ctl_cmd_table.c Tue Dec 16 21:51:21 2014 (r275842) @@ -513,7 +513,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, - 12, {0x0c, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + 12, {0x0c, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 0D REPORT SUPPORTED_TASK MANAGEMENT FUNCTIONS */ {ctl_report_supported_tmf, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH | From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 21:57:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB58D294; Tue, 16 Dec 2014 21:57:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A59B291C; Tue, 16 Dec 2014 21:57:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGLvvMP033819; Tue, 16 Dec 2014 21:57:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGLvu5n033815; Tue, 16 Dec 2014 21:57:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412162157.sBGLvu5n033815@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 21:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275843 - in stable/10/usr.bin: kdump truss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 21:57:57 -0000 Author: jhb Date: Tue Dec 16 21:57:55 2014 New Revision: 275843 URL: https://svnweb.freebsd.org/changeset/base/275843 Log: MFC 273053: Decode the arguments passed to _umtx_op(). In particular, decode the opcode. Modified: stable/10/usr.bin/kdump/kdump.c stable/10/usr.bin/kdump/mksubr stable/10/usr.bin/truss/syscall.h stable/10/usr.bin/truss/syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/kdump/kdump.c ============================================================================== --- stable/10/usr.bin/kdump/kdump.c Tue Dec 16 21:51:21 2014 (r275842) +++ stable/10/usr.bin/kdump/kdump.c Tue Dec 16 21:57:55 2014 (r275843) @@ -57,6 +57,7 @@ extern int errno; #include #include #include +#include #include #include #include @@ -1187,6 +1188,26 @@ ktrsyscall(struct ktr_syscall *ktr, u_in ip++; narg--; break; + case SYS__umtx_op: + print_number(ip, narg, c); + putchar(','); + umtxopname(*ip); + switch (*ip) { + case UMTX_OP_CV_WAIT: + ip++; + narg--; + putchar(','); + umtxcvwaitflags(*ip); + break; + case UMTX_OP_RW_RDLOCK: + ip++; + narg--; + putchar(','); + umtxrwlockflags(*ip); + break; + } + ip++; + narg--; } } while (narg > 0) { Modified: stable/10/usr.bin/kdump/mksubr ============================================================================== --- stable/10/usr.bin/kdump/mksubr Tue Dec 16 21:51:21 2014 (r275842) +++ stable/10/usr.bin/kdump/mksubr Tue Dec 16 21:57:55 2014 (r275843) @@ -156,6 +156,7 @@ _EOF_ # C start cat <<_EOF_ +#include #include #include #include @@ -185,6 +186,8 @@ cat <<_EOF_ #include #include #include +#include +#include #include #include #include @@ -489,6 +492,7 @@ auto_if_type "sockipprotoname" " auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" auto_or_type "thrcreateflagsname" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h" +auto_switch_type "umtxopname" "UMTX_OP_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/umtx.h" auto_switch_type "vmresultname" "KERN_[A-Z]+[[:space:]]+[0-9]+" "vm/vm_param.h" auto_or_type "wait6optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h" auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" @@ -677,6 +681,62 @@ cat <<_EOF_ } } +/* + * AUTO - Special + * + * Just print 0 as 0. + */ +void +umtxcvwaitflags(intmax_t arg) +{ + int or = 0; + if (arg == 0) { + printf("0"); + return; + } + printf("%#jx<", (uintmax_t)arg); +_EOF_ + egrep "^#[[:space:]]*define[[:space:]]+CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+[[:space:]]*" \ + $include_dir/sys/umtx.h | \ + awk '{ for (i = 1; i <= NF; i++) \ + if ($i ~ /define/) \ + break; \ + ++i; \ + printf "\tif (!((arg > 0) ^ ((%s) > 0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' +cat <<_EOF_ + printf(">"); + if (or == 0) + printf("%jd", arg); +} + + +/* + * AUTO - Special + * + * Just print 0 as 0. + */ +void +umtxrwlockflags(intmax_t arg) +{ + int or = 0; + if (arg == 0) { + printf("0"); + return; + } + printf("%#jx<", (uintmax_t)arg); +_EOF_ + egrep "^#[[:space:]]*define[[:space:]]+URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+[[:space:]]*" \ + $include_dir/sys/umtx.h | \ + awk '{ for (i = 1; i <= NF; i++) \ + if ($i ~ /define/) \ + break; \ + ++i; \ + printf "\tif (!((arg > 0) ^ ((%s) > 0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' +cat <<_EOF_ + printf(">"); + if (or == 0) + printf("%jd", arg); +} _EOF_ egrep '#define[[:space:]]+CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)' \ $include_dir/sys/capability.h | \ Modified: stable/10/usr.bin/truss/syscall.h ============================================================================== --- stable/10/usr.bin/truss/syscall.h Tue Dec 16 21:51:21 2014 (r275842) +++ stable/10/usr.bin/truss/syscall.h Tue Dec 16 21:57:55 2014 (r275843) @@ -5,6 +5,7 @@ * Hex -- values that should be printed in hex (addresses) * Octal -- Same as above, but octal * Int -- normal integer values (file descriptors, for example) + * LongHex -- long value that should be printed in hex * Name -- pointer to a NULL-terminated string. * BinString -- pointer to an array of chars, printed via strvisx(). * Ptr -- pointer to some unspecified structure. Just print as hex for now. @@ -35,13 +36,13 @@ * $FreeBSD$ */ -enum Argtype { None = 1, Hex, Octal, Int, Name, Ptr, Stat, Ioctl, Quad, +enum Argtype { None = 1, Hex, Octal, Int, LongHex, Name, Ptr, Stat, Ioctl, Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, - LinuxSockArgs }; + LinuxSockArgs, Umtxop }; #define ARG_MASK 0xff #define OUT 0x100 Modified: stable/10/usr.bin/truss/syscalls.c ============================================================================== --- stable/10/usr.bin/truss/syscalls.c Tue Dec 16 21:51:21 2014 (r275842) +++ stable/10/usr.bin/truss/syscalls.c Tue Dec 16 21:57:55 2014 (r275843) @@ -283,6 +283,9 @@ static struct syscall syscalls[] = { { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } }, { .name = "procctl", .ret_type = 1, .nargs = 4, .args = { { Idtype, 0 }, { Int, 1 }, { Procctl, 2 }, { Ptr, 3 } } }, + { .name = "_umtx_op", .ret_type = 1, .nargs = 5, + .args = { { Ptr, 0 }, { Umtxop, 1 }, { LongHex, 2 }, { Ptr, 3 }, + { Ptr, 4 } } }, { .name = 0 }, }; @@ -416,6 +419,18 @@ static struct xlat procctl_arg[] = { X(PROC_SPROTECT) XEND }; +static struct xlat umtx_ops[] = { + X(UMTX_OP_LOCK) X(UMTX_OP_UNLOCK) X(UMTX_OP_WAIT) + X(UMTX_OP_WAKE) X(UMTX_OP_MUTEX_TRYLOCK) X(UMTX_OP_MUTEX_LOCK) + X(UMTX_OP_MUTEX_UNLOCK) X(UMTX_OP_SET_CEILING) X(UMTX_OP_CV_WAIT) + X(UMTX_OP_CV_SIGNAL) X(UMTX_OP_CV_BROADCAST) X(UMTX_OP_WAIT_UINT) + X(UMTX_OP_RW_RDLOCK) X(UMTX_OP_RW_WRLOCK) X(UMTX_OP_RW_UNLOCK) + X(UMTX_OP_WAIT_UINT_PRIVATE) X(UMTX_OP_WAKE_PRIVATE) + X(UMTX_OP_MUTEX_WAIT) X(UMTX_OP_MUTEX_WAKE) X(UMTX_OP_SEM_WAIT) + X(UMTX_OP_SEM_WAKE) X(UMTX_OP_NWAKE_PRIVATE) X(UMTX_OP_MUTEX_WAKE2) + XEND +}; + #undef X #undef XEND @@ -612,6 +627,9 @@ print_arg(struct syscall_args *sc, unsig case Int: asprintf(&tmp, "%d", (int)args[sc->offset]); break; + case LongHex: + asprintf(&tmp, "0x%lx", args[sc->offset]); + break; case Name: { /* NULL-terminated string. */ char *tmp2; @@ -1288,6 +1306,9 @@ print_arg(struct syscall_args *sc, unsig case Procctl: tmp = strdup(xlookup(procctl_arg, args[sc->offset])); break; + case Umtxop: + tmp = strdup(xlookup(umtx_ops, args[sc->offset])); + break; default: errx(1, "Invalid argument type %d\n", sc->type & ARG_MASK); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 23:25:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 232DE55E; Tue, 16 Dec 2014 23:25:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 04081211; Tue, 16 Dec 2014 23:25:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGNPDo6076923; Tue, 16 Dec 2014 23:25:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGNPDKi076921; Tue, 16 Dec 2014 23:25:13 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412162325.sBGNPDKi076921@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Dec 2014 23:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275844 - vendor/unbound/dist/iterator X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 23:25:14 -0000 Author: delphij Date: Tue Dec 16 23:25:12 2014 New Revision: 275844 URL: https://svnweb.freebsd.org/changeset/base/275844 Log: Bring in unbound fixes for CVE-2014-8602 to ease future code import. Modified: vendor/unbound/dist/iterator/iterator.c vendor/unbound/dist/iterator/iterator.h Modified: vendor/unbound/dist/iterator/iterator.c ============================================================================== --- vendor/unbound/dist/iterator/iterator.c Tue Dec 16 21:57:55 2014 (r275843) +++ vendor/unbound/dist/iterator/iterator.c Tue Dec 16 23:25:12 2014 (r275844) @@ -120,6 +120,7 @@ iter_new(struct module_qstate* qstate, i iq->query_restart_count = 0; iq->referral_count = 0; iq->sent_count = 0; + iq->target_count = NULL; iq->wait_priming_stub = 0; iq->refetch_glue = 0; iq->dnssec_expected = 0; @@ -445,6 +446,26 @@ handle_cname_response(struct module_qsta return 1; } +/** create target count structure for this query */ +static void +target_count_create(struct iter_qstate* iq) +{ + if(!iq->target_count) { + iq->target_count = (int*)calloc(2, sizeof(int)); + /* if calloc fails we simply do not track this number */ + if(iq->target_count) + iq->target_count[0] = 1; + } +} + +static void +target_count_increase(struct iter_qstate* iq, int num) +{ + target_count_create(iq); + if(iq->target_count) + iq->target_count[1] += num; +} + /** * Generate a subrequest. * Generate a local request event. Local events are tied to this module, and @@ -516,6 +537,10 @@ generate_sub_request(uint8_t* qname, siz subiq = (struct iter_qstate*)subq->minfo[id]; memset(subiq, 0, sizeof(*subiq)); subiq->num_target_queries = 0; + target_count_create(iq); + subiq->target_count = iq->target_count; + if(iq->target_count) + iq->target_count[0] ++; /* extra reference */ subiq->num_current_queries = 0; subiq->depth = iq->depth+1; outbound_list_init(&subiq->outlist); @@ -1342,6 +1367,12 @@ query_for_targets(struct module_qstate* if(iq->depth == ie->max_dependency_depth) return 0; + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return 0; + } iter_mark_cycle_targets(qstate, iq->dp); missing = (int)delegpt_count_missing_targets(iq->dp); @@ -1524,6 +1555,7 @@ processLastResort(struct module_qstate* return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += qs; + target_count_increase(iq, qs); if(qs != 0) { qstate->ext_state[id] = module_wait_subquery; return 0; /* and wait for them */ @@ -1533,6 +1565,12 @@ processLastResort(struct module_qstate* verbose(VERB_QUERY, "maxdepth and need more nameservers, fail"); return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); } + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); + } /* mark cycle targets for parent-side lookups */ iter_mark_pside_cycle_targets(qstate, iq->dp); /* see if we can issue queries to get nameserver addresses */ @@ -1562,6 +1600,7 @@ processLastResort(struct module_qstate* if(query_count != 0) { /* suspend to await results */ verbose(VERB_ALGO, "try parent-side glue lookup"); iq->num_target_queries += query_count; + target_count_increase(iq, query_count); qstate->ext_state[id] = module_wait_subquery; return 0; } @@ -1717,6 +1756,7 @@ processQueryTargets(struct module_qstate return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += extra; + target_count_increase(iq, extra); if(iq->num_target_queries > 0) { /* wait to get all targets, we want to try em */ verbose(VERB_ALGO, "wait for all targets for fallback"); @@ -1757,6 +1797,7 @@ processQueryTargets(struct module_qstate /* errors ignored, these targets are not strictly necessary for * this result, we do not have to reply with SERVFAIL */ iq->num_target_queries += extra; + target_count_increase(iq, extra); } /* Add the current set of unused targets to our queue. */ @@ -1802,6 +1843,7 @@ processQueryTargets(struct module_qstate return 1; } iq->num_target_queries += qs; + target_count_increase(iq, qs); } /* Since a target query might have been made, we * need to check again. */ @@ -2894,6 +2936,8 @@ iter_clear(struct module_qstate* qstate, iq = (struct iter_qstate*)qstate->minfo[id]; if(iq) { outbound_list_clear(&iq->outlist); + if(iq->target_count && --iq->target_count[0] == 0) + free(iq->target_count); iq->num_current_queries = 0; } qstate->minfo[id] = NULL; Modified: vendor/unbound/dist/iterator/iterator.h ============================================================================== --- vendor/unbound/dist/iterator/iterator.h Tue Dec 16 21:57:55 2014 (r275843) +++ vendor/unbound/dist/iterator/iterator.h Tue Dec 16 23:25:12 2014 (r275844) @@ -52,6 +52,8 @@ struct iter_donotq; struct iter_prep_list; struct iter_priv; +/** max number of targets spawned for a query and its subqueries */ +#define MAX_TARGET_COUNT 32 /** max number of query restarts. Determines max number of CNAME chain. */ #define MAX_RESTART_COUNT 8 /** max number of referrals. Makes sure resolver does not run away */ @@ -254,6 +256,10 @@ struct iter_qstate { /** number of queries fired off */ int sent_count; + + /** number of target queries spawned in [1], for this query and its + * subqueries, the malloced-array is shared, [0] refcount. */ + int* target_count; /** * The query must store NS records from referrals as parentside RRs From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 00:22:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE79D126; Wed, 17 Dec 2014 00:22:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9A9A69E6; Wed, 17 Dec 2014 00:22:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH0Mg6h007809; Wed, 17 Dec 2014 00:22:42 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH0MgHl007808; Wed, 17 Dec 2014 00:22:42 GMT (envelope-from will@FreeBSD.org) Message-Id: <201412170022.sBH0MgHl007808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 17 Dec 2014 00:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275845 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 00:22:42 -0000 Author: will Date: Wed Dec 17 00:22:41 2014 New Revision: 275845 URL: https://svnweb.freebsd.org/changeset/base/275845 Log: Initialize an argument to NULL instead of expecting dlinfo() to do it. dlinfo() is a weak reference that may not be initialized at the time of execution. The default implementation (in lib/libc/gen/dlfcn.c) neither modifies the address pointed to by the third argument nor returns an error. Differential Revision: https://reviews.freebsd.org/D1326 Reviewed by: markj MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Tue Dec 16 23:25:12 2014 (r275844) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Wed Dec 17 00:22:41 2014 (r275845) @@ -110,7 +110,7 @@ dtrace_dof_init(void) Elf32_Ehdr *elf; #endif dof_helper_t dh; - Link_map *lmp; + Link_map *lmp = NULL; #if defined(sun) Lmid_t lmid; #else From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 01:32:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76EE5DA1; Wed, 17 Dec 2014 01:32:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 57CC6FE4; Wed, 17 Dec 2014 01:32:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH1WS9v041488; Wed, 17 Dec 2014 01:32:28 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH1WSMI041487; Wed, 17 Dec 2014 01:32:28 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201412170132.sBH1WSMI041487@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 17 Dec 2014 01:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275846 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 01:32:28 -0000 Author: mckusick Date: Wed Dec 17 01:32:27 2014 New Revision: 275846 URL: https://svnweb.freebsd.org/changeset/base/275846 Log: Add some additional clarification and fix a few gammer nits. Reviewed by: kib MFC after: 3 weeks Modified: head/lib/libc/sys/procctl.2 Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Wed Dec 17 00:22:41 2014 (r275845) +++ head/lib/libc/sys/procctl.2 Wed Dec 17 01:32:27 2014 (r275846) @@ -101,25 +101,25 @@ Future child processes will also mark al .El .It Dv PROC_REAP_ACQUIRE Acquires the reaper status for the current process. -The status means that orphaned children by the reaper descendants, -forked after the acquisition of the status, are reparented to the +The status means that children orphaned by the reaper's descendants +that were forked after the acquisition of the status are reparented to the reaper. After the system initialization, .Xr init 8 is the default reaper. .Pp .It Dv PROC_REAP_RELEASE -Releases the reaper state fpr the current process. +Releases the reaper state for the current process. The reaper of the current process becomes the new reaper of the -current process descendants. +current process's descendants. .It Dv PROC_REAP_STATUS Provides the information about the reaper of the specified process, -or the process itself, in case it is a reaper. +or the process itself when it is a reaper. The .Fa data -argument must point to the -.Vt "struct procctl_reaper_status" , -which if filled by the syscall on successfull return. +argument must point to a +.Vt procctl_reaper_status +structure which is filled in by the syscall on successful return. .Bd -literal struct procctl_reaper_status { u_int rs_flags; @@ -134,57 +134,62 @@ The may have the following flags returned: .Bl -tag -width "Dv REAPER_STATUS_REALINIT" .It Dv REAPER_STATUS_OWNED -The specified process has acquired the reaper status and did not +The specified process has acquired the reaper status and has not released it. -When the flag is returned, the -.Fa id -pid identifies reaper, otherwise the +When the flag is returned, the specified process +.Fa id , +pid, identifies the reaper, otherwise the .Fa rs_reaper -field of the structure is the pid of the reaper for passed process id. +field of the structure is set to the pid of the reaper +for the specified process id. .It Dv REAPER_STATUS_REALINIT The specified process is the root of the reaper tree, i.e. -.Xr init 8. +.Xr init 8 . .El The .Fa rs_children -returns the number of the children of the reaper. +field returns the number of children of the reaper. The .Fa rs_descendants -returns the total number of descendants of the reaper, -not counting descendants of the reapers in the subtree. +field returns the total number of descendants of the reaper(s), +not counting descendants of the reaper in the subtree. The .Fa rs_reaper -returns the reaper pid. +field returns the reaper pid. The .Fa rs_pid -returns pid of some reaper child if there is any descendant. +returns the pid of one reaper child if there are any descendants. .It Dv PROC_REAP_GETPIDS Queries the list of descendants of the reaper of the specified process. -The request takes the pointer to -.Vt "struct procctl_reaper_pids" -as -.Fa data . +The request takes a pointer to a +.Vt procctl_reaper_pids +structure in the +.Fa data +parameter. .Bd -literal struct procctl_reaper_pids { u_int rp_count; struct procctl_reaper_pidinfo *rp_pids; }; .Ed -On call, the +When called, the .Fa rp_pids -must point to the array of +field must point to an array of .Vt procctl_reaper_pidinfo -structures, to be filled on return, +structures, to be filled in on return, and the .Fa rp_count -must specify the size of the array, -no more than rp_count elements is filled by kernel. +field must specify the size of the array, +into which no more than +.Fa rp_count +elements will be filled in by the kernel. .Pp The .Vt "struct procctl_reaper_pidinfo" -structure provides some information about one reaper' descendant. -Note that for the descendant which is not child, it is the subject -of usual race with process exiting and pid reuse. +structure provides some information about one of the reaper's descendants. +Note that for a descendant that is not a child, it may be incorrectly +identified because of a race in which the original child process exited +and the exited process's pid was reused for an unrelated process. .Bd -literal struct procctl_reaper_pidinfo { pid_t pi_pid; @@ -194,33 +199,35 @@ struct procctl_reaper_pidinfo { .Ed The .Fa pi_pid -is the process id of the descendant. +field is the process id of the descendant. The .Fa pi_subtree -provides the pid of the child of the reaper, which is (grand-)parent +field provides the pid of the child of the reaper, which is the (grand-)parent of the process. The .Fa pi_flags -returns the following flags, further describing the descendant: +field returns the following flags, further describing the descendant: .Bl -tag -width "Dv REAPER_PIDINFO_VALID" .It Dv REAPER_PIDINFO_VALID -Set for the +Set to indicate that the .Vt procctl_reaper_pidinfo -structure, which was filled by kernel. +structure was filled in by the kernel. Zero-filling the .Fa rp_pids -array and testing the flag allows the caller to detect the end -of returned array. +array and testing the +.Dv REAPER_PIDINFO_VALID +flag allows the caller to detect the end +of the returned array. .It Dv REAPER_PIDINFO_CHILD The .Fa pi_pid -is the direct child of the reaper. +field identifies the direct child of the reaper. .El .It Dv PROC_REAP_KILL -Request to deliver a signal to some subset of descendants of the reaper. +Request to deliver a signal to some subset of the descendants of the reaper. The .Fa data -must point to +parameter must point to a .Vt procctl_reaper_kill structure, which is used both for parameters and status return. .Bd -literal @@ -234,39 +241,40 @@ struct procctl_reaper_kill { .Ed The .Fa rk_sig -specifies the signal to be delivered. +field specifies the signal to be delivered. Zero is not a valid signal number, unlike .Xr kill 2 . The .Fa rk_flags -further directs the operation. +field further directs the operation. It is or-ed from the following flags: .Bl -tag -width "Dv REAPER_KILL_CHILDREN" .It Dv REAPER_KILL_CHILDREN Deliver the specified signal only to direct children of the reaper. .It Dv REAPER_KILL_SUBTREE -Deliver the specified signal only to descendants which were forked by -the direct child with pid specified in -.Fa rk_subtree . +Deliver the specified signal only to descendants that were forked by +the direct child with pid specified in the +.Fa rk_subtree +field. .El -If no +If neither the .Dv REAPER_KILL_CHILDREN -and +nor the .Dv REAPER_KILL_SUBTREE flags are specified, all current descendants of the reaper are signalled. .Pp -If signal was delivered to any process, the return value from the request +If a signal was delivered to any process, the return value from the request is zero. -In this case, +In this case, the .Fa rk_killed -field is filled with the count of processes signalled. +field identifies the number of processes signalled. The .Fa rk_fpid field is set to the pid of the first process for which signal delivery failed, e.g. due to the permission problems. If no such process exist, the .Fa rk_fpid -is set to -1. +field is set to -1. .El .Sh RETURN VALUES If an error occurs, a value of -1 is returned and @@ -281,7 +289,7 @@ will fail if: .It Bq Er EFAULT The .Fa arg -points outside the process's allocated address space. +parameter points outside the process's allocated address space. .It Bq Er EINVAL The .Fa cmd @@ -317,11 +325,11 @@ or .Dv PROC_REAP_RELEASE requests. .It Bq Er EINVAL -Invalid or undefined flags were passed to +Invalid or undefined flags were passed to a .Dv PROC_REAP_KILL request. .It Bq Er EINVAL -Invalid or zero signal number was requested for +An invalid or zero signal number was requested for a .Dv PROC_REAP_KILL request. .It Bq Er EINVAL @@ -333,8 +341,8 @@ process. .It Bq Er EBUSY The .Dv PROC_REAP_ACQUIRE -request was issued by the process which already acquired reaper status -and did not released it. +request was issued by a process that had already acquired reaper status +and has not yet released it. .El .Sh SEE ALSO .Xr kill 2 , @@ -346,6 +354,6 @@ The .Fn procctl function appeared in .Fx 10.0 . -Reaper facility was created based on the similar feature of Linux and +The reaper facility is based on a similar feature of Linux and DragonflyBSD, and first appeared in .Fx 10.2 . From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 01:36:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B60D31D9; Wed, 17 Dec 2014 01:36:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A1D4675; Wed, 17 Dec 2014 01:36:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH1a1IL042064; Wed, 17 Dec 2014 01:36:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH1a13e042062; Wed, 17 Dec 2014 01:36:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201412170136.sBH1a13e042062@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 17 Dec 2014 01:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275847 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 01:36:01 -0000 Author: bdrewery Date: Wed Dec 17 01:36:00 2014 New Revision: 275847 URL: https://svnweb.freebsd.org/changeset/base/275847 Log: Bump Dd for r275846 MFC after: 3 weeks Modified: head/lib/libc/sys/procctl.2 Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Wed Dec 17 01:32:27 2014 (r275846) +++ head/lib/libc/sys/procctl.2 Wed Dec 17 01:36:00 2014 (r275847) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 15, 2014 +.Dd December 16, 2014 .Dt PROCCTL 2 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 03:04:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF32A78D; Wed, 17 Dec 2014 03:04:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DBE93C28; Wed, 17 Dec 2014 03:04:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH34iKw085897; Wed, 17 Dec 2014 03:04:44 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH34iD1085896; Wed, 17 Dec 2014 03:04:44 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412170304.sBH34iD1085896@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 17 Dec 2014 03:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275850 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 03:04:45 -0000 Author: neel Date: Wed Dec 17 03:04:43 2014 New Revision: 275850 URL: https://svnweb.freebsd.org/changeset/base/275850 Log: Fix 8259 IRQ priority resolver. Initialize the 8259 such that IRQ7 is the lowest priority. Reviewed by: tychon Differential Revision: https://reviews.freebsd.org/D1322 MFC after: 1 week Modified: head/sys/amd64/vmm/io/vatpic.c Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Wed Dec 17 01:48:32 2014 (r275849) +++ head/sys/amd64/vmm/io/vatpic.c Wed Dec 17 03:04:43 2014 (r275850) @@ -75,7 +75,7 @@ struct atpic { uint8_t mask; /* Interrupt Mask Register (IMR) */ int acnt[8]; /* sum of pin asserts and deasserts */ - int priority; /* current pin priority */ + int lowprio; /* lowest priority irq */ bool intr_raised; }; @@ -102,6 +102,14 @@ struct vatpic { #define VATPIC_CTR4(vatpic, fmt, a1, a2, a3, a4) \ VM_CTR4((vatpic)->vm, fmt, a1, a2, a3, a4) +/* + * Loop over all the pins in priority order from highest to lowest. + */ +#define ATPIC_PIN_FOREACH(pinvar, atpic, tmpvar) \ + for (tmpvar = 0, pinvar = (atpic->lowprio + 1) & 0x7; \ + tmpvar < 8; \ + tmpvar++, pinvar = (pinvar + 1) & 0x7) + static void vatpic_set_pinstate(struct vatpic *vatpic, int pin, bool newstate); static __inline int @@ -110,8 +118,7 @@ vatpic_get_highest_isrpin(struct atpic * int bit, pin; int i; - for (i = 0; i <= 7; i++) { - pin = ((i + 7 - atpic->priority) & 0x7); + ATPIC_PIN_FOREACH(pin, atpic, i) { bit = (1 << pin); if (atpic->service & bit) @@ -125,8 +132,7 @@ static __inline int vatpic_get_highest_irrpin(struct atpic *atpic) { int serviced; - int bit, pin; - int i, j; + int bit, pin, tmp; /* * In 'Special Fully-Nested Mode' when an interrupt request from @@ -137,17 +143,21 @@ vatpic_get_highest_irrpin(struct atpic * if (atpic->sfn) serviced &= ~(1 << 2); - for (i = 0; i <= 7; i++) { - pin = ((i + 7 - atpic->priority) & 0x7); - bit = (1 << pin); - if (serviced & bit) + ATPIC_PIN_FOREACH(pin, atpic, tmp) { + bit = 1 << pin; + + /* + * If there is already an interrupt in service at the same + * or higher priority then bail. + */ + if ((serviced & bit) != 0) break; - } - for (j = 0; j < i; j++) { - pin = ((j + 7 - atpic->priority) & 0x7); - bit = (1 << pin); - if (atpic->request & bit && (~atpic->mask & bit)) + /* + * If an interrupt is asserted and not masked then return + * the corresponding 'pin' to the caller. + */ + if ((atpic->request & bit) != 0 && (atpic->mask & bit) == 0) return (pin); } @@ -238,7 +248,7 @@ vatpic_icw1(struct vatpic *vatpic, struc atpic->icw_num = 1; atpic->mask = 0; - atpic->priority = 0; + atpic->lowprio = 7; atpic->rd_cmd_reg = 0; if ((val & ICW1_SNGL) != 0) { @@ -329,11 +339,11 @@ vatpic_ocw2(struct vatpic *vatpic, struc atpic->service &= ~(1 << isr_bit); if (atpic->rotate) - atpic->priority = isr_bit; + atpic->lowprio = isr_bit; } } else if ((val & OCW2_SL) != 0 && atpic->rotate == true) { /* specific priority */ - atpic->priority = val & 0x7; + atpic->lowprio = val & 0x7; } return (0); @@ -530,7 +540,7 @@ vatpic_pin_accepted(struct atpic *atpic, if (atpic->aeoi == true) { if (atpic->rotate == true) - atpic->priority = pin; + atpic->lowprio = pin; } else { atpic->service |= (1 << pin); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 05:36:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E4DE90B; Wed, 17 Dec 2014 05:36:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 12E33B7B; Wed, 17 Dec 2014 05:36:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH5aabl057026; Wed, 17 Dec 2014 05:36:36 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH5aZkj057022; Wed, 17 Dec 2014 05:36:35 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201412170536.sBH5aZkj057022@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Wed, 17 Dec 2014 05:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275851 - in head: sbin/ifconfig share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 05:36:37 -0000 Author: bryanv Date: Wed Dec 17 05:36:34 2014 New Revision: 275851 URL: https://svnweb.freebsd.org/changeset/base/275851 Log: Prefix all the vxlan ifconfig commands so they are unique And rehook ifvxlan back into the build. Modified: head/sbin/ifconfig/Makefile head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifvxlan.c head/share/man/man4/vxlan.4 Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Wed Dec 17 03:04:43 2014 (r275850) +++ head/sbin/ifconfig/Makefile Wed Dec 17 05:36:34 2014 (r275851) @@ -30,7 +30,7 @@ SRCS+= ifmac.c # MAC support SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support SRCS+= iffib.c # non-default FIB support SRCS+= ifvlan.c # SIOC[GS]ETVLAN support -#SRCS+= ifvxlan.c # VXLAN support +SRCS+= ifvxlan.c # VXLAN support SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Dec 17 03:04:43 2014 (r275850) +++ head/sbin/ifconfig/ifconfig.8 Wed Dec 17 05:36:34 2014 (r275851) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd October 20, 2014 +.Dd December 16, 2014 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2544,33 +2544,33 @@ The following parameters are used to con .Xr vxlan 4 interfaces. .Bl -tag -width indent -.It Cm vni Ar identifier +.It Cm vxlanid Ar identifier This value is a 24-bit VXLAN Network Identifier (VNI) that identifies the virtual network segment membership of the interface. -.It Cm local Ar address +.It Cm vxlanlocal Ar address The source address used in the encapsulating IPv4/IPv6 header. The address should already be assigned to an existing interface. When the interface is configured in unicast mode, the listening socket is bound to this address. -.It Cm remote Ar address +.It Cm vxlanremote Ar address The interface can be configured in a unicast, or point-to-point, mode to create a tunnel between two hosts. This is the IP address of the remote end of the tunnel. -.It Cm group Ar address +.It Cm vxlangroup Ar address The interface can be configured in a multicast mode to create a virtual network of hosts. This is the IP multicast group address the interface will join. -.It Cm localport Ar port +.It Cm vxlanlocalport Ar port The port number the interface will listen on. The default port number is 4789. -.It Cm remoteport Ar port +.It Cm vxlanremoteport Ar port The destination port number used in the encapsulating IPv4/IPv6 header. The remote host should be listening on this port. The default port number is 4789. Note some other implementations, such as Linux, do not default to the IANA assigned port, but instead listen on port 8472. -.It Cm portrange Ar low high +.It Cm vxlanportrange Ar low high The range of source ports used in the encapsulating IPv4/IPv6 header. The port selected within the range is based on a hash of the inner frame. A range is useful to provide entropy within the outer IP header @@ -2581,32 +2581,32 @@ variables .Va net.inet.ip.portrange.first and .Va net.inet.ip.portrange.last -.It Cm timeout Ar timeout +.It Cm vxlantimeout Ar timeout The maximum time, in seconds, before an entry in the forwarding table is pruned. The default is 1200 seconds (20 minutes). -.It Cm maxaddr Ar max +.It Cm vxlanmaxaddr Ar max The maximum number of entries in the forwarding table. The default is 2000. .It Cm vxlandev Ar dev When the interface is configured in multicast mode, the .Cm dev interface is used to transmit IP multicast packets. -.It Cm ttl Ar ttl +.It Cm vxlanttl Ar ttl The TTL used in the encapsulating IPv4/IPv6 header. The default is 64. -.It Cm learn +.It Cm vxlanlearn The source IP address and inner source Ethernet MAC address of received packets are used to dynamically populate the forwarding table. When in multicast mode, an entry in the forwarding table allows the interface to send the frame directly to the remote host instead of broadcasting the frame to the multicast group. This is the default. -.It Fl learn +.It Fl vxlanlearn The forwarding table is not populated by recevied packets. -.It Cm flush +.It Cm vxlanflush Delete all dynamically-learned addresses from the forwarding table. -.It Cm flushall +.It Cm vxlanflushall Delete all addresses, including static addresses, from the forwarding table. .El .Pp Modified: head/sbin/ifconfig/ifvxlan.c ============================================================================== --- head/sbin/ifconfig/ifvxlan.c Wed Dec 17 03:04:43 2014 (r275850) +++ head/sbin/ifconfig/ifvxlan.c Wed Dec 17 05:36:34 2014 (r275851) @@ -595,36 +595,36 @@ setvxlan_flush(const char *val, int d, i static struct cmd vxlan_cmds[] = { - DEF_CLONE_CMD_ARG("vni", setvxlan_vni), - DEF_CLONE_CMD_ARG("local", setvxlan_local), - DEF_CLONE_CMD_ARG("remote", setvxlan_remote), - DEF_CLONE_CMD_ARG("group", setvxlan_group), - DEF_CLONE_CMD_ARG("localport", setvxlan_local_port), - DEF_CLONE_CMD_ARG("remoteport", setvxlan_remote_port), - DEF_CLONE_CMD_ARG2("portrange", setvxlan_port_range), - DEF_CLONE_CMD_ARG("timeout", setvxlan_timeout), - DEF_CLONE_CMD_ARG("maxaddr", setvxlan_maxaddr), + DEF_CLONE_CMD_ARG("vxlanid", setvxlan_vni), + DEF_CLONE_CMD_ARG("vxlanlocal", setvxlan_local), + DEF_CLONE_CMD_ARG("vxlanremote", setvxlan_remote), + DEF_CLONE_CMD_ARG("vxlangroup", setvxlan_group), + DEF_CLONE_CMD_ARG("vxlanlocalport", setvxlan_local_port), + DEF_CLONE_CMD_ARG("vxlanremoteport", setvxlan_remote_port), + DEF_CLONE_CMD_ARG2("vxlanportrange", setvxlan_port_range), + DEF_CLONE_CMD_ARG("vxlantimeout", setvxlan_timeout), + DEF_CLONE_CMD_ARG("vxlanmaxaddr", setvxlan_maxaddr), DEF_CLONE_CMD_ARG("vxlandev", setvxlan_dev), - DEF_CLONE_CMD_ARG("ttl", setvxlan_ttl), - DEF_CLONE_CMD("learn", 1, setvxlan_learn), - DEF_CLONE_CMD("-learn", 0, setvxlan_learn), - - DEF_CMD_ARG("vni", setvxlan_vni), - DEF_CMD_ARG("local", setvxlan_local), - DEF_CMD_ARG("remote", setvxlan_remote), - DEF_CMD_ARG("group", setvxlan_group), - DEF_CMD_ARG("localport", setvxlan_local_port), - DEF_CMD_ARG("remoteport", setvxlan_remote_port), - DEF_CMD_ARG2("portrange", setvxlan_port_range), - DEF_CMD_ARG("timeout", setvxlan_timeout), - DEF_CMD_ARG("maxaddr", setvxlan_maxaddr), + DEF_CLONE_CMD_ARG("vxlanttl", setvxlan_ttl), + DEF_CLONE_CMD("vxlanlearn", 1, setvxlan_learn), + DEF_CLONE_CMD("-vxlanlearn", 0, setvxlan_learn), + + DEF_CMD_ARG("vxlanvni", setvxlan_vni), + DEF_CMD_ARG("vxlanlocal", setvxlan_local), + DEF_CMD_ARG("vxlanremote", setvxlan_remote), + DEF_CMD_ARG("vxlangroup", setvxlan_group), + DEF_CMD_ARG("vxlanlocalport", setvxlan_local_port), + DEF_CMD_ARG("vxlanremoteport", setvxlan_remote_port), + DEF_CMD_ARG2("vxlanportrange", setvxlan_port_range), + DEF_CMD_ARG("vxlantimeout", setvxlan_timeout), + DEF_CMD_ARG("vxlanmaxaddr", setvxlan_maxaddr), DEF_CMD_ARG("vxlandev", setvxlan_dev), - DEF_CMD_ARG("ttl", setvxlan_ttl), - DEF_CMD("learn", 1, setvxlan_learn), - DEF_CMD("-learn", 0, setvxlan_learn), + DEF_CMD_ARG("vxlanttl", setvxlan_ttl), + DEF_CMD("vxlanlearn", 1, setvxlan_learn), + DEF_CMD("-vxlanlearn", 0, setvxlan_learn), - DEF_CMD("flush", 0, setvxlan_flush), - DEF_CMD("flushall", 1, setvxlan_flush), + DEF_CMD("vxlanflush", 0, setvxlan_flush), + DEF_CMD("vxlanflushall", 1, setvxlan_flush), }; static struct afswtch af_vxlan = { Modified: head/share/man/man4/vxlan.4 ============================================================================== --- head/share/man/man4/vxlan.4 Wed Dec 17 03:04:43 2014 (r275850) +++ head/share/man/man4/vxlan.4 Wed Dec 17 05:36:34 2014 (r275851) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2014 +.Dd December 16, 2014 .Dt VXLAN 4 .Os .Sh NAME @@ -140,7 +140,7 @@ or VNI. .Pp When configured with the .Xr ifconfig 8 -.Cm learn +.Cm vxlanlearn parameter, the interface dynamically creates forwarding table entries from received packets. An entry in the forwarding table maps the inner source MAC address @@ -153,16 +153,16 @@ Otherwise, when configured in multicast the interface must flood the frame to all hosts in the group. The maximum number of entries in the table is configurable with the .Xr ifconfig 8 -.Cm maxaddr +.Cm vxlanmaxaddr command. Stale entries in the table periodically pruned. The timeout is configurable with the .Xr ifconfig 8 -.Cm timeout +.Cm vxlantimeout command. The table may be viewed with the .Xr sysctl 8 -.Cm net.link.vlxan.N.ftable.dump +.Cm net.link.vxlan.N.ftable.dump command. .Sh MTU Since the @@ -187,13 +187,13 @@ Create a .Nm interface in unicast mode with the -.Cm local +.Cm vxlanlocal tunnel address of 192.168.100.1, and the -.Cm remote +.Cm vxlanremote tunnel address of 192.168.100.2. .Bd -literal -offset indent -ifconfig vxlan create vni 108 local 192.168.100.1 remote 192.168.100.2 +ifconfig vxlan create vxlanid 108 vxlanlocal 192.168.100.1 vxlanremote 192.168.100.2 .Ed .Pp Create a @@ -207,7 +207,7 @@ and the address of 224.0.2.6. The em0 interface will be used to transmit multicast packets. .Bd -literal -offset indent -ifconfig vxlan create vni 42 local 192.168.10.95 group 224.0.2.6 vxlandev em0 +ifconfig vxlan create vxlanid 42 vxlanlocal 192.168.10.95 vxlangroup 224.0.2.6 vxlandev em0 .Ed .Pp Once created, the From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 06:55:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A39A320B; Wed, 17 Dec 2014 06:55:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 80FF922B; Wed, 17 Dec 2014 06:55:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH6tjJb094526; Wed, 17 Dec 2014 06:55:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH6tjeE094524; Wed, 17 Dec 2014 06:55:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412170655.sBH6tjeE094524@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Dec 2014 06:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275852 - head/contrib/unbound/iterator X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 06:55:45 -0000 Author: delphij Date: Wed Dec 17 06:55:44 2014 New Revision: 275852 URL: https://svnweb.freebsd.org/changeset/base/275852 Log: MFV r275844: Fix unbound remote denial of service vulnerability. Security: FreeBSD-SA-14:30.unbound Security: CVE-2014-8602 Modified: head/contrib/unbound/iterator/iterator.c head/contrib/unbound/iterator/iterator.h Directory Properties: head/contrib/unbound/ (props changed) Modified: head/contrib/unbound/iterator/iterator.c ============================================================================== --- head/contrib/unbound/iterator/iterator.c Wed Dec 17 05:36:34 2014 (r275851) +++ head/contrib/unbound/iterator/iterator.c Wed Dec 17 06:55:44 2014 (r275852) @@ -120,6 +120,7 @@ iter_new(struct module_qstate* qstate, i iq->query_restart_count = 0; iq->referral_count = 0; iq->sent_count = 0; + iq->target_count = NULL; iq->wait_priming_stub = 0; iq->refetch_glue = 0; iq->dnssec_expected = 0; @@ -445,6 +446,26 @@ handle_cname_response(struct module_qsta return 1; } +/** create target count structure for this query */ +static void +target_count_create(struct iter_qstate* iq) +{ + if(!iq->target_count) { + iq->target_count = (int*)calloc(2, sizeof(int)); + /* if calloc fails we simply do not track this number */ + if(iq->target_count) + iq->target_count[0] = 1; + } +} + +static void +target_count_increase(struct iter_qstate* iq, int num) +{ + target_count_create(iq); + if(iq->target_count) + iq->target_count[1] += num; +} + /** * Generate a subrequest. * Generate a local request event. Local events are tied to this module, and @@ -516,6 +537,10 @@ generate_sub_request(uint8_t* qname, siz subiq = (struct iter_qstate*)subq->minfo[id]; memset(subiq, 0, sizeof(*subiq)); subiq->num_target_queries = 0; + target_count_create(iq); + subiq->target_count = iq->target_count; + if(iq->target_count) + iq->target_count[0] ++; /* extra reference */ subiq->num_current_queries = 0; subiq->depth = iq->depth+1; outbound_list_init(&subiq->outlist); @@ -1342,6 +1367,12 @@ query_for_targets(struct module_qstate* if(iq->depth == ie->max_dependency_depth) return 0; + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return 0; + } iter_mark_cycle_targets(qstate, iq->dp); missing = (int)delegpt_count_missing_targets(iq->dp); @@ -1524,6 +1555,7 @@ processLastResort(struct module_qstate* return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += qs; + target_count_increase(iq, qs); if(qs != 0) { qstate->ext_state[id] = module_wait_subquery; return 0; /* and wait for them */ @@ -1533,6 +1565,12 @@ processLastResort(struct module_qstate* verbose(VERB_QUERY, "maxdepth and need more nameservers, fail"); return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); } + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); + } /* mark cycle targets for parent-side lookups */ iter_mark_pside_cycle_targets(qstate, iq->dp); /* see if we can issue queries to get nameserver addresses */ @@ -1562,6 +1600,7 @@ processLastResort(struct module_qstate* if(query_count != 0) { /* suspend to await results */ verbose(VERB_ALGO, "try parent-side glue lookup"); iq->num_target_queries += query_count; + target_count_increase(iq, query_count); qstate->ext_state[id] = module_wait_subquery; return 0; } @@ -1717,6 +1756,7 @@ processQueryTargets(struct module_qstate return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += extra; + target_count_increase(iq, extra); if(iq->num_target_queries > 0) { /* wait to get all targets, we want to try em */ verbose(VERB_ALGO, "wait for all targets for fallback"); @@ -1757,6 +1797,7 @@ processQueryTargets(struct module_qstate /* errors ignored, these targets are not strictly necessary for * this result, we do not have to reply with SERVFAIL */ iq->num_target_queries += extra; + target_count_increase(iq, extra); } /* Add the current set of unused targets to our queue. */ @@ -1802,6 +1843,7 @@ processQueryTargets(struct module_qstate return 1; } iq->num_target_queries += qs; + target_count_increase(iq, qs); } /* Since a target query might have been made, we * need to check again. */ @@ -2894,6 +2936,8 @@ iter_clear(struct module_qstate* qstate, iq = (struct iter_qstate*)qstate->minfo[id]; if(iq) { outbound_list_clear(&iq->outlist); + if(iq->target_count && --iq->target_count[0] == 0) + free(iq->target_count); iq->num_current_queries = 0; } qstate->minfo[id] = NULL; Modified: head/contrib/unbound/iterator/iterator.h ============================================================================== --- head/contrib/unbound/iterator/iterator.h Wed Dec 17 05:36:34 2014 (r275851) +++ head/contrib/unbound/iterator/iterator.h Wed Dec 17 06:55:44 2014 (r275852) @@ -52,6 +52,8 @@ struct iter_donotq; struct iter_prep_list; struct iter_priv; +/** max number of targets spawned for a query and its subqueries */ +#define MAX_TARGET_COUNT 32 /** max number of query restarts. Determines max number of CNAME chain. */ #define MAX_RESTART_COUNT 8 /** max number of referrals. Makes sure resolver does not run away */ @@ -254,6 +256,10 @@ struct iter_qstate { /** number of queries fired off */ int sent_count; + + /** number of target queries spawned in [1], for this query and its + * subqueries, the malloced-array is shared, [0] refcount. */ + int* target_count; /** * The query must store NS records from referrals as parentside RRs From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 06:58:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15B3F380; Wed, 17 Dec 2014 06:58:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0055C23D; Wed, 17 Dec 2014 06:58:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH6w19W094883; Wed, 17 Dec 2014 06:58:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH6w1uc094879; Wed, 17 Dec 2014 06:58:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412170658.sBH6w1uc094879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Dec 2014 06:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275853 - stable/10/contrib/unbound/iterator X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 06:58:02 -0000 Author: delphij Date: Wed Dec 17 06:58:00 2014 New Revision: 275853 URL: https://svnweb.freebsd.org/changeset/base/275853 Log: MFC r275852: MFV r275844: Fix unbound remote denial of service vulnerability. Security: FreeBSD-SA-14:30.unbound Security: CVE-2014-8602 Approved by: so Modified: stable/10/contrib/unbound/iterator/iterator.c stable/10/contrib/unbound/iterator/iterator.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/unbound/iterator/iterator.c ============================================================================== --- stable/10/contrib/unbound/iterator/iterator.c Wed Dec 17 06:55:44 2014 (r275852) +++ stable/10/contrib/unbound/iterator/iterator.c Wed Dec 17 06:58:00 2014 (r275853) @@ -120,6 +120,7 @@ iter_new(struct module_qstate* qstate, i iq->query_restart_count = 0; iq->referral_count = 0; iq->sent_count = 0; + iq->target_count = NULL; iq->wait_priming_stub = 0; iq->refetch_glue = 0; iq->dnssec_expected = 0; @@ -445,6 +446,26 @@ handle_cname_response(struct module_qsta return 1; } +/** create target count structure for this query */ +static void +target_count_create(struct iter_qstate* iq) +{ + if(!iq->target_count) { + iq->target_count = (int*)calloc(2, sizeof(int)); + /* if calloc fails we simply do not track this number */ + if(iq->target_count) + iq->target_count[0] = 1; + } +} + +static void +target_count_increase(struct iter_qstate* iq, int num) +{ + target_count_create(iq); + if(iq->target_count) + iq->target_count[1] += num; +} + /** * Generate a subrequest. * Generate a local request event. Local events are tied to this module, and @@ -516,6 +537,10 @@ generate_sub_request(uint8_t* qname, siz subiq = (struct iter_qstate*)subq->minfo[id]; memset(subiq, 0, sizeof(*subiq)); subiq->num_target_queries = 0; + target_count_create(iq); + subiq->target_count = iq->target_count; + if(iq->target_count) + iq->target_count[0] ++; /* extra reference */ subiq->num_current_queries = 0; subiq->depth = iq->depth+1; outbound_list_init(&subiq->outlist); @@ -1342,6 +1367,12 @@ query_for_targets(struct module_qstate* if(iq->depth == ie->max_dependency_depth) return 0; + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return 0; + } iter_mark_cycle_targets(qstate, iq->dp); missing = (int)delegpt_count_missing_targets(iq->dp); @@ -1524,6 +1555,7 @@ processLastResort(struct module_qstate* return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += qs; + target_count_increase(iq, qs); if(qs != 0) { qstate->ext_state[id] = module_wait_subquery; return 0; /* and wait for them */ @@ -1533,6 +1565,12 @@ processLastResort(struct module_qstate* verbose(VERB_QUERY, "maxdepth and need more nameservers, fail"); return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); } + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); + } /* mark cycle targets for parent-side lookups */ iter_mark_pside_cycle_targets(qstate, iq->dp); /* see if we can issue queries to get nameserver addresses */ @@ -1562,6 +1600,7 @@ processLastResort(struct module_qstate* if(query_count != 0) { /* suspend to await results */ verbose(VERB_ALGO, "try parent-side glue lookup"); iq->num_target_queries += query_count; + target_count_increase(iq, query_count); qstate->ext_state[id] = module_wait_subquery; return 0; } @@ -1717,6 +1756,7 @@ processQueryTargets(struct module_qstate return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += extra; + target_count_increase(iq, extra); if(iq->num_target_queries > 0) { /* wait to get all targets, we want to try em */ verbose(VERB_ALGO, "wait for all targets for fallback"); @@ -1757,6 +1797,7 @@ processQueryTargets(struct module_qstate /* errors ignored, these targets are not strictly necessary for * this result, we do not have to reply with SERVFAIL */ iq->num_target_queries += extra; + target_count_increase(iq, extra); } /* Add the current set of unused targets to our queue. */ @@ -1802,6 +1843,7 @@ processQueryTargets(struct module_qstate return 1; } iq->num_target_queries += qs; + target_count_increase(iq, qs); } /* Since a target query might have been made, we * need to check again. */ @@ -2894,6 +2936,8 @@ iter_clear(struct module_qstate* qstate, iq = (struct iter_qstate*)qstate->minfo[id]; if(iq) { outbound_list_clear(&iq->outlist); + if(iq->target_count && --iq->target_count[0] == 0) + free(iq->target_count); iq->num_current_queries = 0; } qstate->minfo[id] = NULL; Modified: stable/10/contrib/unbound/iterator/iterator.h ============================================================================== --- stable/10/contrib/unbound/iterator/iterator.h Wed Dec 17 06:55:44 2014 (r275852) +++ stable/10/contrib/unbound/iterator/iterator.h Wed Dec 17 06:58:00 2014 (r275853) @@ -52,6 +52,8 @@ struct iter_donotq; struct iter_prep_list; struct iter_priv; +/** max number of targets spawned for a query and its subqueries */ +#define MAX_TARGET_COUNT 32 /** max number of query restarts. Determines max number of CNAME chain. */ #define MAX_RESTART_COUNT 8 /** max number of referrals. Makes sure resolver does not run away */ @@ -254,6 +256,10 @@ struct iter_qstate { /** number of queries fired off */ int sent_count; + + /** number of target queries spawned in [1], for this query and its + * subqueries, the malloced-array is shared, [0] refcount. */ + int* target_count; /** * The query must store NS records from referrals as parentside RRs From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 06:59:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1A334C1; Wed, 17 Dec 2014 06:59:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D256F252; Wed, 17 Dec 2014 06:59:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH6xoXE095219; Wed, 17 Dec 2014 06:59:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH6xmgm095205; Wed, 17 Dec 2014 06:59:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412170659.sBH6xmgm095205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Dec 2014 06:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r275854 - in releng: 10.0 10.0/contrib/unbound/iterator 10.0/sys/conf 10.1 10.1/contrib/unbound/iterator 10.1/sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 06:59:51 -0000 Author: delphij Date: Wed Dec 17 06:59:47 2014 New Revision: 275854 URL: https://svnweb.freebsd.org/changeset/base/275854 Log: Fix unbound remote denial of service vulnerability. Security: FreeBSD-SA-14:30.unbound Security: CVE-2014-8602 Approved by: so Modified: releng/10.0/UPDATING releng/10.0/contrib/unbound/iterator/iterator.c releng/10.0/contrib/unbound/iterator/iterator.h releng/10.0/sys/conf/newvers.sh releng/10.1/UPDATING releng/10.1/contrib/unbound/iterator/iterator.c releng/10.1/contrib/unbound/iterator/iterator.h releng/10.1/sys/conf/newvers.sh Modified: releng/10.0/UPDATING ============================================================================== --- releng/10.0/UPDATING Wed Dec 17 06:58:00 2014 (r275853) +++ releng/10.0/UPDATING Wed Dec 17 06:59:47 2014 (r275854) @@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20141217: p14 FreeBSD-SA-14:30.unbound + Fix unbound remote denial of service vulnerability. + 20141210: p13 FreeBSD-SA-14:28.file Fix multiple vulnerabilities in file(1) and libmagic(3). Modified: releng/10.0/contrib/unbound/iterator/iterator.c ============================================================================== --- releng/10.0/contrib/unbound/iterator/iterator.c Wed Dec 17 06:58:00 2014 (r275853) +++ releng/10.0/contrib/unbound/iterator/iterator.c Wed Dec 17 06:59:47 2014 (r275854) @@ -117,6 +117,7 @@ iter_new(struct module_qstate* qstate, i iq->query_restart_count = 0; iq->referral_count = 0; iq->sent_count = 0; + iq->target_count = NULL; iq->wait_priming_stub = 0; iq->refetch_glue = 0; iq->dnssec_expected = 0; @@ -442,6 +443,26 @@ handle_cname_response(struct module_qsta return 1; } +/** create target count structure for this query */ +static void +target_count_create(struct iter_qstate* iq) +{ + if(!iq->target_count) { + iq->target_count = (int*)calloc(2, sizeof(int)); + /* if calloc fails we simply do not track this number */ + if(iq->target_count) + iq->target_count[0] = 1; + } +} + +static void +target_count_increase(struct iter_qstate* iq, int num) +{ + target_count_create(iq); + if(iq->target_count) + iq->target_count[1] += num; +} + /** * Generate a subrequest. * Generate a local request event. Local events are tied to this module, and @@ -513,6 +534,10 @@ generate_sub_request(uint8_t* qname, siz subiq = (struct iter_qstate*)subq->minfo[id]; memset(subiq, 0, sizeof(*subiq)); subiq->num_target_queries = 0; + target_count_create(iq); + subiq->target_count = iq->target_count; + if(iq->target_count) + iq->target_count[0] ++; /* extra reference */ subiq->num_current_queries = 0; subiq->depth = iq->depth+1; outbound_list_init(&subiq->outlist); @@ -1339,6 +1364,12 @@ query_for_targets(struct module_qstate* if(iq->depth == ie->max_dependency_depth) return 0; + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return 0; + } iter_mark_cycle_targets(qstate, iq->dp); missing = (int)delegpt_count_missing_targets(iq->dp); @@ -1487,6 +1518,7 @@ processLastResort(struct module_qstate* return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += qs; + target_count_increase(iq, qs); if(qs != 0) { qstate->ext_state[id] = module_wait_subquery; return 0; /* and wait for them */ @@ -1496,6 +1528,12 @@ processLastResort(struct module_qstate* verbose(VERB_QUERY, "maxdepth and need more nameservers, fail"); return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); } + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); + } /* mark cycle targets for parent-side lookups */ iter_mark_pside_cycle_targets(qstate, iq->dp); /* see if we can issue queries to get nameserver addresses */ @@ -1525,6 +1563,7 @@ processLastResort(struct module_qstate* if(query_count != 0) { /* suspend to await results */ verbose(VERB_ALGO, "try parent-side glue lookup"); iq->num_target_queries += query_count; + target_count_increase(iq, query_count); qstate->ext_state[id] = module_wait_subquery; return 0; } @@ -1680,6 +1719,7 @@ processQueryTargets(struct module_qstate return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += extra; + target_count_increase(iq, extra); if(iq->num_target_queries > 0) { /* wait to get all targets, we want to try em */ verbose(VERB_ALGO, "wait for all targets for fallback"); @@ -1720,6 +1760,7 @@ processQueryTargets(struct module_qstate /* errors ignored, these targets are not strictly necessary for * this result, we do not have to reply with SERVFAIL */ iq->num_target_queries += extra; + target_count_increase(iq, extra); } /* Add the current set of unused targets to our queue. */ @@ -1765,6 +1806,7 @@ processQueryTargets(struct module_qstate return 1; } iq->num_target_queries += qs; + target_count_increase(iq, qs); } /* Since a target query might have been made, we * need to check again. */ @@ -2847,6 +2889,8 @@ iter_clear(struct module_qstate* qstate, iq = (struct iter_qstate*)qstate->minfo[id]; if(iq) { outbound_list_clear(&iq->outlist); + if(iq->target_count && --iq->target_count[0] == 0) + free(iq->target_count); iq->num_current_queries = 0; } qstate->minfo[id] = NULL; Modified: releng/10.0/contrib/unbound/iterator/iterator.h ============================================================================== --- releng/10.0/contrib/unbound/iterator/iterator.h Wed Dec 17 06:58:00 2014 (r275853) +++ releng/10.0/contrib/unbound/iterator/iterator.h Wed Dec 17 06:59:47 2014 (r275854) @@ -52,6 +52,8 @@ struct iter_donotq; struct iter_prep_list; struct iter_priv; +/** max number of targets spawned for a query and its subqueries */ +#define MAX_TARGET_COUNT 32 /** max number of query restarts. Determines max number of CNAME chain. */ #define MAX_RESTART_COUNT 8 /** max number of referrals. Makes sure resolver does not run away */ @@ -254,6 +256,10 @@ struct iter_qstate { /** number of queries fired off */ int sent_count; + + /** number of target queries spawned in [1], for this query and its + * subqueries, the malloced-array is shared, [0] refcount. */ + int* target_count; /** * The query must store NS records from referrals as parentside RRs Modified: releng/10.0/sys/conf/newvers.sh ============================================================================== --- releng/10.0/sys/conf/newvers.sh Wed Dec 17 06:58:00 2014 (r275853) +++ releng/10.0/sys/conf/newvers.sh Wed Dec 17 06:59:47 2014 (r275854) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="RELEASE-p13" +BRANCH="RELEASE-p14" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.1/UPDATING ============================================================================== --- releng/10.1/UPDATING Wed Dec 17 06:58:00 2014 (r275853) +++ releng/10.1/UPDATING Wed Dec 17 06:59:47 2014 (r275854) @@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20141217: p2 FreeBSD-SA-14:30.unbound + Fix unbound remote denial of service vulnerability. + 20141210: p1 FreeBSD-SA-14:27.stdio FreeBSD-SA-14:28.file Modified: releng/10.1/contrib/unbound/iterator/iterator.c ============================================================================== --- releng/10.1/contrib/unbound/iterator/iterator.c Wed Dec 17 06:58:00 2014 (r275853) +++ releng/10.1/contrib/unbound/iterator/iterator.c Wed Dec 17 06:59:47 2014 (r275854) @@ -120,6 +120,7 @@ iter_new(struct module_qstate* qstate, i iq->query_restart_count = 0; iq->referral_count = 0; iq->sent_count = 0; + iq->target_count = NULL; iq->wait_priming_stub = 0; iq->refetch_glue = 0; iq->dnssec_expected = 0; @@ -445,6 +446,26 @@ handle_cname_response(struct module_qsta return 1; } +/** create target count structure for this query */ +static void +target_count_create(struct iter_qstate* iq) +{ + if(!iq->target_count) { + iq->target_count = (int*)calloc(2, sizeof(int)); + /* if calloc fails we simply do not track this number */ + if(iq->target_count) + iq->target_count[0] = 1; + } +} + +static void +target_count_increase(struct iter_qstate* iq, int num) +{ + target_count_create(iq); + if(iq->target_count) + iq->target_count[1] += num; +} + /** * Generate a subrequest. * Generate a local request event. Local events are tied to this module, and @@ -516,6 +537,10 @@ generate_sub_request(uint8_t* qname, siz subiq = (struct iter_qstate*)subq->minfo[id]; memset(subiq, 0, sizeof(*subiq)); subiq->num_target_queries = 0; + target_count_create(iq); + subiq->target_count = iq->target_count; + if(iq->target_count) + iq->target_count[0] ++; /* extra reference */ subiq->num_current_queries = 0; subiq->depth = iq->depth+1; outbound_list_init(&subiq->outlist); @@ -1342,6 +1367,12 @@ query_for_targets(struct module_qstate* if(iq->depth == ie->max_dependency_depth) return 0; + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return 0; + } iter_mark_cycle_targets(qstate, iq->dp); missing = (int)delegpt_count_missing_targets(iq->dp); @@ -1524,6 +1555,7 @@ processLastResort(struct module_qstate* return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += qs; + target_count_increase(iq, qs); if(qs != 0) { qstate->ext_state[id] = module_wait_subquery; return 0; /* and wait for them */ @@ -1533,6 +1565,12 @@ processLastResort(struct module_qstate* verbose(VERB_QUERY, "maxdepth and need more nameservers, fail"); return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); } + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); + } /* mark cycle targets for parent-side lookups */ iter_mark_pside_cycle_targets(qstate, iq->dp); /* see if we can issue queries to get nameserver addresses */ @@ -1562,6 +1600,7 @@ processLastResort(struct module_qstate* if(query_count != 0) { /* suspend to await results */ verbose(VERB_ALGO, "try parent-side glue lookup"); iq->num_target_queries += query_count; + target_count_increase(iq, query_count); qstate->ext_state[id] = module_wait_subquery; return 0; } @@ -1717,6 +1756,7 @@ processQueryTargets(struct module_qstate return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += extra; + target_count_increase(iq, extra); if(iq->num_target_queries > 0) { /* wait to get all targets, we want to try em */ verbose(VERB_ALGO, "wait for all targets for fallback"); @@ -1757,6 +1797,7 @@ processQueryTargets(struct module_qstate /* errors ignored, these targets are not strictly necessary for * this result, we do not have to reply with SERVFAIL */ iq->num_target_queries += extra; + target_count_increase(iq, extra); } /* Add the current set of unused targets to our queue. */ @@ -1802,6 +1843,7 @@ processQueryTargets(struct module_qstate return 1; } iq->num_target_queries += qs; + target_count_increase(iq, qs); } /* Since a target query might have been made, we * need to check again. */ @@ -2894,6 +2936,8 @@ iter_clear(struct module_qstate* qstate, iq = (struct iter_qstate*)qstate->minfo[id]; if(iq) { outbound_list_clear(&iq->outlist); + if(iq->target_count && --iq->target_count[0] == 0) + free(iq->target_count); iq->num_current_queries = 0; } qstate->minfo[id] = NULL; Modified: releng/10.1/contrib/unbound/iterator/iterator.h ============================================================================== --- releng/10.1/contrib/unbound/iterator/iterator.h Wed Dec 17 06:58:00 2014 (r275853) +++ releng/10.1/contrib/unbound/iterator/iterator.h Wed Dec 17 06:59:47 2014 (r275854) @@ -52,6 +52,8 @@ struct iter_donotq; struct iter_prep_list; struct iter_priv; +/** max number of targets spawned for a query and its subqueries */ +#define MAX_TARGET_COUNT 32 /** max number of query restarts. Determines max number of CNAME chain. */ #define MAX_RESTART_COUNT 8 /** max number of referrals. Makes sure resolver does not run away */ @@ -254,6 +256,10 @@ struct iter_qstate { /** number of queries fired off */ int sent_count; + + /** number of target queries spawned in [1], for this query and its + * subqueries, the malloced-array is shared, [0] refcount. */ + int* target_count; /** * The query must store NS records from referrals as parentside RRs Modified: releng/10.1/sys/conf/newvers.sh ============================================================================== --- releng/10.1/sys/conf/newvers.sh Wed Dec 17 06:58:00 2014 (r275853) +++ releng/10.1/sys/conf/newvers.sh Wed Dec 17 06:59:47 2014 (r275854) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 07:10:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC59A7D2; Wed, 17 Dec 2014 07:10:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A69435E6; Wed, 17 Dec 2014 07:10:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH7AooF003309; Wed, 17 Dec 2014 07:10:50 GMT (envelope-from gleb@FreeBSD.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH7AndY003302; Wed, 17 Dec 2014 07:10:49 GMT (envelope-from gleb@FreeBSD.org) Message-Id: <201412170710.sBH7AndY003302@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gleb set sender to gleb@FreeBSD.org using -f From: Gleb Kurtsou Date: Wed, 17 Dec 2014 07:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275855 - in head: sbin/ffsinfo usr.bin/id usr.bin/killall usr.sbin/lpr/lpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 07:10:50 -0000 Author: gleb Date: Wed Dec 17 07:10:48 2014 New Revision: 275855 URL: https://svnweb.freebsd.org/changeset/base/275855 Log: Adjust printf format specifiers for dev_t and ino_t in user space. ino_t and dev_t are about to become uint64_t. Reviewed by: kib, mckusick Modified: head/sbin/ffsinfo/ffsinfo.c head/usr.bin/id/id.c head/usr.bin/killall/killall.c head/usr.sbin/lpr/lpr/lpr.c Modified: head/sbin/ffsinfo/ffsinfo.c ============================================================================== --- head/sbin/ffsinfo/ffsinfo.c Wed Dec 17 06:59:47 2014 (r275854) +++ head/sbin/ffsinfo/ffsinfo.c Wed Dec 17 07:10:48 2014 (r275855) @@ -67,6 +67,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -361,7 +362,7 @@ dump_whole_ufs1_inode(ino_t inode, int l /* * Dump the main inode structure. */ - snprintf(comment, sizeof(comment), "Inode 0x%08x", inode); + snprintf(comment, sizeof(comment), "Inode 0x%08jx", (uintmax_t)inode); if (level & 0x100) { DBG_DUMP_INO(&sblock, comment, @@ -385,8 +386,8 @@ dump_whole_ufs1_inode(ino_t inode, int l (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } - snprintf(comment, sizeof(comment), "Inode 0x%08x: indirect 0", - inode); + snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 0", + (uintmax_t)inode); DBG_DUMP_IBLK(&sblock, comment, i1blk, @@ -401,8 +402,8 @@ dump_whole_ufs1_inode(ino_t inode, int l (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } - snprintf(comment, sizeof(comment), "Inode 0x%08x: indirect 1", - inode); + snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 1", + (uintmax_t)inode); DBG_DUMP_IBLK(&sblock, comment, i2blk, @@ -416,7 +417,8 @@ dump_whole_ufs1_inode(ino_t inode, int l err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), - "Inode 0x%08x: indirect 1->%d", inode, ind2ctr); + "Inode 0x%08jx: indirect 1->%d", (uintmax_t)inode, + ind2ctr); DBG_DUMP_IBLK(&sblock, comment, i1blk, @@ -432,8 +434,8 @@ dump_whole_ufs1_inode(ino_t inode, int l (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } - snprintf(comment, sizeof(comment), "Inode 0x%08x: indirect 2", - inode); + snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 2", + (uintmax_t)inode); #define SQUARE(a) ((a)*(a)) DBG_DUMP_IBLK(&sblock, comment, @@ -450,7 +452,8 @@ dump_whole_ufs1_inode(ino_t inode, int l err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), - "Inode 0x%08x: indirect 2->%d", inode, ind3ctr); + "Inode 0x%08jx: indirect 2->%d", (uintmax_t)inode, + ind3ctr); DBG_DUMP_IBLK(&sblock, comment, i2blk, @@ -466,8 +469,8 @@ dump_whole_ufs1_inode(ino_t inode, int l err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), - "Inode 0x%08x: indirect 2->%d->%d", inode, - ind3ctr, ind3ctr); + "Inode 0x%08jx: indirect 2->%d->%d", + (uintmax_t)inode, ind3ctr, ind3ctr); DBG_DUMP_IBLK(&sblock, comment, i1blk, @@ -513,7 +516,7 @@ dump_whole_ufs2_inode(ino_t inode, int l /* * Dump the main inode structure. */ - snprintf(comment, sizeof(comment), "Inode 0x%08x", inode); + snprintf(comment, sizeof(comment), "Inode 0x%08jx", (uintmax_t)inode); if (level & 0x100) { DBG_DUMP_INO(&sblock, comment, ino); } @@ -535,7 +538,8 @@ dump_whole_ufs2_inode(ino_t inode, int l (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } - snprintf(comment, sizeof(comment), "Inode 0x%08x: indirect 0", inode); + snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 0", + (uintmax_t)inode); DBG_DUMP_IBLK(&sblock, comment, i1blk, (size_t)rb); rb -= howmany(sblock.fs_bsize, sizeof(ufs2_daddr_t)); } @@ -547,7 +551,8 @@ dump_whole_ufs2_inode(ino_t inode, int l (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } - snprintf(comment, sizeof(comment), "Inode 0x%08x: indirect 1", inode); + snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 1", + (uintmax_t)inode); DBG_DUMP_IBLK(&sblock, comment, i2blk, @@ -561,7 +566,8 @@ dump_whole_ufs2_inode(ino_t inode, int l err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), - "Inode 0x%08x: indirect 1->%d", inode, ind2ctr); + "Inode 0x%08jx: indirect 1->%d", + (uintmax_t)inode, ind2ctr); DBG_DUMP_IBLK(&sblock, comment, i1blk, (size_t)rb); rb -= howmany(sblock.fs_bsize, sizeof(ufs2_daddr_t)); } @@ -574,7 +580,8 @@ dump_whole_ufs2_inode(ino_t inode, int l (size_t)sblock.fs_bsize) == -1) { err(1, "bread: %s", disk.d_error); } - snprintf(comment, sizeof(comment), "Inode 0x%08x: indirect 2", inode); + snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 2", + (uintmax_t)inode); #define SQUARE(a) ((a)*(a)) DBG_DUMP_IBLK(&sblock, comment, @@ -591,7 +598,8 @@ dump_whole_ufs2_inode(ino_t inode, int l err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), - "Inode 0x%08x: indirect 2->%d", inode, ind3ctr); + "Inode 0x%08jx: indirect 2->%d", + (uintmax_t)inode, ind3ctr); DBG_DUMP_IBLK(&sblock, comment, i2blk, @@ -605,8 +613,8 @@ dump_whole_ufs2_inode(ino_t inode, int l err(1, "bread: %s", disk.d_error); } snprintf(comment, sizeof(comment), - "Inode 0x%08x: indirect 2->%d->%d", inode, - ind3ctr, ind3ctr); + "Inode 0x%08jx: indirect 2->%d->%d", + (uintmax_t)inode, ind3ctr, ind3ctr); DBG_DUMP_IBLK(&sblock, comment, i1blk, (size_t)rb); rb -= howmany(sblock.fs_bsize, sizeof(ufs2_daddr_t)); } Modified: head/usr.bin/id/id.c ============================================================================== --- head/usr.bin/id/id.c Wed Dec 17 06:59:47 2014 (r275854) +++ head/usr.bin/id/id.c Wed Dec 17 07:10:48 2014 (r275855) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -346,14 +347,14 @@ auditid(void) "mask.success=0x%08x\n" "mask.failure=0x%08x\n" "asid=%d\n" - "termid_addr.port=0x%08x\n" + "termid_addr.port=0x%08jx\n" "termid_addr.addr[0]=0x%08x\n" "termid_addr.addr[1]=0x%08x\n" "termid_addr.addr[2]=0x%08x\n" "termid_addr.addr[3]=0x%08x\n", ainfo_addr.ai_auid, ainfo_addr.ai_mask.am_success, ainfo_addr.ai_mask.am_failure, ainfo_addr.ai_asid, - ainfo_addr.ai_termid.at_port, + (uintmax_t)ainfo_addr.ai_termid.at_port, ainfo_addr.ai_termid.at_addr[0], ainfo_addr.ai_termid.at_addr[1], ainfo_addr.ai_termid.at_addr[2], @@ -363,11 +364,11 @@ auditid(void) "mask.success=0x%08x\n" "mask.failure=0x%08x\n" "asid=%d\n" - "termid.port=0x%08x\n" + "termid.port=0x%08jx\n" "termid.machine=0x%08x\n", auditinfo.ai_auid, auditinfo.ai_mask.am_success, auditinfo.ai_mask.am_failure, - auditinfo.ai_asid, auditinfo.ai_termid.port, + auditinfo.ai_asid, (uintmax_t)auditinfo.ai_termid.port, auditinfo.ai_termid.machine); } } Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Wed Dec 17 06:59:47 2014 (r275854) +++ head/usr.bin/killall/killall.c Wed Dec 17 07:10:48 2014 (r275855) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -262,7 +263,7 @@ main(int ac, char **av) errx(1, "%s: not a character device", buf); tdev = sb.st_rdev; if (dflag) - printf("ttydev:0x%x\n", tdev); + printf("ttydev:0x%jx\n", (uintmax_t)tdev); } if (user) { uid = strtol(user, &ep, 10); @@ -410,8 +411,9 @@ main(int ac, char **av) if (matched == 0) continue; if (dflag) - printf("sig:%d, cmd:%s, pid:%d, dev:0x%x uid:%d\n", sig, - thiscmd, thispid, thistdev, thisuid); + printf("sig:%d, cmd:%s, pid:%d, dev:0x%jx uid:%d\n", + sig, thiscmd, thispid, (uintmax_t)thistdev, + thisuid); if (vflag || sflag) printf("kill -%s %d\n", sys_signame[sig], thispid); Modified: head/usr.sbin/lpr/lpr/lpr.c ============================================================================== --- head/usr.sbin/lpr/lpr/lpr.c Wed Dec 17 06:59:47 2014 (r275854) +++ head/usr.sbin/lpr/lpr/lpr.c Wed Dec 17 07:10:48 2014 (r275855) @@ -387,8 +387,8 @@ main(int argc, char *argv[]) continue; /* file unreasonable */ if (sflag && (cp = linked(arg)) != NULL) { - (void)snprintf(buf, sizeof(buf), "%u %ju", - statb.st_dev, (uintmax_t)statb.st_ino); + (void)snprintf(buf, sizeof(buf), "%ju %ju", + (uintmax_t)statb.st_dev, (uintmax_t)statb.st_ino); card('S', buf); if (format == 'p') card('T', title ? title : arg); From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 07:27:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A41CD6D; Wed, 17 Dec 2014 07:27:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2ACBD793; Wed, 17 Dec 2014 07:27:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH7RNZw009657; Wed, 17 Dec 2014 07:27:23 GMT (envelope-from gleb@FreeBSD.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH7RKHt009640; Wed, 17 Dec 2014 07:27:20 GMT (envelope-from gleb@FreeBSD.org) Message-Id: <201412170727.sBH7RKHt009640@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gleb set sender to gleb@FreeBSD.org using -f From: Gleb Kurtsou Date: Wed, 17 Dec 2014 07:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275856 - in head/sys: compat/linprocfs compat/svr4 dev/drm dev/drm2 fs/ext2fs kern security/mac_lomac ufs/ffs ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 07:27:23 -0000 Author: gleb Date: Wed Dec 17 07:27:19 2014 New Revision: 275856 URL: https://svnweb.freebsd.org/changeset/base/275856 Log: Adjust printf format specifiers for dev_t and ino_t in kernel. ino_t and dev_t are about to become uint64_t. Reviewed by: kib, mckusick Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/svr4/svr4_socket.c head/sys/dev/drm/drm_sysctl.c head/sys/dev/drm2/drm_sysctl.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/kern/kern_conf.c head/sys/security/mac_lomac/mac_lomac.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/compat/linprocfs/linprocfs.c Wed Dec 17 07:27:19 2014 (r275856) @@ -674,7 +674,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS) PS_ADD("pgrp", "%d", p->p_pgid); PS_ADD("session", "%d", p->p_session->s_sid); PROC_UNLOCK(p); - PS_ADD("tty", "%d", kp.ki_tdev); + PS_ADD("tty", "%ju", (uintmax_t)kp.ki_tdev); PS_ADD("tpgid", "%d", kp.ki_tpgid); PS_ADD("flags", "%u", 0); /* XXX */ PS_ADD("minflt", "%lu", kp.ki_rusage.ru_minflt); Modified: head/sys/compat/svr4/svr4_socket.c ============================================================================== --- head/sys/compat/svr4/svr4_socket.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/compat/svr4/svr4_socket.c Wed Dec 17 07:27:19 2014 (r275856) @@ -93,7 +93,8 @@ svr4_find_socket(td, fp, dev, ino, saun) struct svr4_sockcache_entry *e; void *cookie = ((struct socket *)fp->f_data)->so_emuldata; - DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", td, dev, ino)); + DPRINTF(("svr4_find_socket: [%p,%ju,%ju]: ", td, (uintmax_t)dev, + (uintmax_t)ino)); mtx_lock(&svr4_sockcache_lock); TAILQ_FOREACH(e, &svr4_head, entries) if (e->p == td->td_proc && e->dev == dev && e->ino == ino) { @@ -142,8 +143,8 @@ svr4_add_socket(td, path, st) mtx_lock(&svr4_sockcache_lock); TAILQ_INSERT_HEAD(&svr4_head, e, entries); mtx_unlock(&svr4_sockcache_lock); - DPRINTF(("svr4_add_socket: %s [%p,%d,%d]\n", e->sock.sun_path, - td->td_proc, e->dev, e->ino)); + DPRINTF(("svr4_add_socket: %s [%p,%ju,%ju]\n", e->sock.sun_path, + td->td_proc, (uintmax_t)e->dev, (uintmax_t)e->ino)); return 0; } @@ -160,8 +161,9 @@ svr4_delete_socket(p, fp) if (e->p == p && e->cookie == cookie) { TAILQ_REMOVE(&svr4_head, e, entries); mtx_unlock(&svr4_sockcache_lock); - DPRINTF(("svr4_delete_socket: %s [%p,%d,%d]\n", - e->sock.sun_path, p, (int)e->dev, e->ino)); + DPRINTF(("svr4_delete_socket: %s [%p,%ju,%ju]\n", + e->sock.sun_path, p, (uintmax_t)e->dev, + (uintmax_t)e->ino)); free(e, M_TEMP); return; } @@ -179,8 +181,9 @@ svr4_purge_sockcache(arg, p) TAILQ_FOREACH_SAFE(e, &svr4_head, entries, ne) { if (e->p == p) { TAILQ_REMOVE(&svr4_head, e, entries); - DPRINTF(("svr4_purge_sockcache: %s [%p,%d,%d]\n", - e->sock.sun_path, p, (int)e->dev, e->ino)); + DPRINTF(("svr4_purge_sockcache: %s [%p,%ju,%ju]\n", + e->sock.sun_path, p, (uintmax_t)e->dev, + (uintmax_t)e->ino)); free(e, M_TEMP); } } Modified: head/sys/dev/drm/drm_sysctl.c ============================================================================== --- head/sys/dev/drm/drm_sysctl.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/dev/drm/drm_sysctl.c Wed Dec 17 07:27:19 2014 (r275856) @@ -137,8 +137,9 @@ static int drm_name_info DRM_SYSCTL_HAND int retcode; int hasunique = 0; - DRM_SYSCTL_PRINT("%s 0x%x", dev->driver->name, dev2udev(dev->devnode)); - + DRM_SYSCTL_PRINT("%s 0x%jx", dev->driver->name, + (uintmax_t)dev2udev(dev->devnode)); + DRM_LOCK(); if (dev->unique) { snprintf(buf, sizeof(buf), " %s", dev->unique); Modified: head/sys/dev/drm2/drm_sysctl.c ============================================================================== --- head/sys/dev/drm2/drm_sysctl.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/dev/drm2/drm_sysctl.c Wed Dec 17 07:27:19 2014 (r275856) @@ -155,7 +155,8 @@ static int drm_name_info DRM_SYSCTL_HAND int retcode; int hasunique = 0; - DRM_SYSCTL_PRINT("%s 0x%x", dev->driver->name, dev2udev(dev->devnode)); + DRM_SYSCTL_PRINT("%s 0x%jx", dev->driver->name, + (uintmax_t)dev2udev(dev->devnode)); DRM_LOCK(dev); if (dev->unique) { Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 17 07:27:19 2014 (r275856) @@ -264,8 +264,8 @@ ext2_reallocblks(struct vop_reallocblks_ * with the file. */ #ifdef DEBUG - printf("realloc: ino %d, lbns %jd-%jd\n\told:", ip->i_number, - (intmax_t)start_lbn, (intmax_t)end_lbn); + printf("realloc: ino %ju, lbns %jd-%jd\n\told:", + (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); #endif /* DEBUG */ blkno = newblk; for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) { @@ -968,8 +968,8 @@ ext2_blkfree(struct inode *ip, e4fs_dadd ump = ip->i_ump; cg = dtog(fs, bno); if ((u_int)bno >= fs->e2fs->e2fs_bcount) { - printf("bad block %lld, ino %llu\n", (long long)bno, - (unsigned long long)ip->i_number); + printf("bad block %lld, ino %ju\n", (long long)bno, + (uintmax_t)ip->i_number); ext2_fserr(fs, ip->i_uid, "bad block"); return; } Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/fs/ext2fs/ext2_lookup.c Wed Dec 17 07:27:19 2014 (r275856) @@ -801,11 +801,13 @@ ext2_dirbad(struct inode *ip, doff_t off mp = ITOV(ip)->v_mount; if ((mp->mnt_flag & MNT_RDONLY) == 0) - panic("ext2_dirbad: %s: bad dir ino %lu at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (u_long)ip->i_number,(long)offset, how); + panic("ext2_dirbad: %s: bad dir ino %ju at offset %ld: %s\n", + mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, + (long)offset, how); else - (void)printf("%s: bad dir ino %lu at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (u_long)ip->i_number, (long)offset, how); + (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", + mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, + (long)offset, how); } Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Dec 17 07:27:19 2014 (r275856) @@ -1366,7 +1366,7 @@ ext2_print(struct vop_print_args *ap) struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); - vn_printf(ip->i_devvp, "\tino %lu", (u_long)ip->i_number); + vn_printf(ip->i_devvp, "\tino %ju", (uintmax_t)ip->i_number); if (vp->v_type == VFIFO) fifo_printinfo(vp); printf("\n"); Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/kern/kern_conf.c Wed Dec 17 07:27:19 2014 (r275856) @@ -1292,7 +1292,8 @@ clone_cleanup(struct clonedevs **cdp) if (!(cp->cdp_flags & CDP_SCHED_DTR)) { cp->cdp_flags |= CDP_SCHED_DTR; KASSERT(dev->si_flags & SI_NAMED, - ("Driver has goofed in cloning underways udev %x unit %x", dev2udev(dev), dev2unit(dev))); + ("Driver has goofed in cloning underways udev %jx unit %x", + (uintmax_t)dev2udev(dev), dev2unit(dev))); destroy_devl(dev); } } Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/security/mac_lomac/mac_lomac.c Wed Dec 17 07:27:19 2014 (r275856) @@ -559,11 +559,11 @@ maybe_demote(struct mac_lomac *subjlabel pgid = p->p_pgrp->pg_id; /* XXX could be stale? */ if (vp != NULL && VOP_GETATTR(vp, &va, curthread->td_ucred) == 0) { log(LOG_INFO, "LOMAC: level-%s subject p%dg%du%d:%s demoted to" - " level %s after %s a level-%s %s (inode=%ld, " + " level %s after %s a level-%s %s (inode=%ju, " "mountpount=%s)\n", subjlabeltext, p->p_pid, pgid, curthread->td_ucred->cr_uid, p->p_comm, subjtext, actionname, objlabeltext, objname, - va.va_fileid, vp->v_mount->mnt_stat.f_mntonname); + (uintmax_t)va.va_fileid, vp->v_mount->mnt_stat.f_mntonname); } else { log(LOG_INFO, "LOMAC: level-%s subject p%dg%du%d:%s demoted to" " level %s after %s a level-%s %s\n", Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Dec 17 07:27:19 2014 (r275856) @@ -845,7 +845,7 @@ ffs_reallocblks_ufs2(ap) */ #ifdef DEBUG if (prtrealloc) - printf("realloc: ino %d, lbns %jd-%jd\n\told:", ip->i_number, + printf("realloc: ino %ju, lbns %jd-%jd\n\told:", (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); #endif blkno = newblk; @@ -1029,8 +1029,8 @@ retry: ip = VTOI(*vpp); if (ip->i_mode) { dup_alloc: - printf("mode = 0%o, inum = %lu, fs = %s\n", - ip->i_mode, (u_long)ip->i_number, fs->fs_fsmnt); + printf("mode = 0%o, inum = %ju, fs = %s\n", + ip->i_mode, (uintmax_t)ip->i_number, fs->fs_fsmnt); panic("ffs_valloc: dup alloc"); } if (DIP(ip, i_blocks) && (fs->fs_flags & FS_UNCLEAN) == 0) { /* XXX */ Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/ufs/ufs/ufs_lookup.c Wed Dec 17 07:27:19 2014 (r275856) @@ -1475,7 +1475,8 @@ ufs_checkpath(ino_t source_ino, ino_t pa } } KASSERT(dd_ino == VTOI(vp1)->i_number, - ("directory %d reparented\n", VTOI(vp1)->i_number)); + ("directory %ju reparented\n", + (uintmax_t)VTOI(vp1)->i_number)); if (vp != tvp) vput(vp); vp = vp1; From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 07:47:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24CC214B; Wed, 17 Dec 2014 07:47:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 105A6932; Wed, 17 Dec 2014 07:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH7lQV5019229; Wed, 17 Dec 2014 07:47:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH7lQQp019228; Wed, 17 Dec 2014 07:47:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412170747.sBH7lQQp019228@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Dec 2014 07:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275857 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 07:47:27 -0000 Author: tuexen Date: Wed Dec 17 07:47:25 2014 New Revision: 275857 URL: https://svnweb.freebsd.org/changeset/base/275857 Log: Initilize the msg_flags field consistently in all code paths. Reported by: Coverity CID: 1018726 Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Wed Dec 17 07:27:19 2014 (r275856) +++ head/lib/libc/net/sctp_sys_calls.c Wed Dec 17 07:47:25 2014 (r275857) @@ -597,6 +597,7 @@ sctp_sendmsg(int s, msg.msg_iovlen = 1; msg.msg_control = cmsgbuf; msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + msg.msg_flags = 0; cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; @@ -663,6 +664,7 @@ sctp_send(int sd, const void *data, size msg.msg_iovlen = 1; msg.msg_control = cmsgbuf; msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + msg.msg_flags = 0; cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; @@ -820,7 +822,6 @@ sctp_recvmsg(int s, errno = EINVAL; return (-1); } - msg.msg_flags = 0; iov.iov_base = dbuf; iov.iov_len = len; msg.msg_name = (caddr_t)from; @@ -832,6 +833,7 @@ sctp_recvmsg(int s, msg.msg_iovlen = 1; msg.msg_control = cmsgbuf; msg.msg_controllen = sizeof(cmsgbuf); + msg.msg_flags = 0; sz = recvmsg(s, &msg, *msg_flags); *msg_flags = msg.msg_flags; if (sz <= 0) { @@ -905,6 +907,7 @@ sctp_recvv(int sd, msg.msg_iovlen = iovlen; msg.msg_control = cmsgbuf; msg.msg_controllen = sizeof(cmsgbuf); + msg.msg_flags = 0; ret = recvmsg(sd, &msg, *flags); *flags = msg.msg_flags; if ((ret > 0) && From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 10:54:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D10A0EEC; Wed, 17 Dec 2014 10:54:32 +0000 (UTC) Received: from svn.freebsd.org (unknown [IPv6:2001:1900:2254:2068::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 2B7AA122C; Wed, 17 Dec 2014 09:35:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBH9YtiE071809; Wed, 17 Dec 2014 09:34:55 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH9Ytqp071808; Wed, 17 Dec 2014 09:34:55 GMT (envelope-from br@FreeBSD.org) Message-Id: <201412170934.sBH9Ytqp071808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Dec 2014 09:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275858 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 10:54:32 -0000 Author: br Date: Wed Dec 17 09:34:54 2014 New Revision: 275858 URL: https://svnweb.freebsd.org/changeset/base/275858 Log: Use memory regions information provided in FDT. Reviewed by: brooks Sponsored by: DARPA, AFRL Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Wed Dec 17 07:47:25 2014 (r275857) +++ head/sys/mips/beri/beri_machdep.c Wed Dec 17 09:34:54 2014 (r275858) @@ -88,6 +88,11 @@ static void mips_init(void) { int i; +#ifdef FDT + struct mem_region mr[FDT_MEM_REGIONS]; + int mr_cnt, val; + int j; +#endif for (i = 0; i < 10; i++) { phys_avail[i] = 0; @@ -102,6 +107,29 @@ mips_init(void) physmem = realmem; +#ifdef FDT + if (fdt_get_mem_regions(mr, &mr_cnt, &val) == 0) { + + physmem = btoc(val); + + KASSERT((phys_avail[0] >= mr[0].mr_start) && \ + (phys_avail[0] < (mr[0].mr_start + mr[0].mr_size)), + ("First region is not within FDT memory range")); + + /* Limit size of the first region */ + phys_avail[1] = MIN(mr[0].mr_size, ctob(realmem)); + dump_avail[1] = phys_avail[1]; + + /* Add the rest of regions */ + for (i = 1, j = 2; i < mr_cnt; i++, j+=2) { + phys_avail[j] = mr[i].mr_start; + phys_avail[j+1] = mr[i].mr_size; + dump_avail[j] = phys_avail[j]; + dump_avail[j+1] = phys_avail[j+1]; + } + } +#endif + init_param1(); init_param2(physmem); mips_cpu_init(); From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 10:54:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C0B1F04; Wed, 17 Dec 2014 10:54:33 +0000 (UTC) Received: from svn.freebsd.org (unknown [IPv6:2001:1900:2254:2068::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 5C5E419F6; Wed, 17 Dec 2014 10:49:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHAms5l006447; Wed, 17 Dec 2014 10:48:54 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHAms4i006446; Wed, 17 Dec 2014 10:48:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <201412171048.sBHAms4i006446@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Dec 2014 10:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275859 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 10:54:33 -0000 Author: br Date: Wed Dec 17 10:48:53 2014 New Revision: 275859 URL: https://svnweb.freebsd.org/changeset/base/275859 Log: o Add PIO[2,3] devices information o Enable Virtio Block Modified: head/sys/boot/fdt/dts/arm/socfpga-sockit-beri.dts Modified: head/sys/boot/fdt/dts/arm/socfpga-sockit-beri.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/socfpga-sockit-beri.dts Wed Dec 17 09:34:54 2014 (r275858) +++ head/sys/boot/fdt/dts/arm/socfpga-sockit-beri.dts Wed Dec 17 10:48:53 2014 (r275859) @@ -106,20 +106,36 @@ status = "okay"; }; + pio2: pio@c0022000 { + compatible = "altr,pio"; + reg = <0xc0022000 0x1000>; /* recv */ + interrupts = < 77 >; + interrupt-parent = <&GIC>; + status = "okay"; + }; + + pio3: pio@c0023000 { + compatible = "altr,pio"; + reg = <0xc0023000 0x1000>; /* send */ + interrupts = < 83 >; /* not in use on arm side */ + interrupt-parent = <&GIC>; + status = "okay"; + }; + beri_vtblk: vtblk@00001000 { compatible = "sri-cambridge,beri-vtblk"; reg = <0x00001000 0x1000>; pio-recv = <&pio0>; pio-send = <&pio1>; beri-mem = <&beri_mem0>; - status = "disabled"; + status = "okay"; }; beri_vtnet: vtnet@00002000 { compatible = "sri-cambridge,beri-vtnet"; reg = <0x00002000 0x1000>; - pio-recv = <&pio0>; - pio-send = <&pio1>; + pio-recv = <&pio2>; + pio-send = <&pio3>; beri-mem = <&beri_mem0>; status = "okay"; }; From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 11:05:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 918A81390; Wed, 17 Dec 2014 11:05:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 63B505E6; Wed, 17 Dec 2014 11:05:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHB5kU3015672; Wed, 17 Dec 2014 11:05:46 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHB5jPA015669; Wed, 17 Dec 2014 11:05:45 GMT (envelope-from br@FreeBSD.org) Message-Id: <201412171105.sBHB5jPA015669@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Dec 2014 11:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275860 - head/sys/boot/fdt/dts/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 11:05:46 -0000 Author: br Date: Wed Dec 17 11:05:44 2014 New Revision: 275860 URL: https://svnweb.freebsd.org/changeset/base/275860 Log: Move memory node to the root, so fdt_get_mem_regions() can find it. Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts head/sys/boot/fdt/dts/mips/beri-sim.dts head/sys/boot/fdt/dts/mips/beripad-de4.dts Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Wed Dec 17 10:48:53 2014 (r275859) +++ head/sys/boot/fdt/dts/mips/beri-netfpga.dts Wed Dec 17 11:05:44 2014 (r275860) @@ -82,6 +82,11 @@ */ }; + memory { + device_type = "memory"; + reg = <0x0 0x0FFFFFFF>; // ~256M at 0x0 + }; + soc { #address-cells = <1>; #size-cells = <1>; @@ -94,11 +99,6 @@ compatible = "simple-bus", "mips,mips4k"; ranges = <>; - memory { - device_type = "memory"; - reg = <0x0 0x0FFFFFFF>; // ~256M at 0x0 - }; - beripic: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-sim.dts Wed Dec 17 10:48:53 2014 (r275859) +++ head/sys/boot/fdt/dts/mips/beri-sim.dts Wed Dec 17 11:05:44 2014 (r275860) @@ -80,6 +80,11 @@ */ }; + memory { + device_type = "memory"; + reg = <0x0 0x4000000>; // 64M at 0x0 + }; + soc { #address-cells = <1>; #size-cells = <1>; @@ -92,11 +97,6 @@ compatible = "simple-bus", "mips,mips4k"; ranges = <>; - memory { - device_type = "memory"; - reg = <0x0 0x4000000>; // 64M at 0x0 - }; - beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-de4.dts Wed Dec 17 10:48:53 2014 (r275859) +++ head/sys/boot/fdt/dts/mips/beripad-de4.dts Wed Dec 17 11:05:44 2014 (r275860) @@ -80,6 +80,11 @@ */ }; + memory { + device_type = "memory"; + reg = <0x0 0x40000000>; // 1G at 0x0 + }; + soc { #address-cells = <1>; #size-cells = <1>; @@ -92,11 +97,6 @@ compatible = "simple-bus", "mips,mips4k"; ranges = <>; - memory { - device_type = "memory"; - reg = <0x0 0x40000000>; // 1G at 0x0 - }; - beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 11:36:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E45452F; Wed, 17 Dec 2014 11:36:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F3C39B85; Wed, 17 Dec 2014 11:36:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHBaW7Y030675; Wed, 17 Dec 2014 11:36:32 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHBaWf4030671; Wed, 17 Dec 2014 11:36:32 GMT (envelope-from br@FreeBSD.org) Message-Id: <201412171136.sBHBaWf4030671@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Dec 2014 11:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275861 - in head/sys: boot/fdt/dts/mips mips/beri mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 11:36:33 -0000 Author: br Date: Wed Dec 17 11:36:31 2014 New Revision: 275861 URL: https://svnweb.freebsd.org/changeset/base/275861 Log: Add configuration files for BERI soft-core synthesized on Terasic SoCKit board (Altera FPGA). Use virtio block as root filesystem device. Sponsored by: DARPA, AFRL Added: head/sys/boot/fdt/dts/mips/beripad-sockit.dts (contents, props changed) head/sys/mips/conf/BERI_SOCKIT (contents, props changed) Modified: head/sys/mips/beri/files.beri Added: head/sys/boot/fdt/dts/mips/beripad-sockit.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/mips/beripad-sockit.dts Wed Dec 17 11:36:31 2014 (r275861) @@ -0,0 +1,219 @@ +/*- + * Copyright (c) 2012-2013 Robert N. M. Watson + * Copyright (c) 2013-2014 SRI International + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/* + * Device names here have been largely made up on the spot, especially for the + * "compatible" strings, and might want to be revised. + */ + +/ { + model = "SRI/Cambridge BeriPad (SoCKit)"; + compatible = "sri-cambridge,beripad-sockit"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <1>; + + /* + * Secondary CPUs all start disabled and use the + * spin-table enable method. cpu-release-addr must be + * specified for each cpu other than cpu@0. Values of + * cpu-release-addr grow down from 0x100000 (kernel). + */ + status = "disabled"; + enable-method = "spin-table"; + + cpu@0 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <0 1>; + status = "okay"; + }; + +/* + cpu@1 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <1 1>; + // XXX: should we need cached prefix? + cpu-release-addr = <0xffffffff 0x800fffe0>; + }; +*/ + }; + + memory { + device_type = "memory"; + reg = <0x0 0x10000000>; /* 256MB at 0x0 */ + }; + + soc { + #address-cells = <2>; + #size-cells = <2>; + #interrupt-cells = <1>; + + /* + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so + * we use mips4k coprocessor 0 interrupt management directly. + */ + compatible = "simple-bus", "mips,mips4k"; + /* ranges = <>; */ + + beripic0: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x0 0x7f804000 0x0 0x400 + 0x0 0x7f806000 0x0 0x10 + 0x0 0x7f806080 0x0 0x10 + 0x0 0x7f806100 0x0 0x10>; + interrupts = <0 1 2 3 4>; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + }; + + pio0: pio@7f020000 { + compatible = "altr,pio"; + reg = <0x0 0x7f020000 0x0 0x1000>; /* send */ + interrupts = <4>; /* not used */ + interrupt-parent = <&beripic0>; + }; + + pio1: pio@7f021000 { + compatible = "altr,pio"; + reg = <0x0 0x7f021000 0x0 0x1000>; /* recv */ + interrupts = <10>; + interrupt-parent = <&beripic0>; + }; + + pio2: pio@7f022000 { + compatible = "altr,pio"; + reg = <0x0 0x7f022000 0x0 0x1000>; /* send */ + interrupts = <5>; /* not used */ + interrupt-parent = <&beripic0>; + }; + + pio3: pio@7f023000 { + compatible = "altr,pio"; + reg = <0x0 0x7f023000 0x0 0x1000>; /* recv */ + interrupts = <11>; + interrupt-parent = <&beripic0>; + }; + + virtio_mmio_platform0: virtio_mmio_platform@0 { + compatible = "beri,virtio_mmio_platform"; + pio-send = <&pio0>; + pio-recv = <&pio1>; + }; + + virtio_mmio_platform1: virtio_mmio_platform@1 { + compatible = "beri,virtio_mmio_platform"; + pio-send = <&pio2>; + pio-recv = <&pio3>; + }; + + virtio_block@200001000 { + compatible = "virtio,mmio"; + reg = <0x2 0x1000 0x0 0x1000>; + platform = <&virtio_mmio_platform0>; + status = "okay"; + }; + + virtio_net@200002000 { + compatible = "virtio,mmio"; + reg = <0x2 0x2000 0x0 0x1000>; + platform = <&virtio_mmio_platform1>; + status = "okay"; + }; + + serial@7f000000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x0 0x7f000000 0x0 0x40>; + interrupts = <0>; + interrupt-parent = <&beripic0>; + }; + +/* + serial@7f001000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f001000 0x40>; + }; + + serial@7f002000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f002000 0x40>; + }; +*/ + +/* + led@7f006000 { + compatible = "sri-cambridge,de4led"; + reg = <0x7f006000 0x1>; + }; +*/ + +/* + avgen@0x7f009000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f009000 0x2>; + sri-cambridge,width = <1>; + sri-cambridge,fileio = "r"; + sri-cambridge,devname = "de4bsw"; + }; +*/ + +/* + berirom@0x7f00a000 { + compatible = "sri-cambridge,berirom"; + reg = <0x7f00a000 0x1000>; + }; +*/ + +/* + avgen@0x7f00c000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f00c000 0x8>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,devname = "de4tempfan"; + }; +*/ + }; +}; Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Wed Dec 17 11:05:44 2014 (r275860) +++ head/sys/mips/beri/files.beri Wed Dec 17 11:36:31 2014 (r275861) @@ -6,6 +6,7 @@ dev/altera/jtag_uart/altera_jtag_uart_co dev/altera/jtag_uart/altera_jtag_uart_tty.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_fdt.c optional altera_jtag_uart fdt dev/altera/jtag_uart/altera_jtag_uart_nexus.c optional altera_jtag_uart +dev/beri/virtio/virtio_mmio_platform.c optional virtio_mmio dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c optional netfpga10g_nf10bmac fdt dev/netfpga10g/nf10bmac/if_nf10bmac.c optional netfpga10g_nf10bmac dev/terasic/de4led/terasic_de4led.c optional terasic_de4led Added: head/sys/mips/conf/BERI_SOCKIT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_SOCKIT Wed Dec 17 11:36:31 2014 (r275861) @@ -0,0 +1,26 @@ +# +# BERI_SOCKIT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured in its Terasic SoCKit +# reference configuration. This kernel configration must be further +# specialized to to include a root filesystem specification. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_SOCKIT + +options ROOTDEVNAME=\"ufs:vtbd0\" + +device altera_pio +device altera_jtag_uart + +device virtio +device virtio_blk +device vtnet +device virtio_mmio + +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beripad-sockit.dts From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 12:51:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 027E73BA; Wed, 17 Dec 2014 12:51:23 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (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 CB70E84D; Wed, 17 Dec 2014 12:51:22 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Y1E4R-000Ox6-IF; Wed, 17 Dec 2014 12:51:15 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sBHCpEP8055318; Wed, 17 Dec 2014 05:51:14 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+mVjhshGl7AanqaiB2pL3s Message-ID: <1418820674.1015.14.camel@freebsd.org> Subject: Re: svn commit: r275858 - head/sys/mips/beri From: Ian Lepore To: Ruslan Bukin Date: Wed, 17 Dec 2014 05:51:14 -0700 In-Reply-To: <201412170934.sBH9Ytqp071808@svn.freebsd.org> References: <201412170934.sBH9Ytqp071808@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 12:51:23 -0000 On Wed, 2014-12-17 at 09:34 +0000, Ruslan Bukin wrote: > Author: br > Date: Wed Dec 17 09:34:54 2014 > New Revision: 275858 > URL: https://svnweb.freebsd.org/changeset/base/275858 > > Log: > Use memory regions information provided in FDT. > > Reviewed by: brooks > Sponsored by: DARPA, AFRL > > Modified: > head/sys/mips/beri/beri_machdep.c > > Modified: head/sys/mips/beri/beri_machdep.c > ============================================================================== > --- head/sys/mips/beri/beri_machdep.c Wed Dec 17 07:47:25 2014 (r275857) > +++ head/sys/mips/beri/beri_machdep.c Wed Dec 17 09:34:54 2014 (r275858) > @@ -88,6 +88,11 @@ static void > mips_init(void) > { > int i; > +#ifdef FDT > + struct mem_region mr[FDT_MEM_REGIONS]; > + int mr_cnt, val; > + int j; > +#endif > > for (i = 0; i < 10; i++) { > phys_avail[i] = 0; > @@ -102,6 +107,29 @@ mips_init(void) > > physmem = realmem; > > +#ifdef FDT > + if (fdt_get_mem_regions(mr, &mr_cnt, &val) == 0) { > + > + physmem = btoc(val); > + > + KASSERT((phys_avail[0] >= mr[0].mr_start) && \ > + (phys_avail[0] < (mr[0].mr_start + mr[0].mr_size)), > + ("First region is not within FDT memory range")); > + > + /* Limit size of the first region */ > + phys_avail[1] = MIN(mr[0].mr_size, ctob(realmem)); > + dump_avail[1] = phys_avail[1]; > + > + /* Add the rest of regions */ > + for (i = 1, j = 2; i < mr_cnt; i++, j+=2) { > + phys_avail[j] = mr[i].mr_start; > + phys_avail[j+1] = mr[i].mr_size; > + dump_avail[j] = phys_avail[j]; > + dump_avail[j+1] = phys_avail[j+1]; > + } > + } > +#endif > + > init_param1(); > init_param2(physmem); > mips_cpu_init(); > This doesn't look right, the values in the odd-numbered array slots for phys_avail and dump_avail need to be addresses, not sizes. That is, avail[j] = start, avail[j+1] = start+size (note: not start+size-1). -- Ian From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 13:39:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D04318B; Wed, 17 Dec 2014 13:39:53 +0000 (UTC) Received: from bsdpad.com (xc1.bsdpad.com [195.154.136.64]) (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 22FA9D27; Wed, 17 Dec 2014 13:39:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bsdpad.com) by bsdpad.com with smtp (Exim 4.83 (FreeBSD)) (envelope-from ) id 1Y1EmD-0007fG-CV; Wed, 17 Dec 2014 13:36:29 +0000 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Wed, 17 Dec 2014 13:36:29 +0000 (GMT) Date: Wed, 17 Dec 2014 13:36:29 +0000 From: Ruslan Bukin To: Ian Lepore Subject: Re: svn commit: r275858 - head/sys/mips/beri Message-ID: <20141217133629.GA29458@bsdpad.com> References: <201412170934.sBH9Ytqp071808@svn.freebsd.org> <1418820674.1015.14.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1418820674.1015.14.camel@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 13:39:53 -0000 On Wed, Dec 17, 2014 at 05:51:14AM -0700, Ian Lepore wrote: > > Modified: head/sys/mips/beri/beri_machdep.c > > ============================================================================== > > --- head/sys/mips/beri/beri_machdep.c Wed Dec 17 07:47:25 2014 (r275857) > > +++ head/sys/mips/beri/beri_machdep.c Wed Dec 17 09:34:54 2014 (r275858) > > @@ -88,6 +88,11 @@ static void > > mips_init(void) > > { > > int i; > > +#ifdef FDT > > + struct mem_region mr[FDT_MEM_REGIONS]; > > + int mr_cnt, val; > > + int j; > > +#endif > > > > for (i = 0; i < 10; i++) { > > phys_avail[i] = 0; > > @@ -102,6 +107,29 @@ mips_init(void) > > > > physmem = realmem; > > > > +#ifdef FDT > > + if (fdt_get_mem_regions(mr, &mr_cnt, &val) == 0) { > > + > > + physmem = btoc(val); > > + > > + KASSERT((phys_avail[0] >= mr[0].mr_start) && \ > > + (phys_avail[0] < (mr[0].mr_start + mr[0].mr_size)), > > + ("First region is not within FDT memory range")); > > + > > + /* Limit size of the first region */ > > + phys_avail[1] = MIN(mr[0].mr_size, ctob(realmem)); > > + dump_avail[1] = phys_avail[1]; > > + > > + /* Add the rest of regions */ > > + for (i = 1, j = 2; i < mr_cnt; i++, j+=2) { > > + phys_avail[j] = mr[i].mr_start; > > + phys_avail[j+1] = mr[i].mr_size; > > + dump_avail[j] = phys_avail[j]; > > + dump_avail[j+1] = phys_avail[j+1]; > > + } > > + } > > +#endif > > + > > init_param1(); > > init_param2(physmem); > > mips_cpu_init(); > > > > This doesn't look right, the values in the odd-numbered array slots for > phys_avail and dump_avail need to be addresses, not sizes. That is, > avail[j] = start, avail[j+1] = start+size (note: not start+size-1). > > Right, thanks. Sounds like it should be like that Index: sys/mips/beri/beri_machdep.c =================================================================== --- sys/mips/beri/beri_machdep.c (revision 275861) +++ sys/mips/beri/beri_machdep.c (working copy) @@ -117,13 +117,13 @@ ("First region is not within FDT memory range")); /* Limit size of the first region */ - phys_avail[1] = MIN(mr[0].mr_size, ctob(realmem)); + phys_avail[1] = (mr[0].mr_start + MIN(mr[0].mr_size, ctob(realmem))); dump_avail[1] = phys_avail[1]; /* Add the rest of regions */ for (i = 1, j = 2; i < mr_cnt; i++, j+=2) { phys_avail[j] = mr[i].mr_start; - phys_avail[j+1] = mr[i].mr_size; + phys_avail[j+1] = (mr[i].mr_start + mr[i].mr_size); dump_avail[j] = phys_avail[j]; dump_avail[j+1] = phys_avail[j+1]; } Ruslan From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 14:46:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E934E0E; Wed, 17 Dec 2014 14:46:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4ABCF825; Wed, 17 Dec 2014 14:46:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHEkMFW022878; Wed, 17 Dec 2014 14:46:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHEkMLB022872; Wed, 17 Dec 2014 14:46:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412171446.sBHEkMLB022872@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Dec 2014 14:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275862 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 14:46:22 -0000 Author: emaste Date: Wed Dec 17 14:46:21 2014 New Revision: 275862 URL: https://svnweb.freebsd.org/changeset/base/275862 Log: Do not strip all when stripping an explicit symbol When requested to strip specific symbols (-N flag) the default should be to strip nothing (other than the requested symbols). This is consistent with binutils strip(1). PR: 196038 Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1327 Modified: head/contrib/elftoolchain/elfcopy/main.c Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Wed Dec 17 11:36:31 2014 (r275861) +++ head/contrib/elftoolchain/elfcopy/main.c Wed Dec 17 14:46:21 2014 (r275862) @@ -1109,7 +1109,8 @@ strip_main(struct elfcopy *ecp, int argc if (ecp->strip == 0 && ((ecp->flags & DISCARD_LOCAL) == 0) && - ((ecp->flags & DISCARD_LLABEL) == 0)) + ((ecp->flags & DISCARD_LLABEL) == 0) && + lookup_symop_list(ecp, NULL, SYMOP_STRIP) == NULL) ecp->strip = STRIP_ALL; if (optind == argc) strip_usage(); From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 14:50:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96811398; Wed, 17 Dec 2014 14:50:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 68BE3885; Wed, 17 Dec 2014 14:50:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHEowEJ026159; Wed, 17 Dec 2014 14:50:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHEow8m026158; Wed, 17 Dec 2014 14:50:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412171450.sBHEow8m026158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 17 Dec 2014 14:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275863 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 14:50:58 -0000 Author: pfg Date: Wed Dec 17 14:50:57 2014 New Revision: 275863 URL: https://svnweb.freebsd.org/changeset/base/275863 Log: MFC r275645; ext2fs: Fix old out-of-bounds access. Overrunning buffer pointed to by (caddr_t)&oip->i_db[0] of 48 bytes by passing it to a function which accesses it at byte offset 59 using argument 60UL. The issue was inherited from an older FFS implementation and fixed there with by merging UFS2 in r98542. We follow the FFS fix. CID: 1007665 Discussed with: bde Modified: stable/9/sys/fs/ext2fs/ext2_inode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_inode.c Wed Dec 17 14:46:21 2014 (r275862) +++ stable/9/sys/fs/ext2fs/ext2_inode.c Wed Dec 17 14:50:57 2014 (r275863) @@ -223,14 +223,18 @@ ext2_truncate(struct vnode *vp, off_t le * will be returned to the free list. lastiblock values are also * normalized to -1 for calls to ext2_indirtrunc below. */ - bcopy((caddr_t)&oip->i_db[0], (caddr_t)oldblks, sizeof(oldblks)); - for (level = TRIPLE; level >= SINGLE; level--) + for (level = TRIPLE; level >= SINGLE; level--) { + oldblks[NDADDR + level] = oip->i_ib[level]; if (lastiblock[level] < 0) { oip->i_ib[level] = 0; lastiblock[level] = -1; } - for (i = NDADDR - 1; i > lastblock; i--) - oip->i_db[i] = 0; + } + for (i = 0; i < NDADDR; i++) { + oldblks[i] = oip->i_db[i]; + if (i > lastblock) + oip->i_db[i] = 0; + } oip->i_flag |= IN_CHANGE | IN_UPDATE; allerror = ext2_update(ovp, !DOINGASYNC(ovp)); @@ -240,8 +244,14 @@ ext2_truncate(struct vnode *vp, off_t le * Note that we save the new block configuration so we can check it * when we are done. */ - bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof(newblks)); - bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof(oldblks)); + for (i = 0; i < NDADDR; i++) { + newblks[i] = oip->i_db[i]; + oip->i_db[i] = oldblks[i]; + } + for (i = 0; i < NIADDR; i++) { + newblks[NDADDR + i] = oip->i_ib[i]; + oip->i_ib[i] = oldblks[NDADDR + i]; + } oip->i_size = osize; error = vtruncbuf(ovp, cred, td, length, (int)fs->e2fs_bsize); if (error && (allerror == 0)) From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 15:13:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63A36BCC; Wed, 17 Dec 2014 15:13:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4551EBA1; Wed, 17 Dec 2014 15:13:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHFDOkh037414; Wed, 17 Dec 2014 15:13:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHFDMBK037403; Wed, 17 Dec 2014 15:13:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412171513.sBHFDMBK037403@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Dec 2014 15:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275864 - in head: sys/cam/ctl sys/dev/iscsi usr.sbin/ctld usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 15:13:24 -0000 Author: mav Date: Wed Dec 17 15:13:21 2014 New Revision: 275864 URL: https://svnweb.freebsd.org/changeset/base/275864 Log: Make sequence numbers checks more strict. While we don't support MCS, hole in received sequence numbers may mean only PDU loss. While we don't support lost PDU recovery, terminate the connection to avoid stuck commands. While there, improve handling of sequence numbers wrap after 2^32 PDUs. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_frontend_iscsi.h head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi_proto.h head/usr.sbin/ctld/discovery.c head/usr.sbin/ctld/login.c head/usr.sbin/iscsid/discovery.c head/usr.sbin/iscsid/login.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Dec 17 14:50:57 2014 (r275863) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Dec 17 15:13:21 2014 (r275864) @@ -233,19 +233,34 @@ cfiscsi_pdu_update_cmdsn(const struct ic } #endif - /* - * The target MUST silently ignore any non-immediate command outside - * of this range. - */ - if (cmdsn < cs->cs_cmdsn || cmdsn > cs->cs_cmdsn + maxcmdsn_delta) { - CFISCSI_SESSION_UNLOCK(cs); - CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %d, " - "while expected CmdSN was %d", cmdsn, cs->cs_cmdsn); - return (true); - } + if ((request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) { + /* + * The target MUST silently ignore any non-immediate command + * outside of this range. + */ + if (ISCSI_SNLT(cmdsn, cs->cs_cmdsn) || + ISCSI_SNGT(cmdsn, cs->cs_cmdsn + maxcmdsn_delta)) { + CFISCSI_SESSION_UNLOCK(cs); + CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " + "while expected %u", cmdsn, cs->cs_cmdsn); + return (true); + } - if ((request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) + /* + * We don't support multiple connections now, so any + * discontinuity in CmdSN means lost PDUs. Since we don't + * support PDU retransmission -- terminate the connection. + */ + if (cmdsn != cs->cs_cmdsn) { + CFISCSI_SESSION_UNLOCK(cs); + CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " + "while expected %u; dropping connection", + cmdsn, cs->cs_cmdsn); + cfiscsi_session_terminate(cs); + return (true); + } cs->cs_cmdsn++; + } CFISCSI_SESSION_UNLOCK(cs); @@ -892,6 +907,16 @@ cfiscsi_pdu_handle_data_out(struct icl_p return; } + if (cdw->cdw_datasn != ntohl(bhsdo->bhsdo_datasn)) { + CFISCSI_SESSION_WARN(cs, "received Data-Out PDU with " + "DataSN %u, while expected %u; dropping connection", + ntohl(bhsdo->bhsdo_datasn), cdw->cdw_datasn); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + return; + } + cdw->cdw_datasn++; + io = cdw->cdw_ctl_io; KASSERT((io->io_hdr.flags & CTL_FLAG_DATA_MASK) != CTL_FLAG_DATA_IN, ("CTL_FLAG_DATA_IN")); @@ -2650,6 +2675,7 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; cdw->cdw_r2t_end = io->scsiio.kern_data_len; + cdw->cdw_datasn = 0; /* Set initial data pointer for the CDW respecting ext_data_filled. */ if (io->scsiio.kern_sg_entries > 0) { Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.h Wed Dec 17 14:50:57 2014 (r275863) +++ head/sys/cam/ctl/ctl_frontend_iscsi.h Wed Dec 17 15:13:21 2014 (r275864) @@ -58,6 +58,7 @@ struct cfiscsi_data_wait { char *cdw_sg_addr; size_t cdw_sg_len; uint32_t cdw_r2t_end; + uint32_t cdw_datasn; }; #define CFISCSI_SESSION_STATE_INVALID 0 Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Dec 17 14:50:57 2014 (r275863) +++ head/sys/dev/iscsi/iscsi.c Wed Dec 17 15:13:21 2014 (r275864) @@ -192,7 +192,7 @@ iscsi_pdu_prepare(struct icl_pdu *reques * Data-Out PDU does not contain CmdSN. */ if (bhssc->bhssc_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_OUT) { - if (is->is_cmdsn > is->is_maxcmdsn && + if (ISCSI_SNGT(is->is_cmdsn, is->is_maxcmdsn) && (bhssc->bhssc_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) { /* * Current MaxCmdSN prevents us from sending any more @@ -201,8 +201,10 @@ iscsi_pdu_prepare(struct icl_pdu *reques * or by maintenance thread. */ #if 0 - ISCSI_SESSION_DEBUG(is, "postponing send, CmdSN %d, ExpCmdSN %d, MaxCmdSN %d, opcode 0x%x", - is->is_cmdsn, is->is_expcmdsn, is->is_maxcmdsn, bhssc->bhssc_opcode); + ISCSI_SESSION_DEBUG(is, "postponing send, CmdSN %u, " + "ExpCmdSN %u, MaxCmdSN %u, opcode 0x%x", + is->is_cmdsn, is->is_expcmdsn, is->is_maxcmdsn, + bhssc->bhssc_opcode); #endif return (true); } @@ -611,7 +613,7 @@ iscsi_pdu_update_statsn(const struct icl { const struct iscsi_bhs_data_in *bhsdi; struct iscsi_session *is; - uint32_t expcmdsn, maxcmdsn; + uint32_t expcmdsn, maxcmdsn, statsn; is = PDU_SESSION(response); @@ -630,26 +632,27 @@ iscsi_pdu_update_statsn(const struct icl */ if (bhsdi->bhsdi_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_IN || (bhsdi->bhsdi_flags & BHSDI_FLAGS_S) != 0) { - if (ntohl(bhsdi->bhsdi_statsn) < is->is_statsn) { - ISCSI_SESSION_WARN(is, - "PDU StatSN %d >= session StatSN %d, opcode 0x%x", - is->is_statsn, ntohl(bhsdi->bhsdi_statsn), - bhsdi->bhsdi_opcode); + statsn = ntohl(bhsdi->bhsdi_statsn); + if (statsn != is->is_statsn && statsn != (is->is_statsn + 1)) { + /* XXX: This is normal situation for MCS */ + ISCSI_SESSION_WARN(is, "PDU 0x%x StatSN %u != " + "session ExpStatSN %u (or + 1); reconnecting", + bhsdi->bhsdi_opcode, statsn, is->is_statsn); + iscsi_session_reconnect(is); } - is->is_statsn = ntohl(bhsdi->bhsdi_statsn); + if (ISCSI_SNGT(statsn, is->is_statsn)) + is->is_statsn = statsn; } expcmdsn = ntohl(bhsdi->bhsdi_expcmdsn); maxcmdsn = ntohl(bhsdi->bhsdi_maxcmdsn); - /* - * XXX: Compare using Serial Arithmetic Sense. - */ - if (maxcmdsn + 1 < expcmdsn) { - ISCSI_SESSION_DEBUG(is, "PDU MaxCmdSN %d + 1 < PDU ExpCmdSN %d; ignoring", + if (ISCSI_SNLT(maxcmdsn + 1, expcmdsn)) { + ISCSI_SESSION_DEBUG(is, + "PDU MaxCmdSN %u + 1 < PDU ExpCmdSN %u; ignoring", maxcmdsn, expcmdsn); } else { - if (maxcmdsn > is->is_maxcmdsn) { + if (ISCSI_SNGT(maxcmdsn, is->is_maxcmdsn)) { is->is_maxcmdsn = maxcmdsn; /* @@ -658,15 +661,19 @@ iscsi_pdu_update_statsn(const struct icl */ if (!STAILQ_EMPTY(&is->is_postponed)) cv_signal(&is->is_maintenance_cv); - } else if (maxcmdsn < is->is_maxcmdsn) { - ISCSI_SESSION_DEBUG(is, "PDU MaxCmdSN %d < session MaxCmdSN %d; ignoring", + } else if (ISCSI_SNLT(maxcmdsn, is->is_maxcmdsn)) { + /* XXX: This is normal situation for MCS */ + ISCSI_SESSION_DEBUG(is, + "PDU MaxCmdSN %u < session MaxCmdSN %u; ignoring", maxcmdsn, is->is_maxcmdsn); } - if (expcmdsn > is->is_expcmdsn) { + if (ISCSI_SNGT(expcmdsn, is->is_expcmdsn)) { is->is_expcmdsn = expcmdsn; - } else if (expcmdsn < is->is_expcmdsn) { - ISCSI_SESSION_DEBUG(is, "PDU ExpCmdSN %d < session ExpCmdSN %d; ignoring", + } else if (ISCSI_SNLT(expcmdsn, is->is_expcmdsn)) { + /* XXX: This is normal situation for MCS */ + ISCSI_SESSION_DEBUG(is, + "PDU ExpCmdSN %u < session ExpCmdSN %u; ignoring", expcmdsn, is->is_expcmdsn); } } Modified: head/sys/dev/iscsi/iscsi_proto.h ============================================================================== --- head/sys/dev/iscsi/iscsi_proto.h Wed Dec 17 14:50:57 2014 (r275863) +++ head/sys/dev/iscsi/iscsi_proto.h Wed Dec 17 15:13:21 2014 (r275864) @@ -38,6 +38,9 @@ #define __CTASSERT(x, y) typedef char __assert_ ## y [(x) ? 1 : -1] #endif +#define ISCSI_SNGT(x, y) ((int32_t)(x) - (int32_t)(y) > 0) +#define ISCSI_SNLT(x, y) ((int32_t)(x) - (int32_t)(y) < 0) + #define ISCSI_BHS_SIZE 48 #define ISCSI_HEADER_DIGEST_SIZE 4 #define ISCSI_DATA_DIGEST_SIZE 4 Modified: head/usr.sbin/ctld/discovery.c ============================================================================== --- head/usr.sbin/ctld/discovery.c Wed Dec 17 14:50:57 2014 (r275863) +++ head/usr.sbin/ctld/discovery.c Wed Dec 17 15:13:21 2014 (r275864) @@ -65,13 +65,13 @@ text_receive(struct connection *conn) */ if ((bhstr->bhstr_flags & BHSTR_FLAGS_CONTINUE) != 0) log_errx(1, "received Text PDU with unsupported \"C\" flag"); - if (ntohl(bhstr->bhstr_cmdsn) < conn->conn_cmdsn) { + if (ISCSI_SNLT(ntohl(bhstr->bhstr_cmdsn), conn->conn_cmdsn)) { log_errx(1, "received Text PDU with decreasing CmdSN: " - "was %d, is %d", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn)); + "was %u, is %u", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn)); } if (ntohl(bhstr->bhstr_expstatsn) != conn->conn_statsn) { log_errx(1, "received Text PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhstr->bhstr_expstatsn), + "is %u, should be %u", ntohl(bhstr->bhstr_expstatsn), conn->conn_statsn); } conn->conn_cmdsn = ntohl(bhstr->bhstr_cmdsn); @@ -120,14 +120,14 @@ logout_receive(struct connection *conn) if ((bhslr->bhslr_reason & 0x7f) != BHSLR_REASON_CLOSE_SESSION) log_debugx("received Logout PDU with invalid reason 0x%x; " "continuing anyway", bhslr->bhslr_reason & 0x7f); - if (ntohl(bhslr->bhslr_cmdsn) < conn->conn_cmdsn) { + if (ISCSI_SNLT(ntohl(bhslr->bhslr_cmdsn), conn->conn_cmdsn)) { log_errx(1, "received Logout PDU with decreasing CmdSN: " - "was %d, is %d", conn->conn_cmdsn, + "was %u, is %u", conn->conn_cmdsn, ntohl(bhslr->bhslr_cmdsn)); } if (ntohl(bhslr->bhslr_expstatsn) != conn->conn_statsn) { log_errx(1, "received Logout PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhslr->bhslr_expstatsn), + "is %u, should be %u", ntohl(bhslr->bhslr_expstatsn), conn->conn_statsn); } conn->conn_cmdsn = ntohl(bhslr->bhslr_cmdsn); Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Wed Dec 17 14:50:57 2014 (r275863) +++ head/usr.sbin/ctld/login.c Wed Dec 17 15:13:21 2014 (r275864) @@ -127,17 +127,17 @@ login_receive(struct connection *conn, b log_errx(1, "received Login PDU with unsupported " "Version-min 0x%x", bhslr->bhslr_version_min); } - if (ntohl(bhslr->bhslr_cmdsn) < conn->conn_cmdsn) { + if (ISCSI_SNLT(ntohl(bhslr->bhslr_cmdsn), conn->conn_cmdsn)) { login_send_error(request, 0x02, 0x05); log_errx(1, "received Login PDU with decreasing CmdSN: " - "was %d, is %d", conn->conn_cmdsn, + "was %u, is %u", conn->conn_cmdsn, ntohl(bhslr->bhslr_cmdsn)); } if (initial == false && ntohl(bhslr->bhslr_expstatsn) != conn->conn_statsn) { login_send_error(request, 0x02, 0x05); log_errx(1, "received Login PDU with wrong ExpStatSN: " - "is %d, should be %d", ntohl(bhslr->bhslr_expstatsn), + "is %u, should be %u", ntohl(bhslr->bhslr_expstatsn), conn->conn_statsn); } conn->conn_cmdsn = ntohl(bhslr->bhslr_cmdsn); Modified: head/usr.sbin/iscsid/discovery.c ============================================================================== --- head/usr.sbin/iscsid/discovery.c Wed Dec 17 14:50:57 2014 (r275863) +++ head/usr.sbin/iscsid/discovery.c Wed Dec 17 15:13:21 2014 (r275864) @@ -66,7 +66,7 @@ text_receive(struct connection *conn) log_errx(1, "received Text PDU with unsupported \"C\" flag"); if (ntohl(bhstr->bhstr_statsn) != conn->conn_statsn + 1) { log_errx(1, "received Text PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhstr->bhstr_statsn), + "is %u, should be %u", ntohl(bhstr->bhstr_statsn), conn->conn_statsn + 1); } conn->conn_statsn = ntohl(bhstr->bhstr_statsn); @@ -112,7 +112,7 @@ logout_receive(struct connection *conn) ntohs(bhslr->bhslr_response)); if (ntohl(bhslr->bhslr_statsn) != conn->conn_statsn + 1) { log_errx(1, "received Logout PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhslr->bhslr_statsn), + "is %u, should be %u", ntohl(bhslr->bhslr_statsn), conn->conn_statsn + 1); } conn->conn_statsn = ntohl(bhslr->bhslr_statsn); Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Wed Dec 17 14:50:57 2014 (r275863) +++ head/usr.sbin/iscsid/login.c Wed Dec 17 15:13:21 2014 (r275864) @@ -257,7 +257,7 @@ login_receive(struct connection *conn) * to be bug in NetBSD iSCSI target. */ log_warnx("received Login PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhslr->bhslr_statsn), + "is %u, should be %u", ntohl(bhslr->bhslr_statsn), conn->conn_statsn + 1); } conn->conn_tsih = ntohs(bhslr->bhslr_tsih); From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 15:30:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D136C8; Wed, 17 Dec 2014 15:30:33 +0000 (UTC) Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [IPv6:2607:f8b0:4001:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7AB3DD3; Wed, 17 Dec 2014 15:30:32 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id rd18so15136132iec.29 for ; Wed, 17 Dec 2014 07:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Gpxze81Vzc6vpKQHSrPhkzvl4ff2Kmz7G9sUyHooOjw=; b=T/Lj04IbkMv8Mgs0NV4VvqeLdUVNUzvm/SN3NGVr2c01BCKBEq8bJdm6AtK3Zpe/UU yzOkqsrRNOFLBtiW8gqBC4gW/+8hdnaeeOkPkOqRNXcYCx+a2UlHt+WXU0TCd1vuNFim rX4xDpin50UIEepWLEdLnZkyOlayH0p7i1Eu7myzAl5h7PmUf7ElHvgzAVYTJ8myFRwC 6mDLQE74+2BBOdYgLWU3nZsczLA4cvViBPYmtqmkAMin1IoGJh4qJ22uv5kTh6fUNiXo fRylgi+20HhRACcOOzNzWQVsHT+V1cqzZL1RXbSVGjN8aD2EDDkwy5Dt0gU83zwc5Jz/ lhNA== MIME-Version: 1.0 X-Received: by 10.42.194.17 with SMTP id dw17mr36957989icb.4.1418830232148; Wed, 17 Dec 2014 07:30:32 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.107.176.145 with HTTP; Wed, 17 Dec 2014 07:30:32 -0800 (PST) In-Reply-To: <20141216162055.GA64273@troutmask.apl.washington.edu> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> Date: Wed, 17 Dec 2014 16:30:32 +0100 X-Google-Sender-Auth: yxmw3XDCO1ktGwuwH0FIMJSsTMQ Message-ID: Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src From: Ed Schouten To: Steve Kargl Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 15:30:33 -0000 Steve, 2014-12-16 17:20 GMT+01:00 Steve Kargl : > This seems like a lot of code churn for very little benefit. > > In particular, I know that the one person working on fixing > problems with FreeBSD's libm has a private repo and the openlibm > and android developers base their libm off of FreeBSD's libm > and now they'll need to resync their codebases and resolve > conflicts. I'm always afraid of statements like these, as they can be brought to the table to prevent any changes from being made. The fact that someone else (be it Android or openlibm) uses our code should not limit us as a project to make changes. Hopefully this change will merge into their direction as well? The fact that we often do not dare to refactor our code is exactly what puts us in the spot that a lot of our code is often not directly reusable by others, needs to be forked and adjusted. Examples include u_intX_t, bcopy(), etc. > This comment isn't true! These functions pre-date C11 by years. > See r151865. These functions were designed to deal with gcc's > poorly implemented I. See the paragraph above your comment. Keep in mind that the phrasing is intended to say that CMPLX*() and friends are part of C11. Those do not pre-date C11. > Upon further inspection with md5, this change affects only a single > file. This last paragraph appears to be an excuse for a drive-by > commit. But also acts as proof that the change is harmless. I am not entirely sure what you're trying to imply with this. Are changes that do not affect checksums of object files are bad? -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 17:30:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 735DEDFC; Wed, 17 Dec 2014 17:30:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5EC281CB2; Wed, 17 Dec 2014 17:30:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHHUud8005503; Wed, 17 Dec 2014 17:30:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHHUtR3005495; Wed, 17 Dec 2014 17:30:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412171730.sBHHUtR3005495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Dec 2014 17:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275865 - in head: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 17:30:56 -0000 Author: mav Date: Wed Dec 17 17:30:54 2014 New Revision: 275865 URL: https://svnweb.freebsd.org/changeset/base/275865 Log: Add configuration options to override physical and UNMAP blocks geometry. While in most cases CTL should correctly fetch those values from backing storages, there are some initiators (like MS SQL), that may not like large physical block sizes, even if they are true. For such cases allow override fetched values with supported ones (like 4K). MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Dec 17 15:13:21 2014 (r275864) +++ head/sys/cam/ctl/ctl.c Wed Dec 17 17:30:54 2014 (r275865) @@ -3900,7 +3900,7 @@ ctl_copy_io(union ctl_io *src, union ctl dest->io_hdr.flags |= CTL_FLAG_INT_COPY; } -static int +int ctl_expand_number(const char *buf, uint64_t *num) { char *endptr; @@ -10146,10 +10146,10 @@ ctl_inquiry_evpd_block_limits(struct ctl if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); - if (lun->be_lun->pblockexp != 0) { - scsi_ulto4b((1 << lun->be_lun->pblockexp), + if (lun->be_lun->ublockexp != 0) { + scsi_ulto4b((1 << lun->be_lun->ublockexp), bl_ptr->opt_unmap_grain); - scsi_ulto4b(0x80000000 | lun->be_lun->pblockoff, + scsi_ulto4b(0x80000000 | lun->be_lun->ublockoff, bl_ptr->unmap_grain_align); } } Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Wed Dec 17 15:13:21 2014 (r275864) +++ head/sys/cam/ctl/ctl.h Wed Dec 17 17:30:54 2014 (r275865) @@ -206,6 +206,7 @@ struct ctl_be_arg; void ctl_init_opts(ctl_options_t *opts, int num_args, struct ctl_be_arg *args); void ctl_free_opts(ctl_options_t *opts); char * ctl_get_opt(ctl_options_t *opts, const char *name); +int ctl_expand_number(const char *buf, uint64_t *num); #endif /* _KERNEL */ Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Wed Dec 17 15:13:21 2014 (r275864) +++ head/sys/cam/ctl/ctl_backend.h Wed Dec 17 17:30:54 2014 (r275865) @@ -194,6 +194,8 @@ struct ctl_be_lun { uint32_t blocksize; /* passed to CTL */ uint16_t pblockexp; /* passed to CTL */ uint16_t pblockoff; /* passed to CTL */ + uint16_t ublockexp; /* passed to CTL */ + uint16_t ublockoff; /* passed to CTL */ uint32_t atomicblock; /* passed to CTL */ uint32_t req_lun_id; /* passed to CTL */ uint32_t lun_id; /* returned from CTL */ Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Dec 17 15:13:21 2014 (r275864) +++ head/sys/cam/ctl/ctl_backend_block.c Wed Dec 17 17:30:54 2014 (r275865) @@ -173,6 +173,8 @@ struct ctl_be_block_lun { int blocksize_shift; uint16_t pblockexp; uint16_t pblockoff; + uint16_t ublockexp; + uint16_t ublockoff; struct ctl_be_block_softc *softc; struct devstat *disk_stats; ctl_be_block_lun_flags flags; @@ -1739,8 +1741,9 @@ ctl_be_block_open_file(struct ctl_be_blo { struct ctl_be_block_filedata *file_data; struct ctl_lun_create_params *params; + char *value; struct vattr vattr; - off_t pss; + off_t ps, pss, po, pos, us, uss, uo, uos; int error; error = 0; @@ -1800,11 +1803,36 @@ ctl_be_block_open_file(struct ctl_be_blo be_lun->blocksize = params->blocksize_bytes; else be_lun->blocksize = 512; - pss = vattr.va_blocksize / be_lun->blocksize; - if ((pss > 0) && (pss * be_lun->blocksize == vattr.va_blocksize) && - ((pss & (pss - 1)) == 0)) { + + us = ps = vattr.va_blocksize; + uo = po = 0; + + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "pblocksize"); + if (value != NULL) + ctl_expand_number(value, &ps); + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "pblockoffset"); + if (value != NULL) + ctl_expand_number(value, &po); + pss = ps / be_lun->blocksize; + pos = po / be_lun->blocksize; + if ((pss > 0) && (pss * be_lun->blocksize == ps) && (pss >= pos) && + ((pss & (pss - 1)) == 0) && (pos * be_lun->blocksize == po)) { be_lun->pblockexp = fls(pss) - 1; - be_lun->pblockoff = 0; + be_lun->pblockoff = (pss - pos) % pss; + } + + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "ublocksize"); + if (value != NULL) + ctl_expand_number(value, &us); + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "ublockoffset"); + if (value != NULL) + ctl_expand_number(value, &uo); + uss = us / be_lun->blocksize; + uos = uo / be_lun->blocksize; + if ((uss > 0) && (uss * be_lun->blocksize == us) && (uss >= uos) && + ((uss & (uss - 1)) == 0) && (uos * be_lun->blocksize == uo)) { + be_lun->ublockexp = fls(uss) - 1; + be_lun->ublockoff = (uss - uos) % uss; } /* @@ -1827,8 +1855,9 @@ ctl_be_block_open_dev(struct ctl_be_bloc struct vattr vattr; struct cdev *dev; struct cdevsw *devsw; + char *value; int error; - off_t ps, pss, po, pos; + off_t ps, pss, po, pos, us, uss, uo, uos; params = &be_lun->params; @@ -1942,6 +1971,15 @@ ctl_be_block_open_dev(struct ctl_be_bloc if (error) po = 0; } + us = ps; + uo = po; + + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "pblocksize"); + if (value != NULL) + ctl_expand_number(value, &ps); + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "pblockoffset"); + if (value != NULL) + ctl_expand_number(value, &po); pss = ps / be_lun->blocksize; pos = po / be_lun->blocksize; if ((pss > 0) && (pss * be_lun->blocksize == ps) && (pss >= pos) && @@ -1950,6 +1988,20 @@ ctl_be_block_open_dev(struct ctl_be_bloc be_lun->pblockoff = (pss - pos) % pss; } + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "ublocksize"); + if (value != NULL) + ctl_expand_number(value, &us); + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "ublockoffset"); + if (value != NULL) + ctl_expand_number(value, &uo); + uss = us / be_lun->blocksize; + uos = uo / be_lun->blocksize; + if ((uss > 0) && (uss * be_lun->blocksize == us) && (uss >= uos) && + ((uss & (uss - 1)) == 0) && (uos * be_lun->blocksize == uo)) { + be_lun->ublockexp = fls(uss) - 1; + be_lun->ublockoff = (uss - uos) % uss; + } + return (0); } @@ -2162,6 +2214,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->blocksize = 0; be_lun->pblockexp = 0; be_lun->pblockoff = 0; + be_lun->ublockexp = 0; + be_lun->ublockoff = 0; be_lun->size_blocks = 0; be_lun->size_bytes = 0; be_lun->ctl_be_lun.maxlba = 0; @@ -2212,6 +2266,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.blocksize = be_lun->blocksize; be_lun->ctl_be_lun.pblockexp = be_lun->pblockexp; be_lun->ctl_be_lun.pblockoff = be_lun->pblockoff; + be_lun->ctl_be_lun.ublockexp = be_lun->ublockexp; + be_lun->ctl_be_lun.ublockoff = be_lun->ublockoff; if (be_lun->dispatch == ctl_be_block_dispatch_zvol && be_lun->blocksize != 0) be_lun->ctl_be_lun.atomicblock = CTLBLK_MAX_IO_SIZE / @@ -2591,6 +2647,8 @@ ctl_be_block_modify(struct ctl_be_block_ be_lun->ctl_be_lun.blocksize = be_lun->blocksize; be_lun->ctl_be_lun.pblockexp = be_lun->pblockexp; be_lun->ctl_be_lun.pblockoff = be_lun->pblockoff; + be_lun->ctl_be_lun.ublockexp = be_lun->ublockexp; + be_lun->ctl_be_lun.ublockoff = be_lun->ublockoff; if (be_lun->dispatch == ctl_be_block_dispatch_zvol && be_lun->blocksize != 0) be_lun->ctl_be_lun.atomicblock = CTLBLK_MAX_IO_SIZE / Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Wed Dec 17 15:13:21 2014 (r275864) +++ head/usr.sbin/ctladm/ctladm.8 Wed Dec 17 17:30:54 2014 (r275865) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd December 6, 2014 +.Dd December 17, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -1002,6 +1002,13 @@ Set to "off" to allow them be issued in Parallel issue of consecutive operations may confuse logic of the backing file system, hurting performance; but it may improve performance of backing stores without prefetch/write-back. +.It Va psectorsize +.It Va psectoroffset +Specify physical block size and offset of the device. +.It Va usectorsize +.It Va usectoroffset +Specify UNMAP block size and offset of the device. +.It Va rpm .It Va rpm Specifies medium rotation rate of the device: 0 -- not reported, 1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 19:12:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDF5E6A7; Wed, 17 Dec 2014 19:12:44 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C4276DB3; Wed, 17 Dec 2014 19:12:44 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sBHJCZ4A093691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Dec 2014 11:12:35 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sBHJCZI6093690; Wed, 17 Dec 2014 11:12:35 -0800 (PST) (envelope-from sgk) Date: Wed, 17 Dec 2014 11:12:35 -0800 From: Steve Kargl To: Ed Schouten Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src Message-ID: <20141217191235.GA89501@troutmask.apl.washington.edu> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 19:12:45 -0000 On Wed, Dec 17, 2014 at 04:30:32PM +0100, Ed Schouten wrote: > Steve, > > 2014-12-16 17:20 GMT+01:00 Steve Kargl : > > This seems like a lot of code churn for very little benefit. > > > > In particular, I know that the one person working on fixing > > problems with FreeBSD's libm has a private repo and the openlibm > > and android developers base their libm off of FreeBSD's libm > > and now they'll need to resync their codebases and resolve > > conflicts. > > I'm always afraid of statements like these, as they can be brought to > the table to prevent any changes from being made. The fact that > someone else (be it Android or openlibm) uses our code should not > limit us as a project to make changes. Hopefully this change will > merge into their direction as well? I stand corrected. Foisting unnecessary code churn on others is now an acceptable practice. > The fact that we often do not dare to refactor our code is exactly > what puts us in the spot that a lot of our code is often not directly > reusable by others, needs to be forked and adjusted. Examples include > u_intX_t, bcopy(), etc. Your refactoring is nothing more than a gratuitous code change. The reasons you give in your commit log are bogus justification. But the damage is done. Asking you to revert the patch would simply be more code churn. > > This comment isn't true! These functions pre-date C11 by years. > > See r151865. These functions were designed to deal with gcc's > > poorly implemented I. See the paragraph above your comment. > > Keep in mind that the phrasing is intended to say that CMPLX*() and > friends are part of C11. Those do not pre-date C11. The phrasing is wrong. cpack[fl] came at least 6 years before C11 and were designed to work around defects in C99. CMPLX[FL] were introduced into C11 to address those defects. Changing cpack[fl] to CMPLX[FL] and claiming that the functions are modeled after the C11 macros is wrong (unless the meaning of "before" and "after" have changed). > > Upon further inspection with md5, this change affects only a single > > file. This last paragraph appears to be an excuse for a drive-by > > commit. > > But also acts as proof that the change is harmless. I am not entirely > sure what you're trying to imply with this. Are changes that do not > affect checksums of object files are bad? Gratuitous changes are well gratuitous. You are causing extra work for people actively working on libm and other projects that use FreeBSD's libm. The fact that I ran md5 over the *.o files suggests that you made the change without even checking on its effect on the resulting library. To be blunt, your patch has/had ZERO BENEFIT at the expense of causing additional work for others. There are ample opportunities to improve libm. powl, tgammal, j0l, j1l, jnl, y0l, y1l, ynl, and number of the long double complex functions are not implemented. -- Steve From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 19:24:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8469C3C; Wed, 17 Dec 2014 19:24:35 +0000 (UTC) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47D83F05; Wed, 17 Dec 2014 19:24:35 +0000 (UTC) Received: by mail-wi0-f173.google.com with SMTP id r20so16904411wiv.0; Wed, 17 Dec 2014 11:24:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=4kF2gg4k2egkpvOn5sE6AVWx77mZIyASY7Tq2OBCI+4=; b=F1fShIurZDT7oVDqEBpirSDOBiXuM+yGTcligP2W9wkfZcnXZMhBhR5THE6BnNpfvC SD1YfrudZ4QwWmA48R5XaoYnSPZkcvWk++Eao4Lg8IVwjC7ZeLl6hSs//I5pprSRDMlA lCCawIVl41fOwYwl99H5Sq+BQMm8OX8fvvGXr0tEsc7FfAKvP3TsYAXJVkKl8H7MB4tP cbPv+qRgWt/r5ObqbI8xLEj1c0/tyx+TOKWhNRgFIWJLKx9iSlMu0K5ybqBtr/exRh0s jec5AQZTp9tUacD3AS0RPtTvCMi5c42yoPXkbRK7kVXFUojBCIYsQgEEm6OakKClg4L/ 1mHA== MIME-Version: 1.0 X-Received: by 10.180.80.163 with SMTP id s3mr17006307wix.59.1418844273704; Wed, 17 Dec 2014 11:24:33 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.195 with HTTP; Wed, 17 Dec 2014 11:24:33 -0800 (PST) In-Reply-To: References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> Date: Wed, 17 Dec 2014 11:24:33 -0800 X-Google-Sender-Auth: cytlLUns6pz-VXUu6CoNc2CkIPo Message-ID: Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src From: Adrian Chadd To: Ed Schouten Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 19:24:35 -0000 On 17 December 2014 at 07:30, Ed Schouten wrote: > Steve, > > 2014-12-16 17:20 GMT+01:00 Steve Kargl : >> This seems like a lot of code churn for very little benefit. >> >> In particular, I know that the one person working on fixing >> problems with FreeBSD's libm has a private repo and the openlibm >> and android developers base their libm off of FreeBSD's libm >> and now they'll need to resync their codebases and resolve >> conflicts. > > I'm always afraid of statements like these, as they can be brought to > the table to prevent any changes from being made. The fact that > someone else (be it Android or openlibm) uses our code should not > limit us as a project to make changes. Hopefully this change will > merge into their direction as well? > > The fact that we often do not dare to refactor our code is exactly > what puts us in the spot that a lot of our code is often not directly > reusable by others, needs to be forked and adjusted. Examples include > u_intX_t, bcopy(), etc. > >> This comment isn't true! These functions pre-date C11 by years. >> See r151865. These functions were designed to deal with gcc's >> poorly implemented I. See the paragraph above your comment. > > Keep in mind that the phrasing is intended to say that CMPLX*() and > friends are part of C11. Those do not pre-date C11. > >> Upon further inspection with md5, this change affects only a single >> file. This last paragraph appears to be an excuse for a drive-by >> commit. > > But also acts as proof that the change is harmless. I am not entirely > sure what you're trying to imply with this. Are changes that do not > affect checksums of object files are bad? Actually, the fact that the MD5 signature changed means that the binary code generated has changed, and thus it "isn't harmless." It may be, but it certainly didn't generate identical binary code. We have some active and interested math nerds involved; perhaps a drive-by shooting without including them should be avoided. -adrian From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 19:46:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF608386; Wed, 17 Dec 2014 19:46:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9A10D11AA; Wed, 17 Dec 2014 19:46:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHJkFIF068265; Wed, 17 Dec 2014 19:46:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHJkDnf068253; Wed, 17 Dec 2014 19:46:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412171946.sBHJkDnf068253@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 17 Dec 2014 19:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275866 - in head/gnu/usr.bin/groff: . src src/devices src/libs src/preproc src/roff src/utils X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 19:46:15 -0000 Author: ngie Date: Wed Dec 17 19:46:12 2014 New Revision: 275866 URL: https://svnweb.freebsd.org/changeset/base/275866 Log: Parallelize building gnu/usr.bin/groff This speeds up building the directory from the bootstrap-tools stage in buildworld as well as building from the subdirectory Based on a patch submitted via -arch: https://lists.freebsd.org/pipermail/freebsd-arch/2014-December/016493.html MFC after: 1 week Submitted by: Jia-Shiun Li Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/usr.bin/groff/Makefile head/gnu/usr.bin/groff/src/Makefile head/gnu/usr.bin/groff/src/devices/Makefile head/gnu/usr.bin/groff/src/libs/Makefile head/gnu/usr.bin/groff/src/preproc/Makefile head/gnu/usr.bin/groff/src/roff/Makefile head/gnu/usr.bin/groff/src/utils/Makefile Modified: head/gnu/usr.bin/groff/Makefile ============================================================================== --- head/gnu/usr.bin/groff/Makefile Wed Dec 17 17:30:54 2014 (r275865) +++ head/gnu/usr.bin/groff/Makefile Wed Dec 17 19:46:12 2014 (r275866) @@ -2,4 +2,8 @@ SUBDIR= contrib doc font man src tmac +.for subdir in ${SUBDIR:Nsrc} +SUBDIR_DEPEND_${subdir}= src +.endfor + .include Modified: head/gnu/usr.bin/groff/src/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/Makefile Wed Dec 17 17:30:54 2014 (r275865) +++ head/gnu/usr.bin/groff/src/Makefile Wed Dec 17 19:46:12 2014 (r275866) @@ -2,4 +2,10 @@ SUBDIR= libs devices preproc roff utils +SUBDIR_PARALLEL= + +.for subdir in ${SUBDIR:Nlibs} +SUBDIR_DEPEND_${subdir}= libs +.endfor + .include Modified: head/gnu/usr.bin/groff/src/devices/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/devices/Makefile Wed Dec 17 17:30:54 2014 (r275865) +++ head/gnu/usr.bin/groff/src/devices/Makefile Wed Dec 17 19:46:12 2014 (r275866) @@ -2,4 +2,6 @@ SUBDIR= grodvi grohtml grolbp grolj4 grops grotty +SUBDIR_PARALLEL= + .include Modified: head/gnu/usr.bin/groff/src/libs/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/libs/Makefile Wed Dec 17 17:30:54 2014 (r275865) +++ head/gnu/usr.bin/groff/src/libs/Makefile Wed Dec 17 19:46:12 2014 (r275866) @@ -2,4 +2,6 @@ SUBDIR= libgroff libdriver libbib +SUBDIR_PARALLEL= + .include Modified: head/gnu/usr.bin/groff/src/preproc/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/Makefile Wed Dec 17 17:30:54 2014 (r275865) +++ head/gnu/usr.bin/groff/src/preproc/Makefile Wed Dec 17 19:46:12 2014 (r275866) @@ -2,4 +2,6 @@ SUBDIR= eqn grn html pic refer soelim tbl +SUBDIR_PARALLEL= + .include Modified: head/gnu/usr.bin/groff/src/roff/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/roff/Makefile Wed Dec 17 17:30:54 2014 (r275865) +++ head/gnu/usr.bin/groff/src/roff/Makefile Wed Dec 17 19:46:12 2014 (r275866) @@ -2,4 +2,6 @@ SUBDIR= groff grog nroff psroff troff +SUBDIR_PARALLEL= + .include Modified: head/gnu/usr.bin/groff/src/utils/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/utils/Makefile Wed Dec 17 17:30:54 2014 (r275865) +++ head/gnu/usr.bin/groff/src/utils/Makefile Wed Dec 17 19:46:12 2014 (r275866) @@ -2,4 +2,6 @@ SUBDIR= addftinfo afmtodit hpftodit indxbib lkbib lookbib pfbtops tfmtodit +SUBDIR_PARALLEL= + .include From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 20:02:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9DB476E; Wed, 17 Dec 2014 20:02:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B5C0F13AA; Wed, 17 Dec 2014 20:02:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHK28PU077168; Wed, 17 Dec 2014 20:02:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHK28la077167; Wed, 17 Dec 2014 20:02:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412172002.sBHK28la077167@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 17 Dec 2014 20:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275867 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 20:02:08 -0000 Author: ngie Date: Wed Dec 17 20:02:07 2014 New Revision: 275867 URL: https://svnweb.freebsd.org/changeset/base/275867 Log: Fix sporadic build failures due to race when running make installworld when strip gets replaced at install time by adding it to ITOOLS for the default usr.bin/xinstall STRIP_CMD This will fix the failure noted in this Jenkins build step: https://jenkins.freebsd.org/job/Build-UFS-image/688/ This will also fix the issue reported by alfred@ dealing with installing on targets that differ from build hosts (e.g. installing on i386/i386 when built on amd64/amd64) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Dec 17 19:46:12 2014 (r275866) +++ head/Makefile.inc1 Wed Dec 17 20:02:07 2014 (r275867) @@ -790,7 +790,7 @@ _zoneinfo= zic tzsetup ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ date echo egrep find grep id install ${_install-info} \ ln lockf make mkdir mtree mv pwd_mkdb \ - rm sed services_mkdb sh sysctl test true uname wc ${_zoneinfo} \ + rm sed services_mkdb sh strip sysctl test true uname wc ${_zoneinfo} \ ${LOCAL_ITOOLS} # Needed for share/man From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 20:15:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D44B6DFD; Wed, 17 Dec 2014 20:15:49 +0000 (UTC) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id B2B6D15C6; Wed, 17 Dec 2014 20:15:49 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 872DA5607B; Wed, 17 Dec 2014 14:15:48 -0600 (CST) Date: Wed, 17 Dec 2014 14:15:48 -0600 From: Mark Linimon To: Steve Kargl Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src Message-ID: <20141217201548.GB25019@lonesome.com> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141217191235.GA89501@troutmask.apl.washington.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 20:15:49 -0000 On Wed, Dec 17, 2014 at 11:12:35AM -0800, Steve Kargl wrote: > > I'm always afraid of statements like these, as they can be brought to > > the table to prevent any changes from being made. The fact that > > someone else (be it Android or openlibm) uses our code should not > > limit us as a project to make changes. Hopefully this change will > > merge into their direction as well? > > I stand corrected. Foisting unnecessary code churn on > others is now an acceptable practice. I am not happy with the fact that you put words in his mouth. This conversation IMHO is not showing the respect committers are due. I think you have a legitimate complaint but statements like this aren't going to gain you any supporters. mcl From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 20:19:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F2C8F69; Wed, 17 Dec 2014 20:19:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2B1B41601; Wed, 17 Dec 2014 20:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHKJw3p083007; Wed, 17 Dec 2014 20:19:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHKJwTL083006; Wed, 17 Dec 2014 20:19:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412172019.sBHKJwTL083006@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Dec 2014 20:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275868 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 20:19:58 -0000 Author: tuexen Date: Wed Dec 17 20:19:57 2014 New Revision: 275868 URL: https://svnweb.freebsd.org/changeset/base/275868 Log: Plug a memory leak in an error code path. Reported by: Coverity CID: 1018936 MFC after: 3 days Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Wed Dec 17 20:02:07 2014 (r275867) +++ head/sys/netinet6/sctp6_usrreq.c Wed Dec 17 20:19:57 2014 (r275868) @@ -1125,8 +1125,11 @@ sctp6_peeraddr(struct socket *so, struct SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT); return (ENOENT); } - if ((error = sa6_recoverscope(sin6)) != 0) + if ((error = sa6_recoverscope(sin6)) != 0) { + SCTP_FREE_SONAME(sin6); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, error); return (error); + } *addr = (struct sockaddr *)sin6; return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 20:31:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A211C46C; Wed, 17 Dec 2014 20:31:09 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1A81766; Wed, 17 Dec 2014 20:31:09 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sBHKV5Ut094847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Dec 2014 12:31:05 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sBHKV5Cr094846; Wed, 17 Dec 2014 12:31:05 -0800 (PST) (envelope-from sgk) Date: Wed, 17 Dec 2014 12:31:05 -0800 From: Steve Kargl To: Mark Linimon Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src Message-ID: <20141217203105.GA94787@troutmask.apl.washington.edu> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> <20141217201548.GB25019@lonesome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141217201548.GB25019@lonesome.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 20:31:09 -0000 On Wed, Dec 17, 2014 at 02:15:48PM -0600, Mark Linimon wrote: > On Wed, Dec 17, 2014 at 11:12:35AM -0800, Steve Kargl wrote: > > > I'm always afraid of statements like these, as they can be brought to > > > the table to prevent any changes from being made. The fact that > > > someone else (be it Android or openlibm) uses our code should not > > > limit us as a project to make changes. Hopefully this change will > > > merge into their direction as well? > > > > I stand corrected. Foisting unnecessary code churn on > > others is now an acceptable practice. > > I am not happy with the fact that you put words in his mouth. This > conversation IMHO is not showing the respect committers are due. > I did not put words into his mouth. I simply stated what the results of his commit appear to be. It was an unreviewed drive-by commit with zero benefit that is making extra work for others. -- Steve From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 20:34:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52BE36EA; Wed, 17 Dec 2014 20:34:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3E927185D; Wed, 17 Dec 2014 20:34:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHKYddq091677; Wed, 17 Dec 2014 20:34:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHKYd5o091676; Wed, 17 Dec 2014 20:34:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412172034.sBHKYd5o091676@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Dec 2014 20:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275869 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 20:34:39 -0000 Author: tuexen Date: Wed Dec 17 20:34:38 2014 New Revision: 275869 URL: https://svnweb.freebsd.org/changeset/base/275869 Log: Add a missing break. Reported by: Coverity CID: 1232014 MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Dec 17 20:19:57 2014 (r275868) +++ head/sys/netinet/sctp_pcb.c Wed Dec 17 20:34:38 2014 (r275869) @@ -6462,6 +6462,7 @@ sctp_load_addresses_from_init(struct sct switch (pr_supported->chunk_types[i]) { case SCTP_ASCONF: peer_supports_asconf = 1; + break; case SCTP_ASCONF_ACK: peer_supports_asconf_ack = 1; break; From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 20:48:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BAAD1CD; Wed, 17 Dec 2014 20:48:40 +0000 (UTC) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F414F1A63; Wed, 17 Dec 2014 20:48:39 +0000 (UTC) Received: by mail-pa0-f52.google.com with SMTP id eu11so17172185pac.39 for ; Wed, 17 Dec 2014 12:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=gpL+TGJub9+S0cgRvUjQbIalUoxtsMnSzv1UvSh8p3M=; b=Vkz5jw1x02TGnZRKpu6N79rpparHHRk7UQ9oVlHmEKclJY3jZqT1+bMoseawmlBe6K 103kV8dNgrQmkR6YTtqPifkKnSzAF8JH9POLs1gR2SV1X59oeYLc3+keLdAdz2Vu9U7H MHUm8DB8Nq3NoKhvh8uPXNVOA1G805m5oZ1v5SsuVqf6D6qErBu/ytxYCcPGHsMwpXmC alzikZ2Bh7+3HOSDmiXGWlp8m8kQ6iolr6UkU8E0hquyKsVm9ZF6zmA7kVgjp6uGQBJ+ 2sOjGQRaPOWstdW7wEQaF9FtMOQvccAeQkYjWKjcfRa1urIWSG7luJBItn5Aza7K8SY7 J+WA== X-Received: by 10.66.226.167 with SMTP id rt7mr72574691pac.12.1418849319519; Wed, 17 Dec 2014 12:48:39 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:4e8:e4bf:d5e5:12e3? ([2601:8:ab80:7d6:4e8:e4bf:d5e5:12e3]) by mx.google.com with ESMTPSA id c17sm4812394pdl.6.2014.12.17.12.48.38 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 12:48:38 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_FF39F2E8-E98B-4A72-85A5-9B63BDF7ABBD"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src From: Garrett Cooper In-Reply-To: <20141217191235.GA89501@troutmask.apl.washington.edu> Date: Wed, 17 Dec 2014 12:48:37 -0800 Message-Id: <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> To: Steve Kargl X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 20:48:40 -0000 --Apple-Mail=_FF39F2E8-E98B-4A72-85A5-9B63BDF7ABBD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Dec 17, 2014, at 11:12, Steve Kargl = wrote: > On Wed, Dec 17, 2014 at 04:30:32PM +0100, Ed Schouten wrote: =85 >>> This comment isn't true! These functions pre-date C11 by years. >>> See r151865. These functions were designed to deal with gcc's >>> poorly implemented I. See the paragraph above your comment. >>=20 >> Keep in mind that the phrasing is intended to say that CMPLX*() and >> friends are part of C11. Those do not pre-date C11. >=20 > The phrasing is wrong. cpack[fl] came at least 6 years before > C11 and were designed to work around defects in C99. CMPLX[FL] > were introduced into C11 to address those defects. Changing > cpack[fl] to CMPLX[FL] and claiming that the functions are=20 > modeled after the C11 macros is wrong (unless the meaning of > "before" and "after" have changed). Hi Dimitry/Ed/Steve, Does it make sense to take the logic that Ed added and guard it = with a conditional so people building the functions can use the C+11 = definitions instead of the C99 definitions? This could preserve the old = behavior for folks who don=92t have C+11 capable compilers, but would = allow us (and others) who do via clang or newer versions of gcc to use = the new C+11 idioms, similar to some of the other macros in sys/cdefs.h, = et al. Thank you! --Apple-Mail=_FF39F2E8-E98B-4A72-85A5-9B63BDF7ABBD 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 iQEcBAEBCgAGBQJUkewlAAoJEMZr5QU6S73eu1MH/37z7YWekKpRkG2NnFM7aHff ehRl1k6bAlMSraKnX33h/T6klaXfx0RUNkxbsA03s/Ulzf5Nyj5N/u9zE9dDK77D 5E1jorbtvbv4y6DWQQFb/12JufK5i79vDTkeVgE6+jR8IICdAMkCAInQVMH1g8VU I4q2HiEWsLErpWZSacDlX37aum5OZk3829ljlP0/VVMOr31xx1hAKtlWSKWz1OSZ yOXpnjBESo01dcXdW+Gnt7SPUki0BseE4VC/rl9pE9HDX2lzO16atU7R2Et58vTM 2obgnKVIQ+0ym6p/zH5GcOeXIbSZrEYjmJvHtDSifAZe/avY7S26qJZapxXjvrI= =bGwA -----END PGP SIGNATURE----- --Apple-Mail=_FF39F2E8-E98B-4A72-85A5-9B63BDF7ABBD-- From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 21:16:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A5CFCA3; Wed, 17 Dec 2014 21:16:56 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6341E41; Wed, 17 Dec 2014 21:16:56 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sBHLGs0a095276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Dec 2014 13:16:54 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sBHLGsc0095275; Wed, 17 Dec 2014 13:16:54 -0800 (PST) (envelope-from sgk) Date: Wed, 17 Dec 2014 13:16:54 -0800 From: Steve Kargl To: Garrett Cooper Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src Message-ID: <20141217211654.GA95193@troutmask.apl.washington.edu> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 21:16:56 -0000 On Wed, Dec 17, 2014 at 12:48:37PM -0800, Garrett Cooper wrote: > On Dec 17, 2014, at 11:12, Steve Kargl wrote: > > > On Wed, Dec 17, 2014 at 04:30:32PM +0100, Ed Schouten wrote: > > ? > > >>> This comment isn't true! These functions pre-date C11 by years. > >>> See r151865. These functions were designed to deal with gcc's > >>> poorly implemented I. See the paragraph above your comment. > >> > >> Keep in mind that the phrasing is intended to say that CMPLX*() and > >> friends are part of C11. Those do not pre-date C11. > > > > The phrasing is wrong. cpack[fl] came at least 6 years before > C11 and were designed to work around defects in C99. CMPLX[FL] > > were introduced into C11 to address those defects. Changing > > cpack[fl] to CMPLX[FL] and claiming that the functions are > > modeled after the C11 macros is wrong (unless the meaning of > > "before" and "after" have changed). > > Hi Dimitry/Ed/Steve, > Does it make sense to take the logic that Ed added and guard it with a conditional so people building the functions can use the C+11 definitions instead of the C99 definitions? This could preserve the old behavior for folks who don?t have C+11 capable compilers, but would allow us (and others) who do via clang or newer versions of gcc to use the new C+11 idioms, similar to some of the other macros in sys/cdefs.h, et al. > Thank you! Ed's patch works for non-C11 compilers. His patch to math_private.h contained, for example, #ifndef CMPLXF static __inline float complex CMPLXF(float x, float y) { float_complex z; REALPART(z) = x; IMAGPART(z) = y; return (z.f); } #endif IMNSHO, the correct patch should have been #ifdef CMPLXF #define cpackf(x, y) CMPLXF((x), (y)) #else static __inline float complex cpackf(float x, float y) { float_complex z; REALPART(z) = x; IMAGPART(z) = y; return (z.f); } #endif Ed's diff is ~1000 lines and touches several files. Localizing the change to math_private.h would have been a ~20 line diff to a single file. -- Steve From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 21:26:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8A75B8; Wed, 17 Dec 2014 21:26:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 94AB41F4E; Wed, 17 Dec 2014 21:26:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHLQQGj016052; Wed, 17 Dec 2014 21:26:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHLQQm4016051; Wed, 17 Dec 2014 21:26:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201412172126.sBHLQQm4016051@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 17 Dec 2014 21:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275870 - head/sys/dev/mwl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 21:26:26 -0000 Author: adrian Date: Wed Dec 17 21:26:25 2014 New Revision: 275870 URL: https://svnweb.freebsd.org/changeset/base/275870 Log: Use the correct macro for listing the maximum bus space size. Without this, it fails to compile on i386 PAE builds. Modified: head/sys/dev/mwl/if_mwl_pci.c Modified: head/sys/dev/mwl/if_mwl_pci.c ============================================================================== --- head/sys/dev/mwl/if_mwl_pci.c Wed Dec 17 20:34:38 2014 (r275869) +++ head/sys/dev/mwl/if_mwl_pci.c Wed Dec 17 21:26:25 2014 (r275870) @@ -178,9 +178,9 @@ mwl_pci_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXADDR, /* maxsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ MWL_TXDESC, /* nsegments */ - BUS_SPACE_MAXADDR, /* maxsegsize */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 21:27:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDA241FD; Wed, 17 Dec 2014 21:27:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D9B731F5D; Wed, 17 Dec 2014 21:27:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHLRS3w016221; Wed, 17 Dec 2014 21:27:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHLRS7e016220; Wed, 17 Dec 2014 21:27:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201412172127.sBHLRS7e016220@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 17 Dec 2014 21:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275871 - head/sys/dev/malo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 21:27:29 -0000 Author: adrian Date: Wed Dec 17 21:27:27 2014 New Revision: 275871 URL: https://svnweb.freebsd.org/changeset/base/275871 Log: Update the use of bus space macros to be more correct. This was a problem on i386 PAE builds. Modified: head/sys/dev/malo/if_malo_pci.c Modified: head/sys/dev/malo/if_malo_pci.c ============================================================================== --- head/sys/dev/malo/if_malo_pci.c Wed Dec 17 21:26:25 2014 (r275870) +++ head/sys/dev/malo/if_malo_pci.c Wed Dec 17 21:27:27 2014 (r275871) @@ -225,9 +225,9 @@ malo_pci_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXADDR, /* maxsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ 0, /* nsegments */ - BUS_SPACE_MAXADDR, /* maxsegsize */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 21:36:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67713402; Wed, 17 Dec 2014 21:36:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 51263104; Wed, 17 Dec 2014 21:36:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHLakoj020835; Wed, 17 Dec 2014 21:36:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHLakDJ020834; Wed, 17 Dec 2014 21:36:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412172136.sBHLakDJ020834@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Dec 2014 21:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275872 - in stable: 10/contrib/llvm/tools/clang/lib/CodeGen 9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 21:36:46 -0000 Author: dim Date: Wed Dec 17 21:36:45 2014 New Revision: 275872 URL: https://svnweb.freebsd.org/changeset/base/275872 Log: MFC r275759: Pull in r221170 from upstream clang trunk (by Roman Divacky): Implement vaarg lowering for ppc32. Lowering of scalars and aggregates is supported. Complex numbers are not. This adds va_args support for PowerPC (32 bit) to clang. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D1308 Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Wed Dec 17 21:27:27 2014 (r275871) +++ stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Wed Dec 17 21:36:45 2014 (r275872) @@ -2733,11 +2733,19 @@ llvm::Value *NaClX86_64ABIInfo::EmitVAAr // PowerPC-32 - namespace { -class PPC32TargetCodeGenInfo : public DefaultTargetCodeGenInfo { +/// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. +class PPC32_SVR4_ABIInfo : public DefaultABIInfo { public: - PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : DefaultTargetCodeGenInfo(CGT) {} + PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} + + llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, + CodeGenFunction &CGF) const; +}; + +class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { +public: + PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT)) {} int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const { // This is recovered from gcc output. @@ -2750,6 +2758,96 @@ public: } +llvm::Value *PPC32_SVR4_ABIInfo::EmitVAArg(llvm::Value *VAListAddr, + QualType Ty, + CodeGenFunction &CGF) const { + if (const ComplexType *CTy = Ty->getAs()) { + // TODO: Implement this. For now ignore. + (void)CTy; + return NULL; + } + + bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64; + bool isInt = Ty->isIntegerType() || Ty->isPointerType() || Ty->isAggregateType(); + llvm::Type *CharPtr = CGF.Int8PtrTy; + llvm::Type *CharPtrPtr = CGF.Int8PtrPtrTy; + + CGBuilderTy &Builder = CGF.Builder; + llvm::Value *GPRPtr = Builder.CreateBitCast(VAListAddr, CharPtr, "gprptr"); + llvm::Value *GPRPtrAsInt = Builder.CreatePtrToInt(GPRPtr, CGF.Int32Ty); + llvm::Value *FPRPtrAsInt = Builder.CreateAdd(GPRPtrAsInt, Builder.getInt32(1)); + llvm::Value *FPRPtr = Builder.CreateIntToPtr(FPRPtrAsInt, CharPtr); + llvm::Value *OverflowAreaPtrAsInt = Builder.CreateAdd(FPRPtrAsInt, Builder.getInt32(3)); + llvm::Value *OverflowAreaPtr = Builder.CreateIntToPtr(OverflowAreaPtrAsInt, CharPtrPtr); + llvm::Value *RegsaveAreaPtrAsInt = Builder.CreateAdd(OverflowAreaPtrAsInt, Builder.getInt32(4)); + llvm::Value *RegsaveAreaPtr = Builder.CreateIntToPtr(RegsaveAreaPtrAsInt, CharPtrPtr); + llvm::Value *GPR = Builder.CreateLoad(GPRPtr, false, "gpr"); + // Align GPR when TY is i64. + if (isI64) { + llvm::Value *GPRAnd = Builder.CreateAnd(GPR, Builder.getInt8(1)); + llvm::Value *CC64 = Builder.CreateICmpEQ(GPRAnd, Builder.getInt8(1)); + llvm::Value *GPRPlusOne = Builder.CreateAdd(GPR, Builder.getInt8(1)); + GPR = Builder.CreateSelect(CC64, GPRPlusOne, GPR); + } + llvm::Value *FPR = Builder.CreateLoad(FPRPtr, false, "fpr"); + llvm::Value *OverflowArea = Builder.CreateLoad(OverflowAreaPtr, false, "overflow_area"); + llvm::Value *OverflowAreaAsInt = Builder.CreatePtrToInt(OverflowArea, CGF.Int32Ty); + llvm::Value *RegsaveArea = Builder.CreateLoad(RegsaveAreaPtr, false, "regsave_area"); + llvm::Value *RegsaveAreaAsInt = Builder.CreatePtrToInt(RegsaveArea, CGF.Int32Ty); + + llvm::Value *CC = Builder.CreateICmpULT(isInt ? GPR : FPR, + Builder.getInt8(8), "cond"); + + llvm::Value *RegConstant = Builder.CreateMul(isInt ? GPR : FPR, + Builder.getInt8(isInt ? 4 : 8)); + + llvm::Value *OurReg = Builder.CreateAdd(RegsaveAreaAsInt, Builder.CreateSExt(RegConstant, CGF.Int32Ty)); + + if (Ty->isFloatingType()) + OurReg = Builder.CreateAdd(OurReg, Builder.getInt32(32)); + + llvm::BasicBlock *UsingRegs = CGF.createBasicBlock("using_regs"); + llvm::BasicBlock *UsingOverflow = CGF.createBasicBlock("using_overflow"); + llvm::BasicBlock *Cont = CGF.createBasicBlock("cont"); + + Builder.CreateCondBr(CC, UsingRegs, UsingOverflow); + + CGF.EmitBlock(UsingRegs); + + llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); + llvm::Value *Result1 = Builder.CreateIntToPtr(OurReg, PTy); + // Increase the GPR/FPR indexes. + if (isInt) { + GPR = Builder.CreateAdd(GPR, Builder.getInt8(isI64 ? 2 : 1)); + Builder.CreateStore(GPR, GPRPtr); + } else { + FPR = Builder.CreateAdd(FPR, Builder.getInt8(1)); + Builder.CreateStore(FPR, FPRPtr); + } + CGF.EmitBranch(Cont); + + CGF.EmitBlock(UsingOverflow); + + // Increase the overflow area. + llvm::Value *Result2 = Builder.CreateIntToPtr(OverflowAreaAsInt, PTy); + OverflowAreaAsInt = Builder.CreateAdd(OverflowAreaAsInt, Builder.getInt32(isInt ? 4 : 8)); + Builder.CreateStore(Builder.CreateIntToPtr(OverflowAreaAsInt, CharPtr), OverflowAreaPtr); + CGF.EmitBranch(Cont); + + CGF.EmitBlock(Cont); + + llvm::PHINode *Result = CGF.Builder.CreatePHI(PTy, 2, "vaarg.addr"); + Result->addIncoming(Result1, UsingRegs); + Result->addIncoming(Result2, UsingOverflow); + + if (Ty->isAggregateType()) { + llvm::Value *AGGPtr = Builder.CreateBitCast(Result, CharPtrPtr, "aggrptr") ; + return Builder.CreateLoad(AGGPtr, false, "aggr"); + } + + return Result; +} + bool PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const { From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 21:36:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B958403; Wed, 17 Dec 2014 21:36:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 05162105; Wed, 17 Dec 2014 21:36:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBHLakNj020846; Wed, 17 Dec 2014 21:36:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHLakR5020845; Wed, 17 Dec 2014 21:36:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412172136.sBHLakR5020845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Dec 2014 21:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275872 - in stable: 10/contrib/llvm/tools/clang/lib/CodeGen 9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 21:36:47 -0000 Author: dim Date: Wed Dec 17 21:36:45 2014 New Revision: 275872 URL: https://svnweb.freebsd.org/changeset/base/275872 Log: MFC r275759: Pull in r221170 from upstream clang trunk (by Roman Divacky): Implement vaarg lowering for ppc32. Lowering of scalars and aggregates is supported. Complex numbers are not. This adds va_args support for PowerPC (32 bit) to clang. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D1308 Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Wed Dec 17 21:27:27 2014 (r275871) +++ stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Wed Dec 17 21:36:45 2014 (r275872) @@ -2733,11 +2733,19 @@ llvm::Value *NaClX86_64ABIInfo::EmitVAAr // PowerPC-32 - namespace { -class PPC32TargetCodeGenInfo : public DefaultTargetCodeGenInfo { +/// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. +class PPC32_SVR4_ABIInfo : public DefaultABIInfo { public: - PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : DefaultTargetCodeGenInfo(CGT) {} + PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} + + llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, + CodeGenFunction &CGF) const; +}; + +class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { +public: + PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT)) {} int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const { // This is recovered from gcc output. @@ -2750,6 +2758,96 @@ public: } +llvm::Value *PPC32_SVR4_ABIInfo::EmitVAArg(llvm::Value *VAListAddr, + QualType Ty, + CodeGenFunction &CGF) const { + if (const ComplexType *CTy = Ty->getAs()) { + // TODO: Implement this. For now ignore. + (void)CTy; + return NULL; + } + + bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64; + bool isInt = Ty->isIntegerType() || Ty->isPointerType() || Ty->isAggregateType(); + llvm::Type *CharPtr = CGF.Int8PtrTy; + llvm::Type *CharPtrPtr = CGF.Int8PtrPtrTy; + + CGBuilderTy &Builder = CGF.Builder; + llvm::Value *GPRPtr = Builder.CreateBitCast(VAListAddr, CharPtr, "gprptr"); + llvm::Value *GPRPtrAsInt = Builder.CreatePtrToInt(GPRPtr, CGF.Int32Ty); + llvm::Value *FPRPtrAsInt = Builder.CreateAdd(GPRPtrAsInt, Builder.getInt32(1)); + llvm::Value *FPRPtr = Builder.CreateIntToPtr(FPRPtrAsInt, CharPtr); + llvm::Value *OverflowAreaPtrAsInt = Builder.CreateAdd(FPRPtrAsInt, Builder.getInt32(3)); + llvm::Value *OverflowAreaPtr = Builder.CreateIntToPtr(OverflowAreaPtrAsInt, CharPtrPtr); + llvm::Value *RegsaveAreaPtrAsInt = Builder.CreateAdd(OverflowAreaPtrAsInt, Builder.getInt32(4)); + llvm::Value *RegsaveAreaPtr = Builder.CreateIntToPtr(RegsaveAreaPtrAsInt, CharPtrPtr); + llvm::Value *GPR = Builder.CreateLoad(GPRPtr, false, "gpr"); + // Align GPR when TY is i64. + if (isI64) { + llvm::Value *GPRAnd = Builder.CreateAnd(GPR, Builder.getInt8(1)); + llvm::Value *CC64 = Builder.CreateICmpEQ(GPRAnd, Builder.getInt8(1)); + llvm::Value *GPRPlusOne = Builder.CreateAdd(GPR, Builder.getInt8(1)); + GPR = Builder.CreateSelect(CC64, GPRPlusOne, GPR); + } + llvm::Value *FPR = Builder.CreateLoad(FPRPtr, false, "fpr"); + llvm::Value *OverflowArea = Builder.CreateLoad(OverflowAreaPtr, false, "overflow_area"); + llvm::Value *OverflowAreaAsInt = Builder.CreatePtrToInt(OverflowArea, CGF.Int32Ty); + llvm::Value *RegsaveArea = Builder.CreateLoad(RegsaveAreaPtr, false, "regsave_area"); + llvm::Value *RegsaveAreaAsInt = Builder.CreatePtrToInt(RegsaveArea, CGF.Int32Ty); + + llvm::Value *CC = Builder.CreateICmpULT(isInt ? GPR : FPR, + Builder.getInt8(8), "cond"); + + llvm::Value *RegConstant = Builder.CreateMul(isInt ? GPR : FPR, + Builder.getInt8(isInt ? 4 : 8)); + + llvm::Value *OurReg = Builder.CreateAdd(RegsaveAreaAsInt, Builder.CreateSExt(RegConstant, CGF.Int32Ty)); + + if (Ty->isFloatingType()) + OurReg = Builder.CreateAdd(OurReg, Builder.getInt32(32)); + + llvm::BasicBlock *UsingRegs = CGF.createBasicBlock("using_regs"); + llvm::BasicBlock *UsingOverflow = CGF.createBasicBlock("using_overflow"); + llvm::BasicBlock *Cont = CGF.createBasicBlock("cont"); + + Builder.CreateCondBr(CC, UsingRegs, UsingOverflow); + + CGF.EmitBlock(UsingRegs); + + llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); + llvm::Value *Result1 = Builder.CreateIntToPtr(OurReg, PTy); + // Increase the GPR/FPR indexes. + if (isInt) { + GPR = Builder.CreateAdd(GPR, Builder.getInt8(isI64 ? 2 : 1)); + Builder.CreateStore(GPR, GPRPtr); + } else { + FPR = Builder.CreateAdd(FPR, Builder.getInt8(1)); + Builder.CreateStore(FPR, FPRPtr); + } + CGF.EmitBranch(Cont); + + CGF.EmitBlock(UsingOverflow); + + // Increase the overflow area. + llvm::Value *Result2 = Builder.CreateIntToPtr(OverflowAreaAsInt, PTy); + OverflowAreaAsInt = Builder.CreateAdd(OverflowAreaAsInt, Builder.getInt32(isInt ? 4 : 8)); + Builder.CreateStore(Builder.CreateIntToPtr(OverflowAreaAsInt, CharPtr), OverflowAreaPtr); + CGF.EmitBranch(Cont); + + CGF.EmitBlock(Cont); + + llvm::PHINode *Result = CGF.Builder.CreatePHI(PTy, 2, "vaarg.addr"); + Result->addIncoming(Result1, UsingRegs); + Result->addIncoming(Result2, UsingOverflow); + + if (Ty->isAggregateType()) { + llvm::Value *AGGPtr = Builder.CreateBitCast(Result, CharPtrPtr, "aggrptr") ; + return Builder.CreateLoad(AGGPtr, false, "aggr"); + } + + return Result; +} + bool PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const { From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 03:12:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4023CE98; Thu, 18 Dec 2014 03:12:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 20C42FC7; Thu, 18 Dec 2014 03:12:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI3CkOw078347; Thu, 18 Dec 2014 03:12:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI3Ck6a078346; Thu, 18 Dec 2014 03:12:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201412180312.sBI3Ck6a078346@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 18 Dec 2014 03:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275873 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 03:12:47 -0000 Author: jhibbits Date: Thu Dec 18 03:12:46 2014 New Revision: 275873 URL: https://svnweb.freebsd.org/changeset/base/275873 Log: Make gas parse '__tls_get_addr(foo@tlsgd)'. Corresponds to 727fc41e077139570ea8b8ddfd6c546b2a55627c. This allows us to use -no-integrated-as with clang, if we prefer. Obtained from: binutils-gdb (Relicensed from Alan Modra as GPLv2) MFC after: 2 weeks X-MFC-with: r275718 Modified: head/contrib/binutils/gas/config/tc-ppc.c Modified: head/contrib/binutils/gas/config/tc-ppc.c ============================================================================== --- head/contrib/binutils/gas/config/tc-ppc.c Wed Dec 17 21:36:45 2014 (r275872) +++ head/contrib/binutils/gas/config/tc-ppc.c Thu Dec 18 03:12:46 2014 (r275873) @@ -2509,121 +2509,168 @@ md_assemble (char *str) (char *) NULL, 0); } #ifdef OBJ_ELF - else if ((reloc = ppc_elf_suffix (&str, &ex)) != BFD_RELOC_UNUSED) + else { - /* Some TLS tweaks. */ - switch (reloc) + if (ex.X_op == O_symbol && str[0] == '(') { - default: - break; - case BFD_RELOC_PPC_TLS: - insn = ppc_insert_operand (insn, operand, ppc_obj64 ? 13 : 2, - (char *) NULL, 0); - break; - /* We'll only use the 32 (or 64) bit form of these relocations - in constants. Instructions get the 16 bit form. */ - case BFD_RELOC_PPC_DTPREL: - reloc = BFD_RELOC_PPC_DTPREL16; - break; - case BFD_RELOC_PPC_TPREL: - reloc = BFD_RELOC_PPC_TPREL16; - break; - } + const char *sym_name = S_GET_NAME (ex.X_add_symbol); + if (sym_name[0] == '.') + ++sym_name; - /* For the absolute forms of branches, convert the PC - relative form back into the absolute. */ - if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0) - { - switch (reloc) + if (strcasecmp (sym_name, "__tls_get_addr") == 0) { - case BFD_RELOC_PPC_B26: - reloc = BFD_RELOC_PPC_BA26; - break; - case BFD_RELOC_PPC_B16: - reloc = BFD_RELOC_PPC_BA16; - break; - case BFD_RELOC_PPC_B16_BRTAKEN: - reloc = BFD_RELOC_PPC_BA16_BRTAKEN; - break; - case BFD_RELOC_PPC_B16_BRNTAKEN: - reloc = BFD_RELOC_PPC_BA16_BRNTAKEN; - break; - default: - break; + expressionS tls_exp; + + hold = input_line_pointer; + input_line_pointer = str + 1; + expression (&tls_exp); + if (tls_exp.X_op == O_symbol) + { + reloc = BFD_RELOC_UNUSED; + if (strncasecmp (input_line_pointer, "@tlsgd)", 7) == 0) + { + reloc = BFD_RELOC_PPC_TLSGD; + input_line_pointer += 7; + } + else if (strncasecmp (input_line_pointer, "@tlsld)", 7) == 0) + { + reloc = BFD_RELOC_PPC_TLSLD; + input_line_pointer += 7; + } + if (reloc != BFD_RELOC_UNUSED) + { + SKIP_WHITESPACE (); + str = input_line_pointer; + + if (fc >= MAX_INSN_FIXUPS) + as_fatal (_("too many fixups")); + fixups[fc].exp = tls_exp; + fixups[fc].opindex = *opindex_ptr; + fixups[fc].reloc = reloc; + ++fc; + } + } + input_line_pointer = hold; } } - if (ppc_obj64 - && (operand->flags & (PPC_OPERAND_DS | PPC_OPERAND_DQ)) != 0) + if ((reloc = ppc_elf_suffix (&str, &ex)) != BFD_RELOC_UNUSED) { + /* Some TLS tweaks. */ switch (reloc) { - case BFD_RELOC_16: - reloc = BFD_RELOC_PPC64_ADDR16_DS; - break; - case BFD_RELOC_LO16: - reloc = BFD_RELOC_PPC64_ADDR16_LO_DS; - break; - case BFD_RELOC_16_GOTOFF: - reloc = BFD_RELOC_PPC64_GOT16_DS; - break; - case BFD_RELOC_LO16_GOTOFF: - reloc = BFD_RELOC_PPC64_GOT16_LO_DS; - break; - case BFD_RELOC_LO16_PLTOFF: - reloc = BFD_RELOC_PPC64_PLT16_LO_DS; - break; - case BFD_RELOC_16_BASEREL: - reloc = BFD_RELOC_PPC64_SECTOFF_DS; - break; - case BFD_RELOC_LO16_BASEREL: - reloc = BFD_RELOC_PPC64_SECTOFF_LO_DS; - break; - case BFD_RELOC_PPC_TOC16: - reloc = BFD_RELOC_PPC64_TOC16_DS; - break; - case BFD_RELOC_PPC64_TOC16_LO: - reloc = BFD_RELOC_PPC64_TOC16_LO_DS; - break; - case BFD_RELOC_PPC64_PLTGOT16: - reloc = BFD_RELOC_PPC64_PLTGOT16_DS; - break; - case BFD_RELOC_PPC64_PLTGOT16_LO: - reloc = BFD_RELOC_PPC64_PLTGOT16_LO_DS; - break; - case BFD_RELOC_PPC_DTPREL16: - reloc = BFD_RELOC_PPC64_DTPREL16_DS; - break; - case BFD_RELOC_PPC_DTPREL16_LO: - reloc = BFD_RELOC_PPC64_DTPREL16_LO_DS; - break; - case BFD_RELOC_PPC_TPREL16: - reloc = BFD_RELOC_PPC64_TPREL16_DS; + default: break; - case BFD_RELOC_PPC_TPREL16_LO: - reloc = BFD_RELOC_PPC64_TPREL16_LO_DS; + + case BFD_RELOC_PPC_TLS: + insn = ppc_insert_operand (insn, operand, ppc_obj64 ? 13 : 2, + (char *) NULL, 0); break; - case BFD_RELOC_PPC_GOT_DTPREL16: - case BFD_RELOC_PPC_GOT_DTPREL16_LO: - case BFD_RELOC_PPC_GOT_TPREL16: - case BFD_RELOC_PPC_GOT_TPREL16_LO: + + /* We'll only use the 32 (or 64) bit form of these relocations + in constants. Instructions get the 16 bit form. */ + case BFD_RELOC_PPC_DTPREL: + reloc = BFD_RELOC_PPC_DTPREL16; break; - default: - as_bad (_("unsupported relocation for DS offset field")); + case BFD_RELOC_PPC_TPREL: + reloc = BFD_RELOC_PPC_TPREL16; break; } + + /* For the absolute forms of branches, convert the PC + relative form back into the absolute. */ + if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0) + { + switch (reloc) + { + case BFD_RELOC_PPC_B26: + reloc = BFD_RELOC_PPC_BA26; + break; + case BFD_RELOC_PPC_B16: + reloc = BFD_RELOC_PPC_BA16; + break; + case BFD_RELOC_PPC_B16_BRTAKEN: + reloc = BFD_RELOC_PPC_BA16_BRTAKEN; + break; + case BFD_RELOC_PPC_B16_BRNTAKEN: + reloc = BFD_RELOC_PPC_BA16_BRNTAKEN; + break; + default: + break; + } + } + + if (ppc_obj64 + && (operand->flags & (PPC_OPERAND_DS | PPC_OPERAND_DQ)) != 0) + { + switch (reloc) + { + case BFD_RELOC_16: + reloc = BFD_RELOC_PPC64_ADDR16_DS; + break; + case BFD_RELOC_LO16: + reloc = BFD_RELOC_PPC64_ADDR16_LO_DS; + break; + case BFD_RELOC_16_GOTOFF: + reloc = BFD_RELOC_PPC64_GOT16_DS; + break; + case BFD_RELOC_LO16_GOTOFF: + reloc = BFD_RELOC_PPC64_GOT16_LO_DS; + break; + case BFD_RELOC_LO16_PLTOFF: + reloc = BFD_RELOC_PPC64_PLT16_LO_DS; + break; + case BFD_RELOC_16_BASEREL: + reloc = BFD_RELOC_PPC64_SECTOFF_DS; + break; + case BFD_RELOC_LO16_BASEREL: + reloc = BFD_RELOC_PPC64_SECTOFF_LO_DS; + break; + case BFD_RELOC_PPC_TOC16: + reloc = BFD_RELOC_PPC64_TOC16_DS; + break; + case BFD_RELOC_PPC64_TOC16_LO: + reloc = BFD_RELOC_PPC64_TOC16_LO_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16: + reloc = BFD_RELOC_PPC64_PLTGOT16_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO: + reloc = BFD_RELOC_PPC64_PLTGOT16_LO_DS; + break; + case BFD_RELOC_PPC_DTPREL16: + reloc = BFD_RELOC_PPC64_DTPREL16_DS; + break; + case BFD_RELOC_PPC_DTPREL16_LO: + reloc = BFD_RELOC_PPC64_DTPREL16_LO_DS; + break; + case BFD_RELOC_PPC_TPREL16: + reloc = BFD_RELOC_PPC64_TPREL16_DS; + break; + case BFD_RELOC_PPC_TPREL16_LO: + reloc = BFD_RELOC_PPC64_TPREL16_LO_DS; + break; + case BFD_RELOC_PPC_GOT_DTPREL16: + case BFD_RELOC_PPC_GOT_DTPREL16_LO: + case BFD_RELOC_PPC_GOT_TPREL16: + case BFD_RELOC_PPC_GOT_TPREL16_LO: + break; + default: + as_bad (_("unsupported relocation for DS offset field")); + break; + } + } } /* We need to generate a fixup for this expression. */ if (fc >= MAX_INSN_FIXUPS) as_fatal (_("too many fixups")); fixups[fc].exp = ex; - fixups[fc].opindex = 0; + fixups[fc].opindex = *opindex_ptr; fixups[fc].reloc = reloc; ++fc; } -#endif /* OBJ_ELF */ - +#else /* OBJ_ELF */ else { /* We need to generate a fixup for this expression. */ @@ -2634,6 +2681,7 @@ md_assemble (char *str) fixups[fc].reloc = BFD_RELOC_UNUSED; ++fc; } +#endif /* OBJ_ELF */ if (need_paren) { @@ -5908,6 +5956,8 @@ md_apply_fix (fixS *fixP, valueT *valP, break; case BFD_RELOC_PPC_TLS: + case BFD_RELOC_PPC_TLSLD: + case BFD_RELOC_PPC_TLSGD: break; case BFD_RELOC_PPC_DTPMOD: From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 03:51:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DA9F451; Thu, 18 Dec 2014 03:51:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2E77812FD; Thu, 18 Dec 2014 03:51:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI3pBOS093977; Thu, 18 Dec 2014 03:51:11 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI3pA9h093973; Thu, 18 Dec 2014 03:51:10 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201412180351.sBI3pA9h093973@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 18 Dec 2014 03:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275874 - head/usr.sbin/bsdinstall/distextract X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 03:51:11 -0000 Author: dteske Date: Thu Dec 18 03:51:09 2014 New Revision: 275874 URL: https://svnweb.freebsd.org/changeset/base/275874 Log: In bsdinstall's distextract, replace mixed_gauge() of dialog(3) with new dpv(3) wrapper to dialog(3) dialog_gauge(). The dpv(3) library provides a more flexible and refined interface similar to dialog_mixedgauge() however is implemented atop the more generalized dialog_gauge() for portability. Noticeable improvements in bsdinstall's distextract will be a status line showing data rate information (with support for localeconv(3) to format numbers according to $LANG or $LC_ALL conversion information), i18n support, improved auto-sizing of gauge widget, a ``wheel barrow'' to keep the user informed that things are moving (even if status/progress has not changed), improved color support (mini-progress bars use the same color, if enabled, as the main gauge bar), and several other improvements (some not visible). dpv stands for "dialog progress view" (dpv was introduced in SVN r274116). Differential Revision: https://reviews.freebsd.org/D714 Discussed on: -current Reviewed by: julian MFC after: 3 days X-MFC-to: stable/10 Relnotes: Improved installer feedback from bsdinstall distextract Modified: head/usr.sbin/bsdinstall/distextract/Makefile head/usr.sbin/bsdinstall/distextract/distextract.c Modified: head/usr.sbin/bsdinstall/distextract/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/distextract/Makefile Thu Dec 18 03:12:46 2014 (r275873) +++ head/usr.sbin/bsdinstall/distextract/Makefile Thu Dec 18 03:51:09 2014 (r275874) @@ -2,7 +2,7 @@ BINDIR= /usr/libexec/bsdinstall PROG= distextract -LIBADD= archive ncursesw dialog m +LIBADD= archive dpv figpar ncursesw dialog m WARNS?= 6 MAN= Modified: head/usr.sbin/bsdinstall/distextract/distextract.c ============================================================================== --- head/usr.sbin/bsdinstall/distextract/distextract.c Thu Dec 18 03:12:46 2014 (r275873) +++ head/usr.sbin/bsdinstall/distextract/distextract.c Thu Dec 18 03:51:09 2014 (r275874) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -42,17 +43,13 @@ __FBSDID("$FreeBSD$"); /* Data to process */ static char *distdir = NULL; -struct file_node { - char *path; - char *name; - int length; - struct file_node *next; -}; -static struct file_node *dists = NULL; +static struct archive *archive = NULL; +static struct dpv_file_node *dists = NULL; /* Function prototypes */ +static void sig_int(int sig); static int count_files(const char *file); -static int extract_files(int nfiles, struct file_node *files); +static int extract_files(struct dpv_file_node *file, int out); #if __FreeBSD_version <= 1000008 /* r232154: bump for libarchive update */ #define archive_read_support_filter_all(x) \ @@ -66,11 +63,17 @@ main(void) { char *chrootdir; char *distributions; - int ndists = 0; int retval; - size_t file_node_size = sizeof(struct file_node); + size_t config_size = sizeof(struct dpv_config); + size_t file_node_size = sizeof(struct dpv_file_node); size_t span; - struct file_node *dist = dists; + struct dpv_config *config; + struct dpv_file_node *dist = dists; + static char backtitle[] = "FreeBSD Installer"; + static char title[] = "Archive Extraction"; + static char aprompt[] = "\n Overall Progress:"; + static char pprompt[] = "Extracting distribution files...\n"; + struct sigaction act; char error[PATH_MAX + 512]; if ((distributions = getenv("DISTRIBUTIONS")) == NULL) @@ -80,14 +83,14 @@ main(void) /* Initialize dialog(3) */ init_dialog(stdin, stdout); - dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer"); + dialog_vars.backtitle = backtitle; dlg_put_backtitle(); dialog_msgbox("", "Checking distribution archives.\nPlease wait...", 4, 35, FALSE); /* - * Parse $DISTRIBUTIONS into linked-list + * Parse $DISTRIBUTIONS into dpv(3) linked-list */ while (*distributions != '\0') { span = strcspn(distributions, "\t\n\v\f\r "); @@ -95,7 +98,6 @@ main(void) distributions++; continue; } - ndists++; /* Allocate a new struct for the distribution */ if (dist == NULL) { @@ -141,10 +143,30 @@ main(void) return (EXIT_FAILURE); } - retval = extract_files(ndists, dists); + /* Set cleanup routine for Ctrl-C action */ + act.sa_handler = sig_int; + sigaction(SIGINT, &act, 0); + /* + * Hand off to dpv(3) + */ + if ((config = calloc(1, config_size)) == NULL) + _errx(EXIT_FAILURE, "Out of memory!"); + config->backtitle = backtitle; + config->title = title; + config->pprompt = pprompt; + config->aprompt = aprompt; + config->options |= DPV_WIDE_MODE; + config->label_size = -1; + config->action = extract_files; + config->status_solo = + "%10lli files read @ %'9.1f files/sec."; + config->status_many = + "%10lli files read @ %'9.1f files/sec. [%i/%i busy/wait]"; end_dialog(); + retval = dpv(config, dists); + dpv_free(); while ((dist = dists) != NULL) { dists = dist->next; if (dist->path != NULL) @@ -155,6 +177,12 @@ main(void) return (retval); } +static void +sig_int(int sig __unused) +{ + dpv_interrupt = TRUE; +} + /* * Returns number of files in archive file. Parses $BSDINSTALL_DISTDIR/MANIFEST * if it exists, otherwise uses archive(3) to read the archive file. @@ -167,7 +195,6 @@ count_files(const char *file) int file_count; int retval; size_t span; - struct archive *archive; struct archive_entry *entry; char line[512]; char path[PATH_MAX]; @@ -220,6 +247,7 @@ count_files(const char *file) "Error while extracting %s: %s\n", file, archive_error_string(archive)); dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); + archive = NULL; return (-1); } @@ -227,49 +255,27 @@ count_files(const char *file) while (archive_read_next_header(archive, &entry) == ARCHIVE_OK) file_count++; archive_read_free(archive); + archive = NULL; return (file_count); } static int -extract_files(int nfiles, struct file_node *files) +extract_files(struct dpv_file_node *file, int out __unused) { - int archive_file; - int archive_files[nfiles]; - int current_files = 0; - int i; - int last_progress; - int progress = 0; int retval; - int total_files = 0; - struct archive *archive; struct archive_entry *entry; - struct file_node *file; - char status[8]; - static char title[] = "Archive Extraction"; - static char pprompt[] = "Extracting distribution files...\n"; char path[PATH_MAX]; char errormsg[PATH_MAX + 512]; - const char *items[nfiles*2]; - - /* Make the transfer list for dialog */ - i = 0; - for (file = files; file != NULL; file = file->next) { - items[i*2] = file->name; - items[i*2 + 1] = "Pending"; - archive_files[i] = file->length; - - total_files += file->length; - i++; - } - i = 0; - for (file = files; file != NULL; file = file->next) { + /* Open the archive if necessary */ + if (archive == NULL) { if ((archive = archive_read_new()) == NULL) { snprintf(errormsg, sizeof(errormsg), "Error: %s\n", archive_error_string(NULL)); dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); - return (EXIT_FAILURE); + dpv_abort = 1; + return (-1); } archive_read_support_format_all(archive); archive_read_support_filter_all(archive); @@ -280,59 +286,44 @@ extract_files(int nfiles, struct file_no "Error opening %s: %s\n", file->name, archive_error_string(archive)); dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); - return (EXIT_FAILURE); - } - - items[i*2 + 1] = "In Progress"; - archive_file = 0; - - dialog_mixedgauge(title, pprompt, 0, 0, progress, nfiles, - __DECONST(char **, items)); - - while ((retval = archive_read_next_header(archive, &entry)) == - ARCHIVE_OK) { - last_progress = progress; - progress = (current_files*100)/total_files; - - snprintf(status, sizeof(status), "-%d", - (archive_file*100)/archive_files[i]); - items[i*2 + 1] = status; - - if (progress > last_progress) - dialog_mixedgauge(title, pprompt, 0, 0, - progress, nfiles, - __DECONST(char **, items)); - - retval = archive_read_extract(archive, entry, - ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_OWNER | - ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL | - ARCHIVE_EXTRACT_XATTR | ARCHIVE_EXTRACT_FFLAGS); - - if (retval != ARCHIVE_OK) - break; - - archive_file++; - current_files++; + file->status = DPV_STATUS_FAILED; + dpv_abort = 1; + return (-1); } + } - items[i*2 + 1] = "Done"; - - if (retval != ARCHIVE_EOF) { - snprintf(errormsg, sizeof(errormsg), - "Error while extracting %s: %s\n", items[i*2], - archive_error_string(archive)); - items[i*2 + 1] = "Failed"; - dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); - return (retval); - } + /* Read the next archive header */ + retval = archive_read_next_header(archive, &entry); - progress = (current_files*100)/total_files; - dialog_mixedgauge(title, pprompt, 0, 0, progress, nfiles, - __DECONST(char **, items)); + /* If that went well, perform the extraction */ + if (retval == ARCHIVE_OK) + retval = archive_read_extract(archive, entry, + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_OWNER | + ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL | + ARCHIVE_EXTRACT_XATTR | ARCHIVE_EXTRACT_FFLAGS); + /* Test for either EOF or error */ + if (retval == ARCHIVE_EOF) { archive_read_free(archive); - i++; + archive = NULL; + file->status = DPV_STATUS_DONE; + return (100); + } else if (retval != ARCHIVE_OK) { + snprintf(errormsg, sizeof(errormsg), + "Error while extracting %s: %s\n", file->name, + archive_error_string(archive)); + dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); + file->status = DPV_STATUS_FAILED; + dpv_abort = 1; + return (-1); } - return (EXIT_SUCCESS); + dpv_overall_read++; + file->read++; + + /* Calculate [overall] percentage of completion (if possible) */ + if (file->length >= 0) + return (file->read * 100 / file->length); + else + return (-1); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 05:17:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45122D06; Thu, 18 Dec 2014 05:17:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1834A1CE0; Thu, 18 Dec 2014 05:17:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI5HINV033296; Thu, 18 Dec 2014 05:17:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI5HICb033295; Thu, 18 Dec 2014 05:17:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201412180517.sBI5HICb033295@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 18 Dec 2014 05:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275875 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 05:17:19 -0000 Author: adrian Date: Thu Dec 18 05:17:18 2014 New Revision: 275875 URL: https://svnweb.freebsd.org/changeset/base/275875 Log: Fix the scan handling for 11b->11g upgrades in a world where, well, it's not just 11b/11g. The following was happening, and it's quite .. annoyingly grr-y. * create vap, setup wpa_supplicant with no bgscanning, etc - there's no call to ieee80211_media_change, so vap->iv_des_mode is IEEE80211_MODE_AUTO; * do ifconfig wlan0 scan - same thing, media_change doesn't get called, iv_des_mode stays as auto. * But then, run wpa_cli and do 'scan' - it'll do a media change. * if you're on 11ng, vap->iv_des_mode gets changed to IEEE80211_MODE_11NG * Then makescanlist() is called. There's a block of code that gets called if iv_des_mode != IEEE80211_MODE_AUTO, and it does this: if (vap->iv_des_mode != IEEE80211_MODE_11G || mode != IEEE80211_MODE_11B) continue; mode = IEEE80211_MODE_11G; /* upgrade */ * .. now, iv_des_mode is not IEEE80211_MODE_11G, so it always runs 'continue' * .. and thus the scan list stays empty and no further channel scans occur. Ever.(1) If you then disassociate and try associating to something, your scan table has likely been purged / aged out and you'll never see anything in the scan list. (1) You need to do 'ifconfig wlan0 mode auto' or just destroy/re-create the VAP to get working wireless again. Tested: * iwn(4) - intel 5300 wifi; STA mode; using wpa_supplicant; bgscan enabled -and- wpa_supplicant scanning. Thanks to: * Everyone who kept poking me about this and wondering why the hell their wifi would eventually stop seeing scan lists. Grr. I eventually snapped this evening and dug back into this code. Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Thu Dec 18 03:51:09 2014 (r275874) +++ head/sys/net80211/ieee80211_scan_sta.c Thu Dec 18 05:17:18 2014 (r275875) @@ -600,10 +600,12 @@ makescanlist(struct ieee80211_scan_state * so if the desired mode is 11g, then use * the 11b channel list but upgrade the mode. */ - if (vap->iv_des_mode != IEEE80211_MODE_11G || - mode != IEEE80211_MODE_11B) - continue; - mode = IEEE80211_MODE_11G; /* upgrade */ + if (vap->iv_des_mode == IEEE80211_MODE_11G) { + if (mode == IEEE80211_MODE_11G) /* Skip the G check */ + continue; + else if (mode == IEEE80211_MODE_11B) + mode = IEEE80211_MODE_11G; /* upgrade */ + } } } else { /* From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 07:37:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AF522C6; Thu, 18 Dec 2014 07:37:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 25F191049; Thu, 18 Dec 2014 07:37:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI7bMFm096698; Thu, 18 Dec 2014 07:37:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI7bMTj096697; Thu, 18 Dec 2014 07:37:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180737.sBI7bMTj096697@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 07:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275876 - stable/10/sys/geom/raid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 07:37:22 -0000 Author: mav Date: Thu Dec 18 07:37:21 2014 New Revision: 275876 URL: https://svnweb.freebsd.org/changeset/base/275876 Log: MFC r275475: Decode some binary fields of Intel metadata. Submitted by: Dmitry Luhtionov Modified: stable/10/sys/geom/raid/md_intel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/raid/md_intel.c ============================================================================== --- stable/10/sys/geom/raid/md_intel.c Thu Dec 18 05:17:18 2014 (r275875) +++ stable/10/sys/geom/raid/md_intel.c Thu Dec 18 07:37:21 2014 (r275876) @@ -366,6 +366,78 @@ intel_set_vol_curr_migr_unit(struct inte vol->curr_migr_unit_hi = curr_migr_unit >> 32; } +static char * +intel_status2str(int status) +{ + + switch (status) { + case INTEL_S_READY: + return ("READY"); + case INTEL_S_UNINITIALIZED: + return ("UNINITIALIZED"); + case INTEL_S_DEGRADED: + return ("DEGRADED"); + case INTEL_S_FAILURE: + return ("FAILURE"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_type2str(int type) +{ + + switch (type) { + case INTEL_T_RAID0: + return ("RAID0"); + case INTEL_T_RAID1: + return ("RAID1"); + case INTEL_T_RAID5: + return ("RAID5"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_cngst2str(int cng_state) +{ + + switch (cng_state) { + case INTEL_CNGST_UPDATED: + return ("UPDATED"); + case INTEL_CNGST_NEEDS_UPDATE: + return ("NEEDS_UPDATE"); + case INTEL_CNGST_MASTER_MISSING: + return ("MASTER_MISSING"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_mt2str(int type) +{ + + switch (type) { + case INTEL_MT_INIT: + return ("INIT"); + case INTEL_MT_REBUILD: + return ("REBUILD"); + case INTEL_MT_VERIFY: + return ("VERIFY"); + case INTEL_MT_GEN_MIGR: + return ("GEN_MIGR"); + case INTEL_MT_STATE_CHANGE: + return ("STATE_CHANGE"); + case INTEL_MT_REPAIR: + return ("REPAIR"); + default: + return ("UNKNOWN"); + } +} + static void g_raid_md_intel_print(struct intel_raid_conf *meta) { @@ -384,7 +456,22 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); printf("error_log_size %d\n", meta->error_log_size); - printf("attributes 0x%08x\n", meta->attributes); + printf("attributes 0x%b\n", meta->attributes, + "\020" + "\001RAID0" + "\002RAID1" + "\003RAID10" + "\004RAID1E" + "\005RAID15" + "\006RAIDCNG" + "\007EXT_STRIP" + "\032NVM_CACHE" + "\0332TB_DISK" + "\034BBM" + "\035NVM_CACHE" + "\0362TB" + "\037PM" + "\040CHECKSUM"); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); printf("error_log_pos %u\n", meta->error_log_pos); @@ -392,32 +479,50 @@ g_raid_md_intel_print(struct intel_raid_ printf("orig_config_id 0x%08x\n", meta->orig_config_id); printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); + printf("Flags: S - Spare, A - Assigned, F - Failed, O - Online, D - Disabled\n"); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%b %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, meta->disk[i].sectors_hi, meta->disk[i].id, - meta->disk[i].flags, meta->disk[i].owner_cfg_num); + meta->disk[i].flags, "\20\01S\02A\03F\04O\05D", + meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state 0x%08x\n", mvol->state); + printf(" state 0x%b\n", mvol->state, + "\020" + "\001BOOTABLE" + "\002BOOT_DEVICE" + "\003READ_COALESCING" + "\004WRITE_COALESCING" + "\005LAST_SHUTDOWN_DIRTY" + "\006HIDDEN_AT_BOOT" + "\007CURRENTLY_HIDDEN" + "\010VERIFY_AND_FIX" + "\011MAP_STATE_UNINIT" + "\012NO_AUTO_RECOVERY" + "\013CLONE_N_GO" + "\014CLONE_MAN_SYNC" + "\015CNG_MASTER_DISK_NUM"); printf(" reserved %u\n", mvol->reserved); printf(" migr_priority %u\n", mvol->migr_priority); printf(" num_sub_vols %u\n", mvol->num_sub_vols); printf(" tid %u\n", mvol->tid); printf(" cng_master_disk %u\n", mvol->cng_master_disk); printf(" cache_policy %u\n", mvol->cache_policy); - printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_state %u (%s)\n", mvol->cng_state, + intel_cngst2str(mvol->cng_state)); printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); printf(" migr_state %u\n", mvol->migr_state); - printf(" migr_type %u\n", mvol->migr_type); + printf(" migr_type %u (%s)\n", mvol->migr_type, + intel_mt2str(mvol->migr_type)); printf(" dirty %u\n", mvol->dirty); printf(" fs_state %u\n", mvol->fs_state); printf(" verify_errors %u\n", mvol->verify_errors); @@ -433,8 +538,10 @@ g_raid_md_intel_print(struct intel_raid_ printf(" stripe_count %u\n", mmap->stripe_count); printf(" stripe_count_hi %u\n", mmap->stripe_count_hi); printf(" strip_sectors %u\n", mmap->strip_sectors); - printf(" status %u\n", mmap->status); - printf(" type %u\n", mmap->type); + printf(" status %u (%s)\n", mmap->status, + intel_status2str(mmap->status)); + printf(" type %u (%s)\n", mmap->type, + intel_type2str(mmap->type)); printf(" total_disks %u\n", mmap->total_disks); printf(" total_domains %u\n", mmap->total_domains); printf(" failed_disk_num %u\n", mmap->failed_disk_num); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 07:38:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A23E40F; Thu, 18 Dec 2014 07:38:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 34D9E1062; Thu, 18 Dec 2014 07:38:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI7cgTG096908; Thu, 18 Dec 2014 07:38:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI7cgvd096907; Thu, 18 Dec 2014 07:38:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180738.sBI7cgvd096907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 07:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275877 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 07:38:42 -0000 Author: mav Date: Thu Dec 18 07:38:41 2014 New Revision: 275877 URL: https://svnweb.freebsd.org/changeset/base/275877 Log: MFC r275475: Decode some binary fields of Intel metadata. Submitted by: Dmitry Luhtionov Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Dec 18 07:37:21 2014 (r275876) +++ stable/9/sys/geom/raid/md_intel.c Thu Dec 18 07:38:41 2014 (r275877) @@ -366,6 +366,78 @@ intel_set_vol_curr_migr_unit(struct inte vol->curr_migr_unit_hi = curr_migr_unit >> 32; } +static char * +intel_status2str(int status) +{ + + switch (status) { + case INTEL_S_READY: + return ("READY"); + case INTEL_S_UNINITIALIZED: + return ("UNINITIALIZED"); + case INTEL_S_DEGRADED: + return ("DEGRADED"); + case INTEL_S_FAILURE: + return ("FAILURE"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_type2str(int type) +{ + + switch (type) { + case INTEL_T_RAID0: + return ("RAID0"); + case INTEL_T_RAID1: + return ("RAID1"); + case INTEL_T_RAID5: + return ("RAID5"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_cngst2str(int cng_state) +{ + + switch (cng_state) { + case INTEL_CNGST_UPDATED: + return ("UPDATED"); + case INTEL_CNGST_NEEDS_UPDATE: + return ("NEEDS_UPDATE"); + case INTEL_CNGST_MASTER_MISSING: + return ("MASTER_MISSING"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_mt2str(int type) +{ + + switch (type) { + case INTEL_MT_INIT: + return ("INIT"); + case INTEL_MT_REBUILD: + return ("REBUILD"); + case INTEL_MT_VERIFY: + return ("VERIFY"); + case INTEL_MT_GEN_MIGR: + return ("GEN_MIGR"); + case INTEL_MT_STATE_CHANGE: + return ("STATE_CHANGE"); + case INTEL_MT_REPAIR: + return ("REPAIR"); + default: + return ("UNKNOWN"); + } +} + static void g_raid_md_intel_print(struct intel_raid_conf *meta) { @@ -384,7 +456,22 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); printf("error_log_size %d\n", meta->error_log_size); - printf("attributes 0x%08x\n", meta->attributes); + printf("attributes 0x%b\n", meta->attributes, + "\020" + "\001RAID0" + "\002RAID1" + "\003RAID10" + "\004RAID1E" + "\005RAID15" + "\006RAIDCNG" + "\007EXT_STRIP" + "\032NVM_CACHE" + "\0332TB_DISK" + "\034BBM" + "\035NVM_CACHE" + "\0362TB" + "\037PM" + "\040CHECKSUM"); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); printf("error_log_pos %u\n", meta->error_log_pos); @@ -392,32 +479,50 @@ g_raid_md_intel_print(struct intel_raid_ printf("orig_config_id 0x%08x\n", meta->orig_config_id); printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); + printf("Flags: S - Spare, A - Assigned, F - Failed, O - Online, D - Disabled\n"); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%b %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, meta->disk[i].sectors_hi, meta->disk[i].id, - meta->disk[i].flags, meta->disk[i].owner_cfg_num); + meta->disk[i].flags, "\20\01S\02A\03F\04O\05D", + meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state 0x%08x\n", mvol->state); + printf(" state 0x%b\n", mvol->state, + "\020" + "\001BOOTABLE" + "\002BOOT_DEVICE" + "\003READ_COALESCING" + "\004WRITE_COALESCING" + "\005LAST_SHUTDOWN_DIRTY" + "\006HIDDEN_AT_BOOT" + "\007CURRENTLY_HIDDEN" + "\010VERIFY_AND_FIX" + "\011MAP_STATE_UNINIT" + "\012NO_AUTO_RECOVERY" + "\013CLONE_N_GO" + "\014CLONE_MAN_SYNC" + "\015CNG_MASTER_DISK_NUM"); printf(" reserved %u\n", mvol->reserved); printf(" migr_priority %u\n", mvol->migr_priority); printf(" num_sub_vols %u\n", mvol->num_sub_vols); printf(" tid %u\n", mvol->tid); printf(" cng_master_disk %u\n", mvol->cng_master_disk); printf(" cache_policy %u\n", mvol->cache_policy); - printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_state %u (%s)\n", mvol->cng_state, + intel_cngst2str(mvol->cng_state)); printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); printf(" migr_state %u\n", mvol->migr_state); - printf(" migr_type %u\n", mvol->migr_type); + printf(" migr_type %u (%s)\n", mvol->migr_type, + intel_mt2str(mvol->migr_type)); printf(" dirty %u\n", mvol->dirty); printf(" fs_state %u\n", mvol->fs_state); printf(" verify_errors %u\n", mvol->verify_errors); @@ -433,8 +538,10 @@ g_raid_md_intel_print(struct intel_raid_ printf(" stripe_count %u\n", mmap->stripe_count); printf(" stripe_count_hi %u\n", mmap->stripe_count_hi); printf(" strip_sectors %u\n", mmap->strip_sectors); - printf(" status %u\n", mmap->status); - printf(" type %u\n", mmap->type); + printf(" status %u (%s)\n", mmap->status, + intel_status2str(mmap->status)); + printf(" type %u (%s)\n", mmap->type, + intel_type2str(mmap->type)); printf(" total_disks %u\n", mmap->total_disks); printf(" total_domains %u\n", mmap->total_domains); printf(" failed_disk_num %u\n", mmap->failed_disk_num); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:22:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 528EBAFC; Thu, 18 Dec 2014 08:22:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3CFB21754; Thu, 18 Dec 2014 08:22:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8MKpn019415; Thu, 18 Dec 2014 08:22:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8MHv8019400; Thu, 18 Dec 2014 08:22:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180822.sBI8MHv8019400@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275878 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:22:20 -0000 Author: mav Date: Thu Dec 18 08:22:16 2014 New Revision: 275878 URL: https://svnweb.freebsd.org/changeset/base/275878 Log: MFC r274962: Replace home-grown CTL IO allocator with UMA. Old allocator created significant lock congestion protecting its lists of preallocated I/Os, while UMA provides much better SMP scalability. The downside of UMA is lack of reliable preallocation, that could guarantee successful allocation in non-sleepable environments. But careful code review shown, that only CAM target frontend really has that requirement. Fix that making that frontend preallocate and statically bind CTL I/O for every ATIO/INOT it preallocates any way. That allows to avoid allocations in hot I/O path. Other frontends either may sleep in allocation context or can properly handle allocation errors. On 40-core server with 6 ZVOL-backed LUNs and 7 iSCSI client connections this change increases peak performance from ~700K to >1M IOPS! Yay! :) Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_internal.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_tpc.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:22:16 2014 (r275878) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -646,7 +647,7 @@ ctl_isc_event_handler(ctl_ha_channel cha #if 0 printf("Serialize\n"); #endif - io = ctl_alloc_io((void *)ctl_softc->othersc_pool); + io = ctl_alloc_io_nowait(ctl_softc->othersc_pool); if (io == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -891,8 +892,8 @@ ctl_isc_event_handler(ctl_ha_channel cha /* Handle resets sent from the other side */ case CTL_MSG_MANAGE_TASKS: { struct ctl_taskio *taskio; - taskio = (struct ctl_taskio *)ctl_alloc_io( - (void *)ctl_softc->othersc_pool); + taskio = (struct ctl_taskio *)ctl_alloc_io_nowait( + ctl_softc->othersc_pool); if (taskio == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -920,8 +921,8 @@ ctl_isc_event_handler(ctl_ha_channel cha } /* Persistent Reserve action which needs attention */ case CTL_MSG_PERS_ACTION: - presio = (struct ctl_prio *)ctl_alloc_io( - (void *)ctl_softc->othersc_pool); + presio = (struct ctl_prio *)ctl_alloc_io_nowait( + ctl_softc->othersc_pool); if (presio == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -1005,7 +1006,7 @@ static int ctl_init(void) { struct ctl_softc *softc; - struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool; + void *other_pool; struct ctl_port *port; int i, error, retval; //int isc_retval; @@ -1051,7 +1052,8 @@ ctl_init(void) "Report no lun possible for invalid LUNs"); mtx_init(&softc->ctl_lock, "CTL mutex", NULL, MTX_DEF); - mtx_init(&softc->pool_lock, "CTL pool mutex", NULL, MTX_DEF); + softc->io_zone = uma_zcreate("CTL IO", sizeof(union ctl_io), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); softc->open_count = 0; /* @@ -1088,36 +1090,15 @@ ctl_init(void) STAILQ_INIT(&softc->fe_list); STAILQ_INIT(&softc->port_list); STAILQ_INIT(&softc->be_list); - STAILQ_INIT(&softc->io_pools); ctl_tpc_init(softc); - if (ctl_pool_create(softc, CTL_POOL_INTERNAL, CTL_POOL_ENTRIES_INTERNAL, - &internal_pool)!= 0){ - printf("ctl: can't allocate %d entry internal pool, " - "exiting\n", CTL_POOL_ENTRIES_INTERNAL); - return (ENOMEM); - } - - if (ctl_pool_create(softc, CTL_POOL_EMERGENCY, - CTL_POOL_ENTRIES_EMERGENCY, &emergency_pool) != 0) { - printf("ctl: can't allocate %d entry emergency pool, " - "exiting\n", CTL_POOL_ENTRIES_EMERGENCY); - ctl_pool_free(internal_pool); - return (ENOMEM); - } - - if (ctl_pool_create(softc, CTL_POOL_4OTHERSC, CTL_POOL_ENTRIES_OTHER_SC, + if (ctl_pool_create(softc, "othersc", CTL_POOL_ENTRIES_OTHER_SC, &other_pool) != 0) { printf("ctl: can't allocate %d entry other SC pool, " "exiting\n", CTL_POOL_ENTRIES_OTHER_SC); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); return (ENOMEM); } - - softc->internal_pool = internal_pool; - softc->emergency_pool = emergency_pool; softc->othersc_pool = other_pool; if (worker_threads <= 0) @@ -1139,8 +1120,6 @@ ctl_init(void) &softc->ctl_proc, &thr->thread, 0, 0, "ctl", "work%d", i); if (error != 0) { printf("error creating CTL work thread!\n"); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); ctl_pool_free(other_pool); return (error); } @@ -1149,8 +1128,6 @@ ctl_init(void) &softc->ctl_proc, NULL, 0, 0, "ctl", "lun"); if (error != 0) { printf("error creating CTL lun thread!\n"); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); ctl_pool_free(other_pool); return (error); } @@ -1158,8 +1135,6 @@ ctl_init(void) &softc->ctl_proc, NULL, 0, 0, "ctl", "thresh"); if (error != 0) { printf("error creating CTL threshold thread!\n"); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); ctl_pool_free(other_pool); return (error); } @@ -1212,7 +1187,6 @@ ctl_shutdown(void) { struct ctl_softc *softc; struct ctl_lun *lun, *next_lun; - struct ctl_io_pool *pool; softc = (struct ctl_softc *)control_softc; @@ -1233,24 +1207,13 @@ ctl_shutdown(void) ctl_frontend_deregister(&ioctl_frontend); - /* - * This will rip the rug out from under any FETDs or anyone else - * that has a pool allocated. Since we increment our module - * refcount any time someone outside the main CTL module allocates - * a pool, we shouldn't have any problems here. The user won't be - * able to unload the CTL module until client modules have - * successfully unloaded. - */ - while ((pool = STAILQ_FIRST(&softc->io_pools)) != NULL) - ctl_pool_free(pool); - #if 0 ctl_shutdown_thread(softc->work_thread); mtx_destroy(&softc->queue_lock); #endif ctl_tpc_shutdown(softc); - mtx_destroy(&softc->pool_lock); + uma_zdestroy(softc->io_zone); mtx_destroy(&softc->ctl_lock); destroy_dev(softc->dev); @@ -2373,21 +2336,15 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } io = ctl_alloc_io(softc->ioctl_info.port.ctl_pool_ref); - if (io == NULL) { - printf("ctl_ioctl: can't allocate ctl_io!\n"); - retval = ENOSPC; - break; - } /* * Need to save the pool reference so it doesn't get * spammed by the user's ctl_io. */ pool_tmp = io->io_hdr.pool; - memcpy(io, (void *)addr, sizeof(*io)); - io->io_hdr.pool = pool_tmp; + /* * No status yet, so make sure the status is set properly. */ @@ -3731,285 +3688,95 @@ ctl_kfree_io(union ctl_io *io) #endif /* unused */ /* - * ctl_softc, pool_type, total_ctl_io are passed in. + * ctl_softc, pool_name, total_ctl_io are passed in. * npool is passed out. */ int -ctl_pool_create(struct ctl_softc *ctl_softc, ctl_pool_type pool_type, - uint32_t total_ctl_io, struct ctl_io_pool **npool) +ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name, + uint32_t total_ctl_io, void **npool) { - uint32_t i; - union ctl_io *cur_io, *next_io; +#ifdef IO_POOLS struct ctl_io_pool *pool; - int retval; - - retval = 0; pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT | M_ZERO); - if (pool == NULL) { - retval = ENOMEM; - goto bailout; - } + if (pool == NULL) + return (ENOMEM); - pool->type = pool_type; + snprintf(pool->name, sizeof(pool->name), "CTL IO %s", pool_name); pool->ctl_softc = ctl_softc; - - mtx_lock(&ctl_softc->pool_lock); - pool->id = ctl_softc->cur_pool_id++; - mtx_unlock(&ctl_softc->pool_lock); - - pool->flags = CTL_POOL_FLAG_NONE; - pool->refcount = 1; /* Reference for validity. */ - STAILQ_INIT(&pool->free_queue); - - /* - * XXX KDM other options here: - * - allocate a page at a time - * - allocate one big chunk of memory. - * Page allocation might work well, but would take a little more - * tracking. - */ - for (i = 0; i < total_ctl_io; i++) { - cur_io = (union ctl_io *)malloc(sizeof(*cur_io), M_CTLIO, - M_NOWAIT); - if (cur_io == NULL) { - retval = ENOMEM; - break; - } - cur_io->io_hdr.pool = pool; - STAILQ_INSERT_TAIL(&pool->free_queue, &cur_io->io_hdr, links); - pool->total_ctl_io++; - pool->free_ctl_io++; - } - - if (retval != 0) { - for (cur_io = (union ctl_io *)STAILQ_FIRST(&pool->free_queue); - cur_io != NULL; cur_io = next_io) { - next_io = (union ctl_io *)STAILQ_NEXT(&cur_io->io_hdr, - links); - STAILQ_REMOVE(&pool->free_queue, &cur_io->io_hdr, - ctl_io_hdr, links); - free(cur_io, M_CTLIO); - } - - free(pool, M_CTL); - goto bailout; - } - mtx_lock(&ctl_softc->pool_lock); - ctl_softc->num_pools++; - STAILQ_INSERT_TAIL(&ctl_softc->io_pools, pool, links); - /* - * Increment our usage count if this is an external consumer, so we - * can't get unloaded until the external consumer (most likely a - * FETD) unloads and frees his pool. - * - * XXX KDM will this increment the caller's module use count, or - * mine? - */ -#if 0 - if ((pool_type != CTL_POOL_EMERGENCY) - && (pool_type != CTL_POOL_INTERNAL) - && (pool_type != CTL_POOL_4OTHERSC)) - MOD_INC_USE_COUNT; -#endif - - mtx_unlock(&ctl_softc->pool_lock); + pool->zone = uma_zsecond_create(pool->name, NULL, + NULL, NULL, NULL, ctl_softc->io_zone); + /* uma_prealloc(pool->zone, total_ctl_io); */ *npool = pool; - -bailout: - - return (retval); -} - -static int -ctl_pool_acquire(struct ctl_io_pool *pool) -{ - - mtx_assert(&pool->ctl_softc->pool_lock, MA_OWNED); - - if (pool->flags & CTL_POOL_FLAG_INVALID) - return (EINVAL); - - pool->refcount++; - - return (0); -} - -static void -ctl_pool_release(struct ctl_io_pool *pool) -{ - struct ctl_softc *ctl_softc = pool->ctl_softc; - union ctl_io *io; - - mtx_assert(&ctl_softc->pool_lock, MA_OWNED); - - if (--pool->refcount != 0) - return; - - while ((io = (union ctl_io *)STAILQ_FIRST(&pool->free_queue)) != NULL) { - STAILQ_REMOVE(&pool->free_queue, &io->io_hdr, ctl_io_hdr, - links); - free(io, M_CTLIO); - } - - STAILQ_REMOVE(&ctl_softc->io_pools, pool, ctl_io_pool, links); - ctl_softc->num_pools--; - - /* - * XXX KDM will this decrement the caller's usage count or mine? - */ -#if 0 - if ((pool->type != CTL_POOL_EMERGENCY) - && (pool->type != CTL_POOL_INTERNAL) - && (pool->type != CTL_POOL_4OTHERSC)) - MOD_DEC_USE_COUNT; +#else + *npool = ctl_softc->io_zone; #endif - - free(pool, M_CTL); + return (0); } void ctl_pool_free(struct ctl_io_pool *pool) { - struct ctl_softc *ctl_softc; if (pool == NULL) return; - ctl_softc = pool->ctl_softc; - mtx_lock(&ctl_softc->pool_lock); - pool->flags |= CTL_POOL_FLAG_INVALID; - ctl_pool_release(pool); - mtx_unlock(&ctl_softc->pool_lock); +#ifdef IO_POOLS + uma_zdestroy(pool->zone); + free(pool, M_CTL); +#endif } -/* - * This routine does not block (except for spinlocks of course). - * It tries to allocate a ctl_io union from the caller's pool as quickly as - * possible. - */ union ctl_io * ctl_alloc_io(void *pool_ref) { union ctl_io *io; - struct ctl_softc *ctl_softc; - struct ctl_io_pool *pool, *npool; - struct ctl_io_pool *emergency_pool; +#ifdef IO_POOLS + struct ctl_io_pool *pool = (struct ctl_io_pool *)pool_ref; - pool = (struct ctl_io_pool *)pool_ref; - - if (pool == NULL) { - printf("%s: pool is NULL\n", __func__); - return (NULL); - } - - emergency_pool = NULL; - - ctl_softc = pool->ctl_softc; - - mtx_lock(&ctl_softc->pool_lock); - /* - * First, try to get the io structure from the user's pool. - */ - if (ctl_pool_acquire(pool) == 0) { - io = (union ctl_io *)STAILQ_FIRST(&pool->free_queue); - if (io != NULL) { - STAILQ_REMOVE_HEAD(&pool->free_queue, links); - pool->total_allocated++; - pool->free_ctl_io--; - mtx_unlock(&ctl_softc->pool_lock); - return (io); - } else - ctl_pool_release(pool); - } - /* - * If he doesn't have any io structures left, search for an - * emergency pool and grab one from there. - */ - STAILQ_FOREACH(npool, &ctl_softc->io_pools, links) { - if (npool->type != CTL_POOL_EMERGENCY) - continue; - - if (ctl_pool_acquire(npool) != 0) - continue; - - emergency_pool = npool; - - io = (union ctl_io *)STAILQ_FIRST(&npool->free_queue); - if (io != NULL) { - STAILQ_REMOVE_HEAD(&npool->free_queue, links); - npool->total_allocated++; - npool->free_ctl_io--; - mtx_unlock(&ctl_softc->pool_lock); - return (io); - } else - ctl_pool_release(npool); - } - - /* Drop the spinlock before we malloc */ - mtx_unlock(&ctl_softc->pool_lock); + io = uma_zalloc(pool->zone, M_WAITOK); +#else + io = uma_zalloc((uma_zone_t)pool_ref, M_WAITOK); +#endif + if (io != NULL) + io->io_hdr.pool = pool_ref; + return (io); +} - /* - * The emergency pool (if it exists) didn't have one, so try an - * atomic (i.e. nonblocking) malloc and see if we get lucky. - */ - io = (union ctl_io *)malloc(sizeof(*io), M_CTLIO, M_NOWAIT); - if (io != NULL) { - /* - * If the emergency pool exists but is empty, add this - * ctl_io to its list when it gets freed. - */ - if (emergency_pool != NULL) { - mtx_lock(&ctl_softc->pool_lock); - if (ctl_pool_acquire(emergency_pool) == 0) { - io->io_hdr.pool = emergency_pool; - emergency_pool->total_ctl_io++; - /* - * Need to bump this, otherwise - * total_allocated and total_freed won't - * match when we no longer have anything - * outstanding. - */ - emergency_pool->total_allocated++; - } - mtx_unlock(&ctl_softc->pool_lock); - } else - io->io_hdr.pool = NULL; - } +union ctl_io * +ctl_alloc_io_nowait(void *pool_ref) +{ + union ctl_io *io; +#ifdef IO_POOLS + struct ctl_io_pool *pool = (struct ctl_io_pool *)pool_ref; + io = uma_zalloc(pool->zone, M_NOWAIT); +#else + io = uma_zalloc((uma_zone_t)pool_ref, M_NOWAIT); +#endif + if (io != NULL) + io->io_hdr.pool = pool_ref; return (io); } void ctl_free_io(union ctl_io *io) { +#ifdef IO_POOLS + struct ctl_io_pool *pool; +#endif + if (io == NULL) return; - /* - * If this ctl_io has a pool, return it to that pool. - */ - if (io->io_hdr.pool != NULL) { - struct ctl_io_pool *pool; - - pool = (struct ctl_io_pool *)io->io_hdr.pool; - mtx_lock(&pool->ctl_softc->pool_lock); - io->io_hdr.io_type = 0xff; - STAILQ_INSERT_TAIL(&pool->free_queue, &io->io_hdr, links); - pool->total_freed++; - pool->free_ctl_io++; - ctl_pool_release(pool); - mtx_unlock(&pool->ctl_softc->pool_lock); - } else { - /* - * Otherwise, just free it. We probably malloced it and - * the emergency pool wasn't available. - */ - free(io, M_CTLIO); - } - +#ifdef IO_POOLS + pool = (struct ctl_io_pool *)io->io_hdr.pool; + uma_zfree(pool->zone, io); +#else + uma_zfree((uma_zone_t)io->io_hdr.pool, io); +#endif } void @@ -4024,9 +3791,7 @@ ctl_zero_io(union ctl_io *io) * May need to preserve linked list pointers at some point too. */ pool_ref = io->io_hdr.pool; - memset(io, 0, sizeof(*io)); - io->io_hdr.pool = pool_ref; } @@ -5659,16 +5424,10 @@ ctl_start_stop(struct ctl_scsiio *ctsio) union ctl_io *new_io; new_io = ctl_alloc_io(ctsio->io_hdr.pool); - if (new_io == NULL) { - ctl_set_busy(ctsio); - ctl_done((union ctl_io *)ctsio); - } else { - ctl_copy_io((union ctl_io *)ctsio, - new_io); - retval = lun->backend->config_write(new_io); - ctl_set_success(ctsio); - ctl_done((union ctl_io *)ctsio); - } + ctl_copy_io((union ctl_io *)ctsio, new_io); + retval = lun->backend->config_write(new_io); + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); } else { retval = lun->backend->config_write( (union ctl_io *)ctsio); Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_frontend.c Thu Dec 18 08:22:16 2014 (r275878) @@ -138,7 +138,7 @@ ctl_frontend_find(char *frontend_name) int ctl_port_register(struct ctl_port *port) { - struct ctl_io_pool *pool; + void *pool; int port_num; int retval; @@ -176,7 +176,7 @@ ctl_port_register(struct ctl_port *port) * pending sense queue on the next command, whether or not it is * a REQUEST SENSE. */ - retval = ctl_pool_create(control_softc, CTL_POOL_FETD, + retval = ctl_pool_create(control_softc, port->port_name, port->num_requested_ctl_io + 20, &pool); if (retval != 0) { free(port->wwpn_iid, M_CTL); Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Dec 18 08:22:16 2014 (r275878) @@ -545,7 +545,7 @@ cfcs_action(struct cam_sim *sim, union c return; } - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io == NULL) { printf("%s: can't allocate ctl_io\n", __func__); ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN; @@ -642,7 +642,7 @@ cfcs_action(struct cam_sim *sim, union c return; } - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io == NULL) { ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN; xpt_freeze_devq(ccb->ccb_h.path, 1); @@ -737,7 +737,7 @@ cfcs_action(struct cam_sim *sim, union c return; } - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io == NULL) { ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN; xpt_freeze_devq(ccb->ccb_h.path, 1); Modified: stable/10/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_internal.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_frontend_internal.c Thu Dec 18 08:22:16 2014 (r275878) @@ -761,11 +761,6 @@ cfi_done(union ctl_io *io) struct cfi_lun_io *new_lun_io; new_io = ctl_alloc_io(softc->port.ctl_pool_ref); - if (new_io == NULL) { - printf("%s: unable to allocate ctl_io for " - "error recovery\n", __func__); - goto done; - } ctl_zero_io(new_io); new_io->io_hdr.io_type = CTL_IO_TASK; @@ -967,12 +962,6 @@ cfi_lun_probe(struct cfi_lun *lun, int h union ctl_io *io; io = ctl_alloc_io(lun->softc->port.ctl_pool_ref); - if (io == NULL) { - printf("%s: unable to alloc ctl_io for target %ju " - "lun %d probe\n", __func__, - (uintmax_t)lun->target_id.id, lun->lun_id); - return; - } ctl_scsi_inquiry(io, /*data_ptr*/(uint8_t *)&lun->inq_data, /*data_len*/ sizeof(lun->inq_data), @@ -1014,12 +1003,6 @@ cfi_lun_probe(struct cfi_lun *lun, int h union ctl_io *io; io = ctl_alloc_io(lun->softc->port.ctl_pool_ref); - if (io == NULL) { - printf("%s: unable to alloc ctl_io for target %ju " - "lun %d probe\n", __func__, - (uintmax_t)lun->target_id.id, lun->lun_id); - return; - } dataptr = malloc(sizeof(struct scsi_read_capacity_data_long), M_CTL_CFI, M_NOWAIT); @@ -1394,7 +1377,7 @@ cfi_action(struct cfi_metatask *metatask if (SID_TYPE(&lun->inq_data) != T_DIRECT) continue; da_luns++; - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io != NULL) { ios_allocated++; STAILQ_INSERT_TAIL(&tmp_io_list, &io->io_hdr, @@ -1548,7 +1531,7 @@ cfi_action(struct cfi_metatask *metatask } - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io == NULL) { metatask->status = CFI_MT_ERROR; metatask->taskinfo.bbrread.status = CFI_BBR_NO_MEM; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Dec 18 08:22:16 2014 (r275878) @@ -546,13 +546,6 @@ cfiscsi_pdu_handle_scsi_command(struct i return; } io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); - if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io; " - "dropping connection"); - icl_pdu_free(request); - cfiscsi_session_terminate(cs); - return; - } ctl_zero_io(io); io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request; io->io_hdr.io_type = CTL_IO_SCSI; @@ -610,13 +603,6 @@ cfiscsi_pdu_handle_task_request(struct i cs = PDU_SESSION(request); bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); - if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io;" - "dropping connection"); - icl_pdu_free(request); - cfiscsi_session_terminate(cs); - return; - } ctl_zero_io(io); io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request; io->io_hdr.io_type = CTL_IO_TASK; @@ -1067,10 +1053,6 @@ cfiscsi_session_terminate_tasks(struct c if (cs->cs_target == NULL) return; /* No target yet, so nothing to do. */ io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); - if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); - return; - } ctl_zero_io(io); io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = cs; io->io_hdr.io_type = CTL_IO_TASK; Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_io.h Thu Dec 18 08:22:16 2014 (r275878) @@ -511,6 +511,7 @@ union ctl_io { #ifdef _KERNEL union ctl_io *ctl_alloc_io(void *pool_ref); +union ctl_io *ctl_alloc_io_nowait(void *pool_ref); void ctl_free_io(union ctl_io *io); void ctl_zero_io(union ctl_io *io); void ctl_copy_io(union ctl_io *src, union ctl_io *dest); Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:22:16 2014 (r275878) @@ -71,34 +71,13 @@ struct ctl_fe_ioctl_params { ctl_fe_ioctl_state state; }; -#define CTL_POOL_ENTRIES_INTERNAL 200 -#define CTL_POOL_ENTRIES_EMERGENCY 300 #define CTL_POOL_ENTRIES_OTHER_SC 200 -typedef enum { - CTL_POOL_INTERNAL, - CTL_POOL_FETD, - CTL_POOL_EMERGENCY, - CTL_POOL_4OTHERSC -} ctl_pool_type; - -typedef enum { - CTL_POOL_FLAG_NONE = 0x00, - CTL_POOL_FLAG_INVALID = 0x01 -} ctl_pool_flags; - struct ctl_io_pool { - ctl_pool_type type; - ctl_pool_flags flags; + char name[64]; uint32_t id; struct ctl_softc *ctl_softc; - uint32_t refcount; - uint64_t total_allocated; - uint64_t total_freed; - int32_t total_ctl_io; - int32_t free_ctl_io; - STAILQ_HEAD(, ctl_io_hdr) free_queue; - STAILQ_ENTRY(ctl_io_pool) links; + struct uma_zone *zone; }; typedef enum { @@ -475,9 +454,7 @@ struct ctl_softc { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; struct ctl_ioctl_info ioctl_info; - struct ctl_io_pool *internal_pool; - struct ctl_io_pool *emergency_pool; - struct ctl_io_pool *othersc_pool; + void *othersc_pool; struct proc *ctl_proc; int targ_online; uint32_t ctl_lun_mask[(CTL_MAX_LUNS + 31) / 32]; @@ -492,10 +469,8 @@ struct ctl_softc { struct ctl_port *ctl_ports[CTL_MAX_PORTS]; uint32_t num_backends; STAILQ_HEAD(, ctl_backend_driver) be_list; - struct mtx pool_lock; - uint32_t num_pools; + struct uma_zone *io_zone; uint32_t cur_pool_id; - STAILQ_HEAD(, ctl_io_pool) io_pools; struct ctl_thread threads[CTL_MAX_THREADS]; TAILQ_HEAD(tpc_tokens, tpc_token) tpc_tokens; struct callout tpc_timeout; @@ -508,8 +483,8 @@ extern const struct ctl_cmd_entry ctl_cm uint32_t ctl_get_initindex(struct ctl_nexus *nexus); uint32_t ctl_get_resindex(struct ctl_nexus *nexus); uint32_t ctl_port_idx(int port_num); -int ctl_pool_create(struct ctl_softc *ctl_softc, ctl_pool_type pool_type, - uint32_t total_ctl_io, struct ctl_io_pool **npool); +int ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name, + uint32_t total_ctl_io, void **npool); void ctl_pool_free(struct ctl_io_pool *pool); int ctl_scsi_release(struct ctl_scsiio *ctsio); int ctl_scsi_reserve(struct ctl_scsiio *ctsio); Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_tpc.c Thu Dec 18 08:22:16 2014 (r275878) @@ -812,7 +812,6 @@ tpc_process_b2b(struct tpc_list *list) uint32_t srcblock, dstblock; if (list->stage == 1) { -complete: while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tior, links); ctl_free_io(tior->io); @@ -886,10 +885,6 @@ complete: tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); - if (tior->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_read_write(tior->io, /*data_ptr*/ &list->buf[donebytes], /*data_len*/ roundbytes, @@ -909,10 +904,6 @@ complete: tiow->list = list; TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); - if (tiow->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_read_write(tiow->io, /*data_ptr*/ &list->buf[donebytes], /*data_len*/ roundbytes, @@ -951,7 +942,6 @@ tpc_process_verify(struct tpc_list *list uint64_t sl; if (list->stage == 1) { -complete: while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); @@ -990,10 +980,6 @@ complete: tio->list = list; TAILQ_INSERT_TAIL(&list->allio, tio, links); tio->io = tpcl_alloc_io(); - if (tio->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_tur(tio->io, /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tio->io->io_hdr.retries = 3; tio->lun = sl; @@ -1013,7 +999,6 @@ tpc_process_register_key(struct tpc_list int datalen; if (list->stage == 1) { -complete: while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); @@ -1050,10 +1035,6 @@ complete: tio->list = list; TAILQ_INSERT_TAIL(&list->allio, tio, links); tio->io = tpcl_alloc_io(); - if (tio->io == NULL) { - list->error = 1; - goto complete; - } datalen = sizeof(struct scsi_per_res_out_parms); list->buf = malloc(datalen, M_CTL, M_WAITOK); ctl_scsi_persistent_res_out(tio->io, @@ -1112,7 +1093,6 @@ tpc_process_wut(struct tpc_list *list) uint32_t srcblock, dstblock; if (list->stage > 0) { -complete: /* Cleanup after previous rounds. */ while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); @@ -1184,10 +1164,6 @@ complete: tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); - if (tior->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_read_write(tior->io, /*data_ptr*/ &list->buf[donebytes], /*data_len*/ roundbytes, @@ -1207,10 +1183,6 @@ complete: tiow->list = list; TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); - if (tiow->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_read_write(tiow->io, /*data_ptr*/ &list->buf[donebytes], /*data_len*/ roundbytes, @@ -1289,10 +1261,6 @@ complete: tiow->list = list; TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); - if (tiow->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_write_same(tiow->io, /*data_ptr*/ list->buf, /*data_len*/ dstblock, Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:22:16 2014 (r275878) @@ -72,10 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -typedef enum { - CTLFE_CCB_DEFAULT = 0x00 -} ctlfe_ccb_types; - struct ctlfe_softc { struct ctl_port port; path_id_t path_id; @@ -189,9 +185,7 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, dma_ &ctlfe_dma_enabled, 0, "DMA enabled"); MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CAM CTL FE interface"); -#define ccb_type ppriv_field0 -/* This is only used in the ATIO */ -#define io_ptr ppriv_ptr1 +#define io_ptr ppriv_ptr0 /* This is only used in the CTIO */ #define ccb_atio ppriv_ptr1 @@ -546,6 +540,7 @@ ctlferegister(struct cam_periph *periph, for (i = 0; i < CTLFE_ATIO_PER_LUN; i++) { union ccb *new_ccb; + union ctl_io *new_io; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, M_ZERO|M_NOWAIT); @@ -553,6 +548,14 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } + new_io = ctl_alloc_io_nowait(bus_softc->port.ctl_pool_ref); + if (new_io == NULL) { + free(new_ccb, M_CTLFE); + status = CAM_RESRC_UNAVAIL; + break; + } + new_ccb->ccb_h.io_ptr = new_io; + xpt_setup_ccb(&new_ccb->ccb_h, periph->path, /*priority*/ 1); new_ccb->ccb_h.func_code = XPT_ACCEPT_TARGET_IO; new_ccb->ccb_h.cbfcnp = ctlfedone; @@ -561,6 +564,7 @@ ctlferegister(struct cam_periph *periph, softc->atios_sent++; status = new_ccb->ccb_h.status; if ((status & CAM_STATUS_MASK) != CAM_REQ_INPROG) { + ctl_free_io(new_io); free(new_ccb, M_CTLFE); break; } @@ -581,6 +585,7 @@ ctlferegister(struct cam_periph *periph, for (i = 0; i < CTLFE_IN_PER_LUN; i++) { union ccb *new_ccb; + union ctl_io *new_io; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, M_ZERO|M_NOWAIT); @@ -588,6 +593,13 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } + new_io = ctl_alloc_io_nowait(bus_softc->port.ctl_pool_ref); + if (new_io == NULL) { + free(new_ccb, M_CTLFE); + status = CAM_RESRC_UNAVAIL; + break; + } + new_ccb->ccb_h.io_ptr = new_io; xpt_setup_ccb(&new_ccb->ccb_h, periph->path, /*priority*/ 1); new_ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; @@ -766,8 +778,6 @@ ctlfestart(struct cam_periph *periph, un softc->ccbs_alloced++; - start_ccb->ccb_h.ccb_type = CTLFE_CCB_DEFAULT; - ccb_h = TAILQ_FIRST(&softc->work_queue); if (ccb_h == NULL) { softc->ccbs_freed++; @@ -812,7 +822,6 @@ ctlfestart(struct cam_periph *periph, un xpt_print(periph->path, "%s: aborted " "command 0x%04x discarded\n", __func__, io->scsiio.tag_num); - ctl_free_io(io); /* * For a wildcard attachment, commands can * come in with a specific target/lun. Reset @@ -1038,6 +1047,7 @@ ctlfe_free_ccb(struct cam_periph *periph break; } + ctl_free_io(ccb->ccb_h.io_ptr); free(ccb, M_CTLFE); KASSERT(softc->atios_returned <= softc->atios_sent, ("%s: " @@ -1139,8 +1149,8 @@ ctlfedone(struct cam_periph *periph, uni KASSERT((done_ccb->ccb_h.flags & CAM_UNLOCKED) != 0, ("CCB in ctlfedone() without CAM_UNLOCKED flag")); #ifdef CTLFE_DEBUG - printf("%s: entered, func_code = %#x, type = %#lx\n", __func__, - done_ccb->ccb_h.func_code, done_ccb->ccb_h.ccb_type); + printf("%s: entered, func_code = %#x\n", __func__, + done_ccb->ccb_h.func_code); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:23:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03D6BC2D; Thu, 18 Dec 2014 08:23:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C9869175D; Thu, 18 Dec 2014 08:23:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8N5OJ019563; Thu, 18 Dec 2014 08:23:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8N5FV019561; Thu, 18 Dec 2014 08:23:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180823.sBI8N5FV019561@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275879 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:23:06 -0000 Author: mav Date: Thu Dec 18 08:23:04 2014 New Revision: 275879 URL: https://svnweb.freebsd.org/changeset/base/275879 Log: MFC r275009: Use ctl_set_success() instead of direct inlining. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:22:16 2014 (r275878) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:23:04 2014 (r275879) @@ -5213,8 +5213,7 @@ ctl_scsi_release(struct ctl_scsiio *ctsi mtx_unlock(&lun->lun_lock); - ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.status = CTL_SUCCESS; + ctl_set_success(ctsio); if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { free(ctsio->kern_data_ptr, M_CTL); @@ -5301,8 +5300,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi lun->flags |= CTL_LUN_RESERVED; lun->res_idx = residx; - ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.status = CTL_SUCCESS; + ctl_set_success(ctsio); bailout: mtx_unlock(&lun->lun_lock); @@ -5612,8 +5610,7 @@ ctl_format(struct ctl_scsiio *ctsio) lun->flags &= ~CTL_LUN_INOPERABLE; mtx_unlock(&lun->lun_lock); - ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.status = CTL_SUCCESS; + ctl_set_success(ctsio); bailout: if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { @@ -9608,9 +9605,7 @@ ctl_tur(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_tur\n")); - ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.status = CTL_SUCCESS; - + ctl_set_success(ctsio); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:22:16 2014 (r275878) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:23:04 2014 (r275879) @@ -250,7 +250,7 @@ ctl_backend_ramdisk_move_done(union ctl_ &be_lun->io_task); return (0); } - io->io_hdr.status = CTL_SUCCESS; + ctl_set_success(&io->scsiio); } else if ((io->io_hdr.port_status != 0) && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)){ From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:24:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 512AFD6B; Thu, 18 Dec 2014 08:24:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3AED9176D; Thu, 18 Dec 2014 08:24:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8O00l019721; Thu, 18 Dec 2014 08:24:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8O0jm019715; Thu, 18 Dec 2014 08:24:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180824.sBI8O0jm019715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275880 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:24:00 -0000 Author: mav Date: Thu Dec 18 08:23:59 2014 New Revision: 275880 URL: https://svnweb.freebsd.org/changeset/base/275880 Log: MFC r275032: Decouple datamove/done logic from CTL status set. Modified: stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:23:04 2014 (r275879) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:23:59 2014 (r275880) @@ -86,7 +86,6 @@ struct ctlfe_softc { STAILQ_HEAD(, ctlfe_softc) ctlfe_softc_list; struct mtx ctlfe_list_mtx; static char ctlfe_mtx_desc[] = "ctlfelist"; -static int ctlfe_dma_enabled = 1; #ifdef CTLFE_INIT_ENABLE static int ctlfe_max_targets = 1; static int ctlfe_num_targets = 0; @@ -101,7 +100,6 @@ struct ctlfe_lun_softc { struct ctlfe_softc *parent_softc; struct cam_periph *periph; ctlfe_lun_flags flags; - struct callout dma_callout; uint64_t ccbs_alloced; uint64_t ccbs_freed; uint64_t ctios_sent; @@ -136,6 +134,7 @@ struct ctlfe_lun_cmd_info { #define CTLFE_MAX_SEGS 32 bus_dma_segment_t cam_sglist[CTLFE_MAX_SEGS]; }; +CTASSERT(sizeof(struct ctlfe_lun_cmd_info) <= CTL_PORT_PRIV_SIZE); /* * When we register the adapter/bus, request that this many ctl_ios be @@ -181,8 +180,6 @@ struct ctlfe_lun_cmd_info { #define RANDOM_WWNN #endif -SYSCTL_INT(_kern_cam_ctl, OID_AUTO, dma_enabled, CTLFLAG_RW, - &ctlfe_dma_enabled, 0, "DMA enabled"); MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CAM CTL FE interface"); #define io_ptr ppriv_ptr0 @@ -211,8 +208,8 @@ static int ctlfe_lun_disable(void *arg int lun_id); static void ctlfe_dump_sim(struct cam_sim *sim); static void ctlfe_dump_queue(struct ctlfe_lun_softc *softc); -static void ctlfe_dma_timeout(void *arg); -static void ctlfe_datamove_done(union ctl_io *io); +static void ctlfe_datamove(union ctl_io *io); +static void ctlfe_done(union ctl_io *io); static void ctlfe_dump(void); static struct periph_driver ctlfe_driver = @@ -402,8 +399,8 @@ ctlfeasync(void *callback_arg, uint32_t port->lun_enable = ctlfe_lun_enable; port->lun_disable = ctlfe_lun_disable; port->targ_lun_arg = softc; - port->fe_datamove = ctlfe_datamove_done; - port->fe_done = ctlfe_datamove_done; + port->fe_datamove = ctlfe_datamove; + port->fe_done = ctlfe_done; /* * XXX KDM the path inquiry doesn't give us the maximum * number of targets supported. @@ -518,9 +515,6 @@ ctlferegister(struct cam_periph *periph, TAILQ_INIT(&softc->work_queue); softc->periph = periph; - - callout_init_mtx(&softc->dma_callout, xpt_path_mtx(periph->path), - /*flags*/ 0); periph->softc = softc; xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); @@ -679,8 +673,6 @@ ctlfecleanup(struct cam_periph *periph) * XXX KDM is there anything else that needs to be done here? */ - callout_stop(&softc->dma_callout); - free(softc, M_CTLFE); } @@ -772,260 +764,213 @@ static void ctlfestart(struct cam_periph *periph, union ccb *start_ccb) { struct ctlfe_lun_softc *softc; + struct ctlfe_lun_cmd_info *cmd_info; struct ccb_hdr *ccb_h; + struct ccb_accept_tio *atio; + struct ccb_scsiio *csio; + uint8_t *data_ptr; + uint32_t dxfer_len; + ccb_flags flags; + union ctl_io *io; + uint8_t scsi_status; softc = (struct ctlfe_lun_softc *)periph->softc; - softc->ccbs_alloced++; ccb_h = TAILQ_FIRST(&softc->work_queue); if (ccb_h == NULL) { softc->ccbs_freed++; xpt_release_ccb(start_ccb); - } else { - struct ccb_accept_tio *atio; - struct ccb_scsiio *csio; - uint8_t *data_ptr; - uint32_t dxfer_len; - ccb_flags flags; - union ctl_io *io; - uint8_t scsi_status; + return; + } + + /* Take the ATIO off the work queue */ + TAILQ_REMOVE(&softc->work_queue, ccb_h, periph_links.tqe); + atio = (struct ccb_accept_tio *)ccb_h; + io = (union ctl_io *)ccb_h->io_ptr; + csio = &start_ccb->csio; - /* Take the ATIO off the work queue */ - TAILQ_REMOVE(&softc->work_queue, ccb_h, periph_links.tqe); - atio = (struct ccb_accept_tio *)ccb_h; - io = (union ctl_io *)ccb_h->io_ptr; - csio = &start_ccb->csio; + flags = atio->ccb_h.flags & + (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); - flags = atio->ccb_h.flags & - (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); + if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) { + /* + * Datamove call, we need to setup the S/G list. + */ + cmd_info = (struct ctlfe_lun_cmd_info *) + io->io_hdr.port_priv; + bzero(cmd_info, sizeof(*cmd_info)); + scsi_status = 0; + csio->cdb_len = atio->cdb_len; + ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, + &csio->sglist_cnt); + io->scsiio.ext_data_filled += dxfer_len; + if (io->scsiio.ext_data_filled > io->scsiio.kern_total_len) { + xpt_print(periph->path, "%s: tag 0x%04x " + "fill len %u > total %u\n", + __func__, io->scsiio.tag_num, + io->scsiio.ext_data_filled, + io->scsiio.kern_total_len); + } + } else { + /* + * We're done, send status back. + */ + if ((io->io_hdr.flags & CTL_FLAG_ABORT) && + (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { + io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; - if ((io == NULL) - || (io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) { /* - * We're done, send status back. + * If this command was aborted, we don't + * need to send status back to the SIM. + * Just free the CTIO and ctl_io, and + * recycle the ATIO back to the SIM. */ - flags |= CAM_SEND_STATUS; - if (io == NULL) { - scsi_status = SCSI_STATUS_BUSY; - csio->sense_len = 0; - } else if ((io->io_hdr.flags & CTL_FLAG_ABORT) && - (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { - io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; - - /* - * If this command was aborted, we don't - * need to send status back to the SIM. - * Just free the CTIO and ctl_io, and - * recycle the ATIO back to the SIM. - */ - xpt_print(periph->path, "%s: aborted " - "command 0x%04x discarded\n", - __func__, io->scsiio.tag_num); - /* - * For a wildcard attachment, commands can - * come in with a specific target/lun. Reset - * the target and LUN fields back to the - * wildcard values before we send them back - * down to the SIM. The SIM has a wildcard - * LUN enabled, not whatever target/lun - * these happened to be. - */ - if (softc->flags & CTLFE_LUN_WILDCARD) { - atio->ccb_h.target_id = - CAM_TARGET_WILDCARD; - atio->ccb_h.target_lun = - CAM_LUN_WILDCARD; - } - - if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(periph->path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - atio->ccb_h.status &= ~CAM_DEV_QFRZN; - } - - ccb_h = TAILQ_FIRST(&softc->work_queue); - - if (atio->ccb_h.func_code != - XPT_ACCEPT_TARGET_IO) { - xpt_print(periph->path, "%s: func_code " - "is %#x\n", __func__, - atio->ccb_h.func_code); - } - start_ccb->ccb_h.func_code = XPT_ABORT; - start_ccb->cab.abort_ccb = (union ccb *)atio; - - /* Tell the SIM that we've aborted this ATIO */ - xpt_action(start_ccb); - softc->ccbs_freed++; - xpt_release_ccb(start_ccb); - - /* - * Send the ATIO back down to the SIM. - */ - xpt_action((union ccb *)atio); - softc->atios_sent++; - - /* - * If we still have work to do, ask for - * another CCB. Otherwise, deactivate our - * callout. - */ - if (ccb_h != NULL) - xpt_schedule(periph, /*priority*/ 1); - else - callout_stop(&softc->dma_callout); - - return; - } else { - io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; - scsi_status = io->scsiio.scsi_status; - csio->sense_len = io->scsiio.sense_len; - } - data_ptr = NULL; - dxfer_len = 0; - if (io == NULL) { - printf("%s: tag %04x io is NULL\n", __func__, - atio->tag_id); - } else { -#ifdef CTLFEDEBUG - printf("%s: tag %04x status %x\n", __func__, - atio->tag_id, io->io_hdr.status); -#endif - } - csio->sglist_cnt = 0; - if (csio->sense_len != 0) { - csio->sense_data = io->scsiio.sense_data; - flags |= CAM_SEND_SENSE; - } else if (scsi_status == SCSI_STATUS_CHECK_COND) { - xpt_print(periph->path, "%s: check condition " - "with no sense\n", __func__); - } - } else { - struct ctlfe_lun_cmd_info *cmd_info; - + xpt_print(periph->path, "%s: aborted " + "command 0x%04x discarded\n", + __func__, io->scsiio.tag_num); /* - * Datamove call, we need to setup the S/G list. + * For a wildcard attachment, commands can + * come in with a specific target/lun. Reset + * the target and LUN fields back to the + * wildcard values before we send them back + * down to the SIM. The SIM has a wildcard + * LUN enabled, not whatever target/lun + * these happened to be. */ + if (softc->flags & CTLFE_LUN_WILDCARD) { + atio->ccb_h.target_id = CAM_TARGET_WILDCARD; + atio->ccb_h.target_lun = CAM_LUN_WILDCARD; + } - cmd_info = (struct ctlfe_lun_cmd_info *) - io->io_hdr.port_priv; + if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { + cam_release_devq(periph->path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + atio->ccb_h.status &= ~CAM_DEV_QFRZN; + } + + if (atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) { + xpt_print(periph->path, "%s: func_code " + "is %#x\n", __func__, + atio->ccb_h.func_code); + } + start_ccb->ccb_h.func_code = XPT_ABORT; + start_ccb->cab.abort_ccb = (union ccb *)atio; - KASSERT(sizeof(*cmd_info) < CTL_PORT_PRIV_SIZE, - ("%s: sizeof(struct ctlfe_lun_cmd_info) %zd < " - "CTL_PORT_PRIV_SIZE %d", __func__, - sizeof(*cmd_info), CTL_PORT_PRIV_SIZE)); - io->io_hdr.flags &= ~CTL_FLAG_DMA_QUEUED; + /* Tell the SIM that we've aborted this ATIO */ + xpt_action(start_ccb); + softc->ccbs_freed++; + xpt_release_ccb(start_ccb); /* - * Need to zero this, in case it has been used for - * a previous datamove for this particular I/O. + * Send the ATIO back down to the SIM. */ - bzero(cmd_info, sizeof(*cmd_info)); - scsi_status = 0; - - csio->cdb_len = atio->cdb_len; - - ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, - &csio->sglist_cnt); + xpt_action((union ccb *)atio); + softc->atios_sent++; - io->scsiio.ext_data_filled += dxfer_len; + /* + * If we still have work to do, ask for + * another CCB. Otherwise, deactivate our + * callout. + */ + if (!TAILQ_EMPTY(&softc->work_queue)) + xpt_schedule(periph, /*priority*/ 1); + return; + } - if (io->scsiio.ext_data_filled > - io->scsiio.kern_total_len) { - xpt_print(periph->path, "%s: tag 0x%04x " - "fill len %u > total %u\n", - __func__, io->scsiio.tag_num, - io->scsiio.ext_data_filled, - io->scsiio.kern_total_len); - } + flags |= CAM_SEND_STATUS; + scsi_status = io->scsiio.scsi_status; + csio->sense_len = io->scsiio.sense_len; + data_ptr = NULL; + dxfer_len = 0; +#ifdef CTLFEDEBUG + printf("%s: tag %04x status %x\n", __func__, + atio->tag_id, io->io_hdr.status); +#endif + csio->sglist_cnt = 0; + if (csio->sense_len != 0) { + csio->sense_data = io->scsiio.sense_data; + flags |= CAM_SEND_SENSE; + } else if (scsi_status == SCSI_STATUS_CHECK_COND) { + xpt_print(periph->path, "%s: check condition " + "with no sense\n", __func__); } + } #ifdef CTLFEDEBUG - printf("%s: %s: tag %04x flags %x ptr %p len %u\n", __func__, - (flags & CAM_SEND_STATUS) ? "done" : "datamove", - atio->tag_id, flags, data_ptr, dxfer_len); + printf("%s: %s: tag %04x flags %x ptr %p len %u\n", __func__, + (flags & CAM_SEND_STATUS) ? "done" : "datamove", + atio->tag_id, flags, data_ptr, dxfer_len); #endif - /* - * Valid combinations: - * - CAM_SEND_STATUS, CAM_DATA_SG = 0, dxfer_len = 0, - * sglist_cnt = 0 - * - CAM_SEND_STATUS = 0, CAM_DATA_SG = 0, dxfer_len != 0, - * sglist_cnt = 0 - * - CAM_SEND_STATUS = 0, CAM_DATA_SG, dxfer_len != 0, - * sglist_cnt != 0 - */ + /* + * Valid combinations: + * - CAM_SEND_STATUS, CAM_DATA_SG = 0, dxfer_len = 0, + * sglist_cnt = 0 + * - CAM_SEND_STATUS = 0, CAM_DATA_SG = 0, dxfer_len != 0, + * sglist_cnt = 0 + * - CAM_SEND_STATUS = 0, CAM_DATA_SG, dxfer_len != 0, + * sglist_cnt != 0 + */ #ifdef CTLFEDEBUG - if (((flags & CAM_SEND_STATUS) - && (((flags & CAM_DATA_SG) != 0) - || (dxfer_len != 0) - || (csio->sglist_cnt != 0))) - || (((flags & CAM_SEND_STATUS) == 0) - && (dxfer_len == 0)) - || ((flags & CAM_DATA_SG) - && (csio->sglist_cnt == 0)) - || (((flags & CAM_DATA_SG) == 0) - && (csio->sglist_cnt != 0))) { - printf("%s: tag %04x cdb %02x flags %#x dxfer_len " - "%d sg %u\n", __func__, atio->tag_id, - atio->cdb_io.cdb_bytes[0], flags, dxfer_len, - csio->sglist_cnt); - if (io != NULL) { - printf("%s: tag %04x io status %#x\n", __func__, - atio->tag_id, io->io_hdr.status); - } else { - printf("%s: tag %04x no associated io\n", - __func__, atio->tag_id); - } - } + if (((flags & CAM_SEND_STATUS) + && (((flags & CAM_DATA_SG) != 0) + || (dxfer_len != 0) + || (csio->sglist_cnt != 0))) + || (((flags & CAM_SEND_STATUS) == 0) + && (dxfer_len == 0)) + || ((flags & CAM_DATA_SG) + && (csio->sglist_cnt == 0)) + || (((flags & CAM_DATA_SG) == 0) + && (csio->sglist_cnt != 0))) { + printf("%s: tag %04x cdb %02x flags %#x dxfer_len " + "%d sg %u\n", __func__, atio->tag_id, + atio->cdb_io.cdb_bytes[0], flags, dxfer_len, + csio->sglist_cnt); + printf("%s: tag %04x io status %#x\n", __func__, + atio->tag_id, io->io_hdr.status); + } #endif - cam_fill_ctio(csio, - /*retries*/ 2, - ctlfedone, - flags, - (flags & CAM_TAG_ACTION_VALID) ? - MSG_SIMPLE_Q_TAG : 0, - atio->tag_id, - atio->init_id, - scsi_status, - /*data_ptr*/ data_ptr, - /*dxfer_len*/ dxfer_len, - /*timeout*/ 5 * 1000); - start_ccb->ccb_h.flags |= CAM_UNLOCKED; - start_ccb->ccb_h.ccb_atio = atio; - if (((flags & CAM_SEND_STATUS) == 0) - && (io != NULL)) - io->io_hdr.flags |= CTL_FLAG_DMA_INPROG; - - softc->ctios_sent++; - - cam_periph_unlock(periph); - xpt_action(start_ccb); - cam_periph_lock(periph); + cam_fill_ctio(csio, + /*retries*/ 2, + ctlfedone, + flags, + (flags & CAM_TAG_ACTION_VALID) ? MSG_SIMPLE_Q_TAG : 0, + atio->tag_id, + atio->init_id, + scsi_status, + /*data_ptr*/ data_ptr, + /*dxfer_len*/ dxfer_len, + /*timeout*/ 5 * 1000); + start_ccb->ccb_h.flags |= CAM_UNLOCKED; + start_ccb->ccb_h.ccb_atio = atio; + if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) + io->io_hdr.flags |= CTL_FLAG_DMA_INPROG; + io->io_hdr.flags &= ~(CTL_FLAG_DMA_QUEUED | CTL_FLAG_STATUS_QUEUED); - if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(periph->path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - atio->ccb_h.status &= ~CAM_DEV_QFRZN; - } + softc->ctios_sent++; - ccb_h = TAILQ_FIRST(&softc->work_queue); + cam_periph_unlock(periph); + xpt_action(start_ccb); + cam_periph_lock(periph); + + if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { + cam_release_devq(periph->path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + atio->ccb_h.status &= ~CAM_DEV_QFRZN; } + /* - * If we still have work to do, ask for another CCB. Otherwise, - * deactivate our callout. + * If we still have work to do, ask for another CCB. */ - if (ccb_h != NULL) + if (!TAILQ_EMPTY(&softc->work_queue)) xpt_schedule(periph, /*priority*/ 1); - else - callout_stop(&softc->dma_callout); } static void @@ -1278,7 +1223,7 @@ ctlfedone(struct cam_periph *periph, uni | (done_ccb->csio.msg_ptr[6]); } - if (srr && (done_ccb->ccb_h.flags & CAM_SEND_STATUS)) { + if (srr && (io->io_hdr.flags & CTL_FLAG_DMA_INPROG) == 0) { /* * If status was being sent, the back end data is now * history. Hack it up and resubmit a new command with @@ -1317,7 +1262,7 @@ ctlfedone(struct cam_periph *periph, uni * resources. If we were doing a datamove, call the * datamove done routine. */ - if (done_ccb->ccb_h.flags & CAM_SEND_STATUS) { + if ((io->io_hdr.flags & CTL_FLAG_DMA_INPROG) == 0) { softc->ccbs_freed++; xpt_release_ccb(done_ccb); /* @@ -1986,7 +1931,6 @@ ctlfe_dump_sim(struct cam_sim *sim) printf("%s%d: max tagged openings: %d, max dev openings: %d\n", sim->sim_name, sim->unit_number, sim->max_tagged_dev_openings, sim->max_dev_openings); - printf("\n"); } /* @@ -2003,27 +1947,11 @@ ctlfe_dump_queue(struct ctlfe_lun_softc num_items = 0; TAILQ_FOREACH(hdr, &softc->work_queue, periph_links.tqe) { - union ctl_io *io; - - io = hdr->io_ptr; + union ctl_io *io = hdr->io_ptr; num_items++; /* - * This can happen when we get an ATIO but can't allocate - * a ctl_io. See the XPT_ACCEPT_TARGET_IO case in ctlfedone(). - */ - if (io == NULL) { - struct ccb_scsiio *csio; - - csio = (struct ccb_scsiio *)hdr; - - xpt_print(periph->path, "CCB %#x ctl_io allocation " - "failed\n", csio->tag_id); - continue; - } - - /* * Only regular SCSI I/O is put on the work * queue, so we can print sense here. There may be no * sense if it's no the queue for a DMA, but this serves to @@ -2035,20 +1963,15 @@ ctlfe_dump_queue(struct ctlfe_lun_softc ctl_io_error_print(io, NULL); /* - * We're sending status back to the - * initiator, so we're on the queue waiting - * for a CTIO to do that. + * Print DMA status if we are DMA_QUEUED. */ - if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) - continue; - - /* - * Otherwise, we're on the queue waiting to - * do a data transfer. - */ - xpt_print(periph->path, "Total %u, Current %u, Resid %u\n", - io->scsiio.kern_total_len, io->scsiio.kern_data_len, - io->scsiio.kern_data_resid); + if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) { + xpt_print(periph->path, + "Total %u, Current %u, Resid %u\n", + io->scsiio.kern_total_len, + io->scsiio.kern_data_len, + io->scsiio.kern_data_resid); + } } xpt_print(periph->path, "%d requests total waiting for CCBs\n", @@ -2064,66 +1987,43 @@ ctlfe_dump_queue(struct ctlfe_lun_softc } /* - * This function is called when we fail to get a CCB for a DMA or status return - * to the initiator within the specified time period. - * - * The callout code should insure that we hold the sim mutex here. + * Datamove/done routine called by CTL. Put ourselves on the queue to + * receive a CCB from CAM so we can queue the continue I/O request down + * to the adapter. */ static void -ctlfe_dma_timeout(void *arg) +ctlfe_datamove(union ctl_io *io) { - struct ctlfe_lun_softc *softc; + union ccb *ccb; struct cam_periph *periph; - struct cam_sim *sim; - int num_queued; - - softc = (struct ctlfe_lun_softc *)arg; - periph = softc->periph; - sim = xpt_path_sim(periph->path); - num_queued = 0; - - /* - * Nothing to do... - */ - if (TAILQ_FIRST(&softc->work_queue) == NULL) { - xpt_print(periph->path, "TIMEOUT triggered after %d " - "seconds, but nothing on work queue??\n", - CTLFE_DMA_TIMEOUT); - return; - } - - xpt_print(periph->path, "TIMEOUT (%d seconds) waiting for DMA to " - "start\n", CTLFE_DMA_TIMEOUT); - - ctlfe_dump_queue(softc); - - ctlfe_dump_sim(sim); + struct ctlfe_lun_softc *softc; - xpt_print(periph->path, "calling xpt_schedule() to attempt to " - "unstick our queue\n"); + KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, + ("Unexpected io_type (%d) in ctlfe_datamove", io->io_hdr.io_type)); + ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + periph = xpt_path_periph(ccb->ccb_h.path); + cam_periph_lock(periph); + softc = (struct ctlfe_lun_softc *)periph->softc; + io->io_hdr.flags |= CTL_FLAG_DMA_QUEUED; + if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) + io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED; + TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h, + periph_links.tqe); xpt_schedule(periph, /*priority*/ 1); - - xpt_print(periph->path, "xpt_schedule() call complete\n"); + cam_periph_unlock(periph); } -/* - * Datamove/done routine called by CTL. Put ourselves on the queue to - * receive a CCB from CAM so we can queue the continue I/O request down - * to the adapter. - */ static void -ctlfe_datamove_done(union ctl_io *io) +ctlfe_done(union ctl_io *io) { union ccb *ccb; struct cam_periph *periph; struct ctlfe_lun_softc *softc; ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; - periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); - softc = (struct ctlfe_lun_softc *)periph->softc; if (io->io_hdr.io_type == CTL_IO_TASK) { @@ -2143,27 +2043,10 @@ ctlfe_datamove_done(union ctl_io *io) ccb->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE; xpt_action(ccb); } else { - if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) - io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED; - else - io->io_hdr.flags |= CTL_FLAG_DMA_QUEUED; - + io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED; TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h, periph_links.tqe); - - /* - * Reset the timeout for our latest active DMA. - */ - callout_reset(&softc->dma_callout, - CTLFE_DMA_TIMEOUT * hz, - ctlfe_dma_timeout, softc); - /* - * Ask for the CAM transport layer to send us a CCB to do - * the DMA or send status, unless ctlfe_dma_enabled is set - * to 0. - */ - if (ctlfe_dma_enabled != 0) - xpt_schedule(periph, /*priority*/ 1); + xpt_schedule(periph, /*priority*/ 1); } cam_periph_unlock(periph); @@ -2173,14 +2056,11 @@ static void ctlfe_dump(void) { struct ctlfe_softc *bus_softc; + struct ctlfe_lun_softc *lun_softc; STAILQ_FOREACH(bus_softc, &ctlfe_softc_list, links) { - struct ctlfe_lun_softc *lun_softc; - ctlfe_dump_sim(bus_softc->sim); - - STAILQ_FOREACH(lun_softc, &bus_softc->lun_softc_list, links) { + STAILQ_FOREACH(lun_softc, &bus_softc->lun_softc_list, links) ctlfe_dump_queue(lun_softc); - } } } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:25:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D857DEBA; Thu, 18 Dec 2014 08:25:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C28F21787; Thu, 18 Dec 2014 08:25:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8P2CE019952; Thu, 18 Dec 2014 08:25:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8P1mc019934; Thu, 18 Dec 2014 08:25:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180825.sBI8P1mc019934@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275881 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:25:03 -0000 Author: mav Date: Thu Dec 18 08:25:00 2014 New Revision: 275881 URL: https://svnweb.freebsd.org/changeset/base/275881 Log: MFC r275058: Coalesce last data move and command status for read commands. Make CTL core and block backend set success status before initiating last data move for read commands. Make CAM target and iSCSI frontends detect such condition and send command status together with data. New I/O flag allows to skip duplicate status sending on later fe_done() call. For Fibre Channel this change saves one of three interrupts per read command, increasing performance from 126K to 160K IOPS. For iSCSI this change saves one of three PDUs per read command, increasing performance from 1M to 1.2M IOPS. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_tpc.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:25:00 2014 (r275881) @@ -4998,23 +4998,13 @@ ctl_config_move_done(union ctl_io *io) { int retval; - retval = CTL_RETVAL_COMPLETE; - - CTL_DEBUG_PRINT(("ctl_config_move_done\n")); - /* - * XXX KDM this shouldn't happen, but what if it does? - */ - if (io->io_hdr.io_type != CTL_IO_SCSI) - panic("I/O type isn't CTL_IO_SCSI!"); + KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, + ("Config I/O type isn't CTL_IO_SCSI (%d)!", io->io_hdr.io_type)); - if ((io->io_hdr.port_status == 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) - io->io_hdr.status = CTL_SUCCESS; - else if ((io->io_hdr.port_status != 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)){ + if ((io->io_hdr.port_status != 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { /* * For hardware error sense keys, the sense key * specific value is defined to be a retry count, @@ -5027,15 +5017,12 @@ ctl_config_move_done(union ctl_io *io) /*sks_valid*/ 1, /*retry_count*/ io->io_hdr.port_status); - if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) - free(io->scsiio.kern_data_ptr, M_CTL); - ctl_done(io); - goto bailout; } - if (((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) - || ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) - || ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0)) { + if (((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) || + ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) || + ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0)) { /* * XXX KDM just assuming a single pointer here, and not a * S/G list. If we start using S/G lists for config data, @@ -5043,8 +5030,8 @@ ctl_config_move_done(union ctl_io *io) */ if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) free(io->scsiio.kern_data_ptr, M_CTL); - /* Hopefully the user has already set the status... */ ctl_done(io); + retval = CTL_RETVAL_COMPLETE; } else { /* * XXX KDM now we need to continue data movement. Some @@ -5067,7 +5054,6 @@ ctl_config_move_done(union ctl_io *io) */ retval = ctl_scsiio(&io->scsiio); } -bailout: return (retval); } @@ -5213,13 +5199,12 @@ ctl_scsi_release(struct ctl_scsiio *ctsi mtx_unlock(&lun->lun_lock); - ctl_set_success(ctsio); - if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { free(ctsio->kern_data_ptr, M_CTL); ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; } + ctl_set_success(ctsio); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } @@ -5683,9 +5668,9 @@ ctl_read_buffer(struct ctl_scsiio *ctsio ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctl_set_success(ctsio); ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -5748,8 +5733,8 @@ ctl_write_buffer(struct ctl_scsiio *ctsi return (CTL_RETVAL_COMPLETE); } + ctl_set_success(ctsio); ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -6878,12 +6863,10 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) } } - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -7033,11 +7016,10 @@ ctl_log_sense(struct ctl_scsiio *ctsio) memcpy(header + 1, page_index->page_data, page_index->page_len); - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -7092,12 +7074,10 @@ ctl_read_capacity(struct ctl_scsiio *cts */ scsi_ulto4b(lun->be_lun->blocksize, data->length); - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -7155,12 +7135,10 @@ ctl_read_capacity_16(struct ctl_scsiio * if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) data->lalba_lbp[0] |= SRC16_LBPME | SRC16_LBPRZ; - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -7220,7 +7198,7 @@ ctl_read_defect(struct ctl_scsiio *ctsio scsi_ulto4b(0, data12->length); } - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -7363,15 +7341,9 @@ ctl_report_tagret_port_groups(struct ctl } mtx_unlock(&softc->ctl_lock); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - - CTL_DEBUG_PRINT(("buf = %x %x %x %x %x %x %x %x\n", - ctsio->kern_data_ptr[0], ctsio->kern_data_ptr[1], - ctsio->kern_data_ptr[2], ctsio->kern_data_ptr[3], - ctsio->kern_data_ptr[4], ctsio->kern_data_ptr[5], - ctsio->kern_data_ptr[6], ctsio->kern_data_ptr[7])); - ctl_datamove((union ctl_io *)ctsio); return(retval); } @@ -7535,9 +7507,9 @@ fill_one: break; } + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return(retval); } @@ -7579,9 +7551,9 @@ ctl_report_supported_tmf(struct ctl_scsi data->byte1 |= RST_ATS | RST_ATSS | RST_CTSS | RST_LURS | RST_TRS; data->byte2 |= RST_ITNRS; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -7629,9 +7601,9 @@ ctl_report_timestamp(struct ctl_scsiio * scsi_ulto4b(timestamp >> 16, data->timestamp); scsi_ulto2b(timestamp & 0xffff, &data->timestamp[4]); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -7896,17 +7868,10 @@ retry: } mtx_unlock(&lun->lun_lock); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - - CTL_DEBUG_PRINT(("buf = %x %x %x %x %x %x %x %x\n", - ctsio->kern_data_ptr[0], ctsio->kern_data_ptr[1], - ctsio->kern_data_ptr[2], ctsio->kern_data_ptr[3], - ctsio->kern_data_ptr[4], ctsio->kern_data_ptr[5], - ctsio->kern_data_ptr[6], ctsio->kern_data_ptr[7])); - ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9435,12 +9400,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio * We can only return SCSI_STATUS_CHECK_COND when we can't satisfy * this request. */ - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (retval); } @@ -9554,19 +9517,14 @@ ctl_request_sense(struct ctl_scsiio *cts /* * We report the SCSI status as OK, since the status of the * request sense command itself is OK. - */ - ctsio->scsi_status = SCSI_STATUS_OK; - - /* * We report 0 for the sense length, because we aren't doing * autosense in this case. We're reporting sense as * parameter data. */ - ctsio->sense_len = 0; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9585,17 +9543,14 @@ no_sense: /*ascq*/ 0x00, SSD_ELEM_NONE); - ctsio->scsi_status = SCSI_STATUS_OK; - /* * We report 0 for the sense length, because we aren't doing * autosense in this case. We're reporting sense as parameter data. */ - ctsio->sense_len = 0; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9680,12 +9635,10 @@ ctl_inquiry_evpd_supported(struct ctl_sc /* Logical Block Provisioning */ pages->page_list[9] = SVPD_LBP; - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9736,12 +9689,11 @@ ctl_inquiry_evpd_serial(struct ctl_scsii (char *)lun->be_lun->serial_num, CTL_SN_LEN); } else memset(sn_ptr->serial_num, 0x20, CTL_SN_LEN); - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9787,11 +9739,10 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * eid_ptr->flags2 = SVPD_EID_HEADSUP | SVPD_EID_ORDSUP | SVPD_EID_SIMPSUP; eid_ptr->flags3 = SVPD_EID_V_SUP; - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9839,11 +9790,10 @@ ctl_inquiry_evpd_mpp(struct ctl_scsiio * mpp_ptr->descr[0].subpage_code = 0xff; mpp_ptr->descr[0].policy = SVPD_MPP_SHARED; - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9961,11 +9911,10 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio memcpy(desc, port->target_devid->data, port->target_devid->len); } - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10076,11 +10025,10 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s } mtx_unlock(&softc->ctl_lock); - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10145,11 +10093,10 @@ ctl_inquiry_evpd_block_limits(struct ctl } scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10206,11 +10153,10 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * bdc_ptr->wab_wac_ff = (i & 0x0f); bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10259,11 +10205,10 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->prov_type = SVPD_LBP_THIN; } - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10563,7 +10508,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio } } - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -13534,8 +13479,9 @@ ctl_process_done(union ctl_io *io) * Check to see if we have any errors to inject here. We only * inject errors for commands that don't already have errors set. */ - if ((STAILQ_FIRST(&lun->error_list) != NULL) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) + if ((STAILQ_FIRST(&lun->error_list) != NULL) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) && + ((io->io_hdr.flags & CTL_FLAG_STATUS_SENT) == 0)) ctl_inject_error(lun, io); /* Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:25:00 2014 (r275881) @@ -384,8 +384,9 @@ ctl_be_block_move_done(union ctl_io *io) * We set status at this point for read commands, and write * commands with errors. */ - if ((io->io_hdr.port_status == 0) && - ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && + if (io->io_hdr.flags & CTL_FLAG_ABORT) { + ; + } else if ((io->io_hdr.port_status == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { lbalen = ARGS(beio->io); if (lbalen->flags & CTL_LLF_READ) { @@ -408,10 +409,9 @@ ctl_be_block_move_done(union ctl_io *io) else ctl_set_success(&io->scsiio); } - } - else if ((io->io_hdr.port_status != 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { + } else if ((io->io_hdr.port_status != 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { /* * For hardware error sense keys, the sense key * specific value is defined to be a retry count, @@ -535,6 +535,9 @@ ctl_be_block_biodone(struct bio *bio) ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { + if ((ARGS(io)->flags & CTL_LLF_READ) && + beio->beio_cont == NULL) + ctl_set_success(&io->scsiio); #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -742,6 +745,9 @@ ctl_be_block_dispatch_file(struct ctl_be ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { + if ((ARGS(io)->flags & CTL_LLF_READ) && + beio->beio_cont == NULL) + ctl_set_success(&io->scsiio); #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -831,6 +837,9 @@ ctl_be_block_dispatch_zvol(struct ctl_be ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { + if ((ARGS(io)->flags & CTL_LLF_READ) && + beio->beio_cont == NULL) + ctl_set_success(&io->scsiio); #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:25:00 2014 (r275881) @@ -238,9 +238,10 @@ ctl_backend_ramdisk_move_done(union ctl_ if (io->scsiio.kern_sg_entries > 0) free(io->scsiio.kern_data_ptr, M_RAMDISK); io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; - if ((io->io_hdr.port_status == 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { + if (io->io_hdr.flags & CTL_FLAG_ABORT) { + ; + } else if ((io->io_hdr.port_status == 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { if (io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer > 0) { mtx_lock(&be_lun->queue_lock); STAILQ_INSERT_TAIL(&be_lun->cont_queue, @@ -251,9 +252,9 @@ ctl_backend_ramdisk_move_done(union ctl_ return (0); } ctl_set_success(&io->scsiio); - } else if ((io->io_hdr.port_status != 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)){ + } else if ((io->io_hdr.port_status != 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { /* * For hardware error sense keys, the sense key * specific value is defined to be a retry count, Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Dec 18 08:25:00 2014 (r275881) @@ -371,14 +371,16 @@ cfiscsi_pdu_prepare(struct icl_pdu *resp * See the comment below - StatSN is not meaningful and must * not be advanced. */ - if (bhssr->bhssr_opcode == ISCSI_BHS_OPCODE_SCSI_DATA_IN) + if (bhssr->bhssr_opcode == ISCSI_BHS_OPCODE_SCSI_DATA_IN && + (bhssr->bhssr_flags & BHSDI_FLAGS_S) == 0) advance_statsn = false; /* * 10.7.3: "The fields StatSN, Status, and Residual Count * only have meaningful content if the S bit is set to 1." */ - if (bhssr->bhssr_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_IN) + if (bhssr->bhssr_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_IN || + (bhssr->bhssr_flags & BHSDI_FLAGS_S)) bhssr->bhssr_statsn = htonl(cs->cs_statsn); bhssr->bhssr_expcmdsn = htonl(cs->cs_cmdsn); bhssr->bhssr_maxcmdsn = htonl(cs->cs_cmdsn + maxcmdsn_delta); @@ -2552,8 +2554,10 @@ cfiscsi_datamove_in(union ctl_io *io) */ buffer_offset += response->ip_data_len; if (buffer_offset == io->scsiio.kern_total_len || - buffer_offset == expected_len) - bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; + buffer_offset == expected_len) { + buffer_offset -= response->ip_data_len; + break; + } cfiscsi_pdu_queue(response); response = NULL; bhsdi = NULL; @@ -2562,8 +2566,27 @@ cfiscsi_datamove_in(union ctl_io *io) if (response != NULL) { buffer_offset += response->ip_data_len; if (buffer_offset == io->scsiio.kern_total_len || - buffer_offset == expected_len) + buffer_offset == expected_len) { bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; + if (io->io_hdr.status == CTL_SUCCESS) { + bhsdi->bhsdi_flags |= BHSDI_FLAGS_S; + if (PDU_TOTAL_TRANSFER_LEN(request) < + ntohl(bhssc->bhssc_expected_data_transfer_length)) { + bhsdi->bhsdi_flags |= BHSSR_FLAGS_RESIDUAL_UNDERFLOW; + bhsdi->bhsdi_residual_count = + htonl(ntohl(bhssc->bhssc_expected_data_transfer_length) - + PDU_TOTAL_TRANSFER_LEN(request)); + } else if (PDU_TOTAL_TRANSFER_LEN(request) > + ntohl(bhssc->bhssc_expected_data_transfer_length)) { + bhsdi->bhsdi_flags |= BHSSR_FLAGS_RESIDUAL_OVERFLOW; + bhsdi->bhsdi_residual_count = + htonl(PDU_TOTAL_TRANSFER_LEN(request) - + ntohl(bhssc->bhssc_expected_data_transfer_length)); + } + bhsdi->bhsdi_status = io->scsiio.scsi_status; + io->io_hdr.flags |= CTL_FLAG_STATUS_SENT; + } + } KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); cfiscsi_pdu_queue(response); } @@ -2769,8 +2792,9 @@ cfiscsi_scsi_command_done(union ctl_io * * Do not return status for aborted commands. * There are exceptions, but none supported by CTL yet. */ - if ((io->io_hdr.flags & CTL_FLAG_ABORT) && - (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { + if (((io->io_hdr.flags & CTL_FLAG_ABORT) && + (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) || + (io->io_hdr.flags & CTL_FLAG_STATUS_SENT)) { ctl_free_io(io); icl_pdu_free(request); return; Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_io.h Thu Dec 18 08:25:00 2014 (r275881) @@ -124,9 +124,10 @@ typedef enum { CTL_FLAG_FAILOVER = 0x04000000, /* Killed by a failover */ CTL_FLAG_IO_ACTIVE = 0x08000000, /* I/O active on this SC */ CTL_FLAG_RDMA_MASK = CTL_FLAG_NO_DATASYNC | CTL_FLAG_BUS_ADDR | - CTL_FLAG_AUTO_MIRROR | CTL_FLAG_REDIR_DONE + CTL_FLAG_AUTO_MIRROR | CTL_FLAG_REDIR_DONE, /* Flags we care about for remote DMA */ + CTL_FLAG_STATUS_SENT = 0x10000000 /* Status sent by datamove */ } ctl_io_flags; Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_tpc.c Thu Dec 18 08:25:00 2014 (r275881) @@ -425,7 +425,7 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * gco_ptr->data_segment_granularity = 0; gco_ptr->inline_data_granularity = 0; - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -487,9 +487,9 @@ ctl_receive_copy_operating_parameters(st data->list_of_implemented_descriptor_type_codes[2] = EC_SEG_REGISTER_KEY; data->list_of_implemented_descriptor_type_codes[3] = EC_CSCD_ID; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -584,9 +584,9 @@ ctl_receive_copy_status_lid1(struct ctl_ scsi_ulto4b(list_copy.curbytes >> 20, data->transfer_count); } + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -656,9 +656,9 @@ ctl_receive_copy_failure_details(struct scsi_ulto2b(list_copy.sense_len, data->sense_data_length); memcpy(data->sense_data, &list_copy.sense_data, list_copy.sense_len); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -742,9 +742,9 @@ ctl_receive_copy_status_lid4(struct ctl_ data->sense_data_length = list_copy.sense_len; memcpy(data->sense_data, &list_copy.sense_data, list_copy.sense_len); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -1482,8 +1482,6 @@ tpc_done(union ctl_io *io) * more sophisticated initiator type behavior, the CAM error * recovery code in ../common might be helpful. */ -// if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) -// ctl_io_error_print(io, NULL); tio = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) && (io->io_hdr.retries > 0)) { @@ -2180,9 +2178,9 @@ ctl_receive_rod_token_information(struct printf("RRTI(list=%u) valid=%d\n", scsi_4btoul(cdb->list_identifier), list_copy.res_token_valid); */ + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -2246,9 +2244,9 @@ ctl_report_all_rod_tokens(struct ctl_scs /* printf("RART tokens=%d\n", i); */ + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:25:00 2014 (r275881) @@ -792,14 +792,15 @@ ctlfestart(struct cam_periph *periph, un flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); + cmd_info = (struct ctlfe_lun_cmd_info *)io->io_hdr.port_priv; + cmd_info->cur_transfer_index = 0; + cmd_info->cur_transfer_off = 0; + cmd_info->flags = 0; if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) { /* * Datamove call, we need to setup the S/G list. */ - cmd_info = (struct ctlfe_lun_cmd_info *) - io->io_hdr.port_priv; - bzero(cmd_info, sizeof(*cmd_info)); scsi_status = 0; csio->cdb_len = atio->cdb_len; ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, @@ -880,17 +881,23 @@ ctlfestart(struct cam_periph *periph, un xpt_schedule(periph, /*priority*/ 1); return; } - + data_ptr = NULL; + dxfer_len = 0; + csio->sglist_cnt = 0; + scsi_status = 0; + } + if ((io->io_hdr.flags & CTL_FLAG_STATUS_QUEUED) && + (cmd_info->flags & CTLFE_CMD_PIECEWISE) == 0 && + ((io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) == 0 || + io->io_hdr.status == CTL_SUCCESS)) { + io->io_hdr.flags |= CTL_FLAG_STATUS_SENT; flags |= CAM_SEND_STATUS; scsi_status = io->scsiio.scsi_status; csio->sense_len = io->scsiio.sense_len; - data_ptr = NULL; - dxfer_len = 0; #ifdef CTLFEDEBUG printf("%s: tag %04x status %x\n", __func__, atio->tag_id, io->io_hdr.status); #endif - csio->sglist_cnt = 0; if (csio->sense_len != 0) { csio->sense_data = io->scsiio.sense_data; flags |= CAM_SEND_SENSE; @@ -2042,6 +2049,19 @@ ctlfe_done(union ctl_io *io) ccb->ccb_h.status = CAM_REQ_INPROG; ccb->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE; xpt_action(ccb); + } else if (io->io_hdr.flags & CTL_FLAG_STATUS_SENT) { + if (softc->flags & CTLFE_LUN_WILDCARD) { + ccb->ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb->ccb_h.target_lun = CAM_LUN_WILDCARD; + } + if (periph->flags & CAM_PERIPH_INVALID) { + ctlfe_free_ccb(periph, ccb); + } else { + softc->atios_sent++; + cam_periph_unlock(periph); + xpt_action(ccb); + return; + } } else { io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED; TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h, From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:26:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BB807A; Thu, 18 Dec 2014 08:26:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6716F179A; Thu, 18 Dec 2014 08:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8QCv0020144; Thu, 18 Dec 2014 08:26:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8QCbf020143; Thu, 18 Dec 2014 08:26:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180826.sBI8QCbf020143@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275882 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:26:12 -0000 Author: mav Date: Thu Dec 18 08:26:11 2014 New Revision: 275882 URL: https://svnweb.freebsd.org/changeset/base/275882 Log: MFC r275365: Move ctlfe_onoffline() out of lock to let it sleep when needed. Do some more other polishing while there. Modified: stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:25:00 2014 (r275881) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:26:11 2014 (r275882) @@ -622,6 +622,9 @@ ctlferegister(struct cam_periph *periph, "notify CCBs, status 0x%x\n", __func__, status); return (CAM_REQ_CMP_ERR); } + mtx_lock(&bus_softc->lun_softc_mtx); + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); + mtx_unlock(&bus_softc->lun_softc_mtx); return (CAM_REQ_CMP); } @@ -1573,12 +1576,7 @@ ctlfe_onoffline(void *arg, int online) printf("%s: unable to create path!\n", __func__); return; } - ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_NOWAIT | M_ZERO); - if (ccb == NULL) { - printf("%s: unable to malloc CCB!\n", __func__); - xpt_free_path(path); - return; - } + ccb = xpt_alloc_ccb(); xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); /* @@ -1711,10 +1709,7 @@ ctlfe_onoffline(void *arg, int online) } xpt_free_path(path); - - free(ccb, M_TEMP); - - return; + xpt_free_ccb(ccb); } static void @@ -1740,14 +1735,7 @@ ctlfe_online(void *arg) return; } - lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, - M_NOWAIT | M_ZERO); - if (lun_softc == NULL) { - xpt_print(path, "%s: unable to allocate softc for " - "wildcard periph\n", __func__); - xpt_free_path(path); - return; - } + lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, M_WAITOK | M_ZERO); xpt_path_lock(path); periph = cam_periph_find(path, "ctl"); @@ -1780,14 +1768,10 @@ ctlfe_online(void *arg) "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); free(lun_softc, M_CTLFE); - } else { - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); - ctlfe_onoffline(arg, /*online*/ 1); } xpt_path_unlock(path); + ctlfe_onoffline(arg, /*online*/ 1); xpt_free_path(path); } @@ -1801,6 +1785,8 @@ ctlfe_offline(void *arg) bus_softc = (struct ctlfe_softc *)arg; + ctlfe_onoffline(arg, /*online*/ 0); + /* * Disable the wildcard LUN for this port now that we have taken * the port offline. @@ -1813,14 +1799,9 @@ ctlfe_offline(void *arg) __func__); return; } - xpt_path_lock(path); - - ctlfe_onoffline(arg, /*online*/ 0); - if ((periph = cam_periph_find(path, "ctl")) != NULL) cam_periph_invalidate(periph); - xpt_path_unlock(path); xpt_free_path(path); } @@ -1881,10 +1862,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); free(softc, M_CTLFE); - } else { - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); } xpt_path_unlock(path); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:27:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F5861D0; Thu, 18 Dec 2014 08:27:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1091717AD; Thu, 18 Dec 2014 08:27:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8R14s020296; Thu, 18 Dec 2014 08:27:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8R1X3020294; Thu, 18 Dec 2014 08:27:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180827.sBI8R1X3020294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275883 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:27:02 -0000 Author: mav Date: Thu Dec 18 08:27:00 2014 New Revision: 275883 URL: https://svnweb.freebsd.org/changeset/base/275883 Log: MFC r275403: Removed unused variable and unify some names. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:26:11 2014 (r275882) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:00 2014 (r275883) @@ -10970,7 +10970,6 @@ ctl_check_blocked(struct ctl_lun *lun) case CTL_ACTION_SKIP: { struct ctl_softc *softc; const struct ctl_cmd_entry *entry; - uint32_t initidx; int isc_retval; /* @@ -11010,8 +11009,6 @@ ctl_check_blocked(struct ctl_lun *lun) entry = ctl_get_cmd_entry(&cur_blocked->scsiio, NULL); softc = control_softc; - initidx = ctl_get_initindex(&cur_blocked->io_hdr.nexus); - /* * Check this I/O for LUN state changes that may * have happened while this command was blocked. @@ -11848,7 +11845,7 @@ ctl_lun_reset(struct ctl_lun *lun, union { union ctl_io *xio; #if 0 - uint32_t initindex; + uint32_t initidx; #endif int i; @@ -11868,9 +11865,9 @@ ctl_lun_reset(struct ctl_lun *lun, union * This version sets unit attention for every */ #if 0 - initindex = ctl_get_initindex(&io->io_hdr.nexus); + initidx = ctl_get_initindex(&io->io_hdr.nexus); for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (initindex == i) + if (initidx == i) continue; lun->pending_ua[i] |= ua_type; } @@ -11978,9 +11975,9 @@ ctl_i_t_nexus_reset(union ctl_io *io) { struct ctl_softc *softc = control_softc; struct ctl_lun *lun; - uint32_t initindex, residx; + uint32_t initidx, residx; - initindex = ctl_get_initindex(&io->io_hdr.nexus); + initidx = ctl_get_initindex(&io->io_hdr.nexus); residx = ctl_get_resindex(&io->io_hdr.nexus); mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { @@ -11989,11 +11986,11 @@ ctl_i_t_nexus_reset(union ctl_io *io) io->io_hdr.nexus.initid.id, (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); #ifdef CTL_WITH_CA - ctl_clear_mask(lun->have_ca, initindex); + ctl_clear_mask(lun->have_ca, initidx); #endif if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == residx)) lun->flags &= ~CTL_LUN_RESERVED; - lun->pending_ua[initindex] |= CTL_UA_I_T_NEXUS_LOSS; + lun->pending_ua[initidx] |= CTL_UA_I_T_NEXUS_LOSS; mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:27:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 331D2311; Thu, 18 Dec 2014 08:27:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1E5A717C7; Thu, 18 Dec 2014 08:27:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8RlNa020440; Thu, 18 Dec 2014 08:27:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8RlCh020439; Thu, 18 Dec 2014 08:27:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180827.sBI8RlCh020439@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275884 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:27:48 -0000 Author: mav Date: Thu Dec 18 08:27:46 2014 New Revision: 275884 URL: https://svnweb.freebsd.org/changeset/base/275884 Log: MFC r275404: Reduce code duplication by creating ctl_set_res_ua() helper. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:00 2014 (r275883) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:46 2014 (r275884) @@ -7875,6 +7875,15 @@ retry: return (CTL_RETVAL_COMPLETE); } +static void +ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) +{ + + if (residx >= persis_offset && + residx < persis_offset + CTL_MAX_INITIATORS) + lun->pending_ua[residx - persis_offset] |= ua; +} + /* * Returns 0 if ctl_persistent_reserve_out() should continue, non-zero if * it should return. @@ -7928,15 +7937,8 @@ ctl_pro_preempt(struct ctl_softc *softc, if (i == residx || lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; lun->res_type = type; @@ -8007,12 +8009,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { mtx_unlock(&lun->lun_lock); @@ -8087,27 +8084,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (sa_res_key == lun->pr_keys[i]) { lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type ==SPR_TYPE_EX_AC_RO)){ - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[ - i-persis_offset] |= - CTL_UA_RES_RELEASE; + ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = type; @@ -8146,15 +8127,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { @@ -8209,14 +8182,8 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8231,15 +8198,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < persis_offset) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } } } else { @@ -8251,25 +8210,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (sa_res_key == lun->pr_keys[i]) { lun->pr_keys[i] = 0; lun->pr_key_count--; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type == SPR_TYPE_EX_AC_RO)) { - if (!persis_offset - && i < persis_offset) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_RES_RELEASE; + ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = msg->pr.pr_info.res_type; @@ -8653,14 +8598,8 @@ ctl_persistent_reserve_out(struct ctl_sc for (i=0; i < 2*CTL_MAX_INITIATORS; i++) if (lun->pr_keys[i] != 0) { - if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_RES_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_RES_PREEMPT; - lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; mtx_unlock(&lun->lun_lock); @@ -8802,14 +8741,8 @@ ctl_hndl_per_res_out_on_other_sc(union c for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= CTL_UA_RES_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_RES_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; break; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:28:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44F0244B; Thu, 18 Dec 2014 08:28:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3061917D3; Thu, 18 Dec 2014 08:28:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8SkV5020622; Thu, 18 Dec 2014 08:28:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8SjqG020618; Thu, 18 Dec 2014 08:28:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180828.sBI8SjqG020618@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275885 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:28:46 -0000 Author: mav Date: Thu Dec 18 08:28:44 2014 New Revision: 275885 URL: https://svnweb.freebsd.org/changeset/base/275885 Log: MFC r275405: Convert persis_offset from global variable to softc field. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:46 2014 (r275884) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:28:44 2014 (r275885) @@ -356,7 +356,6 @@ static struct ctl_logical_block_provisio * XXX KDM move these into the softc. */ static int rcv_sync_msg; -static int persis_offset; static uint8_t ctl_pause_rtr; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); @@ -1076,7 +1075,7 @@ ctl_init(void) softc->port_offset = 0; } else softc->port_offset = (softc->ha_id - 1) * CTL_MAX_PORTS; - persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; + softc->persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; /* * XXX KDM need to figure out where we want to get our target ID @@ -7878,10 +7877,10 @@ retry: static void ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) { + int off = lun->ctl_softc->persis_offset; - if (residx >= persis_offset && - residx < persis_offset + CTL_MAX_INITIATORS) - lun->pending_ua[residx - persis_offset] |= ua; + if (residx >= off && residx < off + CTL_MAX_INITIATORS) + lun->pending_ua[residx - off] |= ua; } /* @@ -8420,8 +8419,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ for (i = 0; i < CTL_MAX_INITIATORS;i++){ - if (lun->pr_keys[ - i + persis_offset] == 0) + if (lun->pr_keys[i + + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; @@ -8568,7 +8567,7 @@ ctl_persistent_reserve_out(struct ctl_sc && type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (i == residx || - lun->pr_keys[i + persis_offset] == 0) + lun->pr_keys[i + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8685,8 +8684,8 @@ ctl_hndl_per_res_out_on_other_sc(union c */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i+ - persis_offset] == 0) + if (lun->pr_keys[i + + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= @@ -8719,7 +8718,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i+persis_offset] != 0) + if (lun->pr_keys[i + softc->persis_offset] != 0) lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:27:46 2014 (r275884) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:28:44 2014 (r275885) @@ -450,6 +450,7 @@ struct ctl_softc { int ha_state; int is_single; int port_offset; + int persis_offset; int inquiry_pq_no_lun; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:30:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1124D688; Thu, 18 Dec 2014 08:30:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EFFB018A8; Thu, 18 Dec 2014 08:30:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8UTRR023985; Thu, 18 Dec 2014 08:30:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8UTER023983; Thu, 18 Dec 2014 08:30:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180830.sBI8UTER023983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275886 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:30:30 -0000 Author: mav Date: Thu Dec 18 08:30:28 2014 New Revision: 275886 URL: https://svnweb.freebsd.org/changeset/base/275886 Log: MFC r275447: Do not pre-allocate reservation keys memory for every possible initiator. In configurations with many ports, like iSCSI, each LUN is typically accessed only by limited subset of ports. Allocating that memory on demand allows to reduce CTL memory usage from 5.3MB/LUN to 1.3MB/LUN. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:28:44 2014 (r275885) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:30:28 2014 (r275886) @@ -3038,7 +3038,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_DUMP_STRUCTS: { - int i, j, k, idx; + int i, j, k; struct ctl_port *port; struct ctl_frontend *fe; @@ -3054,13 +3054,14 @@ ctl_ioctl(struct cdev *dev, u_long cmd, continue; for (j = 0; j < (CTL_MAX_PORTS * 2); j++) { + if (lun->pr_keys[j] == NULL) + continue; for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ - idx = j * CTL_MAX_INIT_PER_PORT + k; - if (lun->pr_keys[idx] == 0) + if (lun->pr_keys[j][k] == 0) continue; printf(" LUN %d port %d iid %d key " "%#jx\n", i, j, k, - (uintmax_t)lun->pr_keys[idx]); + (uintmax_t)lun->pr_keys[j][k]); } } } @@ -3649,6 +3650,57 @@ ctl_is_set(uint32_t *mask, uint32_t bit) return (1); } +static uint64_t +ctl_get_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + if (t == NULL) + return (0); + return (t[residx % CTL_MAX_INIT_PER_PORT]); +} + +static void +ctl_clr_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + if (t == NULL) + return; + t[residx % CTL_MAX_INIT_PER_PORT] = 0; +} + +static void +ctl_alloc_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *p; + u_int i; + + i = residx/CTL_MAX_INIT_PER_PORT; + if (lun->pr_keys[i] != NULL) + return; + mtx_unlock(&lun->lun_lock); + p = malloc(sizeof(uint64_t) * CTL_MAX_INIT_PER_PORT, M_CTL, + M_WAITOK | M_ZERO); + mtx_lock(&lun->lun_lock); + if (lun->pr_keys[i] == NULL) + lun->pr_keys[i] = p; + else + free(p, M_CTL); +} + +static void +ctl_set_prkey(struct ctl_lun *lun, uint32_t residx, uint64_t key) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + KASSERT(t != NULL, ("prkey %d is not allocated", residx)); + t[residx % CTL_MAX_INIT_PER_PORT] = key; +} + #ifdef unused /* * The bus, target and lun are optional, they can be filled in later. @@ -4687,6 +4739,10 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); + for (i = 0; i < 2 * CTL_MAX_PORTS; i++) { + if (lun->pr_keys[i] != NULL) + free(lun->pr_keys[i], M_CTL); + } free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -5347,7 +5403,7 @@ ctl_start_stop(struct ctl_scsiio *ctsio) uint32_t residx; residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if (lun->pr_keys[residx] == 0 + if (ctl_get_prkey(lun, residx) == 0 || (lun->pr_res_idx!=residx && lun->res_type < 4)) { ctl_set_reservation_conflict(ctsio); @@ -7615,6 +7671,7 @@ ctl_persistent_reserve_in(struct ctl_scs /* struct scsi_per_res_in_rsrv in_data; */ struct ctl_lun *lun; struct ctl_softc *softc; + uint64_t key; CTL_DEBUG_PRINT(("ctl_persistent_reserve_in\n")); @@ -7700,7 +7757,7 @@ retry: lun->pr_key_count, res_keys->header.length); for (i = 0, key_count = 0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if ((key = ctl_get_prkey(lun, i)) == 0) continue; /* @@ -7726,8 +7783,7 @@ retry: key_count++; continue; } - scsi_u64to8b(lun->pr_keys[i], - res_keys->keys[key_count].key); + scsi_u64to8b(key, res_keys->keys[key_count].key); key_count++; } break; @@ -7778,7 +7834,7 @@ retry: * is 0, since it doesn't really matter. */ if (lun->pr_res_idx != CTL_PR_ALL_REGISTRANTS) { - scsi_u64to8b(lun->pr_keys[lun->pr_res_idx], + scsi_u64to8b(ctl_get_prkey(lun, lun->pr_res_idx), res->data.reservation); } res->data.scopetype = lun->res_type; @@ -7830,10 +7886,10 @@ retry: res_desc = &res_status->desc[0]; for (i = 0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if ((key = ctl_get_prkey(lun, i)) == 0) continue; - scsi_u64to8b(lun->pr_keys[i], res_desc->res_key.key); + scsi_u64to8b(key, res_desc->res_key.key); if ((lun->flags & CTL_LUN_PR_RESERVED) && (lun->pr_res_idx == i || lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS)) { @@ -7933,10 +7989,10 @@ ctl_pro_preempt(struct ctl_softc *softc, * them */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (i == residx || lun->pr_keys[i] == 0) + if (i == residx || ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8002,11 +8058,11 @@ ctl_pro_preempt(struct ctl_softc *softc, } for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] != sa_res_key) + if (ctl_get_prkey(lun, i) != sa_res_key) continue; found = 1; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8035,7 +8091,7 @@ ctl_pro_preempt(struct ctl_softc *softc, } else { /* Reserved but not all registrants */ /* sa_res_key is res holder */ - if (sa_res_key == lun->pr_keys[lun->pr_res_idx]) { + if (sa_res_key == ctl_get_prkey(lun, lun->pr_res_idx)) { /* validate scope and type */ if ((cdb->scope_type & SPR_SCOPE_MASK) != SPR_LU_SCOPE) { @@ -8077,11 +8133,11 @@ ctl_pro_preempt(struct ctl_softc *softc, */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (i == residx || lun->pr_keys[i] == 0) + if (i == residx || ctl_get_prkey(lun, i) == 0) continue; - if (sa_res_key == lun->pr_keys[i]) { - lun->pr_keys[i] = 0; + if (sa_res_key == ctl_get_prkey(lun, i)) { + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type @@ -8120,11 +8176,11 @@ ctl_pro_preempt(struct ctl_softc *softc, int found=0; for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (sa_res_key != lun->pr_keys[i]) + if (sa_res_key != ctl_get_prkey(lun, i)) continue; found = 1; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8170,7 +8226,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS || lun->pr_res_idx == CTL_PR_NO_RESERVATION - || sa_res_key != lun->pr_keys[lun->pr_res_idx]) { + || sa_res_key != ctl_get_prkey(lun, lun->pr_res_idx)) { if (sa_res_key == 0) { /* * Unregister everybody else and build UA for @@ -8178,10 +8234,10 @@ ctl_pro_preempt_other(struct ctl_lun *lu */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (i == msg->pr.pr_info.residx || - lun->pr_keys[i] == 0) + ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8192,10 +8248,10 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_res_idx = msg->pr.pr_info.residx; } else { for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (sa_res_key == lun->pr_keys[i]) + if (sa_res_key == ctl_get_prkey(lun, i)) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8203,11 +8259,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu } else { for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (i == msg->pr.pr_info.residx || - lun->pr_keys[i] == 0) + ctl_get_prkey(lun, i) == 0) continue; - if (sa_res_key == lun->pr_keys[i]) { - lun->pr_keys[i] = 0; + if (sa_res_key == ctl_get_prkey(lun, i)) { + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type @@ -8239,7 +8295,7 @@ ctl_persistent_reserve_out(struct ctl_sc struct scsi_per_res_out_parms* param; struct ctl_softc *softc; uint32_t residx; - uint64_t res_key, sa_res_key; + uint64_t res_key, sa_res_key, key; uint8_t type; union ctl_ha_msg persis_io; int i; @@ -8313,8 +8369,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ if ((cdb->action & SPRO_ACTION_MASK) != SPRO_REG_IGNO) { mtx_lock(&lun->lun_lock); - if (lun->pr_keys[residx] != 0) { - if (res_key != lun->pr_keys[residx]) { + if ((key = ctl_get_prkey(lun, residx)) != 0) { + if (res_key != key) { /* * The current key passed in doesn't match * the one the initiator previously @@ -8395,12 +8451,12 @@ ctl_persistent_reserve_out(struct ctl_sc if ((res_key == 0 && (cdb->action & SPRO_ACTION_MASK) == SPRO_REGISTER) || ((cdb->action & SPRO_ACTION_MASK) == SPRO_REG_IGNO - && lun->pr_keys[residx] == 0)) { + && ctl_get_prkey(lun, residx) == 0)) { mtx_unlock(&lun->lun_lock); goto done; } - lun->pr_keys[residx] = 0; + ctl_clr_prkey(lun, residx); lun->pr_key_count--; if (residx == lun->pr_res_idx) { @@ -8419,8 +8475,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ for (i = 0; i < CTL_MAX_INITIATORS;i++){ - if (lun->pr_keys[i + - softc->persis_offset] == 0) + if (ctl_get_prkey(lun, i + + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; @@ -8450,9 +8506,10 @@ ctl_persistent_reserve_out(struct ctl_sc * If we aren't registered currently then increment * the key count and set the registered flag. */ - if (lun->pr_keys[residx] == 0) + ctl_alloc_prkey(lun, residx); + if (ctl_get_prkey(lun, residx) == 0) lun->pr_key_count++; - lun->pr_keys[residx] = sa_res_key; + ctl_set_prkey(lun, residx, sa_res_key); persis_io.hdr.nexus = ctsio->io_hdr.nexus; persis_io.hdr.msg_type = CTL_MSG_PERS_ACTION; @@ -8567,7 +8624,8 @@ ctl_persistent_reserve_out(struct ctl_sc && type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (i == residx || - lun->pr_keys[i + softc->persis_offset] == 0) + ctl_get_prkey(lun, + i + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8593,11 +8651,10 @@ ctl_persistent_reserve_out(struct ctl_sc lun->pr_key_count = 0; lun->pr_res_idx = CTL_PR_NO_RESERVATION; - lun->pr_keys[residx] = 0; - + ctl_clr_prkey(lun, residx); for (i=0; i < 2*CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i] != 0) { - lun->pr_keys[i] = 0; + if (ctl_get_prkey(lun, i) != 0) { + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; @@ -8655,15 +8712,16 @@ ctl_hndl_per_res_out_on_other_sc(union c mtx_lock(&lun->lun_lock); switch(msg->pr.pr_info.action) { case CTL_PR_REG_KEY: - if (lun->pr_keys[msg->pr.pr_info.residx] == 0) + ctl_alloc_prkey(lun, msg->pr.pr_info.residx); + if (ctl_get_prkey(lun, msg->pr.pr_info.residx) == 0) lun->pr_key_count++; - lun->pr_keys[msg->pr.pr_info.residx] = - scsi_8btou64(msg->pr.pr_info.sa_res_key); + ctl_set_prkey(lun, msg->pr.pr_info.residx, + scsi_8btou64(msg->pr.pr_info.sa_res_key)); lun->PRGeneration++; break; case CTL_PR_UNREG_KEY: - lun->pr_keys[msg->pr.pr_info.residx] = 0; + ctl_clr_prkey(lun, msg->pr.pr_info.residx); lun->pr_key_count--; /* XXX Need to see if the reservation has been released */ @@ -8684,8 +8742,8 @@ ctl_hndl_per_res_out_on_other_sc(union c */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i + - softc->persis_offset] == 0) + if (ctl_get_prkey(lun, i + + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= @@ -8718,7 +8776,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i + softc->persis_offset] != 0) + if (ctl_get_prkey(lun, i + softc->persis_offset) != 0) lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8738,9 +8796,9 @@ ctl_hndl_per_res_out_on_other_sc(union c lun->pr_res_idx = CTL_PR_NO_RESERVATION; for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if (ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; @@ -11051,7 +11109,7 @@ ctl_scsiio_lun_check(struct ctl_softc *c * reservation and this isn't the res holder then set a * conflict. */ - if (lun->pr_keys[residx] == 0 + if (ctl_get_prkey(lun, residx) == 0 || (residx != lun->pr_res_idx && lun->res_type < 4)) { ctl_set_reservation_conflict(ctsio); retval = 1; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:28:44 2014 (r275885) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:30:28 2014 (r275886) @@ -410,7 +410,7 @@ struct ctl_lun { struct ctl_lun_io_stats stats; uint32_t res_idx; unsigned int PRGeneration; - uint64_t pr_keys[2*CTL_MAX_INITIATORS]; + uint64_t *pr_keys[2 * CTL_MAX_PORTS]; int pr_key_count; uint32_t pr_res_idx; uint8_t res_type; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:31:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 651687D4; Thu, 18 Dec 2014 08:31:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3729F18BF; Thu, 18 Dec 2014 08:31:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8VEAv024593; Thu, 18 Dec 2014 08:31:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8VE7Y024592; Thu, 18 Dec 2014 08:31:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180831.sBI8VE7Y024592@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275887 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:31:14 -0000 Author: mav Date: Thu Dec 18 08:31:13 2014 New Revision: 275887 URL: https://svnweb.freebsd.org/changeset/base/275887 Log: MFC r275455: Remove some unused code. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:30:28 2014 (r275886) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:31:13 2014 (r275887) @@ -402,12 +402,6 @@ static int ctl_ioctl(struct cdev *dev, u struct thread *td); static uint32_t ctl_map_lun(int port_num, uint32_t lun); static uint32_t ctl_map_lun_back(int port_num, uint32_t lun); -#ifdef unused -static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, - uint32_t targ_target, uint32_t targ_lun, - int can_wait); -static void ctl_kfree_io(union ctl_io *io); -#endif /* unused */ static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, struct ctl_be_lun *be_lun, struct ctl_id target_id); static int ctl_free_lun(struct ctl_lun *lun); @@ -3701,43 +3695,6 @@ ctl_set_prkey(struct ctl_lun *lun, uint3 t[residx % CTL_MAX_INIT_PER_PORT] = key; } -#ifdef unused -/* - * The bus, target and lun are optional, they can be filled in later. - * can_wait is used to determine whether we can wait on the malloc or not. - */ -union ctl_io* -ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, uint32_t targ_target, - uint32_t targ_lun, int can_wait) -{ - union ctl_io *io; - - if (can_wait) - io = (union ctl_io *)malloc(sizeof(*io), M_CTL, M_WAITOK); - else - io = (union ctl_io *)malloc(sizeof(*io), M_CTL, M_NOWAIT); - - if (io != NULL) { - io->io_hdr.io_type = io_type; - io->io_hdr.targ_port = targ_port; - /* - * XXX KDM this needs to change/go away. We need to move - * to a preallocated pool of ctl_scsiio structures. - */ - io->io_hdr.nexus.targ_target.id = targ_target; - io->io_hdr.nexus.targ_lun = targ_lun; - } - - return (io); -} - -void -ctl_kfree_io(union ctl_io *io) -{ - free(io, M_CTL); -} -#endif /* unused */ - /* * ctl_softc, pool_name, total_ctl_io are passed in. * npool is passed out. From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:32:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 145CE910; Thu, 18 Dec 2014 08:32:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F34B118D0; Thu, 18 Dec 2014 08:32:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8W7W3024784; Thu, 18 Dec 2014 08:32:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8W7dh024780; Thu, 18 Dec 2014 08:32:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180832.sBI8W7dh024780@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275888 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:32:08 -0000 Author: mav Date: Thu Dec 18 08:32:06 2014 New Revision: 275888 URL: https://svnweb.freebsd.org/changeset/base/275888 Log: MFC r275458: Do not pre-allocate UNIT ATTENTIONs storage for every possible initiator. Abusing ability of major UAs cover minor ones we may not account UAs for inactive ports. Allocate UAs storage for port and start accounting only after some initiator from that port fetched its first POWER ON OCCURRED. This reduces per-LUN CTL memory usage from >1MB to less then 100K. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_error.c stable/10/sys/cam/ctl/ctl_error.h stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:31:13 2014 (r275887) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:32:06 2014 (r275888) @@ -964,12 +964,70 @@ ctl_copy_sense_data(union ctl_ha_msg *sr dest->io_hdr.status = src->hdr.status; } +static void +ctl_est_ua(struct ctl_lun *lun, uint32_t initidx, ctl_ua_type ua) +{ + ctl_ua_type *pu; + + mtx_assert(&lun->lun_lock, MA_OWNED); + pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT]; + if (pu == NULL) + return; + pu[initidx % CTL_MAX_INIT_PER_PORT] |= ua; +} + +static void +ctl_est_ua_all(struct ctl_lun *lun, uint32_t except, ctl_ua_type ua) +{ + int i, j; + + mtx_assert(&lun->lun_lock, MA_OWNED); + for (i = 0; i < CTL_MAX_PORTS; i++) { + if (lun->pending_ua[i] == NULL) + continue; + for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) { + if (i * CTL_MAX_INIT_PER_PORT + j == except) + continue; + lun->pending_ua[i][j] |= ua; + } + } +} + +static void +ctl_clr_ua(struct ctl_lun *lun, uint32_t initidx, ctl_ua_type ua) +{ + ctl_ua_type *pu; + + mtx_assert(&lun->lun_lock, MA_OWNED); + pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT]; + if (pu == NULL) + return; + pu[initidx % CTL_MAX_INIT_PER_PORT] &= ~ua; +} + +static void +ctl_clr_ua_all(struct ctl_lun *lun, uint32_t except, ctl_ua_type ua) +{ + int i, j; + + mtx_assert(&lun->lun_lock, MA_OWNED); + for (i = 0; i < CTL_MAX_PORTS; i++) { + if (lun->pending_ua[i] == NULL) + continue; + for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) { + if (i * CTL_MAX_INIT_PER_PORT + j == except) + continue; + lun->pending_ua[i][j] &= ~ua; + } + } +} + static int ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS) { struct ctl_softc *softc = (struct ctl_softc *)arg1; struct ctl_lun *lun; - int error, value, i; + int error, value; if (softc->flags & CTL_FLAG_ACTIVE_SHELF) value = 0; @@ -987,8 +1045,7 @@ ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS) softc->flags &= ~CTL_FLAG_ACTIVE_SHELF; STAILQ_FOREACH(lun, &softc->lun_list, links) { mtx_lock(&lun->lun_lock); - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] |= CTL_UA_ASYM_ACC_CHANGE; + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -4549,19 +4606,13 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft ctl_init_log_page_index(lun); /* - * Set the poweron UA for all initiators on this LUN only. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] = CTL_UA_POWERON; - - /* * Now, before we insert this lun on the lun list, set the lun * inventory changed UA for all other luns. */ STAILQ_FOREACH(nlun, &ctl_softc->lun_list, links) { - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; - } + mtx_lock(&nlun->lun_lock); + ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE); + mtx_unlock(&nlun->lun_lock); } STAILQ_INSERT_TAIL(&ctl_softc->lun_list, lun, links); @@ -4696,18 +4747,18 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); - for (i = 0; i < 2 * CTL_MAX_PORTS; i++) { - if (lun->pr_keys[i] != NULL) - free(lun->pr_keys[i], M_CTL); - } + for (i = 0; i < CTL_MAX_PORTS; i++) + free(lun->pending_ua[i], M_CTL); + for (i = 0; i < 2 * CTL_MAX_PORTS; i++) + free(lun->pr_keys[i], M_CTL); free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); STAILQ_FOREACH(nlun, &softc->lun_list, links) { - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; - } + mtx_lock(&nlun->lun_lock); + ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE); + mtx_unlock(&nlun->lun_lock); } return (0); @@ -4985,19 +5036,10 @@ ctl_lun_operable(struct ctl_be_lun *be_l void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun) { - struct ctl_lun *lun; - struct ctl_softc *softc; - int i; - - softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); - - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] |= CTL_UA_CAPACITY_CHANGED; - + ctl_est_ua_all(lun, -1, CTL_UA_CAPACITY_CHANGED); mtx_unlock(&lun->lun_lock); } @@ -6045,19 +6087,8 @@ ctl_control_page_handler(struct ctl_scsi saved_cp->eca_and_aen |= user_cp->eca_and_aen & SCP_SWP; set_ua = 1; } - if (set_ua != 0) { - int i; - /* - * Let other initiators know that the mode - * parameters for this LUN have changed. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (i == initidx) - continue; - - lun->pending_ua[i] |= CTL_UA_MODE_CHANGE; - } - } + if (set_ua != 0) + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); mtx_unlock(&lun->lun_lock); return (0); @@ -6093,19 +6124,8 @@ ctl_caching_sp_handler(struct ctl_scsiio saved_cp->flags1 |= user_cp->flags1 & (SCP_WCE | SCP_RCD); set_ua = 1; } - if (set_ua != 0) { - int i; - /* - * Let other initiators know that the mode - * parameters for this LUN have changed. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (i == initidx) - continue; - - lun->pending_ua[i] |= CTL_UA_MODE_CHANGE; - } - } + if (set_ua != 0) + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); mtx_unlock(&lun->lun_lock); return (0); @@ -7893,7 +7913,7 @@ ctl_set_res_ua(struct ctl_lun *lun, uint int off = lun->ctl_softc->persis_offset; if (residx >= off && residx < off + CTL_MAX_INITIATORS) - lun->pending_ua[residx - off] |= ua; + ctl_est_ua(lun, residx - off, ua); } /* @@ -8435,8 +8455,8 @@ ctl_persistent_reserve_out(struct ctl_sc if (ctl_get_prkey(lun, i + softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, + CTL_UA_RES_RELEASE); } } lun->res_type = 0; @@ -8584,7 +8604,7 @@ ctl_persistent_reserve_out(struct ctl_sc ctl_get_prkey(lun, i + softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } } mtx_unlock(&lun->lun_lock); @@ -8703,8 +8723,7 @@ ctl_hndl_per_res_out_on_other_sc(union c softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = 0; @@ -8734,8 +8753,7 @@ ctl_hndl_per_res_out_on_other_sc(union c && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) if (ctl_get_prkey(lun, i + softc->persis_offset) != 0) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } lun->flags &= ~CTL_LUN_PR_RESERVED; @@ -9308,7 +9326,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio */ if (request_lun != NULL) { mtx_lock(&lun->lun_lock); - lun->pending_ua[initidx] &= ~CTL_UA_LUN_CHANGE; + ctl_clr_ua(lun, initidx, CTL_UA_RES_RELEASE); mtx_unlock(&lun->lun_lock); } } @@ -9363,6 +9381,7 @@ ctl_request_sense(struct ctl_scsiio *cts uint32_t initidx; int have_error; scsi_sense_data_type sense_format; + ctl_ua_type ua_type; cdb = (struct scsi_request_sense *)ctsio->cdb; @@ -9447,11 +9466,8 @@ ctl_request_sense(struct ctl_scsiio *cts have_error = 1; } else #endif - if (lun->pending_ua[initidx] != CTL_UA_NONE) { - ctl_ua_type ua_type; - - ua_type = ctl_build_ua(&lun->pending_ua[initidx], - sense_ptr, sense_format); + { + ua_type = ctl_build_ua(lun, initidx, sense_ptr, sense_format); if (ua_type != CTL_UA_NONE) have_error = 1; } @@ -11122,7 +11138,6 @@ ctl_failover(void) union ctl_io *next_io, *pending_io; union ctl_io *io; int lun_idx; - int i; ctl_softc = control_softc; @@ -11257,13 +11272,7 @@ ctl_failover(void) } } - /* - * Build Unit Attention - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_ua[i] |= - CTL_UA_ASYM_ACC_CHANGE; - } + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) && (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { printf("FAILOVER: secondary lun %d\n", lun_idx); @@ -11352,13 +11361,7 @@ ctl_failover(void) } } - /* - * Build Unit Attention - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_ua[i] |= - CTL_UA_ASYM_ACC_CHANGE; - } + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else { panic("Unhandled HA mode failover, LUN flags = %#x, " "ha_mode = #%x", lun->flags, ctl_softc->ha_mode); @@ -11494,28 +11497,22 @@ ctl_scsiio_precheck(struct ctl_softc *ct */ if ((entry->flags & CTL_CMD_FLAG_NO_SENSE) == 0) { ctl_ua_type ua_type; + scsi_sense_data_type sense_format; - if (lun->pending_ua[initidx] != CTL_UA_NONE) { - scsi_sense_data_type sense_format; - - if (lun != NULL) - sense_format = (lun->flags & - CTL_LUN_SENSE_DESC) ? SSD_TYPE_DESC : - SSD_TYPE_FIXED; - else - sense_format = SSD_TYPE_FIXED; + if (lun->flags & CTL_LUN_SENSE_DESC) + sense_format = SSD_TYPE_DESC; + else + sense_format = SSD_TYPE_FIXED; - ua_type = ctl_build_ua(&lun->pending_ua[initidx], - &ctsio->sense_data, sense_format); - if (ua_type != CTL_UA_NONE) { - ctsio->scsi_status = SCSI_STATUS_CHECK_COND; - ctsio->io_hdr.status = CTL_SCSI_ERROR | - CTL_AUTOSENSE; - ctsio->sense_len = SSD_FULL_SIZE; - mtx_unlock(&lun->lun_lock); - ctl_done((union ctl_io *)ctsio); - return (retval); - } + ua_type = ctl_build_ua(lun, initidx, &ctsio->sense_data, + sense_format); + if (ua_type != CTL_UA_NONE) { + mtx_unlock(&lun->lun_lock); + ctsio->scsi_status = SCSI_STATUS_CHECK_COND; + ctsio->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; + ctsio->sense_len = SSD_FULL_SIZE; + ctl_done((union ctl_io *)ctsio); + return (retval); } } @@ -11794,7 +11791,9 @@ ctl_lun_reset(struct ctl_lun *lun, union #if 0 uint32_t initidx; #endif +#ifdef CTL_WITH_CA int i; +#endif mtx_lock(&lun->lun_lock); /* @@ -11813,11 +11812,9 @@ ctl_lun_reset(struct ctl_lun *lun, union */ #if 0 initidx = ctl_get_initindex(&io->io_hdr.nexus); - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (initidx == i) - continue; - lun->pending_ua[i] |= ua_type; - } + ctl_est_ua_all(lun, initidx, ua_type); +#else + ctl_est_ua_all(lun, -1, ua_type); #endif /* @@ -11830,12 +11827,10 @@ ctl_lun_reset(struct ctl_lun *lun, union */ lun->flags &= ~CTL_LUN_RESERVED; - for (i = 0; i < CTL_MAX_INITIATORS; i++) { #ifdef CTL_WITH_CA + for (i = 0; i < CTL_MAX_INITIATORS; i++) ctl_clear_mask(lun->have_ca, i); #endif - lun->pending_ua[i] |= ua_type; - } mtx_unlock(&lun->lun_lock); return (0); @@ -11937,7 +11932,7 @@ ctl_i_t_nexus_reset(union ctl_io *io) #endif if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == residx)) lun->flags &= ~CTL_LUN_RESERVED; - lun->pending_ua[initidx] |= CTL_UA_I_T_NEXUS_LOSS; + ctl_est_ua(lun, initidx, CTL_UA_I_T_NEXUS_LOSS); mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -13953,14 +13948,11 @@ ctl_thresh_thread(void *arg) if (lun->lasttpt == 0 || time_uptime - lun->lasttpt >= CTL_LBP_UA_PERIOD) { lun->lasttpt = time_uptime; - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] |= - CTL_UA_THIN_PROV_THRES; + ctl_est_ua_all(lun, -1, CTL_UA_THIN_PROV_THRES); } } else { lun->lasttpt = 0; - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] &= ~CTL_UA_THIN_PROV_THRES; + ctl_clr_ua_all(lun, -1, CTL_UA_THIN_PROV_THRES); } mtx_unlock(&lun->lun_lock); } Modified: stable/10/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.c Thu Dec 18 08:31:13 2014 (r275887) +++ stable/10/sys/cam/ctl/ctl_error.c Thu Dec 18 08:32:06 2014 (r275888) @@ -367,16 +367,35 @@ ctl_set_ua(struct ctl_scsiio *ctsio, int } ctl_ua_type -ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, - scsi_sense_data_type sense_format) +ctl_build_ua(struct ctl_lun *lun, uint32_t initidx, + struct scsi_sense_data *sense, scsi_sense_data_type sense_format) { + ctl_ua_type *ua; ctl_ua_type ua_to_build, ua_to_clear; int asc, ascq; + uint32_t p, i; - if (*ua_type == CTL_UA_NONE) + mtx_assert(&lun->lun_lock, MA_OWNED); + p = initidx / CTL_MAX_INIT_PER_PORT; + if ((ua = lun->pending_ua[p]) == NULL) { + mtx_unlock(&lun->lun_lock); + ua = malloc(sizeof(ctl_ua_type) * CTL_MAX_INIT_PER_PORT, + M_CTL, M_WAITOK); + mtx_lock(&lun->lun_lock); + if (lun->pending_ua[p] == NULL) { + lun->pending_ua[p] = ua; + for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) + ua[i] = CTL_UA_POWERON; + } else { + free(ua, M_CTL); + ua = lun->pending_ua[p]; + } + } + i = initidx % CTL_MAX_INIT_PER_PORT; + if (ua[i] == CTL_UA_NONE) return (CTL_UA_NONE); - ua_to_build = (1 << (ffs(*ua_type) - 1)); + ua_to_build = (1 << (ffs(ua[i]) - 1)); ua_to_clear = ua_to_build; switch (ua_to_build) { @@ -482,7 +501,7 @@ ctl_build_ua(ctl_ua_type *ua_type, struc SSD_ELEM_NONE); /* We're reporting this UA, so clear it */ - *ua_type &= ~ua_to_clear; + ua[i] &= ~ua_to_clear; return (ua_to_build); } Modified: stable/10/sys/cam/ctl/ctl_error.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.h Thu Dec 18 08:31:13 2014 (r275887) +++ stable/10/sys/cam/ctl/ctl_error.h Thu Dec 18 08:32:06 2014 (r275888) @@ -42,6 +42,8 @@ #ifndef _CTL_ERROR_H_ #define _CTL_ERROR_H_ +struct ctl_lun; + void ctl_set_sense_data_va(struct scsi_sense_data *sense_data, void *lun, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq, va_list ap); @@ -55,8 +57,8 @@ void ctl_sense_to_desc(struct scsi_sense void ctl_sense_to_fixed(struct scsi_sense_data_desc *sense_src, struct scsi_sense_data_fixed *sense_dest); void ctl_set_ua(struct ctl_scsiio *ctsio, int asc, int ascq); -ctl_ua_type ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, - scsi_sense_data_type sense_format); +ctl_ua_type ctl_build_ua(struct ctl_lun *lun, uint32_t initidx, + struct scsi_sense_data *sense, scsi_sense_data_type sense_format); void ctl_set_overlapped_cmd(struct ctl_scsiio *ctsio); void ctl_set_overlapped_tag(struct ctl_scsiio *ctsio, uint8_t tag); void ctl_set_invalid_field(struct ctl_scsiio *ctsio, int sks_valid, int command, Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:31:13 2014 (r275887) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:32:06 2014 (r275888) @@ -403,7 +403,7 @@ struct ctl_lun { uint32_t have_ca[CTL_MAX_INITIATORS >> 5]; struct scsi_sense_data pending_sense[CTL_MAX_INITIATORS]; #endif - ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; + ctl_ua_type *pending_ua[CTL_MAX_PORTS]; time_t lasttpt; struct ctl_mode_pages mode_pages; struct ctl_log_pages log_pages; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:32:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEA71A5D; Thu, 18 Dec 2014 08:32:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AA01218E0; Thu, 18 Dec 2014 08:32:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8WvVT024924; Thu, 18 Dec 2014 08:32:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8Wv6j024923; Thu, 18 Dec 2014 08:32:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180832.sBI8Wv6j024923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275889 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:32:58 -0000 Author: mav Date: Thu Dec 18 08:32:56 2014 New Revision: 275889 URL: https://svnweb.freebsd.org/changeset/base/275889 Log: MFC r275459: Unify function names after r275458. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:32:06 2014 (r275888) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:32:56 2014 (r275889) @@ -7908,7 +7908,7 @@ retry: } static void -ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) +ctl_est_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) { int off = lun->ctl_softc->persis_offset; @@ -7970,7 +7970,7 @@ ctl_pro_preempt(struct ctl_softc *softc, continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; lun->res_type = type; @@ -8041,7 +8041,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { mtx_unlock(&lun->lun_lock); @@ -8116,11 +8116,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (sa_res_key == ctl_get_prkey(lun, i)) { ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type ==SPR_TYPE_EX_AC_RO)){ - ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); + ctl_est_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = type; @@ -8159,7 +8159,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { @@ -8215,7 +8215,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8230,7 +8230,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } } } else { @@ -8242,11 +8242,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (sa_res_key == ctl_get_prkey(lun, i)) { ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type == SPR_TYPE_EX_AC_RO)) { - ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); + ctl_est_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = msg->pr.pr_info.res_type; @@ -8632,7 +8632,7 @@ ctl_persistent_reserve_out(struct ctl_sc for (i=0; i < 2*CTL_MAX_INITIATORS; i++) if (ctl_get_prkey(lun, i) != 0) { ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; mtx_unlock(&lun->lun_lock); @@ -8774,7 +8774,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (ctl_get_prkey(lun, i) == 0) continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; break; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:36:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9654EBC7; Thu, 18 Dec 2014 08:36:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7A0041917; Thu, 18 Dec 2014 08:36:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8aLDZ025439; Thu, 18 Dec 2014 08:36:21 GMT (envelope-from erwin@FreeBSD.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8aLHe025437; Thu, 18 Dec 2014 08:36:21 GMT (envelope-from erwin@FreeBSD.org) Message-Id: <201412180836.sBI8aLHe025437@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: erwin set sender to erwin@FreeBSD.org using -f From: Erwin Lansing Date: Thu, 18 Dec 2014 08:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275890 - in stable/9: contrib/bind9 contrib/bind9/bin/check contrib/bind9/bin/confgen contrib/bind9/bin/dig contrib/bind9/bin/dig/include/dig contrib/bind9/bin/dnssec contrib/bind9/bin... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:36:21 -0000 Author: erwin Date: Thu Dec 18 08:36:19 2014 New Revision: 275890 URL: https://svnweb.freebsd.org/changeset/base/275890 Log: Update BIND to 9.9.6-P1 Most notable changes in 9.9.6 and includes the latest SA: https://lists.isc.org/pipermail/bind-announce/2014-September/000928.html Note this is a direct commit to stable/9 as BIND is no longer in head. Sponsored by: DK Hostmaster A/S Added: stable/9/contrib/bind9/lib/dns/rdata/generic/caa_257.c - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/caa_257.c stable/9/contrib/bind9/lib/dns/rdata/generic/caa_257.h - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/caa_257.h stable/9/contrib/bind9/lib/dns/rdata/generic/cdnskey_60.c - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/cdnskey_60.c stable/9/contrib/bind9/lib/dns/rdata/generic/cdnskey_60.h - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/cdnskey_60.h stable/9/contrib/bind9/lib/dns/rdata/generic/cds_59.c - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/cds_59.c stable/9/contrib/bind9/lib/dns/rdata/generic/cds_59.h - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/cds_59.h stable/9/contrib/bind9/lib/isc/counter.c - copied unchanged from r275801, vendor/bind9/dist/lib/isc/counter.c stable/9/contrib/bind9/lib/isc/include/isc/counter.h - copied unchanged from r275801, vendor/bind9/dist/lib/isc/include/isc/counter.h stable/9/contrib/bind9/lib/lwres/compat.c - copied unchanged from r275801, vendor/bind9/dist/lib/lwres/compat.c stable/9/contrib/bind9/lib/lwres/include/lwres/string.h - copied unchanged from r275801, vendor/bind9/dist/lib/lwres/include/lwres/string.h Deleted: stable/9/contrib/bind9/lib/lwres/strtoul.c Modified: stable/9/contrib/bind9/CHANGES stable/9/contrib/bind9/FAQ stable/9/contrib/bind9/FAQ.xml stable/9/contrib/bind9/README stable/9/contrib/bind9/acconfig.h stable/9/contrib/bind9/aclocal.m4 stable/9/contrib/bind9/bin/check/Makefile.in stable/9/contrib/bind9/bin/check/named-checkconf.8 stable/9/contrib/bind9/bin/check/named-checkconf.c stable/9/contrib/bind9/bin/check/named-checkconf.docbook stable/9/contrib/bind9/bin/check/named-checkconf.html stable/9/contrib/bind9/bin/check/named-checkzone.8 stable/9/contrib/bind9/bin/check/named-checkzone.docbook stable/9/contrib/bind9/bin/check/named-checkzone.html stable/9/contrib/bind9/bin/confgen/ddns-confgen.8 stable/9/contrib/bind9/bin/confgen/ddns-confgen.c stable/9/contrib/bind9/bin/confgen/ddns-confgen.docbook stable/9/contrib/bind9/bin/confgen/ddns-confgen.html stable/9/contrib/bind9/bin/confgen/rndc-confgen.8 stable/9/contrib/bind9/bin/confgen/rndc-confgen.docbook stable/9/contrib/bind9/bin/confgen/rndc-confgen.html stable/9/contrib/bind9/bin/dig/dig.1 stable/9/contrib/bind9/bin/dig/dig.c stable/9/contrib/bind9/bin/dig/dig.docbook stable/9/contrib/bind9/bin/dig/dig.html stable/9/contrib/bind9/bin/dig/dighost.c stable/9/contrib/bind9/bin/dig/host.1 stable/9/contrib/bind9/bin/dig/host.c stable/9/contrib/bind9/bin/dig/host.docbook stable/9/contrib/bind9/bin/dig/host.html stable/9/contrib/bind9/bin/dig/include/dig/dig.h stable/9/contrib/bind9/bin/dig/nslookup.1 stable/9/contrib/bind9/bin/dig/nslookup.c stable/9/contrib/bind9/bin/dig/nslookup.docbook stable/9/contrib/bind9/bin/dig/nslookup.html stable/9/contrib/bind9/bin/dnssec/Makefile.in stable/9/contrib/bind9/bin/dnssec/dnssec-dsfromkey.8 stable/9/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c stable/9/contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-dsfromkey.html stable/9/contrib/bind9/bin/dnssec/dnssec-importkey.8 stable/9/contrib/bind9/bin/dnssec/dnssec-importkey.c stable/9/contrib/bind9/bin/dnssec/dnssec-importkey.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-importkey.html stable/9/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8 stable/9/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c stable/9/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html stable/9/contrib/bind9/bin/dnssec/dnssec-keygen.8 stable/9/contrib/bind9/bin/dnssec/dnssec-keygen.c stable/9/contrib/bind9/bin/dnssec/dnssec-keygen.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-keygen.html stable/9/contrib/bind9/bin/dnssec/dnssec-revoke.8 stable/9/contrib/bind9/bin/dnssec/dnssec-revoke.c stable/9/contrib/bind9/bin/dnssec/dnssec-revoke.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-revoke.html stable/9/contrib/bind9/bin/dnssec/dnssec-settime.8 stable/9/contrib/bind9/bin/dnssec/dnssec-settime.c stable/9/contrib/bind9/bin/dnssec/dnssec-settime.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-settime.html stable/9/contrib/bind9/bin/dnssec/dnssec-signzone.8 stable/9/contrib/bind9/bin/dnssec/dnssec-signzone.c stable/9/contrib/bind9/bin/dnssec/dnssec-signzone.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-signzone.html stable/9/contrib/bind9/bin/dnssec/dnssec-verify.8 stable/9/contrib/bind9/bin/dnssec/dnssec-verify.c stable/9/contrib/bind9/bin/dnssec/dnssec-verify.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-verify.html stable/9/contrib/bind9/bin/dnssec/dnssectool.c stable/9/contrib/bind9/bin/dnssec/dnssectool.h stable/9/contrib/bind9/bin/named/bind9.ver3.xsl stable/9/contrib/bind9/bin/named/bind9.ver3.xsl.h stable/9/contrib/bind9/bin/named/client.c stable/9/contrib/bind9/bin/named/config.c stable/9/contrib/bind9/bin/named/control.c stable/9/contrib/bind9/bin/named/controlconf.c stable/9/contrib/bind9/bin/named/include/named/query.h stable/9/contrib/bind9/bin/named/include/named/server.h stable/9/contrib/bind9/bin/named/lwresd.8 stable/9/contrib/bind9/bin/named/lwresd.docbook stable/9/contrib/bind9/bin/named/lwresd.html stable/9/contrib/bind9/bin/named/main.c stable/9/contrib/bind9/bin/named/named.8 stable/9/contrib/bind9/bin/named/named.conf.5 stable/9/contrib/bind9/bin/named/named.conf.docbook stable/9/contrib/bind9/bin/named/named.conf.html stable/9/contrib/bind9/bin/named/named.docbook stable/9/contrib/bind9/bin/named/named.html stable/9/contrib/bind9/bin/named/query.c stable/9/contrib/bind9/bin/named/server.c stable/9/contrib/bind9/bin/named/unix/dlz_dlopen_driver.c stable/9/contrib/bind9/bin/named/unix/os.c stable/9/contrib/bind9/bin/named/update.c stable/9/contrib/bind9/bin/named/zoneconf.c stable/9/contrib/bind9/bin/nsupdate/Makefile.in stable/9/contrib/bind9/bin/nsupdate/nsupdate.1 stable/9/contrib/bind9/bin/nsupdate/nsupdate.c stable/9/contrib/bind9/bin/nsupdate/nsupdate.docbook stable/9/contrib/bind9/bin/nsupdate/nsupdate.html stable/9/contrib/bind9/bin/rndc/rndc.8 stable/9/contrib/bind9/bin/rndc/rndc.c stable/9/contrib/bind9/bin/rndc/rndc.conf.5 stable/9/contrib/bind9/bin/rndc/rndc.conf.docbook stable/9/contrib/bind9/bin/rndc/rndc.conf.html stable/9/contrib/bind9/bin/rndc/rndc.docbook stable/9/contrib/bind9/bin/rndc/rndc.html stable/9/contrib/bind9/bin/tools/arpaname.1 stable/9/contrib/bind9/bin/tools/arpaname.docbook stable/9/contrib/bind9/bin/tools/arpaname.html stable/9/contrib/bind9/bin/tools/genrandom.8 stable/9/contrib/bind9/bin/tools/genrandom.c stable/9/contrib/bind9/bin/tools/genrandom.docbook stable/9/contrib/bind9/bin/tools/genrandom.html stable/9/contrib/bind9/bin/tools/isc-hmac-fixup.8 stable/9/contrib/bind9/bin/tools/isc-hmac-fixup.c stable/9/contrib/bind9/bin/tools/isc-hmac-fixup.docbook stable/9/contrib/bind9/bin/tools/isc-hmac-fixup.html stable/9/contrib/bind9/bin/tools/named-journalprint.8 stable/9/contrib/bind9/bin/tools/named-journalprint.docbook stable/9/contrib/bind9/bin/tools/named-journalprint.html stable/9/contrib/bind9/bin/tools/nsec3hash.8 stable/9/contrib/bind9/bin/tools/nsec3hash.c stable/9/contrib/bind9/bin/tools/nsec3hash.docbook stable/9/contrib/bind9/bin/tools/nsec3hash.html stable/9/contrib/bind9/config.h.in stable/9/contrib/bind9/configure.in stable/9/contrib/bind9/doc/arm/Bv9ARM-book.xml stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html stable/9/contrib/bind9/doc/arm/Bv9ARM.html stable/9/contrib/bind9/doc/arm/Bv9ARM.pdf stable/9/contrib/bind9/doc/arm/Makefile.in stable/9/contrib/bind9/doc/arm/libdns.xml stable/9/contrib/bind9/doc/arm/man.arpaname.html stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html stable/9/contrib/bind9/doc/arm/man.dig.html stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html stable/9/contrib/bind9/doc/arm/man.dnssec-keygen.html stable/9/contrib/bind9/doc/arm/man.dnssec-revoke.html stable/9/contrib/bind9/doc/arm/man.dnssec-settime.html stable/9/contrib/bind9/doc/arm/man.dnssec-signzone.html stable/9/contrib/bind9/doc/arm/man.dnssec-verify.html stable/9/contrib/bind9/doc/arm/man.genrandom.html stable/9/contrib/bind9/doc/arm/man.host.html stable/9/contrib/bind9/doc/arm/man.isc-hmac-fixup.html stable/9/contrib/bind9/doc/arm/man.named-checkconf.html stable/9/contrib/bind9/doc/arm/man.named-checkzone.html stable/9/contrib/bind9/doc/arm/man.named-journalprint.html stable/9/contrib/bind9/doc/arm/man.named.html stable/9/contrib/bind9/doc/arm/man.nsec3hash.html stable/9/contrib/bind9/doc/arm/man.nsupdate.html stable/9/contrib/bind9/doc/arm/man.rndc-confgen.html stable/9/contrib/bind9/doc/arm/man.rndc.conf.html stable/9/contrib/bind9/doc/arm/man.rndc.html stable/9/contrib/bind9/doc/arm/pkcs11.xml stable/9/contrib/bind9/doc/misc/options stable/9/contrib/bind9/lib/bind9/Makefile.in stable/9/contrib/bind9/lib/bind9/api stable/9/contrib/bind9/lib/bind9/check.c stable/9/contrib/bind9/lib/bind9/getaddresses.c stable/9/contrib/bind9/lib/dns/Makefile.in stable/9/contrib/bind9/lib/dns/acl.c stable/9/contrib/bind9/lib/dns/adb.c stable/9/contrib/bind9/lib/dns/api stable/9/contrib/bind9/lib/dns/dispatch.c stable/9/contrib/bind9/lib/dns/dns64.c stable/9/contrib/bind9/lib/dns/dnssec.c stable/9/contrib/bind9/lib/dns/ecdb.c stable/9/contrib/bind9/lib/dns/gen.c stable/9/contrib/bind9/lib/dns/gssapictx.c stable/9/contrib/bind9/lib/dns/include/dns/Makefile.in stable/9/contrib/bind9/lib/dns/include/dns/adb.h stable/9/contrib/bind9/lib/dns/include/dns/dns64.h stable/9/contrib/bind9/lib/dns/include/dns/dnssec.h stable/9/contrib/bind9/lib/dns/include/dns/message.h stable/9/contrib/bind9/lib/dns/include/dns/rbt.h stable/9/contrib/bind9/lib/dns/include/dns/rdataset.h stable/9/contrib/bind9/lib/dns/include/dns/resolver.h stable/9/contrib/bind9/lib/dns/include/dns/view.h stable/9/contrib/bind9/lib/dns/keytable.c stable/9/contrib/bind9/lib/dns/master.c stable/9/contrib/bind9/lib/dns/message.c stable/9/contrib/bind9/lib/dns/name.c stable/9/contrib/bind9/lib/dns/nsec.c stable/9/contrib/bind9/lib/dns/nsec3.c stable/9/contrib/bind9/lib/dns/openssl_link.c stable/9/contrib/bind9/lib/dns/peer.c stable/9/contrib/bind9/lib/dns/rbt.c stable/9/contrib/bind9/lib/dns/rbtdb.c stable/9/contrib/bind9/lib/dns/rcode.c stable/9/contrib/bind9/lib/dns/rdata.c stable/9/contrib/bind9/lib/dns/rdata/generic/gpos_27.c stable/9/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c stable/9/contrib/bind9/lib/dns/rdata/generic/hip_55.c stable/9/contrib/bind9/lib/dns/rdata/generic/isdn_20.c stable/9/contrib/bind9/lib/dns/rdata/generic/naptr_35.c stable/9/contrib/bind9/lib/dns/rdata/generic/nsec3_50.c stable/9/contrib/bind9/lib/dns/rdata/generic/opt_41.c stable/9/contrib/bind9/lib/dns/rdata/generic/spf_99.c stable/9/contrib/bind9/lib/dns/rdata/generic/tkey_249.c stable/9/contrib/bind9/lib/dns/rdata/generic/tlsa_52.c stable/9/contrib/bind9/lib/dns/rdata/generic/tlsa_52.h stable/9/contrib/bind9/lib/dns/rdata/generic/txt_16.c stable/9/contrib/bind9/lib/dns/rdata/generic/uri_256.c stable/9/contrib/bind9/lib/dns/rdata/generic/x25_19.c stable/9/contrib/bind9/lib/dns/rdataslab.c stable/9/contrib/bind9/lib/dns/resolver.c stable/9/contrib/bind9/lib/dns/rootns.c stable/9/contrib/bind9/lib/dns/rpz.c stable/9/contrib/bind9/lib/dns/rrl.c stable/9/contrib/bind9/lib/dns/time.c stable/9/contrib/bind9/lib/dns/tsig.c stable/9/contrib/bind9/lib/dns/validator.c stable/9/contrib/bind9/lib/dns/view.c stable/9/contrib/bind9/lib/dns/zone.c stable/9/contrib/bind9/lib/export/isc/Makefile.in stable/9/contrib/bind9/lib/export/samples/sample-update.c stable/9/contrib/bind9/lib/irs/Makefile.in stable/9/contrib/bind9/lib/irs/api stable/9/contrib/bind9/lib/irs/context.c stable/9/contrib/bind9/lib/irs/getaddrinfo.c stable/9/contrib/bind9/lib/irs/include/irs/Makefile.in stable/9/contrib/bind9/lib/isc/Makefile.in stable/9/contrib/bind9/lib/isc/api stable/9/contrib/bind9/lib/isc/backtrace.c stable/9/contrib/bind9/lib/isc/base32.c stable/9/contrib/bind9/lib/isc/event.c stable/9/contrib/bind9/lib/isc/hash.c stable/9/contrib/bind9/lib/isc/include/isc/Makefile.in stable/9/contrib/bind9/lib/isc/include/isc/base32.h stable/9/contrib/bind9/lib/isc/include/isc/buffer.h stable/9/contrib/bind9/lib/isc/include/isc/event.h stable/9/contrib/bind9/lib/isc/include/isc/file.h stable/9/contrib/bind9/lib/isc/include/isc/iterated_hash.h stable/9/contrib/bind9/lib/isc/include/isc/print.h stable/9/contrib/bind9/lib/isc/include/isc/result.h stable/9/contrib/bind9/lib/isc/include/isc/socket.h stable/9/contrib/bind9/lib/isc/include/isc/task.h stable/9/contrib/bind9/lib/isc/include/isc/timer.h stable/9/contrib/bind9/lib/isc/include/isc/types.h stable/9/contrib/bind9/lib/isc/lib.c stable/9/contrib/bind9/lib/isc/log.c stable/9/contrib/bind9/lib/isc/mem.c stable/9/contrib/bind9/lib/isc/netaddr.c stable/9/contrib/bind9/lib/isc/print.c stable/9/contrib/bind9/lib/isc/radix.c stable/9/contrib/bind9/lib/isc/random.c stable/9/contrib/bind9/lib/isc/regex.c stable/9/contrib/bind9/lib/isc/result.c stable/9/contrib/bind9/lib/isc/socket_api.c stable/9/contrib/bind9/lib/isc/task.c stable/9/contrib/bind9/lib/isc/task_api.c stable/9/contrib/bind9/lib/isc/timer.c stable/9/contrib/bind9/lib/isc/timer_api.c stable/9/contrib/bind9/lib/isc/tm.c stable/9/contrib/bind9/lib/isc/unix/app.c stable/9/contrib/bind9/lib/isc/unix/include/isc/Makefile.in stable/9/contrib/bind9/lib/isc/unix/include/isc/net.h stable/9/contrib/bind9/lib/isc/unix/include/isc/stat.h stable/9/contrib/bind9/lib/isc/unix/socket.c stable/9/contrib/bind9/lib/isccc/Makefile.in stable/9/contrib/bind9/lib/isccfg/Makefile.in stable/9/contrib/bind9/lib/isccfg/aclconf.c stable/9/contrib/bind9/lib/isccfg/api stable/9/contrib/bind9/lib/isccfg/include/isccfg/Makefile.in stable/9/contrib/bind9/lib/isccfg/include/isccfg/aclconf.h stable/9/contrib/bind9/lib/isccfg/namedconf.c stable/9/contrib/bind9/lib/isccfg/parser.c stable/9/contrib/bind9/lib/lwres/Makefile.in stable/9/contrib/bind9/lib/lwres/api stable/9/contrib/bind9/lib/lwres/gai_strerror.c stable/9/contrib/bind9/lib/lwres/getaddrinfo.c stable/9/contrib/bind9/lib/lwres/gethost.c stable/9/contrib/bind9/lib/lwres/include/lwres/Makefile.in stable/9/contrib/bind9/lib/lwres/include/lwres/lwres.h stable/9/contrib/bind9/lib/lwres/include/lwres/netdb.h.in stable/9/contrib/bind9/lib/lwres/include/lwres/platform.h.in stable/9/contrib/bind9/lib/lwres/include/lwres/stdlib.h stable/9/contrib/bind9/lib/lwres/lwconfig.c stable/9/contrib/bind9/lib/lwres/man/lwres.3 stable/9/contrib/bind9/lib/lwres/man/lwres.docbook stable/9/contrib/bind9/lib/lwres/man/lwres.html stable/9/contrib/bind9/lib/lwres/man/lwres_buffer.3 stable/9/contrib/bind9/lib/lwres/man/lwres_buffer.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_buffer.html stable/9/contrib/bind9/lib/lwres/man/lwres_config.3 stable/9/contrib/bind9/lib/lwres/man/lwres_config.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_config.html stable/9/contrib/bind9/lib/lwres/man/lwres_context.3 stable/9/contrib/bind9/lib/lwres/man/lwres_context.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_context.html stable/9/contrib/bind9/lib/lwres/man/lwres_gabn.3 stable/9/contrib/bind9/lib/lwres/man/lwres_gabn.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_gabn.html stable/9/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3 stable/9/contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html stable/9/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3 stable/9/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html stable/9/contrib/bind9/lib/lwres/man/lwres_gethostent.3 stable/9/contrib/bind9/lib/lwres/man/lwres_gethostent.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_gethostent.html stable/9/contrib/bind9/lib/lwres/man/lwres_getipnode.3 stable/9/contrib/bind9/lib/lwres/man/lwres_getipnode.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_getipnode.html stable/9/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3 stable/9/contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html stable/9/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3 stable/9/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html stable/9/contrib/bind9/lib/lwres/man/lwres_gnba.3 stable/9/contrib/bind9/lib/lwres/man/lwres_gnba.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_gnba.html stable/9/contrib/bind9/lib/lwres/man/lwres_hstrerror.3 stable/9/contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_hstrerror.html stable/9/contrib/bind9/lib/lwres/man/lwres_inetntop.3 stable/9/contrib/bind9/lib/lwres/man/lwres_inetntop.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_inetntop.html stable/9/contrib/bind9/lib/lwres/man/lwres_noop.3 stable/9/contrib/bind9/lib/lwres/man/lwres_noop.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_noop.html stable/9/contrib/bind9/lib/lwres/man/lwres_packet.3 stable/9/contrib/bind9/lib/lwres/man/lwres_packet.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_packet.html stable/9/contrib/bind9/lib/lwres/man/lwres_resutil.3 stable/9/contrib/bind9/lib/lwres/man/lwres_resutil.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_resutil.html stable/9/contrib/bind9/lib/lwres/print.c stable/9/contrib/bind9/make/rules.in stable/9/contrib/bind9/version stable/9/lib/bind/config.h stable/9/lib/bind/dns/code.h stable/9/lib/bind/dns/dns/enumtype.h stable/9/lib/bind/dns/dns/rdatastruct.h stable/9/lib/bind/isc/Makefile stable/9/lib/bind/isc/isc/platform.h stable/9/lib/bind/lwres/Makefile stable/9/lib/bind/lwres/lwres/netdb.h stable/9/lib/bind/lwres/lwres/platform.h Directory Properties: stable/9/contrib/bind9/ (props changed) Modified: stable/9/contrib/bind9/CHANGES ============================================================================== --- stable/9/contrib/bind9/CHANGES Thu Dec 18 08:32:56 2014 (r275889) +++ stable/9/contrib/bind9/CHANGES Thu Dec 18 08:36:19 2014 (r275890) @@ -1,3 +1,5 @@ + --- 9.9.6-P1 released --- + 4006. [security] A flaw in delegation handling could be exploited to put named into an infinite loop. This has been addressed by placing limits on the number @@ -7,7 +9,430 @@ query (CVE-2014-8500). The recursion depth limit is configured via the - "max-recursion-depth" option. [RT #35780] + "max-recursion-depth" option, and the query limit + via the "max-recursion-queries" option. [RT #37580] + + --- 9.9.6 released --- + +3950. [port] Changed the bin/python Makefile to work around a + bmake bug in FreeBSD 10 and NetBSD 6. [RT #36993] + + --- 9.9.6rc2 released --- + +3947. [cleanup] Set the executable bit on libraries when using + libtool. [RT #36786] + +3946. [cleanup] Improved "configure" search for a python interpreter. + [RT #36992] + +3945. [bug] Invalid wildcard expansions could be incorrectly + accepted by the validator. [RT #37093] + +3944. [test] Added a regression test for "server-id". [RT #37057] + +3942. [bug] Wildcard responses from a optout range should be + marked as insecure. [RT #37072] + +3941. [doc] Include the BIND version number in the ARM. [RT #37067] + + --- 9.9.6rc1 released --- + +3933. [bug] Corrected the implementation of dns_rdata_casecompare() + for the HIP rdata type. [RT #36911] + +3932. [test] Improved named-checkconf tests. [RT #36911] + +3931. [cleanup] Cleanup how dlz grammar is defined. [RT #36879] + +3929. [bug] 'host -a' needed to clear idnoptions. [RT #36963] + +3928. [test] Improve rndc system test. [RT #36898] + +3925. [bug] DS lookup of RFC 1918 empty zones failed. [RT #36917] + +3924. [bug] Improve 'rndc addzone' error reporting. [RT #35187] + +3923. [bug] Sanity check the xml2-config output. [RT #22246] + +3922. [bug] When resigning, dnssec-signzone was removing + all signatures from delegation nodes. It now + retains DS and (if applicable) NSEC signatures. + [RT #36946] + +3921. [bug] AD was inappropriately set on RPZ responses. [RT #36833] + +3919. [bug] dig: continue to next line if a address lookup fails + in batch mode. [RT #36755] + +3918. [doc] Update check-spf documentation. [RT #36910] + +3917. [bug] dig, nslookup and host now continue on names that are + too long after applying a search list elements. + [RT #36892] + +3916. [contrib] zone2sqlite checked wrong result code. Address + compiler warnings. [RT #36931] + + --- 9.9.6b2 released --- + +3914. [bug] Allow the URI target and CAA value fields to + be zero length. [RT #36737] + +3913. [bug] Address race issue in dispatch. [RT #36731] + +3910. [bug] Fix races to free event during shutdown. [RT #36720] + +3909. [bug] When computing the number of elements required for a + acl count_acl_elements could have a short count leading + to a assertion failure. Also zero out new acl elements + in dns_acl_merge. [RT #36675] + +3908. [bug] rndc now differentiates between a zone in multiple + views and a zone that doesn't exist at all. [RT #36691] + +3907. [cleanup] Alphabetize rndc help. [RT #36683] + +3906. [protocol] Update URI record format to comply with + draft-faltstrom-uri-08. [RT #36642] + +3905. [bug] Address deadlock between view.c and adb.c. [RT #36341] + +3904. [func] Add the RPZ SOA to the additional section. [RT36507] + +3903. [bug] Improve the accuracy of DiG's reported round trip + time. [RT 36611] + +3902. [bug] liblwres wasn't handling link-local addresses in + nameserver clauses in resolv.conf. [RT #36039] + +3901. [protocol] Added support for CAA record type (RFC 6844). + [RT #36625] + +3900. [bug] Fix a crash in PostgreSQL DLZ driver. [RT #36637] + +3899. [bug] "request-ixfr" is only applicable to slave and redirect + zones. [RT #36608] + +3898. [bug] Too small a buffer in tohexstr() calls in test code. + [RT #36598] + +3894. [bug] Buffers in isc_print_vsnprintf were not properly + initialized leading to potential overflows when + printing out quad values. [RT #36505] + +3892. [bug] Setting '-t aaaa' in .digrc had unintended side + effects. [RT #36452] + +3891. [bug] Use ${INSTALL_SCRIPT} rather than ${INSTALL_PROGRAM} + to install python programs. + +3890. [bug] RRSIG sets that were not loaded in a single transaction + at start up where not being correctly added to + re-signing heaps. [RT #36302] + +3889. [port] hurd: configure fixes as per: + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746540 + +3887. [cleanup] Make all static symbols in rbtdb64 end in "64" so + they are easier to use in a debugger. [RT #36373] + + --- 9.9.6b1 released --- + +3885. [port] Use 'open()' rather than 'file()' to open files in + python. + +3884. [protocol] Add CDS and CDNSKEY record types. [RT #36333] + +3881. [bug] Address memory leak with UPDATE error handling. + [RT #36303] + +3880. [test] Update ans.pl to work with new TSIG support in + Net::DNS; add additional Net::DNS version prerequisite + checks. [RT #36327] + +3879. [func] Add version printing option to various BIND utilities. + [RT #10686] + +3878. [bug] Using the incorrect filename for a DLZ module + caused a segmentation fault on startup. [RT #36286] + +3874. [test] Check that only "check-names master" is needed for + updates to be accepted. + +3873. [protocol] Only warn for SPF without TXT spf record. [RT #36210] + +3872. [bug] Address issues found by static analysis. [RT #36209] + +3871. [bug] Don't publish an activated key automatically before + its publish time. [RT #35063] + +3870. [placeholder] + +3869. [placeholder] + +3868. [bug] isc_mem_setwater incorrectly cleared hi_called + potentially leaving over memory cleaner running. + [RT #35270] + +3866. [bug] Named could die on disk full in generate_session_key. + [RT #36119] + +3864. [bug] RPZ didn't work well when being used as forwarder. + [RT #36060] + +3862. [cleanup] Return immediately if we are not going to log the + message in ns_client_dumpmessage. + +3861. [bug] Benign missing isc_buffer_availablelength check in + dns_message_pseudosectiontotext. [RT #36078] + +3860. [bug] ioctl(DP_POLL) array size needs to be determined + at run time as it is limited to {OPEN_MAX}. + [RT #35878] + +3858. [bug] Disable GCC 4.9 "delete null pointer check". + [RT #35968] + +3857. [bug] Make it harder for a incorrect NOEDNS classification + to be made. [RT #36020] + +3855. [bug] Limit smoothed round trip time aging to no more than + once a second. [RT #32909] + +3854. [cleanup] Report unrecognized options, if any, in the final + configure summary. [RT #36014] + +3853. [cleanup] Refactor dns_rdataslab_fromrdataset to separate out + the handling of a rdataset with no records. [RT #35968] + +3849. [doc] Alphabetized dig's +options. [RT #35992] + +3847. [bug] 'configure --with-dlz-postgres' failed to fail when + there is not support available. + +3846. [bug] "dig +notcp ixfr=" should result in a UDP + ixfr query. [RT #35980] + +3844. [bug] Use the x64 version of the Microsoft Visual C++ + Redistributable when built for 64 bit Windows. + [RT #35973] + +3843. [protocol] Check EDNS EXPIRE option in dns_rdata_fromwire. + [RT #35969] + +3842. [bug] Adjust RRL log-only logging category. [RT #35945] + +3841. [cleanup] Refactor zone.c:add_opt to use dns_message_buildopt. + [RT #35924] + +3840. [port] Check for arc4random_addrandom() before using it; + it's been removed from OpenBSD 5.5. [RT #35907] + +3839. [test] Use only posix-compatible shell in system tests. + [RT #35625] + +3838. [protocol] EDNS EXPIRE as been assigned a code point of 9. + +3836. [bug] Address C++ keyword usage in header file. + +3834. [bug] The re-signing heaps were not being updated soon enough + leading to multiple re-generations of the same RRSIG + when a zone transfer was in progress. [RT #35273] + +3833. [bug] Cross compiling was broken due to calling genrandom at + build time. [RT #35869] + +3827. [contrib] The example DLZ driver (a version of which is + also used in the dlzexternal system test) could + use absolute names as relative. [RT #35802] + +3826. [bug] Corrected bad INSIST logic in isc_radix_remove(). + [RT #35870] + +3825. [bug] Address sign extension bug in isc_regex_validate. + [RT #35758] + +3824. [bug] A collision between two flag values could cause + problems with cache cleaning. [RT #35858] + +3822. [bug] Log the correct type of static-stub zones when + removing them. [RT #35842] + +3819. [bug] NSEC3 hashes need to be able to be entered and + displayed without padding. This is not a issue for + currently defined algorithms but may be for future + hash algorithms. [RT #27925] + +3818. [bug] Stop lying to the optimizer that 'void *arg' is a + constant in isc_event_allocate. + +3815. [doc] Clarify "nsupdate -y" usage in man page. [RT #35808] + +3809. [doc] Fix NSID documentation. + +3807. [bug] Fix sign extension bug in dns_name_fromtext when + lowercase is set. [RT #35743] + +3806. [test] Improved system test portability. [RT #35625] + +3805. [contrib] Added contrib/perftcpdns, a performance testing tool + for DNS over TCP. [RT #35710] + +3804. [bug] Corrected a race condition in dispatch.c in which + portentry could be reset leading to an assertion + failure in socket_search(). (Change #3708 + addressed the same issue but was incomplete.) + [RT #35128] + +3803. [bug] "named-checkconf -z" incorrectly rejected zones + using alternate data sources for not having a "file" + option. [RT #35685] + +3802. [bug] Various header files were not being installed. + +3801. [port] Fix probing for gssapi support on FreeBSD. [RT #35615] + +3799. [bug] Improve named's command line error reporting. + [RT #35603] + +3796. [bug] Register dns error codes. [RT #35629] + +3795. [bug] Make named-checkconf detect raw masterfiles for + hint zones and reject them. [RT #35268] + +3794. [maint] Added AAAA for C.ROOT-SERVERS.NET. + +3793. [bug] zone.c:save_nsec3param() could assert when out of + memory. [RT #35621] + +3792. [func] Provide links to the alternate statistics views when + displaying in a browser. [RT #35605] + +3791. [bug] solaris: remove extraneous return. [RT #35589] + +3787. [bug] The code that checks whether "auto-dnssec" is + allowed was ignoring "allow-update" ACLs set at + the options or view level. [RT #29536] + +3780. [bug] $GENERATE handled negative numbers incorrectly. + [RT #25528] + +3779. [cleanup] Clarify the error message when using an option + that was not enabled at compile time. [RT #35504] + +3778. [bug] Log a warning when the wrong address family is + used in "listen-on" or "listen-on-v6". [RT #17848] + +3775. [bug] dlz_dlopen driver could return the wrong error + code on API version mismatch, leading to a segfault. + [RT #35495] + +3773. [func] "host", "nslookup" and "nsupdate" now have + options to print the version number and exit. + [RT #26057] + +3770. [bug] "dig +trace" could fail with an assertion when it + needed to fall back to TCP due to a truncated + response. [RT #24660] + +3769. [doc] Improved documentation of "rndc signing -list". + [RT #30652] + +3768. [bug] "dnssec-checkds" was missing the SHA-384 digest + algorithm. [RT #34000] + +3767. [func] Log explicitly when using rndc.key to configure + command channel. [RT #35316] + +3765. [bug] Fixed a bug in "rndc secroots" that could crash + named when dumping an empty keynode. [RT #35469] + +3764. [bug] The dnssec-keygen/settime -S and -i options + (to set up a successor key and set the prepublication + interval) were missing from dnssec-keyfromlabel. + [RT #35394] + +3761. [bug] Address dangling reference bug in dns_keytable_add. + [RT #35471] + +3757. [port] Enable Python tools (dnssec-coverage, + dnssec-checkds) to run on Windows. [RT #34355] + +3756. [bug] GSSAPI Kerberos realm checking was broken in + check_config leading to spurious messages being + logged. [RT #35443] + +3754. [cleanup] win32: Installer now places files in the + Program Files area rather than system services. + [RT #35361] + +3753. [bug] allow-notify was ignoring keys. [RT #35425] + +3751. [tuning] The default setting for the -U option (setting + the number of UDP listeners per interface) has + been adjusted to improve performance. [RT #35417] + +3747. [bug] A race condition could lead to a core dump when + destroying a resolver fetch object. [RT #35385] + +3743. [bug] delegation-only flag wasn't working in forward zone + declarations despite being documented. This is + needed to support turning off forwarding and turning + on delegation only at the same name. [RT #35392] + +3742. [port] linux: libcap support: declare curval at start of + block. [RT #35387] + +3740. [contrib] Minor fixes to configure --with-dlz-bdb, + --with-dlz-postgres and --with-dlz-odbc. [RT #35340] + +3737. [bug] 'rndc retransfer' could trigger a assertion failure + with inline zones. [RT #35353] + +3736. [bug] nsupdate: When specifying a server by name, + fall back to alternate addresses if the first + address for that name is not reachable. [RT #25784] + +3734. [bug] Improve building with libtool. [RT #35314] + +3732. [contrib] Fixed a type mismatch causing the ODBC DLZ + driver to dump core on 64-bit systems. [RT #35324] + +3731. [func] Added a "no-case-compress" ACL, which causes + named to use case-insensitive compression + (disabling change #3645) for specified + clients. (This is useful when dealing + with broken client implementations that + use case-sensitive name comparisons, + rejecting responses that fail to match the + capitalization of the query that was sent.) + [RT #35300] + +3730. [cleanup] Added "never" as a synonym for "none" when + configuring key event dates in the dnssec tools. + [RT #35277] + +3729. [bug] dnssec-keygen could set the publication date + incorrectly when only the activation date was + specified on the command line. [RT #35278] + +3724. [bug] win32: Fixed a bug that prevented dig and + host from exiting properly after completing + a UDP query. [RT #35288] + +3720. [bug] Address compiler warnings. [RT #35261] + +3719. [bug] Address memory leak in in peer.c. [RT #35255] + +3718. [bug] A missing ISC_LINK_INIT in log.c. [RT #35260] + +3714. [test] System tests that need to test for cryptography + support before running can now use a common + "testcrypto.sh" script to do so. [RT #35213] + +3713. [bug] Save memory by not storing "also-notify" addresses + in zone objects that are configured not to send + notify requests. [RT #35195] --- 9.9.5 released --- @@ -174,7 +599,7 @@ 3660. [cleanup] Changed the name of "isc-config.sh" to "bind9-config". [RT #23825] -3659. [port] solaris: don't add explict dependancies/rules for +3659. [port] solaris: don't add explicit dependencies/rules for python programs as make won't use the implicit rules. [RT #34835] @@ -1026,7 +1451,7 @@ when queryperf is available. - the encoding of PASSTHRU action to "rpz-passthru". (The old encoding is still accepted.) - [RT #26172] + [RT #26172] 3329. [bug] Handle RRSIG signer-name case consistently: We @@ -1290,7 +1715,7 @@ timestamp. [RT #26883] 3238. [bug] keyrdata was not being reinitialized in - lib/dns/rbtdb.c:iszonesecure. [RT#26913] + lib/dns/rbtdb.c:iszonesecure. [RT #26913] 3237. [bug] dig -6 didn't work with +trace. [RT #26906] @@ -1542,7 +1967,7 @@ 3162. [test] start.pl: modified to allow for "named.args" in ns*/ subdirectory to override stock arguments to - named. Largely from RT#26044, but no separate ticket. + named. Largely from RT #26044, but no separate ticket. 3161. [bug] zone.c:del_sigs failed to always reset rdata leading assertion failures. [RT #25880] @@ -1798,7 +2223,7 @@ 3090. [func] Make --with-gssapi default [RT #23738] 3089. [func] dnssec-dsfromkey now supports reading keys from - standard input "dnssec-dsfromkey -f -". [RT# 20662] + standard input "dnssec-dsfromkey -f -". [RT #20662] 3088. [bug] Remove bin/tests/system/logfileconfig/ns1/named.conf and add setup.sh in order to resolve changing @@ -2324,13 +2749,13 @@ 2939. [func] Check that named successfully skips NSEC3 records that fail to match the NSEC3PARAM record currently - in use. [RT# 21868] + in use. [RT #21868] 2938. [bug] When generating signed responses, from a signed zone that uses NSEC3, named would use a uninitialized pointer if it needed to skip a NSEC3 record because it didn't match the selected NSEC3PARAM record for - zone. [RT# 21868] + zone. [RT #21868] 2937. [bug] Worked around an apparent race condition in over memory conditions. Without this fix a DNS cache DB or @@ -2409,7 +2834,7 @@ 2926. [placeholder] 2925. [bug] Named failed to accept uncachable negative responses - from insecure zones. [RT# 21555] + from insecure zones. [RT #21555] 2924. [func] 'rndc secroots' dump a combined summary of the current managed keys combined with trusted keys. @@ -2469,7 +2894,7 @@ 2904. [bug] When using DLV, sub-zones of the zones in the DLV, could be incorrectly marked as insecure instead of secure leading to negative proofs failing. This was - a unintended outcome from change 2890. [RT# 21392] + a unintended outcome from change 2890. [RT #21392] 2903. [bug] managed-keys-directory missing from namedconf.c. [RT #21370] @@ -2504,7 +2929,7 @@ 2892. [bug] Handle REVOKED keys better. [RT #20961] 2891. [maint] Update empty-zones list to match - draft-ietf-dnsop-default-local-zones-13. [RT# 21099] + draft-ietf-dnsop-default-local-zones-13. [RT #21099] 2890. [bug] Handle the introduction of new trusted-keys and DS, DLV RRsets better. [RT #21097] @@ -2915,7 +3340,7 @@ 2761. [cleanup] Enable internal symbol table for backtrace only for systems that are known to work. Currently, BSD - variants, Linux and Solaris are supported. [RT# 20202] + variants, Linux and Solaris are supported. [RT #20202] 2760. [cleanup] Corrected named-compilezone usage summary. [RT #20533] @@ -2929,7 +3354,7 @@ 2757. [bug] dig: assertion failure could occur in connect timeout. [RT #20599] -2756. [bug] Fixed corrupt logfile message in update.c. [RT# 20597] +2756. [bug] Fixed corrupt logfile message in update.c. [RT #20597] 2755. [placeholder] @@ -3924,7 +4349,7 @@ glue when sibling checks were disabled. [RT #18768] 2470. [bug] Elements of the isc_radix_node_t could be incorrectly - overwritten. [RT# 18719] + overwritten. [RT #18719] 2469. [port] solaris: Work around Solaris's select() limitations. [RT #18769] @@ -3997,7 +4422,7 @@ 2446. [func] Add a new log message about build options on startup. A new command-line option '-V' for named is also - provided to show this information. [RT# 18645] + provided to show this information. [RT #18645] 2445. [doc] ARM out-of-date on empty reverse zones (list includes RFC1918 address, but these are not yet compiled in). @@ -4011,7 +4436,7 @@ Fix this by doing an immediate WSAConnect() rather than an io completion port type for UDP. -2442. [bug] A lock could be destroyed twice. [RT# 18626] +2442. [bug] A lock could be destroyed twice. [RT #18626] 2441. [bug] isc_radix_insert() could copy radix tree nodes incompletely. [RT #18573] @@ -4248,7 +4673,7 @@ [RT #18054] 2368. [port] Linux: use libcap for capability management if - possible. [RT# 18026] + possible. [RT #18026] 2367. [bug] Improve counting of dns_resstatscounter_retry [RT #18030] @@ -4526,7 +4951,7 @@ 2277. [bug] Empty zone names were not correctly being caught at in the post parse checks. [RT #17357] -2276. [bug] Install . [RT# 17359] +2276. [bug] Install . [RT #17359] 2275. [func] Add support to dig to perform IXFR queries over UDP. [RT #17235] @@ -4534,7 +4959,7 @@ 2274. [func] Log zone transfer statistics. [RT #17336] 2273. [bug] Adjust log level to WARNING when saving inconsistent - stub/slave master and journal files. [RT# 17279] + stub/slave master and journal files. [RT #17279] 2272. [bug] Handle illegal dnssec-lookaside trust-anchor names. [RT #17262] @@ -4960,7 +5385,7 @@ packet was sent to. [RT #16613] 2142. [bug] Handle master files with a modification time that - matches the epoch. [RT# 16612] + matches the epoch. [RT #16612] 2141. [bug] dig/host should not be setting IDN_ASCCHECK (IDN equivalent of LDH checks). [RT #16609] @@ -4974,12 +5399,12 @@ 2138. [bug] Lock order reversal in resolver.c. [RT #16653] 2137. [port] Mips little endian and/or mips 64 bit are now - supported for atomic operations. [RT#16648] + supported for atomic operations. [RT #16648] 2136. [bug] nslookup/host looped if there was no search list and the host didn't exist. [RT #16657] -2135. [bug] Uninitialized rdataset in sdlz.c. [RT# 16656] +2135. [bug] Uninitialized rdataset in sdlz.c. [RT #16656] 2134. [func] Additional statistics support. [RT #16666] @@ -5047,7 +5472,7 @@ labels were failing. [RT #16447] 2113. [bug] nsupdate: if a zone is specified it should be used - for server discover. [RT# 16455] + for server discover. [RT #16455] 2112. [security] Warn if weak RSA exponent is used. [RT #16460] @@ -5095,7 +5520,7 @@ 2095. [port] libbind: alway prototype inet_cidr_ntop_ipv6() and net_cidr_ntop_ipv6(). [RT #16388] -2094. [contrib] Update named-bootconf. [RT# 16404] +2094. [contrib] Update named-bootconf. [RT #16404] 2093. [bug] named-checkzone -s was broken. @@ -5247,7 +5672,7 @@ [RT #16179] 2043. [port] nsupdate/nslookup: Force the flushing of the prompt - for interactive sessions. [RT#16148] + for interactive sessions. [RT #16148] 2042. [bug] named-checkconf was incorrectly rejecting the logging category "config". [RT #16117] @@ -5619,7 +6044,7 @@ 1927. [bug] Access to soanode or nsnode in rbtdb violated the lock order rule and could cause a dead lock. - [RT# 15518] + [RT #15518] 1926. [bug] The Windows installer did not check for empty passwords. BINDinstall was being installed in @@ -5636,7 +6061,7 @@ dns_log_setcontext(). 1921. [bug] Client memory contexts were not using internal - malloc. [RT# 15434] + malloc. [RT #15434] 1920. [bug] The cache rbtdb lock array was too small to have the desired performance characteristics. @@ -5908,7 +6333,7 @@ 1832. [bug] named fails to return BADKEY on unknown TSIG algorithm. [RT #13620] -1831. [doc] Update named-checkzone documentation. [RT#13604] +1831. [doc] Update named-checkzone documentation. [RT #13604] 1830. [bug] adb lame cache has sence of test reversed. [RT #13600] @@ -5929,7 +6354,7 @@ [RT #13510] 1823. [bug] Wrong macro used to check for point to point interface. - [RT#13418] + [RT #13418] 1822. [bug] check-names test for RT was reversed. [RT #13382] @@ -6089,7 +6514,7 @@ 1771. [placeholder] 1770. [bug] named-checkconf failed to report missing a missing - file clause for rbt{64} master/hint zones. [RT#13009] + file clause for rbt{64} master/hint zones. [RT #13009] 1769. [port] win32: change compiler flags /MTd ==> /MDd, /MT ==> /MD. @@ -6101,7 +6526,7 @@ support for (struct in6_pktinfo) failed. [RT #13077] 1766. [bug] Update the master file timestamp on successful refresh - as well as the journal's timestamp. [RT# 13062] + as well as the journal's timestamp. [RT #13062] 1765. [bug] configure --with-openssl=auto failed. [RT #12937] @@ -6254,7 +6679,7 @@ "ifconfig.sh down" didn't work for Solaris 9. 1716. [doc] named.conf(5) was being installed in the wrong - location. [RT# 12441] + location. [RT #12441] 1715. [func] 'dig +trace' now randomly selects the next servers to try. Report if there is a bad delegation. @@ -6323,7 +6748,7 @@ are defined in named.conf. [RT #12023] 1693. [bug] max-journal-size was not effective for master zones - with ixfr-from-differences set. [RT# 12024] + with ixfr-from-differences set. [RT #12024] 1692. [bug] Don't set -I, -L and -R flags when libcrypto is in /usr/lib. [RT #11971] @@ -6389,7 +6814,7 @@ 1671. [contrib] queryperf: add NAPTR to the list of known types. 1670. [func] Log UPDATE requests to slave zones without an acl as - "disabled" at debug level 3. [RT# 11657] + "disabled" at debug level 3. [RT #11657] 1669. [placeholder] @@ -6456,7 +6881,7 @@ [RT #11445] 1646. [bug] win32: logging file versions didn't work with - non-UNC filenames. [RT#11486] + non-UNC filenames. [RT #11486] 1645. [bug] named could trigger a REQUIRE failure if multiple masters with keys are specified. @@ -6506,17 +6931,17 @@ 1629. [func] dig now supports IPv6 scoped addresses with the extended format in the local-server part. [RT #8753] -1628. [bug] Typo in Compaq Trucluster support. [RT# 11264] +1628. [bug] Typo in Compaq Trucluster support. [RT #11264] 1627. [bug] win32: sockets were not being closed when the - last external reference was removed. [RT# 11179] + last external reference was removed. [RT #11179] -1626. [bug] --enable-getifaddrs was broken. [RT#11259] +1626. [bug] --enable-getifaddrs was broken. [RT #11259] 1625. [bug] named failed to load/transfer RFC2535 signed zones - which contained CNAMES. [RT# 11237] + which contained CNAMES. [RT #11237] -1624. [bug] zonemgr_putio() call should be locked. [RT# 11163] +1624. [bug] zonemgr_putio() call should be locked. [RT #11163] 1623. [bug] A serial number of zero was being displayed in the "sending notifies" log message when also-notify was @@ -6526,12 +6951,12 @@ available, and suppress wildcard binding if not. 1621. [bug] match-destinations did not work for IPv6 TCP queries. - [RT# 11156] + [RT #11156] 1620. [func] When loading a zone report if it is signed. [RT #11149] 1619. [bug] Missing ISC_LIST_UNLINK in end_reserved_dispatches(). - [RT# 11118] + [RT #11118] 1618. [bug] Fencepost errors in dns_name_ishostname() and dns_name_ismailbox() could trigger a INSIST(). @@ -6544,14 +6969,14 @@ 1615. [port] Define ISC_SOCKADDR_LEN_T based on _BSD_SOCKLEN_T_ if it is defined. -1614. [port] win32: silence resource limit messages. [RT# 11101] +1614. [port] win32: silence resource limit messages. [RT #11101] 1613. [bug] Builds would fail on machines w/o a if_nametoindex(). Missing #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX/#endif. [RT #11119] 1612. [bug] check-names at the option/view level could trigger - an INSIST. [RT# 11116] + an INSIST. [RT #11116] 1611. [bug] solaris: IPv6 interface scanning failed to cope with no active IPv6 interfaces. @@ -6571,7 +6996,7 @@ to use when making queries. 1607. [bug] dig, host and nslookup were still using random() - to generate query ids. [RT# 11013] + to generate query ids. [RT #11013] 1606. [bug] DLV insecurity proof was failing. @@ -6582,14 +7007,14 @@ partially initialized structure. 1603. [bug] nsupdate: set interactive based on isatty(). - [RT# 10929] + [RT #10929] 1602. [bug] Logging to a file failed unless a size was specified. - [RT# 10925] + [RT #10925] 1601. [bug] Silence spurious warning 'both "recursion no;" and "allow-recursion" active' warning from view "_bind". - [RT# 10920] + [RT #10920] 1600. [bug] Duplicate zone pre-load checks were not case insensitive. @@ -6612,9 +7037,9 @@ queries while the dump was in progress. [RT #10565] 1593. [bug] rndc should return "unknown command" to unknown - commands. [RT# 10642] + commands. [RT #10642] -1592. [bug] configure_view() could leak a dispatch. [RT# 10675] +1592. [bug] configure_view() could leak a dispatch. [RT #10675] 1591. [bug] libbind: updated to BIND 8.4.5. @@ -6655,7 +7080,7 @@ workaround code. [RT #10331] 1576. [bug] Race condition in dns_dispatch_addresponse(). - [RT# 10272] + [RT #10272] 1575. [func] Log TSIG name on TSIG verify failure. [RT #4404] @@ -6680,7 +7105,7 @@ complete answer message to the last update. 1568. [bug] nsupdate now reports that the update failed in - interactive mode. [RT# 10236] + interactive mode. [RT #10236] 1567. [maint] B.ROOT-SERVERS.NET is now 192.228.79.201. @@ -6731,7 +7156,7 @@ were specified in /etc/resolv.conf. [RT #8232] 1553. [bug] The windows socket code could stop accepting - connections. [RT#10115] + connections. [RT #10115] 1552. [bug] Accept NOTIFY requests from mapped masters if matched-mapped is set. [RT #10049] @@ -6744,7 +7169,7 @@ in a easily parsable format (-D and -o). 1548. [bug] When parsing APL records it was possible to silently - accept out of range ADDRESSFAMILY values. [RT# 9979] + accept out of range ADDRESSFAMILY values. [RT #9979] 1547. [bug] Named wasted memory recording duplicate lame zone entries. [RT #9341] @@ -6781,10 +7206,10 @@ 1535. [placeholder] -1534. [bug] Race condition when priming cache. [RT# 9940] +1534. [bug] Race condition when priming cache. [RT #9940] 1533. [func] Warn if both "recursion no;" and "allow-recursion" - are active. [RT# 4389] + are active. [RT #4389] 1532. [port] netbsd: the configure test for requires . @@ -6796,7 +7221,7 @@ moment. [RT #9462] 1529. [bug] "notify explicit;" failed to log that NOTIFY messages - were being sent for the zone. [RT# 9442] + were being sent for the zone. [RT #9442] 1528. [cleanup] Simplify some dns_name_ functions based on the deprecation of bitstring labels. @@ -6812,18 +7237,18 @@ 1525. [bug] dns_cache_create() could trigger a REQUIRE failure in isc_mem_put() during error cleanup. - [RT# 9360] + [RT #9360] 1524. [port] AIX needs to be able to resolve all symbols when creating shared libraries (--with-libtool). -1523. [bug] Fix race condition in rbtdb. [RT# 9189] +1523. [bug] Fix race condition in rbtdb. [RT #9189] 1522. [bug] dns_db_findnode() relax the requirements on 'name'. - [RT# 9286] + [RT #9286] 1521. [bug] dns_view_createresolver() failed to check the - result from isc_mem_create(). [RT# 9294] + result from isc_mem_create(). [RT #9294] 1520. [protocol] Add SSHFP (SSH Finger Print) type. @@ -6923,7 +7348,7 @@ [RT #6189] 1486. [bug] isc_print_snprintf() '%%' consumed one too many format - characters. [RT# 8230] + characters. [RT #8230] 1485. [bug] gen failed to handle high type values. [RT #6225] @@ -7260,7 +7685,7 @@ 1372. [bug] named crashes with an assertion failure on exit when sharing the same port for listening and querying, and - changing listening addresses several times. [RT# 3509] + changing listening addresses several times. [RT #3509] 1371. [bug] notify-source-v6, transfer-source-v6 and query-source-v6 with explicit addresses and using the @@ -7283,7 +7708,7 @@ addresses / prefixes. 1364. [func] Log file name when unable to open memory statistics - and dump database files. [RT# 3437] + and dump database files. [RT #3437] 1363. [func] Listen-on-v6 now supports specific addresses. @@ -7595,7 +8020,7 @@ 1252. [bug] Dig, host and nslookup were not checking the address the answer was coming from against the address it was - sent to. [RT# 2692] + sent to. [RT #2692] 1251. [port] win32: a make file contained absolute version specific references. @@ -7667,7 +8092,7 @@ 1227. [bug] dns_lex_getmastertoken() now returns ISC_R_BADNUMBER if a number was expected and some other token was - found. [RT#2532] + found. [RT #2532] 1226. [func] Use EDNS for zone refresh queries. [RT #2551] @@ -9280,7 +9705,7 @@ 729. [port] pthread_setconcurrency() needs to be called on Solaris. 728. [bug] Fix comment processing on master file directives. - [RT# 757] + [RT #757] 727. [port] Work around OS bug where accept() succeeds but fails to fill in the peer address of the accepted @@ -9322,7 +9747,7 @@ failure in adb.c. [RT #738] 714. [bug] Preserve interval timers across reloads unless changed. - [RT# 729] + [RT #729] 713. [func] named-checkconf takes '-t directory' similar to named. [RT #726] @@ -9542,7 +9967,7 @@ 644. [bug] #622 needed more work. [RT #562] 643. [bug] xfrin error messages made more verbose, added class - of the zone. [RT# 599] + of the zone. [RT #599] 642. [bug] Break the exit_check() race in the zone module. [RT #598] @@ -9970,7 +10395,7 @@ assertion. [RT #399] 515. [bug] The ssu table was not being attached / detached - by dns_zone_[sg]etssutable. [RT#397] + by dns_zone_[sg]etssutable. [RT #397] 514. [func] Retry refresh and notify queries if they timeout. [RT #388] @@ -10304,7 +10729,7 @@ transfers were finished. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:37:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F4045D0F; Thu, 18 Dec 2014 08:37:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DF39F192A; Thu, 18 Dec 2014 08:37:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8bAa1025673; Thu, 18 Dec 2014 08:37:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8bAct025672; Thu, 18 Dec 2014 08:37:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180837.sBI8bAct025672@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275891 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:37:11 -0000 Author: mav Date: Thu Dec 18 08:37:09 2014 New Revision: 275891 URL: https://svnweb.freebsd.org/changeset/base/275891 Log: MFC r275461: Increase CTL ports limit from 128 to 256 and LUNs limit from 256 to 1024. After recent optimizations this change is no longer blocked by CTL memory consumption. Those limits are still not free, but much cheaper now. Relnotes: yes Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl_ioctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Thu Dec 18 08:36:19 2014 (r275890) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Thu Dec 18 08:37:09 2014 (r275891) @@ -60,17 +60,17 @@ /* * Maximum number of LUNs we support at the moment. MUST be a power of 2. */ -#define CTL_MAX_LUNS 256 +#define CTL_MAX_LUNS 1024 /* * Maximum number of initiators per port. */ -#define CTL_MAX_INIT_PER_PORT 2048 // Was 16 +#define CTL_MAX_INIT_PER_PORT 2048 /* * Maximum number of ports registered at one time. */ -#define CTL_MAX_PORTS 128 +#define CTL_MAX_PORTS 256 /* * Maximum number of initiators we support. From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:38:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28C03E49; Thu, 18 Dec 2014 08:38:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 132591938; Thu, 18 Dec 2014 08:38:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8cA87025864; Thu, 18 Dec 2014 08:38:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8c86k025856; Thu, 18 Dec 2014 08:38:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180838.sBI8c86k025856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275892 - in stable/10/sys: cam/ctl cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:38:10 -0000 Author: mav Date: Thu Dec 18 08:38:07 2014 New Revision: 275892 URL: https://svnweb.freebsd.org/changeset/base/275892 Log: MFC r275474: Add GET LBA STATUS command support to CTL. It is implemented for LUNs backed by ZVOLs in "dev" mode and files. GEOM has no such API, so for LUNs backed by raw devices all LBAs will be reported as mapped/unknown. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:38:07 2014 (r275892) @@ -5174,6 +5174,40 @@ ctl_config_write_done(union ctl_io *io) free(buf, M_CTL); } +void +ctl_config_read_done(union ctl_io *io) +{ + uint8_t *buf; + + /* + * If there is some error -- we are done, skip data transfer. + */ + if ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0 || + ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) + buf = io->scsiio.kern_data_ptr; + else + buf = NULL; + ctl_done(io); + if (buf) + free(buf, M_CTL); + return; + } + + /* + * If the IO_CONT flag is set, we need to call the supplied + * function to continue processing the I/O, instead of completing + * the I/O just yet. + */ + if (io->io_hdr.flags & CTL_FLAG_IO_CONT) { + io->scsiio.io_cont(io); + return; + } + + ctl_datamove(io); +} + /* * SCSI release command. */ @@ -7175,6 +7209,66 @@ ctl_read_capacity_16(struct ctl_scsiio * } int +ctl_get_lba_status(struct ctl_scsiio *ctsio) +{ + struct scsi_get_lba_status *cdb; + struct scsi_get_lba_status_data *data; + struct ctl_lun *lun; + struct ctl_lba_len_flags *lbalen; + uint64_t lba; + uint32_t alloc_len, total_len; + int retval; + + CTL_DEBUG_PRINT(("ctl_get_lba_status\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_get_lba_status *)ctsio->cdb; + lba = scsi_8btou64(cdb->addr); + alloc_len = scsi_4btoul(cdb->alloc_len); + + if (lba > lun->be_lun->maxlba) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + total_len = sizeof(*data) + sizeof(data->descr[0]); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + data = (struct scsi_get_lba_status_data *)ctsio->kern_data_ptr; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* Fill dummy data in case backend can't tell anything. */ + scsi_ulto4b(4 + sizeof(data->descr[0]), data->length); + scsi_u64to8b(lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, lun->be_lun->maxlba + 1 - lba), + data->descr[0].length); + data->descr[0].status = 0; /* Mapped or unknown. */ + + ctl_set_success(ctsio); + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba = lba; + lbalen->len = total_len; + lbalen->flags = 0; + retval = lun->backend->config_read((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); +} + +int ctl_read_defect(struct ctl_scsiio *ctsio) { struct scsi_read_defect_data_10 *ccb10; @@ -10644,6 +10738,14 @@ ctl_get_lba_len(union ctl_io *io, uint64 *len = UINT64_MAX; break; } + case SERVICE_ACTION_IN: { /* GET LBA STATUS */ + struct scsi_get_lba_status *cdb; + + cdb = (struct scsi_get_lba_status *)io->scsiio.cdb; + *lba = scsi_8btou64(cdb->addr); + *len = UINT32_MAX; + break; + } default: return (1); break; /* NOTREACHED */ Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl.h Thu Dec 18 08:38:07 2014 (r275892) @@ -186,6 +186,7 @@ int ctl_config_move_done(union ctl_io *i void ctl_datamove(union ctl_io *io); void ctl_done(union ctl_io *io); void ctl_data_submit_done(union ctl_io *io); +void ctl_config_read_done(union ctl_io *io); void ctl_config_write_done(union ctl_io *io); void ctl_portDB_changed(int portnum); void ctl_init_isc_msg(void); Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:38:07 2014 (r275892) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -165,6 +166,7 @@ struct ctl_be_block_lun { cbb_dispatch_t dispatch; cbb_dispatch_t lun_flush; cbb_dispatch_t unmap; + cbb_dispatch_t get_lba_status; cbb_getattr_t getattr; uma_zone_t lun_zone; uint64_t size_blocks; @@ -182,6 +184,7 @@ struct ctl_be_block_lun { struct task io_task; int num_threads; STAILQ_HEAD(, ctl_io_hdr) input_queue; + STAILQ_HEAD(, ctl_io_hdr) config_read_queue; STAILQ_HEAD(, ctl_io_hdr) config_write_queue; STAILQ_HEAD(, ctl_io_hdr) datamove_queue; struct mtx_padalign io_lock; @@ -240,6 +243,8 @@ static void ctl_be_block_flush_file(stru struct ctl_be_block_io *beio); static void ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static void ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, @@ -248,6 +253,8 @@ static void ctl_be_block_dispatch_dev(st struct ctl_be_block_io *beio); static uint64_t ctl_be_block_getattr_dev(struct ctl_be_block_lun *be_lun, const char *attrname); +static void ctl_be_block_cr_dispatch(struct ctl_be_block_lun *be_lun, + union ctl_io *io); static void ctl_be_block_cw_dispatch(struct ctl_be_block_lun *be_lun, union ctl_io *io); static void ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, @@ -756,6 +763,46 @@ ctl_be_block_dispatch_file(struct ctl_be } static void +ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + union ctl_io *io = beio->io; + struct ctl_lba_len_flags *lbalen = ARGS(io); + struct scsi_get_lba_status_data *data; + off_t roff, off; + int error, status; + + DPRINTF("entered\n"); + + off = roff = ((off_t)lbalen->lba) << be_lun->blocksize_shift; + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); + error = VOP_IOCTL(be_lun->vn, FIOSEEKHOLE, &off, + 0, curthread->td_ucred, curthread); + if (error == 0 && off > roff) + status = 0; /* mapped up to off */ + else { + error = VOP_IOCTL(be_lun->vn, FIOSEEKDATA, &off, + 0, curthread->td_ucred, curthread); + if (error == 0 && off > roff) + status = 1; /* deallocated up to off */ + else { + status = 0; /* unknown up to the end */ + off = be_lun->size_bytes; + } + } + VOP_UNLOCK(be_lun->vn, 0); + + off >>= be_lun->blocksize_shift; + data = (struct scsi_get_lba_status_data *)io->scsiio.kern_data_ptr; + scsi_u64to8b(lbalen->lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, off - lbalen->lba), + data->descr[0].length); + data->descr[0].status = status; + + ctl_complete_beio(beio); +} + +static void ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -848,6 +895,45 @@ ctl_be_block_dispatch_zvol(struct ctl_be } static void +ctl_be_block_gls_zvol(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + struct ctl_be_block_devdata *dev_data = &be_lun->backend.dev; + union ctl_io *io = beio->io; + struct ctl_lba_len_flags *lbalen = ARGS(io); + struct scsi_get_lba_status_data *data; + off_t roff, off; + int error, status; + + DPRINTF("entered\n"); + + off = roff = ((off_t)lbalen->lba) << be_lun->blocksize_shift; + error = (*dev_data->csw->d_ioctl)(dev_data->cdev, FIOSEEKHOLE, + (caddr_t)&off, FREAD, curthread); + if (error == 0 && off > roff) + status = 0; /* mapped up to off */ + else { + error = (*dev_data->csw->d_ioctl)(dev_data->cdev, FIOSEEKDATA, + (caddr_t)&off, FREAD, curthread); + if (error == 0 && off > roff) + status = 1; /* deallocated up to off */ + else { + status = 0; /* unknown up to the end */ + off = be_lun->size_bytes; + } + } + + off >>= be_lun->blocksize_shift; + data = (struct scsi_get_lba_status_data *)io->scsiio.kern_data_ptr; + scsi_u64to8b(lbalen->lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, off - lbalen->lba), + data->descr[0].length); + data->descr[0].status = status; + + ctl_complete_beio(beio); +} + +static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -1220,6 +1306,49 @@ ctl_be_block_cw_dispatch_unmap(struct ct } static void +ctl_be_block_cr_done(struct ctl_be_block_io *beio) +{ + union ctl_io *io; + + io = beio->io; + ctl_free_beio(beio); + ctl_config_read_done(io); +} + +static void +ctl_be_block_cr_dispatch(struct ctl_be_block_lun *be_lun, + union ctl_io *io) +{ + struct ctl_be_block_io *beio; + struct ctl_be_block_softc *softc; + + DPRINTF("entered\n"); + + softc = be_lun->softc; + beio = ctl_alloc_beio(softc); + beio->io = io; + beio->lun = be_lun; + beio->beio_cont = ctl_be_block_cr_done; + PRIV(io)->ptr = (void *)beio; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: /* GET LBA STATUS */ + beio->bio_cmd = -1; + beio->ds_trans_type = DEVSTAT_NO_DATA; + beio->ds_tag_type = DEVSTAT_TAG_ORDERED; + beio->io_len = 0; + if (be_lun->get_lba_status) + be_lun->get_lba_status(be_lun, beio); + else + ctl_be_block_cr_done(beio); + break; + default: + panic("Unhandled CDB type %#x", io->scsiio.cdb[0]); + break; + } +} + +static void ctl_be_block_cw_done(struct ctl_be_block_io *beio) { union ctl_io *io; @@ -1454,16 +1583,21 @@ ctl_be_block_worker(void *context, int p } io = (union ctl_io *)STAILQ_FIRST(&be_lun->config_write_queue); if (io != NULL) { - DPRINTF("config write queue\n"); - STAILQ_REMOVE(&be_lun->config_write_queue, &io->io_hdr, ctl_io_hdr, links); - mtx_unlock(&be_lun->queue_lock); - ctl_be_block_cw_dispatch(be_lun, io); - + mtx_lock(&be_lun->queue_lock); + continue; + } + io = (union ctl_io *)STAILQ_FIRST(&be_lun->config_read_queue); + if (io != NULL) { + DPRINTF("config read queue\n"); + STAILQ_REMOVE(&be_lun->config_read_queue, &io->io_hdr, + ctl_io_hdr, links); + mtx_unlock(&be_lun->queue_lock); + ctl_be_block_cr_dispatch(be_lun, io); mtx_lock(&be_lun->queue_lock); continue; } @@ -1592,6 +1726,7 @@ ctl_be_block_open_file(struct ctl_be_blo be_lun->dev_type = CTL_BE_BLOCK_FILE; be_lun->dispatch = ctl_be_block_dispatch_file; be_lun->lun_flush = ctl_be_block_flush_file; + be_lun->get_lba_status = ctl_be_block_gls_file; error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); if (error != 0) { @@ -1678,9 +1813,10 @@ ctl_be_block_open_dev(struct ctl_be_bloc &be_lun->backend.dev.dev_ref); if (be_lun->backend.dev.csw == NULL) panic("Unable to retrieve device switch"); - if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) + if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) { be_lun->dispatch = ctl_be_block_dispatch_zvol; - else + be_lun->get_lba_status = ctl_be_block_gls_zvol; + } else be_lun->dispatch = ctl_be_block_dispatch_dev; be_lun->lun_flush = ctl_be_block_flush_dev; be_lun->unmap = ctl_be_block_unmap_dev; @@ -1955,6 +2091,7 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->params = req->reqdata.create; be_lun->softc = softc; STAILQ_INIT(&be_lun->input_queue); + STAILQ_INIT(&be_lun->config_read_queue); STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); sprintf(be_lun->lunname, "cblk%d", softc->num_luns); @@ -2585,13 +2722,50 @@ ctl_be_block_config_write(union ctl_io * } return (retval); - } static int ctl_be_block_config_read(union ctl_io *io) { - return (0); + struct ctl_be_block_lun *be_lun; + struct ctl_be_lun *ctl_be_lun; + int retval = 0; + + DPRINTF("entered\n"); + + ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ + CTL_PRIV_BACKEND_LUN].ptr; + be_lun = (struct ctl_be_block_lun *)ctl_be_lun->be_lun; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: + if (io->scsiio.cdb[1] == SGLS_SERVICE_ACTION) { + mtx_lock(&be_lun->queue_lock); + STAILQ_INSERT_TAIL(&be_lun->config_read_queue, + &io->io_hdr, links); + mtx_unlock(&be_lun->queue_lock); + taskqueue_enqueue(be_lun->io_taskqueue, + &be_lun->io_task); + retval = CTL_RETVAL_QUEUED; + break; + } + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 1, + /*bit*/ 4); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + default: + ctl_set_invalid_opcode(&io->scsiio); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + + return (retval); } static int Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:38:07 2014 (r275892) @@ -967,8 +967,31 @@ ctl_backend_ramdisk_config_write(union c static int ctl_backend_ramdisk_config_read(union ctl_io *io) { - /* - * XXX KDM need to implement!! - */ - return (0); + int retval = 0; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: + if (io->scsiio.cdb[1] == SGLS_SERVICE_ACTION) { + /* We have nothing to tell, leave default data. */ + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 1, + /*bit*/ 4); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + default: + ctl_set_invalid_opcode(&io->scsiio); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + + return (retval); } Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Thu Dec 18 08:38:07 2014 (r275892) @@ -433,7 +433,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 0F */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, -/* 10 */ +/* 10 READ CAPACITY(16) */ {ctl_read_capacity_16, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN | CTL_CMD_FLAG_OK_ON_STOPPED | CTL_CMD_FLAG_OK_ON_INOPERABLE | @@ -443,7 +443,18 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_LUN_PAT_READCAP, 16, {0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, -/* 11-1f */ +/* 11 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 12 GET LBA STATUS */ +{ctl_get_lba_status, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, + CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, + 16, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 13-1f */ }; /* A3 MAINTENANCE IN */ Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:38:07 2014 (r275892) @@ -516,6 +516,7 @@ int ctl_report_supported_opcodes(struct int ctl_report_supported_tmf(struct ctl_scsiio *ctsio); int ctl_report_timestamp(struct ctl_scsiio *ctsio); int ctl_isc(struct ctl_scsiio *ctsio); +int ctl_get_lba_status(struct ctl_scsiio *ctsio); void ctl_tpc_init(struct ctl_softc *softc); void ctl_tpc_shutdown(struct ctl_softc *softc); Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/scsi/scsi_all.h Thu Dec 18 08:38:07 2014 (r275892) @@ -2518,6 +2518,32 @@ struct scsi_read_capacity_data_long uint8_t reserved[16]; }; +struct scsi_get_lba_status +{ + uint8_t opcode; +#define SGLS_SERVICE_ACTION 0x12 + uint8_t service_action; + uint8_t addr[8]; + uint8_t alloc_len[4]; + uint8_t reserved; + uint8_t control; +}; + +struct scsi_get_lba_status_data_descr +{ + uint8_t addr[8]; + uint8_t length[4]; + uint8_t status; + uint8_t reserved[3]; +}; + +struct scsi_get_lba_status_data +{ + uint8_t length[4]; + uint8_t reserved[4]; + struct scsi_get_lba_status_data_descr descr[]; +}; + struct scsi_report_luns { uint8_t opcode; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Dec 18 08:38:07 2014 (r275892) @@ -91,6 +91,7 @@ #include #include #include +#include #include @@ -2914,6 +2915,18 @@ zvol_d_ioctl(struct cdev *dev, u_long cm error = ENOIOCTL; break; } + case FIOSEEKHOLE: + case FIOSEEKDATA: { + off_t *off = (off_t *)data; + uint64_t noff; + boolean_t hole; + + hole = (cmd == FIOSEEKHOLE); + noff = *off; + error = dmu_offset_next(zv->zv_objset, ZVOL_OBJ, hole, &noff); + *off = noff; + break; + } default: error = ENOIOCTL; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:43:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FB1CFB; Thu, 18 Dec 2014 08:43:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 618341A24; Thu, 18 Dec 2014 08:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8hbIm030079; Thu, 18 Dec 2014 08:43:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8hb7f030078; Thu, 18 Dec 2014 08:43:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180843.sBI8hb7f030078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275893 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:43:37 -0000 Author: mav Date: Thu Dec 18 08:43:36 2014 New Revision: 275893 URL: https://svnweb.freebsd.org/changeset/base/275893 Log: MFC r275481: Add to CTL support for threshold notifications for file-backed LUNs. Previously it was supported only for ZVOL-backed LUNs, but now should work for file-backed LUNs too. Used value in this case is a space occupied by the backing file, while available value is an available space on file system. Pool thresholds are still not implemented in this case. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:38:07 2014 (r275892) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:43:36 2014 (r275893) @@ -245,6 +245,8 @@ static void ctl_be_block_dispatch_file(s struct ctl_be_block_io *beio); static void ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static uint64_t ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, + const char *attrname); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, @@ -802,6 +804,31 @@ ctl_be_block_gls_file(struct ctl_be_bloc ctl_complete_beio(beio); } +static uint64_t +ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, const char *attrname) +{ + struct vattr vattr; + struct statfs statfs; + int error; + + if (be_lun->vn == NULL) + return (UINT64_MAX); + if (strcmp(attrname, "blocksused") == 0) { + error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); + if (error != 0) + return (UINT64_MAX); + return (vattr.va_bytes >> be_lun->blocksize_shift); + } + if (strcmp(attrname, "blocksavail") == 0) { + error = VFS_STATFS(be_lun->vn->v_mount, &statfs); + if (error != 0) + return (UINT64_MAX); + return ((statfs.f_bavail * statfs.f_bsize) >> + be_lun->blocksize_shift); + } + return (UINT64_MAX); +} + static void ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) @@ -1727,6 +1754,7 @@ ctl_be_block_open_file(struct ctl_be_blo be_lun->dispatch = ctl_be_block_dispatch_file; be_lun->lun_flush = ctl_be_block_flush_file; be_lun->get_lba_status = ctl_be_block_gls_file; + be_lun->getattr = ctl_be_block_getattr_file; error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); if (error != 0) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:45:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE318244; Thu, 18 Dec 2014 08:45:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B98081A46; Thu, 18 Dec 2014 08:45:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8jTN7030421; Thu, 18 Dec 2014 08:45:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8jThH030420; Thu, 18 Dec 2014 08:45:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180845.sBI8jThH030420@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275894 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:45:29 -0000 Author: mav Date: Thu Dec 18 08:45:28 2014 New Revision: 275894 URL: https://svnweb.freebsd.org/changeset/base/275894 Log: MFC r275512: In addition to r275481 allow threshold notifications work without UNMAP. While without UNMAP support there is not much initiator can do about it, the administrator still better be notified about the storage overflow. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:43:36 2014 (r275893) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:45:28 2014 (r275894) @@ -4349,8 +4349,7 @@ ctl_init_log_page_index(struct ctl_lun * continue; if (page_index->page_code == SLS_LOGICAL_BLOCK_PROVISIONING && - ((lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) == 0 || - lun->backend->lun_attr == NULL)) + lun->backend->lun_attr == NULL) continue; if (page_index->page_code != prev) { @@ -10255,8 +10254,8 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->page_code = SVPD_LBP; scsi_ulto2b(sizeof(*lbp_ptr) - 4, lbp_ptr->page_length); + lbp_ptr->threshold_exponent = CTL_LBP_EXPONENT; if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { - lbp_ptr->threshold_exponent = CTL_LBP_EXPONENT; lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP; lbp_ptr->prov_type = SVPD_LBP_THIN; @@ -14004,7 +14003,6 @@ ctl_thresh_thread(void *arg) be_lun = lun->be_lun; if ((lun->flags & CTL_LUN_DISABLED) || (lun->flags & CTL_LUN_OFFLINE) || - (be_lun->flags & CTL_LUN_FLAG_UNMAP) == 0 || lun->backend->lun_attr == NULL) continue; rwpage = &lun->mode_pages.rw_er_page[CTL_PAGE_CURRENT]; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:46:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F82838A; Thu, 18 Dec 2014 08:46:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 419B51A5D; Thu, 18 Dec 2014 08:46:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8kuti030660; Thu, 18 Dec 2014 08:46:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8ksW7030654; Thu, 18 Dec 2014 08:46:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180846.sBI8ksW7030654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275895 - in stable/10: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:46:56 -0000 Author: mav Date: Thu Dec 18 08:46:53 2014 New Revision: 275895 URL: https://svnweb.freebsd.org/changeset/base/275895 Log: MFC r275568: Count consecutive read requests as blocking in CTL for files and ZVOLs. Technically read requests can be executed in any order or simultaneously since they are not changing any data. But ZFS prefetcher goes crasy when it receives consecutive requests from different threads. Since prefetcher works on level of separate blocks, instead of two consecutive 128K requests it may receive 32 8K requests in mixed order. This patch is more workaround then a real fix, and it does not fix all of prefetcher problems, but it improves sequential read speed by 3-4x times in some configurations. On the other side it may hurt performance if some backing store has no prefetch, that is why it is disabled by default for raw devices. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_ser_table.c stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:46:53 2014 (r275895) @@ -435,7 +435,9 @@ static int ctl_inquiry_evpd_lbp(struct c static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); static int ctl_inquiry_std(struct ctl_scsiio *ctsio); static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint64_t *len); -static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2); +static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2, + bool seq); +static ctl_action ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2); static ctl_action ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io *ooa_io); static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, @@ -4592,6 +4594,17 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft if (value != NULL && strcmp(value, "on") == 0) lun->flags |= CTL_LUN_READONLY; + lun->serseq = CTL_LUN_SERSEQ_OFF; + if (be_lun->flags & CTL_LUN_FLAG_SERSEQ_READ) + lun->serseq = CTL_LUN_SERSEQ_READ; + value = ctl_get_opt(&be_lun->options, "serseq"); + if (value != NULL && strcmp(value, "on") == 0) + lun->serseq = CTL_LUN_SERSEQ_ON; + else if (value != NULL && strcmp(value, "read") == 0) + lun->serseq = CTL_LUN_SERSEQ_READ; + else if (value != NULL && strcmp(value, "off") == 0) + lun->serseq = CTL_LUN_SERSEQ_OFF; + lun->ctl_softc = ctl_softc; TAILQ_INIT(&lun->ooa_queue); TAILQ_INIT(&lun->blocked_queue); @@ -10754,15 +10767,15 @@ ctl_get_lba_len(union ctl_io *io, uint64 } static ctl_action -ctl_extent_check_lba(uint64_t lba1, uint64_t len1, uint64_t lba2, uint64_t len2) +ctl_extent_check_lba(uint64_t lba1, uint64_t len1, uint64_t lba2, uint64_t len2, + bool seq) { uint64_t endlba1, endlba2; - endlba1 = lba1 + len1 - 1; + endlba1 = lba1 + len1 - (seq ? 0 : 1); endlba2 = lba2 + len2 - 1; - if ((endlba1 < lba2) - || (endlba2 < lba1)) + if ((endlba1 < lba2) || (endlba2 < lba1)) return (CTL_ACTION_PASS); else return (CTL_ACTION_BLOCK); @@ -10801,23 +10814,39 @@ ctl_extent_check_unmap(union ctl_io *io, } static ctl_action -ctl_extent_check(union ctl_io *io1, union ctl_io *io2) +ctl_extent_check(union ctl_io *io1, union ctl_io *io2, bool seq) { uint64_t lba1, lba2; uint64_t len1, len2; int retval; - if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + if (ctl_get_lba_len(io2, &lba2, &len2) != 0) return (CTL_ACTION_ERROR); - retval = ctl_extent_check_unmap(io2, lba1, len1); + retval = ctl_extent_check_unmap(io1, lba2, len2); if (retval != CTL_ACTION_ERROR) return (retval); + if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + return (CTL_ACTION_ERROR); + + return (ctl_extent_check_lba(lba1, len1, lba2, len2, seq)); +} + +static ctl_action +ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2) +{ + uint64_t lba1, lba2; + uint64_t len1, len2; + + if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + return (CTL_ACTION_ERROR); if (ctl_get_lba_len(io2, &lba2, &len2) != 0) return (CTL_ACTION_ERROR); - return (ctl_extent_check_lba(lba1, len1, lba2, len2)); + if (lba1 + len1 == lba2) + return (CTL_ACTION_BLOCK); + return (CTL_ACTION_PASS); } static ctl_action @@ -10906,12 +10935,18 @@ ctl_check_for_blockage(struct ctl_lun *l case CTL_SER_BLOCK: return (CTL_ACTION_BLOCK); case CTL_SER_EXTENT: - return (ctl_extent_check(pending_io, ooa_io)); + return (ctl_extent_check(ooa_io, pending_io, + (lun->serseq == CTL_LUN_SERSEQ_ON))); case CTL_SER_EXTENTOPT: if ((lun->mode_pages.control_page[CTL_PAGE_CURRENT].queue_flags & SCP_QUEUE_ALG_MASK) != SCP_QUEUE_ALG_UNRESTRICTED) - return (ctl_extent_check(pending_io, ooa_io)); - /* FALLTHROUGH */ + return (ctl_extent_check(ooa_io, pending_io, + (lun->serseq == CTL_LUN_SERSEQ_ON))); + return (CTL_ACTION_PASS); + case CTL_SER_EXTENTSEQ: + if (lun->serseq != CTL_LUN_SERSEQ_OFF) + return (ctl_extent_check_seq(ooa_io, pending_io)); + return (CTL_ACTION_PASS); case CTL_SER_PASS: return (CTL_ACTION_PASS); case CTL_SER_BLOCKOPT: @@ -12442,7 +12477,7 @@ ctl_cmd_pattern_match(struct ctl_scsiio return (CTL_LUN_PAT_NONE); action = ctl_extent_check_lba(lba1, len1, desc->lba_range.lba, - desc->lba_range.len); + desc->lba_range.len, FALSE); /* * A "pass" means that the LBA ranges don't overlap, so * this doesn't match the user's range criteria. Modified: stable/10/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.h Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl_backend.h Thu Dec 18 08:46:53 2014 (r275895) @@ -85,7 +85,8 @@ typedef enum { CTL_LUN_FLAG_DEVID = 0x20, CTL_LUN_FLAG_DEV_TYPE = 0x40, CTL_LUN_FLAG_UNMAP = 0x80, - CTL_LUN_FLAG_OFFLINE = 0x100 + CTL_LUN_FLAG_OFFLINE = 0x100, + CTL_LUN_FLAG_SERSEQ_READ = 0x200 } ctl_backend_lun_flags; #ifdef _KERNEL Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:46:53 2014 (r275895) @@ -2207,6 +2207,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_OFFLINE; if (unmap) be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; + if (be_lun->dispatch != ctl_be_block_dispatch_dev) + be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_SERSEQ_READ; be_lun->ctl_be_lun.be_lun = be_lun; be_lun->ctl_be_lun.maxlba = (be_lun->size_blocks == 0) ? 0 : (be_lun->size_blocks - 1); Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:46:53 2014 (r275895) @@ -97,6 +97,7 @@ typedef enum { CTL_SER_BLOCKOPT, CTL_SER_EXTENT, CTL_SER_EXTENTOPT, + CTL_SER_EXTENTSEQ, CTL_SER_PASS, CTL_SER_SKIP } ctl_serialize_action; @@ -183,6 +184,12 @@ typedef enum { } ctl_lun_flags; typedef enum { + CTL_LUN_SERSEQ_OFF, + CTL_LUN_SERSEQ_READ, + CTL_LUN_SERSEQ_ON +} ctl_lun_serseq; + +typedef enum { CTLBLOCK_FLAG_NONE = 0x00, CTLBLOCK_FLAG_INVALID = 0x01 } ctlblock_flags; @@ -386,6 +393,7 @@ struct ctl_lun { struct ctl_id target; uint64_t lun; ctl_lun_flags flags; + ctl_lun_serseq serseq; STAILQ_HEAD(,ctl_error_desc) error_list; uint64_t error_serial; struct ctl_softc *ctl_softc; Modified: stable/10/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_ser_table.c Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl_ser_table.c Thu Dec 18 08:46:53 2014 (r275895) @@ -59,12 +59,13 @@ #define bO CTL_SER_BLOCKOPT /* Optional block */ #define xT CTL_SER_EXTENT /* Extent check */ #define xO CTL_SER_EXTENTOPT /* Optional extent check */ +#define xS CTL_SER_EXTENTSEQ /* Sequential extent check */ static ctl_serialize_action ctl_serialize_table[CTL_SERIDX_COUNT][CTL_SERIDX_COUNT] = { /**>IDX_ :: 2nd:TUR RD WRT UNM MDSN MDSL RQSN INQ RDCP RES LSNS FMT STR*/ /*TUR */{ pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*READ */{ pS, pS, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*READ */{ pS, xS, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*WRITE */{ pS, xT, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*UNMAP */{ pS, xO, xO, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*MD_SNS */{ bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, pS, bK, bK}, Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/usr.sbin/ctladm/ctladm.8 Thu Dec 18 08:46:53 2014 (r275895) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd November 5, 2014 +.Dd December 6, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -995,6 +995,13 @@ command sequence order shall be explicit client through the selection of appropriate commands and task attributes. The default value is "restricted". It improves data integrity, but may introduce some additional delays. +.It Va serseq +Set to "on" to serialize conseŃutive reads/writes. +Set to "read" to serialize conseŃutive reads. +Set to "off" to allow them be issued in parallel. +Parallel issue of consecutive operations may confuse logic of the +backing file system, hurting performance; but it may improve performance +of backing stores without prefetch/write-back. .It Va rpm Specifies medium rotation rate of the device: 0 -- not reported, 1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 08:49:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04EB2614; Thu, 18 Dec 2014 08:49:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E44071BCA; Thu, 18 Dec 2014 08:49:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8npZ6031084; Thu, 18 Dec 2014 08:49:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8np7G031083; Thu, 18 Dec 2014 08:49:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180849.sBI8np7G031083@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275896 - stable/10/usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:49:52 -0000 Author: mav Date: Thu Dec 18 08:49:50 2014 New Revision: 275896 URL: https://svnweb.freebsd.org/changeset/base/275896 Log: MFC r275482: Document r275481 changes. Modified: stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Thu Dec 18 08:46:53 2014 (r275895) +++ stable/10/usr.sbin/ctladm/ctladm.8 Thu Dec 18 08:49:50 2014 (r275896) @@ -1014,10 +1014,11 @@ Set to "on", enables UNMAP support for t .It Va used-threshold .It Va pool-avail-threshold .It Va pool-used-threshold -Set per-LUN/-pool thin provisioning soft thresholds for ZVOL-backed LUNs. +Set per-LUN/-pool thin provisioning soft thresholds. LUN will establish UNIT ATTENTION condition if its or pool available space get below configured avail values, or its or pool used space get above configured used values. +Pool thresholds are working only for ZVOL-backed LUNs. .It Va writecache Set to "off", disables write caching for the LUN, if supported by the backend. .El From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 10:01:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF357596; Thu, 18 Dec 2014 10:01:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 97A7D1708; Thu, 18 Dec 2014 10:01:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIA1HKx066928; Thu, 18 Dec 2014 10:01:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIA1CSw066510; Thu, 18 Dec 2014 10:01:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412181001.sBIA1CSw066510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Dec 2014 10:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275897 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/ext2fs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nfsserver fs/tmpfs fs/unionfs kern nfsclient nfsserver ufs/ffs u... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 10:01:17 -0000 Author: kib Date: Thu Dec 18 10:01:12 2014 New Revision: 275897 URL: https://svnweb.freebsd.org/changeset/base/275897 Log: The VOP_LOOKUP() implementations for CREATE op do not put the name into namecache, to avoid cache trashing when doing large operations. E.g., tar archive extraction is not usually followed by access to many of the files created. Right now, each VOP_LOOKUP() implementation explicitely knowns about this quirk and tests for both MAKEENTRY flag presence and op != CREATE to make the call to cache_enter(). Centralize the handling of the quirk into VFS, by deciding to cache only by MAKEENTRY flag in VOP. VFS now sets NOCACHE flag for CREATE namei() calls. Note that the change in semantic is backward-compatible and could be merged to the stable branch, and is compatible with non-changed third-party filesystems which correctly handle MAKEENTRY. Suggested by: Chris Torek Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/msdosfs/msdosfs_lookup.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/unionfs/union_subr.c head/sys/fs/unionfs/union_vnops.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsserver/nfs_serv.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 10:01:12 2014 (r275897) @@ -1548,7 +1548,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode /* * Insert name into cache (as non-existent) if appropriate. */ - if (error == ENOENT && (cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if (error == ENOENT && (cnp->cn_flags & MAKEENTRY) != 0) cache_enter(dvp, *vpp, cnp); /* * Insert name into cache if appropriate. Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/ext2fs/ext2_lookup.c Thu Dec 18 10:01:12 2014 (r275897) @@ -514,7 +514,7 @@ notfound: /* * Insert name into cache (as non-existent) if appropriate. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(vdp, NULL, cnp); return (ENOENT); Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/fuse/fuse_vnops.c Thu Dec 18 10:01:12 2014 (r275897) @@ -795,7 +795,7 @@ calldaemon: * caching...) */ #if 0 - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) { + if ((cnp->cn_flags & MAKEENTRY) != 0) { FS_DEBUG("inserting NULL into cache\n"); cache_enter(dvp, NULL, cnp); } Modified: head/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_lookup.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/msdosfs/msdosfs_lookup.c Thu Dec 18 10:01:12 2014 (r275897) @@ -416,7 +416,7 @@ notfound: * and 8.3 filenames. Hence, it may not invalidate all negative * entries if a file with this name is later created. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(vdp, *vpp, cnp); #endif return (ENOENT); Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/nandfs/nandfs_vnops.c Thu Dec 18 10:01:12 2014 (r275897) @@ -478,7 +478,7 @@ out: * the file might not be found and thus putting it into the namecache * might be seen as negative caching. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(dvp, *vpp, cnp); return (error); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Dec 18 10:01:12 2014 (r275897) @@ -1184,8 +1184,7 @@ nfs_lookup(struct vop_lookup_args *ap) return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && - dattrflag) { + if ((cnp->cn_flags & MAKEENTRY) != 0 && dattrflag) { /* * Cache the modification time of the parent * directory from the post-op attributes in Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu Dec 18 10:01:12 2014 (r275897) @@ -994,7 +994,7 @@ nfsrvd_create(struct nfsrv_descript *nd, goto out; } NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | LOCKLEAF | SAVESTART); + LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) @@ -1205,7 +1205,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, goto out; } } - NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, cnflags); + NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, cnflags | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) @@ -1658,7 +1658,7 @@ nfsrvd_link(struct nfsrv_descript *nd, i } } NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | SAVENAME); + LOCKPARENT | SAVENAME | NOCACHE); if (!nd->nd_repstat) { nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); @@ -1735,7 +1735,7 @@ nfsrvd_symlink(struct nfsrv_descript *nd *vpp = NULL; NFSVNO_ATTRINIT(&nva); NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | SAVESTART); + LOCKPARENT | SAVESTART | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (!error && !nd->nd_repstat) @@ -1853,7 +1853,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, goto out; } NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | SAVENAME); + LOCKPARENT | SAVENAME | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) @@ -2782,7 +2782,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ } if (create == NFSV4OPEN_CREATE) NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | LOCKLEAF | SAVESTART); + LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE); else NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, LOOKUP, LOCKLEAF | SAVESTART); Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Dec 18 10:01:12 2014 (r275897) @@ -195,7 +195,7 @@ tmpfs_lookup(struct vop_cachedlookup_arg /* Store the result of this lookup in the cache. Avoid this if the * request was for creation, as it does not improve timings on * emprical tests. */ - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(dvp, *vpp, cnp); out: Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/unionfs/union_subr.c Thu Dec 18 10:01:12 2014 (r275897) @@ -536,6 +536,8 @@ unionfs_relookup(struct vnode *dvp, stru cn->cn_flags |= (cnp->cn_flags & (DOWHITEOUT | SAVESTART)); else if (RENAME == nameiop) cn->cn_flags |= (cnp->cn_flags & SAVESTART); + else if (nameiop == CREATE) + cn->cn_flags |= NOCACHE; vref(dvp); VOP_UNLOCK(dvp, LK_RELEASE); Modified: head/sys/fs/unionfs/union_vnops.c ============================================================================== --- head/sys/fs/unionfs/union_vnops.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/fs/unionfs/union_vnops.c Thu Dec 18 10:01:12 2014 (r275897) @@ -160,8 +160,7 @@ unionfs_lookup(struct vop_cachedlookup_a LK_RETRY); vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); - } else if (error == ENOENT && (cnflags & MAKEENTRY) && - nameiop != CREATE) + } else if (error == ENOENT && (cnflags & MAKEENTRY) != 0) cache_enter(dvp, NULLVP, cnp); UNIONFS_INTERNAL_DEBUG("unionfs_lookup: leave (%d)\n", error); @@ -337,7 +336,7 @@ unionfs_lookup_out: if (lvp != NULLVP) vrele(lvp); - if (error == ENOENT && (cnflags & MAKEENTRY) && nameiop != CREATE) + if (error == ENOENT && (cnflags & MAKEENTRY) != 0) cache_enter(dvp, NULLVP, cnp); UNIONFS_INTERNAL_DEBUG("unionfs_lookup: leave (%d)\n", error); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/kern/uipc_usrreq.c Thu Dec 18 10:01:12 2014 (r275897) @@ -505,7 +505,7 @@ uipc_bindat(int fd, struct socket *so, s buf[namelen] = 0; restart: - NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | SAVENAME, + NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | SAVENAME | NOCACHE, UIO_SYSSPACE, buf, fd, cap_rights_init(&rights, CAP_BINDAT), td); /* SHOULD BE ABLE TO ADOPT EXISTING AND wakeup() ALA FIFO's */ error = namei(&nd); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/kern/vfs_syscalls.c Thu Dec 18 10:01:12 2014 (r275897) @@ -1269,8 +1269,9 @@ kern_mknodat(struct thread *td, int fd, return (error); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, - pathseg, path, fd, cap_rights_init(&rights, CAP_MKNODAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | + NOCACHE, pathseg, path, fd, cap_rights_init(&rights, CAP_MKNODAT), + td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1384,8 +1385,9 @@ kern_mkfifoat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, - pathseg, path, fd, cap_rights_init(&rights, CAP_MKFIFOAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | + NOCACHE, pathseg, path, fd, cap_rights_init(&rights, CAP_MKFIFOAT), + td); if ((error = namei(&nd)) != 0) return (error); if (nd.ni_vp != NULL) { @@ -1530,8 +1532,9 @@ again: vrele(vp); return (EPERM); /* POSIX */ } - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2, - segflg, path2, fd2, cap_rights_init(&rights, CAP_LINKAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2 | + NOCACHE, segflg, path2, fd2, cap_rights_init(&rights, CAP_LINKAT), + td); if ((error = namei(&nd)) == 0) { if (nd.ni_vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1650,8 +1653,9 @@ kern_symlinkat(struct thread *td, char * AUDIT_ARG_TEXT(syspath); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, - segflg, path2, fd, cap_rights_init(&rights, CAP_SYMLINKAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | + NOCACHE, segflg, path2, fd, cap_rights_init(&rights, CAP_SYMLINKAT), + td); if ((error = namei(&nd)) != 0) goto out; if (nd.ni_vp) { @@ -3581,8 +3585,9 @@ kern_mkdirat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, - segflg, path, fd, cap_rights_init(&rights, CAP_MKDIRAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | + NOCACHE, segflg, path, fd, cap_rights_init(&rights, CAP_MKDIRAT), + td); nd.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&nd)) != 0) return (error); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/kern/vfs_vnops.c Thu Dec 18 10:01:12 2014 (r275897) @@ -189,7 +189,11 @@ restart: fmode = *flagp; if (fmode & O_CREAT) { ndp->ni_cnd.cn_nameiop = CREATE; - ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF; + /* + * Set NOCACHE to avoid flushing the cache when + * rolling in many files at once. + */ + ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF | NOCACHE; if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0) ndp->ni_cnd.cn_flags |= FOLLOW; if (!(vn_open_flags & VN_OPEN_NOAUDIT)) Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/nfsclient/nfs_vnops.c Thu Dec 18 10:01:12 2014 (r275897) @@ -1184,8 +1184,7 @@ nfsmout: return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && - dattrflag) { + if ((cnp->cn_flags & MAKEENTRY) != 0 && dattrflag) { /* * Cache the modification time of the parent * directory from the post-op attributes in Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/nfsserver/nfs_serv.c Thu Dec 18 10:01:12 2014 (r275897) @@ -1217,7 +1217,7 @@ nfsrv_create(struct nfsrv_descript *nfsd nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART; + nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE; /* * Call namei and do initial cleanup to get a few things @@ -1501,7 +1501,7 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART; + nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE; /* * Handle nfs_namei() call. If an error occurs, the nd structure @@ -2030,7 +2030,7 @@ nfsrv_link(struct nfsrv_descript *nfsd, VOP_UNLOCK(vp, 0); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT; + nd.ni_cnd.cn_flags = LOCKPARENT | NOCACHE; error = nfs_namei(&nd, nfsd, dfhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); if (dirp && !v3) { @@ -2153,7 +2153,7 @@ nfsrv_symlink(struct nfsrv_descript *nfs nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART; + nd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART | NOCACHE; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); if (error == 0) { @@ -2325,7 +2325,7 @@ nfsrv_mkdir(struct nfsrv_descript *nfsd, nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT; + nd.ni_cnd.cn_flags = LOCKPARENT | NOCACHE; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/ufs/ffs/ffs_snapshot.c Thu Dec 18 10:01:12 2014 (r275897) @@ -256,7 +256,8 @@ ffs_snapshot(mp, snapfile) * Create the snapshot file. */ restart: - NDINIT(&nd, CREATE, LOCKPARENT | LOCKLEAF, UIO_SYSSPACE, snapfile, td); + NDINIT(&nd, CREATE, LOCKPARENT | LOCKLEAF | NOCACHE, UIO_SYSSPACE, + snapfile, td); if ((error = namei(&nd)) != 0) return (error); if (nd.ni_vp != NULL) { Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Thu Dec 18 08:49:50 2014 (r275896) +++ head/sys/ufs/ufs/ufs_lookup.c Thu Dec 18 10:01:12 2014 (r275897) @@ -550,7 +550,7 @@ notfound: /* * Insert name into cache (as non-existent) if appropriate. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(vdp, NULL, cnp); return (ENOENT); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 11:10:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B91439E4; Thu, 18 Dec 2014 11:10:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A4DEB11FF; Thu, 18 Dec 2014 11:10:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIBAGxc097651; Thu, 18 Dec 2014 11:10:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIBAGcW097650; Thu, 18 Dec 2014 11:10:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412181110.sBIBAGcW097650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Dec 2014 11:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275898 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 11:10:16 -0000 Author: kib Date: Thu Dec 18 11:10:15 2014 New Revision: 275898 URL: https://svnweb.freebsd.org/changeset/base/275898 Log: MFC r259609 (by se): Fix overflow for timeout values of more than 68 years, which is the maximum covered by sbintime (LONG_MAX seconds). MFC r259633 (by se): Fix compilation on 32 bit architectures and use INT64_MAX instead of LONG_MAX for the upper bound check. Modified: stable/10/sys/kern/kern_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Thu Dec 18 10:01:12 2014 (r275897) +++ stable/10/sys/kern/kern_event.c Thu Dec 18 11:10:15 2014 (r275898) @@ -522,10 +522,14 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ -static __inline sbintime_t +static __inline sbintime_t timer2sbintime(intptr_t data) { +#ifdef __LP64__ + if (data > INT64_MAX / SBT_1MS) + return INT64_MAX; +#endif return (SBT_1MS * data); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 11:30:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6650261; Thu, 18 Dec 2014 11:30:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A1B2F1613; Thu, 18 Dec 2014 11:30:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIBUrMi009979; Thu, 18 Dec 2014 11:30:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIBUq0V009976; Thu, 18 Dec 2014 11:30:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412181130.sBIBUq0V009976@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Dec 2014 11:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275899 - in stable/10: lib/libc/sys sys/kern sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 11:30:53 -0000 Author: kib Date: Thu Dec 18 11:30:51 2014 New Revision: 275899 URL: https://svnweb.freebsd.org/changeset/base/275899 Log: MFC r268843 (by bapt): Extend kqueue's EVFILT_TIMER by adding precision unit flags support. Modified: stable/10/lib/libc/sys/kqueue.2 stable/10/sys/kern/kern_event.c stable/10/sys/sys/event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Thu Dec 18 11:10:15 2014 (r275898) +++ stable/10/lib/libc/sys/kqueue.2 Thu Dec 18 11:30:51 2014 (r275899) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2013 +.Dd July 18, 2014 .Dt KQUEUE 2 .Os .Sh NAME @@ -436,7 +436,7 @@ Establishes an arbitrary timer identifie .Va ident . When adding a timer, .Va data -specifies the timeout period in milliseconds. +specifies the timeout period. The timer will be periodic unless EV_ONESHOT is specified. On return, .Va data @@ -447,8 +447,25 @@ There is a system wide limit on the numb which is controlled by the .Va kern.kq_calloutmax sysctl. +.Bl -tag -width XXNOTE_USECONDS +.It Dv NOTE_SECONDS +.Va data +is in seconds. +.It Dv NOTE_MSECONDS +.Va data +is in milliseconds. +.It Dv NOTE_USECONDS +.Va data +is in microseconds. +.It Dv NOTE_NSECONDS +.Va data +is in nanoseconds. +.It +.El .Pp -On return, +If +.Va fflags +is not set, the default is milliseconds. On return, .Va fflags contains the events which triggered the filter. .It Dv EVFILT_USER Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Thu Dec 18 11:10:15 2014 (r275898) +++ stable/10/sys/kern/kern_event.c Thu Dec 18 11:30:51 2014 (r275899) @@ -522,15 +522,38 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ + +#define NOTE_TIMER_PRECMASK (NOTE_SECONDS|NOTE_MSECONDS|NOTE_USECONDS| \ + NOTE_NSECONDS) + static __inline sbintime_t -timer2sbintime(intptr_t data) +timer2sbintime(intptr_t data, int flags) { + sbintime_t modifier; + + switch (flags & NOTE_TIMER_PRECMASK) { + case NOTE_SECONDS: + modifier = SBT_1S; + break; + case NOTE_MSECONDS: /* FALLTHROUGH */ + case 0: + modifier = SBT_1MS; + break; + case NOTE_USECONDS: + modifier = SBT_1US; + break; + case NOTE_NSECONDS: + modifier = SBT_1NS; + break; + default: + return (-1); + } #ifdef __LP64__ - if (data > INT64_MAX / SBT_1MS) - return INT64_MAX; + if (data > SBT_MAX / modifier) + return (SBT_MAX); #endif - return (SBT_1MS * data); + return (modifier * data); } static void @@ -545,14 +568,15 @@ filt_timerexpire(void *knx) if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; - *kn->kn_ptr.p_nexttime += timer2sbintime(kn->kn_sdata); + *kn->kn_ptr.p_nexttime += timer2sbintime(kn->kn_sdata, + kn->kn_sfflags); callout_reset_sbt_on(calloutp, *kn->kn_ptr.p_nexttime, 0, filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); } } /* - * data contains amount of time to sleep, in milliseconds + * data contains amount of time to sleep */ static int filt_timerattach(struct knote *kn) @@ -565,7 +589,11 @@ filt_timerattach(struct knote *kn) return (EINVAL); if ((intptr_t)kn->kn_sdata == 0 && (kn->kn_flags & EV_ONESHOT) == 0) kn->kn_sdata = 1; - to = timer2sbintime(kn->kn_sdata); + /* Only precision unit are supported in flags so far */ + if (kn->kn_sfflags & ~NOTE_TIMER_PRECMASK) + return (EINVAL); + + to = timer2sbintime(kn->kn_sdata, kn->kn_sfflags); if (to < 0) return (EINVAL); Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Thu Dec 18 11:10:15 2014 (r275898) +++ stable/10/sys/sys/event.h Thu Dec 18 11:30:51 2014 (r275899) @@ -132,6 +132,12 @@ struct kevent { #define NOTE_TRACKERR 0x00000002 /* could not track child */ #define NOTE_CHILD 0x00000004 /* am a child process */ +/* additional flags for EVFILE_TIMER */ +#define NOTE_SECONDS 0x00000001 /* data is seconds */ +#define NOTE_MSECONDS 0x00000002 /* data is milliseconds */ +#define NOTE_USECONDS 0x00000004 /* data is microseconds */ +#define NOTE_NSECONDS 0x00000008 /* data is nanoseconds */ + struct knote; SLIST_HEAD(klist, knote); struct kqueue; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 11:36:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D49A685; Thu, 18 Dec 2014 11:36:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1E41A166A; Thu, 18 Dec 2014 11:36:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIBaFMi011968; Thu, 18 Dec 2014 11:36:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIBaFWS011967; Thu, 18 Dec 2014 11:36:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412181136.sBIBaFWS011967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Dec 2014 11:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275900 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 11:36:16 -0000 Author: kib Date: Thu Dec 18 11:36:14 2014 New Revision: 275900 URL: https://svnweb.freebsd.org/changeset/base/275900 Log: MFC r271315 (by joel): Minor mdoc nit. MFC r275806: Markup fixes for kqueue(2), no content changes. Modified: stable/10/lib/libc/sys/kqueue.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Thu Dec 18 11:30:51 2014 (r275899) +++ stable/10/lib/libc/sys/kqueue.2 Thu Dec 18 11:36:14 2014 (r275900) @@ -162,56 +162,56 @@ struct kevent { The fields of .Fa struct kevent are: -.Bl -tag -width XXXfilter -.It ident +.Bl -tag -width "Fa filter" +.It Fa ident Value used to identify this event. The exact interpretation is determined by the attached filter, but often is a file descriptor. -.It filter +.It Fa filter Identifies the kernel filter used to process this event. The pre-defined system filters are described below. -.It flags +.It Fa flags Actions to perform on the event. -.It fflags +.It Fa fflags Filter-specific flags. -.It data +.It Fa data Filter-specific data value. -.It udata +.It Fa udata Opaque user-defined value passed through the kernel unchanged. .El .Pp The .Va flags field can contain the following values: -.Bl -tag -width XXXEV_ONESHOT -.It EV_ADD +.Bl -tag -width EV_DISPATCH +.It Dv EV_ADD Adds the event to the kqueue. Re-adding an existing event will modify the parameters of the original event, and not result in a duplicate entry. Adding an event automatically enables it, unless overridden by the EV_DISABLE flag. -.It EV_ENABLE +.It Dv EV_ENABLE Permit .Fn kevent to return the event if it is triggered. -.It EV_DISABLE +.It Dv EV_DISABLE Disable the event so .Fn kevent will not return it. The filter itself is not disabled. -.It EV_DISPATCH +.It Dv EV_DISPATCH Disable the event source immediately after delivery of an event. See .Dv EV_DISABLE above. -.It EV_DELETE +.It Dv EV_DELETE Removes the event from the kqueue. Events which are attached to file descriptors are automatically deleted on the last close of the descriptor. -.It EV_RECEIPT +.It Dv EV_RECEIPT This flag is useful for making bulk changes to a kqueue without draining any pending events. When passed as input, it forces @@ -220,20 +220,20 @@ to always be returned. When a filter is successfully added the .Va data field will be zero. -.It EV_ONESHOT +.It Dv EV_ONESHOT Causes the event to return only the first occurrence of the filter being triggered. After the user retrieves the event from the kqueue, it is deleted. -.It EV_CLEAR +.It Dv EV_CLEAR After the event is retrieved by the user, its state is reset. This is useful for filters which report state transitions instead of the current state. Note that some filters may automatically set this flag internally. -.It EV_EOF +.It Dv EV_EOF Filters may set this flag to indicate filter-specific EOF condition. -.It EV_ERROR +.It Dv EV_ERROR See .Sx RETURN VALUES below. @@ -245,8 +245,8 @@ Arguments may be passed to and from the and .Va data fields in the kevent structure. -.Bl -tag -width EVFILT_SIGNAL -.It EVFILT_READ +.Bl -tag -width "Dv EVFILT_PROCDESC" +.It Dv EVFILT_READ Takes a descriptor as the identifier, and returns whenever there is data available to read. The behavior of the filter is slightly different depending @@ -265,7 +265,7 @@ subject to the value of the socket buffer. This may be overridden with a per-filter low water mark at the time the filter is added by setting the -NOTE_LOWAT +.Dv NOTE_LOWAT flag in .Va fflags , and specifying the new low water mark in @@ -275,7 +275,9 @@ On return, contains the number of bytes of protocol data available to read. .Pp If the read direction of the socket has shutdown, then the filter -also sets EV_EOF in +also sets +.Dv EV_EOF +in .Va flags , and returns the socket error (if any) in .Va fflags . @@ -291,9 +293,13 @@ Returns when the there is data to read; .Va data contains the number of bytes available. .Pp -When the last writer disconnects, the filter will set EV_EOF in +When the last writer disconnects, the filter will set +.Dv EV_EOF +in .Va flags . -This may be cleared by passing in EV_CLEAR, at which point the +This may be cleared by passing in +.Dv EV_CLEAR , +at which point the filter will resume waiting for data to become available before returning. .It "BPF devices" @@ -304,7 +310,7 @@ enabled and there is any data to read; .Va data contains the number of bytes available. .El -.It EVFILT_WRITE +.It Dv EVFILT_WRITE Takes a descriptor as the identifier, and returns whenever it is possible to write to the descriptor. For sockets, pipes @@ -312,23 +318,30 @@ and fifos, .Va data will contain the amount of space remaining in the write buffer. The filter will set EV_EOF when the reader disconnects, and for -the fifo case, this may be cleared by use of EV_CLEAR. +the fifo case, this may be cleared by use of +.Dv EV_CLEAR . Note that this filter is not supported for vnodes or BPF devices. .Pp For sockets, the low water mark and socket error handling is -identical to the EVFILT_READ case. -.It EVFILT_AIO +identical to the +.Dv EVFILT_READ +case. +.It Dv EVFILT_AIO The sigevent portion of the AIO request is filled in, with .Va sigev_notify_kqueue containing the descriptor of the kqueue that the event should be attached to, .Va sigev_notify_kevent_flags -containing the kevent flags which should be EV_ONESHOT, EV_CLEAR or -EV_DISPATCH, +containing the kevent flags which should be +.Dv EV_ONESHOT , +.Dv EV_CLEAR +or +.Dv EV_DISPATCH , .Va sigev_value containing the udata value, and .Va sigev_notify -set to SIGEV_KEVENT. +set to +.Dv SIGEV_KEVENT . When the .Fn aio_* system call is made, the event will be registered @@ -339,29 +352,30 @@ argument set to the returned by the .Fn aio_* system call. -The filter returns under the same conditions as aio_error. -.It EVFILT_VNODE +The filter returns under the same conditions as +.Fn aio_error . +.It Dv EVFILT_VNODE Takes a file descriptor as the identifier and the events to watch for in .Va fflags , and returns when one or more of the requested events occurs on the descriptor. The events to monitor are: -.Bl -tag -width XXNOTE_RENAME -.It NOTE_DELETE +.Bl -tag -width "Dv NOTE_RENAME" +.It Dv NOTE_DELETE The .Fn unlink system call was called on the file referenced by the descriptor. -.It NOTE_WRITE +.It Dv NOTE_WRITE A write occurred on the file referenced by the descriptor. -.It NOTE_EXTEND +.It Dv NOTE_EXTEND The file referenced by the descriptor was extended. -.It NOTE_ATTRIB +.It Dv NOTE_ATTRIB The file referenced by the descriptor had its attributes changed. -.It NOTE_LINK +.It Dv NOTE_LINK The link count on the file changed. -.It NOTE_RENAME +.It Dv NOTE_RENAME The file referenced by the descriptor was renamed. -.It NOTE_REVOKE +.It Dv NOTE_REVOKE Access to the file was revoked via .Xr revoke 2 or the underlying file system was unmounted. @@ -370,26 +384,26 @@ or the underlying file system was unmoun On return, .Va fflags contains the events which triggered the filter. -.It EVFILT_PROC +.It Dv EVFILT_PROC Takes the process ID to monitor as the identifier and the events to watch for in .Va fflags , and returns when the process performs one or more of the requested events. If a process can normally see another process, it can attach an event to it. The events to monitor are: -.Bl -tag -width XXNOTE_TRACKERR -.It NOTE_EXIT +.Bl -tag -width "Dv NOTE_TRACKERR" +.It Dv NOTE_EXIT The process has exited. The exit status will be stored in .Va data . -.It NOTE_FORK +.It Dv NOTE_FORK The process has called .Fn fork . -.It NOTE_EXEC +.It Dv NOTE_EXEC The process has executed a new process via .Xr execve 2 or a similar call. -.It NOTE_TRACK +.It Dv NOTE_TRACK Follow a process across .Fn fork calls. @@ -397,22 +411,28 @@ The parent process registers a new keven using the same .Va fflags as the original event. -The child process will signal an event with NOTE_CHILD set in +The child process will signal an event with +.Dv NOTE_CHILD +set in .Va fflags and the parent PID in .Va data . .Pp If the parent process fails to register a new kevent .Pq usually due to resource limitations , -it will signal an event with NOTE_TRACKERR set in +it will signal an event with +.Dv NOTE_TRACKERR +set in .Va fflags , -and the child process will not signal a NOTE_CHILD event. +and the child process will not signal a +.Dv NOTE_CHILD +event. .El .Pp On return, .Va fflags contains the events which triggered the filter. -.It EVFILT_SIGNAL +.It Dv EVFILT_SIGNAL Takes the signal number to monitor as the identifier and returns when the given signal is delivered to the process. This coexists with the @@ -422,7 +442,9 @@ and facilities, and has a lower precedence. The filter will record all attempts to deliver a signal to a process, even if the signal has -been marked as SIG_IGN, except for the +been marked as +.Dv SIG_IGN , +except for the .Dv SIGCHLD signal, which, if ignored, won't be recorded by the filter. Event notification happens after normal @@ -430,14 +452,18 @@ signal delivery processing. .Va data returns the number of times the signal has occurred since the last call to .Fn kevent . -This filter automatically sets the EV_CLEAR flag internally. -.It EVFILT_TIMER +This filter automatically sets the +.Dv EV_CLEAR +flag internally. +.It Dv EVFILT_TIMER Establishes an arbitrary timer identified by .Va ident . When adding a timer, .Va data specifies the timeout period. -The timer will be periodic unless EV_ONESHOT is specified. +The timer will be periodic unless +.Dv EV_ONESHOT +is specified. On return, .Va data contains the number of times the timeout has expired since the last call to @@ -447,7 +473,7 @@ There is a system wide limit on the numb which is controlled by the .Va kern.kq_calloutmax sysctl. -.Bl -tag -width XXNOTE_USECONDS +.Bl -tag -width "Dv NOTE_USECONDS" .It Dv NOTE_SECONDS .Va data is in seconds. @@ -460,7 +486,6 @@ is in microseconds. .It Dv NOTE_NSECONDS .Va data is in nanoseconds. -.It .El .Pp If @@ -476,7 +501,7 @@ user level code. The lower 24 bits of the .Va fflags may be used for user defined flags and manipulated using the following: -.Bl -tag -width XXNOTE_FFLAGSMASK +.Bl -tag -width "Dv NOTE_FFLAGSMASK" .It Dv NOTE_FFNOP Ignore the input .Va fflags . @@ -498,7 +523,7 @@ User defined flag mask for .El .Pp A user event is triggered for output with the following: -.Bl -tag -width XXNOTE_FFLAGSMASK +.Bl -tag -width "Dv NOTE_FFLAGSMASK" .It Dv NOTE_TRIGGER Cause the event to be triggered. .El From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 13:46:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80D379D3; Thu, 18 Dec 2014 13:46:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6BBF01A41; Thu, 18 Dec 2014 13:46:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIDkCWt074020; Thu, 18 Dec 2014 13:46:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIDkCiX074019; Thu, 18 Dec 2014 13:46:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201412181346.sBIDkCiX074019@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 18 Dec 2014 13:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275901 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 13:46:12 -0000 Author: avg Date: Thu Dec 18 13:46:11 2014 New Revision: 275901 URL: https://svnweb.freebsd.org/changeset/base/275901 Log: MFC r275401: zfs_putpages: actually update mtime and ctime Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 11:36:14 2014 (r275900) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 13:46:11 2014 (r275901) @@ -5937,6 +5937,7 @@ top: &zp->z_pflags, 8); zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime, B_TRUE); + (void)sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, len, 0); zfs_vmobject_wlock(object); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 13:46:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5125B02; Thu, 18 Dec 2014 13:46:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A072C1A4C; Thu, 18 Dec 2014 13:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIDkXYP074108; Thu, 18 Dec 2014 13:46:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIDkX4Z074107; Thu, 18 Dec 2014 13:46:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201412181346.sBIDkX4Z074107@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 18 Dec 2014 13:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275902 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 13:46:33 -0000 Author: avg Date: Thu Dec 18 13:46:32 2014 New Revision: 275902 URL: https://svnweb.freebsd.org/changeset/base/275902 Log: MFC r275401: zfs_putpages: actually update mtime and ctime Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 13:46:11 2014 (r275901) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 13:46:32 2014 (r275902) @@ -5914,6 +5914,7 @@ top: &zp->z_pflags, 8); zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime, B_TRUE); + (void)sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, len, 0); VM_OBJECT_LOCK(object); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 14:31:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62FEB9EB; Thu, 18 Dec 2014 14:31:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4F3CE212A; Thu, 18 Dec 2014 14:31:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIEVVqq096883; Thu, 18 Dec 2014 14:31:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIEVVOj096882; Thu, 18 Dec 2014 14:31:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412181431.sBIEVVOj096882@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 18 Dec 2014 14:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275903 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 14:31:31 -0000 Author: andrew Date: Thu Dec 18 14:31:30 2014 New Revision: 275903 URL: https://svnweb.freebsd.org/changeset/base/275903 Log: Add AArch64 64-bit relocation values. These will be needed by rtld when we import it along with utilities in elftoolchain. Differential Revision: https://reviews.freebsd.org/D1330 Reviewed by: emaste Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu Dec 18 13:46:32 2014 (r275902) +++ head/sys/sys/elf_common.h Thu Dec 18 14:31:30 2014 (r275903) @@ -641,6 +641,18 @@ typedef struct { #define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */ #define R_386_IRELATIVE 42 /* PLT entry resolved indirectly at runtime */ +#define R_AARCH64_ABS64 257 /* Absolute offset */ +#define R_AARCH64_ABS32 258 /* Absolute, 32-bit overflow check */ +#define R_AARCH64_ABS16 259 /* Absolute, 16-bit overflow check */ +#define R_AARCH64_PREL64 260 /* PC relative */ +#define R_AARCH64_PREL32 261 /* PC relative, 32-bit overflow check */ +#define R_AARCH64_PREL16 262 /* PC relative, 16-bit overflow check */ +#define R_AARCH64_COPY 1024 /* Copy data from shared object */ +#define R_AARCH64_GLOB_DAT 1025 /* Set GOT entry to data address */ +#define R_AARCH64_JUMP_SLOT 1026 /* Set GOT entry to code address */ +#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ +#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ + #define R_ARM_NONE 0 /* No relocation. */ #define R_ARM_PC24 1 #define R_ARM_ABS32 2 From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 16:57:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9464560B; Thu, 18 Dec 2014 16:57:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 686991A2A; Thu, 18 Dec 2014 16:57:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIGvND3063804; Thu, 18 Dec 2014 16:57:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIGvNc9063803; Thu, 18 Dec 2014 16:57:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201412181657.sBIGvNc9063803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Dec 2014 16:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275905 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 16:57:23 -0000 Author: imp Date: Thu Dec 18 16:57:22 2014 New Revision: 275905 URL: https://svnweb.freebsd.org/changeset/base/275905 Log: Don't deselect the card too soon. To set the block size or switch the function parameters, the card has to be in transfer state. If it is in the idle state, the commands are ignored. This caused us not to set the proper parameters that we later assume to be present, leading to downstream failures of the card / interface as our state machine mismatches the card's. Submitted by: Svatopluk Kraus , Michal Meloun Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Thu Dec 18 16:57:19 2014 (r275904) +++ head/sys/dev/mmc/mmc.c Thu Dec 18 16:57:22 2014 (r275905) @@ -1357,7 +1357,6 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->erase_sector = 16 << ivar->sd_status.au_size; } - mmc_select_card(sc, 0); /* Find max supported bus width. */ if ((mmcbr_get_caps(sc->dev) & MMC_CAP_4_BIT_DATA) && (ivar->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) @@ -1385,6 +1384,7 @@ mmc_discover_cards(struct mmc_softc *sc) child = device_add_child(sc->dev, NULL, -1); device_set_ivars(child, ivar); } + mmc_select_card(sc, 0); return; } mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid); @@ -1443,7 +1443,6 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->hs_tran_speed = ivar->tran_speed; /* Find max supported bus width. */ ivar->bus_width = mmc_test_bus_width(sc); - mmc_select_card(sc, 0); /* Handle HC erase sector size. */ if (ivar->raw_ext_csd[EXT_CSD_ERASE_GRP_SIZE] != 0) { ivar->erase_sector = 1024 * @@ -1451,6 +1450,7 @@ mmc_discover_cards(struct mmc_softc *sc) mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_ERASE_GRP_DEF, 1); } + mmc_select_card(sc, 0); } else { ivar->bus_width = bus_width_1; ivar->timing = bus_timing_normal; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 16:57:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95EB145F; Thu, 18 Dec 2014 16:57:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 820FA1A28; Thu, 18 Dec 2014 16:57:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIGvKgD063731; Thu, 18 Dec 2014 16:57:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIGvKZI063730; Thu, 18 Dec 2014 16:57:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201412181657.sBIGvKZI063730@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Dec 2014 16:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275904 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 16:57:20 -0000 Author: imp Date: Thu Dec 18 16:57:19 2014 New Revision: 275904 URL: https://svnweb.freebsd.org/changeset/base/275904 Log: Remove -fno-strict-alias, as it is no longer needed. Modified: head/usr.sbin/kldxref/Makefile Modified: head/usr.sbin/kldxref/Makefile ============================================================================== --- head/usr.sbin/kldxref/Makefile Thu Dec 18 14:31:30 2014 (r275903) +++ head/usr.sbin/kldxref/Makefile Thu Dec 18 16:57:19 2014 (r275904) @@ -5,7 +5,6 @@ MAN= kldxref.8 SRCS= kldxref.c ef.c ef_obj.c WARNS?= 2 -CFLAGS+=-fno-strict-aliasing .if exists(ef_${MACHINE_CPUARCH}.c) && ${MACHINE_ARCH} != "powerpc64" SRCS+= ef_${MACHINE_CPUARCH}.c From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:10:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DB42AA0; Thu, 18 Dec 2014 18:10:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 09B5E2723; Thu, 18 Dec 2014 18:10:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIIAegT098201; Thu, 18 Dec 2014 18:10:40 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIIAee1098200; Thu, 18 Dec 2014 18:10:40 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201412181810.sBIIAee1098200@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 18 Dec 2014 18:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275906 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 18:10:41 -0000 Author: jamie Date: Thu Dec 18 18:10:39 2014 New Revision: 275906 URL: https://svnweb.freebsd.org/changeset/base/275906 Log: Setgid before running a command as a specified user. Previously only initgroups(3) was called, what isn't quite enough. This brings jail(8) in line with jexec(8), which was already doing the right thing. PR: 195984 MFC after: 1 week Modified: head/usr.sbin/jail/command.c Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Thu Dec 18 16:57:22 2014 (r275905) +++ head/usr.sbin/jail/command.c Thu Dec 18 18:10:39 2014 (r275906) @@ -667,6 +667,11 @@ run_command(struct cfjail *j) if (term != NULL) setenv("TERM", term, 1); } + if (setgid(pwd->pw_gid) < 0) { + jail_warnx(j, "setgid %d: %s", pwd->pw_gid, + strerror(errno)); + exit(1); + } if (setusercontext(lcap, pwd, pwd->pw_uid, username ? LOGIN_SETALL & ~LOGIN_SETGROUP & ~LOGIN_SETLOGIN : LOGIN_SETPATH | LOGIN_SETENV) < 0) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:16:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C958BC73; Thu, 18 Dec 2014 18:16:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B43652819; Thu, 18 Dec 2014 18:16:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIIG2it001387; Thu, 18 Dec 2014 18:16:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIIG1aK001377; Thu, 18 Dec 2014 18:16:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412181816.sBIIG1aK001377@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 18 Dec 2014 18:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275907 - in head: . etc etc/mtree tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 18:16:03 -0000 Author: ngie Date: Thu Dec 18 18:16:00 2014 New Revision: 275907 URL: https://svnweb.freebsd.org/changeset/base/275907 Log: Fix building/installing tests when TESTSBASE != /usr/tests The work in r258233 hardcoded the assumption that tests was the last component of the tests tree by pushing tests as an explicit prefix for the paths in BSD.tests.dist and /usr was the prefix for all tests, per BSD.usr.dist and all of the mtree calls used in Makefile.inc1. This assumption breaks if/when one provides a custom TESTSBASE "prefix", e.g. TESTSBASE=/mytests . One thing that r258233 did properly though was remove "/usr/tests" creation from BSD.usr.dist -- that should have not been there in the first place. That was an "oops" on my part for the work that was originally committed in r241823 MFC after: 2 weeks Phabric: D1301 Reviewed by: imp Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/etc/Makefile head/etc/mtree/BSD.include.dist head/etc/mtree/BSD.tests.dist head/etc/mtree/BSD.usr.dist head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Dec 18 18:10:39 2014 (r275906) +++ head/Makefile.inc1 Thu Dec 18 18:16:00 2014 (r275907) @@ -526,8 +526,9 @@ _worldtmp: -p ${WORLDTMP}/usr/lib >/dev/null .endif .if ${MK_TESTS} != "no" + mkdir -p ${WORLDTMP}${TESTSBASE} mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ - -p ${WORLDTMP}/usr >/dev/null + -p ${WORLDTMP}${TESTSBASE} >/dev/null .endif .for _mtree in ${LOCAL_MTREE} mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null @@ -866,8 +867,9 @@ distributeworld installworld: _installch -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null .endif .if ${MK_TESTS} != "no" && ${dist} == "tests" + -mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ - -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null + -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null .endif .if defined(NO_ROOT) ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ @@ -2085,8 +2087,9 @@ _xi-mtree: mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${XDDESTDIR}/usr/include >/dev/null .if ${MK_TESTS} != "no" + mkdir -p ${XDDESTDIR}${TESTSBASE} mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ - -p ${XDDESTDIR}/usr >/dev/null + -p ${XDDESTDIR}${TESTSBASE} >/dev/null .endif .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Dec 18 18:10:39 2014 (r275906) +++ head/etc/Makefile Thu Dec 18 18:16:00 2014 (r275907) @@ -333,7 +333,7 @@ MTREES+= mtree/BSD.debug.dist /usr/lib MTREES+= mtree/BSD.groff.dist /usr .endif .if ${MK_TESTS} != "no" -MTREES+= mtree/BSD.tests.dist /usr +MTREES+= mtree/BSD.tests.dist ${TESTSBASE} .endif .if ${MK_SENDMAIL} != "no" MTREES+= mtree/BSD.sendmail.dist / @@ -349,6 +349,7 @@ distrib-dirs: ${MTREES:N/*} shift; \ d=${DESTDIR}$$1; \ shift; \ + test -d $$d || mkdir -p $$d; \ ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \ -f $$m -p $$d; \ ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ @@ -362,6 +363,7 @@ distrib-dirs: ${MTREES:N/*} test "$$d" == "/" && d=""; \ d=${DISTBASE}$$d; \ shift; \ + test -d $$d || mkdir -p $$d; \ ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \ "sed s#^\.#.$$d# | ${METALOG.add}" ; \ ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \ Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu Dec 18 18:10:39 2014 (r275906) +++ head/etc/mtree/BSD.include.dist Thu Dec 18 18:16:00 2014 (r275907) @@ -9,6 +9,10 @@ .. arpa .. + atf-c + .. + atf-c++ + .. bsm .. bsnmp Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Dec 18 18:10:39 2014 (r275906) +++ head/etc/mtree/BSD.tests.dist Thu Dec 18 18:16:00 2014 (r275907) @@ -5,410 +5,392 @@ /set type=dir uname=root gname=wheel mode=0755 . - include - atf-c + bin + chown .. - atf-c++ + date .. - .. - share - atf + mv .. - doc - atf - .. - pjdfstest - .. + pax .. - .. - tests - bin - chown + pkill + .. + sh + builtins .. - date + errors .. - mv + execution .. - pax + expansion .. - pkill + parameters .. - sh - builtins - .. - errors - .. - execution - .. - expansion - .. - parameters - .. - parser - .. - set-e - .. + parser .. - sleep - .. - test + set-e .. .. - cddl - lib - .. - sbin - .. - usr.bin - .. - usr.sbin - .. + sleep + .. + test + .. + .. + cddl + lib .. - etc + sbin .. - games + usr.bin .. - gnu - lib - .. - usr.bin - diff - .. - .. + usr.sbin .. + .. + etc + .. + games + .. + gnu lib - atf - libatf-c - detail - .. - .. - libatf-c++ - detail - .. - .. - test-programs - .. + .. + usr.bin + diff .. - libc - c063 - .. - db - .. - gen - execve - .. - posix_spawn - .. + .. + .. + lib + atf + libatf-c + detail .. - hash - data - .. + .. + libatf-c++ + detail .. - inet + .. + test-programs + .. + .. + libc + c063 + .. + db + .. + gen + execve .. - locale + posix_spawn .. - net - getaddrinfo - data - .. - .. + .. + hash + data .. - regex + .. + inet + .. + locale + .. + net + getaddrinfo data .. .. - ssp - .. - stdio - .. - stdlib - .. - string - .. - sys - .. - time - .. - tls - dso - .. - .. - termios - .. - ttyio + .. + regex + data .. .. - libcrypt + ssp .. - libmp + stdio .. - libnv + stdlib .. - libpam + string .. - libproc + sys .. - librt + time .. - libthr - dlopen + tls + dso .. .. - libutil + termios .. - msun + ttyio .. .. + libcrypt + .. + libmp + .. + libnv + .. + libpam + .. + libproc + .. + librt + .. + libthr + dlopen + .. + .. + libutil + .. + msun + .. + .. + libexec + atf + atf-check + .. + atf-sh + .. + .. + rtld-elf + .. + .. + sbin + dhclient + .. + devd + .. + growfs + .. + mdconfig + .. + .. + secure + lib + .. libexec - atf - atf-check + .. + usr.bin + .. + usr.sbin + .. + .. + share + examples + tests + atf .. - atf-sh + plain .. .. - rtld-elf - .. .. - sbin - dhclient + .. + sys + kern + .. + netinet + .. + opencrypto + .. + pjdfstest + chflags + .. + chmod .. - devd + chown .. - growfs + ftruncate .. - mdconfig + granular .. - .. - secure - lib + link .. - libexec + mkdir .. - usr.bin + mkfifo .. - usr.sbin + mknod .. - .. - share - examples - tests - atf - .. - plain - .. - .. + open .. - .. - sys - kern + rename .. - netinet + rmdir .. - opencrypto + symlink .. - pjdfstest - chflags + truncate + .. + unlink + .. + .. + .. + usr.bin + apply + .. + basename + .. + bmake + archives + fmt_44bsd .. - chmod + fmt_44bsd_mod .. - chown + fmt_oldbsd .. - ftruncate + .. + basic + t0 .. - granular + t1 .. - link + t2 .. - mkdir + t3 .. - mkfifo + .. + execution + ellipsis .. - mknod + empty .. - open + joberr .. - rename + plus .. - rmdir + .. + shell + builtin .. - symlink + meta .. - truncate + path .. - unlink + path_select .. - .. - .. - usr.bin - apply - .. - basename - .. - bmake - archives - fmt_44bsd - .. - fmt_44bsd_mod - .. - fmt_oldbsd - .. + replace + .. + select .. + .. + suffixes basic - t0 - .. - t1 - .. - t2 - .. - t3 - .. .. - execution - ellipsis - .. - empty - .. - joberr - .. - plus - .. + src_wild1 .. - shell - builtin - .. - meta - .. - path - .. - path_select - .. - replace - .. - select - .. + src_wild2 .. - suffixes - basic - .. - src_wild1 - .. - src_wild2 - .. + .. + syntax + directive-t0 .. - syntax - directive-t0 - .. - enl - .. - funny-targets - .. - semi - .. + enl .. - sysmk - t0 - 2 - 1 - .. - .. - mk - .. - .. - t1 - 2 - 1 - .. - .. - mk + funny-targets + .. + semi + .. + .. + sysmk + t0 + 2 + 1 .. .. - t2 - 2 - 1 - .. - .. - mk - .. + mk .. .. - variables - modifier_M + t1 + 2 + 1 + .. .. - modifier_t + mk .. - opt_V + .. + t2 + 2 + 1 + .. .. - t0 + mk .. .. .. - calendar - .. - cmp - .. - comm - .. - cut - .. - dirname - .. - file2c - .. - grep - .. - gzip - .. - join - .. - jot - .. - lastcomm - .. - m4 - .. - mkimg - .. - ncal - .. - printf - .. - sed - regress.multitest.out + variables + modifier_M .. - .. - timeout - .. - tr - .. - truncate - .. - units - .. - uudecode - .. - uuencode - .. - xargs - .. - yacc - yacc + modifier_t + .. + opt_V + .. + t0 .. .. .. - usr.sbin - etcupdate - .. - newsyslog - .. - nmtree - .. - pw + calendar + .. + cmp + .. + comm + .. + cut + .. + dirname + .. + file2c + .. + grep + .. + gzip + .. + join + .. + jot + .. + lastcomm + .. + m4 + .. + mkimg + .. + ncal + .. + printf + .. + sed + regress.multitest.out .. - sa + .. + timeout + .. + tr + .. + truncate + .. + units + .. + uudecode + .. + uuencode + .. + xargs + .. + yacc + yacc .. .. .. + usr.sbin + etcupdate + .. + newsyslog + .. + nmtree + .. + pw + .. + sa + .. + .. .. # vim: set expandtab ts=4 sw=4: Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Dec 18 18:10:39 2014 (r275906) +++ head/etc/mtree/BSD.usr.dist Thu Dec 18 18:16:00 2014 (r275907) @@ -126,6 +126,8 @@ sbin .. share + atf + .. bsdconfig media .. @@ -169,6 +171,8 @@ doc IPv6 .. + atf + .. atm .. legal @@ -189,6 +193,8 @@ .. papers .. + pjdfstest + .. psd 01.cacm .. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Dec 18 18:10:39 2014 (r275906) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Dec 18 18:16:00 2014 (r275907) @@ -4663,10 +4663,10 @@ OLD_FILES+=usr/share/man/man4/atf-test-c OLD_FILES+=usr/share/mk/atf.test.mk # Test suite. -. if(exists(${DESTDIR}/usr/tests/)) -TESTS_DIRS!=find ${DESTDIR}/usr/tests -type d | sed -e 's,^${DESTDIR}/,,'; echo +. if exists(${DESTDIR}${TESTSBASE}) +TESTS_DIRS!=find ${DESTDIR}${TESTSBASE} -type d | sed -e 's,^${DESTDIR}/,,'; echo OLD_DIRS+=${TESTS_DIRS} -TESTS_FILES!=find ${DESTDIR}/usr/tests \! -type d | sed -e 's,^${DESTDIR}/,,'; echo +TESTS_FILES!=find ${DESTDIR}${TESTSBASE} \! -type d | sed -e 's,^${DESTDIR}/,,'; echo OLD_FILES+=${TESTS_FILES} . endif .endif # Test suite. From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:20:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32D06EAC; Thu, 18 Dec 2014 18:20:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1F2012872; Thu, 18 Dec 2014 18:20:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIIKYlt003850; Thu, 18 Dec 2014 18:20:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIIKYTj003849; Thu, 18 Dec 2014 18:20:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412181820.sBIIKYTj003849@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 18 Dec 2014 18:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275908 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 18:20:35 -0000 Author: ngie Date: Thu Dec 18 18:20:33 2014 New Revision: 275908 URL: https://svnweb.freebsd.org/changeset/base/275908 Log: Document STRIP_CMD in build(7) and note its importance with LOCAL_ITOOLS MFC after: 1 week Phabric: D1335 Reviewed by: brueffer Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Thu Dec 18 18:16:00 2014 (r275907) +++ head/share/man/man7/build.7 Thu Dec 18 18:20:33 2014 (r275908) @@ -445,6 +445,21 @@ process. .Bd -literal -offset indent make PORTS_MODULES=emulators/kqemu-kmod kernel .Ed +.It Va STRIP_CMD +Command to use at install time when stripping binaries. +Be sure to add any additional tools required to run +.Va STRIP_CMD +to the +.Va LOCAL_ITOOLS +.Xr make 1 +variable before running the +.Cm distributeworld +or +.Cm installworld +targets. +See +.Xr install 1 +for more details. .It Va SUBDIR_OVERRIDE Override the default list of sub-directories and only build the sub-directory named in this variable. From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:26:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27DC416B; Thu, 18 Dec 2014 18:26:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 143D82984; Thu, 18 Dec 2014 18:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIIQB7k006119; Thu, 18 Dec 2014 18:26:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIIQB0j006118; Thu, 18 Dec 2014 18:26:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412181826.sBIIQB0j006118@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 18 Dec 2014 18:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275909 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 18:26:12 -0000 Author: ngie Date: Thu Dec 18 18:26:10 2014 New Revision: 275909 URL: https://svnweb.freebsd.org/changeset/base/275909 Log: Don't build full clang toolchain or clang extras in stages 1-3 of buildworld MFC after: 1 week Reviewed by: dim (as part of a "larger" diff) Phabric: D1336 Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Dec 18 18:20:33 2014 (r275908) +++ head/Makefile.inc1 Thu Dec 18 18:26:10 2014 (r275909) @@ -263,7 +263,8 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no + MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_LLDB=no MK_TESTS=no # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -273,7 +274,9 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_LLDB=no MK_TESTS=no # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -1478,7 +1481,8 @@ NXBMAKE= ${NXBENV} ${MAKE} \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_FULL=no MK_LLDB=no + MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_DEBUG_FILES=no MK_LLDB=no native-xtools: .MAKE mkdir -p ${OBJTREE}/nxb-bin/bin From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:30:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F7303DD; Thu, 18 Dec 2014 18:30:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4BD7B29F5; Thu, 18 Dec 2014 18:30:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIIUYG5006758; Thu, 18 Dec 2014 18:30:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIIUYeJ006757; Thu, 18 Dec 2014 18:30:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412181830.sBIIUYeJ006757@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 18 Dec 2014 18:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275910 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 18:30:34 -0000 Author: ngie Date: Thu Dec 18 18:30:33 2014 New Revision: 275910 URL: https://svnweb.freebsd.org/changeset/base/275910 Log: Fix accidental MK_DEBUG_FILES=no addition to NXBMAKE in r275909 X-MFC with: r275909 Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Dec 18 18:26:10 2014 (r275909) +++ head/Makefile.inc1 Thu Dec 18 18:30:33 2014 (r275910) @@ -1482,7 +1482,7 @@ NXBMAKE= ${NXBENV} ${MAKE} \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_DEBUG_FILES=no MK_LLDB=no + MK_LLDB=no native-xtools: .MAKE mkdir -p ${OBJTREE}/nxb-bin/bin From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:31:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A50C52C; Thu, 18 Dec 2014 18:31:20 +0000 (UTC) Received: from mail-pd0-x22d.google.com (mail-pd0-x22d.google.com [IPv6:2607:f8b0:400e:c02::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 221C62AA3; Thu, 18 Dec 2014 18:31:20 +0000 (UTC) Received: by mail-pd0-f173.google.com with SMTP id ft15so1910071pdb.18; Thu, 18 Dec 2014 10:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=Bnvt4uB+ykF98uil9An+GGG7LFP5HOvHUpBlh5Y9YzI=; b=MCMGz3Uur7d2Ip84MyXYwZAI4PhQ4SswqiT36vcpmtKFwimys6+FvCmXjqMZPQ4CPB hHQq+mUE35GDyqP+WrLedcVz9fK1a4qXL3e6sz1YMwlaLIGRbamJ3hhx4bCckeLprLlW OkSDJhxK/KNTgWz1KQUEaQU69TAtNnX5C9fO0AQAq4kZmuR55M5XPZVU3vVgNE+R02ZD kkSbCL7vTGzRQSOoQWrAxPU3s09l4W5zd/CY9P8IpuZ1UsWzCpdn+FcK8LvUtVFpzm9Q TU8qKB59ZJBQhqQL/5C2RGbVu/ZxtU8ac7c+YDuS8IkHQGQ19iiOjGYJ/qVIVuVKh4C1 UUAQ== X-Received: by 10.70.52.33 with SMTP id q1mr2137725pdo.64.1418927479640; Thu, 18 Dec 2014 10:31:19 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:4965:32c9:fd93:5519? ([2601:8:ab80:7d6:4965:32c9:fd93:5519]) by mx.google.com with ESMTPSA id fm4sm7357831pdb.88.2014.12.18.10.31.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 10:31:18 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_F8ECA421-4576-4232-9E17-47EE44AC87E2"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r275909 - head From: Garrett Cooper In-Reply-To: <201412181826.sBIIQB0j006118@svn.freebsd.org> Date: Thu, 18 Dec 2014 10:31:18 -0800 Message-Id: References: <201412181826.sBIIQB0j006118@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 18:31:20 -0000 --Apple-Mail=_F8ECA421-4576-4232-9E17-47EE44AC87E2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Dec 18, 2014, at 10:26, Garrett Cooper wrote: > Author: ngie > Date: Thu Dec 18 18:26:10 2014 > New Revision: 275909 > URL: https://svnweb.freebsd.org/changeset/base/275909 >=20 > Log: > Don't build full clang toolchain or clang extras in stages 1-3 of = buildworld =85 > # cross-tools stage > XMAKE=3D TOOLS_PREFIX=3D${WORLDTMP} ${BMAKE} \ > @@ -1478,7 +1481,8 @@ NXBMAKE=3D ${NXBENV} ${MAKE} \ > MK_HTML=3Dno MK_INFO=3Dno NO_LINT=3Dyes MK_MAN=3Dno \ > -DNO_PIC MK_PROFILE=3Dno -DNO_SHARED \ > -DNO_CPU_CFLAGS MK_WARNS=3Dno MK_CTF=3Dno \ > - MK_CLANG_FULL=3Dno MK_LLDB=3Dno > + MK_CLANG_EXTRAS=3Dno MK_CLANG_FULL=3Dno \ > + MK_DEBUG_FILES=3Dno MK_LLDB=3Dno Before anyone else comments =85 I already fixed removed = MK_DEBUG_FILES=3Dno being added to NXBMAKE in r275910. --Apple-Mail=_F8ECA421-4576-4232-9E17-47EE44AC87E2 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 iQEcBAEBCgAGBQJUkx12AAoJEMZr5QU6S73etTQIAJFz9bPe1bJ/DnSlP5It1iXl hCkiSJRSM9R+UwcXu2PFpJkZT1Wjhqt4Hg2ZfmGTBHvjABtLw0bnwkv3MddNZgWd UKfrfdU87plXt99o39HMGXfeSP/R6SRC7dzHbBvxqKIipTxYIpuXktjkSM4f4fXD xxjKrOWT2Z8M6DDvk+Aub9uw/9U++WmDdIqVM/y629P570TRXNKs8iFZM0UibPN9 MTCPEAtqUf5cMKSwwtvIo60funLOhNJlVkU5ZOy8xK64ud7BqSPvMhcdtcNdSw37 dP+gbli7q8RZo6RE3Qv063FRILF2Il+umY0rsqlieQbtF6pqwj1ACR76qziXgl0= =hlCM -----END PGP SIGNATURE----- --Apple-Mail=_F8ECA421-4576-4232-9E17-47EE44AC87E2-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:59:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20A7722D; Thu, 18 Dec 2014 18:59:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0C5E62E20; Thu, 18 Dec 2014 18:59:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIIxRCw021059; Thu, 18 Dec 2014 18:59:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIIxRdG021057; Thu, 18 Dec 2014 18:59:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412181859.sBIIxRdG021057@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 18 Dec 2014 18:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275914 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 18:59:28 -0000 Author: delphij Date: Thu Dec 18 18:59:26 2014 New Revision: 275914 URL: https://svnweb.freebsd.org/changeset/base/275914 Log: 5422 preserve AVL invariants in dn_dbufs Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Josef 'Jeff' Sipek Reviewed by: Albert Lee Approved by: Dan McDonald Author: Alex Reece illumos/illumos-gate@a846f19d279fdfb0e0d63f78ccaf0205a88274d2 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Thu Dec 18 18:46:08 2014 (r275913) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Thu Dec 18 18:59:26 2014 (r275914) @@ -79,16 +79,14 @@ dbuf_compare(const void *x1, const void return (1); } - if (d1->db_state < d2->db_state) { + if (d1->db_state == DB_SEARCH) { + ASSERT3S(d2->db_state, !=, DB_SEARCH); return (-1); - } - if (d1->db_state > d2->db_state) { + } else if (d2->db_state == DB_SEARCH) { + ASSERT3S(d1->db_state, !=, DB_SEARCH); return (1); } - ASSERT3S(d1->db_state, !=, DB_SEARCH); - ASSERT3S(d2->db_state, !=, DB_SEARCH); - if ((uintptr_t)d1 < (uintptr_t)d2) { return (-1); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 19:10:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 126EF804; Thu, 18 Dec 2014 19:10:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F2F8E2F92; Thu, 18 Dec 2014 19:10:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIJA0Mb025956; Thu, 18 Dec 2014 19:10:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIJA0p8025955; Thu, 18 Dec 2014 19:10:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412181910.sBIJA0p8025955@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Dec 2014 19:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275916 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 19:10:01 -0000 Author: emaste Date: Thu Dec 18 19:09:59 2014 New Revision: 275916 URL: https://svnweb.freebsd.org/changeset/base/275916 Log: Include section name in strip warning message Modified: head/contrib/elftoolchain/elfcopy/sections.c Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Thu Dec 18 19:02:25 2014 (r275915) +++ head/contrib/elftoolchain/elfcopy/sections.c Thu Dec 18 19:09:59 2014 (r275916) @@ -762,8 +762,8 @@ resync_sections(struct elfcopy *ecp) s->off = roundup(off, s->align); } else { if (s->loadable) - warnx("moving loadable section," - "is this intentional?"); + warnx("moving loadable section %s, " + "is this intentional?", s->name); s->off = roundup(off, s->align); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 20:23:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A168521; Thu, 18 Dec 2014 20:23:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 60CD51C6A; Thu, 18 Dec 2014 20:23:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIKNLoJ063383; Thu, 18 Dec 2014 20:23:21 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIKNKvE063380; Thu, 18 Dec 2014 20:23:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412182023.sBIKNKvE063380@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 18 Dec 2014 20:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275918 - head/usr.bin/seq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 20:23:21 -0000 Author: delphij Date: Thu Dec 18 20:23:19 2014 New Revision: 275918 URL: https://svnweb.freebsd.org/changeset/base/275918 Log: Sync with NetBSD, mainly address NetBSD bug #43355: Fix valid_format() to be more careful about allowing only valid printf formats. Obtained from: NetBSD MFC after: 2 weeks Modified: head/usr.bin/seq/seq.1 head/usr.bin/seq/seq.c Modified: head/usr.bin/seq/seq.1 ============================================================================== --- head/usr.bin/seq/seq.1 Thu Dec 18 19:33:28 2014 (r275917) +++ head/usr.bin/seq/seq.1 Thu Dec 18 20:23:19 2014 (r275918) @@ -1,4 +1,4 @@ -.\" $NetBSD: seq.1,v 1.6 2008/11/26 15:03:47 ginsbach Exp $ +.\" $NetBSD: seq.1,v 1.8 2013/04/07 17:37:45 jdf Exp $ .\" .\" Copyright (c) 2005 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2010 +.Dd September 10, 2013 .Dt SEQ 1 .Os .Sh NAME @@ -59,7 +59,7 @@ as possible, in increments of When .Ar first is larger than -.Ar last +.Ar last , the default .Ar incr is -1. @@ -79,8 +79,11 @@ style .Ar format to print each number. Only the +.Cm A , +.Cm a , .Cm E , .Cm e , +.Cm F , .Cm f , .Cm G , .Cm g , Modified: head/usr.bin/seq/seq.c ============================================================================== --- head/usr.bin/seq/seq.c Thu Dec 18 19:33:28 2014 (r275917) +++ head/usr.bin/seq/seq.c Thu Dec 18 20:23:19 2014 (r275918) @@ -1,4 +1,4 @@ -/* $NetBSD: seq.c,v 1.5 2008/07/21 14:19:26 lukem Exp $ */ +/* $NetBSD: seq.c,v 1.7 2010/05/27 08:40:19 dholland Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation, Inc. * All rights reserved. @@ -158,6 +158,8 @@ main(int argc, char *argv[]) if (!valid_format(fmt)) errx(1, "invalid format string: `%s'", fmt); fmt = unescape(fmt); + if (!valid_format(fmt)) + errx(1, "invalid format string"); /* * XXX to be bug for bug compatible with Plan 9 add a * newline if none found at the end of the format string. @@ -225,39 +227,56 @@ numeric(const char *s) static int valid_format(const char *fmt) { - int conversions = 0; + unsigned conversions = 0; while (*fmt != '\0') { /* scan for conversions */ - if (*fmt != '\0' && *fmt != '%') { - do { - fmt++; - } while (*fmt != '\0' && *fmt != '%'); + if (*fmt != '%') { + fmt++; + continue; } - /* scan a conversion */ - if (*fmt != '\0') { - do { - fmt++; + fmt++; - /* ok %% */ - if (*fmt == '%') { - fmt++; - break; - } - /* valid conversions */ - if (strchr("eEfgG", *fmt) && - conversions++ < 1) { - fmt++; - break; - } - /* flags, width and precision */ - if (isdigit((unsigned char)*fmt) || - strchr("+- 0#.", *fmt)) - continue; + /* allow %% but not things like %10% */ + if (*fmt == '%') { + fmt++; + continue; + } - /* oops! bad conversion format! */ - return (0); - } while (*fmt != '\0'); + /* flags */ + while (*fmt != '\0' && strchr("#0- +'", *fmt)) { + fmt++; + } + + /* field width */ + while (*fmt != '\0' && strchr("0123456789", *fmt)) { + fmt++; + } + + /* precision */ + if (*fmt == '.') { + fmt++; + while (*fmt != '\0' && strchr("0123456789", *fmt)) { + fmt++; + } + } + + /* conversion */ + switch (*fmt) { + case 'A': + case 'a': + case 'E': + case 'e': + case 'F': + case 'f': + case 'G': + case 'g': + /* floating point formats are accepted */ + conversions++; + break; + default: + /* anything else is not */ + return 0; } } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 21:44:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0599D30C for ; Thu, 18 Dec 2014 21:44:52 +0000 (UTC) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B99DD2B81 for ; Thu, 18 Dec 2014 21:44:51 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id kx10so2213118pab.30 for ; Thu, 18 Dec 2014 13:44:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=from:content-type:mime-version:subject:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=f1J7Hxn2uJ4GShRjwhCZpH6jX2Z3Z7+ynzB3G5o7ZE0=; b=ql7dCDIniAswVOZfMjiDFx33jC3VE+AKW32hgdpPHd4wb+oeEVz1R6wHlr8JqvdFpy p4vQQEaOpd5x8BeLITnRsbHLqc+p4hW/omtupdTq8KiJjNy8WrLfb5fRL8EUtXcB0boq w6HixYJK/AXfxsRqT7tJ/sRJnNj0jl/KD4tXQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=f1J7Hxn2uJ4GShRjwhCZpH6jX2Z3Z7+ynzB3G5o7ZE0=; b=Fex4LLpju6cpQe6YxvHoT+cfuKsyOCxz4+pisJeDW/8wTj89wd2pJEH0a0TKbSdOhe T5x4KmtifOXcMUXpMXMOUC1P/HidcFLqy9pYbWEVGIjGSUm59VeMVBG3bCfOpmDgVv9Y Jpgr1RmbLSyBaC8Q/t8+qKFUN3q4CZviCQJt7HwQ5S152iksJLc/Qi5V0Teegt8ikPvS nq7D7dil1JbOqDr6XKbvd8uaPyFtF7GoIHioISiQ0SzNKLfPynJOpO3qaas9iLS8Luev t8IGQznkAM+mOVp7m9S39xjxFFer1DsJ1UEpyQjjZqZYSuMseXqjnRjJZFblnZS8jQsu fOoQ== X-Gm-Message-State: ALoCoQmpW/ULf5P2z4TP2TW2pGtvUtU/s40/+r+sYuaX72LXFklae1yAxdFWwLFmPMZXTJlP+0JY X-Received: by 10.66.222.42 with SMTP id qj10mr7027782pac.47.1418939091232; Thu, 18 Dec 2014 13:44:51 -0800 (PST) Received: from [10.64.25.114] ([69.53.236.236]) by mx.google.com with ESMTPSA id f4sm7588909pdk.87.2014.12.18.13.44.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 13:44:50 -0800 (PST) From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src In-Reply-To: <20141217211654.GA95193@troutmask.apl.washington.edu> Date: Thu, 18 Dec 2014 14:44:47 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <18504F2A-72C1-4962-86E6-CCAE4898B478@gmail.com> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> <20141217211654.GA95193@troutmask.apl.washington.edu> To: Steve Kargl X-Mailer: Apple Mail (2.1993) Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric , svn-src-head@freebsd.org, Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 21:44:52 -0000 > On Dec 17, 2014, at 2:16 PM, Steve Kargl = wrote: >=20 >=20 > Ed's diff is ~1000 lines and touches several files. Localizing > the change to math_private.h would have been a ~20 line > diff to a single file. Then just back his change out, put yours in and we all win. This seems = like ample =E2=80=9Cthis is better=E2=80=9D justification to me. While there = is a little more churn, external trackers will apply then unapply the churn, resulting in a net win. = Especially if you do the blackout as one commit and the better fix as another, which means = external trackers can just skip the two commits of churn with little effort on = their part. Warner From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 22:15:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BEDD94E; Thu, 18 Dec 2014 22:15:19 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15A862F73; Thu, 18 Dec 2014 22:15:19 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id ex7so107904wid.9; Thu, 18 Dec 2014 14:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=zvreUWlO4plXJa3aHJ/nQtCCq5N/Ytxdf/Yxo2PnkJ8=; b=usUd8hZ5pmMhB5sEKte7/eDBIOkAqYrYaIRG7LiLmyiHhGBkJDQKRZbaeFdSL1Hiev sIkyjO4mOyspC9KMASZvahiaSnwFEriVg930+EgCbrSY2sEjKcnZ3Tc8gTzfrau+cR9L 5wt98oLfPUvAQhD57JmAyY2U3/ijBo3Wnrt5CmfoIIxsXZsM94OtKgqIj3kQVMopAh4+ lENnh+R3AJ6B3MYrl2OkSiLGp3HHTkobw/j8arg/+karUFE6SUadIRRAANkeyZDA7dKq ONqQLaRbmWpgz3jUyAtWgzN0MJQk9OhMb+EP6Kcp0MO2DqPojzPRTS26GOi/hxWTMeFE 9JxA== MIME-Version: 1.0 X-Received: by 10.180.7.198 with SMTP id l6mr62131wia.26.1418940917209; Thu, 18 Dec 2014 14:15:17 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.195 with HTTP; Thu, 18 Dec 2014 14:15:17 -0800 (PST) In-Reply-To: <18504F2A-72C1-4962-86E6-CCAE4898B478@gmail.com> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> <20141217211654.GA95193@troutmask.apl.washington.edu> <18504F2A-72C1-4962-86E6-CCAE4898B478@gmail.com> Date: Thu, 18 Dec 2014 14:15:17 -0800 X-Google-Sender-Auth: yTwglBbDqG-xUQi03xCy28xoPqA Message-ID: Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Dimitry Andric , Steve Kargl , "svn-src-head@freebsd.org" , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 22:15:19 -0000 On 18 December 2014 at 13:44, Warner Losh wrote: > >> On Dec 17, 2014, at 2:16 PM, Steve Kargl wrote: >> >> >> Ed's diff is ~1000 lines and touches several files. Localizing >> the change to math_private.h would have been a ~20 line >> diff to a single file. > > Then just back his change out, put yours in and we all win. This seems li= ke > ample =E2=80=9Cthis is better=E2=80=9D justification to me. While there i= s a little more churn, external > trackers will apply then unapply the churn, resulting in a net win. Espec= ially if you > do the blackout as one commit and the better fix as another, which means = external > trackers can just skip the two commits of churn with little effort on the= ir part. +1 And although the initial source stuff was a bit of a debate, I'm glad that it led to a much cleaner looking long term solution. -adrian From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 22:32:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1799AE81; Thu, 18 Dec 2014 22:32:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 032BE1214; Thu, 18 Dec 2014 22:32:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIMWN18025134; Thu, 18 Dec 2014 22:32:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIMWMeJ025130; Thu, 18 Dec 2014 22:32:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412182232.sBIMWMeJ025130@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 22:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275920 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 22:32:24 -0000 Author: mav Date: Thu Dec 18 22:32:22 2014 New Revision: 275920 URL: https://svnweb.freebsd.org/changeset/base/275920 Log: Pass real optimal transfer size supported by backend. For files and ZVOLs that is 1MB now, not 128K. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Dec 18 21:22:23 2014 (r275919) +++ head/sys/cam/ctl/ctl.c Thu Dec 18 22:32:22 2014 (r275920) @@ -10142,7 +10142,7 @@ ctl_inquiry_evpd_block_limits(struct ctl scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len); if (lun != NULL) { bs = lun->be_lun->blocksize; - scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len); + scsi_ulto4b(lun->be_lun->opttxferlen, bl_ptr->opt_txfer_len); if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Thu Dec 18 21:22:23 2014 (r275919) +++ head/sys/cam/ctl/ctl_backend.h Thu Dec 18 22:32:22 2014 (r275920) @@ -146,10 +146,16 @@ typedef void (*be_lun_config_t)(void *be * * pblockexp is the log2() of number of LBAs on the LUN per physical sector. * - * pblockoff is the lowest LBA on the LUN aligned ot physical sector. + * pblockoff is the lowest LBA on the LUN aligned to physical sector. + * + * ublockexp is the log2() of number of LBAs on the LUN per UNMAP block. + * + * ublockoff is the lowest LBA on the LUN aligned to UNMAP block. * * atomicblock is the number of blocks that can be written atomically. * + * opttxferlen is the number of blocks that can be written in one operation. + * * req_lun_id is the requested LUN ID. CTL only pays attention to this * field if the CTL_LUN_FLAG_ID_REQ flag is set. If the requested LUN ID is * not available, the LUN addition will fail. If a particular LUN ID isn't @@ -197,6 +203,7 @@ struct ctl_be_lun { uint16_t ublockexp; /* passed to CTL */ uint16_t ublockoff; /* passed to CTL */ uint32_t atomicblock; /* passed to CTL */ + uint32_t opttxferlen; /* passed to CTL */ uint32_t req_lun_id; /* passed to CTL */ uint32_t lun_id; /* returned from CTL */ uint8_t serial_num[CTL_SN_LEN]; /* passed to CTL */ Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 21:22:23 2014 (r275919) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 22:32:22 2014 (r275920) @@ -175,6 +175,8 @@ struct ctl_be_block_lun { uint16_t pblockoff; uint16_t ublockexp; uint16_t ublockoff; + uint32_t atomicblock; + uint32_t opttxferlen; struct ctl_be_block_softc *softc; struct devstat *disk_stats; ctl_be_block_lun_flags flags; @@ -1845,6 +1847,8 @@ ctl_be_block_open_file(struct ctl_be_blo "file %s size %ju < block size %u", be_lun->dev_path, (uintmax_t)be_lun->size_bytes, be_lun->blocksize); } + + be_lun->opttxferlen = CTLBLK_MAX_IO_SIZE / be_lun->blocksize; return (error); } @@ -1856,7 +1860,7 @@ ctl_be_block_open_dev(struct ctl_be_bloc struct cdev *dev; struct cdevsw *devsw; char *value; - int error; + int error, atomic, maxio; off_t ps, pss, po, pos, us, uss, uo, uos; params = &be_lun->params; @@ -1870,8 +1874,16 @@ ctl_be_block_open_dev(struct ctl_be_bloc if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) { be_lun->dispatch = ctl_be_block_dispatch_zvol; be_lun->get_lba_status = ctl_be_block_gls_zvol; - } else + atomic = maxio = CTLBLK_MAX_IO_SIZE; + } else { be_lun->dispatch = ctl_be_block_dispatch_dev; + atomic = 0; + maxio = be_lun->backend.dev.cdev->si_iosize_max; + if (maxio <= 0) + maxio = DFLTPHYS; + if (maxio > CTLBLK_MAX_IO_SIZE) + maxio = CTLBLK_MAX_IO_SIZE; + } be_lun->lun_flush = ctl_be_block_flush_dev; be_lun->unmap = ctl_be_block_unmap_dev; be_lun->getattr = ctl_be_block_getattr_dev; @@ -2002,6 +2014,8 @@ ctl_be_block_open_dev(struct ctl_be_bloc be_lun->ublockoff = (uss - uos) % uss; } + be_lun->atomicblock = atomic / be_lun->blocksize; + be_lun->opttxferlen = maxio / be_lun->blocksize; return (0); } @@ -2268,10 +2282,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.pblockoff = be_lun->pblockoff; be_lun->ctl_be_lun.ublockexp = be_lun->ublockexp; be_lun->ctl_be_lun.ublockoff = be_lun->ublockoff; - if (be_lun->dispatch == ctl_be_block_dispatch_zvol && - be_lun->blocksize != 0) - be_lun->ctl_be_lun.atomicblock = CTLBLK_MAX_IO_SIZE / - be_lun->blocksize; + be_lun->ctl_be_lun.atomicblock = be_lun->atomicblock; + be_lun->ctl_be_lun.opttxferlen = be_lun->opttxferlen; /* Tell the user the blocksize we ended up using */ params->lun_size_bytes = be_lun->size_bytes; params->blocksize_bytes = be_lun->blocksize; @@ -2649,10 +2661,8 @@ ctl_be_block_modify(struct ctl_be_block_ be_lun->ctl_be_lun.pblockoff = be_lun->pblockoff; be_lun->ctl_be_lun.ublockexp = be_lun->ublockexp; be_lun->ctl_be_lun.ublockoff = be_lun->ublockoff; - if (be_lun->dispatch == ctl_be_block_dispatch_zvol && - be_lun->blocksize != 0) - be_lun->ctl_be_lun.atomicblock = CTLBLK_MAX_IO_SIZE / - be_lun->blocksize; + be_lun->ctl_be_lun.atomicblock = be_lun->atomicblock; + be_lun->ctl_be_lun.opttxferlen = be_lun->opttxferlen; ctl_lun_capacity_changed(&be_lun->ctl_be_lun); if (oldsize == 0 && be_lun->size_blocks != 0) ctl_lun_online(&be_lun->ctl_be_lun); Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 21:22:23 2014 (r275919) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 22:32:22 2014 (r275920) @@ -597,6 +597,7 @@ ctl_backend_ramdisk_create(struct ctl_be if (unmap) be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; be_lun->ctl_be_lun.atomicblock = UINT32_MAX; + be_lun->ctl_be_lun.opttxferlen = softc->rd_size / blocksize; be_lun->ctl_be_lun.be_lun = be_lun; if (params->flags & CTL_LUN_FLAG_ID_REQ) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 23:00:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 802A99A8; Thu, 18 Dec 2014 23:00:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6BBC31719; Thu, 18 Dec 2014 23:00:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIN0Ink038577; Thu, 18 Dec 2014 23:00:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIN0Iig038576; Thu, 18 Dec 2014 23:00:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412182300.sBIN0Iig038576@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Dec 2014 23:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275921 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 23:00:18 -0000 Author: jhb Date: Thu Dec 18 23:00:17 2014 New Revision: 275921 URL: https://svnweb.freebsd.org/changeset/base/275921 Log: MFC 273871: Skip the smap sysctl instead of panicing if no kernel metadata can be found. Modified: stable/10/sys/i386/i386/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Thu Dec 18 22:32:22 2014 (r275920) +++ stable/10/sys/i386/i386/machdep.c Thu Dec 18 23:00:17 2014 (r275921) @@ -3117,6 +3117,8 @@ smap_sysctl_handler(SYSCTL_HANDLER_ARGS) kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf32 kernel"); + if (kmdp == NULL) + return (0); smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 23:45:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F257923B; Thu, 18 Dec 2014 23:45:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C3F771DB5; Thu, 18 Dec 2014 23:45:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBINjRUt061282; Thu, 18 Dec 2014 23:45:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBINjR53061281; Thu, 18 Dec 2014 23:45:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412182345.sBINjR53061281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 18 Dec 2014 23:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275922 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 23:45:28 -0000 Author: delphij Date: Thu Dec 18 23:45:26 2014 New Revision: 275922 URL: https://svnweb.freebsd.org/changeset/base/275922 Log: MFV r275914: As of r270383, the dbuf_compare comparator compares the dbuf attributes in the following order: db_level (indirect level) db_blkid (block number) db_state (current state) the address of the element Because db_state is being considered before the element's state, changing of db_state would affect balancedness of the AVL tree, even when the address of element compares differently. For instance, in dbuf_create, db_state may be altered after the node is inserted into the AVL tree and may break AVL tree balancedness. Instead of using db_state as a comparision critera (introduced in r270383), consider it only when we are doing a lookup, that is one of the two dbuf pointers contains DB_SEARCH. Illumos issue: 5422 preserve AVL invariants in dn_dbufs MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Dec 18 23:00:17 2014 (r275921) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Dec 18 23:45:26 2014 (r275922) @@ -81,16 +81,14 @@ dbuf_compare(const void *x1, const void return (1); } - if (d1->db_state < d2->db_state) { + if (d1->db_state == DB_SEARCH) { + ASSERT3S(d2->db_state, !=, DB_SEARCH); return (-1); - } - if (d1->db_state > d2->db_state) { + } else if (d2->db_state == DB_SEARCH) { + ASSERT3S(d1->db_state, !=, DB_SEARCH); return (1); } - ASSERT3S(d1->db_state, !=, DB_SEARCH); - ASSERT3S(d2->db_state, !=, DB_SEARCH); - if ((uintptr_t)d1 < (uintptr_t)d2) { return (-1); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 23:59:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E521C806; Thu, 18 Dec 2014 23:59:09 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BE0C71F32; Thu, 18 Dec 2014 23:59:09 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sBINx2e1001799 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Dec 2014 15:59:02 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sBINx2Vp001798; Thu, 18 Dec 2014 15:59:02 -0800 (PST) (envelope-from sgk) Date: Thu, 18 Dec 2014 15:59:02 -0800 From: Steve Kargl To: Warner Losh Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src Message-ID: <20141218235902.GA1590@troutmask.apl.washington.edu> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> <20141217211654.GA95193@troutmask.apl.washington.edu> <18504F2A-72C1-4962-86E6-CCAE4898B478@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18504F2A-72C1-4962-86E6-CCAE4898B478@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric , svn-src-head@freebsd.org, Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 23:59:10 -0000 On Thu, Dec 18, 2014 at 02:44:47PM -0700, Warner Losh wrote: > > > On Dec 17, 2014, at 2:16 PM, Steve Kargl wrote: > > > > > > Ed's diff is ~1000 lines and touches several files. Localizing > > the change to math_private.h would have been a ~20 line > > diff to a single file. > > Then just back his change out, put yours in and we all win. I had already written that I would not ask Ed to revert his change due to the excessive code churn. You may interpret this to mean that I will not unfix what was not needed to be fix to begin with. My only hope now is that Ed will fix the comment he inserted into math_private.h to properly note that the functions formerly known as cpack[fl] were written years before the C11 macros CMPLX[FL] existed. -- Steve From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 00:20:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5518FFFE; Fri, 19 Dec 2014 00:20:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4099223F9; Fri, 19 Dec 2014 00:20:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ0KUNd077990; Fri, 19 Dec 2014 00:20:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ0KUD5077989; Fri, 19 Dec 2014 00:20:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412190020.sBJ0KUD5077989@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 19 Dec 2014 00:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275923 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 00:20:30 -0000 Author: delphij Date: Fri Dec 19 00:20:29 2014 New Revision: 275923 URL: https://svnweb.freebsd.org/changeset/base/275923 Log: Add missing continue: we can't proceed further if the kernel does not panic with zfs_panic_recover. Illumos issue: 5438 zfs_blkptr_verify should continue after zfs_panic_recover Reported by: Coverity CID: 1232014 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Dec 18 23:45:26 2014 (r275922) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Dec 19 00:20:29 2014 (r275923) @@ -704,18 +704,20 @@ zfs_blkptr_verify(spa_t *spa, const blkp zfs_panic_recover("blkptr at %p DVA %u has invalid " "VDEV %llu", bp, i, (longlong_t)vdevid); + continue; } vdev_t *vd = spa->spa_root_vdev->vdev_child[vdevid]; if (vd == NULL) { zfs_panic_recover("blkptr at %p DVA %u has invalid " "VDEV %llu", bp, i, (longlong_t)vdevid); + continue; } if (vd->vdev_ops == &vdev_hole_ops) { zfs_panic_recover("blkptr at %p DVA %u has hole " "VDEV %llu", bp, i, (longlong_t)vdevid); - + continue; } if (vd->vdev_ops == &vdev_missing_ops) { /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 01:12:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D2E9A8D; Fri, 19 Dec 2014 01:12:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6EE4E2BF5; Fri, 19 Dec 2014 01:12:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ1COwg004320; Fri, 19 Dec 2014 01:12:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ1CN45004317; Fri, 19 Dec 2014 01:12:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412190112.sBJ1CN45004317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Dec 2014 01:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275925 - in head: sys/dev/iscsi usr.sbin/ctld usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 01:12:24 -0000 Author: mav Date: Fri Dec 19 01:12:22 2014 New Revision: 275925 URL: https://svnweb.freebsd.org/changeset/base/275925 Log: Slightly polish iSCSI parameters negotiation. MFC after: 1 week Modified: head/sys/dev/iscsi/iscsi.c head/usr.sbin/ctld/login.c head/usr.sbin/iscsid/login.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Dec 19 00:34:10 2014 (r275924) +++ head/sys/dev/iscsi/iscsi.c Fri Dec 19 01:12:22 2014 (r275925) @@ -2157,6 +2157,10 @@ iscsi_action_scsiio(struct iscsi_session ISCSI_SESSION_DEBUG(is, "len %zd -> %zd", len, is->is_first_burst_length); len = is->is_first_burst_length; } + if (len > is->is_max_data_segment_length) { + ISCSI_SESSION_DEBUG(is, "len %zd -> %zd", len, is->is_max_data_segment_length); + len = is->is_max_data_segment_length; + } error = icl_pdu_append_data(request, csio->data_ptr, len, M_NOWAIT); if (error != 0) { Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Fri Dec 19 00:34:10 2014 (r275924) +++ head/usr.sbin/ctld/login.c Fri Dec 19 01:12:22 2014 (r275925) @@ -558,7 +558,7 @@ login_negotiate_key(struct pdu *request, tmp = MAX_DATA_SEGMENT_LENGTH; } conn->conn_max_data_segment_length = tmp; - keys_add_int(response_keys, name, tmp); + keys_add_int(response_keys, name, MAX_DATA_SEGMENT_LENGTH); } else if (strcmp(name, "MaxBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) { Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Fri Dec 19 00:34:10 2014 (r275924) +++ head/usr.sbin/iscsid/login.c Fri Dec 19 01:12:22 2014 (r275925) @@ -388,6 +388,11 @@ login_negotiate_key(struct connection *c if (tmp <= 0) log_errx(1, "received invalid " "MaxRecvDataSegmentLength"); + if (tmp > ISCSI_MAX_DATA_SEGMENT_LENGTH) { + log_debugx("capping MaxRecvDataSegmentLength " + "from %d to %d", tmp, ISCSI_MAX_DATA_SEGMENT_LENGTH); + tmp = ISCSI_MAX_DATA_SEGMENT_LENGTH; + } conn->conn_max_data_segment_length = tmp; } else if (strcmp(name, "MaxBurstLength") == 0) { if (conn->conn_immediate_data) { @@ -451,10 +456,11 @@ login_negotiate(struct connection *conn) keys_add(request_keys, "ImmediateData", "Yes"); keys_add_int(request_keys, "MaxBurstLength", - ISCSI_MAX_DATA_SEGMENT_LENGTH); + 2 * ISCSI_MAX_DATA_SEGMENT_LENGTH); keys_add_int(request_keys, "FirstBurstLength", ISCSI_MAX_DATA_SEGMENT_LENGTH); keys_add(request_keys, "InitialR2T", "Yes"); + keys_add(request_keys, "MaxOutstandingR2T", "1"); } else { keys_add(request_keys, "HeaderDigest", "None"); keys_add(request_keys, "DataDigest", "None"); @@ -465,7 +471,6 @@ login_negotiate(struct connection *conn) keys_add(request_keys, "DefaultTime2Wait", "0"); keys_add(request_keys, "DefaultTime2Retain", "0"); keys_add(request_keys, "ErrorRecoveryLevel", "0"); - keys_add(request_keys, "MaxOutstandingR2T", "1"); keys_save(request_keys, request); keys_delete(request_keys); request_keys = NULL; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 01:13:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E348CBDE; Fri, 19 Dec 2014 01:13:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C3F782C07; Fri, 19 Dec 2014 01:13:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ1Dgo9004523; Fri, 19 Dec 2014 01:13:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ1DgnO004521; Fri, 19 Dec 2014 01:13:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412190113.sBJ1DgnO004521@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Dec 2014 01:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275926 - stable/10/sys/geom/raid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 01:13:43 -0000 Author: mav Date: Fri Dec 19 01:13:41 2014 New Revision: 275926 URL: https://svnweb.freebsd.org/changeset/base/275926 Log: MFC r275503: Avoid unneeded malloc/memcpy/free if there is no metadata on disk. Submitted by: Dmitry Luhtionov Modified: stable/10/sys/geom/raid/md_nvidia.c stable/10/sys/geom/raid/md_sii.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/10/sys/geom/raid/md_nvidia.c Fri Dec 19 01:12:22 2014 (r275925) +++ stable/10/sys/geom/raid/md_nvidia.c Fri Dec 19 01:13:41 2014 (r275926) @@ -256,23 +256,24 @@ nvidia_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct nvidia_raid_conf *)buf; /* Check if this is an NVIDIA RAID struct */ if (strncmp(meta->nvidia_id, NVIDIA_MAGIC, strlen(NVIDIA_MAGIC))) { G_RAID_DEBUG(1, "NVIDIA signature check failed on %s", pp->name); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } if (meta->config_size > 128 || meta->config_size < 30) { G_RAID_DEBUG(1, "NVIDIA metadata size looks wrong: %d", meta->config_size); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint32_t *)meta, Modified: stable/10/sys/geom/raid/md_sii.c ============================================================================== --- stable/10/sys/geom/raid/md_sii.c Fri Dec 19 01:12:22 2014 (r275925) +++ stable/10/sys/geom/raid/md_sii.c Fri Dec 19 01:13:41 2014 (r275926) @@ -277,15 +277,13 @@ sii_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct sii_raid_conf *)buf; /* Check vendor ID. */ if (meta->vendor_id != 0x1095) { G_RAID_DEBUG(1, "SiI vendor ID check failed on %s (0x%04x)", pp->name, meta->vendor_id); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } @@ -293,9 +291,12 @@ sii_meta_read(struct g_consumer *cp) if (meta->version_major != 2) { G_RAID_DEBUG(1, "SiI version check failed on %s (%d.%d)", pp->name, meta->version_major, meta->version_minor); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint16_t *)meta, i = 0; i <= 159; i++) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 01:14:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F0E6D29; Fri, 19 Dec 2014 01:14:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0FE022C37; Fri, 19 Dec 2014 01:14:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ1Eg6e004726; Fri, 19 Dec 2014 01:14:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ1Eg8T004721; Fri, 19 Dec 2014 01:14:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412190114.sBJ1Eg8T004721@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Dec 2014 01:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275927 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 01:14:43 -0000 Author: mav Date: Fri Dec 19 01:14:41 2014 New Revision: 275927 URL: https://svnweb.freebsd.org/changeset/base/275927 Log: MFC r275503: Avoid unneeded malloc/memcpy/free if there is no metadata on disk. Submitted by: Dmitry Luhtionov Modified: stable/9/sys/geom/raid/md_nvidia.c stable/9/sys/geom/raid/md_sii.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/9/sys/geom/raid/md_nvidia.c Fri Dec 19 01:13:41 2014 (r275926) +++ stable/9/sys/geom/raid/md_nvidia.c Fri Dec 19 01:14:41 2014 (r275927) @@ -256,23 +256,24 @@ nvidia_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct nvidia_raid_conf *)buf; /* Check if this is an NVIDIA RAID struct */ if (strncmp(meta->nvidia_id, NVIDIA_MAGIC, strlen(NVIDIA_MAGIC))) { G_RAID_DEBUG(1, "NVIDIA signature check failed on %s", pp->name); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } if (meta->config_size > 128 || meta->config_size < 30) { G_RAID_DEBUG(1, "NVIDIA metadata size looks wrong: %d", meta->config_size); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint32_t *)meta, Modified: stable/9/sys/geom/raid/md_sii.c ============================================================================== --- stable/9/sys/geom/raid/md_sii.c Fri Dec 19 01:13:41 2014 (r275926) +++ stable/9/sys/geom/raid/md_sii.c Fri Dec 19 01:14:41 2014 (r275927) @@ -277,15 +277,13 @@ sii_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct sii_raid_conf *)buf; /* Check vendor ID. */ if (meta->vendor_id != 0x1095) { G_RAID_DEBUG(1, "SiI vendor ID check failed on %s (0x%04x)", pp->name, meta->vendor_id); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } @@ -293,9 +291,12 @@ sii_meta_read(struct g_consumer *cp) if (meta->version_major != 2) { G_RAID_DEBUG(1, "SiI version check failed on %s (%d.%d)", pp->name, meta->version_major, meta->version_minor); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint16_t *)meta, i = 0; i <= 159; i++) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 01:40:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42C1D3E6; Fri, 19 Dec 2014 01:40:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2F6972F29; Fri, 19 Dec 2014 01:40:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ1e06m014898; Fri, 19 Dec 2014 01:40:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ1dxCu014892; Fri, 19 Dec 2014 01:39:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201412190139.sBJ1dxCu014892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 19 Dec 2014 01:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275928 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 01:40:00 -0000 Author: adrian Date: Fri Dec 19 01:39:58 2014 New Revision: 275928 URL: https://svnweb.freebsd.org/changeset/base/275928 Log: Make ieee80211_add_ssid() public. Some drivers use private copies of this. PR: kern/196116 Submitted by: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Dec 19 01:14:41 2014 (r275927) +++ head/sys/net80211/ieee80211_output.c Fri Dec 19 01:39:58 2014 (r275928) @@ -1702,7 +1702,7 @@ ieee80211_add_xrates(uint8_t *frm, const /* * Add an ssid element to a frame. */ -static uint8_t * +uint8_t * ieee80211_add_ssid(uint8_t *frm, const uint8_t *ssid, u_int len) { *frm++ = IEEE80211_ELEMID_SSID; Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Fri Dec 19 01:14:41 2014 (r275927) +++ head/sys/net80211/ieee80211_proto.h Fri Dec 19 01:39:58 2014 (r275928) @@ -149,6 +149,7 @@ struct mbuf *ieee80211_alloc_cts(struct uint8_t *ieee80211_add_rates(uint8_t *, const struct ieee80211_rateset *); uint8_t *ieee80211_add_xrates(uint8_t *, const struct ieee80211_rateset *); +uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); uint8_t *ieee80211_add_wpa(uint8_t *, const struct ieee80211vap *); uint8_t *ieee80211_add_rsn(uint8_t *, const struct ieee80211vap *); uint8_t *ieee80211_add_qos(uint8_t *, const struct ieee80211_node *); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 01:41:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98D1C57C; Fri, 19 Dec 2014 01:41:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 81EC82F57; Fri, 19 Dec 2014 01:41:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ1fqsm018614; Fri, 19 Dec 2014 01:41:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ1fqvx018613; Fri, 19 Dec 2014 01:41:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201412190141.sBJ1fqvx018613@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 19 Dec 2014 01:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275929 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 01:41:52 -0000 Author: adrian Date: Fri Dec 19 01:41:51 2014 New Revision: 275929 URL: https://svnweb.freebsd.org/changeset/base/275929 Log: Remove a private copy of ieee80211_add_ssid(). PR: kern/196116 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Dec 19 01:39:58 2014 (r275928) +++ head/sys/dev/iwn/if_iwn.c Fri Dec 19 01:41:51 2014 (r275929) @@ -279,7 +279,6 @@ static int iwn_send_btcoex(struct iwn_so static int iwn_send_advanced_btcoex(struct iwn_softc *); static int iwn5000_runtime_calib(struct iwn_softc *); static int iwn_config(struct iwn_softc *); -static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); static int iwn_scan(struct iwn_softc *, struct ieee80211vap *, struct ieee80211_scan_state *, struct ieee80211_channel *); static int iwn_auth(struct iwn_softc *, struct ieee80211vap *vap); @@ -6527,18 +6526,6 @@ iwn_config(struct iwn_softc *sc) return 0; } -/* - * Add an ssid element to a frame. - */ -static uint8_t * -ieee80211_add_ssid(uint8_t *frm, const uint8_t *ssid, u_int len) -{ - *frm++ = IEEE80211_ELEMID_SSID; - *frm++ = len; - memcpy(frm, ssid, len); - return frm + len; -} - static uint16_t iwn_get_active_dwell_time(struct iwn_softc *sc, struct ieee80211_channel *c, uint8_t n_probes) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 06:48:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73499C06; Fri, 19 Dec 2014 06:48:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5F6EE1290; Fri, 19 Dec 2014 06:48:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ6mmxA059709; Fri, 19 Dec 2014 06:48:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ6mmv5059708; Fri, 19 Dec 2014 06:48:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412190648.sBJ6mmv5059708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 19 Dec 2014 06:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275930 - head/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 06:48:48 -0000 Author: delphij Date: Fri Dec 19 06:48:47 2014 New Revision: 275930 URL: https://svnweb.freebsd.org/changeset/base/275930 Log: Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece) MFC after: 2 weeks Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Fri Dec 19 01:41:51 2014 (r275929) +++ head/lib/libc/regex/regcomp.c Fri Dec 19 06:48:47 2014 (r275930) @@ -1716,8 +1716,10 @@ computematchjumps(struct parse *p, struc } g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int)); - if (g->matchjump == NULL) /* Not a fatal error */ + if (g->matchjump == NULL) { /* Not a fatal error */ + free(pmatches); return; + } /* Set maximum possible jump for each character in the pattern */ for (mindex = 0; mindex < g->mlen; mindex++) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 06:51:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9EB2D85; Fri, 19 Dec 2014 06:51:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A5A531368; Fri, 19 Dec 2014 06:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ6p2QQ063422; Fri, 19 Dec 2014 06:51:02 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ6p2eQ063421; Fri, 19 Dec 2014 06:51:02 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201412190651.sBJ6p2eQ063421@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 19 Dec 2014 06:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275931 - head/sys/modules/cryptodev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 06:51:02 -0000 Author: lwhsu (ports committer) Date: Fri Dec 19 06:51:01 2014 New Revision: 275931 URL: https://svnweb.freebsd.org/changeset/base/275931 Log: Fix `make depend` in sys/modules Differential Revision: https://reviews.freebsd.org/D1338 Reviewed by: delphij Approved by: delphij Modified: head/sys/modules/cryptodev/Makefile Modified: head/sys/modules/cryptodev/Makefile ============================================================================== --- head/sys/modules/cryptodev/Makefile Fri Dec 19 06:48:47 2014 (r275930) +++ head/sys/modules/cryptodev/Makefile Fri Dec 19 06:51:01 2014 (r275931) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../opencrypto KMOD = cryptodev SRCS = cryptodev.c -SRCS += bus_if.h device_if.h opt_compat.h +SRCS += bus_if.h device_if.h opt_compat.h opt_kdtrace.h .include From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 09:34:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5845E2F1; Fri, 19 Dec 2014 09:34:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 439042E47; Fri, 19 Dec 2014 09:34:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ9YFmu037089; Fri, 19 Dec 2014 09:34:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ9YFJ6037088; Fri, 19 Dec 2014 09:34:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412190934.sBJ9YFJ6037088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Dec 2014 09:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275932 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 09:34:15 -0000 Author: kib Date: Fri Dec 19 09:34:14 2014 New Revision: 275932 URL: https://svnweb.freebsd.org/changeset/base/275932 Log: MFC r275727: For architectures where time_t is wide enough, in particular, 64bit platforms, avoid overflow after year 2038 in clock_ct_to_ts(). PR: 195868 Modified: stable/10/sys/kern/subr_clock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_clock.c ============================================================================== --- stable/10/sys/kern/subr_clock.c Fri Dec 19 06:51:01 2014 (r275931) +++ stable/10/sys/kern/subr_clock.c Fri Dec 19 09:34:14 2014 (r275932) @@ -133,7 +133,6 @@ print_ct(struct clocktime *ct) int clock_ct_to_ts(struct clocktime *ct, struct timespec *ts) { - time_t secs; int i, year, days; year = ct->year; @@ -167,11 +166,10 @@ clock_ct_to_ts(struct clocktime *ct, str days += days_in_month(year, i); days += (ct->day - 1); - /* Add hours, minutes, seconds. */ - secs = ((days * 24 + ct->hour) * 60 + ct->min) * 60 + ct->sec; - - ts->tv_sec = secs; + ts->tv_sec = (((time_t)days * 24 + ct->hour) * 60 + ct->min) * 60 + + ct->sec; ts->tv_nsec = ct->nsec; + if (ct_debug) printf(" = %ld.%09ld\n", (long)ts->tv_sec, (long)ts->tv_nsec); return (0); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 09:37:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D13DC5BF; Fri, 19 Dec 2014 09:37:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BCFA42EAD; Fri, 19 Dec 2014 09:37:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ9b096037522; Fri, 19 Dec 2014 09:37:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ9b0YB037521; Fri, 19 Dec 2014 09:37:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412190937.sBJ9b0YB037521@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Dec 2014 09:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275933 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 09:37:00 -0000 Author: kib Date: Fri Dec 19 09:36:59 2014 New Revision: 275933 URL: https://svnweb.freebsd.org/changeset/base/275933 Log: MFC r275833: The iret instruction may generate #np and #ss fault, besides #gp. When returning to usermode, the handler for that exceptions is also executed with wrong gs base. Handle all three possible faults in the same way, checking for iret fault, and performing full iret. Modified: stable/10/sys/amd64/amd64/exception.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/exception.S ============================================================================== --- stable/10/sys/amd64/amd64/exception.S Fri Dec 19 09:34:14 2014 (r275932) +++ stable/10/sys/amd64/amd64/exception.S Fri Dec 19 09:36:59 2014 (r275933) @@ -154,9 +154,13 @@ IDTVEC(xmm) IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) - TRAP_ERR(T_SEGNPFLT) + subq $TF_ERR,%rsp + movl $T_SEGNPFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(stk) - TRAP_ERR(T_STKFLT) + subq $TF_ERR,%rsp + movl $T_STKFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(align) TRAP_ERR(T_ALIGNFLT) @@ -319,6 +323,7 @@ IDTVEC(page) IDTVEC(prot) subq $TF_ERR,%rsp movl $T_PROTFLT,TF_TRAPNO(%rsp) +prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ leaq doreti_iret(%rip),%rdi From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 09:42:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01952813; Fri, 19 Dec 2014 09:42:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E129E2FAB; Fri, 19 Dec 2014 09:42:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ9gf5h041621; Fri, 19 Dec 2014 09:42:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ9gfUb041620; Fri, 19 Dec 2014 09:42:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412190942.sBJ9gfUb041620@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Dec 2014 09:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275934 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 09:42:42 -0000 Author: kib Date: Fri Dec 19 09:42:40 2014 New Revision: 275934 URL: https://svnweb.freebsd.org/changeset/base/275934 Log: MFC r275833: The iret instruction may generate #np and #ss fault, besides #gp. When returning to usermode, the handler for that exceptions is also executed with wrong gs base. Handle all three possible faults in the same way, checking for iret fault, and performing full iret. Modified: stable/9/sys/amd64/amd64/exception.S Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/exception.S ============================================================================== --- stable/9/sys/amd64/amd64/exception.S Fri Dec 19 09:36:59 2014 (r275933) +++ stable/9/sys/amd64/amd64/exception.S Fri Dec 19 09:42:40 2014 (r275934) @@ -154,9 +154,13 @@ IDTVEC(xmm) IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) - TRAP_ERR(T_SEGNPFLT) + subq $TF_ERR,%rsp + movl $T_SEGNPFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(stk) - TRAP_ERR(T_STKFLT) + subq $TF_ERR,%rsp + movl $T_STKFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(align) TRAP_ERR(T_ALIGNFLT) @@ -319,6 +323,7 @@ IDTVEC(page) IDTVEC(prot) subq $TF_ERR,%rsp movl $T_PROTFLT,TF_TRAPNO(%rsp) +prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ leaq doreti_iret(%rip),%rdi From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 09:52:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E78BEA6E; Fri, 19 Dec 2014 09:52:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D2C9310F1; Fri, 19 Dec 2014 09:52:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJ9qMJg046291; Fri, 19 Dec 2014 09:52:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ9qMr2046290; Fri, 19 Dec 2014 09:52:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412190952.sBJ9qMr2046290@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Dec 2014 09:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r275935 - stable/8/sys/amd64/amd64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 09:52:23 -0000 Author: kib Date: Fri Dec 19 09:52:21 2014 New Revision: 275935 URL: https://svnweb.freebsd.org/changeset/base/275935 Log: MFC r275833: The iret instruction may generate #np and #ss fault, besides #gp. When returning to usermode, the handler for that exceptions is also executed with wrong gs base. Handle all three possible faults in the same way, checking for iret fault, and performing full iret. Modified: stable/8/sys/amd64/amd64/exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) Modified: stable/8/sys/amd64/amd64/exception.S ============================================================================== --- stable/8/sys/amd64/amd64/exception.S Fri Dec 19 09:42:40 2014 (r275934) +++ stable/8/sys/amd64/amd64/exception.S Fri Dec 19 09:52:21 2014 (r275935) @@ -150,9 +150,13 @@ IDTVEC(xmm) IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) - TRAP_ERR(T_SEGNPFLT) + subq $TF_ERR,%rsp + movl $T_SEGNPFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(stk) - TRAP_ERR(T_STKFLT) + subq $TF_ERR,%rsp + movl $T_STKFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(align) TRAP_ERR(T_ALIGNFLT) @@ -315,6 +319,7 @@ IDTVEC(page) IDTVEC(prot) subq $TF_ERR,%rsp movl $T_PROTFLT,TF_TRAPNO(%rsp) +prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ leaq doreti_iret(%rip),%rdi From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 12:09:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE9002A4; Fri, 19 Dec 2014 12:09:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9ABCD28FC; Fri, 19 Dec 2014 12:09:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJC9Ux2007327; Fri, 19 Dec 2014 12:09:30 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJC9Ujt007326; Fri, 19 Dec 2014 12:09:30 GMT (envelope-from br@FreeBSD.org) Message-Id: <201412191209.sBJC9Ujt007326@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 19 Dec 2014 12:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275936 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 12:09:30 -0000 Author: br Date: Fri Dec 19 12:09:29 2014 New Revision: 275936 URL: https://svnweb.freebsd.org/changeset/base/275936 Log: Correct the end address of the memory regions. Pointed out by: ian Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Fri Dec 19 09:52:21 2014 (r275935) +++ head/sys/mips/beri/beri_machdep.c Fri Dec 19 12:09:29 2014 (r275936) @@ -117,13 +117,13 @@ mips_init(void) ("First region is not within FDT memory range")); /* Limit size of the first region */ - phys_avail[1] = MIN(mr[0].mr_size, ctob(realmem)); + phys_avail[1] = (mr[0].mr_start + MIN(mr[0].mr_size, ctob(realmem))); dump_avail[1] = phys_avail[1]; /* Add the rest of regions */ for (i = 1, j = 2; i < mr_cnt; i++, j+=2) { phys_avail[j] = mr[i].mr_start; - phys_avail[j+1] = mr[i].mr_size; + phys_avail[j+1] = (mr[i].mr_start + mr[i].mr_size); dump_avail[j] = phys_avail[j]; dump_avail[j+1] = phys_avail[j+1]; } From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 13:07:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 993D4C65; Fri, 19 Dec 2014 13:07:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 851A612DB; Fri, 19 Dec 2014 13:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJD7bWV035354; Fri, 19 Dec 2014 13:07:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJD7bfh035353; Fri, 19 Dec 2014 13:07:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412191307.sBJD7bfh035353@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 19 Dec 2014 13:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275937 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 13:07:37 -0000 Author: andrew Date: Fri Dec 19 13:07:36 2014 New Revision: 275937 URL: https://svnweb.freebsd.org/changeset/base/275937 Log: Add support for empty ranges properties within the tree, some vendor device trees have these, for example the ARM AArch64 Foundation Model. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Fri Dec 19 12:09:29 2014 (r275936) +++ head/sys/dev/fdt/fdt_common.c Fri Dec 19 13:07:36 2014 (r275937) @@ -75,6 +75,12 @@ fdt_get_range_by_busaddr(phandle_t node, u_long bus_addr, par_bus_addr, pbase, psize; int err, i, len, tuple_size, tuples; + if (node == 0) { + *base = 0; + *size = ULONG_MAX; + return (0); + } + if ((fdt_addrsize_cells(node, &addr_cells, &size_cells)) != 0) return (ENXIO); /* @@ -91,9 +97,8 @@ fdt_get_range_by_busaddr(phandle_t node, if (len > sizeof(ranges)) return (ENOMEM); if (len == 0) { - *base = 0; - *size = ULONG_MAX; - return (0); + return (fdt_get_range_by_busaddr(OF_parent(node), addr, + base, size)); } if (OF_getprop(node, "ranges", ranges, sizeof(ranges)) <= 0) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 13:22:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0360D34F; Fri, 19 Dec 2014 13:22:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E2D5715CA; Fri, 19 Dec 2014 13:22:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJDM3ae044510; Fri, 19 Dec 2014 13:22:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJDM3PL044509; Fri, 19 Dec 2014 13:22:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412191322.sBJDM3PL044509@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Dec 2014 13:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275938 - stable/10/usr.sbin/syslogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 13:22:04 -0000 Author: ae Date: Fri Dec 19 13:22:02 2014 New Revision: 275938 URL: https://svnweb.freebsd.org/changeset/base/275938 Log: MFC r275729: Increase the buffer size to keep the list of programm names when parsing programm specification. It is safe to not check out of bounds access, because !isprint(p[i]) check will stop reading, when '\0' character will be read from the input string. Sponsored by: Yandex LLC Modified: stable/10/usr.sbin/syslogd/syslogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/10/usr.sbin/syslogd/syslogd.c Fri Dec 19 13:07:36 2014 (r275937) +++ stable/10/usr.sbin/syslogd/syslogd.c Fri Dec 19 13:22:02 2014 (r275938) @@ -1542,7 +1542,7 @@ init(int signo) struct filed *f, *next, **nextp; char *p; char cline[LINE_MAX]; - char prog[NAME_MAX+1]; + char prog[LINE_MAX]; char host[MAXHOSTNAMELEN]; char oldLocalHostName[MAXHOSTNAMELEN]; char hostMsg[2*MAXHOSTNAMELEN+40]; @@ -1664,7 +1664,7 @@ init(int signo) (void)strlcpy(prog, "*", sizeof(prog)); continue; } - for (i = 0; i < NAME_MAX; i++) { + for (i = 0; i < LINE_MAX - 1; i++) { if (!isprint(p[i]) || isspace(p[i])) break; prog[i] = p[i]; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 13:24:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DBB34A9; Fri, 19 Dec 2014 13:24:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 78CF615F9; Fri, 19 Dec 2014 13:24:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJDOrBY044884; Fri, 19 Dec 2014 13:24:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJDOroo044883; Fri, 19 Dec 2014 13:24:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412191324.sBJDOroo044883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Dec 2014 13:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275939 - stable/9/usr.sbin/syslogd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 13:24:53 -0000 Author: ae Date: Fri Dec 19 13:24:52 2014 New Revision: 275939 URL: https://svnweb.freebsd.org/changeset/base/275939 Log: MFC r275729: Increase the buffer size to keep the list of programm names when parsing programm specification. It is safe to not check out of bounds access, because !isprint(p[i]) check will stop reading, when '\0' character will be read from the input string. Sponsored by: Yandex LLC Modified: stable/9/usr.sbin/syslogd/syslogd.c Directory Properties: stable/9/usr.sbin/syslogd/ (props changed) Modified: stable/9/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/9/usr.sbin/syslogd/syslogd.c Fri Dec 19 13:22:02 2014 (r275938) +++ stable/9/usr.sbin/syslogd/syslogd.c Fri Dec 19 13:24:52 2014 (r275939) @@ -1539,7 +1539,7 @@ init(int signo) struct filed *f, *next, **nextp; char *p; char cline[LINE_MAX]; - char prog[NAME_MAX+1]; + char prog[LINE_MAX]; char host[MAXHOSTNAMELEN]; char oldLocalHostName[MAXHOSTNAMELEN]; char hostMsg[2*MAXHOSTNAMELEN+40]; @@ -1661,7 +1661,7 @@ init(int signo) (void)strlcpy(prog, "*", sizeof(prog)); continue; } - for (i = 0; i < NAME_MAX; i++) { + for (i = 0; i < LINE_MAX - 1; i++) { if (!isprint(p[i]) || isspace(p[i])) break; prog[i] = p[i]; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 18:45:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C5C015D; Fri, 19 Dec 2014 18:45:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 83B67102C; Fri, 19 Dec 2014 18:45:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJIjrPA094875; Fri, 19 Dec 2014 18:45:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJIjrCe094874; Fri, 19 Dec 2014 18:45:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201412191845.sBJIjrCe094874@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Dec 2014 18:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275940 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 18:45:53 -0000 Author: imp Date: Fri Dec 19 18:45:52 2014 New Revision: 275940 URL: https://svnweb.freebsd.org/changeset/base/275940 Log: Bump the largest record we can cope with from 1k to 8k. Other users of the hints file don't have any real limits, and longer records will need to be written shortly. Modified: head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Fri Dec 19 13:24:52 2014 (r275939) +++ head/usr.sbin/kldxref/kldxref.c Fri Dec 19 18:45:52 2014 (r275940) @@ -53,7 +53,7 @@ #include "ef.h" -#define MAXRECSIZE 1024 +#define MAXRECSIZE 8192 #define check(val) if ((error = (val)) != 0) break static int dflag; /* do not create a hint file, only write on stdout */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 19:09:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4653AEE; Fri, 19 Dec 2014 19:09:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D082A1370; Fri, 19 Dec 2014 19:09:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJJ9N3O005440; Fri, 19 Dec 2014 19:09:23 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJJ9N60005439; Fri, 19 Dec 2014 19:09:23 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201412191909.sBJJ9N60005439@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Fri, 19 Dec 2014 19:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275941 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 19:09:24 -0000 Author: benno Date: Fri Dec 19 19:09:22 2014 New Revision: 275941 URL: https://svnweb.freebsd.org/changeset/base/275941 Log: Adjust the test of a KASSERT to better match the intent. This assertion was added in r246213 as a guard against corrupted mbufs arriving from drivers, the key distinguishing factor of said mbufs being that they had a negative length. Given we're in a while loop specifically designed to skip over zero-length mbufs, panicking on a zero-length mbuf seems incorrect. No objection from: kib Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Dec 19 18:45:52 2014 (r275940) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Dec 19 19:09:22 2014 (r275941) @@ -219,7 +219,8 @@ nfsm_mbufuio(struct nfsrv_descript *nd, } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); - KASSERT(len > 0, ("len %d", len)); + KASSERT(len >= 0, + ("len %d, corrupted mbuf?", len)); } xfer = (left > len) ? len : left; #ifdef notdef From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 20:35:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE4992C4; Fri, 19 Dec 2014 20:35:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 99DDC283D; Fri, 19 Dec 2014 20:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJKZ7qh047309; Fri, 19 Dec 2014 20:35:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJKZ7pM047307; Fri, 19 Dec 2014 20:35:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412192035.sBJKZ7pM047307@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Dec 2014 20:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275942 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 20:35:07 -0000 Author: mav Date: Fri Dec 19 20:35:06 2014 New Revision: 275942 URL: https://svnweb.freebsd.org/changeset/base/275942 Log: Reduce number of places where global control_softc is used. At some point we may want to have several CTL instances, and that is not really impossible. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.c head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_tpc.c head/sys/cam/ctl/ctl_tpc.h head/sys/cam/ctl/ctl_tpc_local.c head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Dec 19 19:09:22 2014 (r275941) +++ head/sys/cam/ctl/ctl.c Fri Dec 19 20:35:06 2014 (r275942) @@ -398,8 +398,8 @@ static int ctl_ioctl_fill_ooa(struct ctl struct ctl_ooa_entry *kern_entries); static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); -static uint32_t ctl_map_lun(int port_num, uint32_t lun); -static uint32_t ctl_map_lun_back(int port_num, uint32_t lun); +static uint32_t ctl_map_lun(struct ctl_softc *softc, int port_num, uint32_t lun); +static uint32_t ctl_map_lun_back(struct ctl_softc *softc, int port_num, uint32_t lun); static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, struct ctl_be_lun *be_lun, struct ctl_id target_id); static int ctl_free_lun(struct ctl_lun *lun); @@ -441,8 +441,7 @@ static ctl_action ctl_check_for_blockage static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io *starting_io); static int ctl_check_blocked(struct ctl_lun *lun); -static int ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, - struct ctl_lun *lun, +static int ctl_scsiio_lun_check(struct ctl_lun *lun, const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio); //static int ctl_check_rtr(union ctl_io *pending_io, struct ctl_softc *softc); @@ -609,12 +608,12 @@ ctl_isc_handler_finish_ser_only(struct c static void ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_event event, int param) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; union ctl_io *io; struct ctl_prio *presio; ctl_ha_status isc_status; - ctl_softc = control_softc; + softc = control_softc; io = NULL; @@ -640,7 +639,7 @@ ctl_isc_event_handler(ctl_ha_channel cha #if 0 printf("Serialize\n"); #endif - io = ctl_alloc_io_nowait(ctl_softc->othersc_pool); + io = ctl_alloc_io_nowait(softc->othersc_pool); if (io == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -672,7 +671,7 @@ ctl_isc_event_handler(ctl_ha_channel cha * * XXX KDM add another flag that is more specific. */ - if (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY) + if (softc->ha_mode == CTL_HA_MODE_SER_ONLY) io->io_hdr.flags |= CTL_FLAG_INT_COPY; io->io_hdr.nexus = msg_info.hdr.nexus; #if 0 @@ -686,7 +685,7 @@ ctl_isc_event_handler(ctl_ha_channel cha io->scsiio.tag_type = msg_info.scsi.tag_type; memcpy(io->scsiio.cdb, msg_info.scsi.cdb, CTL_MAX_CDBLEN); - if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) { + if (softc->ha_mode == CTL_HA_MODE_XFER) { const struct ctl_cmd_entry *entry; entry = ctl_get_cmd_entry(&io->scsiio, NULL); @@ -852,11 +851,11 @@ ctl_isc_event_handler(ctl_ha_channel cha * mode */ case CTL_MSG_FINISH_IO: - if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) - ctl_isc_handler_finish_xfer(ctl_softc, + if (softc->ha_mode == CTL_HA_MODE_XFER) + ctl_isc_handler_finish_xfer(softc, &msg_info); else - ctl_isc_handler_finish_ser_only(ctl_softc, + ctl_isc_handler_finish_ser_only(softc, &msg_info); break; @@ -886,7 +885,7 @@ ctl_isc_event_handler(ctl_ha_channel cha case CTL_MSG_MANAGE_TASKS: { struct ctl_taskio *taskio; taskio = (struct ctl_taskio *)ctl_alloc_io_nowait( - ctl_softc->othersc_pool); + softc->othersc_pool); if (taskio == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -915,7 +914,7 @@ ctl_isc_event_handler(ctl_ha_channel cha /* Persistent Reserve action which needs attention */ case CTL_MSG_PERS_ACTION: presio = (struct ctl_prio *)ctl_alloc_io_nowait( - ctl_softc->othersc_pool); + softc->othersc_pool); if (presio == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -1832,16 +1831,16 @@ bailout: static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; union ctl_ha_msg msg_info; struct ctl_lun *lun; int retval = 0; uint32_t targ_lun; - ctl_softc = control_softc; + softc = control_softc; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - lun = ctl_softc->ctl_luns[targ_lun]; + lun = softc->ctl_luns[targ_lun]; if (lun==NULL) { /* @@ -1886,7 +1885,7 @@ ctl_serialize_other_sc_cmd(struct ctl_sc break; case CTL_ACTION_PASS: case CTL_ACTION_SKIP: - if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) { + if (softc->ha_mode == CTL_HA_MODE_XFER) { ctsio->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR; ctl_enqueue_rtr((union ctl_io *)ctsio); } else { @@ -3602,11 +3601,11 @@ ctl_port_idx(int port_num) } static uint32_t -ctl_map_lun(int port_num, uint32_t lun_id) +ctl_map_lun(struct ctl_softc *softc, int port_num, uint32_t lun_id) { struct ctl_port *port; - port = control_softc->ctl_ports[ctl_port_idx(port_num)]; + port = softc->ctl_ports[ctl_port_idx(port_num)]; if (port == NULL) return (UINT32_MAX); if (port->lun_map == NULL) @@ -3615,12 +3614,12 @@ ctl_map_lun(int port_num, uint32_t lun_i } static uint32_t -ctl_map_lun_back(int port_num, uint32_t lun_id) +ctl_map_lun_back(struct ctl_softc *softc, int port_num, uint32_t lun_id) { struct ctl_port *port; uint32_t i; - port = control_softc->ctl_ports[ctl_port_idx(port_num)]; + port = softc->ctl_ports[ctl_port_idx(port_num)]; if (port->lun_map == NULL) return (lun_id); for (i = 0; i < CTL_MAX_LUNS; i++) { @@ -4777,25 +4776,25 @@ ctl_free_lun(struct ctl_lun *lun) static void ctl_create_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; - ctl_softc = control_softc; + softc = control_softc; /* * ctl_alloc_lun() should handle all potential failure cases. */ - ctl_alloc_lun(ctl_softc, NULL, be_lun, ctl_softc->target); + ctl_alloc_lun(softc, NULL, be_lun, softc->target); } int ctl_add_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc = control_softc; + struct ctl_softc *softc = control_softc; - mtx_lock(&ctl_softc->ctl_lock); - STAILQ_INSERT_TAIL(&ctl_softc->pending_lun_queue, be_lun, links); - mtx_unlock(&ctl_softc->ctl_lock); - wakeup(&ctl_softc->pending_lun_queue); + mtx_lock(&softc->ctl_lock); + STAILQ_INSERT_TAIL(&softc->pending_lun_queue, be_lun, links); + mtx_unlock(&softc->ctl_lock); + wakeup(&softc->pending_lun_queue); return (0); } @@ -4803,16 +4802,15 @@ ctl_add_lun(struct ctl_be_lun *be_lun) int ctl_enable_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_port *port, *nport; struct ctl_lun *lun; int retval; - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + softc = lun->ctl_softc; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); if ((lun->flags & CTL_LUN_DISABLED) == 0) { /* @@ -4820,13 +4818,13 @@ ctl_enable_lun(struct ctl_be_lun *be_lun * enabled? */ mtx_unlock(&lun->lun_lock); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (0); } lun->flags &= ~CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); - for (port = STAILQ_FIRST(&ctl_softc->port_list); port != NULL; port = nport) { + for (port = STAILQ_FIRST(&softc->port_list); port != NULL; port = nport) { nport = STAILQ_NEXT(port, links); /* @@ -4834,9 +4832,9 @@ ctl_enable_lun(struct ctl_be_lun *be_lun * This can lead to a callback into CTL (at least in the * case of the internal initiator frontend. */ - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); retval = port->lun_enable(port->targ_lun_arg, lun->target,lun->lun); - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); if (retval != 0) { printf("%s: FETD %s port %d returned error " "%d for lun_enable on target %ju lun %jd\n", @@ -4851,7 +4849,7 @@ ctl_enable_lun(struct ctl_be_lun *be_lun #endif } - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (0); } @@ -4859,27 +4857,26 @@ ctl_enable_lun(struct ctl_be_lun *be_lun int ctl_disable_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_port *port; struct ctl_lun *lun; int retval; - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + softc = lun->ctl_softc; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); if (lun->flags & CTL_LUN_DISABLED) { mtx_unlock(&lun->lun_lock); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (0); } lun->flags |= CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); - STAILQ_FOREACH(port, &ctl_softc->port_list, links) { - mtx_unlock(&ctl_softc->ctl_lock); + STAILQ_FOREACH(port, &softc->port_list, links) { + mtx_unlock(&softc->ctl_lock); /* * Drop the lock before we call the frontend's disable * routine, to avoid lock order reversals. @@ -4889,7 +4886,7 @@ ctl_disable_lun(struct ctl_be_lun *be_lu */ retval = port->lun_disable(port->targ_lun_arg, lun->target, lun->lun); - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); if (retval != 0) { printf("ctl_alloc_lun: FETD %s port %d returned error " "%d for lun_disable on target %ju lun %jd\n", @@ -4898,7 +4895,7 @@ ctl_disable_lun(struct ctl_be_lun *be_lu } } - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (0); } @@ -4906,80 +4903,55 @@ ctl_disable_lun(struct ctl_be_lun *be_lu int ctl_start_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_STOPPED; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_stop_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_STOPPED; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_lun_offline(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_OFFLINE; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_lun_online(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_OFFLINE; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_invalidate_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_lun *lun; - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + softc = lun->ctl_softc; mtx_lock(&lun->lun_lock); @@ -5002,9 +4974,9 @@ ctl_invalidate_lun(struct ctl_be_lun *be */ if (TAILQ_EMPTY(&lun->ooa_queue)) { mtx_unlock(&lun->lun_lock); - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); ctl_free_lun(lun); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); } else mtx_unlock(&lun->lun_lock); @@ -5014,32 +4986,22 @@ ctl_invalidate_lun(struct ctl_be_lun *be int ctl_lun_inoperable(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_INOPERABLE; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_lun_operable(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_INOPERABLE; mtx_unlock(&lun->lun_lock); - return (0); } @@ -5225,7 +5187,6 @@ int ctl_scsi_release(struct ctl_scsiio *ctsio) { int length, longid, thirdparty_id, resv_id; - struct ctl_softc *ctl_softc; struct ctl_lun *lun; uint32_t residx; @@ -5236,7 +5197,6 @@ ctl_scsi_release(struct ctl_scsiio *ctsi residx = ctl_get_resindex(&ctsio->io_hdr.nexus); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; switch (ctsio->cdb[0]) { case RELEASE_10: { @@ -5313,7 +5273,6 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi int extent, thirdparty, longid; int resv_id, length; uint64_t thirdparty_id; - struct ctl_softc *ctl_softc; struct ctl_lun *lun; uint32_t residx; @@ -5328,7 +5287,6 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi residx = ctl_get_resindex(&ctsio->io_hdr.nexus); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; switch (ctsio->cdb[0]) { case RESERVE_10: { @@ -5402,13 +5360,11 @@ ctl_start_stop(struct ctl_scsiio *ctsio) { struct scsi_start_stop_unit *cdb; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; int retval; CTL_DEBUG_PRINT(("ctl_start_stop\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; retval = 0; cdb = (struct scsi_start_stop_unit *)ctsio->cdb; @@ -5529,7 +5485,7 @@ int ctl_sync_cache(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; uint64_t starting_lba; uint32_t block_count; int retval; @@ -5537,7 +5493,7 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_sync_cache\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; + softc = lun->ctl_softc; retval = 0; switch (ctsio->cdb[0]) { @@ -5590,7 +5546,7 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) * CACHE command directly to the back end. */ mtx_lock(&lun->lun_lock); - if ((ctl_softc->flags & CTL_FLAG_REAL_SYNC) + if ((softc->flags & CTL_FLAG_REAL_SYNC) && (++(lun->sync_count) >= lun->sync_interval)) { lun->sync_count = 0; mtx_unlock(&lun->lun_lock); @@ -5611,13 +5567,11 @@ ctl_format(struct ctl_scsiio *ctsio) { struct scsi_format *cdb; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; int length, defect_list_len; CTL_DEBUG_PRINT(("ctl_format\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; cdb = (struct scsi_format *)ctsio->cdb; @@ -6075,7 +6029,6 @@ ctl_control_page_handler(struct ctl_scsi { struct scsi_control_page *current_cp, *saved_cp, *user_cp; struct ctl_lun *lun; - struct ctl_softc *softc; int set_ua; uint32_t initidx; @@ -6091,8 +6044,6 @@ ctl_control_page_handler(struct ctl_scsi (page_index->page_data + (page_index->page_len * CTL_PAGE_SAVED)); - softc = control_softc; - mtx_lock(&lun->lun_lock); if (((current_cp->rlec & SCP_DSENSE) == 0) && ((user_cp->rlec & SCP_DSENSE) != 0)) { @@ -7358,8 +7309,8 @@ ctl_report_tagret_port_groups(struct ctl CTL_DEBUG_PRINT(("ctl_report_tagret_port_groups\n")); cdb = (struct scsi_maintenance_in *)ctsio->cdb; - softc = control_softc; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + softc = lun->ctl_softc; retval = CTL_RETVAL_COMPLETE; @@ -7390,7 +7341,8 @@ ctl_report_tagret_port_groups(struct ctl STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_map_lun_back(port->targ_port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_map_lun_back(softc, port->targ_port, lun->lun) >= + CTL_MAX_LUNS) continue; num_target_ports++; } @@ -7463,8 +7415,8 @@ ctl_report_tagret_port_groups(struct ctl STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_map_lun_back(port->targ_port, lun->lun) >= - CTL_MAX_LUNS) + if (ctl_map_lun_back(softc, port->targ_port, lun->lun) + >= CTL_MAX_LUNS) continue; p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS; scsi_ulto2b(p, tpg_desc->descriptors[pc]. @@ -7756,13 +7708,12 @@ ctl_persistent_reserve_in(struct ctl_scs CTL_DEBUG_PRINT(("ctl_persistent_reserve_in\n")); - softc = control_softc; - cdb = (struct scsi_per_res_in *)ctsio->cdb; alloc_len = scsi_2btoul(cdb->length); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + softc = lun->ctl_softc; retry: mtx_lock(&lun->lun_lock); @@ -8385,10 +8336,9 @@ ctl_persistent_reserve_out(struct ctl_sc retval = CTL_RETVAL_COMPLETE; - softc = control_softc; - cdb = (struct scsi_per_res_out *)ctsio->cdb; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + softc = lun->ctl_softc; /* * We only support whole-LUN scope. The scope & type are ignored for @@ -9304,6 +9254,7 @@ ctl_verify(struct ctl_scsiio *ctsio) int ctl_report_luns(struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = control_softc; struct scsi_report_luns *cdb; struct scsi_report_luns_data *lun_data; struct ctl_lun *lun, *request_lun; @@ -9319,9 +9270,9 @@ ctl_report_luns(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_report_luns\n")); - mtx_lock(&control_softc->ctl_lock); - num_luns = control_softc->num_luns; - mtx_unlock(&control_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); + num_luns = softc->num_luns; + mtx_unlock(&softc->ctl_lock); switch (cdb->select_report) { case RPL_REPORT_DEFAULT: @@ -9373,12 +9324,13 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); - mtx_lock(&control_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { - lun_id = ctl_map_lun(ctsio->io_hdr.nexus.targ_port, targ_lun_id); + lun_id = ctl_map_lun(softc, ctsio->io_hdr.nexus.targ_port, + targ_lun_id); if (lun_id >= CTL_MAX_LUNS) continue; - lun = control_softc->ctl_luns[lun_id]; + lun = softc->ctl_luns[lun_id]; if (lun == NULL) continue; @@ -9434,7 +9386,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_unlock(&lun->lun_lock); } } - mtx_unlock(&control_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); /* * It's quite possible that we've returned fewer LUNs than we allocated @@ -9869,15 +9821,15 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio { struct scsi_vpd_device_id *devid_ptr; struct scsi_vpd_id_descriptor *desc; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_lun *lun; struct ctl_port *port; int data_len; uint8_t proto; - ctl_softc = control_softc; + softc = control_softc; - port = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; + port = softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; data_len = sizeof(struct scsi_vpd_device_id) + @@ -10011,7 +9963,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_map_lun_back(port->targ_port, lun->lun) >= + ctl_map_lun_back(softc, port->targ_port, lun->lun) >= CTL_MAX_LUNS) continue; num_target_ports++; @@ -10065,8 +10017,8 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_map_lun_back(port->targ_port, lun->lun) >= - CTL_MAX_LUNS) + ctl_map_lun_back(softc, port->targ_port, lun->lun) + >= CTL_MAX_LUNS) continue; p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS; scsi_ulto2b(p, pd->relative_port_id); @@ -10342,20 +10294,20 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio { struct scsi_inquiry_data *inq_ptr; struct scsi_inquiry *cdb; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_lun *lun; char *val; uint32_t alloc_len, data_len; ctl_port_type port_type; - ctl_softc = control_softc; + softc = control_softc; /* * Figure out whether we're talking to a Fibre Channel port or not. * We treat the ioctl front end, and any SCSI adapters, as packetized * SCSI front ends. */ - port_type = ctl_softc->ctl_ports[ + port_type = softc->ctl_ports[ ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]->port_type; if (port_type == CTL_PORT_IOCTL || port_type == CTL_PORT_INTERNAL) port_type = CTL_PORT_SCSI; @@ -10432,7 +10384,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio if (lun != NULL) inq_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | lun->be_lun->lun_type; - else if (ctl_softc->inquiry_pq_no_lun == 0) + else if (softc->inquiry_pq_no_lun == 0) inq_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; else inq_ptr->device = (SID_QUAL_BAD_LU << 5) | T_NODEVICE; @@ -11065,7 +11017,6 @@ ctl_check_blocked(struct ctl_lun *lun) break; case CTL_ACTION_PASS: case CTL_ACTION_SKIP: { - struct ctl_softc *softc; const struct ctl_cmd_entry *entry; int isc_retval; @@ -11104,7 +11055,6 @@ ctl_check_blocked(struct ctl_lun *lun) break; } entry = ctl_get_cmd_entry(&cur_blocked->scsiio, NULL); - softc = control_softc; /* * Check this I/O for LUN state changes that may @@ -11114,7 +11064,7 @@ ctl_check_blocked(struct ctl_lun *lun) * for any states that can be caused by SCSI * commands. */ - if (ctl_scsiio_lun_check(softc, lun, entry, + if (ctl_scsiio_lun_check(lun, entry, &cur_blocked->scsiio) == 0) { cur_blocked->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR; @@ -11148,9 +11098,10 @@ ctl_check_blocked(struct ctl_lun *lun) * careful attention to the placement of any new checks. */ static int -ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, struct ctl_lun *lun, +ctl_scsiio_lun_check(struct ctl_lun *lun, const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = lun->ctl_softc; int retval; uint32_t residx; @@ -11162,7 +11113,7 @@ ctl_scsiio_lun_check(struct ctl_softc *c * If this shelf is a secondary shelf controller, we have to reject * any media access commands. */ - if ((ctl_softc->flags & CTL_FLAG_ACTIVE_SHELF) == 0 && + if ((softc->flags & CTL_FLAG_ACTIVE_SHELF) == 0 && (entry->flags & CTL_CMD_FLAG_OK_ON_SECONDARY) == 0) { ctl_set_lun_standby(ctsio); retval = 1; @@ -11268,14 +11219,14 @@ static void ctl_failover(void) { struct ctl_lun *lun; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; union ctl_io *next_io, *pending_io; union ctl_io *io; int lun_idx; - ctl_softc = control_softc; + softc = control_softc; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); /* * Remove any cmds from the other SC from the rtr queue. These * will obviously only be for LUNs for which we're the primary. @@ -11285,19 +11236,19 @@ ctl_failover(void) * which HA mode we're in. */ #ifdef notyet - mtx_lock(&ctl_softc->queue_lock); - for (io = (union ctl_io *)STAILQ_FIRST(&ctl_softc->rtr_queue); + mtx_lock(&softc->queue_lock); + for (io = (union ctl_io *)STAILQ_FIRST(&softc->rtr_queue); io != NULL; io = next_io) { next_io = (union ctl_io *)STAILQ_NEXT(&io->io_hdr, links); if (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) - STAILQ_REMOVE(&ctl_softc->rtr_queue, &io->io_hdr, + STAILQ_REMOVE(&softc->rtr_queue, &io->io_hdr, ctl_io_hdr, links); } - mtx_unlock(&ctl_softc->queue_lock); + mtx_unlock(&softc->queue_lock); #endif - for (lun_idx=0; lun_idx < ctl_softc->num_luns; lun_idx++) { - lun = ctl_softc->ctl_luns[lun_idx]; + for (lun_idx=0; lun_idx < softc->num_luns; lun_idx++) { + lun = softc->ctl_luns[lun_idx]; if (lun==NULL) continue; @@ -11309,7 +11260,7 @@ ctl_failover(void) continue; if ((lun->flags & CTL_LUN_PRIMARY_SC) - && (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { + && (softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { printf("FAILOVER: primary lun %d\n", lun_idx); /* * Remove all commands from the other SC. First from the @@ -11351,7 +11302,7 @@ ctl_failover(void) } ctl_check_blocked(lun); } else if ((lun->flags & CTL_LUN_PRIMARY_SC) - && (ctl_softc->ha_mode == CTL_HA_MODE_XFER)) { + && (softc->ha_mode == CTL_HA_MODE_XFER)) { printf("FAILOVER: primary lun %d\n", lun_idx); /* @@ -11369,7 +11320,7 @@ ctl_failover(void) io->io_hdr.flags |= CTL_FLAG_ABORT; } } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) - && (ctl_softc->ha_mode == CTL_HA_MODE_XFER)) { + && (softc->ha_mode == CTL_HA_MODE_XFER)) { printf("FAILOVER: secondary lun %d\n", lun_idx); @@ -11408,7 +11359,7 @@ ctl_failover(void) ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) - && (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { + && (softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { printf("FAILOVER: secondary lun %d\n", lun_idx); /* * if the first io on the OOA is not on the RtR queue @@ -11498,15 +11449,15 @@ ctl_failover(void) ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else { panic("Unhandled HA mode failover, LUN flags = %#x, " - "ha_mode = #%x", lun->flags, ctl_softc->ha_mode); + "ha_mode = #%x", lun->flags, softc->ha_mode); } } ctl_pause_rtr = 0; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); } static int -ctl_scsiio_precheck(struct ctl_softc *ctl_softc, struct ctl_scsiio *ctsio) +ctl_scsiio_precheck(struct ctl_softc *softc, struct ctl_scsiio *ctsio) { struct ctl_lun *lun; const struct ctl_cmd_entry *entry; @@ -11519,7 +11470,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; if ((targ_lun < CTL_MAX_LUNS) - && ((lun = ctl_softc->ctl_luns[targ_lun]) != NULL)) { + && ((lun = softc->ctl_luns[targ_lun]) != NULL)) { /* * If the LUN is invalid, pretend that it doesn't exist. * It will go away as soon as all pending I/O has been @@ -11651,7 +11602,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct } - if (ctl_scsiio_lun_check(ctl_softc, lun, entry, ctsio) != 0) { + if (ctl_scsiio_lun_check(lun, entry, ctsio) != 0) { mtx_unlock(&lun->lun_lock); ctl_done((union ctl_io *)ctsio); return (retval); @@ -11859,13 +11810,13 @@ bailout: * our single target. */ static int -ctl_bus_reset(struct ctl_softc *ctl_softc, union ctl_io *io) +ctl_bus_reset(struct ctl_softc *softc, union ctl_io *io) { - return(ctl_target_reset(ctl_softc, io, CTL_UA_BUS_RESET)); + return(ctl_target_reset(softc, io, CTL_UA_BUS_RESET)); } static int -ctl_target_reset(struct ctl_softc *ctl_softc, union ctl_io *io, +ctl_target_reset(struct ctl_softc *softc, union ctl_io *io, ctl_ua_type ua_type) { struct ctl_lun *lun; @@ -11889,10 +11840,10 @@ ctl_target_reset(struct ctl_softc *ctl_s } retval = 0; - mtx_lock(&ctl_softc->ctl_lock); - STAILQ_FOREACH(lun, &ctl_softc->lun_list, links) + mtx_lock(&softc->ctl_lock); + STAILQ_FOREACH(lun, &softc->lun_list, links) retval += ctl_lun_reset(lun, io, ua_type); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (retval); } @@ -12078,7 +12029,7 @@ ctl_abort_task(union ctl_io *io) { union ctl_io *xio; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; #if 0 struct sbuf sb; char printbuf[128]; @@ -12086,19 +12037,19 @@ ctl_abort_task(union ctl_io *io) int found; uint32_t targ_lun; - ctl_softc = control_softc; + softc = control_softc; found = 0; /* * Look up the LUN. */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); if ((targ_lun < CTL_MAX_LUNS) - && (ctl_softc->ctl_luns[targ_lun] != NULL)) - lun = ctl_softc->ctl_luns[targ_lun]; + && (softc->ctl_luns[targ_lun] != NULL)) + lun = softc->ctl_luns[targ_lun]; else { - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (1); } @@ -12108,7 +12059,7 @@ ctl_abort_task(union ctl_io *io) #endif mtx_lock(&lun->lun_lock); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); /* * Run through the OOA queue and attempt to find the given I/O. * The target port, initiator ID, tag type and tag number have to @@ -12224,7 +12175,7 @@ ctl_abort_task(union ctl_io *io) static void ctl_run_task(union ctl_io *io) { - struct ctl_softc *ctl_softc = control_softc; + struct ctl_softc *softc = control_softc; int retval = 1; const char *task_desc; @@ -12279,12 +12230,12 @@ ctl_run_task(union ctl_io *io) uint32_t targ_lun; targ_lun = io->io_hdr.nexus.targ_mapped_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); if ((targ_lun < CTL_MAX_LUNS) - && (ctl_softc->ctl_luns[targ_lun] != NULL)) - lun = ctl_softc->ctl_luns[targ_lun]; + && (softc->ctl_luns[targ_lun] != NULL)) + lun = softc->ctl_luns[targ_lun]; else { - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); retval = 1; break; } @@ -12311,14 +12262,14 @@ ctl_run_task(union ctl_io *io) retval = ctl_lun_reset(lun, io, CTL_UA_LUN_RESET); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); break; } case CTL_TASK_TARGET_RESET: - retval = ctl_target_reset(ctl_softc, io, CTL_UA_TARG_RESET); + retval = ctl_target_reset(softc, io, CTL_UA_TARG_RESET); break; case CTL_TASK_BUS_RESET: - retval = ctl_bus_reset(ctl_softc, io); + retval = ctl_bus_reset(softc, io); break; case CTL_TASK_PORT_LOGIN: break; @@ -12345,13 +12296,13 @@ ctl_handle_isc(union ctl_io *io) { int free_io; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 20:51:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34A1EA99; Fri, 19 Dec 2014 20:51:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 20EF52B44; Fri, 19 Dec 2014 20:51:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJKpu8D056259; Fri, 19 Dec 2014 20:51:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJKptKW056258; Fri, 19 Dec 2014 20:51:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412192051.sBJKptKW056258@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Dec 2014 20:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275943 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 20:51:56 -0000 Author: mav Date: Fri Dec 19 20:51:54 2014 New Revision: 275943 URL: https://svnweb.freebsd.org/changeset/base/275943 Log: Constify some static data. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Dec 19 20:35:06 2014 (r275942) +++ head/sys/cam/ctl/ctl.c Fri Dec 19 20:51:54 2014 (r275943) @@ -111,7 +111,7 @@ struct ctl_softc *control_softc = NULL; * Note that these are default values only. The actual values will be * filled in when the user does a mode sense. */ -static struct copan_debugconf_subpage debugconf_page_default = { +const static struct copan_debugconf_subpage debugconf_page_default = { DBGCNF_PAGE_CODE | SMPH_SPF, /* page_code */ DBGCNF_SUBPAGE_CODE, /* subpage */ {(sizeof(struct copan_debugconf_subpage) - 4) >> 8, @@ -121,7 +121,7 @@ static struct copan_debugconf_subpage de CTL_TIME_IO_DEFAULT_SECS>>0}, /* ctl_time_io_secs */ }; -static struct copan_debugconf_subpage debugconf_page_changeable = { +const static struct copan_debugconf_subpage debugconf_page_changeable = { DBGCNF_PAGE_CODE | SMPH_SPF, /* page_code */ DBGCNF_SUBPAGE_CODE, /* subpage */ {(sizeof(struct copan_debugconf_subpage) - 4) >> 8, @@ -130,7 +130,7 @@ static struct copan_debugconf_subpage de {0xff,0xff}, /* ctl_time_io_secs */ }; -static struct scsi_da_rw_recovery_page rw_er_page_default = { +const static struct scsi_da_rw_recovery_page rw_er_page_default = { /*page_code*/SMS_RW_ERROR_RECOVERY_PAGE, /*page_length*/sizeof(struct scsi_da_rw_recovery_page) - 2, /*byte3*/SMS_RWER_AWRE|SMS_RWER_ARRE, @@ -144,7 +144,7 @@ static struct scsi_da_rw_recovery_page r /*recovery_time_limit*/{0, 0}, }; -static struct scsi_da_rw_recovery_page rw_er_page_changeable = { +const static struct scsi_da_rw_recovery_page rw_er_page_changeable = { /*page_code*/SMS_RW_ERROR_RECOVERY_PAGE, /*page_length*/sizeof(struct scsi_da_rw_recovery_page) - 2, /*byte3*/0, @@ -158,7 +158,7 @@ static struct scsi_da_rw_recovery_page r /*recovery_time_limit*/{0, 0}, }; -static struct scsi_format_page format_page_default = { +const static struct scsi_format_page format_page_default = { /*page_code*/SMS_FORMAT_DEVICE_PAGE, /*page_length*/sizeof(struct scsi_format_page) - 2, /*tracks_per_zone*/ {0, 0}, @@ -175,7 +175,7 @@ static struct scsi_format_page format_pa /*reserved*/ {0, 0, 0} }; -static struct scsi_format_page format_page_changeable = { +const static struct scsi_format_page format_page_changeable = { /*page_code*/SMS_FORMAT_DEVICE_PAGE, /*page_length*/sizeof(struct scsi_format_page) - 2, /*tracks_per_zone*/ {0, 0}, @@ -191,7 +191,7 @@ static struct scsi_format_page format_pa /*reserved*/ {0, 0, 0} }; -static struct scsi_rigid_disk_page rigid_disk_page_default = { +const static struct scsi_rigid_disk_page rigid_disk_page_default = { /*page_code*/SMS_RIGID_DISK_PAGE, /*page_length*/sizeof(struct scsi_rigid_disk_page) - 2, /*cylinders*/ {0, 0, 0}, @@ -208,7 +208,7 @@ static struct scsi_rigid_disk_page rigid /*reserved2*/ {0, 0} }; -static struct scsi_rigid_disk_page rigid_disk_page_changeable = { +const static struct scsi_rigid_disk_page rigid_disk_page_changeable = { /*page_code*/SMS_RIGID_DISK_PAGE, /*page_length*/sizeof(struct scsi_rigid_disk_page) - 2, /*cylinders*/ {0, 0, 0}, @@ -224,7 +224,7 @@ static struct scsi_rigid_disk_page rigid /*reserved2*/ {0, 0} }; -static struct scsi_caching_page caching_page_default = { +const static struct scsi_caching_page caching_page_default = { /*page_code*/SMS_CACHING_PAGE, /*page_length*/sizeof(struct scsi_caching_page) - 2, /*flags1*/ SCP_DISC | SCP_WCE, @@ -240,7 +240,7 @@ static struct scsi_caching_page caching_ /*non_cache_seg_size*/ {0, 0, 0} }; -static struct scsi_caching_page caching_page_changeable = { +const static struct scsi_caching_page caching_page_changeable = { /*page_code*/SMS_CACHING_PAGE, /*page_length*/sizeof(struct scsi_caching_page) - 2, /*flags1*/ SCP_WCE | SCP_RCD, @@ -256,7 +256,7 @@ static struct scsi_caching_page caching_ /*non_cache_seg_size*/ {0, 0, 0} }; -static struct scsi_control_page control_page_default = { +const static struct scsi_control_page control_page_default = { /*page_code*/SMS_CONTROL_MODE_PAGE, /*page_length*/sizeof(struct scsi_control_page) - 2, /*rlec*/0, @@ -268,7 +268,7 @@ static struct scsi_control_page control_ /*extended_selftest_completion_time*/{0, 0} }; -static struct scsi_control_page control_page_changeable = { +const static struct scsi_control_page control_page_changeable = { /*page_code*/SMS_CONTROL_MODE_PAGE, /*page_length*/sizeof(struct scsi_control_page) - 2, /*rlec*/SCP_DSENSE, @@ -280,7 +280,7 @@ static struct scsi_control_page control_ /*extended_selftest_completion_time*/{0, 0} }; -static struct scsi_info_exceptions_page ie_page_default = { +const static struct scsi_info_exceptions_page ie_page_default = { /*page_code*/SMS_INFO_EXCEPTIONS_PAGE, /*page_length*/sizeof(struct scsi_info_exceptions_page) - 2, /*info_flags*/SIEP_FLAGS_DEXCPT, @@ -289,7 +289,7 @@ static struct scsi_info_exceptions_page /*report_count*/{0, 0, 0, 0} }; -static struct scsi_info_exceptions_page ie_page_changeable = { +const static struct scsi_info_exceptions_page ie_page_changeable = { /*page_code*/SMS_INFO_EXCEPTIONS_PAGE, /*page_length*/sizeof(struct scsi_info_exceptions_page) - 2, /*info_flags*/0, @@ -300,7 +300,7 @@ static struct scsi_info_exceptions_page #define CTL_LBPM_LEN (sizeof(struct ctl_logical_block_provisioning_page) - 4) -static struct ctl_logical_block_provisioning_page lbp_page_default = {{ +const static struct ctl_logical_block_provisioning_page lbp_page_default = {{ /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, /*subpage_code*/0x02, /*page_length*/{CTL_LBPM_LEN >> 8, CTL_LBPM_LEN}, @@ -326,7 +326,7 @@ static struct ctl_logical_block_provisio } }; -static struct ctl_logical_block_provisioning_page lbp_page_changeable = {{ +const static struct ctl_logical_block_provisioning_page lbp_page_changeable = {{ /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, /*subpage_code*/0x02, /*page_length*/{CTL_LBPM_LEN >> 8, CTL_LBPM_LEN}, From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 21:46:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B96662D; Fri, 19 Dec 2014 21:46:25 +0000 (UTC) Received: from mail.myota.org (mail.myota.org [85.10.206.105]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4F916B9; Fri, 19 Dec 2014 21:46:23 +0000 (UTC) Received: from mobile.client (47.4.167.190.d.dyn.codetel.net.do [190.167.4.47] (may be forged)) (authenticated bits=128) by mail.myota.org (8.14.9/8.14.9) with ESMTP id sBJLjvBG021689; Fri, 19 Dec 2014 22:46:04 +0100 (CET) (envelope-from andre@albsmeier.net) Received: from submit.client ([127.0.0.1]) by schlappy.local (8.14.9/8.14.9) with ESMTP id sBJLjSle002021; Fri, 19 Dec 2014 22:45:28 +0100 (CET) (envelope-from andre@schlappy.albsmeier.net) Received: (from user@localhost) by schlappy.local (8.14.9/8.14.9/Submit) id sBJLjScG002020; Fri, 19 Dec 2014 22:45:28 +0100 (CET) (envelope-from andre@schlappy.albsmeier.net) Date: Fri, 19 Dec 2014 22:45:28 +0100 From: Andre Albsmeier To: Erwin Lansing Subject: Re: svn commit: r275890 - in stable/9: contrib/bind9 contrib/bind9/bin/check contrib/bind9/bin/confgen contrib/bind9/bin/dig contrib/bind9/bin/dig/include/dig contrib/bind9/bin/dnssec contrib/bind9/bin... Message-ID: <20141219214528.GA1998@schlappy> References: <201412180836.sBI8aLHe025437@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412180836.sBI8aLHe025437@svn.freebsd.org> X-Echelon: 757, PBX, unix, eavesdropping, 707 X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Not delayed on 85.10.206.105, ACL: AUTH(59), Origin: DO, OS: FreeBSD 9.x X-Virus-Scanned: clamav-milter 0.98.5 at colo X-Virus-Status: Clean Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 21:46:25 -0000 On Thu, 18-Dec-2014 at 08:36:21 +0000, Erwin Lansing wrote: > Author: erwin > > Log: > Update BIND to 9.9.6-P1 > I just noticed again that dnssec-importkey does not appear in usr.sbin/Makefile, is this intentional? If not we should probably add SUBDIR+= dnssec-importkey From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 23:13:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B4C171D; Fri, 19 Dec 2014 23:13:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4724C27AE; Fri, 19 Dec 2014 23:13:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJNDlBa024151; Fri, 19 Dec 2014 23:13:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJNDlGE024150; Fri, 19 Dec 2014 23:13:47 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201412192313.sBJNDlGE024150@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 19 Dec 2014 23:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275944 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 23:13:47 -0000 Author: ian Date: Fri Dec 19 23:13:46 2014 New Revision: 275944 URL: https://svnweb.freebsd.org/changeset/base/275944 Log: Add code to set and reset open-drain mode on the bus when requested. Submitted by: Michal Meloun Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Fri Dec 19 20:51:54 2014 (r275943) +++ head/sys/arm/ti/ti_sdhci.c Fri Dec 19 23:13:46 2014 (r275944) @@ -112,6 +112,7 @@ static struct ofw_compat_data compat_dat #define MMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS (3 << 9) +#define MMCHS_CON_OD (1 << 0) #define MMCHS_SYSCTL 0x12C #define MMCHS_SYSCTL_CLKD_MASK 0x3FF #define MMCHS_SYSCTL_CLKD_SHIFT 6 @@ -327,7 +328,7 @@ ti_sdhci_update_ios(device_t brdev, devi struct ti_sdhci_softc *sc = device_get_softc(brdev); struct sdhci_slot *slot; struct mmc_ios *ios; - uint32_t val32; + uint32_t val32, newval32; slot = device_get_ivars(reqdev); ios = &slot->host.ios; @@ -339,10 +340,20 @@ ti_sdhci_update_ios(device_t brdev, devi * requested, then let the standard driver handle everything else. */ val32 = ti_mmchs_read_4(sc, MMCHS_CON); + newval32 = val32; + if (ios->bus_width == bus_width_8) - ti_mmchs_write_4(sc, MMCHS_CON, val32 | MMCHS_CON_DW8); + newval32 |= MMCHS_CON_DW8; else - ti_mmchs_write_4(sc, MMCHS_CON, val32 & ~MMCHS_CON_DW8); + newval32 &= ~MMCHS_CON_DW8; + + if (ios->bus_mode == opendrain) + newval32 |= MMCHS_CON_OD; + else /* if (ios->bus_mode == pushpull) */ + newval32 &= ~MMCHS_CON_OD; + + if (newval32 != val32) + ti_mmchs_write_4(sc, MMCHS_CON, newval32); return (sdhci_generic_update_ios(brdev, reqdev)); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 23:18:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE0588BD; Fri, 19 Dec 2014 23:18:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9EFAA280A; Fri, 19 Dec 2014 23:18:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJNINYc024782; Fri, 19 Dec 2014 23:18:23 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJNINjE024781; Fri, 19 Dec 2014 23:18:23 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201412192318.sBJNINjE024781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 19 Dec 2014 23:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275945 - stable/10/usr.bin/elfdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 23:18:23 -0000 Author: brueffer Date: Fri Dec 19 23:18:22 2014 New Revision: 275945 URL: https://svnweb.freebsd.org/changeset/base/275945 Log: MFC: r274960 (slightly modified) Limit descriptors and enter capability mode. Since the header was renamed in HEAD, this commit includes sys/capability.h. Differential: D1009 Reviewed by: jonathan, pjd Relnotes: yes Modified: stable/10/usr.bin/elfdump/elfdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/elfdump/elfdump.c ============================================================================== --- stable/10/usr.bin/elfdump/elfdump.c Fri Dec 19 23:13:46 2014 (r275944) +++ stable/10/usr.bin/elfdump/elfdump.c Fri Dec 19 23:18:22 2014 (r275945) @@ -29,12 +29,15 @@ __FBSDID("$FreeBSD$"); #include + +#include #include #include #include #include #include #include +#include #include #include #include @@ -467,6 +470,7 @@ elf_get_shstrndx(Elf32_Ehdr *e, void *sh int main(int ac, char **av) { + cap_rights_t rights; u_int64_t phoff; u_int64_t shoff; u_int64_t phentsize; @@ -527,6 +531,9 @@ main(int ac, char **av) case 'w': if ((out = fopen(optarg, "w")) == NULL) err(1, "%s", optarg); + cap_rights_init(&rights, CAP_FSTAT, CAP_WRITE); + if (cap_rights_limit(fileno(out), &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for %s", optarg); break; case '?': default: @@ -539,6 +546,17 @@ main(int ac, char **av) if ((fd = open(*av, O_RDONLY)) < 0 || fstat(fd, &sb) < 0) err(1, "%s", *av); + cap_rights_init(&rights, CAP_MMAP_R); + if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for %s", *av); + close(STDIN_FILENO); + cap_rights_init(&rights, CAP_WRITE); + if (cap_rights_limit(STDOUT_FILENO, &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for stdout"); + if (cap_rights_limit(STDERR_FILENO, &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for stderr"); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); e = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); if (e == MAP_FAILED) err(1, NULL); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 23:24:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 677E9B94; Fri, 19 Dec 2014 23:24:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5390A2937; Fri, 19 Dec 2014 23:24:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJNOtGD028988; Fri, 19 Dec 2014 23:24:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJNOthq028986; Fri, 19 Dec 2014 23:24:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201412192324.sBJNOthq028986@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 19 Dec 2014 23:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275946 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 23:24:55 -0000 Author: ian Date: Fri Dec 19 23:24:54 2014 New Revision: 275946 URL: https://svnweb.freebsd.org/changeset/base/275946 Log: Rewrap long lines; no functional changes. Submitted by: Michal Meloun Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Fri Dec 19 23:18:22 2014 (r275945) +++ head/sys/arm/ti/ti_sdhci.c Fri Dec 19 23:24:54 2014 (r275946) @@ -403,9 +403,11 @@ ti_sdhci_hw_init(device_t dev) /* Issue a softreset to the controller */ ti_mmchs_write_4(sc, MMCHS_SYSCONFIG, MMCHS_SYSCONFIG_RESET); timeout = 1000; - while (!(ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & MMCHS_SYSSTATUS_RESETDONE)) { + while (!(ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & + MMCHS_SYSSTATUS_RESETDONE)) { if (--timeout == 0) { - device_printf(dev, "Error: Controller reset operation timed out\n"); + device_printf(dev, + "Error: Controller reset operation timed out\n"); break; } DELAY(100); @@ -414,9 +416,11 @@ ti_sdhci_hw_init(device_t dev) /* Reset both the command and data state machines */ ti_sdhci_write_1(dev, NULL, SDHCI_SOFTWARE_RESET, SDHCI_RESET_ALL); timeout = 1000; - while ((ti_sdhci_read_1(dev, NULL, SDHCI_SOFTWARE_RESET) & SDHCI_RESET_ALL)) { + while ((ti_sdhci_read_1(dev, NULL, SDHCI_SOFTWARE_RESET) & + SDHCI_RESET_ALL)) { if (--timeout == 0) { - device_printf(dev, "Error: Software reset operation timed out\n"); + device_printf(dev, + "Error: Software reset operation timed out\n"); break; } DELAY(100); From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 00:04:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12B0F3FE; Sat, 20 Dec 2014 00:04:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F10C91103; Sat, 20 Dec 2014 00:04:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBK043qD048372; Sat, 20 Dec 2014 00:04:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBK042lT048355; Sat, 20 Dec 2014 00:04:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201412200004.sBK042lT048355@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Dec 2014 00:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275947 - in head/sys: geom/sched modules/geom/geom_sched/gs_sched X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 00:04:04 -0000 Author: imp Date: Sat Dec 20 00:04:01 2014 New Revision: 275947 URL: https://svnweb.freebsd.org/changeset/base/275947 Log: Remove support for FreeBSD 7 and really old FreeBSD 8. The classifiers have been in the base for a while, so the gymnastics here aren't needed. In addition, the bugs in subr_disk.c have been fixed since 2009, so there's no need for an identical copy of it in the tree anymore. There's really no need to binary patch g_io_request, so let's get rid of the code (not compiled in anymore) lest others think it is a good idea. Deleted: head/sys/geom/sched/subr_disk.c Modified: head/sys/geom/sched/README head/sys/geom/sched/g_sched.c head/sys/geom/sched/g_sched.h head/sys/geom/sched/gs_rr.c head/sys/modules/geom/geom_sched/gs_sched/Makefile Modified: head/sys/geom/sched/README ============================================================================== --- head/sys/geom/sched/README Fri Dec 19 23:24:54 2014 (r275946) +++ head/sys/geom/sched/README Sat Dec 20 00:04:01 2014 (r275947) @@ -39,37 +39,17 @@ with cvs, and lets cvs progress when com To try it out: -1. USERS OF FREEBSD 7, PLEASE READ CAREFULLY THE FOLLOWING: - - On loading, this module patches one kernel function (g_io_request()) - so that I/O requests ("bio's") carry a classification tag, useful - for scheduling purposes. - - ON FREEBSD 7, the tag is stored in an existing (though rarely used) - field of the "struct bio", a solution which makes this module - incompatible with other modules using it, such as ZFS and gjournal. - Additionally, g_io_request() is patched in-memory to add a call - to the function that initializes this field (i386/amd64 only; - for other architectures you need to manually patch sys/geom/geom_io.c). - See details in the file g_sched.c. - - On FreeBSD 8.0 and above, the above trick is not necessary, - as the struct bio contains dedicated fields for the classifier, - and hooks for request classifiers. - - If you don't like the above, don't run this code. - -2. PLEASE MAKE SURE THAT THE DISK THAT YOU WILL BE USING FOR TESTS +1. PLEASE MAKE SURE THAT THE DISK THAT YOU WILL BE USING FOR TESTS DOES NOT CONTAIN PRECIOUS DATA. This is experimental code, so we make no guarantees, though I am routinely using it on my desktop and laptop. -3. EXTRACT AND BUILD THE PROGRAMS +2. EXTRACT AND BUILD THE PROGRAMS A 'make install' in the directory should work (with root privs), or you can even try the binary modules. If you want to build the modules yourself, look at the Makefile. -4. LOAD THE MODULE, CREATE A GEOM NODE, RUN TESTS +3. LOAD THE MODULE, CREATE A GEOM NODE, RUN TESTS The scheduler's module must be loaded first: Modified: head/sys/geom/sched/g_sched.c ============================================================================== --- head/sys/geom/sched/g_sched.c Fri Dec 19 23:24:54 2014 (r275946) +++ head/sys/geom/sched/g_sched.c Sat Dec 20 00:04:01 2014 (r275947) @@ -346,17 +346,8 @@ static inline u_long g_sched_classify(struct bio *bp) { -#if __FreeBSD_version > 800098 /* we have classifier fields in the struct bio */ -#define HAVE_BIO_CLASSIFIER return ((u_long)bp->bio_classifier1); -#else -#warning old version!!! - while (bp->bio_parent != NULL) - bp = bp->bio_parent; - - return ((u_long)bp->bio_caller1); -#endif } /* Return the hash chain for the given key. */ @@ -705,7 +696,7 @@ g_gsched_global_init(void) G_SCHED_DEBUG(0, "Initializing global data."); mtx_init(&me.gs_mtx, "gsched", NULL, MTX_DEF); LIST_INIT(&me.gs_scheds); - gs_bioq_init(&me.gs_pending); + bioq_init(&me.gs_pending); me.gs_initialized = 1; } } @@ -914,7 +905,7 @@ g_sched_temporary_start(struct bio *bio) mtx_lock(&me.gs_mtx); me.gs_npending++; - gs_bioq_disksort(&me.gs_pending, bio); + bioq_disksort(&me.gs_pending, bio); mtx_unlock(&me.gs_mtx); } @@ -923,7 +914,7 @@ g_sched_flush_pending(g_start_t *start) { struct bio *bp; - while ((bp = gs_bioq_takefirst(&me.gs_pending))) + while ((bp = bioq_takefirst(&me.gs_pending))) start(bp); } @@ -1365,161 +1356,7 @@ g_sched_destroy_geom(struct gctl_req *re * to the issuer of a request in bp->bio_classifier1 as soon * as the bio is posted to the geom queue (and not later, because * requests are managed by the g_down thread afterwards). - * - * On older versions of the system (but this code is not used - * in any existing release), we [ab]use the caller1 field in the - * root element of the bio tree to store the classification info. - * The marking is done at the beginning of g_io_request() - * and only if we find that the field is NULL. - * - * To avoid rebuilding the kernel, this module will patch the - * initial part of g_io_request() so it jumps to some hand-coded - * assembly that does the marking and then executes the original - * body of g_io_request(). - * - * fake_ioreq[] is architecture-specific machine code - * that implements the above. CODE_SIZE, STORE_SIZE etc. - * are constants used in the patching routine. Look at the - * code in g_ioreq_patch() for the details. - */ - -#ifndef HAVE_BIO_CLASSIFIER -/* - * Support for old FreeBSD versions - */ -#if defined(__i386__) -#define CODE_SIZE 29 -#define STORE_SIZE 5 -#define EPILOGUE 5 -#define SIZE (CODE_SIZE + STORE_SIZE + EPILOGUE) - -static u_char fake_ioreq[SIZE] = { - 0x8b, 0x44, 0x24, 0x04, /* mov bp, %eax */ - /* 1: */ - 0x89, 0xc2, /* mov %eax, %edx # edx = bp */ - 0x8b, 0x40, 0x64, /* mov bp->bio_parent, %eax */ - 0x85, 0xc0, /* test %eax, %eax */ - 0x75, 0xf7, /* jne 1b */ - 0x8b, 0x42, 0x30, /* mov bp->bp_caller1, %eax */ - 0x85, 0xc0, /* test %eax, %eax */ - 0x75, 0x09, /* jne 2f */ - 0x64, 0xa1, 0x00, 0x00, /* mov %fs:0, %eax */ - 0x00, 0x00, - 0x89, 0x42, 0x30, /* mov %eax, bp->bio_caller1 */ - /* 2: */ - 0x55, 0x89, 0xe5, 0x57, 0x56, - 0xe9, 0x00, 0x00, 0x00, 0x00, /* jmp back... */ -}; -#elif defined(__amd64) -#define CODE_SIZE 38 -#define STORE_SIZE 6 -#define EPILOGUE 5 -#define SIZE (CODE_SIZE + STORE_SIZE + EPILOGUE) - -static u_char fake_ioreq[SIZE] = { - 0x48, 0x89, 0xf8, /* mov bp, %rax */ - /* 1: */ - 0x48, 0x89, 0xc2, /* mov %rax, %rdx # rdx = bp */ - 0x48, 0x8b, 0x82, 0xa8, /* mov bp->bio_parent, %rax */ - 0x00, 0x00, 0x00, - 0x48, 0x85, 0xc0, /* test %rax, %rax */ - 0x75, 0xf1, /* jne 1b */ - 0x48, 0x83, 0x7a, 0x58, /* cmp $0, bp->bp_caller1 */ - 0x00, - 0x75, 0x0d, /* jne 2f */ - 0x65, 0x48, 0x8b, 0x04, /* mov %gs:0, %rax */ - 0x25, 0x00, 0x00, 0x00, - 0x00, - 0x48, 0x89, 0x42, 0x58, /* mov %rax, bp->bio_caller1 */ - /* 2: */ - 0x55, 0x48, 0x89, 0xe5, 0x41, 0x56, - 0xe9, 0x00, 0x00, 0x00, 0x00, /* jmp back... */ -}; -#else /* neither x86 nor amd64 */ -static void -g_new_io_request(struct bio *bp, struct g_consumer *cp) -{ - struct bio *top = bp; - - /* - * bio classification: if bio_caller1 is available in the - * root of the 'struct bio' tree, store there the thread id - * of the thread that originated the request. - * More sophisticated classification schemes can be used. - */ - while (top->bio_parent) - top = top->bio_parent; - - if (top->bio_caller1 == NULL) - top->bio_caller1 = curthread; -} - -#error please add the code above in g_new_io_request() to the beginning of \ - /sys/geom/geom_io.c::g_io_request(), and remove this line. -#endif /* end of arch-specific code */ - -static int -g_ioreq_patch(void) -{ - u_char *original; - u_long ofs; - int found; - - if (me.gs_patched) - return (-1); - - original = (u_char *)g_io_request; - - found = !bcmp(original, fake_ioreq + CODE_SIZE, STORE_SIZE); - if (!found) - return (-1); - - /* Jump back to the original + STORE_SIZE. */ - ofs = (original + STORE_SIZE) - (fake_ioreq + SIZE); - bcopy(&ofs, fake_ioreq + CODE_SIZE + STORE_SIZE + 1, 4); - - /* Patch the original address with a jump to the trampoline. */ - *original = 0xe9; /* jump opcode */ - ofs = fake_ioreq - (original + 5); - bcopy(&ofs, original + 1, 4); - - me.gs_patched = 1; - - return (0); -} - -/* - * Restore the original code, this is easy. */ -static void -g_ioreq_restore(void) -{ - u_char *original; - - if (me.gs_patched) { - original = (u_char *)g_io_request; - bcopy(fake_ioreq + CODE_SIZE, original, STORE_SIZE); - me.gs_patched = 0; - } -} - -static inline void -g_classifier_ini(void) -{ - - g_ioreq_patch(); -} - -static inline void -g_classifier_fini(void) -{ - - g_ioreq_restore(); -} - -/*--- end of support code for older FreeBSD versions */ - -#else /* HAVE_BIO_CLASSIFIER */ /* * Classifier support for recent FreeBSD versions: we use @@ -1552,7 +1389,6 @@ g_classifier_fini(void) g_unregister_classifier(&g_sched_classifier); } -#endif /* HAVE_BIO_CLASSIFIER */ static void g_sched_init(struct g_class *mp) Modified: head/sys/geom/sched/g_sched.h ============================================================================== --- head/sys/geom/sched/g_sched.h Fri Dec 19 23:24:54 2014 (r275946) +++ head/sys/geom/sched/g_sched.h Sat Dec 20 00:04:01 2014 (r275947) @@ -120,19 +120,6 @@ struct g_sched_softc { #define G_SCHED_PROXYING 1 #define G_SCHED_FLUSHING 2 -/* - * Temporary- our own version of the disksort, because the - * version in 7.x and 8.x before march 2009 is buggy. - */ -void gs_bioq_init(struct bio_queue_head *); -void gs_bioq_remove(struct bio_queue_head *, struct bio *); -void gs_bioq_flush(struct bio_queue_head *, struct devstat *, int); -void gs_bioq_insert_head(struct bio_queue_head *, struct bio *); -void gs_bioq_insert_tail(struct bio_queue_head *, struct bio *); -struct bio *gs_bioq_first(struct bio_queue_head *); -struct bio *gs_bioq_takefirst(struct bio_queue_head *); -void gs_bioq_disksort(struct bio_queue_head *, struct bio *); - #endif /* _KERNEL */ #endif /* _G_SCHED_H_ */ Modified: head/sys/geom/sched/gs_rr.c ============================================================================== --- head/sys/geom/sched/gs_rr.c Fri Dec 19 23:24:54 2014 (r275946) +++ head/sys/geom/sched/gs_rr.c Sat Dec 20 00:04:01 2014 (r275947) @@ -315,7 +315,7 @@ g_rr_init_class(void *data, void *priv) struct g_rr_softc *sc = data; struct g_rr_queue *qp = priv; - gs_bioq_init(&qp->q_bioq); + bioq_init(&qp->q_bioq); /* * Set the initial parameters for the client: @@ -350,7 +350,7 @@ g_rr_fini_class(void *data, void *priv) { struct g_rr_queue *qp = priv; - KASSERT(gs_bioq_first(&qp->q_bioq) == NULL, + KASSERT(bioq_first(&qp->q_bioq) == NULL, ("released nonempty queue")); qp->q_sc->sc_nqueues--; me.queues--; @@ -438,7 +438,7 @@ g_rr_next(void *data, int force) qp->q_flags &= ~G_FLAG_COMPLETED; } - bp = gs_bioq_takefirst(&qp->q_bioq); /* surely not NULL */ + bp = bioq_takefirst(&qp->q_bioq); /* surely not NULL */ qp->q_service += bp->bio_length; /* charge the service */ /* @@ -456,7 +456,7 @@ g_rr_next(void *data, int force) * on read or writes (e.g., anticipate only on reads). */ expired = g_rr_queue_expired(qp); /* are we expired ? */ - next = gs_bioq_first(&qp->q_bioq); /* do we have one more ? */ + next = bioq_first(&qp->q_bioq); /* do we have one more ? */ if (expired) { sc->sc_active = NULL; /* Either requeue or release reference. */ @@ -538,7 +538,7 @@ g_rr_start(void *data, struct bio *bp) if (qp == NULL) return (-1); /* allocation failed, tell upstream */ - if (gs_bioq_first(&qp->q_bioq) == NULL) { + if (bioq_first(&qp->q_bioq) == NULL) { /* * We are inserting into an empty queue. * Reset its state if it is sc_active, @@ -560,7 +560,7 @@ g_rr_start(void *data, struct bio *bp) /* Inherit the reference returned by g_rr_queue_get(). */ bp->bio_caller1 = qp; - gs_bioq_disksort(&qp->q_bioq, bp); + bioq_disksort(&qp->q_bioq, bp); return (0); } Modified: head/sys/modules/geom/geom_sched/gs_sched/Makefile ============================================================================== --- head/sys/modules/geom/geom_sched/gs_sched/Makefile Fri Dec 19 23:24:54 2014 (r275946) +++ head/sys/modules/geom/geom_sched/gs_sched/Makefile Sat Dec 20 00:04:01 2014 (r275947) @@ -1,6 +1,6 @@ # $FreeBSD$ KMOD= geom_sched -SRCS= g_sched.c subr_disk.c +SRCS= g_sched.c # ../Makefile.inc automatically included .include From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 00:07:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96A6157A; Sat, 20 Dec 2014 00:07:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 829D31159; Sat, 20 Dec 2014 00:07:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBK07sM2048990; Sat, 20 Dec 2014 00:07:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBK07s8u048989; Sat, 20 Dec 2014 00:07:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201412200007.sBK07s8u048989@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Dec 2014 00:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275948 - head/sys/modules/geom/geom_sched/gsched_rr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 00:07:54 -0000 Author: imp Date: Sat Dec 20 00:07:53 2014 New Revision: 275948 URL: https://svnweb.freebsd.org/changeset/base/275948 Log: Remove comments relevant to 6.x only. Modified: head/sys/modules/geom/geom_sched/gsched_rr/Makefile Modified: head/sys/modules/geom/geom_sched/gsched_rr/Makefile ============================================================================== --- head/sys/modules/geom/geom_sched/gsched_rr/Makefile Sat Dec 20 00:04:01 2014 (r275947) +++ head/sys/modules/geom/geom_sched/gsched_rr/Makefile Sat Dec 20 00:07:53 2014 (r275948) @@ -2,8 +2,6 @@ KMOD= gsched_rr SRCS= gs_rr.c -# hash.h on 6.x has a (char *) cast on a const pointer -#CWARNFLAGS= # ../Makefile.inc automatically included .include From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 00:37:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F7FFCA6; Sat, 20 Dec 2014 00:37:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 41C2215F7; Sat, 20 Dec 2014 00:37:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBK0bwAH063225; Sat, 20 Dec 2014 00:37:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBK0bvll063223; Sat, 20 Dec 2014 00:37:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201412200037.sBK0bvll063223@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 20 Dec 2014 00:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275949 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 00:37:58 -0000 Author: ian Date: Sat Dec 20 00:37:56 2014 New Revision: 275949 URL: https://svnweb.freebsd.org/changeset/base/275949 Log: When command and data interrupts have been aggregated together, don't do the data-completed processing if a command-error interrupt is also asserted. Reviewed by: Michal Meloun Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Dec 20 00:07:53 2014 (r275948) +++ head/sys/dev/sdhci/sdhci.c Sat Dec 20 00:37:56 2014 (r275949) @@ -713,9 +713,13 @@ sdhci_timeout(void *arg) struct sdhci_slot *slot = arg; if (slot->curcmd != NULL) { + slot_printf(slot, " Controller timeout\n"); + sdhci_dumpregs(slot); sdhci_reset(slot, SDHCI_RESET_CMD|SDHCI_RESET_DATA); slot->curcmd->error = MMC_ERR_TIMEOUT; sdhci_req_done(slot); + } else { + slot_printf(slot, " Spurious timeout - no active command\n"); } } @@ -1274,7 +1278,9 @@ sdhci_generic_intr(struct sdhci_slot *sl /* Handle data interrupts. */ if (intmask & SDHCI_INT_DATA_MASK) { WR4(slot, SDHCI_INT_STATUS, intmask & SDHCI_INT_DATA_MASK); - sdhci_data_irq(slot, intmask & SDHCI_INT_DATA_MASK); + /* Dont call data_irq in case of errored command */ + if ((intmask & SDHCI_INT_CMD_ERROR_MASK) == 0) + sdhci_data_irq(slot, intmask & SDHCI_INT_DATA_MASK); } /* Handle AutoCMD12 error interrupt. */ if (intmask & SDHCI_INT_ACMD12ERR) { Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sat Dec 20 00:07:53 2014 (r275948) +++ head/sys/dev/sdhci/sdhci.h Sat Dec 20 00:37:56 2014 (r275949) @@ -182,8 +182,11 @@ #define SDHCI_INT_NORMAL_MASK 0x00007FFF #define SDHCI_INT_ERROR_MASK 0xFFFF8000 -#define SDHCI_INT_CMD_MASK (SDHCI_INT_RESPONSE | SDHCI_INT_TIMEOUT | \ +#define SDHCI_INT_CMD_ERROR_MASK (SDHCI_INT_TIMEOUT | \ SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX) + +#define SDHCI_INT_CMD_MASK (SDHCI_INT_RESPONSE | SDHCI_INT_CMD_ERROR_MASK) + #define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \ SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \ From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 01:13:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C7D55BE; Sat, 20 Dec 2014 01:13:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1D7001FE5; Sat, 20 Dec 2014 01:13:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBK1DEQD081585; Sat, 20 Dec 2014 01:13:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBK1DEOG081581; Sat, 20 Dec 2014 01:13:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201412200113.sBK1DEOG081581@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 20 Dec 2014 01:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275950 - in head/sys: arm/ti 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 01:13:15 -0000 Author: ian Date: Sat Dec 20 01:13:13 2014 New Revision: 275950 URL: https://svnweb.freebsd.org/changeset/base/275950 Log: Add a new sdhci quirk, SDHCI_QUIRK_WAITFOR_RESET_ASSERTED, to work around TI OMAP controllers which will return the reset-in-progress bit as zero if you read the status register too fast after setting the reset bit. The zero is apparently from a stale snapshot of the internal state presented in the interface register, and leads to a false indication that the reset is complete when it either hasn't started yet or is in-progress. The workaround is to first loop until the bit is seen as asserted, then do the normal loop waiting to see it de-asserted. Submitted by: Michal Meloun Modified: head/sys/arm/ti/ti_sdhci.c head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Sat Dec 20 00:37:56 2014 (r275949) +++ head/sys/arm/ti/ti_sdhci.c Sat Dec 20 01:13:13 2014 (r275950) @@ -413,9 +413,27 @@ ti_sdhci_hw_init(device_t dev) DELAY(100); } - /* Reset both the command and data state machines */ + /* + * Reset the command and data state machines and also other aspects of + * the controller such as bus clock and power. + * + * If we read the software reset register too fast after writing it we + * can get back a zero that means the reset hasn't started yet rather + * than that the reset is complete. Per TI recommendations, work around + * it by reading until we see the reset bit asserted, then read until + * it's clear. We also set the SDHCI_QUIRK_WAITFOR_RESET_ASSERTED quirk + * so that the main sdhci driver uses this same logic in its resets. + */ ti_sdhci_write_1(dev, NULL, SDHCI_SOFTWARE_RESET, SDHCI_RESET_ALL); - timeout = 1000; + timeout = 10000; + while ((ti_sdhci_read_1(dev, NULL, SDHCI_SOFTWARE_RESET) & + SDHCI_RESET_ALL) != SDHCI_RESET_ALL) { + if (--timeout == 0) { + break; + } + DELAY(1); + } + timeout = 10000; while ((ti_sdhci_read_1(dev, NULL, SDHCI_SOFTWARE_RESET) & SDHCI_RESET_ALL)) { if (--timeout == 0) { @@ -583,6 +601,12 @@ ti_sdhci_attach(device_t dev) sc->slot.quirks |= SDHCI_QUIRK_DONT_SHIFT_RESPONSE; /* + * Reset bits are broken, have to wait to see the bits asserted + * before waiting to see them de-asserted. + */ + sc->slot.quirks |= SDHCI_QUIRK_WAITFOR_RESET_ASSERTED; + + /* * DMA is not really broken, I just haven't implemented it yet. */ sc->slot.quirks |= SDHCI_QUIRK_BROKEN_DMA; Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Dec 20 00:37:56 2014 (r275949) +++ head/sys/dev/sdhci/sdhci.c Sat Dec 20 01:13:13 2014 (r275950) @@ -149,7 +149,6 @@ static void sdhci_reset(struct sdhci_slot *slot, uint8_t mask) { int timeout; - uint8_t res; if (slot->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { if (!(RD4(slot, SDHCI_PRESENT_STATE) & @@ -168,26 +167,43 @@ sdhci_reset(struct sdhci_slot *slot, uin sdhci_set_clock(slot, clock); } - WR1(slot, SDHCI_SOFTWARE_RESET, mask); - if (mask & SDHCI_RESET_ALL) { slot->clock = 0; slot->power = 0; } + WR1(slot, SDHCI_SOFTWARE_RESET, mask); + + if (slot->quirks & SDHCI_QUIRK_WAITFOR_RESET_ASSERTED) { + /* + * Resets on TI OMAPs and AM335x are incompatible with SDHCI + * specification. The reset bit has internal propagation delay, + * so a fast read after write returns 0 even if reset process is + * in progress. The workaround is to poll for 1 before polling + * for 0. In the worst case, if we miss seeing it asserted the + * time we spent waiting is enough to ensure the reset finishes. + */ + timeout = 10000; + while ((RD1(slot, SDHCI_SOFTWARE_RESET) & mask) != mask) { + if (timeout <= 0) + break; + timeout--; + DELAY(1); + } + } + /* Wait max 100 ms */ - timeout = 100; + timeout = 10000; /* Controller clears the bits when it's done */ - while ((res = RD1(slot, SDHCI_SOFTWARE_RESET)) & mask) { - if (timeout == 0) { - slot_printf(slot, - "Reset 0x%x never completed - 0x%x.\n", - (int)mask, (int)res); + while (RD1(slot, SDHCI_SOFTWARE_RESET) & mask) { + if (timeout <= 0) { + slot_printf(slot, "Reset 0x%x never completed.\n", + mask); sdhci_dumpregs(slot); return; } timeout--; - DELAY(1000); + DELAY(10); } } Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sat Dec 20 00:37:56 2014 (r275949) +++ head/sys/dev/sdhci/sdhci.h Sat Dec 20 01:13:13 2014 (r275950) @@ -59,6 +59,8 @@ #define SDHCI_QUIRK_MISSING_CAPS (1<<12) /* Hardware shifts the 136-bit response, don't do it in software. */ #define SDHCI_QUIRK_DONT_SHIFT_RESPONSE (1<<13) +/* Wait to see reset bit asserted before waiting for de-asserted */ +#define SDHCI_QUIRK_WAITFOR_RESET_ASSERTED (1<<14) /* * Controller registers From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 04:24:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBC35F84; Sat, 20 Dec 2014 04:24:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A81A725D6; Sat, 20 Dec 2014 04:24:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBK4OfqC070367; Sat, 20 Dec 2014 04:24:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBK4OfhE070366; Sat, 20 Dec 2014 04:24:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201412200424.sBK4OfhE070366@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 20 Dec 2014 04:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275951 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 04:24:41 -0000 Author: ian Date: Sat Dec 20 04:24:40 2014 New Revision: 275951 URL: https://svnweb.freebsd.org/changeset/base/275951 Log: Log mmc and sd command failures. Reporting of routine expected errors, such as timeouts while probing a bus or testing for a feature, is squelched. Also, error reporting is limited to 5 events per second, because when an sdcard goes bad on a low-end embedded board, flooding the console at high speed isn't helpful. Original logging code contributed by Michal Meloun, but then I fancied it up with squelching and ppsratecheck. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sat Dec 20 01:13:13 2014 (r275950) +++ head/sys/dev/mmc/mmc.c Sat Dec 20 04:24:40 2014 (r275951) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -76,8 +77,13 @@ struct mmc_softc { struct intr_config_hook config_intrhook; device_t owner; uint32_t last_rca; + int squelched; /* suppress reporting of (expected) errors */ + int log_count; + struct timeval log_time; }; +#define LOG_PPS 5 /* Log no more than 5 errors per second. */ + /* * Per-card data */ @@ -426,6 +432,13 @@ mmc_wait_for_cmd(struct mmc_softc *sc, s err = cmd->error; } while (err != MMC_ERR_NONE && retries-- > 0); + if (err != MMC_ERR_NONE && sc->squelched == 0) { + if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) { + device_printf(sc->dev, "CMD%d failed, RESULT: %d\n", + cmd->opcode, err); + } + } + return (err); } @@ -436,6 +449,8 @@ mmc_wait_for_app_cmd(struct mmc_softc *s struct mmc_command appcmd; int err; + /* Squelch error reporting at lower levels, we report below. */ + sc->squelched++; do { memset(&appcmd, 0, sizeof(appcmd)); appcmd.opcode = MMC_APP_CMD; @@ -455,6 +470,14 @@ mmc_wait_for_app_cmd(struct mmc_softc *s err = cmd->error; } } while (err != MMC_ERR_NONE && retries-- > 0); + sc->squelched--; + + if (err != MMC_ERR_NONE && sc->squelched == 0) { + if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) { + device_printf(sc->dev, "ACMD%d failed, RESULT: %d\n", + cmd->opcode, err); + } + } return (err); } @@ -760,6 +783,7 @@ mmc_test_bus_width(struct mmc_softc *sc) mmcbr_set_bus_width(sc->dev, bus_width_8); mmcbr_update_ios(sc->dev); + sc->squelched++; /* Errors are expected, squelch reporting. */ memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); cmd.opcode = MMC_BUSTEST_W; @@ -783,6 +807,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.len = 8; data.flags = MMC_DATA_READ; err = mmc_wait_for_cmd(sc, &cmd, 0); + sc->squelched--; mmcbr_set_bus_width(sc->dev, bus_width_1); mmcbr_update_ios(sc->dev); @@ -795,6 +820,7 @@ mmc_test_bus_width(struct mmc_softc *sc) mmcbr_set_bus_width(sc->dev, bus_width_4); mmcbr_update_ios(sc->dev); + sc->squelched++; /* Errors are expected, squelch reporting. */ memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); cmd.opcode = MMC_BUSTEST_W; @@ -818,6 +844,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.len = 4; data.flags = MMC_DATA_READ; err = mmc_wait_for_cmd(sc, &cmd, 0); + sc->squelched--; mmcbr_set_bus_width(sc->dev, bus_width_1); mmcbr_update_ios(sc->dev); @@ -1270,7 +1297,9 @@ mmc_discover_cards(struct mmc_softc *sc) if (bootverbose || mmc_debug) device_printf(sc->dev, "Probing cards\n"); while (1) { + sc->squelched++; /* Errors are expected, squelch reporting. */ err = mmc_all_send_cid(sc, raw_cid); + sc->squelched--; if (err == MMC_ERR_TIMEOUT) break; if (err != MMC_ERR_NONE) { @@ -1536,6 +1565,7 @@ mmc_go_discovery(struct mmc_softc *sc) /* * First, try SD modes */ + sc->squelched++; /* Errors are expected, squelch reporting. */ mmcbr_set_mode(dev, mode_sd); mmc_power_up(sc); mmcbr_set_bus_mode(dev, pushpull); @@ -1561,6 +1591,7 @@ mmc_go_discovery(struct mmc_softc *sc) "MMC probe: OK (OCR: 0x%08x)\n", ocr); } else if (bootverbose || mmc_debug) device_printf(sc->dev, "SD probe: OK (OCR: 0x%08x)\n", ocr); + sc->squelched--; mmcbr_set_ocr(dev, mmc_select_vdd(sc, ocr)); if (mmcbr_get_ocr(dev) != 0) From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 04:57:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03AEB2C7; Sat, 20 Dec 2014 04:57:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CA10228F8; Sat, 20 Dec 2014 04:57:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBK4vkNp084516; Sat, 20 Dec 2014 04:57:46 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBK4vkLQ084515; Sat, 20 Dec 2014 04:57:46 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412200457.sBK4vkLQ084515@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 20 Dec 2014 04:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275952 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 04:57:47 -0000 Author: neel Date: Sat Dec 20 04:57:45 2014 New Revision: 275952 URL: https://svnweb.freebsd.org/changeset/base/275952 Log: Various 8259 device model improvements: - implement 8259 "polled" mode. - set 'atpic->sfn' if bit 4 in ICW4 is set during master initialization. - report error if guest tries to enable the "special mask" mode. Differential Revision: https://reviews.freebsd.org/D1328 Reviewed by: tychon Reported by: grehan Tested by: grehan MFC after: 1 week Modified: head/sys/amd64/vmm/io/vatpic.c Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Sat Dec 20 04:24:40 2014 (r275951) +++ head/sys/amd64/vmm/io/vatpic.c Sat Dec 20 04:57:45 2014 (r275952) @@ -112,6 +112,16 @@ struct vatpic { static void vatpic_set_pinstate(struct vatpic *vatpic, int pin, bool newstate); +static __inline bool +master_atpic(struct vatpic *vatpic, struct atpic *atpic) +{ + + if (atpic == &vatpic->atpic[0]) + return (true); + else + return (false); +} + static __inline int vatpic_get_highest_isrpin(struct atpic *atpic) { @@ -250,6 +260,7 @@ vatpic_icw1(struct vatpic *vatpic, struc atpic->mask = 0; atpic->lowprio = 7; atpic->rd_cmd_reg = 0; + atpic->poll = 0; if ((val & ICW1_SNGL) != 0) { VATPIC_CTR0(vatpic, "vatpic cascade mode required"); @@ -301,6 +312,15 @@ vatpic_icw4(struct vatpic *vatpic, struc if ((val & ICW4_AEOI) != 0) atpic->aeoi = true; + if ((val & ICW4_SFNM) != 0) { + if (master_atpic(vatpic, atpic)) { + atpic->sfn = true; + } else { + VATPIC_CTR1(vatpic, "Ignoring special fully nested " + "mode on slave atpic: %#x", val); + } + } + atpic->icw_num = 0; atpic->ready = true; @@ -354,11 +374,17 @@ vatpic_ocw3(struct vatpic *vatpic, struc { VATPIC_CTR1(vatpic, "atpic ocw3 0x%x", val); - atpic->poll = ((val & OCW3_P) != 0); + if (val & OCW3_ESMM) { + VATPIC_CTR0(vatpic, "atpic special mask mode not implemented"); + return (-1); + } if (val & OCW3_RR) { /* read register command */ atpic->rd_cmd_reg = val & OCW3_RIS; + + /* Polling mode */ + atpic->poll = ((val & OCW3_P) != 0); } return (0); @@ -578,12 +604,19 @@ static int vatpic_read(struct vatpic *vatpic, struct atpic *atpic, bool in, int port, int bytes, uint32_t *eax) { + int pin; + VATPIC_LOCK(vatpic); if (atpic->poll) { - VATPIC_CTR0(vatpic, "vatpic polled mode not supported"); - VATPIC_UNLOCK(vatpic); - return (-1); + atpic->poll = 0; + pin = vatpic_get_highest_irrpin(atpic); + if (pin >= 0) { + vatpic_pin_accepted(atpic, pin); + *eax = 0x80 | pin; + } else { + *eax = 0; + } } else { if (port & ICU_IMR_OFFSET) { /* read interrrupt mask register */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 06:36:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B979947; Sat, 20 Dec 2014 06:36:27 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtpout001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED6611C26; Sat, 20 Dec 2014 06:36:25 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTPSA id <0NGV00AEOBNX1L10@st11p02mm-asmtp001.mac.com>; Sat, 20 Dec 2014 06:36:00 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2014-12-20_01:2014-12-19,2014-12-20,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412080000 definitions=main-1412200071 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src From: Rui Paulo In-reply-to: <20141218235902.GA1590@troutmask.apl.washington.edu> Date: Fri, 19 Dec 2014 22:35:56 -0800 Content-transfer-encoding: quoted-printable Message-id: <88F4DDC5-730A-40D3-BA89-77ED20A94024@me.com> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> <20141217211654.GA95193@troutmask.apl.washington.edu> <18504F2A-72C1-4962-86E6-CCAE4898B478@gmail.com> <20141218235902.GA1590@troutmask.apl.washington.edu> To: Steve Kargl X-Mailer: Apple Mail (2.1993) Cc: Ed Schouten , src-committers@freebsd.org, Warner Losh , svn-src-all@freebsd.org, Dimitry Andric , svn-src-head@freebsd.org, Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 06:36:27 -0000 On Dec 18, 2014, at 15:59, Steve Kargl = wrote: > My only hope now is that Ed will fix the comment he inserted into > math_private.h to properly note that the functions formerly known > as cpack[fl] were written years before the C11 macros CMPLX[FL] > existed. Instead of waiting on Ed to fix a comment, you could just phrase it = better. I did not see any objection from him on this matter. You were = presented with several options from other committers and you chose to = not to take any action besides sending emails. The ball's on your court = now. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 13:33:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9FB36D4; Sat, 20 Dec 2014 13:33:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A55842635; Sat, 20 Dec 2014 13:33:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKDXXrA022442; Sat, 20 Dec 2014 13:33:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKDXWlF022433; Sat, 20 Dec 2014 13:33:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412201333.sBKDXWlF022433@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 20 Dec 2014 13:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275953 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 13:33:33 -0000 Author: mav Date: Sat Dec 20 13:33:31 2014 New Revision: 275953 URL: https://svnweb.freebsd.org/changeset/base/275953 Log: Replace ctl_min() macro with MIN(). MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_internal.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Dec 20 04:57:45 2014 (r275952) +++ head/sys/cam/ctl/ctl.c Sat Dec 20 13:33:31 2014 (r275953) @@ -1743,8 +1743,8 @@ ctl_ioctl_do_datamove(struct ctl_scsiio i < ext_sg_entries && j < kern_sg_entries;) { uint8_t *ext_ptr, *kern_ptr; - len_to_copy = ctl_min(ext_sglist[i].len - ext_watermark, - kern_sglist[j].len - kern_watermark); + len_to_copy = MIN(ext_sglist[i].len - ext_watermark, + kern_sglist[j].len - kern_watermark); ext_ptr = (uint8_t *)ext_sglist[i].addr; ext_ptr = ext_ptr + ext_watermark; @@ -2834,8 +2834,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, bbr_info->scsi_status = metatask->taskinfo.bbrread.scsi_status; memcpy(&bbr_info->sense_data, &metatask->taskinfo.bbrread.sense_data, - ctl_min(sizeof(bbr_info->sense_data), - sizeof(metatask->taskinfo.bbrread.sense_data))); + MIN(sizeof(bbr_info->sense_data), + sizeof(metatask->taskinfo.bbrread.sense_data))); cfi_free_metatask(metatask); @@ -3642,7 +3642,7 @@ ctl_ffz(uint32_t *mask, uint32_t size) num_chunks = (size >> 5); if (num_chunks == 0) num_chunks++; - num_pieces = ctl_min((sizeof(uint32_t) * 8), size); + num_pieces = MIN((sizeof(uint32_t) * 8), size); for (i = 0; i < num_chunks; i++) { for (j = 0; j < num_pieces; j++) { @@ -3889,7 +3889,7 @@ ctl_copy_io(union ctl_io *src, union ctl */ pool_ref = dest->io_hdr.pool; - memcpy(dest, src, ctl_min(sizeof(*src), sizeof(*dest))); + memcpy(dest, src, MIN(sizeof(*src), sizeof(*dest))); dest->io_hdr.pool = pool_ref; /* @@ -6752,7 +6752,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header = (struct scsi_mode_hdr_6 *)ctsio->kern_data_ptr; - header->datalen = ctl_min(total_len - 1, 254); + header->datalen = MIN(total_len - 1, 254); if (control_dev == 0) { header->dev_specific = 0x10; /* DPOFUA */ if ((lun->flags & CTL_LUN_READONLY) || @@ -6774,7 +6774,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header = (struct scsi_mode_hdr_10 *)ctsio->kern_data_ptr; - datalen = ctl_min(total_len - 2, 65533); + datalen = MIN(total_len - 2, 65533); scsi_ulto2b(datalen, header->datalen); if (control_dev == 0) { header->dev_specific = 0x10; /* DPOFUA */ @@ -9515,7 +9515,7 @@ ctl_request_sense(struct ctl_scsiio *cts (struct scsi_sense_data_fixed *)sense_ptr); else memcpy(sense_ptr, &lun->pending_sense[initidx], - ctl_min(sizeof(*sense_ptr), + MIN(sizeof(*sense_ptr), sizeof(lun->pending_sense[initidx]))); ctl_clear_mask(lun->have_ca, initidx); @@ -12474,8 +12474,8 @@ ctl_inject_error(struct ctl_lun *lun, un * checks. */ bcopy(&desc->custom_sense, &io->scsiio.sense_data, - ctl_min(sizeof(desc->custom_sense), - sizeof(io->scsiio.sense_data))); + MIN(sizeof(desc->custom_sense), + sizeof(io->scsiio.sense_data))); io->scsiio.scsi_status = SCSI_STATUS_CHECK_COND; io->scsiio.sense_len = SSD_FULL_SIZE; io->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; @@ -12704,7 +12704,7 @@ ctl_datamove(union ctl_io *io) */ for (sg_entries_sent = 0; sg_entries_sent < msg.dt.kern_sg_entries; msg.dt.sg_sequence++) { - msg.dt.cur_sg_entries = ctl_min((sizeof(msg.dt.sg_list)/ + msg.dt.cur_sg_entries = MIN((sizeof(msg.dt.sg_list)/ sizeof(msg.dt.sg_list[0])), msg.dt.kern_sg_entries - sg_entries_sent); @@ -13067,7 +13067,7 @@ ctl_datamove_remote_sgl_setup(union ctl_ for (i = 0; (i < sizeof(io->io_hdr.remote_sglist) / sizeof(io->io_hdr.remote_sglist[0])) && (len_to_go > 0); i++) { - local_sglist[i].len = ctl_min(len_to_go, 131072); + local_sglist[i].len = MIN(len_to_go, 131072); CTL_SIZE_8B(local_dma_sglist[i].len, local_sglist[i].len); local_sglist[i].addr = @@ -13203,8 +13203,8 @@ ctl_datamove_remote_xfer(union ctl_io *i * also have enough slack left over at the end, though, * to round up to the next 8 byte boundary. */ - cur_len = ctl_min(local_sglist[i].len - local_used, - remote_sglist[j].len - remote_used); + cur_len = MIN(local_sglist[i].len - local_used, + remote_sglist[j].len - remote_used); /* * In this case, we have a size issue and need to decrease @@ -13703,7 +13703,7 @@ ctl_queue_sense(union ctl_io *io) } memcpy(&lun->pending_sense[initidx], &io->scsiio.sense_data, - ctl_min(sizeof(lun->pending_sense[initidx]), + MIN(sizeof(lun->pending_sense[initidx]), sizeof(io->scsiio.sense_data))); ctl_set_mask(lun->have_ca, initidx); mtx_unlock(&lun->lun_lock); Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Sat Dec 20 04:57:45 2014 (r275952) +++ head/sys/cam/ctl/ctl.h Sat Dec 20 13:33:31 2014 (r275953) @@ -40,7 +40,6 @@ #ifndef _CTL_H_ #define _CTL_H_ -#define ctl_min(x,y) (((x) < (y)) ? (x) : (y)) #define CTL_RETVAL_COMPLETE 0 #define CTL_RETVAL_QUEUED 1 #define CTL_RETVAL_ALLOCATED 2 Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sat Dec 20 04:57:45 2014 (r275952) +++ head/sys/cam/ctl/ctl_backend_block.c Sat Dec 20 13:33:31 2014 (r275953) @@ -2302,32 +2302,32 @@ ctl_be_block_create(struct ctl_be_block_ snprintf(tmpstr, sizeof(tmpstr), "MYSERIAL%4d", softc->num_luns); strncpy((char *)be_lun->ctl_be_lun.serial_num, tmpstr, - ctl_min(sizeof(be_lun->ctl_be_lun.serial_num), + MIN(sizeof(be_lun->ctl_be_lun.serial_num), sizeof(tmpstr))); /* Tell the user what we used for a serial number */ strncpy((char *)params->serial_num, tmpstr, - ctl_min(sizeof(params->serial_num), sizeof(tmpstr))); + MIN(sizeof(params->serial_num), sizeof(tmpstr))); } else { strncpy((char *)be_lun->ctl_be_lun.serial_num, params->serial_num, - ctl_min(sizeof(be_lun->ctl_be_lun.serial_num), + MIN(sizeof(be_lun->ctl_be_lun.serial_num), sizeof(params->serial_num))); } if ((params->flags & CTL_LUN_FLAG_DEVID) == 0) { snprintf(tmpstr, sizeof(tmpstr), "MYDEVID%4d", softc->num_luns); strncpy((char *)be_lun->ctl_be_lun.device_id, tmpstr, - ctl_min(sizeof(be_lun->ctl_be_lun.device_id), + MIN(sizeof(be_lun->ctl_be_lun.device_id), sizeof(tmpstr))); /* Tell the user what we used for a device ID */ strncpy((char *)params->device_id, tmpstr, - ctl_min(sizeof(params->device_id), sizeof(tmpstr))); + MIN(sizeof(params->device_id), sizeof(tmpstr))); } else { strncpy((char *)be_lun->ctl_be_lun.device_id, params->device_id, - ctl_min(sizeof(be_lun->ctl_be_lun.device_id), - sizeof(params->device_id))); + MIN(sizeof(be_lun->ctl_be_lun.device_id), + sizeof(params->device_id))); } TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_be_block_worker, be_lun); Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Dec 20 04:57:45 2014 (r275952) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Dec 20 13:33:31 2014 (r275953) @@ -313,8 +313,7 @@ ctl_backend_ramdisk_continue(union ctl_i sg_entries = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; for (i = 0, len_filled = 0; i < sg_filled; i++) { sg_entries[i].addr = softc->ramdisk_pages[i]; - sg_entries[i].len = ctl_min(PAGE_SIZE, - len - len_filled); + sg_entries[i].len = MIN(PAGE_SIZE, len - len_filled); len_filled += sg_entries[i].len; } io->io_hdr.flags |= CTL_FLAG_KDPTR_SGLIST; @@ -614,32 +613,32 @@ ctl_backend_ramdisk_create(struct ctl_be snprintf(tmpstr, sizeof(tmpstr), "MYSERIAL%4d", softc->num_luns); strncpy((char *)be_lun->ctl_be_lun.serial_num, tmpstr, - ctl_min(sizeof(be_lun->ctl_be_lun.serial_num), - sizeof(tmpstr))); + MIN(sizeof(be_lun->ctl_be_lun.serial_num), + sizeof(tmpstr))); /* Tell the user what we used for a serial number */ strncpy((char *)params->serial_num, tmpstr, - ctl_min(sizeof(params->serial_num), sizeof(tmpstr))); + MIN(sizeof(params->serial_num), sizeof(tmpstr))); } else { strncpy((char *)be_lun->ctl_be_lun.serial_num, params->serial_num, - ctl_min(sizeof(be_lun->ctl_be_lun.serial_num), - sizeof(params->serial_num))); + MIN(sizeof(be_lun->ctl_be_lun.serial_num), + sizeof(params->serial_num))); } if ((params->flags & CTL_LUN_FLAG_DEVID) == 0) { snprintf(tmpstr, sizeof(tmpstr), "MYDEVID%4d", softc->num_luns); strncpy((char *)be_lun->ctl_be_lun.device_id, tmpstr, - ctl_min(sizeof(be_lun->ctl_be_lun.device_id), - sizeof(tmpstr))); + MIN(sizeof(be_lun->ctl_be_lun.device_id), + sizeof(tmpstr))); /* Tell the user what we used for a device ID */ strncpy((char *)params->device_id, tmpstr, - ctl_min(sizeof(params->device_id), sizeof(tmpstr))); + MIN(sizeof(params->device_id), sizeof(tmpstr))); } else { strncpy((char *)be_lun->ctl_be_lun.device_id, params->device_id, - ctl_min(sizeof(be_lun->ctl_be_lun.device_id), - sizeof(params->device_id))); + MIN(sizeof(be_lun->ctl_be_lun.device_id), + sizeof(params->device_id))); } STAILQ_INIT(&be_lun->cont_queue); Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Dec 20 04:57:45 2014 (r275952) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Dec 20 13:33:31 2014 (r275953) @@ -401,8 +401,8 @@ cfcs_datamove(union ctl_io *io) i < cam_sg_count && j < ctl_sg_count;) { uint8_t *cam_ptr, *ctl_ptr; - len_to_copy = ctl_min(cam_sglist[i].ds_len - cam_watermark, - ctl_sglist[j].len - ctl_watermark); + len_to_copy = MIN(cam_sglist[i].ds_len - cam_watermark, + ctl_sglist[j].len - ctl_watermark); cam_ptr = (uint8_t *)cam_sglist[i].ds_addr; cam_ptr = cam_ptr + cam_watermark; Modified: head/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_internal.c Sat Dec 20 04:57:45 2014 (r275952) +++ head/sys/cam/ctl/ctl_frontend_internal.c Sat Dec 20 13:33:31 2014 (r275953) @@ -499,8 +499,8 @@ cfi_datamove(union ctl_io *io) i < ext_sg_entries && j < kern_sg_entries;) { uint8_t *ext_ptr, *kern_ptr; - len_to_copy = ctl_min(ext_sglist[i].len - ext_watermark, - kern_sglist[j].len - kern_watermark); + len_to_copy = MIN(ext_sglist[i].len - ext_watermark, + kern_sglist[j].len - kern_watermark); ext_ptr = (uint8_t *)ext_sglist[i].addr; ext_ptr = ext_ptr + ext_watermark; @@ -1103,8 +1103,8 @@ cfi_metatask_bbr_errorparse(struct cfi_m metatask->taskinfo.bbrread.scsi_status = io->scsiio.scsi_status; memcpy(&metatask->taskinfo.bbrread.sense_data, &io->scsiio.sense_data, - ctl_min(sizeof(metatask->taskinfo.bbrread.sense_data), - sizeof(io->scsiio.sense_data))); + MIN(sizeof(metatask->taskinfo.bbrread.sense_data), + sizeof(io->scsiio.sense_data))); if (io->scsiio.scsi_status == SCSI_STATUS_RESERV_CONFLICT) { metatask->status = CFI_MT_ERROR; From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 13:47:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33744B09; Sat, 20 Dec 2014 13:47:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1F44E2790; Sat, 20 Dec 2014 13:47:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKDldbA027660; Sat, 20 Dec 2014 13:47:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKDldGN027659; Sat, 20 Dec 2014 13:47:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412201347.sBKDldGN027659@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Dec 2014 13:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275954 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 13:47:40 -0000 Author: tuexen Date: Sat Dec 20 13:47:38 2014 New Revision: 275954 URL: https://svnweb.freebsd.org/changeset/base/275954 Log: Cleanup the code. Reported by: Coverity CID: 1232003 Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Dec 20 13:33:31 2014 (r275953) +++ head/sys/netinet/sctp_usrreq.c Sat Dec 20 13:47:38 2014 (r275954) @@ -3643,12 +3643,6 @@ flags_out: (sid < stcb->asoc.streamoutcnt) && ((policy == SCTP_PR_SCTP_ALL) || (PR_SCTP_VALID_POLICY(policy)))) { -#else - if ((stcb != NULL) && - (policy != SCTP_PR_SCTP_NONE) && - (sid < stcb->asoc.streamoutcnt) && - (policy == SCTP_PR_SCTP_ALL)) { -#endif if (policy == SCTP_PR_SCTP_ALL) { sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; @@ -3656,6 +3650,13 @@ flags_out: sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[policy]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[policy]; } +#else + if ((stcb != NULL) && + (policy == SCTP_PR_SCTP_ALL) && + (sid < stcb->asoc.streamoutcnt)) { + sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; + sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; +#endif SCTP_TCB_UNLOCK(stcb); *optsize = sizeof(struct sctp_prstatus); } else { From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 13:51:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01BE5C6A; Sat, 20 Dec 2014 13:51:31 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 820032857; Sat, 20 Dec 2014 13:51:30 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id n3so4299482wiv.1; Sat, 20 Dec 2014 05:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=7sHzxg/gYsDyJ9IoUan2A11T0SWEUGTZzyk8qEwZtNo=; b=p9DJZFRqE8/tDxjmOr1sOggVIDkJS3ScV+2a7mIyRIZ+eqif+HA83nIRuKd80CnG4e zQOa8wwETLwHHRjJwYNbQMwTnkC6dOay9RetFF5Y3I/+agySnTxUx99kxYt27+PxUVuJ Nw//3Q5r9BfRAwFGHAaEuzQUSwoi1g+RMEjxWblOJ78PJjKy8qFLVsvlK8lkMNSE185D vnFluK3+YrOuwLbFuq+N+UXiMKyFUX8SOZvwYHmqqmlbzYRNkY34m7LazHADSCQFfMBs MVFLpZYDF1G7S9i+MKBWDA4EbfKZ3FSAPhyVRkw30FQUOFx6Yyz4KTa6BZv0oq2cu2sr J+cA== X-Received: by 10.180.13.7 with SMTP id d7mr15047506wic.57.1419083488820; Sat, 20 Dec 2014 05:51:28 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id p1sm16415657wjy.22.2014.12.20.05.51.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Dec 2014 05:51:27 -0800 (PST) Sender: Baptiste Daroussin Date: Sat, 20 Dec 2014 14:51:25 +0100 From: Baptiste Daroussin To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r275768 - in head/usr.sbin: . vigr Message-ID: <20141220135125.GE21894@ivaldir.etoilebsd.net> References: <201412141640.sBEGelm0072509@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sfyO1m2EN8ZOtJL6" Content-Disposition: inline In-Reply-To: <201412141640.sBEGelm0072509@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 13:51:31 -0000 --sfyO1m2EN8ZOtJL6 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 14, 2014 at 04:40:47PM +0000, Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Sun Dec 14 16:40:46 2014 > New Revision: 275768 > URL: https://svnweb.freebsd.org/changeset/base/275768 >=20 > Log: > Add a vigr(8) utility which does for /etc/group what vipw(8) does for > /etc/master.passwd. >=20 > Added: > head/usr.sbin/vigr/ > head/usr.sbin/vigr/Makefile (contents, props changed) > head/usr.sbin/vigr/vigr.8 (contents, props changed) > head/usr.sbin/vigr/vigr.sh (contents, props changed) I wonder why you chose making a script instead of using libutil? gr_* have = now the same level of features as of pw_* the benifit would have been to be abl= e to share the code with vipw(8) (maybe just have vigr(8) a hardlink so vipw(8))= and to allow transparent change if one day he have a group db (aka gr_mkdb() is= now a simple rename(2) but could be changed to generate a db like pw_mkdb() doe= s). Best regards, Bapt --sfyO1m2EN8ZOtJL6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlSVftcACgkQ8kTtMUmk6Eyj+QCgh3S3FfLYKHSmEGOaL+auvNkR KM0AoJpN+4xm8Hto360Y6hC9ExGjTJT0 =BDIl -----END PGP SIGNATURE----- --sfyO1m2EN8ZOtJL6-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 14:19:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88B4C2CE; Sat, 20 Dec 2014 14:19:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 74A112AF0; Sat, 20 Dec 2014 14:19:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKEJlTM042529; Sat, 20 Dec 2014 14:19:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKEJlMO042528; Sat, 20 Dec 2014 14:19:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201412201419.sBKEJlMO042528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 20 Dec 2014 14:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275955 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 14:19:47 -0000 Author: glebius Date: Sat Dec 20 14:19:46 2014 New Revision: 275955 URL: https://svnweb.freebsd.org/changeset/base/275955 Log: Add to sbappendstream_locked() a check against NULL mbuf, like it is done in sbappend_locked() and sbappendrecord_locked(). This is a quick fix to the panic introduced by r274712. A proper solution should be to make sosend_generic() avoid calling pru_send() with NULL mbuf for the protocols that do not understand control messages. Those protocols that understand control messages, should be able to receive NULL mbuf, if control is non-NULL. Modified: head/sys/kern/uipc_sockbuf.c Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sat Dec 20 13:47:38 2014 (r275954) +++ head/sys/kern/uipc_sockbuf.c Sat Dec 20 14:19:46 2014 (r275955) @@ -640,6 +640,9 @@ sbappendstream_locked(struct sockbuf *sb { SOCKBUF_LOCK_ASSERT(sb); + if (m == NULL) + return; + KASSERT(m->m_nextpkt == NULL,("sbappendstream 0")); KASSERT(sb->sb_mb == sb->sb_lastrecord,("sbappendstream 1")); From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 15:11:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 651BC863; Sat, 20 Dec 2014 15:11:53 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E4D9C15C6; Sat, 20 Dec 2014 15:11:52 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 453209392; Sat, 20 Dec 2014 15:11:52 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 0EAAD4473; Sat, 20 Dec 2014 16:11:42 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Baptiste Daroussin Subject: Re: svn commit: r275768 - in head/usr.sbin: . vigr References: <201412141640.sBEGelm0072509@svn.freebsd.org> <20141220135125.GE21894@ivaldir.etoilebsd.net> Date: Sat, 20 Dec 2014 16:11:41 +0100 In-Reply-To: <20141220135125.GE21894@ivaldir.etoilebsd.net> (Baptiste Daroussin's message of "Sat, 20 Dec 2014 14:51:25 +0100") Message-ID: <867fxm1hle.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 15:11:53 -0000 Baptiste Daroussin writes: > I wonder why you chose making a script instead of using libutil? 50 lines of shell vs a few hundred lines of C... BTW, we need a new nss implementation; the current one has serious flaws that cannot be fixed without a redesign. That would be a good occasion to write a solid, shared passwd(5) / group(5) parser, and maybe get rid of pwd.db, which serves no real purpose and is not compatible with a full implementation of the + syntax. (we still have to generate it for the sake of older programs, but we don't have to use it) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 15:46:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B610C96; Sat, 20 Dec 2014 15:46:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0CC9919A7; Sat, 20 Dec 2014 15:46:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKFkGHo083530; Sat, 20 Dec 2014 15:46:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKFkGsS083528; Sat, 20 Dec 2014 15:46:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412201546.sBKFkGsS083528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Dec 2014 15:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275956 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 15:46:17 -0000 Author: kib Date: Sat Dec 20 15:46:15 2014 New Revision: 275956 URL: https://svnweb.freebsd.org/changeset/base/275956 Log: MFC r275743: Put the buffer cleanup code after inactivation. Modified: stable/10/sys/kern/vfs_subr.c stable/10/sys/sys/bufobj.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Sat Dec 20 14:19:46 2014 (r275955) +++ stable/10/sys/kern/vfs_subr.c Sat Dec 20 15:46:15 2014 (r275956) @@ -1567,6 +1567,7 @@ buf_vlist_add(struct buf *bp, struct buf int error; ASSERT_BO_WLOCKED(bo); + KASSERT((bo->bo_flag & BO_DEAD) == 0, ("dead bo %p", bo)); KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) == 0, ("buf_vlist_add: Buf %p has existing xflags %d", bp, bp->b_xflags)); bp->b_xflags |= xflags; @@ -2794,16 +2795,6 @@ vgonel(struct vnode *vp) vfs_notify_upper(vp, VFS_NOTIFY_UPPER_RECLAIM); /* - * Clean out any buffers associated with the vnode. - * If the flush fails, just toss the buffers. - */ - mp = NULL; - if (!TAILQ_EMPTY(&vp->v_bufobj.bo_dirty.bv_hd)) - (void) vn_start_secondary_write(vp, &mp, V_WAIT); - if (vinvalbuf(vp, V_SAVE, 0, 0) != 0) - vinvalbuf(vp, 0, 0, 0); - - /* * If purging an active vnode, it must be closed and * deactivated before being reclaimed. */ @@ -2817,6 +2808,29 @@ vgonel(struct vnode *vp) } if (vp->v_type == VSOCK) vfs_unp_reclaim(vp); + + /* + * Clean out any buffers associated with the vnode. + * If the flush fails, just toss the buffers. + */ + mp = NULL; + if (!TAILQ_EMPTY(&vp->v_bufobj.bo_dirty.bv_hd)) + (void) vn_start_secondary_write(vp, &mp, V_WAIT); + if (vinvalbuf(vp, V_SAVE, 0, 0) != 0) { + while (vinvalbuf(vp, 0, 0, 0) != 0) + ; + } +#ifdef INVARIANTS + BO_LOCK(&vp->v_bufobj); + KASSERT(TAILQ_EMPTY(&vp->v_bufobj.bo_dirty.bv_hd) && + vp->v_bufobj.bo_dirty.bv_cnt == 0 && + TAILQ_EMPTY(&vp->v_bufobj.bo_clean.bv_hd) && + vp->v_bufobj.bo_clean.bv_cnt == 0, + ("vp %p bufobj not invalidated", vp)); + vp->v_bufobj.bo_flag |= BO_DEAD; + BO_UNLOCK(&vp->v_bufobj); +#endif + /* * Reclaim the vnode. */ Modified: stable/10/sys/sys/bufobj.h ============================================================================== --- stable/10/sys/sys/bufobj.h Sat Dec 20 14:19:46 2014 (r275955) +++ stable/10/sys/sys/bufobj.h Sat Dec 20 15:46:15 2014 (r275956) @@ -112,6 +112,7 @@ struct bufobj { */ #define BO_ONWORKLST (1 << 0) /* On syncer work-list */ #define BO_WWAIT (1 << 1) /* Wait for output to complete */ +#define BO_DEAD (1 << 2) /* Dead; only with INVARIANTS */ #define BO_LOCKPTR(bo) (&(bo)->bo_lock) #define BO_LOCK(bo) rw_wlock(BO_LOCKPTR((bo))) From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 15:49:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 648D8DEC; Sat, 20 Dec 2014 15:49:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5019319C8; Sat, 20 Dec 2014 15:49:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKFnDL6083948; Sat, 20 Dec 2014 15:49:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKFnDsl083947; Sat, 20 Dec 2014 15:49:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412201549.sBKFnDsl083947@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Dec 2014 15:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275957 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 15:49:13 -0000 Author: kib Date: Sat Dec 20 15:49:12 2014 New Revision: 275957 URL: https://svnweb.freebsd.org/changeset/base/275957 Log: MFC r275744: Only sleep interruptible while waiting for suspension end when filesystem specified VFCF_SBDRY flag, i.e. for NFS. Modified: stable/10/sys/kern/vfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Sat Dec 20 15:46:15 2014 (r275956) +++ stable/10/sys/kern/vfs_vnops.c Sat Dec 20 15:49:12 2014 (r275957) @@ -1579,7 +1579,7 @@ vn_closefile(fp, td) static int vn_start_write_locked(struct mount *mp, int flags) { - int error; + int error, mflags; mtx_assert(MNT_MTX(mp), MA_OWNED); error = 0; @@ -1589,13 +1589,15 @@ vn_start_write_locked(struct mount *mp, */ if ((curthread->td_pflags & TDP_IGNSUSP) == 0 || mp->mnt_susp_owner != curthread) { + mflags = ((mp->mnt_vfc->vfc_flags & VFCF_SBDRY) != 0 ? + (flags & PCATCH) : 0) | (PUSER - 1); while ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) { if (flags & V_NOWAIT) { error = EWOULDBLOCK; goto unlock; } - error = msleep(&mp->mnt_flag, MNT_MTX(mp), - (PUSER - 1) | (flags & PCATCH), "suspfs", 0); + error = msleep(&mp->mnt_flag, MNT_MTX(mp), mflags, + "suspfs", 0); if (error) goto unlock; } @@ -1705,8 +1707,9 @@ vn_start_secondary_write(vp, mpp, flags) /* * Wait for the suspension to finish. */ - error = msleep(&mp->mnt_flag, MNT_MTX(mp), - (PUSER - 1) | (flags & PCATCH) | PDROP, "suspfs", 0); + error = msleep(&mp->mnt_flag, MNT_MTX(mp), (PUSER - 1) | PDROP | + ((mp->mnt_vfc->vfc_flags & VFCF_SBDRY) != 0 ? (flags & PCATCH) : 0), + "suspfs", 0); vfs_rel(mp); if (error == 0) goto retry; From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 16:13:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2E8E306; Sat, 20 Dec 2014 16:13:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DEF9A2182; Sat, 20 Dec 2014 16:13:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKGDWV3097430; Sat, 20 Dec 2014 16:13:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKGDWYT097428; Sat, 20 Dec 2014 16:13:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412201613.sBKGDWYT097428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 20 Dec 2014 16:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275958 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 16:13:33 -0000 Author: mav Date: Sat Dec 20 16:13:31 2014 New Revision: 275958 URL: https://svnweb.freebsd.org/changeset/base/275958 Log: Report XML parsing errors. MFC after: 3 days Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Sat Dec 20 15:49:12 2014 (r275957) +++ head/usr.sbin/ctladm/ctladm.c Sat Dec 20 16:13:31 2014 (r275958) @@ -3643,11 +3643,14 @@ retry: XML_SetCharacterDataHandler(parser, cctl_islist_char_handler); retval = XML_Parse(parser, conn_str, strlen(conn_str), 1); - XML_ParserFree(parser); if (retval != 1) { + warnx("%s: Unable to parse XML: Error %d", __func__, + XML_GetErrorCode(parser)); + XML_ParserFree(parser); retval = 1; goto bailout; } + XML_ParserFree(parser); if (verbose != 0) { STAILQ_FOREACH(conn, &islist.conn_list, links) { @@ -4058,11 +4061,14 @@ retry: XML_SetCharacterDataHandler(parser, cctl_char_handler); retval = XML_Parse(parser, lun_str, strlen(lun_str), 1); - XML_ParserFree(parser); if (retval != 1) { + warnx("%s: Unable to parse XML: Error %d", __func__, + XML_GetErrorCode(parser)); + XML_ParserFree(parser); retval = 1; goto bailout; } + XML_ParserFree(parser); printf("LUN Backend %18s %4s %-16s %-16s\n", "Size (Blocks)", "BS", "Serial Number", "Device ID"); @@ -4336,11 +4342,14 @@ retry: XML_SetCharacterDataHandler(parser, cctl_char_phandler); retval = XML_Parse(parser, port_str, strlen(port_str), 1); - XML_ParserFree(parser); if (retval != 1) { + warnx("%s: Unable to parse XML: Error %d", __func__, + XML_GetErrorCode(parser)); + XML_ParserFree(parser); retval = 1; goto bailout; } + XML_ParserFree(parser); if (quiet == 0) printf("Port Online Frontend Name pp vp\n"); From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 16:31:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88E53595; Sat, 20 Dec 2014 16:31:44 +0000 (UTC) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4BF24AA; Sat, 20 Dec 2014 16:31:43 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id BB4205607B; Sat, 20 Dec 2014 10:31:42 -0600 (CST) Date: Sat, 20 Dec 2014 10:31:42 -0600 From: Mark Linimon To: Neel Natu Subject: Re: svn commit: r275952 - head/sys/amd64/vmm/io Message-ID: <20141220163142.GA15049@lonesome.com> References: <201412200457.sBK4vkLQ084515@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412200457.sBK4vkLQ084515@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 16:31:44 -0000 On Sat, Dec 20, 2014 at 04:57:46AM +0000, Neel Natu wrote: > Various 8259 device model improvements: While I am glad to see this particular commit ... ... I have to say that I am depressed seeing the string "8259" in 2014. That chip was a hack in its time, which was a long time ago. (For those kids in the audience: IIRC it was designed to be part of a chipset supporting the Intel 8085 CPU). The fact that designs still carry around little shards of this is ... miserable. Sigh. mcl From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 16:39:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0389E75A; Sat, 20 Dec 2014 16:39:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D8C5F250B; Sat, 20 Dec 2014 16:39:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKGdv6Y007561; Sat, 20 Dec 2014 16:39:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKGdvvQ007559; Sat, 20 Dec 2014 16:39:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412201639.sBKGdvvQ007559@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 20 Dec 2014 16:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275959 - in head: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 16:39:58 -0000 Author: mav Date: Sat Dec 20 16:39:56 2014 New Revision: 275959 URL: https://svnweb.freebsd.org/changeset/base/275959 Log: Report initiator id in portlist XML in more formalized way. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c head/usr.sbin/ctladm/ctladm.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Dec 20 16:13:31 2014 (r275958) +++ head/sys/cam/ctl/ctl.c Sat Dec 20 16:39:56 2014 (r275959) @@ -3497,11 +3497,11 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (port->wwpn_iid[j].name != NULL) retval = sbuf_printf(sb, - "\t%u %s\n", + "\t%s\n", j, port->wwpn_iid[j].name); else retval = sbuf_printf(sb, - "\t%u naa.%08jx\n", + "\tnaa.%08jx\n", j, port->wwpn_iid[j].wwpn); if (retval != 0) break; Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Sat Dec 20 16:13:31 2014 (r275958) +++ head/usr.sbin/ctladm/ctladm.c Sat Dec 20 16:39:56 2014 (r275959) @@ -4117,6 +4117,7 @@ struct cctl_portlist_data { STAILQ_HEAD(,cctl_port) port_list; struct cctl_port *cur_port; int level; + uint64_t cur_id; struct sbuf *cur_sb[32]; }; @@ -4139,6 +4140,14 @@ cctl_start_pelement(void *user_data, con if (portlist->cur_sb[portlist->level] == NULL) err(1, "%s: Unable to allocate sbuf", __func__); + portlist->cur_id = 0; + for (i = 0; attr[i] != NULL; i += 2) { + if (strcmp(attr[i], "id") == 0) { + portlist->cur_id = strtoull(attr[i+1], NULL, 0); + break; + } + } + if (strcmp(name, "targ_port") == 0) { if (cur_port != NULL) errx(1, "%s: improper port element nesting", __func__); @@ -4153,16 +4162,8 @@ cctl_start_pelement(void *user_data, con STAILQ_INIT(&cur_port->init_list); STAILQ_INIT(&cur_port->attr_list); + cur_port->port_id = portlist->cur_id; STAILQ_INSERT_TAIL(&portlist->port_list, cur_port, links); - - for (i = 0; attr[i] != NULL; i += 2) { - if (strcmp(attr[i], "id") == 0) { - cur_port->port_id = strtoull(attr[i+1], NULL, 0); - } else { - errx(1, "%s: invalid LUN attribute %s = %s", - __func__, attr[i], attr[i+1]); - } - } } } @@ -4231,7 +4232,10 @@ cctl_end_pelement(void *user_data, const err(1, "%s: can't allocate %zd bytes for nv pair", __func__, sizeof(*nv)); - nv->name = strdup(name); + if (strcmp(name, "initiator") == 0) + asprintf(&nv->name, "%ju", portlist->cur_id); + else + nv->name = strdup(name); if (nv->name == NULL) err(1, "%s: can't allocated %zd bytes for string", __func__, strlen(name)); @@ -4372,7 +4376,8 @@ retry: if (port->target) printf(" Target: %s\n", port->target); STAILQ_FOREACH(nv, &port->init_list, links) { - printf(" Initiator: %s\n", nv->value); + printf(" Initiator %s: %s\n", + nv->name, nv->value); } } From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 16:40:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6362B89B; Sat, 20 Dec 2014 16:40:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4FCD42516; Sat, 20 Dec 2014 16:40:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKGeocv008386; Sat, 20 Dec 2014 16:40:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKGeoXQ008385; Sat, 20 Dec 2014 16:40:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412201640.sBKGeoXQ008385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Dec 2014 16:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275960 - head/sys/dev/cpuctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 16:40:50 -0000 Author: kib Date: Sat Dec 20 16:40:49 2014 New Revision: 275960 URL: https://svnweb.freebsd.org/changeset/base/275960 Log: Increase allowed size of the microcode blob to 32KB. Some Intel CPU's updates weight 28KB. PR: 179523 MFC after: 1 week Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Sat Dec 20 16:39:56 2014 (r275959) +++ head/sys/dev/cpuctl/cpuctl.c Sat Dec 20 16:40:49 2014 (r275960) @@ -63,7 +63,7 @@ static d_ioctl_t cpuctl_ioctl; # define DPRINTF(...) #endif -#define UCODE_SIZE_MAX (16 * 1024) +#define UCODE_SIZE_MAX (32 * 1024) static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 18:15:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B7B9811; Sat, 20 Dec 2014 18:15:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 374851B83; Sat, 20 Dec 2014 18:15:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKIFO5N060123; Sat, 20 Dec 2014 18:15:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKIFOSq060122; Sat, 20 Dec 2014 18:15:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412201815.sBKIFOSq060122@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 20 Dec 2014 18:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275961 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 18:15:24 -0000 Author: andrew Date: Sat Dec 20 18:15:23 2014 New Revision: 275961 URL: https://svnweb.freebsd.org/changeset/base/275961 Log: Clean up to use the standard style of "options \t" and "device\t\t" Modified: head/sys/arm/conf/IMX6 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Sat Dec 20 16:40:49 2014 (r275960) +++ head/sys/arm/conf/IMX6 Sat Dec 20 18:15:23 2014 (r275961) @@ -21,139 +21,139 @@ ident IMX6 include "../freescale/imx/std.imx6" options HZ=500 # Scheduling quantum is 2 milliseconds. -options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -#options MD_ROOT # MD is a potential root device -options NFSCL # New Network Filesystem Client -#options NFSD # New Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL +options SCHED_ULE # ULE scheduler +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +#options MD_ROOT # MD is a potential root device +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL options TMPFS # Efficient memory filesystem -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -#options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options GEOM_PART_GPT # GUID Partition Tables. -options GEOM_LABEL # Provides labelization -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options INCLUDE_CONFIG_FILE # Include this file in kernel +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: -options KDB # Enable kernel debugger support. +options KDB # Enable kernel debugger support. # For minimum debugger support use KDB_TRACE, for interactive use DDB. -#options KDB_TRACE # Print a stack trace for a panic. -options DDB # Support DDB. +#options KDB_TRACE # Print a stack trace for a panic. +options DDB # Support DDB. # For full debugger support use this instead: -#options GDB # Support remote GDB. +#options GDB # Support remote GDB. # Other debugging options... makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER # Use to enter debugger. -#options DEBUG -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles +options ALT_BREAK_TO_DEBUGGER # Use to enter debugger. +#options DEBUG +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -#device gif # IPv6 and IPv4 tunneling -#device firmware # firmware assist module -device ether # Ethernet support -device miibus # Required for ethernet -device bpf # Berkeley packet filter (required for DHCP) +device loop # Network loopback +device random # Entropy device +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +#device gif # IPv6 and IPv4 tunneling +#device firmware # firmware assist module +device ether # Ethernet support +device miibus # Required for ethernet +device bpf # Berkeley packet filter (required for DHCP) # General-purpose input/output device gpio # Serial (COM) ports -device uart # Multi-uart driver +device uart # Multi-uart driver # SDCard -device sdhci # SD controller -device mmc # SD/MMC protocol -device mmcsd # SDCard disk device +device sdhci # SD controller +device mmc # SD/MMC protocol +device mmcsd # SDCard disk device # SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) # USB support -#options USB_DEBUG # enable debug msgs -device ehci # OHCI USB interface -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da -device uhid # "Human Interface Devices" -device u3g # USB modems -#device ukbd # Allow keyboard like HIDs to control console -#device ums # USB mouse +#options USB_DEBUG # enable debug msgs +device ehci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" +device u3g # USB modems +#device ukbd # Allow keyboard like HIDs to control console +#device ums # USB mouse # USB Ethernet, requires miibus -#device aue # ADMtek USB Ethernet -#device axe # ASIX Electronics USB Ethernet -#device cdce # Generic USB over Ethernet -#device cue # CATC USB Ethernet -#device kue # Kawasaki LSI USB Ethernet -#device rue # RealTek RTL8150 USB Ethernet -#device udav # Davicom DM9601E USB +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB # USB Wireless -#device rum # Ralink Technology RT2501USB wireless NICs +#device rum # Ralink Technology RT2501USB wireless NICs # Wireless NIC cards -#device wlan # 802.11 support -#device wlan_wep # 802.11 WEP support -#device wlan_ccmp # 802.11 CCMP support -#device wlan_tkip # 802.11 TKIP support -#device wlan_amrr # AMRR transmit rate control algorithm +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm # NOTE: serial console will be disabled if syscons enabled # Uncomment following lines for framebuffer/syscons support # Wandboard has no video console support yet. -#device sc -#device kbdmux -#options SC_DFLT_FONT # compile font in -#makeoptions SC_DFLT_FONT=cp437 +#device sc +#device kbdmux +#options SC_DFLT_FONT # compile font in +#makeoptions SC_DFLT_FONT=cp437 # required for netbooting -#options BOOTP -#options BOOTP_COMPAT -#options BOOTP_NFSROOT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ffec0 +#options BOOTP +#options BOOTP_COMPAT +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ffec0 # U-Boot stuff lives on slice 1, FreeBSD on slice 2. -options ROOTDEVNAME=\"ufs:mmcsd0s2a\" +options ROOTDEVNAME=\"ufs:mmcsd0s2a\" # ARM and SoC-specific options -options FDT # Configure using FDT/DTB data. -options SMP # Enable multiple cores -options VFP # Enable floating point hardware support -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) +options FDT # Configure using FDT/DTB data. +options SMP # Enable multiple cores +options VFP # Enable floating point hardware support +options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) # SoC-specific devices -device ffec # Freescale Fast Ethernet Controller -device fsliic # Freescale i2c/iic -device iic # iic protocol -device iicbus # iic bus -#device imxwdt # Watchdog. WARNING: can't be disabled!!! +device ffec # Freescale Fast Ethernet Controller +device fsliic # Freescale i2c/iic +device iic # iic protocol +device iicbus # iic bus +#device imxwdt # Watchdog. WARNING: can't be disabled!!! From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 18:42:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 278B7A03; Sat, 20 Dec 2014 18:42:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 13C571F76; Sat, 20 Dec 2014 18:42:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKIgLRc079185; Sat, 20 Dec 2014 18:42:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKIgL8f079184; Sat, 20 Dec 2014 18:42:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412201842.sBKIgL8f079184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 20 Dec 2014 18:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275962 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 18:42:22 -0000 Author: andrew Date: Sat Dec 20 18:42:20 2014 New Revision: 275962 URL: https://svnweb.freebsd.org/changeset/base/275962 Log: Clean up the style of the CUBIEBOARD2 config file Modified: head/sys/arm/conf/CUBIEBOARD2 Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Sat Dec 20 18:15:23 2014 (r275961) +++ head/sys/arm/conf/CUBIEBOARD2 Sat Dec 20 18:42:20 2014 (r275962) @@ -20,7 +20,7 @@ ident CUBIEBOARD2 -include "../allwinner/a20/std.a20" +include "../allwinner/a20/std.a20" makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" @@ -34,18 +34,18 @@ options GEOM_PART_MBR # MBR partition options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists +options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories -options MSDOSFS # MSDOS Filesystem +options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PREEMPTION @@ -60,7 +60,7 @@ options KDB options DDB # Enable the kernel debugger options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC @@ -78,15 +78,15 @@ options WITNESS_SKIPSPIN # Don't run wi #options BOOTP_WIRED_TO=cpsw0 # MMC/SD/SDIO card slot support -#device mmc # mmc/sd bus -#device mmcsd # mmc/sd flash cards +#device mmc # mmc/sd bus +#device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card options ROOTDEVNAME=\"ufs:/dev/da0s2\" # ATA controllers -#device ahci # AHCI-compatible SATA controllers -#device ata # Legacy ATA/SATA controllers +#device ahci # AHCI-compatible SATA controllers +#device ata # Legacy ATA/SATA controllers #options ATA_STATIC_ID # Static device numbering # Console and misc @@ -98,8 +98,8 @@ device md device random # Entropy device # I2C support -#device iicbus -#device iic +#device iicbus +#device iic # GPIO device gpio @@ -114,8 +114,8 @@ device usb options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE -#device uhci -#device ohci +#device uhci +#device ohci device ehci device umass @@ -125,7 +125,7 @@ device loop device ether device mii device smscphy -#device cpsw +#device cpsw device bpf device emac From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 19:15:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7533F7B9; Sat, 20 Dec 2014 19:15:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5FABF2497; Sat, 20 Dec 2014 19:15:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKJFBSH095943; Sat, 20 Dec 2014 19:15:11 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKJFBLS095941; Sat, 20 Dec 2014 19:15:11 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412201915.sBKJFBLS095941@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 20 Dec 2014 19:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275963 - in head/sys: arm/broadcom/bcm2835 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 19:15:11 -0000 Author: rpaulo Date: Sat Dec 20 19:15:10 2014 New Revision: 275963 URL: https://svnweb.freebsd.org/changeset/base/275963 Log: Driver for CPU frequency/voltage control on the Raspberry Pi. Differential Revision: https://reviews.freebsd.org/D1025 Submitted by: Daisuke Aoyama aoyama@peach.ne.jp Reviewed by: ian (earlier version), rpaulo MFC after: 1 month Relnotes: yes Added: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox.h head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/boot/fdt/dts/arm/rpi.dts Added: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Sat Dec 20 19:15:10 2014 (r275963) @@ -0,0 +1,1818 @@ +/*- + * Copyright (C) 2013-2014 Daisuke Aoyama + * 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 +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "cpufreq_if.h" +#include "mbox_if.h" + +#ifdef DEBUG +#define DPRINTF(fmt, ...) do { \ + printf("%s:%u: ", __func__, __LINE__); \ + printf(fmt, ##__VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(fmt, ...) +#endif + +#define HZ2MHZ(freq) ((freq) / (1000 * 1000)) +#define MHZ2HZ(freq) ((freq) * (1000 * 1000)) +#define OFFSET2MVOLT(val) (1200 + ((val) * 25)) +#define MVOLT2OFFSET(val) (((val) - 1200) / 25) +#define RAW2K(temp) (((temp) + 273150) / 1000) +#define K2RAW(temp) (((temp) * 1000) - 273150) + +#define DEFAULT_ARM_FREQUENCY 700 +#define DEFAULT_CORE_FREQUENCY 250 +#define DEFAULT_SDRAM_FREQUENCY 400 +#define DEFAULT_LOWEST_FREQ 300 +#define TRANSITION_LATENCY 1000 +#define MIN_OVER_VOLTAGE -16 +#define MAX_OVER_VOLTAGE 6 +#define MSG_ERROR -999999999 +#define MHZSTEP 100 +#define HZSTEP (MHZ2HZ(MHZSTEP)) + +#define VC_LOCK(sc) do { \ + sema_wait(&vc_sema); \ + } while (0) +#define VC_UNLOCK(sc) do { \ + sema_post(&vc_sema); \ + } while (0) + +/* ARM->VC mailbox property semaphore */ +static struct sema vc_sema; + +static struct sysctl_ctx_list bcm2835_sysctl_ctx; + +struct bcm2835_cpufreq_softc { + device_t dev; + int arm_max_freq; + int arm_min_freq; + int core_max_freq; + int core_min_freq; + int sdram_max_freq; + int sdram_min_freq; + int max_voltage_core; + int min_voltage_core; + + /* the values written in mbox */ + int voltage_core; + int voltage_sdram; + int voltage_sdram_c; + int voltage_sdram_i; + int voltage_sdram_p; + int turbo_mode; + + /* mbox buffer (physical address) */ + bus_dma_tag_t dma_tag; + bus_dmamap_t dma_map; + bus_size_t dma_size; + void *dma_buf; + bus_addr_t dma_phys; + + /* initial hook for waiting mbox intr */ + struct intr_config_hook init_hook; +}; + +static int cpufreq_verbose = 0; +TUNABLE_INT("hw.bcm2835.cpufreq.verbose", &cpufreq_verbose); +static int cpufreq_lowest_freq = DEFAULT_LOWEST_FREQ; +TUNABLE_INT("hw.bcm2835.cpufreq.lowest_freq", &cpufreq_lowest_freq); + +#ifdef DEBUG +static void +bcm2835_dump(const void *data, int len) +{ + const uint8_t *p = (const uint8_t*)data; + int i; + + printf("dump @ %p:\n", data); + for (i = 0; i < len; i++) { + printf("%2.2x ", p[i]); + if ((i % 4) == 3) + printf(" "); + if ((i % 16) == 15) + printf("\n"); + } + printf("\n"); +} +#endif + +static int +bcm2835_mbox_call_prop(struct bcm2835_cpufreq_softc *sc) +{ + struct bcm2835_mbox_hdr *msg = (struct bcm2835_mbox_hdr *)sc->dma_buf; + struct bcm2835_mbox_tag_hdr *tag, *last; + uint8_t *up; + device_t mbox; + size_t hdr_size; + int idx; + int err; + + /* + * For multiple calls, locking is not here. The caller must have + * VC semaphore. + */ + + /* get mbox device */ + mbox = devclass_get_device(devclass_find("mbox"), 0); + if (mbox == NULL) { + device_printf(sc->dev, "can't find mbox\n"); + return (-1); + } + + /* go mailbox property */ +#ifdef PROP_DEBUG + bcm2835_dump(msg, 64); +#endif + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + MBOX_WRITE(mbox, BCM2835_MBOX_CHAN_PROP, (uint32_t)sc->dma_phys); + MBOX_READ(mbox, BCM2835_MBOX_CHAN_PROP, &err); + bus_dmamap_sync(sc->dma_tag, sc->dma_map, BUS_DMASYNC_POSTREAD); +#ifdef PROP_DEBUG + bcm2835_dump(msg, 64); +#endif + + /* check response code */ + if (msg->code != BCM2835_MBOX_CODE_RESP_SUCCESS) { + device_printf(sc->dev, "mbox response error\n"); + return (-1); + } + + /* tag = first tag */ + up = (uint8_t *)msg; + hdr_size = sizeof(struct bcm2835_mbox_hdr); + tag = (struct bcm2835_mbox_tag_hdr *)(up + hdr_size); + /* last = end of buffer specified by header */ + last = (struct bcm2835_mbox_tag_hdr *)(up + msg->buf_size); + + /* loop unitl end tag (=0x0) */ + hdr_size = sizeof(struct bcm2835_mbox_tag_hdr); + for (idx = 0; tag->tag != 0; idx++) { + if ((tag->val_len & BCM2835_MBOX_TAG_VAL_LEN_RESPONSE) == 0) { + device_printf(sc->dev, "tag%d response error\n", idx); + return (-1); + } + /* clear response bit */ + tag->val_len &= ~BCM2835_MBOX_TAG_VAL_LEN_RESPONSE; + + /* get next tag */ + up = (uint8_t *)tag; + tag = (struct bcm2835_mbox_tag_hdr *)(up + hdr_size + + tag->val_buf_size); + + /* check buffer size of header */ + if (tag > last) { + device_printf(sc->dev, "mbox buffer size error\n"); + return (-1); + } + } + + return (0); +} + +static int +bcm2835_cpufreq_get_clock_rate(struct bcm2835_cpufreq_softc *sc, + uint32_t clock_id) +{ + struct msg_get_clock_rate *msg; + int rate; + int err; + + /* + * Get clock rate + * Tag: 0x00030002 + * Request: + * Length: 4 + * Value: + * u32: clock id + * Response: + * Length: 8 + * Value: + * u32: clock id + * u32: rate (in Hz) + */ + + /* using DMA buffer for VC */ + msg = (struct msg_get_clock_rate *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_CLOCK_RATE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.clock_id = clock_id; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't get clock rate (id=%u)\n", + clock_id); + return (MSG_ERROR); + } + + /* result (Hz) */ + rate = (int)msg->body.resp.rate_hz; + DPRINTF("clock = %d(Hz)\n", rate); + return (rate); +} + +static int +bcm2835_cpufreq_get_max_clock_rate(struct bcm2835_cpufreq_softc *sc, + uint32_t clock_id) +{ + struct msg_get_max_clock_rate *msg; + int rate; + int err; + + /* + * Get max clock rate + * Tag: 0x00030004 + * Request: + * Length: 4 + * Value: + * u32: clock id + * Response: + * Length: 8 + * Value: + * u32: clock id + * u32: rate (in Hz) + */ + + /* using DMA buffer for VC */ + msg = (struct msg_get_max_clock_rate *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_CLOCK_RATE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.clock_id = clock_id; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't get max clock rate (id=%u)\n", + clock_id); + return (MSG_ERROR); + } + + /* result (Hz) */ + rate = (int)msg->body.resp.rate_hz; + DPRINTF("clock = %d(Hz)\n", rate); + return (rate); +} + +static int +bcm2835_cpufreq_get_min_clock_rate(struct bcm2835_cpufreq_softc *sc, + uint32_t clock_id) +{ + struct msg_get_min_clock_rate *msg; + int rate; + int err; + + /* + * Get min clock rate + * Tag: 0x00030007 + * Request: + * Length: 4 + * Value: + * u32: clock id + * Response: + * Length: 8 + * Value: + * u32: clock id + * u32: rate (in Hz) + */ + + /* using DMA buffer for VC */ + msg = (struct msg_get_min_clock_rate *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_CLOCK_RATE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.clock_id = clock_id; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't get min clock rate (id=%u)\n", + clock_id); + return (MSG_ERROR); + } + + /* result (Hz) */ + rate = (int)msg->body.resp.rate_hz; + DPRINTF("clock = %d(Hz)\n", rate); + return (rate); +} + +static int +bcm2835_cpufreq_set_clock_rate(struct bcm2835_cpufreq_softc *sc, + uint32_t clock_id, uint32_t rate_hz) +{ + struct msg_set_clock_rate *msg; + int rate; + int err; + + /* + * Set clock rate + * Tag: 0x00038002 + * Request: + * Length: 8 + * Value: + * u32: clock id + * u32: rate (in Hz) + * Response: + * Length: 8 + * Value: + * u32: clock id + * u32: rate (in Hz) + */ + + /* using DMA buffer for VC */ + msg = (struct msg_set_clock_rate *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_CLOCK_RATE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.clock_id = clock_id; + msg->body.req.rate_hz = rate_hz; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't set clock rate (id=%u)\n", + clock_id); + return (MSG_ERROR); + } + + /* workaround for core clock */ + if (clock_id == BCM2835_MBOX_CLOCK_ID_CORE) { + /* for safety (may change voltage without changing clock) */ + DELAY(TRANSITION_LATENCY); + + /* + * XXX: the core clock is unable to change at once, + * to change certainly, write it twice now. + */ + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_CLOCK_RATE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.clock_id = clock_id; + msg->body.req.rate_hz = rate_hz; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, + "can't set clock rate (id=%u)\n", clock_id); + return (MSG_ERROR); + } + } + + /* result (Hz) */ + rate = (int)msg->body.resp.rate_hz; + DPRINTF("clock = %d(Hz)\n", rate); + return (rate); +} + +static int +bcm2835_cpufreq_get_turbo(struct bcm2835_cpufreq_softc *sc) +{ + struct msg_get_turbo *msg; + int level; + int err; + + /* + * Get turbo + * Tag: 0x00030009 + * Request: + * Length: 4 + * Value: + * u32: id + * Response: + * Length: 8 + * Value: + * u32: id + * u32: level + */ + + /* using DMA buffer for VC */ + msg = (struct msg_get_turbo *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_TURBO; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.id = 0; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't get turbo\n"); + return (MSG_ERROR); + } + + /* result 0=non-turbo, 1=turbo */ + level = (int)msg->body.resp.level; + DPRINTF("level = %d\n", level); + return (level); +} + +static int +bcm2835_cpufreq_set_turbo(struct bcm2835_cpufreq_softc *sc, uint32_t level) +{ + struct msg_set_turbo *msg; + int value; + int err; + + /* + * Set turbo + * Tag: 0x00038009 + * Request: + * Length: 8 + * Value: + * u32: id + * u32: level + * Response: + * Length: 8 + * Value: + * u32: id + * u32: level + */ + + /* using DMA buffer for VC */ + msg = (struct msg_set_turbo *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* replace unknown value to OFF */ + if (level != BCM2835_MBOX_TURBO_ON && level != BCM2835_MBOX_TURBO_OFF) + level = BCM2835_MBOX_TURBO_OFF; + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_TURBO; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.id = 0; + msg->body.req.level = level; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't set turbo\n"); + return (MSG_ERROR); + } + + /* result 0=non-turbo, 1=turbo */ + value = (int)msg->body.resp.level; + DPRINTF("level = %d\n", value); + return (value); +} + +static int +bcm2835_cpufreq_get_voltage(struct bcm2835_cpufreq_softc *sc, + uint32_t voltage_id) +{ + struct msg_get_voltage *msg; + int value; + int err; + + /* + * Get voltage + * Tag: 0x00030003 + * Request: + * Length: 4 + * Value: + * u32: voltage id + * Response: + * Length: 8 + * Value: + * u32: voltage id + * u32: value (offset from 1.2V in units of 0.025V) + */ + + /* using DMA buffer for VC */ + msg = (struct msg_get_voltage *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_VOLTAGE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.voltage_id = voltage_id; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't get voltage\n"); + return (MSG_ERROR); + } + + /* result (offset from 1.2V) */ + value = (int)msg->body.resp.value; + DPRINTF("value = %d\n", value); + return (value); +} + +static int +bcm2835_cpufreq_get_max_voltage(struct bcm2835_cpufreq_softc *sc, + uint32_t voltage_id) +{ + struct msg_get_max_voltage *msg; + int value; + int err; + + /* + * Get voltage + * Tag: 0x00030005 + * Request: + * Length: 4 + * Value: + * u32: voltage id + * Response: + * Length: 8 + * Value: + * u32: voltage id + * u32: value (offset from 1.2V in units of 0.025V) + */ + + /* using DMA buffer for VC */ + msg = (struct msg_get_max_voltage *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_VOLTAGE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.voltage_id = voltage_id; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't get max voltage\n"); + return (MSG_ERROR); + } + + /* result (offset from 1.2V) */ + value = (int)msg->body.resp.value; + DPRINTF("value = %d\n", value); + return (value); +} +static int +bcm2835_cpufreq_get_min_voltage(struct bcm2835_cpufreq_softc *sc, + uint32_t voltage_id) +{ + struct msg_get_min_voltage *msg; + int value; + int err; + + /* + * Get voltage + * Tag: 0x00030008 + * Request: + * Length: 4 + * Value: + * u32: voltage id + * Response: + * Length: 8 + * Value: + * u32: voltage id + * u32: value (offset from 1.2V in units of 0.025V) + */ + + /* using DMA buffer for VC */ + msg = (struct msg_get_min_voltage *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_VOLTAGE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.voltage_id = voltage_id; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't get min voltage\n"); + return (MSG_ERROR); + } + + /* result (offset from 1.2V) */ + value = (int)msg->body.resp.value; + DPRINTF("value = %d\n", value); + return (value); +} + +static int +bcm2835_cpufreq_set_voltage(struct bcm2835_cpufreq_softc *sc, + uint32_t voltage_id, int32_t value) +{ + struct msg_set_voltage *msg; + int err; + + /* + * Set voltage + * Tag: 0x00038003 + * Request: + * Length: 4 + * Value: + * u32: voltage id + * u32: value (offset from 1.2V in units of 0.025V) + * Response: + * Length: 8 + * Value: + * u32: voltage id + * u32: value (offset from 1.2V in units of 0.025V) + */ + + /* + * over_voltage: + * 0 (1.2 V). Values above 6 are only allowed when force_turbo or + * current_limit_override are specified (which set the warranty bit). + */ + if (value > MAX_OVER_VOLTAGE || value < MIN_OVER_VOLTAGE) { + /* currently not supported */ + device_printf(sc->dev, "not supported voltage: %d\n", value); + return (MSG_ERROR); + } + + /* using DMA buffer for VC */ + msg = (struct msg_set_voltage *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_VOLTAGE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.voltage_id = voltage_id; + msg->body.req.value = (uint32_t)value; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't set voltage\n"); + return (MSG_ERROR); + } + + /* result (offset from 1.2V) */ + value = (int)msg->body.resp.value; + DPRINTF("value = %d\n", value); + return (value); +} + +static int +bcm2835_cpufreq_get_temperature(struct bcm2835_cpufreq_softc *sc) +{ + struct msg_get_temperature *msg; + int value; + int err; + + /* + * Get temperature + * Tag: 0x00030006 + * Request: + * Length: 4 + * Value: + * u32: temperature id + * Response: + * Length: 8 + * Value: + * u32: temperature id + * u32: value + */ + + /* using DMA buffer for VC */ + msg = (struct msg_get_temperature *)sc->dma_buf; + if (sizeof(*msg) > sc->dma_size) { + device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", + sizeof(*msg), sc->dma_size); + return (MSG_ERROR); + } + + /* setup single tag buffer */ + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_TEMPERATURE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.temperature_id = 0; + msg->end_tag = 0; + + /* call mailbox property */ + err = bcm2835_mbox_call_prop(sc); + if (err) { + device_printf(sc->dev, "can't get temperature\n"); + return (MSG_ERROR); + } + + /* result (temperature of degree C) */ + value = (int)msg->body.resp.value; + DPRINTF("value = %d\n", value); + return (value); +} + + + +static int +sysctl_bcm2835_cpufreq_arm_freq(SYSCTL_HANDLER_ARGS) +{ + struct bcm2835_cpufreq_softc *sc = arg1; + int val; + int err; + + /* get realtime value */ + VC_LOCK(sc); + val = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM); + VC_UNLOCK(sc); + if (val == MSG_ERROR) + return (EIO); + + err = sysctl_handle_int(oidp, &val, 0, req); + if (err || !req->newptr) /* error || read request */ + return (err); + + /* write request */ + VC_LOCK(sc); + err = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM, + val); + VC_UNLOCK(sc); + if (err == MSG_ERROR) { + device_printf(sc->dev, "set clock arm_freq error\n"); + return (EIO); + } + DELAY(TRANSITION_LATENCY); + + return (0); +} + +static int +sysctl_bcm2835_cpufreq_core_freq(SYSCTL_HANDLER_ARGS) +{ + struct bcm2835_cpufreq_softc *sc = arg1; + int val; + int err; + + /* get realtime value */ + VC_LOCK(sc); + val = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_CORE); + VC_UNLOCK(sc); + if (val == MSG_ERROR) + return (EIO); + + err = sysctl_handle_int(oidp, &val, 0, req); + if (err || !req->newptr) /* error || read request */ + return (err); + + /* write request */ + VC_LOCK(sc); + err = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_CORE, + val); + if (err == MSG_ERROR) { + VC_UNLOCK(sc); + device_printf(sc->dev, "set clock core_freq error\n"); + return (EIO); + } + VC_UNLOCK(sc); + DELAY(TRANSITION_LATENCY); + + return (0); +} + +static int +sysctl_bcm2835_cpufreq_sdram_freq(SYSCTL_HANDLER_ARGS) +{ + struct bcm2835_cpufreq_softc *sc = arg1; + int val; + int err; + + /* get realtime value */ + VC_LOCK(sc); + val = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_SDRAM); + VC_UNLOCK(sc); + if (val == MSG_ERROR) + return (EIO); + + err = sysctl_handle_int(oidp, &val, 0, req); + if (err || !req->newptr) /* error || read request */ + return (err); + + /* write request */ + VC_LOCK(sc); + err = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_SDRAM, + val); + VC_UNLOCK(sc); + if (err == MSG_ERROR) { + device_printf(sc->dev, "set clock sdram_freq error\n"); + return (EIO); + } + DELAY(TRANSITION_LATENCY); + + return (0); +} + +static int +sysctl_bcm2835_cpufreq_turbo(SYSCTL_HANDLER_ARGS) +{ + struct bcm2835_cpufreq_softc *sc = arg1; + int val; + int err; + + /* get realtime value */ + VC_LOCK(sc); + val = bcm2835_cpufreq_get_turbo(sc); + VC_UNLOCK(sc); + if (val == MSG_ERROR) + return (EIO); + + err = sysctl_handle_int(oidp, &val, 0, req); + if (err || !req->newptr) /* error || read request */ + return (err); + + /* write request */ + if (val > 0) + sc->turbo_mode = BCM2835_MBOX_TURBO_ON; + else + sc->turbo_mode = BCM2835_MBOX_TURBO_OFF; + + VC_LOCK(sc); + err = bcm2835_cpufreq_set_turbo(sc, sc->turbo_mode); + VC_UNLOCK(sc); + if (err == MSG_ERROR) { + device_printf(sc->dev, "set turbo error\n"); + return (EIO); + } + DELAY(TRANSITION_LATENCY); + + return (0); +} + +static int +sysctl_bcm2835_cpufreq_voltage_core(SYSCTL_HANDLER_ARGS) +{ + struct bcm2835_cpufreq_softc *sc = arg1; + int val; + int err; + + /* get realtime value */ + VC_LOCK(sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 19:41:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6595DC95; Sat, 20 Dec 2014 19:41:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 466772C3A; Sat, 20 Dec 2014 19:41:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKJfWgb012532; Sat, 20 Dec 2014 19:41:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKJfWKp012531; Sat, 20 Dec 2014 19:41:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201412201941.sBKJfWKp012531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 20 Dec 2014 19:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275964 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 19:41:32 -0000 Author: adrian Date: Sat Dec 20 19:41:31 2014 New Revision: 275964 URL: https://svnweb.freebsd.org/changeset/base/275964 Log: Document where in scan_task the scan state can change, and potentially deal/log a warning if the scan flags change during one of those race windows. It's highly likely that I need to actually sit down and replace this scan infrastructure at some point. It has some other side effects too - the scan task is a blocking task scheduled in the net80211 taskqueue; so drivers that use this taskqueue have other things not run. Eek. If you see this printf happen then please let me know! Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Sat Dec 20 19:15:10 2014 (r275963) +++ head/sys/net80211/ieee80211_scan.c Sat Dec 20 19:41:31 2014 (r275964) @@ -882,6 +882,9 @@ scan_task(void *arg, int pending) } scanend = ticks + SCAN_PRIVATE(ss)->ss_duration; + + /* XXX scan state can change! Re-validate scan state! */ + IEEE80211_UNLOCK(ic); ic->ic_scan_start(ic); /* notify driver */ IEEE80211_LOCK(ic); @@ -944,6 +947,8 @@ scan_task(void *arg, int pending) ic->ic_scan_curchan(ss, maxdwell); IEEE80211_LOCK(ic); + /* XXX scan state can change! Re-validate scan state! */ + SCAN_PRIVATE(ss)->ss_chanmindwell = ticks + ss->ss_mindwell; /* clear mindwell lock and initial channel change flush */ SCAN_PRIVATE(ss)->ss_iflags &= ~ISCAN_REP; @@ -960,6 +965,7 @@ scan_task(void *arg, int pending) IEEE80211_UNLOCK(ic); ic->ic_scan_end(ic); /* notify driver */ IEEE80211_LOCK(ic); + /* XXX scan state can change! Re-validate scan state! */ /* * Since a cancellation may have occured during one of the @@ -969,10 +975,10 @@ scan_task(void *arg, int pending) ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0)) { /* XXX printf? */ if_printf(vap->iv_ifp, - "%s: OOPS! scan cancelled during driver call!\n", + "%s: OOPS! scan cancelled during driver call (1)!\n", __func__); + scandone = 1; } - scandone |= ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0); /* * Record scan complete time. Note that we also do @@ -1032,6 +1038,19 @@ scan_task(void *arg, int pending) ticks, ss->ss_mindwell, scanend); /* + * Since a cancellation may have occured during one of the + * driver calls (whilst unlocked), update scandone. + */ + if (scandone == 0 && + ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0)) { + /* XXX printf? */ + if_printf(vap->iv_ifp, + "%s: OOPS! scan cancelled during driver call (2)!\n", + __func__); + scandone = 1; + } + + /* * Clear the SCAN bit first in case frames are * pending on the station power save queue. If * we defer this then the dispatch of the frames From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 19:47:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9808EEFF; Sat, 20 Dec 2014 19:47:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 84AFE2D2D; Sat, 20 Dec 2014 19:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKJlqQH016789; Sat, 20 Dec 2014 19:47:52 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKJlqTI016788; Sat, 20 Dec 2014 19:47:52 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412201947.sBKJlqTI016788@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 20 Dec 2014 19:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275965 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 19:47:52 -0000 Author: neel Date: Sat Dec 20 19:47:51 2014 New Revision: 275965 URL: https://svnweb.freebsd.org/changeset/base/275965 Log: Emulate writes to the IA32_MISC_ENABLE MSR. PR: 196093 Reported by: db Tested by: db Discussed with: grehan MFC after: 1 week Modified: head/sys/amd64/vmm/intel/vmx_msr.c Modified: head/sys/amd64/vmm/intel/vmx_msr.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_msr.c Sat Dec 20 19:41:31 2014 (r275964) +++ head/sys/amd64/vmm/intel/vmx_msr.c Sat Dec 20 19:47:51 2014 (r275965) @@ -376,9 +376,31 @@ vmx_rdmsr(struct vmx *vmx, int vcpuid, u int vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu) { - int error = 0; - + uint64_t changed; + int error; + + error = 0; switch (num) { + case MSR_IA32_MISC_ENABLE: + changed = val ^ misc_enable; + /* + * If the host has disabled the NX feature then the guest + * also cannot use it. However, a Linux guest will try to + * enable the NX feature by writing to the MISC_ENABLE MSR. + * + * This can be safely ignored because the memory management + * code looks at CPUID.80000001H:EDX.NX to check if the + * functionality is actually enabled. + */ + changed &= ~(1UL << 34); + + /* + * Punt to userspace if any other bits are being modified. + */ + if (changed) + error = EINVAL; + + break; default: error = EINVAL; break; From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 20:07:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7A34C52; Sat, 20 Dec 2014 20:07:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A89A32FDA; Sat, 20 Dec 2014 20:07:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKK7nTu028259; Sat, 20 Dec 2014 20:07:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKK7nI1028257; Sat, 20 Dec 2014 20:07:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201412202007.sBKK7nI1028257@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 20 Dec 2014 20:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275966 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 20:07:50 -0000 Author: adrian Date: Sat Dec 20 20:07:48 2014 New Revision: 275966 URL: https://svnweb.freebsd.org/changeset/base/275966 Log: Remove some hard-coded IE assembly over to use net80211 methods. PR: kern/196069 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sat Dec 20 19:47:51 2014 (r275965) +++ head/sys/dev/wpi/if_wpi.c Sat Dec 20 20:07:48 2014 (r275966) @@ -2564,7 +2564,7 @@ wpi_scan(struct wpi_softc *sc) struct ieee80211_channel *c; enum ieee80211_phymode mode; uint8_t *frm; - int nrates, pktlen, error, i, nssid; + int pktlen, error, i, nssid; bus_addr_t physaddr; desc = &ring->desc[ring->cur]; @@ -2613,7 +2613,7 @@ wpi_scan(struct wpi_softc *sc) nssid = MIN(ss->ss_nssid, WPI_SCAN_MAX_ESSIDS); for (i = 0; i < nssid; i++) { hdr->scan_essids[i].id = IEEE80211_ELEMID_SSID; - hdr->scan_essids[i].esslen = MIN(ss->ss_ssid[i].len, 32); + hdr->scan_essids[i].esslen = MIN(ss->ss_ssid[i].len, IEEE80211_NWID_LEN); memcpy(hdr->scan_essids[i].essid, ss->ss_ssid[i].ssid, hdr->scan_essids[i].esslen); #ifdef WPI_DEBUG @@ -2630,7 +2630,7 @@ wpi_scan(struct wpi_softc *sc) * Build a probe request frame. Most of the following code is a * copy & paste of what is done in net80211. */ - wh = (struct ieee80211_frame *)&hdr->scan_essids[4]; + wh = (struct ieee80211_frame *)&hdr->scan_essids[WPI_SCAN_MAX_ESSIDS]; wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ; wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; @@ -2642,30 +2642,12 @@ wpi_scan(struct wpi_softc *sc) frm = (uint8_t *)(wh + 1); - /* add essid IE, the hardware will fill this in for us */ - *frm++ = IEEE80211_ELEMID_SSID; - *frm++ = 0; - mode = ieee80211_chan2mode(ic->ic_curchan); rs = &ic->ic_sup_rates[mode]; - /* add supported rates IE */ - *frm++ = IEEE80211_ELEMID_RATES; - nrates = rs->rs_nrates; - if (nrates > IEEE80211_RATE_SIZE) - nrates = IEEE80211_RATE_SIZE; - *frm++ = nrates; - memcpy(frm, rs->rs_rates, nrates); - frm += nrates; - - /* add supported xrates IE */ - if (rs->rs_nrates > IEEE80211_RATE_SIZE) { - nrates = rs->rs_nrates - IEEE80211_RATE_SIZE; - *frm++ = IEEE80211_ELEMID_XRATES; - *frm++ = nrates; - memcpy(frm, rs->rs_rates + IEEE80211_RATE_SIZE, nrates); - frm += nrates; - } + frm = ieee80211_add_ssid(frm, NULL, 0); + frm = ieee80211_add_rates(frm, rs); + frm = ieee80211_add_xrates(frm, rs); /* setup length of probe request */ hdr->tx.len = htole16(frm - (uint8_t *)wh); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sat Dec 20 19:47:51 2014 (r275965) +++ head/sys/dev/wpi/if_wpireg.h Sat Dec 20 20:07:48 2014 (r275966) @@ -511,7 +511,7 @@ struct { struct { uint8_t id; uint8_t esslen; - uint8_t essid[32]; + uint8_t essid[IEEE80211_NWID_LEN]; }scan_essids[WPI_SCAN_MAX_ESSIDS]; /* followed by probe request body */ /* followed by nchan x wpi_scan_chan */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 21:17:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69BFB9F5; Sat, 20 Dec 2014 21:17:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3C4111E34; Sat, 20 Dec 2014 21:17:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKLHTM9061479; Sat, 20 Dec 2014 21:17:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKLHT4W061478; Sat, 20 Dec 2014 21:17:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412202117.sBKLHT4W061478@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Dec 2014 21:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275967 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 21:17:29 -0000 Author: tuexen Date: Sat Dec 20 21:17:28 2014 New Revision: 275967 URL: https://svnweb.freebsd.org/changeset/base/275967 Log: Fix and harmonize the validation of PR-SCTP policies. Reported by: Coverity CID: 1232044 MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Dec 20 20:07:48 2014 (r275966) +++ head/sys/netinet/sctp_usrreq.c Sat Dec 20 21:17:28 2014 (r275967) @@ -3639,10 +3639,10 @@ flags_out: policy = sprstat->sprstat_policy; #if defined(SCTP_DETAILED_STR_STATS) if ((stcb != NULL) && - (policy != SCTP_PR_SCTP_NONE) && (sid < stcb->asoc.streamoutcnt) && - ((policy == SCTP_PR_SCTP_ALL) || - (PR_SCTP_VALID_POLICY(policy)))) { + (policy != SCTP_PR_SCTP_NONE) && + ((policy <= SCTP_PR_SCTP_MAX) || + (policy == SCTP_PR_SCTP_ALL))) { if (policy == SCTP_PR_SCTP_ALL) { sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; @@ -3652,8 +3652,8 @@ flags_out: } #else if ((stcb != NULL) && - (policy == SCTP_PR_SCTP_ALL) && - (sid < stcb->asoc.streamoutcnt)) { + (sid < stcb->asoc.streamoutcnt) && + (policy == SCTP_PR_SCTP_ALL)) { sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; #endif @@ -3676,8 +3676,8 @@ flags_out: policy = sprstat->sprstat_policy; if ((stcb != NULL) && (policy != SCTP_PR_SCTP_NONE) && - ((policy == SCTP_PR_SCTP_ALL) || - (PR_SCTP_VALID_POLICY(policy)))) { + ((policy <= SCTP_PR_SCTP_MAX) || + (policy == SCTP_PR_SCTP_ALL))) { if (policy == SCTP_PR_SCTP_ALL) { sprstat->sprstat_abandoned_unsent = stcb->asoc.abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.abandoned_sent[0]; @@ -6038,7 +6038,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, optsize); SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); - if (PR_SCTP_INVALID_POLICY(info->pr_policy)) { + if (info->pr_policy > SCTP_PR_SCTP_MAX) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 22:12:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 657D638A; Sat, 20 Dec 2014 22:12:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 379792A7F; Sat, 20 Dec 2014 22:12:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKMC572089035; Sat, 20 Dec 2014 22:12:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKMC4FI089033; Sat, 20 Dec 2014 22:12:04 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201412202212.sBKMC4FI089033@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 20 Dec 2014 22:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275968 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 22:12:05 -0000 Author: glebius Date: Sat Dec 20 22:12:04 2014 New Revision: 275968 URL: https://svnweb.freebsd.org/changeset/base/275968 Log: Revert r274494, r274712, r275955 and provide extra comments explaining why there could appear a zero-sized mbufs in socket buffers. A proper fix would be to divorce record socket buffers and stream socket buffers, and divorce pru_send that accepts normal data from pru_send that accepts control data. Modified: head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sat Dec 20 21:17:28 2014 (r275967) +++ head/sys/kern/uipc_sockbuf.c Sat Dec 20 22:12:04 2014 (r275968) @@ -640,9 +640,6 @@ sbappendstream_locked(struct sockbuf *sb { SOCKBUF_LOCK_ASSERT(sb); - if (m == NULL) - return; - KASSERT(m->m_nextpkt == NULL,("sbappendstream 0")); KASSERT(sb->sb_mb == sb->sb_lastrecord,("sbappendstream 1")); @@ -1065,6 +1062,21 @@ sbcut_internal(struct sockbuf *sb, int l m = n; } } + /* + * Free any zero-length mbufs from the buffer. + * For SOCK_DGRAM sockets such mbufs represent empty records. + * XXX: For SOCK_STREAM sockets such mbufs can appear in the buffer, + * when sosend_generic() needs to send only control data. + */ + while (m && m->m_len == 0) { + struct mbuf *n; + + sbfree(sb, m); + n = m->m_next; + m->m_next = mfree; + mfree = m; + m = n; + } if (m) { sb->sb_mb = m; m->m_nextpkt = next; Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Dec 20 21:17:28 2014 (r275967) +++ head/sys/kern/uipc_socket.c Sat Dec 20 22:12:04 2014 (r275968) @@ -1310,11 +1310,14 @@ restart: resid = 0; if (flags & MSG_EOR) top->m_flags |= M_EOR; - } else if (resid > 0) { + } else { /* * Copy the data from userland into a mbuf - * chain. If no data is to be copied in, - * a single empty mbuf is returned. + * chain. If resid is 0, which can happen + * only if we have control to send, then + * a single empty mbuf is returned. This + * is a workaround to prevent protocol send + * methods to panic. */ top = m_uiotombuf(uio, M_WAITOK, space, (atomic ? max_hdr : 0), From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 22:51:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28B12A2A; Sat, 20 Dec 2014 22:51:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1511B141A; Sat, 20 Dec 2014 22:51:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKMp2bK004858; Sat, 20 Dec 2014 22:51:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKMp2Wr004857; Sat, 20 Dec 2014 22:51:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201412202251.sBKMp2Wr004857@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 20 Dec 2014 22:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r275969 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 22:51:03 -0000 Author: cy Date: Sat Dec 20 22:51:01 2014 New Revision: 275969 URL: https://svnweb.freebsd.org/changeset/base/275969 Log: Temporarily remove size limit restriction in order to import ntp-4.2.8 into the vendor branch. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sat Dec 20 22:12:04 2014 (r275968) +++ svnadmin/conf/sizelimit.conf Sat Dec 20 22:51:01 2014 (r275969) @@ -20,6 +20,7 @@ #lulf # adrian brooks +cy des dim ed From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 22:52:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D020BB63; Sat, 20 Dec 2014 22:52:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B598B1448; Sat, 20 Dec 2014 22:52:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKMqgsH007991; Sat, 20 Dec 2014 22:52:42 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKMqg7c007986; Sat, 20 Dec 2014 22:52:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201412202252.sBKMqg7c007986@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 20 Dec 2014 22:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275970 - in vendor/ntp/dist: . adjtimed arlib clockstuff conf html html/build html/description_files html/drivers html/drivers/scripts html/hints html/icons html/pic html/scripts inclu... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 22:52:42 -0000 Author: cy Date: Sat Dec 20 22:52:39 2014 New Revision: 275970 URL: https://svnweb.freebsd.org/changeset/base/275970 Log: Vendor import ntp 4.2.8. Reviewed by: roberto Security: VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2 Security: http://www.kb.cert.org/vuls/id/852879 Security: CVE-2014-9293 Security CVE-2014-9294 Security CVE-2014-9295 Security CVE-2014-9296 Added: vendor/ntp/dist/check-libopts.mf vendor/ntp/dist/html/access.html (contents, props changed) vendor/ntp/dist/html/authentic.html (contents, props changed) vendor/ntp/dist/html/autokey.html (contents, props changed) vendor/ntp/dist/html/clock.html (contents, props changed) vendor/ntp/dist/html/cluster.html (contents, props changed) vendor/ntp/dist/html/discipline.html (contents, props changed) vendor/ntp/dist/html/discover.html (contents, props changed) vendor/ntp/dist/html/drivers/driver45.html (contents, props changed) vendor/ntp/dist/html/drivers/driver46.html (contents, props changed) vendor/ntp/dist/html/filter.html (contents, props changed) vendor/ntp/dist/html/history.html (contents, props changed) vendor/ntp/dist/html/huffpuff.html (contents, props changed) vendor/ntp/dist/html/icons/sitemap.png (contents, props changed) vendor/ntp/dist/html/leap.html (contents, props changed) vendor/ntp/dist/html/orphan.html (contents, props changed) vendor/ntp/dist/html/pic/ vendor/ntp/dist/html/pic/9400n.jpg (contents, props changed) vendor/ntp/dist/html/pic/alice11.gif (contents, props changed) vendor/ntp/dist/html/pic/alice13.gif (contents, props changed) vendor/ntp/dist/html/pic/alice15.gif (contents, props changed) vendor/ntp/dist/html/pic/alice23.gif (contents, props changed) vendor/ntp/dist/html/pic/alice31.gif (contents, props changed) vendor/ntp/dist/html/pic/alice32.gif (contents, props changed) vendor/ntp/dist/html/pic/alice35.gif (contents, props changed) vendor/ntp/dist/html/pic/alice38.gif (contents, props changed) vendor/ntp/dist/html/pic/alice44.gif (contents, props changed) vendor/ntp/dist/html/pic/alice47.gif (contents, props changed) vendor/ntp/dist/html/pic/alice51.gif (contents, props changed) vendor/ntp/dist/html/pic/alice61.gif (contents, props changed) vendor/ntp/dist/html/pic/barnstable.gif (contents, props changed) vendor/ntp/dist/html/pic/beaver.gif (contents, props changed) vendor/ntp/dist/html/pic/boom3.gif (contents, props changed) vendor/ntp/dist/html/pic/boom3a.gif (contents, props changed) vendor/ntp/dist/html/pic/boom4.gif (contents, props changed) vendor/ntp/dist/html/pic/broad.gif (contents, props changed) vendor/ntp/dist/html/pic/bustardfly.gif (contents, props changed) vendor/ntp/dist/html/pic/c51.jpg (contents, props changed) vendor/ntp/dist/html/pic/description.jpg (contents, props changed) vendor/ntp/dist/html/pic/discipline.gif (contents, props changed) vendor/ntp/dist/html/pic/dogsnake.gif (contents, props changed) vendor/ntp/dist/html/pic/driver29.gif (contents, props changed) vendor/ntp/dist/html/pic/driver43_1.gif (contents, props changed) vendor/ntp/dist/html/pic/driver43_2.jpg (contents, props changed) vendor/ntp/dist/html/pic/fg6021.gif (contents, props changed) vendor/ntp/dist/html/pic/fg6039.jpg (contents, props changed) vendor/ntp/dist/html/pic/fig_3_1.gif (contents, props changed) vendor/ntp/dist/html/pic/flatheads.gif (contents, props changed) vendor/ntp/dist/html/pic/flt1.gif (contents, props changed) vendor/ntp/dist/html/pic/flt2.gif (contents, props changed) vendor/ntp/dist/html/pic/flt3.gif (contents, props changed) vendor/ntp/dist/html/pic/flt4.gif (contents, props changed) vendor/ntp/dist/html/pic/flt5.gif (contents, props changed) vendor/ntp/dist/html/pic/flt6.gif (contents, props changed) vendor/ntp/dist/html/pic/flt7.gif (contents, props changed) vendor/ntp/dist/html/pic/flt8.gif (contents, props changed) vendor/ntp/dist/html/pic/flt9.gif (contents, props changed) vendor/ntp/dist/html/pic/freq1211.gif (contents, props changed) vendor/ntp/dist/html/pic/gadget.jpg (contents, props changed) vendor/ntp/dist/html/pic/gps167.jpg (contents, props changed) vendor/ntp/dist/html/pic/group.gif (contents, props changed) vendor/ntp/dist/html/pic/hornraba.gif (contents, props changed) vendor/ntp/dist/html/pic/igclock.gif (contents, props changed) vendor/ntp/dist/html/pic/neoclock4x.gif (contents, props changed) vendor/ntp/dist/html/pic/offset1211.gif (contents, props changed) vendor/ntp/dist/html/pic/oncore_evalbig.gif (contents, props changed) vendor/ntp/dist/html/pic/oncore_remoteant.jpg (contents, props changed) vendor/ntp/dist/html/pic/oncore_utplusbig.gif (contents, props changed) vendor/ntp/dist/html/pic/oz2.gif (contents, props changed) vendor/ntp/dist/html/pic/panda.gif (contents, props changed) vendor/ntp/dist/html/pic/pd_om006.gif (contents, props changed) vendor/ntp/dist/html/pic/pd_om011.gif (contents, props changed) vendor/ntp/dist/html/pic/peer.gif (contents, props changed) vendor/ntp/dist/html/pic/pogo.gif (contents, props changed) vendor/ntp/dist/html/pic/pogo1a.gif (contents, props changed) vendor/ntp/dist/html/pic/pogo3a.gif (contents, props changed) vendor/ntp/dist/html/pic/pogo4.gif (contents, props changed) vendor/ntp/dist/html/pic/pogo5.gif (contents, props changed) vendor/ntp/dist/html/pic/pogo6.gif (contents, props changed) vendor/ntp/dist/html/pic/pogo7.gif (contents, props changed) vendor/ntp/dist/html/pic/pogo8.gif (contents, props changed) vendor/ntp/dist/html/pic/pzf509.jpg (contents, props changed) vendor/ntp/dist/html/pic/pzf511.jpg (contents, props changed) vendor/ntp/dist/html/pic/rabbit.gif (contents, props changed) vendor/ntp/dist/html/pic/radio2.jpg (contents, props changed) vendor/ntp/dist/html/pic/sheepb.jpg (contents, props changed) vendor/ntp/dist/html/pic/stack1a.jpg (contents, props changed) vendor/ntp/dist/html/pic/stats.gif (contents, props changed) vendor/ntp/dist/html/pic/sx5.gif (contents, props changed) vendor/ntp/dist/html/pic/thunderbolt.jpg (contents, props changed) vendor/ntp/dist/html/pic/time1.gif (contents, props changed) vendor/ntp/dist/html/pic/tonea.gif (contents, props changed) vendor/ntp/dist/html/pic/tribeb.gif (contents, props changed) vendor/ntp/dist/html/pic/wingdorothy.gif (contents, props changed) vendor/ntp/dist/html/poll.html (contents, props changed) vendor/ntp/dist/html/scripts/hand.txt (contents, props changed) vendor/ntp/dist/html/scripts/special.txt (contents, props changed) vendor/ntp/dist/html/select.html (contents, props changed) vendor/ntp/dist/html/stats.html (contents, props changed) vendor/ntp/dist/html/warp.html (contents, props changed) vendor/ntp/dist/include/declcond.h (contents, props changed) vendor/ntp/dist/include/intreswork.h (contents, props changed) vendor/ntp/dist/include/libntp.h (contents, props changed) vendor/ntp/dist/include/ntp_prio_q.h (contents, props changed) vendor/ntp/dist/include/ntp_worker.h (contents, props changed) vendor/ntp/dist/include/ntp_workimpl.h (contents, props changed) vendor/ntp/dist/include/timespecops.h (contents, props changed) vendor/ntp/dist/include/timetoa.h (contents, props changed) vendor/ntp/dist/include/timevalops.h (contents, props changed) vendor/ntp/dist/include/vint64ops.h (contents, props changed) vendor/ntp/dist/includes.mf vendor/ntp/dist/lib/isc/Atffile vendor/ntp/dist/lib/isc/app_api.c (contents, props changed) vendor/ntp/dist/lib/isc/backtrace-emptytbl.c (contents, props changed) vendor/ntp/dist/lib/isc/backtrace.c (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/backtrace.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/bind9.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/namespace.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/queue.h (contents, props changed) vendor/ntp/dist/lib/isc/mem_api.c (contents, props changed) vendor/ntp/dist/lib/isc/socket_api.c (contents, props changed) vendor/ntp/dist/lib/isc/task_api.c (contents, props changed) vendor/ntp/dist/lib/isc/tests/ vendor/ntp/dist/lib/isc/tests/Atffile vendor/ntp/dist/lib/isc/tests/hash_test.c (contents, props changed) vendor/ntp/dist/lib/isc/tests/isctest.c (contents, props changed) vendor/ntp/dist/lib/isc/tests/isctest.h (contents, props changed) vendor/ntp/dist/lib/isc/tests/queue_test.c (contents, props changed) vendor/ntp/dist/lib/isc/tests/socket_test.c (contents, props changed) vendor/ntp/dist/lib/isc/tests/symtab_test.c (contents, props changed) vendor/ntp/dist/lib/isc/tests/task_test.c (contents, props changed) vendor/ntp/dist/lib/isc/tests/taskpool_test.c (contents, props changed) vendor/ntp/dist/lib/isc/timer_api.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/libgen.h (contents, props changed) vendor/ntp/dist/libjsmn/ vendor/ntp/dist/libjsmn/LICENSE vendor/ntp/dist/libjsmn/Makefile (contents, props changed) vendor/ntp/dist/libjsmn/README.md vendor/ntp/dist/libjsmn/jsmn.c (contents, props changed) vendor/ntp/dist/libjsmn/jsmn.h (contents, props changed) vendor/ntp/dist/libjsmn/jsmn_test.c (contents, props changed) vendor/ntp/dist/libntp/ntp_calendar.c (contents, props changed) vendor/ntp/dist/libntp/ntp_crypto_rnd.c (contents, props changed) vendor/ntp/dist/libntp/ntp_intres.c (contents, props changed) vendor/ntp/dist/libntp/ntp_worker.c (contents, props changed) vendor/ntp/dist/libntp/socket.c (contents, props changed) vendor/ntp/dist/libntp/strl_obsd.c (contents, props changed) vendor/ntp/dist/libntp/timetoa.c (contents, props changed) vendor/ntp/dist/libntp/timevalops.c (contents, props changed) vendor/ntp/dist/libntp/vint64ops.c (contents, props changed) vendor/ntp/dist/libntp/work_fork.c (contents, props changed) vendor/ntp/dist/libntp/work_thread.c (contents, props changed) vendor/ntp/dist/libparse/clk_sel240x.c (contents, props changed) vendor/ntp/dist/ntpd/complete.conf.in (contents, props changed) vendor/ntp/dist/ntpd/declcond.h (contents, props changed) vendor/ntp/dist/ntpd/invoke-ntp.conf.menu vendor/ntp/dist/ntpd/invoke-ntp.conf.texi vendor/ntp/dist/ntpd/invoke-ntp.keys.menu vendor/ntp/dist/ntpd/invoke-ntp.keys.texi vendor/ntp/dist/ntpd/invoke-ntpd.menu vendor/ntp/dist/ntpd/invoke-ntpd.texi vendor/ntp/dist/ntpd/ntp.conf.5man vendor/ntp/dist/ntpd/ntp.conf.5mdoc vendor/ntp/dist/ntpd/ntp.conf.def vendor/ntp/dist/ntpd/ntp.conf.html (contents, props changed) vendor/ntp/dist/ntpd/ntp.conf.man.in (contents, props changed) vendor/ntp/dist/ntpd/ntp.conf.mdoc.in (contents, props changed) vendor/ntp/dist/ntpd/ntp.conf.texi vendor/ntp/dist/ntpd/ntp.keys.5man vendor/ntp/dist/ntpd/ntp.keys.5mdoc vendor/ntp/dist/ntpd/ntp.keys.def vendor/ntp/dist/ntpd/ntp.keys.html (contents, props changed) vendor/ntp/dist/ntpd/ntp.keys.man.in (contents, props changed) vendor/ntp/dist/ntpd/ntp.keys.mdoc.in (contents, props changed) vendor/ntp/dist/ntpd/ntp.keys.texi vendor/ntp/dist/ntpd/ntp_leapsec.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_leapsec.h (contents, props changed) vendor/ntp/dist/ntpd/ntp_prio_q.c (contents, props changed) vendor/ntp/dist/ntpd/ntpd.1ntpdman vendor/ntp/dist/ntpd/ntpd.1ntpdmdoc vendor/ntp/dist/ntpd/ntpd.html (contents, props changed) vendor/ntp/dist/ntpd/ntpd.man.in (contents, props changed) vendor/ntp/dist/ntpd/ntpd.mdoc.in (contents, props changed) vendor/ntp/dist/ntpd/ntpd.texi vendor/ntp/dist/ntpd/refclock_gpsdjson.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_tsyncpci.c (contents, props changed) vendor/ntp/dist/ntpdc/invoke-ntpdc.menu vendor/ntp/dist/ntpdc/invoke-ntpdc.texi vendor/ntp/dist/ntpdc/ntpdc.1ntpdcman vendor/ntp/dist/ntpdc/ntpdc.1ntpdcmdoc vendor/ntp/dist/ntpdc/ntpdc.html (contents, props changed) vendor/ntp/dist/ntpdc/ntpdc.man.in (contents, props changed) vendor/ntp/dist/ntpdc/ntpdc.mdoc.in (contents, props changed) vendor/ntp/dist/ntpdc/ntpdc.texi vendor/ntp/dist/ntpq/invoke-ntpq.menu vendor/ntp/dist/ntpq/invoke-ntpq.texi vendor/ntp/dist/ntpq/ntpq.1ntpqman vendor/ntp/dist/ntpq/ntpq.1ntpqmdoc vendor/ntp/dist/ntpq/ntpq.html (contents, props changed) vendor/ntp/dist/ntpq/ntpq.man.in (contents, props changed) vendor/ntp/dist/ntpq/ntpq.mdoc.in (contents, props changed) vendor/ntp/dist/ntpq/ntpq.texi vendor/ntp/dist/ntpsnmpd/invoke-ntpsnmpd.menu vendor/ntp/dist/ntpsnmpd/invoke-ntpsnmpd.texi vendor/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdman vendor/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc vendor/ntp/dist/ntpsnmpd/ntpsnmpd.html (contents, props changed) vendor/ntp/dist/ntpsnmpd/ntpsnmpd.man.in (contents, props changed) vendor/ntp/dist/ntpsnmpd/ntpsnmpd.mdoc.in (contents, props changed) vendor/ntp/dist/ntpsnmpd/ntpsnmpd.texi vendor/ntp/dist/ports/ vendor/ntp/dist/ports/winnt/ vendor/ntp/dist/ports/winnt/include/ vendor/ntp/dist/ports/winnt/include/arpa/ vendor/ntp/dist/ports/winnt/include/arpa/inet.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/clockstuff.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/config.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/gaa_compat.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/hopf_PCI_io.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/netdb.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/ntp_iocompletionport.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/ntp_timer.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/ntservice.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/stdint.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/stdnoreturn.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/sys/ vendor/ntp/dist/ports/winnt/include/sys/ioctl.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/sys/param.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/sys/resource.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/sys/signal.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/sys/time.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/sys/wait.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/syslog.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/termios.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/timepps.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/unistd.h (contents, props changed) vendor/ntp/dist/ports/winnt/include/win32_io.h (contents, props changed) vendor/ntp/dist/ports/winnt/instsrv/ vendor/ntp/dist/ports/winnt/instsrv/instsrv.c (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/ vendor/ntp/dist/ports/winnt/libntp/MSG00001.bin (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/SetSystemTime.c (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/getclock.c (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/messages.h (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/messages.mc vendor/ntp/dist/ports/winnt/libntp/messages.rc vendor/ntp/dist/ports/winnt/libntp/randfile.c (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/setpriority.c (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/syslog.c (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/termios.c (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/util_clockstuff.c (contents, props changed) vendor/ntp/dist/ports/winnt/libntp/win32_io.c (contents, props changed) vendor/ntp/dist/ports/winnt/ntpd/ vendor/ntp/dist/ports/winnt/ntpd/hopf_PCI_io.c (contents, props changed) vendor/ntp/dist/ports/winnt/ntpd/nt_clockstuff.c (contents, props changed) vendor/ntp/dist/ports/winnt/ntpd/ntp_iocompletionport.c (contents, props changed) vendor/ntp/dist/ports/winnt/ntpd/ntservice.c (contents, props changed) vendor/ntp/dist/ports/winnt/ntptrace/ vendor/ntp/dist/ports/winnt/ntptrace/ntptrace.dsp vendor/ntp/dist/ports/winnt/ppsapi/ vendor/ntp/dist/ports/winnt/ppsapi/loopback/ vendor/ntp/dist/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/ vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/sys/ vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/sys/time.h (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/loopback/src/timepps.h (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/skelprov/ vendor/ntp/dist/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def vendor/ntp/dist/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln vendor/ntp/dist/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/ppsapi/skelprov/sys/ vendor/ntp/dist/ports/winnt/ppsapi/skelprov/sys/time.h (contents, props changed) vendor/ntp/dist/ports/winnt/scripts/ vendor/ntp/dist/ports/winnt/scripts/mkver.bat (contents, props changed) vendor/ntp/dist/ports/winnt/vs2005/ vendor/ntp/dist/ports/winnt/vs2005/Instsrv.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2005/libntp.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2005/ntp.sln vendor/ntp/dist/ports/winnt/vs2005/ntpd.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2005/ntpdate.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2005/ntpdc.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2005/ntpkeygen.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2005/ntpq.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/ vendor/ntp/dist/ports/winnt/vs2008/instsrv/ vendor/ntp/dist/ports/winnt/vs2008/instsrv/instsrv.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/libntp/ vendor/ntp/dist/ports/winnt/vs2008/libntp/libntp.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/loopback-pps/ vendor/ntp/dist/ports/winnt/vs2008/loopback-pps/loopback-ppsapi-provider.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/ntp-keygen/ vendor/ntp/dist/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/ntp.sln vendor/ntp/dist/ports/winnt/vs2008/ntpd/ vendor/ntp/dist/ports/winnt/vs2008/ntpd-keyword-gen/ vendor/ntp/dist/ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat vendor/ntp/dist/ports/winnt/vs2008/ntpd/ntpd.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/ntpdate/ vendor/ntp/dist/ports/winnt/vs2008/ntpdate/ntpdate.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/ntpdc/ vendor/ntp/dist/ports/winnt/vs2008/ntpdc/ntpdc.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2008/ntpq/ vendor/ntp/dist/ports/winnt/vs2008/ntpq/ntpq.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ vendor/ntp/dist/ports/winnt/vs2013/instsrv/ vendor/ntp/dist/ports/winnt/vs2013/instsrv/instsrv.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/instsrv/instsrv.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/libntp/ vendor/ntp/dist/ports/winnt/vs2013/libntp/libntp.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/libntp/libntp.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/libntp/libntp.vcxproj.filters (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/loopback-pps/ vendor/ntp/dist/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj.filters (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntp-keygen/ vendor/ntp/dist/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj.filters (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntp.sln vendor/ntp/dist/ports/winnt/vs2013/ntpd/ vendor/ntp/dist/ports/winnt/vs2013/ntpd-keyword-gen/ vendor/ntp/dist/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpd/gen-ntp_keyword.bat vendor/ntp/dist/ports/winnt/vs2013/ntpd/ntpd.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpd/ntpd.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpdate/ vendor/ntp/dist/ports/winnt/vs2013/ntpdate/ntpdate.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpdc/ vendor/ntp/dist/ports/winnt/vs2013/ntpdc/ntpdc.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj.filters (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpq/ vendor/ntp/dist/ports/winnt/vs2013/ntpq/ntpq.vcproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpq/ntpq.vcxproj (contents, props changed) vendor/ntp/dist/ports/winnt/vs2013/ntpq/ntpq.vcxproj.filters (contents, props changed) vendor/ntp/dist/scripts/build/ vendor/ntp/dist/scripts/build/Makefile.am (contents, props changed) vendor/ntp/dist/scripts/build/Makefile.in (contents, props changed) vendor/ntp/dist/scripts/build/UpdatePoint (contents, props changed) vendor/ntp/dist/scripts/build/VersionName (contents, props changed) vendor/ntp/dist/scripts/build/check--help (contents, props changed) vendor/ntp/dist/scripts/build/checkChangeLog (contents, props changed) vendor/ntp/dist/scripts/build/checkHtmlFileDates (contents, props changed) vendor/ntp/dist/scripts/build/fixautomakedepsmagic (contents, props changed) vendor/ntp/dist/scripts/build/genCommitLog (contents, props changed) vendor/ntp/dist/scripts/build/genver (contents, props changed) vendor/ntp/dist/scripts/build/mkver.in (contents, props changed) vendor/ntp/dist/scripts/build/updateBEDate (contents, props changed) vendor/ntp/dist/scripts/calc_tickadj/ vendor/ntp/dist/scripts/calc_tickadj/Makefile.am (contents, props changed) vendor/ntp/dist/scripts/calc_tickadj/Makefile.in (contents, props changed) vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj-opts vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj-opts.def vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.html (contents, props changed) vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.in (contents, props changed) vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.man.in (contents, props changed) vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.mdoc.in (contents, props changed) vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.texi vendor/ntp/dist/scripts/calc_tickadj/invoke-calc_tickadj.menu vendor/ntp/dist/scripts/calc_tickadj/invoke-calc_tickadj.texi vendor/ntp/dist/scripts/deprecated/ vendor/ntp/dist/scripts/deprecated/freq_adj.in (contents, props changed) vendor/ntp/dist/scripts/deprecated/hpadjtime.sh (contents, props changed) vendor/ntp/dist/scripts/deprecated/html2man.in (contents, props changed) vendor/ntp/dist/scripts/deprecated/ntp-close (contents, props changed) vendor/ntp/dist/scripts/deprecated/ntp-groper (contents, props changed) vendor/ntp/dist/scripts/deprecated/ntp-restart (contents, props changed) vendor/ntp/dist/scripts/deprecated/ntp-status (contents, props changed) vendor/ntp/dist/scripts/invoke-plot_summary.menu vendor/ntp/dist/scripts/invoke-plot_summary.texi vendor/ntp/dist/scripts/invoke-summary.menu vendor/ntp/dist/scripts/invoke-summary.texi vendor/ntp/dist/scripts/lib/ vendor/ntp/dist/scripts/lib/Makefile.am (contents, props changed) vendor/ntp/dist/scripts/lib/Makefile.in (contents, props changed) vendor/ntp/dist/scripts/lib/NTP/ vendor/ntp/dist/scripts/lib/NTP/Util.pm (contents, props changed) vendor/ntp/dist/scripts/ntp-wait/ vendor/ntp/dist/scripts/ntp-wait/Makefile.am (contents, props changed) vendor/ntp/dist/scripts/ntp-wait/Makefile.in (contents, props changed) vendor/ntp/dist/scripts/ntp-wait/invoke-ntp-wait.menu vendor/ntp/dist/scripts/ntp-wait/invoke-ntp-wait.texi vendor/ntp/dist/scripts/ntp-wait/ntp-wait-opts vendor/ntp/dist/scripts/ntp-wait/ntp-wait-opts.def vendor/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitman vendor/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc vendor/ntp/dist/scripts/ntp-wait/ntp-wait.html (contents, props changed) vendor/ntp/dist/scripts/ntp-wait/ntp-wait.in (contents, props changed) vendor/ntp/dist/scripts/ntp-wait/ntp-wait.man.in (contents, props changed) vendor/ntp/dist/scripts/ntp-wait/ntp-wait.mdoc.in (contents, props changed) vendor/ntp/dist/scripts/ntp-wait/ntp-wait.texi vendor/ntp/dist/scripts/ntpsweep/ vendor/ntp/dist/scripts/ntpsweep/Makefile.am (contents, props changed) vendor/ntp/dist/scripts/ntpsweep/Makefile.in (contents, props changed) vendor/ntp/dist/scripts/ntpsweep/invoke-ntpsweep.menu vendor/ntp/dist/scripts/ntpsweep/invoke-ntpsweep.texi vendor/ntp/dist/scripts/ntpsweep/ntpsweep-opts vendor/ntp/dist/scripts/ntpsweep/ntpsweep-opts.def vendor/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepman vendor/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc vendor/ntp/dist/scripts/ntpsweep/ntpsweep.html (contents, props changed) vendor/ntp/dist/scripts/ntpsweep/ntpsweep.in (contents, props changed) vendor/ntp/dist/scripts/ntpsweep/ntpsweep.man.in (contents, props changed) vendor/ntp/dist/scripts/ntpsweep/ntpsweep.mdoc.in (contents, props changed) vendor/ntp/dist/scripts/ntpsweep/ntpsweep.texi vendor/ntp/dist/scripts/ntptrace/ vendor/ntp/dist/scripts/ntptrace/Makefile.am (contents, props changed) vendor/ntp/dist/scripts/ntptrace/Makefile.in (contents, props changed) vendor/ntp/dist/scripts/ntptrace/invoke-ntptrace.menu vendor/ntp/dist/scripts/ntptrace/invoke-ntptrace.texi vendor/ntp/dist/scripts/ntptrace/ntptrace-opts vendor/ntp/dist/scripts/ntptrace/ntptrace-opts.def vendor/ntp/dist/scripts/ntptrace/ntptrace.1ntptraceman vendor/ntp/dist/scripts/ntptrace/ntptrace.1ntptracemdoc vendor/ntp/dist/scripts/ntptrace/ntptrace.html (contents, props changed) vendor/ntp/dist/scripts/ntptrace/ntptrace.in (contents, props changed) vendor/ntp/dist/scripts/ntptrace/ntptrace.man.in (contents, props changed) vendor/ntp/dist/scripts/ntptrace/ntptrace.mdoc.in (contents, props changed) vendor/ntp/dist/scripts/ntptrace/ntptrace.texi vendor/ntp/dist/scripts/plot_summary-opts vendor/ntp/dist/scripts/plot_summary-opts.def vendor/ntp/dist/scripts/plot_summary.1plot_summaryman vendor/ntp/dist/scripts/plot_summary.1plot_summarymdoc vendor/ntp/dist/scripts/plot_summary.html (contents, props changed) vendor/ntp/dist/scripts/plot_summary.man.in (contents, props changed) vendor/ntp/dist/scripts/plot_summary.mdoc.in (contents, props changed) vendor/ntp/dist/scripts/plot_summary.texi vendor/ntp/dist/scripts/rc/ vendor/ntp/dist/scripts/rc/README vendor/ntp/dist/scripts/rc/ntpd vendor/ntp/dist/scripts/rc/ntpwait vendor/ntp/dist/scripts/rc/rc.d/ vendor/ntp/dist/scripts/rc/rc.d/TIMESYNC vendor/ntp/dist/scripts/rc/rc.d/ntpd vendor/ntp/dist/scripts/rc/rc.d/ntpwait vendor/ntp/dist/scripts/summary-opts vendor/ntp/dist/scripts/summary-opts.def vendor/ntp/dist/scripts/summary.1summaryman vendor/ntp/dist/scripts/summary.1summarymdoc vendor/ntp/dist/scripts/summary.html (contents, props changed) vendor/ntp/dist/scripts/summary.man.in (contents, props changed) vendor/ntp/dist/scripts/summary.mdoc.in (contents, props changed) vendor/ntp/dist/scripts/summary.texi vendor/ntp/dist/sntp/ag-tpl/ vendor/ntp/dist/sntp/ag-tpl/0-old/ vendor/ntp/dist/sntp/ag-tpl/0-old/Mdoc.pm (contents, props changed) vendor/ntp/dist/sntp/ag-tpl/0-old/agman-cmd.tpl vendor/ntp/dist/sntp/ag-tpl/0-old/agmdoc-cmd.tpl vendor/ntp/dist/sntp/ag-tpl/0-old/cmd-doc.tlib vendor/ntp/dist/sntp/ag-tpl/0-old/mdoc-synopsis.tlib vendor/ntp/dist/sntp/ag-tpl/0-old/mdoc2man (contents, props changed) vendor/ntp/dist/sntp/ag-tpl/0-old/mdoc2texi (contents, props changed) vendor/ntp/dist/sntp/ag-tpl/0-old/perlopt.tpl vendor/ntp/dist/sntp/check-libntp.mf vendor/ntp/dist/sntp/check-libopts.mf vendor/ntp/dist/sntp/include/ vendor/ntp/dist/sntp/include/Makefile.am (contents, props changed) vendor/ntp/dist/sntp/include/Makefile.in (contents, props changed) vendor/ntp/dist/sntp/include/autogen-version.def vendor/ntp/dist/sntp/include/copyright.def vendor/ntp/dist/sntp/include/debug-opt.def vendor/ntp/dist/sntp/include/homerc.def vendor/ntp/dist/sntp/include/ntp.lic vendor/ntp/dist/sntp/include/version.def vendor/ntp/dist/sntp/include/version.texi vendor/ntp/dist/sntp/includes.mf vendor/ntp/dist/sntp/invoke-sntp.menu vendor/ntp/dist/sntp/invoke-sntp.texi vendor/ntp/dist/sntp/libevent/ vendor/ntp/dist/sntp/libevent/ChangeLog vendor/ntp/dist/sntp/libevent/ChangeLog-1.4 (contents, props changed) vendor/ntp/dist/sntp/libevent/ChangeLog-2.0 vendor/ntp/dist/sntp/libevent/Doxyfile vendor/ntp/dist/sntp/libevent/LICENSE vendor/ntp/dist/sntp/libevent/Makefile.am (contents, props changed) vendor/ntp/dist/sntp/libevent/Makefile.in (contents, props changed) vendor/ntp/dist/sntp/libevent/Makefile.nmake (contents, props changed) vendor/ntp/dist/sntp/libevent/README vendor/ntp/dist/sntp/libevent/WIN32-Code/ vendor/ntp/dist/sntp/libevent/WIN32-Code/nmake/ vendor/ntp/dist/sntp/libevent/WIN32-Code/nmake/evconfig-private.h (contents, props changed) vendor/ntp/dist/sntp/libevent/WIN32-Code/nmake/event2/ vendor/ntp/dist/sntp/libevent/WIN32-Code/nmake/event2/event-config.h (contents, props changed) vendor/ntp/dist/sntp/libevent/WIN32-Code/tree.h (contents, props changed) vendor/ntp/dist/sntp/libevent/aclocal.m4 vendor/ntp/dist/sntp/libevent/arc4random.c (contents, props changed) vendor/ntp/dist/sntp/libevent/autogen.sh (contents, props changed) vendor/ntp/dist/sntp/libevent/buffer.c (contents, props changed) vendor/ntp/dist/sntp/libevent/buffer_iocp.c (contents, props changed) vendor/ntp/dist/sntp/libevent/bufferevent-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/bufferevent.c (contents, props changed) vendor/ntp/dist/sntp/libevent/bufferevent_async.c (contents, props changed) vendor/ntp/dist/sntp/libevent/bufferevent_filter.c (contents, props changed) vendor/ntp/dist/sntp/libevent/bufferevent_openssl.c (contents, props changed) vendor/ntp/dist/sntp/libevent/bufferevent_pair.c (contents, props changed) vendor/ntp/dist/sntp/libevent/bufferevent_ratelim.c (contents, props changed) vendor/ntp/dist/sntp/libevent/bufferevent_sock.c (contents, props changed) vendor/ntp/dist/sntp/libevent/build-aux/ vendor/ntp/dist/sntp/libevent/build-aux/compile (contents, props changed) vendor/ntp/dist/sntp/libevent/build-aux/config.guess (contents, props changed) vendor/ntp/dist/sntp/libevent/build-aux/config.sub (contents, props changed) vendor/ntp/dist/sntp/libevent/build-aux/depcomp (contents, props changed) vendor/ntp/dist/sntp/libevent/build-aux/install-sh (contents, props changed) vendor/ntp/dist/sntp/libevent/build-aux/ltmain.sh (contents, props changed) vendor/ntp/dist/sntp/libevent/build-aux/missing (contents, props changed) vendor/ntp/dist/sntp/libevent/build-aux/ylwrap (contents, props changed) vendor/ntp/dist/sntp/libevent/changelist-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/compat/ vendor/ntp/dist/sntp/libevent/compat/sys/ vendor/ntp/dist/sntp/libevent/compat/sys/queue.h (contents, props changed) vendor/ntp/dist/sntp/libevent/config.h.in (contents, props changed) vendor/ntp/dist/sntp/libevent/configure (contents, props changed) vendor/ntp/dist/sntp/libevent/configure.ac vendor/ntp/dist/sntp/libevent/defer-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/devpoll.c (contents, props changed) vendor/ntp/dist/sntp/libevent/epoll.c (contents, props changed) vendor/ntp/dist/sntp/libevent/epoll_sub.c (contents, props changed) vendor/ntp/dist/sntp/libevent/epolltable-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/evbuffer-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/evconfig-private.h (contents, props changed) vendor/ntp/dist/sntp/libevent/evconfig-private.h.in (contents, props changed) vendor/ntp/dist/sntp/libevent/evdns.c (contents, props changed) vendor/ntp/dist/sntp/libevent/event-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/event.c (contents, props changed) vendor/ntp/dist/sntp/libevent/event_iocp.c (contents, props changed) vendor/ntp/dist/sntp/libevent/event_rpcgen.py (contents, props changed) vendor/ntp/dist/sntp/libevent/event_tagging.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evmap-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/evmap.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evport.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evrpc-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/evrpc.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evsignal-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/evthread-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/evthread.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evthread_pthread.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evthread_win32.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evutil.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evutil_rand.c (contents, props changed) vendor/ntp/dist/sntp/libevent/evutil_time.c (contents, props changed) vendor/ntp/dist/sntp/libevent/ht-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/http-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/http.c (contents, props changed) vendor/ntp/dist/sntp/libevent/include/ vendor/ntp/dist/sntp/libevent/include/evdns.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/ vendor/ntp/dist/sntp/libevent/include/event2/buffer.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/buffer_compat.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/bufferevent.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/bufferevent_compat.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/bufferevent_ssl.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/bufferevent_struct.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/dns.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/dns_compat.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/dns_struct.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/event.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/event_compat.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/event_struct.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/http.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/http_compat.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/http_struct.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/keyvalq_struct.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/listener.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/rpc.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/rpc_compat.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/rpc_struct.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/tag.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/tag_compat.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/thread.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/util.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/event2/visibility.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/evhttp.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/evrpc.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/evutil.h (contents, props changed) vendor/ntp/dist/sntp/libevent/include/include.am vendor/ntp/dist/sntp/libevent/iocp-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/ipv6-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/kqueue-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/kqueue.c (contents, props changed) vendor/ntp/dist/sntp/libevent/libevent.pc.in (contents, props changed) vendor/ntp/dist/sntp/libevent/libevent_openssl.pc.in (contents, props changed) vendor/ntp/dist/sntp/libevent/libevent_pthreads.pc.in (contents, props changed) vendor/ntp/dist/sntp/libevent/listener.c (contents, props changed) vendor/ntp/dist/sntp/libevent/log-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/log.c (contents, props changed) vendor/ntp/dist/sntp/libevent/m4/ vendor/ntp/dist/sntp/libevent/m4/ac_backport_259_ssizet.m4 vendor/ntp/dist/sntp/libevent/m4/libevent_openssl.m4 vendor/ntp/dist/sntp/libevent/m4/libtool.m4 vendor/ntp/dist/sntp/libevent/m4/ltoptions.m4 vendor/ntp/dist/sntp/libevent/m4/ltsugar.m4 vendor/ntp/dist/sntp/libevent/m4/ltversion.m4 vendor/ntp/dist/sntp/libevent/m4/lt~obsolete.m4 vendor/ntp/dist/sntp/libevent/m4/ntp_pkg_config.m4 vendor/ntp/dist/sntp/libevent/m4/openldap-thread-check.m4 vendor/ntp/dist/sntp/libevent/m4/openldap.m4 vendor/ntp/dist/sntp/libevent/make-event-config.sed (contents, props changed) vendor/ntp/dist/sntp/libevent/minheap-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/mm-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/poll.c (contents, props changed) vendor/ntp/dist/sntp/libevent/ratelim-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/ vendor/ntp/dist/sntp/libevent/sample/dns-example.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/event-read-fifo.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/hello-world.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/hostcheck.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/hostcheck.h (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/http-server.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/https-client.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/include.am vendor/ntp/dist/sntp/libevent/sample/le-proxy.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/openssl_hostname_validation.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/openssl_hostname_validation.h (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/signal-test.c (contents, props changed) vendor/ntp/dist/sntp/libevent/sample/time-test.c (contents, props changed) vendor/ntp/dist/sntp/libevent/select.c (contents, props changed) vendor/ntp/dist/sntp/libevent/signal.c (contents, props changed) vendor/ntp/dist/sntp/libevent/strlcpy-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/strlcpy.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/ vendor/ntp/dist/sntp/libevent/test/Makefile.nmake (contents, props changed) vendor/ntp/dist/sntp/libevent/test/bench.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/bench_cascade.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/bench_http.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/bench_httpclient.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/check-dumpevents.py (contents, props changed) vendor/ntp/dist/sntp/libevent/test/include.am vendor/ntp/dist/sntp/libevent/test/regress.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress.gen.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress.gen.h (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress.h (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress.rpc vendor/ntp/dist/sntp/libevent/test/regress_buffer.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_bufferevent.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_dns.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_et.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_finalize.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_http.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_iocp.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_listener.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_main.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_minheap.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_rpc.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_ssl.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_testutils.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_testutils.h (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_thread.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_thread.h (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_util.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/regress_zlib.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/rpcgen_wrapper.sh (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-changelist.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-closed.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-dumpevents.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-eof.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-fdleak.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-init.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-ratelim.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-time.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test-weof.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/test.sh (contents, props changed) vendor/ntp/dist/sntp/libevent/test/tinytest.c (contents, props changed) vendor/ntp/dist/sntp/libevent/test/tinytest.h (contents, props changed) vendor/ntp/dist/sntp/libevent/test/tinytest_local.h (contents, props changed) vendor/ntp/dist/sntp/libevent/test/tinytest_macros.h (contents, props changed) vendor/ntp/dist/sntp/libevent/time-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/util-internal.h (contents, props changed) vendor/ntp/dist/sntp/libevent/whatsnew-2.0.txt (contents, props changed) vendor/ntp/dist/sntp/libevent/whatsnew-2.1.txt (contents, props changed) vendor/ntp/dist/sntp/libevent/win32select.c (contents, props changed) vendor/ntp/dist/sntp/libopts/alias.c (contents, props changed) vendor/ntp/dist/sntp/libopts/ao-strs.c (contents, props changed) vendor/ntp/dist/sntp/libopts/ao-strs.h (contents, props changed) vendor/ntp/dist/sntp/libopts/check.c (contents, props changed) vendor/ntp/dist/sntp/libopts/compat/_Noreturn.h (contents, props changed) vendor/ntp/dist/sntp/libopts/enum.c (contents, props changed) vendor/ntp/dist/sntp/libopts/env.c (contents, props changed) vendor/ntp/dist/sntp/libopts/find.c (contents, props changed) vendor/ntp/dist/sntp/libopts/gettext.h (contents, props changed) vendor/ntp/dist/sntp/libopts/init.c (contents, props changed) vendor/ntp/dist/sntp/libopts/intprops.h (contents, props changed) vendor/ntp/dist/sntp/libopts/m4/stdnoreturn.m4 vendor/ntp/dist/sntp/libopts/option-value-type.c (contents, props changed) vendor/ntp/dist/sntp/libopts/option-value-type.h (contents, props changed) vendor/ntp/dist/sntp/libopts/option-xat-attribute.c (contents, props changed) vendor/ntp/dist/sntp/libopts/option-xat-attribute.h (contents, props changed) vendor/ntp/dist/sntp/libopts/stdnoreturn.in.h (contents, props changed) vendor/ntp/dist/sntp/loc/ vendor/ntp/dist/sntp/loc/README vendor/ntp/dist/sntp/loc/darwin vendor/ntp/dist/sntp/loc/debian vendor/ntp/dist/sntp/loc/freebsd vendor/ntp/dist/sntp/loc/legacy vendor/ntp/dist/sntp/loc/netbsd vendor/ntp/dist/sntp/loc/redhat vendor/ntp/dist/sntp/loc/solaris vendor/ntp/dist/sntp/m4/ vendor/ntp/dist/sntp/m4/define_dir.m4 vendor/ntp/dist/sntp/m4/hms_search_lib.m4 vendor/ntp/dist/sntp/m4/libtool.m4 vendor/ntp/dist/sntp/m4/ltoptions.m4 vendor/ntp/dist/sntp/m4/ltsugar.m4 vendor/ntp/dist/sntp/m4/ltversion.m4 vendor/ntp/dist/sntp/m4/lt~obsolete.m4 vendor/ntp/dist/sntp/m4/ntp_cacheversion.m4 vendor/ntp/dist/sntp/m4/ntp_compiler.m4 vendor/ntp/dist/sntp/m4/ntp_crosscompile.m4 vendor/ntp/dist/sntp/m4/ntp_crypto_rand.m4 vendor/ntp/dist/sntp/m4/ntp_debug.m4 vendor/ntp/dist/sntp/m4/ntp_dir_sep.m4 vendor/ntp/dist/sntp/m4/ntp_facilitynames.m4 vendor/ntp/dist/sntp/m4/ntp_googletest.m4 vendor/ntp/dist/sntp/m4/ntp_ipv6.m4 vendor/ntp/dist/sntp/m4/ntp_lib_m.m4 vendor/ntp/dist/sntp/m4/ntp_libevent.m4 vendor/ntp/dist/sntp/m4/ntp_libntp.m4 vendor/ntp/dist/sntp/m4/ntp_lineeditlibs.m4 vendor/ntp/dist/sntp/m4/ntp_locinfo.m4 vendor/ntp/dist/sntp/m4/ntp_openssl.m4 vendor/ntp/dist/sntp/m4/ntp_pkg_config.m4 vendor/ntp/dist/sntp/m4/ntp_prog_cc.m4 vendor/ntp/dist/sntp/m4/ntp_rlimit.m4 vendor/ntp/dist/sntp/m4/ntp_sntp.m4 vendor/ntp/dist/sntp/m4/ntp_sysexits.m4 vendor/ntp/dist/sntp/m4/ntp_ver_suffix.m4 vendor/ntp/dist/sntp/m4/ntp_vpathhack.m4 vendor/ntp/dist/sntp/m4/os_cflags.m4 vendor/ntp/dist/sntp/m4/snprintf.m4 vendor/ntp/dist/sntp/m4/version.m4 vendor/ntp/dist/sntp/scm-rev vendor/ntp/dist/sntp/scripts/ vendor/ntp/dist/sntp/scripts/Makefile.am (contents, props changed) vendor/ntp/dist/sntp/scripts/Makefile.in (contents, props changed) vendor/ntp/dist/sntp/scripts/cvo.sh (contents, props changed) vendor/ntp/dist/sntp/scripts/genLocInfo (contents, props changed) vendor/ntp/dist/sntp/scripts/mansec2subst.sed (contents, props changed) vendor/ntp/dist/sntp/sntp.1sntpman vendor/ntp/dist/sntp/sntp.1sntpmdoc vendor/ntp/dist/sntp/sntp.man.in (contents, props changed) vendor/ntp/dist/sntp/sntp.mdoc.in (contents, props changed) vendor/ntp/dist/sntp/tests/ vendor/ntp/dist/sntp/tests/Makefile.am (contents, props changed) vendor/ntp/dist/sntp/tests/Makefile.in (contents, props changed) vendor/ntp/dist/sntp/tests/crypto.cpp (contents, props changed) vendor/ntp/dist/sntp/tests/data/ vendor/ntp/dist/sntp/tests/data/debug-input-lfp-bin vendor/ntp/dist/sntp/tests/data/debug-input-lfp-dec vendor/ntp/dist/sntp/tests/data/debug-input-pkt vendor/ntp/dist/sntp/tests/data/key-test-ascii vendor/ntp/dist/sntp/tests/data/key-test-comments vendor/ntp/dist/sntp/tests/data/key-test-empty vendor/ntp/dist/sntp/tests/data/key-test-hex vendor/ntp/dist/sntp/tests/data/key-test-invalid-hex vendor/ntp/dist/sntp/tests/data/kod-expected-multiple vendor/ntp/dist/sntp/tests/data/kod-expected-single vendor/ntp/dist/sntp/tests/data/kod-test-blanks vendor/ntp/dist/sntp/tests/data/kod-test-correct vendor/ntp/dist/sntp/tests/data/kod-test-empty vendor/ntp/dist/sntp/tests/fileHandlingTest.h (contents, props changed) vendor/ntp/dist/sntp/tests/keyFile.cpp (contents, props changed) vendor/ntp/dist/sntp/tests/kodDatabase.cpp (contents, props changed) vendor/ntp/dist/sntp/tests/kodFile.cpp (contents, props changed) vendor/ntp/dist/sntp/tests/networking.cpp (contents, props changed) vendor/ntp/dist/sntp/tests/packetHandling.cpp (contents, props changed) vendor/ntp/dist/sntp/tests/packetProcessing.cpp (contents, props changed) vendor/ntp/dist/sntp/tests/sntptest.h (contents, props changed) vendor/ntp/dist/sntp/tests/tests-runner (contents, props changed) vendor/ntp/dist/sntp/tests/utilities.cpp (contents, props changed) vendor/ntp/dist/sntp/tests_main.cpp (contents, props changed) vendor/ntp/dist/sntp/tests_main.h (contents, props changed) vendor/ntp/dist/tests/ vendor/ntp/dist/tests/Makefile.am (contents, props changed) vendor/ntp/dist/tests/Makefile.in (contents, props changed) vendor/ntp/dist/tests/libntp/ vendor/ntp/dist/tests/libntp/Makefile.am (contents, props changed) vendor/ntp/dist/tests/libntp/Makefile.in (contents, props changed) vendor/ntp/dist/tests/libntp/a_md5encrypt.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/atoint.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/atouint.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/authkeys.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/buftvtots.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/calendar.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/caljulian.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/caltontp.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/calyearstart.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/clocktime.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/decodenetnum.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/hextoint.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/hextolfp.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/humandate.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/lfpfunc.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/lfptest.h (contents, props changed) vendor/ntp/dist/tests/libntp/lfptostr.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/libntptest.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/libntptest.h (contents, props changed) vendor/ntp/dist/tests/libntp/modetoa.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/msyslog.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/netof.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/numtoa.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/numtohost.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/octtoint.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/prettydate.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/recvbuff.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/refnumtoa.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/sfptostr.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/sockaddrtest.h (contents, props changed) vendor/ntp/dist/tests/libntp/socktoa.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/ssl_init.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/statestr.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/strtolfp.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/timespecops.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/timestructs.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/timestructs.h (contents, props changed) vendor/ntp/dist/tests/libntp/timevalops.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/tstotv.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/tvtots.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/uglydate.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/vi64ops.cpp (contents, props changed) vendor/ntp/dist/tests/libntp/ymd2yd.cpp (contents, props changed) vendor/ntp/dist/tests/ntpd/ vendor/ntp/dist/tests/ntpd/Makefile.am (contents, props changed) vendor/ntp/dist/tests/ntpd/Makefile.in (contents, props changed) vendor/ntp/dist/tests/ntpd/leapsec.cpp (contents, props changed) vendor/ntp/dist/tests/ntpd/ntpdtest.cpp (contents, props changed) vendor/ntp/dist/tests/ntpd/ntpdtest.h (contents, props changed) vendor/ntp/dist/util/invoke-ntp-keygen.menu vendor/ntp/dist/util/invoke-ntp-keygen.texi vendor/ntp/dist/util/ntp-keygen.1ntp-keygenman vendor/ntp/dist/util/ntp-keygen.1ntp-keygenmdoc vendor/ntp/dist/util/ntp-keygen.html (contents, props changed) vendor/ntp/dist/util/ntp-keygen.man.in (contents, props changed) vendor/ntp/dist/util/ntp-keygen.mdoc.in (contents, props changed) vendor/ntp/dist/util/ntp-keygen.texi vendor/ntp/dist/util/tg2.c (contents, props changed) Deleted: vendor/ntp/dist/FREEBSD-Xlist vendor/ntp/dist/FREEBSD-upgrade vendor/ntp/dist/arlib/ vendor/ntp/dist/clockstuff/clktest.c vendor/ntp/dist/excludes vendor/ntp/dist/html/build/ vendor/ntp/dist/html/description_files/ vendor/ntp/dist/html/drivers/driver2.html vendor/ntp/dist/html/gadget.html vendor/ntp/dist/html/manyopt.html vendor/ntp/dist/include/autogen-version.def vendor/ntp/dist/include/copyright.def vendor/ntp/dist/include/debug-opt.def vendor/ntp/dist/include/homerc.def vendor/ntp/dist/include/ntp_data_structures.h vendor/ntp/dist/include/ntp_sprintf.h vendor/ntp/dist/include/version.def vendor/ntp/dist/include/version.texi vendor/ntp/dist/kernel/README vendor/ntp/dist/kernel/chuinit.c vendor/ntp/dist/kernel/clkinit.c vendor/ntp/dist/kernel/sys/chudefs.h vendor/ntp/dist/kernel/sys/clkdefs.h vendor/ntp/dist/kernel/tty_chu.c vendor/ntp/dist/kernel/tty_chu_STREAMS.c vendor/ntp/dist/kernel/tty_clk.c vendor/ntp/dist/kernel/tty_clk_STREAMS.c vendor/ntp/dist/libisc/ vendor/ntp/dist/libntp/fptoa.c vendor/ntp/dist/libntp/fptoms.c vendor/ntp/dist/libntp/inttoa.c vendor/ntp/dist/libntp/memmove.c vendor/ntp/dist/libntp/mfptoa.c vendor/ntp/dist/libntp/mfptoms.c vendor/ntp/dist/libntp/msutotsf.c vendor/ntp/dist/libntp/strstr.c vendor/ntp/dist/libntp/tsftomsu.c vendor/ntp/dist/libntp/tstotv.c vendor/ntp/dist/libntp/tvtots.c vendor/ntp/dist/libntp/uinttoa.c vendor/ntp/dist/libopts/ vendor/ntp/dist/librsaref/ vendor/ntp/dist/m4/ vendor/ntp/dist/ntpd/complete.conf vendor/ntp/dist/ntpd/ntp_data_structures.c vendor/ntp/dist/ntpd/ntp_intres.c vendor/ntp/dist/ntpd/ntpd-opts.menu vendor/ntp/dist/ntpd/ntpd-opts.texi vendor/ntp/dist/ntpd/ntpd.1 vendor/ntp/dist/ntpd/refclock_trak.c vendor/ntp/dist/ntpdate/ntptime_config.c vendor/ntp/dist/ntpdate/ntptimeset.c vendor/ntp/dist/ntpdc/ntpdc-opts.menu vendor/ntp/dist/ntpdc/ntpdc-opts.texi vendor/ntp/dist/ntpdc/ntpdc.1 vendor/ntp/dist/ntpq/ntpq-opts.menu vendor/ntp/dist/ntpq/ntpq-opts.texi vendor/ntp/dist/ntpq/ntpq.1 vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.menu vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.texi vendor/ntp/dist/ntpsnmpd/ntpsnmpd.1 vendor/ntp/dist/scripts/UpdatePoint vendor/ntp/dist/scripts/VersionName vendor/ntp/dist/scripts/calc_tickadj.in vendor/ntp/dist/scripts/check--help vendor/ntp/dist/scripts/checkChangeLog vendor/ntp/dist/scripts/checktime.in vendor/ntp/dist/scripts/cvo.sh vendor/ntp/dist/scripts/fixautomakedepsmagic vendor/ntp/dist/scripts/freq_adj.in vendor/ntp/dist/scripts/genCommitLog vendor/ntp/dist/scripts/genver vendor/ntp/dist/scripts/hpadjtime.sh vendor/ntp/dist/scripts/html2man.in vendor/ntp/dist/scripts/mkver.in vendor/ntp/dist/scripts/ntp-close vendor/ntp/dist/scripts/ntp-groper vendor/ntp/dist/scripts/ntp-restart vendor/ntp/dist/scripts/ntp-status vendor/ntp/dist/scripts/ntp-wait.in vendor/ntp/dist/scripts/ntpsweep.in vendor/ntp/dist/scripts/ntptrace.in vendor/ntp/dist/scripts/rc1/ vendor/ntp/dist/scripts/rc2/ vendor/ntp/dist/scripts/support/ vendor/ntp/dist/sntp/autogen-version.def vendor/ntp/dist/sntp/header.h vendor/ntp/dist/sntp/libopts/enumeration.c vendor/ntp/dist/sntp/libopts/environment.c vendor/ntp/dist/sntp/libopts/value-type.c vendor/ntp/dist/sntp/libopts/value-type.h vendor/ntp/dist/sntp/libopts/xat-attribute.c vendor/ntp/dist/sntp/libopts/xat-attribute.h vendor/ntp/dist/sntp/sntp-opts.menu vendor/ntp/dist/sntp/sntp-opts.texi vendor/ntp/dist/sntp/sntp.1 vendor/ntp/dist/sntp/version.def vendor/ntp/dist/sntp/version.m4 vendor/ntp/dist/sntp/version.texi vendor/ntp/dist/util/ntp-keygen-opts.menu vendor/ntp/dist/util/ntp-keygen-opts.texi vendor/ntp/dist/util/ntp-keygen.1 vendor/ntp/dist/version vendor/ntp/dist/version.m4 Modified: vendor/ntp/dist/COPYRIGHT (contents, props changed) vendor/ntp/dist/ChangeLog (contents, props changed) vendor/ntp/dist/CommitLog vendor/ntp/dist/Makefile.am (contents, props changed) vendor/ntp/dist/Makefile.in (contents, props changed) vendor/ntp/dist/NEWS (contents, props changed) vendor/ntp/dist/WHERE-TO-START (contents, props changed) vendor/ntp/dist/aclocal.m4 (contents, props changed) vendor/ntp/dist/adjtimed/Makefile.am (contents, props changed) vendor/ntp/dist/adjtimed/Makefile.in (contents, props changed) vendor/ntp/dist/bincheck.mf vendor/ntp/dist/bootstrap vendor/ntp/dist/build (contents, props changed) vendor/ntp/dist/clockstuff/Makefile.am (contents, props changed) vendor/ntp/dist/clockstuff/Makefile.in (contents, props changed) vendor/ntp/dist/clockstuff/README (contents, props changed) vendor/ntp/dist/clockstuff/chutest.c (contents, props changed) vendor/ntp/dist/clockstuff/propdelay.c (contents, props changed) vendor/ntp/dist/config.h.in (contents, props changed) vendor/ntp/dist/configure (contents, props changed) vendor/ntp/dist/configure.ac vendor/ntp/dist/deps-ver vendor/ntp/dist/depsver.mf vendor/ntp/dist/flock-build (contents, props changed) vendor/ntp/dist/html/accopt.html (contents, props changed) vendor/ntp/dist/html/assoc.html (contents, props changed) vendor/ntp/dist/html/audio.html (contents, props changed) vendor/ntp/dist/html/authopt.html (contents, props changed) vendor/ntp/dist/html/bugs.html (contents, props changed) vendor/ntp/dist/html/build.html (contents, props changed) vendor/ntp/dist/html/clockopt.html (contents, props changed) vendor/ntp/dist/html/comdex.html (contents, props changed) vendor/ntp/dist/html/config.html (contents, props changed) vendor/ntp/dist/html/confopt.html (contents, props changed) vendor/ntp/dist/html/copyright.html (contents, props changed) vendor/ntp/dist/html/debug.html (contents, props changed) vendor/ntp/dist/html/decode.html (contents, props changed) vendor/ntp/dist/html/drivers/driver1.html (contents, props changed) vendor/ntp/dist/html/drivers/driver10.html (contents, props changed) vendor/ntp/dist/html/drivers/driver11.html (contents, props changed) vendor/ntp/dist/html/drivers/driver12.html (contents, props changed) vendor/ntp/dist/html/drivers/driver16.html (contents, props changed) vendor/ntp/dist/html/drivers/driver18.html (contents, props changed) vendor/ntp/dist/html/drivers/driver19.html (contents, props changed) vendor/ntp/dist/html/drivers/driver20.html (contents, props changed) vendor/ntp/dist/html/drivers/driver22.html (contents, props changed) vendor/ntp/dist/html/drivers/driver26.html (contents, props changed) vendor/ntp/dist/html/drivers/driver27.html (contents, props changed) vendor/ntp/dist/html/drivers/driver28.html (contents, props changed) vendor/ntp/dist/html/drivers/driver29.html (contents, props changed) vendor/ntp/dist/html/drivers/driver3.html (contents, props changed) vendor/ntp/dist/html/drivers/driver30.html (contents, props changed) vendor/ntp/dist/html/drivers/driver31.html vendor/ntp/dist/html/drivers/driver32.html (contents, props changed) vendor/ntp/dist/html/drivers/driver33.html (contents, props changed) vendor/ntp/dist/html/drivers/driver34.html (contents, props changed) vendor/ntp/dist/html/drivers/driver35.html (contents, props changed) vendor/ntp/dist/html/drivers/driver36.html (contents, props changed) vendor/ntp/dist/html/drivers/driver37.html (contents, props changed) vendor/ntp/dist/html/drivers/driver38.html (contents, props changed) vendor/ntp/dist/html/drivers/driver39.html (contents, props changed) vendor/ntp/dist/html/drivers/driver4.html (contents, props changed) vendor/ntp/dist/html/drivers/driver40.html (contents, props changed) vendor/ntp/dist/html/drivers/driver42.html (contents, props changed) vendor/ntp/dist/html/drivers/driver43.html (contents, props changed) vendor/ntp/dist/html/drivers/driver44.html (contents, props changed) vendor/ntp/dist/html/drivers/driver5.html (contents, props changed) vendor/ntp/dist/html/drivers/driver6.html (contents, props changed) vendor/ntp/dist/html/drivers/driver7.html (contents, props changed) vendor/ntp/dist/html/drivers/driver8.html (contents, props changed) vendor/ntp/dist/html/drivers/driver9.html (contents, props changed) vendor/ntp/dist/html/drivers/mx4200data.html (contents, props changed) vendor/ntp/dist/html/drivers/oncore-shmem.html (contents, props changed) vendor/ntp/dist/html/drivers/scripts/footer.txt vendor/ntp/dist/html/drivers/scripts/style.css vendor/ntp/dist/html/drivers/tf582_4.html vendor/ntp/dist/html/extern.html (contents, props changed) vendor/ntp/dist/html/hints.html (contents, props changed) vendor/ntp/dist/html/hints/sco.html (contents, props changed) vendor/ntp/dist/html/hints/solaris.html (contents, props changed) vendor/ntp/dist/html/hints/vxworks.html (contents, props changed) vendor/ntp/dist/html/hints/winnt.html (contents, props changed) vendor/ntp/dist/html/howto.html (contents, props changed) vendor/ntp/dist/html/index.html (contents, props changed) vendor/ntp/dist/html/kern.html (contents, props changed) vendor/ntp/dist/html/kernpps.html (contents, props changed) vendor/ntp/dist/html/keygen.html (contents, props changed) vendor/ntp/dist/html/miscopt.html (contents, props changed) vendor/ntp/dist/html/monopt.html (contents, props changed) vendor/ntp/dist/html/msyslog.html (contents, props changed) vendor/ntp/dist/html/ntp-wait.html (contents, props changed) vendor/ntp/dist/html/ntp_conf.html vendor/ntp/dist/html/ntpd.html (contents, props changed) vendor/ntp/dist/html/ntpdate.html (contents, props changed) vendor/ntp/dist/html/ntpdc.html (contents, props changed) vendor/ntp/dist/html/ntpdsim.html (contents, props changed) vendor/ntp/dist/html/ntpdsim_new.html vendor/ntp/dist/html/ntpq.html (contents, props changed) vendor/ntp/dist/html/ntptime.html (contents, props changed) vendor/ntp/dist/html/ntptrace.html (contents, props changed) vendor/ntp/dist/html/parsedata.html (contents, props changed) vendor/ntp/dist/html/parsenew.html (contents, props changed) vendor/ntp/dist/html/pps.html (contents, props changed) vendor/ntp/dist/html/prefer.html (contents, props changed) vendor/ntp/dist/html/quick.html (contents, props changed) vendor/ntp/dist/html/rate.html (contents, props changed) vendor/ntp/dist/html/rdebug.html (contents, props changed) vendor/ntp/dist/html/refclock.html (contents, props changed) vendor/ntp/dist/html/release.html (contents, props changed) vendor/ntp/dist/html/scripts/accopt.txt (contents, props changed) vendor/ntp/dist/html/scripts/audio.txt (contents, props changed) vendor/ntp/dist/html/scripts/authopt.txt (contents, props changed) vendor/ntp/dist/html/scripts/clockopt.txt (contents, props changed) vendor/ntp/dist/html/scripts/command.txt (contents, props changed) vendor/ntp/dist/html/scripts/config.txt (contents, props changed) vendor/ntp/dist/html/scripts/confopt.txt (contents, props changed) vendor/ntp/dist/html/scripts/external.txt (contents, props changed) vendor/ntp/dist/html/scripts/footer.txt (contents, props changed) vendor/ntp/dist/html/scripts/install.txt (contents, props changed) vendor/ntp/dist/html/scripts/manual.txt (contents, props changed) vendor/ntp/dist/html/scripts/misc.txt (contents, props changed) vendor/ntp/dist/html/scripts/miscopt.txt (contents, props changed) vendor/ntp/dist/html/scripts/monopt.txt (contents, props changed) vendor/ntp/dist/html/scripts/refclock.txt (contents, props changed) vendor/ntp/dist/html/scripts/style.css (contents, props changed) vendor/ntp/dist/html/sitemap.html (contents, props changed) vendor/ntp/dist/html/sntp.html (contents, props changed) vendor/ntp/dist/html/tickadj.html (contents, props changed) vendor/ntp/dist/html/xleave.html (contents, props changed) vendor/ntp/dist/include/Makefile.am (contents, props changed) vendor/ntp/dist/include/Makefile.in (contents, props changed) vendor/ntp/dist/include/iosignal.h (contents, props changed) vendor/ntp/dist/include/isc/Makefile.am (contents, props changed) vendor/ntp/dist/include/isc/Makefile.in (contents, props changed) vendor/ntp/dist/include/isc/mem.h (contents, props changed) vendor/ntp/dist/include/l_stdlib.h (contents, props changed) vendor/ntp/dist/include/lib_strbuf.h (contents, props changed) vendor/ntp/dist/include/mbg_gps166.h (contents, props changed) vendor/ntp/dist/include/ntp.h (contents, props changed) vendor/ntp/dist/include/ntp_assert.h (contents, props changed) vendor/ntp/dist/include/ntp_calendar.h (contents, props changed) vendor/ntp/dist/include/ntp_cmdargs.h (contents, props changed) vendor/ntp/dist/include/ntp_config.h (contents, props changed) vendor/ntp/dist/include/ntp_control.h (contents, props changed) vendor/ntp/dist/include/ntp_crypto.h (contents, props changed) vendor/ntp/dist/include/ntp_debug.h vendor/ntp/dist/include/ntp_filegen.h (contents, props changed) vendor/ntp/dist/include/ntp_fp.h (contents, props changed) vendor/ntp/dist/include/ntp_intres.h (contents, props changed) vendor/ntp/dist/include/ntp_io.h (contents, props changed) vendor/ntp/dist/include/ntp_libopts.h (contents, props changed) vendor/ntp/dist/include/ntp_machine.h (contents, props changed) vendor/ntp/dist/include/ntp_md5.h (contents, props changed) vendor/ntp/dist/include/ntp_net.h (contents, props changed) vendor/ntp/dist/include/ntp_proto.h (contents, props changed) vendor/ntp/dist/include/ntp_random.h vendor/ntp/dist/include/ntp_refclock.h (contents, props changed) vendor/ntp/dist/include/ntp_request.h (contents, props changed) vendor/ntp/dist/include/ntp_rfc2553.h (contents, props changed) vendor/ntp/dist/include/ntp_select.h (contents, props changed) vendor/ntp/dist/include/ntp_stdlib.h (contents, props changed) vendor/ntp/dist/include/ntp_string.h (contents, props changed) vendor/ntp/dist/include/ntp_syscall.h (contents, props changed) vendor/ntp/dist/include/ntp_syslog.h (contents, props changed) vendor/ntp/dist/include/ntp_tty.h (contents, props changed) vendor/ntp/dist/include/ntp_types.h (contents, props changed) vendor/ntp/dist/include/ntp_unixtime.h (contents, props changed) vendor/ntp/dist/include/ntpd.h (contents, props changed) vendor/ntp/dist/include/ntpsim.h (contents, props changed) vendor/ntp/dist/include/recvbuff.h (contents, props changed) vendor/ntp/dist/include/refclock_atom.h (contents, props changed) vendor/ntp/dist/include/timepps-SCO.h vendor/ntp/dist/include/timepps-Solaris.h vendor/ntp/dist/include/timepps-SunOS.h vendor/ntp/dist/kernel/Makefile.am (contents, props changed) vendor/ntp/dist/kernel/Makefile.in (contents, props changed) vendor/ntp/dist/kernel/sys/Makefile.am (contents, props changed) vendor/ntp/dist/kernel/sys/Makefile.in (contents, props changed) vendor/ntp/dist/lib/isc/alpha/include/isc/atomic.h (contents, props changed) vendor/ntp/dist/lib/isc/api vendor/ntp/dist/lib/isc/assertions.c (contents, props changed) vendor/ntp/dist/lib/isc/base32.c (contents, props changed) vendor/ntp/dist/lib/isc/base64.c (contents, props changed) vendor/ntp/dist/lib/isc/entropy.c (contents, props changed) vendor/ntp/dist/lib/isc/hash.c (contents, props changed) vendor/ntp/dist/lib/isc/heap.c (contents, props changed) vendor/ntp/dist/lib/isc/hmacmd5.c (contents, props changed) vendor/ntp/dist/lib/isc/hmacsha.c (contents, props changed) vendor/ntp/dist/lib/isc/httpd.c (contents, props changed) vendor/ntp/dist/lib/isc/ia64/include/isc/atomic.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/app.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/assertions.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/buffer.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/entropy.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/error.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/file.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/fsaccess.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/hash.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/heap.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/hmacmd5.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/hmacsha.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/lib.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/list.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/log.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/md5.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/mem.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/msgs.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/netaddr.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/netscope.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/platform.h.in (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/portset.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/radix.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/random.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/ratelimiter.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/refcount.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/result.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/resultclass.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/serial.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/sha1.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/sha2.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/sockaddr.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/socket.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/stats.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/symtab.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/task.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/taskpool.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/timer.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/types.h (contents, props changed) vendor/ntp/dist/lib/isc/include/isc/util.h (contents, props changed) vendor/ntp/dist/lib/isc/inet_aton.c (contents, props changed) vendor/ntp/dist/lib/isc/inet_ntop.c (contents, props changed) vendor/ntp/dist/lib/isc/inet_pton.c (contents, props changed) vendor/ntp/dist/lib/isc/iterated_hash.c (contents, props changed) vendor/ntp/dist/lib/isc/lib.c (contents, props changed) vendor/ntp/dist/lib/isc/log.c (contents, props changed) vendor/ntp/dist/lib/isc/md5.c (contents, props changed) vendor/ntp/dist/lib/isc/mem.c (contents, props changed) vendor/ntp/dist/lib/isc/mutexblock.c (contents, props changed) vendor/ntp/dist/lib/isc/netaddr.c (contents, props changed) vendor/ntp/dist/lib/isc/powerpc/include/isc/atomic.h (contents, props changed) vendor/ntp/dist/lib/isc/print.c (contents, props changed) vendor/ntp/dist/lib/isc/pthreads/mutex.c (contents, props changed) vendor/ntp/dist/lib/isc/radix.c (contents, props changed) vendor/ntp/dist/lib/isc/random.c (contents, props changed) vendor/ntp/dist/lib/isc/result.c (contents, props changed) vendor/ntp/dist/lib/isc/rwlock.c (contents, props changed) vendor/ntp/dist/lib/isc/sha1.c (contents, props changed) vendor/ntp/dist/lib/isc/sha2.c (contents, props changed) vendor/ntp/dist/lib/isc/sockaddr.c (contents, props changed) vendor/ntp/dist/lib/isc/sparc64/include/isc/atomic.h (contents, props changed) vendor/ntp/dist/lib/isc/stats.c (contents, props changed) vendor/ntp/dist/lib/isc/string.c (contents, props changed) vendor/ntp/dist/lib/isc/symtab.c (contents, props changed) vendor/ntp/dist/lib/isc/task.c (contents, props changed) vendor/ntp/dist/lib/isc/task_p.h (contents, props changed) vendor/ntp/dist/lib/isc/taskpool.c (contents, props changed) vendor/ntp/dist/lib/isc/timer.c (contents, props changed) vendor/ntp/dist/lib/isc/timer_p.h (contents, props changed) vendor/ntp/dist/lib/isc/unix/app.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/dir.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/entropy.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/errno2result.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/errno2result.h (contents, props changed) vendor/ntp/dist/lib/isc/unix/file.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/ifiter_ioctl.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/ifiter_sysctl.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/include/isc/net.h (contents, props changed) vendor/ntp/dist/lib/isc/unix/include/isc/offset.h (contents, props changed) vendor/ntp/dist/lib/isc/unix/include/isc/stdtime.h (contents, props changed) vendor/ntp/dist/lib/isc/unix/include/isc/strerror.h (contents, props changed) vendor/ntp/dist/lib/isc/unix/include/isc/time.h (contents, props changed) vendor/ntp/dist/lib/isc/unix/interfaceiter.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/net.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/resource.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/socket.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/socket_p.h (contents, props changed) vendor/ntp/dist/lib/isc/unix/stdio.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/strerror.c (contents, props changed) vendor/ntp/dist/lib/isc/unix/time.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/app.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/dir.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/entropy.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/file.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/ipv6.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/mutex.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/net.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/ntpaths.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/platform.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/stat.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/stdtime.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/thread.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/time.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/include/isc/win32os.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/interfaceiter.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/libisc.def vendor/ntp/dist/lib/isc/win32/libisc.dsp vendor/ntp/dist/lib/isc/win32/libisc.mak vendor/ntp/dist/lib/isc/win32/net.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/netdb.h (contents, props changed) vendor/ntp/dist/lib/isc/win32/ntgroups.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/ntpaths.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/socket.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/time.c (contents, props changed) vendor/ntp/dist/lib/isc/win32/unistd.h (contents, props changed) vendor/ntp/dist/libntp/Makefile.am (contents, props changed) vendor/ntp/dist/libntp/Makefile.in (contents, props changed) vendor/ntp/dist/libntp/a_md5encrypt.c (contents, props changed) vendor/ntp/dist/libntp/atoint.c (contents, props changed) vendor/ntp/dist/libntp/atolfp.c (contents, props changed) vendor/ntp/dist/libntp/atouint.c (contents, props changed) vendor/ntp/dist/libntp/audio.c (contents, props changed) vendor/ntp/dist/libntp/authkeys.c (contents, props changed) vendor/ntp/dist/libntp/authreadkeys.c (contents, props changed) vendor/ntp/dist/libntp/authusekey.c (contents, props changed) vendor/ntp/dist/libntp/bsd_strerror.c (contents, props changed) vendor/ntp/dist/libntp/buftvtots.c (contents, props changed) vendor/ntp/dist/libntp/caljulian.c (contents, props changed) vendor/ntp/dist/libntp/caltontp.c (contents, props changed) vendor/ntp/dist/libntp/calyearstart.c (contents, props changed) vendor/ntp/dist/libntp/clocktime.c (contents, props changed) vendor/ntp/dist/libntp/clocktypes.c (contents, props changed) vendor/ntp/dist/libntp/decodenetnum.c (contents, props changed) vendor/ntp/dist/libntp/dofptoa.c (contents, props changed) vendor/ntp/dist/libntp/dolfptoa.c (contents, props changed) vendor/ntp/dist/libntp/findconfig.c (contents, props changed) vendor/ntp/dist/libntp/getopt.c (contents, props changed) vendor/ntp/dist/libntp/hextoint.c (contents, props changed) vendor/ntp/dist/libntp/hextolfp.c (contents, props changed) vendor/ntp/dist/libntp/humandate.c (contents, props changed) vendor/ntp/dist/libntp/iosignal.c (contents, props changed) vendor/ntp/dist/libntp/lib_strbuf.c (contents, props changed) vendor/ntp/dist/libntp/machines.c (contents, props changed) vendor/ntp/dist/libntp/mktime.c (contents, props changed) vendor/ntp/dist/libntp/modetoa.c (contents, props changed) vendor/ntp/dist/libntp/mstolfp.c (contents, props changed) vendor/ntp/dist/libntp/msyslog.c (contents, props changed) vendor/ntp/dist/libntp/netof.c (contents, props changed) vendor/ntp/dist/libntp/ntp_libopts.c (contents, props changed) vendor/ntp/dist/libntp/ntp_lineedit.c (contents, props changed) vendor/ntp/dist/libntp/ntp_random.c vendor/ntp/dist/libntp/ntp_rfc2553.c (contents, props changed) vendor/ntp/dist/libntp/numtoa.c (contents, props changed) vendor/ntp/dist/libntp/numtohost.c (contents, props changed) vendor/ntp/dist/libntp/octtoint.c (contents, props changed) vendor/ntp/dist/libntp/prettydate.c (contents, props changed) vendor/ntp/dist/libntp/recvbuff.c (contents, props changed) vendor/ntp/dist/libntp/refnumtoa.c (contents, props changed) vendor/ntp/dist/libntp/snprintf.c (contents, props changed) vendor/ntp/dist/libntp/socktoa.c (contents, props changed) vendor/ntp/dist/libntp/socktohost.c (contents, props changed) vendor/ntp/dist/libntp/ssl_init.c (contents, props changed) vendor/ntp/dist/libntp/statestr.c (contents, props changed) vendor/ntp/dist/libntp/syssignal.c (contents, props changed) vendor/ntp/dist/libntp/systime.c (contents, props changed) vendor/ntp/dist/libntp/uglydate.c (contents, props changed) vendor/ntp/dist/libntp/ymd2yd.c (contents, props changed) vendor/ntp/dist/libparse/Makefile.am (contents, props changed) vendor/ntp/dist/libparse/Makefile.in (contents, props changed) vendor/ntp/dist/libparse/binio.c vendor/ntp/dist/libparse/clk_rawdcf.c (contents, props changed) vendor/ntp/dist/libparse/clk_trimtsip.c (contents, props changed) vendor/ntp/dist/libparse/clk_wharton.c (contents, props changed) vendor/ntp/dist/libparse/data_mbg.c (contents, props changed) vendor/ntp/dist/libparse/gpstolfp.c vendor/ntp/dist/libparse/ieee754io.c vendor/ntp/dist/libparse/mfp_mul.c vendor/ntp/dist/libparse/mkinfo_rcmd.sed (contents, props changed) vendor/ntp/dist/libparse/mkinfo_scmd.sed (contents, props changed) vendor/ntp/dist/libparse/parse.c (contents, props changed) vendor/ntp/dist/libparse/parse_conf.c (contents, props changed) vendor/ntp/dist/libparse/parsesolaris.c (contents, props changed) vendor/ntp/dist/libparse/trim_info.c (contents, props changed) vendor/ntp/dist/ntpd/Makefile.am (contents, props changed) vendor/ntp/dist/ntpd/Makefile.in (contents, props changed) vendor/ntp/dist/ntpd/check_y2k.c (contents, props changed) vendor/ntp/dist/ntpd/cmd_args.c (contents, props changed) vendor/ntp/dist/ntpd/keyword-gen-utd vendor/ntp/dist/ntpd/keyword-gen.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_config.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_control.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_crypto.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_filegen.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_io.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_keyword.h (contents, props changed) vendor/ntp/dist/ntpd/ntp_loopfilter.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_monitor.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_parser.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_parser.h (contents, props changed) vendor/ntp/dist/ntpd/ntp_parser.y vendor/ntp/dist/ntpd/ntp_peer.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_proto.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_refclock.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_request.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_restrict.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_scanner.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_scanner.h (contents, props changed) vendor/ntp/dist/ntpd/ntp_signd.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_timer.c (contents, props changed) vendor/ntp/dist/ntpd/ntp_util.c (contents, props changed) vendor/ntp/dist/ntpd/ntpd-opts.c vendor/ntp/dist/ntpd/ntpd-opts.def vendor/ntp/dist/ntpd/ntpd-opts.h vendor/ntp/dist/ntpd/ntpd.c (contents, props changed) vendor/ntp/dist/ntpd/ntpdbase-opts.def vendor/ntp/dist/ntpd/ntpsim.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_acts.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_arbiter.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_arc.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_as2201.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_atom.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_bancomm.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_chronolog.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_chu.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_conf.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_datum.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_dumbclock.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_fg.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_gpsvme.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_heath.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_hopfpci.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_hopfser.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_hpgps.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_irig.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_jjy.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_jupiter.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_leitch.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_msfees.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_mx4200.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_neoclock4x.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_nmea.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_oncore.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_palisade.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_palisade.h (contents, props changed) vendor/ntp/dist/ntpd/refclock_parse.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_pcf.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_pst.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_ripencc.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_shm.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_tpro.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_true.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_tt560.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_ulink.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_wwv.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_wwvb.c (contents, props changed) vendor/ntp/dist/ntpd/refclock_zyfer.c (contents, props changed) vendor/ntp/dist/ntpdate/Makefile.am (contents, props changed) vendor/ntp/dist/ntpdate/Makefile.in (contents, props changed) vendor/ntp/dist/ntpdate/ntpdate.c (contents, props changed) vendor/ntp/dist/ntpdate/ntpdate.h (contents, props changed) vendor/ntp/dist/ntpdc/Makefile.am (contents, props changed) vendor/ntp/dist/ntpdc/Makefile.in (contents, props changed) vendor/ntp/dist/ntpdc/layout.std (contents, props changed) vendor/ntp/dist/ntpdc/nl.pl (contents, props changed) vendor/ntp/dist/ntpdc/nl.pl.in (contents, props changed) vendor/ntp/dist/ntpdc/ntpdc-layout.c (contents, props changed) vendor/ntp/dist/ntpdc/ntpdc-opts.c vendor/ntp/dist/ntpdc/ntpdc-opts.def vendor/ntp/dist/ntpdc/ntpdc-opts.h vendor/ntp/dist/ntpdc/ntpdc.c (contents, props changed) vendor/ntp/dist/ntpdc/ntpdc.h (contents, props changed) vendor/ntp/dist/ntpdc/ntpdc_ops.c (contents, props changed) vendor/ntp/dist/ntpq/Makefile.am (contents, props changed) vendor/ntp/dist/ntpq/Makefile.in (contents, props changed) vendor/ntp/dist/ntpq/libntpq.c (contents, props changed) vendor/ntp/dist/ntpq/libntpq.h (contents, props changed) vendor/ntp/dist/ntpq/libntpq_subs.c (contents, props changed) vendor/ntp/dist/ntpq/ntpq-opts.c vendor/ntp/dist/ntpq/ntpq-opts.def vendor/ntp/dist/ntpq/ntpq-opts.h vendor/ntp/dist/ntpq/ntpq-subs.c vendor/ntp/dist/ntpq/ntpq.c (contents, props changed) vendor/ntp/dist/ntpq/ntpq.h (contents, props changed) vendor/ntp/dist/ntpsnmpd/Makefile.am (contents, props changed) vendor/ntp/dist/ntpsnmpd/Makefile.in (contents, props changed) vendor/ntp/dist/ntpsnmpd/netsnmp_daemonize.c (contents, props changed) vendor/ntp/dist/ntpsnmpd/ntpSnmpSubagentObject.c (contents, props changed) vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c (contents, props changed) vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.def vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h (contents, props changed) vendor/ntp/dist/ntpsnmpd/ntpsnmpd.c (contents, props changed) vendor/ntp/dist/packageinfo.sh vendor/ntp/dist/parseutil/Makefile.am (contents, props changed) vendor/ntp/dist/parseutil/Makefile.in (contents, props changed) vendor/ntp/dist/parseutil/dcfd.c (contents, props changed) vendor/ntp/dist/parseutil/testdcf.c (contents, props changed) vendor/ntp/dist/readme.y2kfixes (contents, props changed) vendor/ntp/dist/scripts/Makefile.am (contents, props changed) vendor/ntp/dist/scripts/Makefile.in (contents, props changed) vendor/ntp/dist/scripts/README (contents, props changed) vendor/ntp/dist/scripts/monitoring/ntp.pl (contents, props changed) vendor/ntp/dist/scripts/monitoring/ntptrap (contents, props changed) vendor/ntp/dist/scripts/ntpver.in (contents, props changed) vendor/ntp/dist/scripts/plot_summary.in (contents, props changed) vendor/ntp/dist/scripts/summary.in (contents, props changed) vendor/ntp/dist/sntp/COPYRIGHT vendor/ntp/dist/sntp/Makefile.am (contents, props changed) vendor/ntp/dist/sntp/Makefile.in (contents, props changed) vendor/ntp/dist/sntp/aclocal.m4 (contents, props changed) vendor/ntp/dist/sntp/bincheck.mf vendor/ntp/dist/sntp/config.h.in vendor/ntp/dist/sntp/configure (contents, props changed) vendor/ntp/dist/sntp/configure.ac (contents, props changed) vendor/ntp/dist/sntp/crypto.c (contents, props changed) vendor/ntp/dist/sntp/crypto.h (contents, props changed) vendor/ntp/dist/sntp/deps-ver vendor/ntp/dist/sntp/depsver.mf vendor/ntp/dist/sntp/kod_management.c (contents, props changed) vendor/ntp/dist/sntp/kod_management.h (contents, props changed) vendor/ntp/dist/sntp/libopts/COPYING.gplv3 vendor/ntp/dist/sntp/libopts/COPYING.lgplv3 vendor/ntp/dist/sntp/libopts/Makefile.am vendor/ntp/dist/sntp/libopts/Makefile.in vendor/ntp/dist/sntp/libopts/README vendor/ntp/dist/sntp/libopts/ag-char-map.h (contents, props changed) vendor/ntp/dist/sntp/libopts/autoopts.c vendor/ntp/dist/sntp/libopts/autoopts.h vendor/ntp/dist/sntp/libopts/autoopts/options.h vendor/ntp/dist/sntp/libopts/autoopts/project.h (contents, props changed) vendor/ntp/dist/sntp/libopts/autoopts/usage-txt.h vendor/ntp/dist/sntp/libopts/boolean.c vendor/ntp/dist/sntp/libopts/compat/compat.h vendor/ntp/dist/sntp/libopts/compat/pathfind.c vendor/ntp/dist/sntp/libopts/compat/snprintf.c vendor/ntp/dist/sntp/libopts/compat/strchr.c vendor/ntp/dist/sntp/libopts/compat/strdup.c vendor/ntp/dist/sntp/libopts/compat/windows-config.h vendor/ntp/dist/sntp/libopts/configfile.c vendor/ntp/dist/sntp/libopts/cook.c vendor/ntp/dist/sntp/libopts/file.c (contents, props changed) vendor/ntp/dist/sntp/libopts/genshell.c vendor/ntp/dist/sntp/libopts/genshell.h vendor/ntp/dist/sntp/libopts/libopts.c vendor/ntp/dist/sntp/libopts/load.c vendor/ntp/dist/sntp/libopts/m4/libopts.m4 vendor/ntp/dist/sntp/libopts/m4/liboptschk.m4 vendor/ntp/dist/sntp/libopts/makeshell.c vendor/ntp/dist/sntp/libopts/nested.c vendor/ntp/dist/sntp/libopts/numeric.c vendor/ntp/dist/sntp/libopts/parse-duration.c (contents, props changed) vendor/ntp/dist/sntp/libopts/parse-duration.h (contents, props changed) vendor/ntp/dist/sntp/libopts/pgusage.c vendor/ntp/dist/sntp/libopts/proto.h vendor/ntp/dist/sntp/libopts/putshell.c vendor/ntp/dist/sntp/libopts/reset.c (contents, props changed) vendor/ntp/dist/sntp/libopts/restore.c vendor/ntp/dist/sntp/libopts/save.c vendor/ntp/dist/sntp/libopts/sort.c vendor/ntp/dist/sntp/libopts/stack.c vendor/ntp/dist/sntp/libopts/streqvcmp.c vendor/ntp/dist/sntp/libopts/text_mmap.c vendor/ntp/dist/sntp/libopts/time.c (contents, props changed) vendor/ntp/dist/sntp/libopts/tokenize.c vendor/ntp/dist/sntp/libopts/usage.c vendor/ntp/dist/sntp/libopts/version.c vendor/ntp/dist/sntp/log.c (contents, props changed) vendor/ntp/dist/sntp/log.h (contents, props changed) vendor/ntp/dist/sntp/main.c (contents, props changed) vendor/ntp/dist/sntp/main.h (contents, props changed) vendor/ntp/dist/sntp/networking.c (contents, props changed) vendor/ntp/dist/sntp/networking.h (contents, props changed) vendor/ntp/dist/sntp/sntp-opts.c vendor/ntp/dist/sntp/sntp-opts.def vendor/ntp/dist/sntp/sntp-opts.h vendor/ntp/dist/sntp/sntp.c (contents, props changed) vendor/ntp/dist/sntp/sntp.html (contents, props changed) vendor/ntp/dist/sntp/sntp.texi vendor/ntp/dist/sntp/utilities.c (contents, props changed) vendor/ntp/dist/sntp/utilities.h (contents, props changed) vendor/ntp/dist/util/Makefile.am (contents, props changed) vendor/ntp/dist/util/Makefile.in (contents, props changed) vendor/ntp/dist/util/README (contents, props changed) vendor/ntp/dist/util/audio-pcm.c (contents, props changed) vendor/ntp/dist/util/hist.c (contents, props changed) vendor/ntp/dist/util/jitter.c (contents, props changed) vendor/ntp/dist/util/ntp-keygen-opts.c vendor/ntp/dist/util/ntp-keygen-opts.def vendor/ntp/dist/util/ntp-keygen-opts.h vendor/ntp/dist/util/ntp-keygen.c (contents, props changed) vendor/ntp/dist/util/ntptime.c (contents, props changed) vendor/ntp/dist/util/sht.c (contents, props changed) vendor/ntp/dist/util/tg.c vendor/ntp/dist/util/tickadj.c (contents, props changed) Directory Properties: vendor/ntp/dist/INSTALL (props changed) vendor/ntp/dist/NOTES.y2kfixes (props changed) vendor/ntp/dist/README (props changed) vendor/ntp/dist/README.bk (props changed) vendor/ntp/dist/README.hackers (props changed) vendor/ntp/dist/README.patches (props changed) vendor/ntp/dist/README.refclocks (props changed) vendor/ntp/dist/README.versions (props changed) vendor/ntp/dist/TODO (props changed) vendor/ntp/dist/adjtimed/README (props changed) vendor/ntp/dist/adjtimed/adjtimed.c (props changed) vendor/ntp/dist/compile (props changed) vendor/ntp/dist/conf/README (props changed) vendor/ntp/dist/conf/baldwin.conf (props changed) vendor/ntp/dist/conf/beauregard.conf (props changed) vendor/ntp/dist/conf/grundoon.conf (props changed) vendor/ntp/dist/conf/malarky.conf (props changed) vendor/ntp/dist/conf/pogo.conf (props changed) vendor/ntp/dist/conf/rackety.conf (props changed) vendor/ntp/dist/config.guess (props changed) vendor/ntp/dist/config.sub (props changed) vendor/ntp/dist/depcomp (props changed) vendor/ntp/dist/dot.emacs (props changed) vendor/ntp/dist/html/hints/solaris-dosynctodr.html (props changed) vendor/ntp/dist/include/README (props changed) vendor/ntp/dist/include/adjtime.h (props changed) vendor/ntp/dist/include/ascii.h (props changed) vendor/ntp/dist/include/audio.h (props changed) vendor/ntp/dist/include/binio.h (props changed) vendor/ntp/dist/include/gps.h (props changed) vendor/ntp/dist/include/hopf6039.h (props changed) vendor/ntp/dist/include/icom.h (props changed) vendor/ntp/dist/include/ieee754io.h (props changed) vendor/ntp/dist/include/mx4200.h (props changed) vendor/ntp/dist/include/ntif.h (props changed) vendor/ntp/dist/include/ntp_datum.h (props changed) vendor/ntp/dist/include/ntp_if.h (props changed) vendor/ntp/dist/include/ntp_lineedit.h (props changed) vendor/ntp/dist/include/ntp_lists.h (props changed) vendor/ntp/dist/include/ntp_malloc.h (props changed) vendor/ntp/dist/include/parse.h (props changed) vendor/ntp/dist/include/parse_conf.h (props changed) vendor/ntp/dist/include/ssl_applink.c (props changed) vendor/ntp/dist/include/trimble.h (props changed) vendor/ntp/dist/install-sh (props changed) vendor/ntp/dist/kernel/sys/README (props changed) vendor/ntp/dist/kernel/sys/bsd_audioirig.h (props changed) vendor/ntp/dist/kernel/sys/i8253.h (props changed) vendor/ntp/dist/kernel/sys/parsestreams.h (props changed) vendor/ntp/dist/kernel/sys/pcl720.h (props changed) vendor/ntp/dist/kernel/sys/ppsclock.h (props changed) vendor/ntp/dist/kernel/sys/timex.h (props changed) vendor/ntp/dist/kernel/sys/tpro.h (props changed) vendor/ntp/dist/kernel/sys/tt560_api.h (props changed) vendor/ntp/dist/lib/isc/bitstring.c (props changed) vendor/ntp/dist/lib/isc/buffer.c (props changed) vendor/ntp/dist/lib/isc/bufferlist.c (props changed) vendor/ntp/dist/lib/isc/commandline.c (props changed) vendor/ntp/dist/lib/isc/error.c (props changed) vendor/ntp/dist/lib/isc/event.c (props changed) vendor/ntp/dist/lib/isc/fsaccess.c (props changed) vendor/ntp/dist/lib/isc/hex.c (props changed) vendor/ntp/dist/lib/isc/include/isc/base32.h (props changed) vendor/ntp/dist/lib/isc/include/isc/base64.h (props changed) vendor/ntp/dist/lib/isc/include/isc/bitstring.h (props changed) vendor/ntp/dist/lib/isc/include/isc/boolean.h (props changed) vendor/ntp/dist/lib/isc/include/isc/bufferlist.h (props changed) vendor/ntp/dist/lib/isc/include/isc/commandline.h (props changed) vendor/ntp/dist/lib/isc/include/isc/event.h (props changed) vendor/ntp/dist/lib/isc/include/isc/eventclass.h (props changed) vendor/ntp/dist/lib/isc/include/isc/formatcheck.h (props changed) vendor/ntp/dist/lib/isc/include/isc/hex.h (props changed) vendor/ntp/dist/lib/isc/include/isc/httpd.h (props changed) vendor/ntp/dist/lib/isc/include/isc/interfaceiter.h (props changed) vendor/ntp/dist/lib/isc/include/isc/ipv6.h (props changed) vendor/ntp/dist/lib/isc/include/isc/iterated_hash.h (props changed) vendor/ntp/dist/lib/isc/include/isc/lang.h (props changed) vendor/ntp/dist/lib/isc/include/isc/lex.h (props changed) vendor/ntp/dist/lib/isc/include/isc/lfsr.h (props changed) vendor/ntp/dist/lib/isc/include/isc/magic.h (props changed) vendor/ntp/dist/lib/isc/include/isc/msgcat.h (props changed) vendor/ntp/dist/lib/isc/include/isc/mutexblock.h (props changed) vendor/ntp/dist/lib/isc/include/isc/ondestroy.h (props changed) vendor/ntp/dist/lib/isc/include/isc/os.h (props changed) vendor/ntp/dist/lib/isc/include/isc/parseint.h (props changed) vendor/ntp/dist/lib/isc/include/isc/platform.h (props changed) vendor/ntp/dist/lib/isc/include/isc/print.h (props changed) vendor/ntp/dist/lib/isc/include/isc/quota.h (props changed) vendor/ntp/dist/lib/isc/include/isc/region.h (props changed) vendor/ntp/dist/lib/isc/include/isc/resource.h (props changed) vendor/ntp/dist/lib/isc/include/isc/rwlock.h (props changed) vendor/ntp/dist/lib/isc/include/isc/stdio.h (props changed) vendor/ntp/dist/lib/isc/include/isc/stdlib.h (props changed) vendor/ntp/dist/lib/isc/include/isc/string.h (props changed) vendor/ntp/dist/lib/isc/include/isc/version.h (props changed) vendor/ntp/dist/lib/isc/include/isc/xml.h (props changed) vendor/ntp/dist/lib/isc/lex.c (props changed) vendor/ntp/dist/lib/isc/lfsr.c (props changed) vendor/ntp/dist/lib/isc/mips/include/isc/atomic.h (props changed) vendor/ntp/dist/lib/isc/netscope.c (props changed) vendor/ntp/dist/lib/isc/nls/msgcat.c (props changed) vendor/ntp/dist/lib/isc/noatomic/include/isc/atomic.h (props changed) vendor/ntp/dist/lib/isc/nothreads/condition.c (props changed) vendor/ntp/dist/lib/isc/nothreads/include/isc/condition.h (props changed) vendor/ntp/dist/lib/isc/nothreads/include/isc/mutex.h (props changed) vendor/ntp/dist/lib/isc/nothreads/include/isc/once.h (props changed) vendor/ntp/dist/lib/isc/nothreads/include/isc/thread.h (props changed) vendor/ntp/dist/lib/isc/nothreads/mutex.c (props changed) vendor/ntp/dist/lib/isc/nothreads/thread.c (props changed) vendor/ntp/dist/lib/isc/ondestroy.c (props changed) vendor/ntp/dist/lib/isc/parseint.c (props changed) vendor/ntp/dist/lib/isc/portset.c (props changed) vendor/ntp/dist/lib/isc/pthreads/condition.c (props changed) vendor/ntp/dist/lib/isc/pthreads/include/isc/condition.h (props changed) vendor/ntp/dist/lib/isc/pthreads/include/isc/mutex.h (props changed) vendor/ntp/dist/lib/isc/pthreads/include/isc/once.h (props changed) vendor/ntp/dist/lib/isc/pthreads/include/isc/thread.h (props changed) vendor/ntp/dist/lib/isc/pthreads/thread.c (props changed) vendor/ntp/dist/lib/isc/quota.c (props changed) vendor/ntp/dist/lib/isc/ratelimiter.c (props changed) vendor/ntp/dist/lib/isc/refcount.c (props changed) vendor/ntp/dist/lib/isc/region.c (props changed) vendor/ntp/dist/lib/isc/serial.c (props changed) vendor/ntp/dist/lib/isc/strtoul.c (props changed) vendor/ntp/dist/lib/isc/unix/fsaccess.c (props changed) vendor/ntp/dist/lib/isc/unix/include/isc/dir.h (props changed) vendor/ntp/dist/lib/isc/unix/include/isc/int.h (props changed) vendor/ntp/dist/lib/isc/unix/include/isc/keyboard.h (props changed) vendor/ntp/dist/lib/isc/unix/include/isc/netdb.h (props changed) vendor/ntp/dist/lib/isc/unix/include/isc/stat.h (props changed) vendor/ntp/dist/lib/isc/unix/include/isc/syslog.h (props changed) vendor/ntp/dist/lib/isc/unix/ipv6.c (props changed) vendor/ntp/dist/lib/isc/unix/keyboard.c (props changed) vendor/ntp/dist/lib/isc/unix/os.c (props changed) vendor/ntp/dist/lib/isc/unix/stdtime.c (props changed) vendor/ntp/dist/lib/isc/unix/syslog.c (props changed) vendor/ntp/dist/lib/isc/version.c (props changed) vendor/ntp/dist/lib/isc/win32/DLLMain.c (props changed) vendor/ntp/dist/lib/isc/win32/condition.c (props changed) vendor/ntp/dist/lib/isc/win32/errno2result.c (props changed) vendor/ntp/dist/lib/isc/win32/errno2result.h (props changed) vendor/ntp/dist/lib/isc/win32/fsaccess.c (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/bind_registry.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/bindevt.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/condition.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/dir.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/int.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/keyboard.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/netdb.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/ntgroups.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/offset.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/once.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/strerror.h (props changed) vendor/ntp/dist/lib/isc/win32/include/isc/syslog.h (props changed) vendor/ntp/dist/lib/isc/win32/ipv6.c (props changed) vendor/ntp/dist/lib/isc/win32/keyboard.c (props changed) vendor/ntp/dist/lib/isc/win32/once.c (props changed) vendor/ntp/dist/lib/isc/win32/os.c (props changed) vendor/ntp/dist/lib/isc/win32/resource.c (props changed) vendor/ntp/dist/lib/isc/win32/stdio.c (props changed) vendor/ntp/dist/lib/isc/win32/stdtime.c (props changed) vendor/ntp/dist/lib/isc/win32/strerror.c (props changed) vendor/ntp/dist/lib/isc/win32/syslog.c (props changed) vendor/ntp/dist/lib/isc/win32/syslog.h (props changed) vendor/ntp/dist/lib/isc/win32/thread.c (props changed) vendor/ntp/dist/lib/isc/win32/version.c (props changed) vendor/ntp/dist/lib/isc/win32/win32os.c (props changed) vendor/ntp/dist/lib/isc/x86_32/include/isc/atomic.h (props changed) vendor/ntp/dist/lib/isc/x86_64/include/isc/atomic.h (props changed) vendor/ntp/dist/libntp/README (props changed) vendor/ntp/dist/libntp/adjtime.c (props changed) vendor/ntp/dist/libntp/adjtimex.c (props changed) vendor/ntp/dist/libntp/emalloc.c (props changed) vendor/ntp/dist/libntp/icom.c (props changed) vendor/ntp/dist/libntp/strdup.c (props changed) vendor/ntp/dist/libntp/systime_s.c (props changed) vendor/ntp/dist/libparse/README (props changed) vendor/ntp/dist/libparse/clk_computime.c (props changed) vendor/ntp/dist/libparse/clk_dcf7000.c (props changed) vendor/ntp/dist/libparse/clk_hopf6021.c (props changed) vendor/ntp/dist/libparse/clk_meinberg.c (props changed) vendor/ntp/dist/libparse/clk_rcc8000.c (props changed) vendor/ntp/dist/libparse/clk_schmid.c (props changed) vendor/ntp/dist/libparse/clk_trimtaip.c (props changed) vendor/ntp/dist/libparse/clk_varitext.c (props changed) vendor/ntp/dist/libparse/info_trimble.c (props changed) vendor/ntp/dist/libparse/parsestreams.c (props changed) vendor/ntp/dist/missing (props changed) vendor/ntp/dist/ntpd/jupiter.h (props changed) vendor/ntp/dist/ntpd/refclock_local.c (props changed) vendor/ntp/dist/ntpdate/README (props changed) vendor/ntp/dist/ntpdc/README (props changed) vendor/ntp/dist/ntpdc/nl_in.c (props changed) vendor/ntp/dist/ntpq/README (props changed) vendor/ntp/dist/ntpsnmpd/ntpSnmpSubagentObject.h (props changed) vendor/ntp/dist/ntpsnmpd/ntp_snmp.h (props changed) vendor/ntp/dist/parseutil/README (props changed) vendor/ntp/dist/results.y2kfixes (props changed) vendor/ntp/dist/scripts/monitoring/README (props changed) vendor/ntp/dist/scripts/monitoring/loopwatch.config.SAMPLE (props changed) vendor/ntp/dist/scripts/monitoring/lr.pl (props changed) vendor/ntp/dist/scripts/monitoring/ntploopstat (props changed) vendor/ntp/dist/scripts/monitoring/ntploopwatch (props changed) vendor/ntp/dist/scripts/monitoring/timelocal.pl (props changed) vendor/ntp/dist/scripts/stats/README (props changed) vendor/ntp/dist/scripts/stats/README.stats (props changed) vendor/ntp/dist/scripts/stats/README.timecodes (props changed) vendor/ntp/dist/scripts/stats/clock.awk (props changed) vendor/ntp/dist/scripts/stats/dupe.awk (props changed) vendor/ntp/dist/scripts/stats/ensemble.S (props changed) vendor/ntp/dist/scripts/stats/ensemble.awk (props changed) vendor/ntp/dist/scripts/stats/etf.S (props changed) vendor/ntp/dist/scripts/stats/etf.awk (props changed) vendor/ntp/dist/scripts/stats/itf.S (props changed) vendor/ntp/dist/scripts/stats/itf.awk (props changed) vendor/ntp/dist/scripts/stats/loop.S (props changed) vendor/ntp/dist/scripts/stats/loop.awk (props changed) vendor/ntp/dist/scripts/stats/loop_summary (props changed) vendor/ntp/dist/scripts/stats/peer.awk (props changed) vendor/ntp/dist/scripts/stats/psummary.awk (props changed) vendor/ntp/dist/scripts/stats/summary.sh (props changed) vendor/ntp/dist/scripts/stats/tdata.S (props changed) vendor/ntp/dist/scripts/stats/tdata.awk (props changed) vendor/ntp/dist/sntp/config.guess (props changed) vendor/ntp/dist/sntp/config.sub (props changed) vendor/ntp/dist/sntp/data_formats.h (props changed) vendor/ntp/dist/sntp/depcomp (props changed) vendor/ntp/dist/sntp/install-sh (props changed) vendor/ntp/dist/sntp/missing (props changed) vendor/ntp/dist/util/ansi2knr.1 (props changed) vendor/ntp/dist/util/ansi2knr.c (props changed) vendor/ntp/dist/util/byteorder.c (props changed) vendor/ntp/dist/util/kern.c (props changed) vendor/ntp/dist/util/longsize.c (props changed) vendor/ntp/dist/util/pps-api.c (props changed) vendor/ntp/dist/util/precision.c (props changed) vendor/ntp/dist/util/testrs6000.c (props changed) vendor/ntp/dist/util/timetrim.c (props changed) Modified: vendor/ntp/dist/COPYRIGHT ============================================================================== --- vendor/ntp/dist/COPYRIGHT Sat Dec 20 22:51:01 2014 (r275969) +++ vendor/ntp/dist/COPYRIGHT Sat Dec 20 22:52:39 2014 (r275970) @@ -4,7 +4,7 @@ This file is automatically generated fro jpg "Clone me," says Dolly sheepishly. - Last update: 1-Jan-2011 08:34 UTC + Last update: 9-Aug-2014 07:56 UTC _________________________________________________________________ The following copyright notice applies to all files collectively @@ -13,7 +13,7 @@ This file is automatically generated fro applies as if the text was explicitly included in the file. *********************************************************************** * * -* Copyright (c) University of Delaware 1992-2011 * +* Copyright (c) University of Delaware 1992-2014 * * * * Permission to use, copy, modify, and distribute this software and * * its documentation for any purpose with or without fee is hereby * @@ -75,53 +75,58 @@ This file is automatically generated fro 27. [29]Poul-Henning Kamp Oncore driver (Original author) 28. [30]Frank Kardel [31] PARSE - driver (>14 reference clocks), STREAMS modules for PARSE, support + (driver 14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup, dynamic interface handling - 29. [32]William L. Jones RS/6000 AIX + 29. [32]Johannes Maximilian Kuehn Rewrote sntp to + comply with NTPv4 specification, ntpq saveconfig + 30. [33]William L. Jones RS/6000 AIX modifications, HPUX modifications - 30. [33]Dave Katz RS/6000 AIX port - 31. [34]Craig Leres 4.4BSD port, ppsclock, Magnavox + 31. [34]Dave Katz RS/6000 AIX port + 32. [35]Craig Leres 4.4BSD port, ppsclock, Magnavox GPS clock driver - 32. [35]George Lindholm SunOS 5.1 port - 33. [36]Louis A. Mamakos MD5-based authentication - 34. [37]Lars H. Mathiesen adaptation of foundation + 33. [36]George Lindholm SunOS 5.1 port + 34. [37]Louis A. Mamakos MD5-based authentication + 35. [38]Lars H. Mathiesen adaptation of foundation code for Version 3 as specified in RFC-1305 - 35. [38]Danny Mayer Network I/O, Windows Port, Code + 36. [39]Danny Mayer Network I/O, Windows Port, Code Maintenance - 36. [39]David L. Mills Version 4 foundation: clock - discipline, authentication, precision kernel; clock drivers: - Spectracom, Austron, Arbiter, Heath, ATOM, ACTS, KSI/Odetics; - audio clock drivers: CHU, WWV/H, IRIG - 37. [40]Wolfgang Moeller VMS port - 38. [41]Jeffrey Mogul ntptrace utility - 39. [42]Tom Moore i386 svr4 port - 40. [43]Kamal A Mostafa SCO OpenServer port - 41. [44]Derek Mulcahy and [45]Damon + 37. [40]David L. Mills Version 4 foundation, + precision kernel; clock drivers: 1, 3, 4, 6, 7, 11, 13, 18, 19, + 22, 36 + 38. [41]Wolfgang Moeller VMS port + 39. [42]Jeffrey Mogul ntptrace utility + 40. [43]Tom Moore i386 svr4 port + 41. [44]Kamal A Mostafa SCO OpenServer port + 42. [45]Derek Mulcahy and [46]Damon Hart-Davis ARCRON MSF clock driver - 42. [46]Rob Neal Bancomm refclock and config/parse code + 43. [47]Rob Neal Bancomm refclock and config/parse code maintenance - 43. [47]Rainer Pruy + 44. [48]Rainer Pruy monitoring/trap scripts, statistics file handling - 44. [48]Dirce Richards Digital UNIX V4.0 port - 45. [49]Wilfredo Sánchez added support for + 45. [49]Dirce Richards Digital UNIX V4.0 port + 46. [50]Wilfredo Sánchez added support for NetInfo - 46. [50]Nick Sayer SunOS streams modules - 47. [51]Jack Sasportas Saved a Lot of + 47. [51]Nick Sayer SunOS streams modules + 48. [52]Jack Sasportas Saved a Lot of space on the stuff in the html/pic/ subdirectory - 48. [52]Ray Schnitzler Unixware1 port - 49. [53]Michael Shields USNO clock driver - 50. [54]Jeff Steinman Datum PTS clock + 49. [53]Ray Schnitzler Unixware1 port + 50. [54]Michael Shields USNO clock driver + 51. [55]Jeff Steinman Datum PTS clock driver - 51. [55]Harlan Stenn GNU automake/autoconfigure + 52. [56]Harlan Stenn GNU automake/autoconfigure makeover, various other bits (see the ChangeLog) - 52. [56]Kenneth Stone HP-UX port - 53. [57]Ajit Thyagarajan IP multicast/anycast + 53. [57]Kenneth Stone HP-UX port + 54. [58]Ajit Thyagarajan IP multicast/anycast support - 54. [58]Tomoaki TSURUOKA TRAK clock + 55. [59]Tomoaki TSURUOKA TRAK clock driver - 55. [59]Paul A Vixie TrueTime GPS driver, generic + 56. [60]Brian Utterback General codebase, + Solaris issues + 57. [61]Loganaden Velvindron Sandboxing + (libseccomp) support + 58. [62]Paul A Vixie TrueTime GPS driver, generic TrueTime clock driver - 56. [60]Ulrich Windl corrected and + 59. [63]Ulrich Windl corrected and validated HTML documents according to the HTML DTD _________________________________________________________________ @@ -141,7 +146,7 @@ References 12. mailto:%20Jean-Francois.Boudreault@viagenie.qc.ca 13. mailto:%20reg@dwf.com 14. mailto:%20clift@ml.csiro.au - 15. mailto:casey@csc.co.za + 15. mailto:%20casey@csc.co.za 16. mailto:%20Sven_Dietrich@trimble.COM 17. mailto:%20dundas@salt.jpl.nasa.gov 18. mailto:%20duwe@immd4.informatik.uni-erlangen.de @@ -153,37 +158,40 @@ References 24. mailto:%20iglesias@uci.edu 25. mailto:%20jagubox.gsfc.nasa.gov 26. mailto:%20jbj@chatham.usdesign.com - 27. mailto:Hans.Lambermont@nl.origin-it.com + 27. mailto:%20Hans.Lambermont@nl.origin-it.com 28. mailto:H.Lambermont@chello.nl 29. mailto:%20phk@FreeBSD.ORG 30. http://www4.informatik.uni-erlangen.de/%7ekardel - 31. mailto:%20kardel(at)ntp(dot)org - 32. mailto:%20jones@hermes.chpc.utexas.edu - 33. mailto:%20dkatz@cisco.com - 34. mailto:%20leres@ee.lbl.gov - 35. mailto:%20lindholm@ucs.ubc.ca - 36. mailto:%20louie@ni.umd.edu - 37. mailto:%20thorinn@diku.dk - 38. mailto:%20mayer@ntp.org - 39. mailto:%20mills@udel.edu - 40. mailto:%20moeller@gwdgv1.dnet.gwdg.de - 41. mailto:%20mogul@pa.dec.com - 42. mailto:%20tmoore@fievel.daytonoh.ncr.com - 43. mailto:%20kamal@whence.com - 44. mailto:%20derek@toybox.demon.co.uk - 45. mailto:%20d@hd.org - 46. mailto:%20neal@ntp.org - 47. mailto:%20Rainer.Pruy@informatik.uni-erlangen.de - 48. mailto:%20dirce@zk3.dec.com - 49. mailto:%20wsanchez@apple.com - 50. mailto:%20mrapple@quack.kfu.com - 51. mailto:%20jack@innovativeinternet.com - 52. mailto:%20schnitz@unipress.com - 53. mailto:%20shields@tembel.org - 54. mailto:%20pebbles.jpl.nasa.gov - 55. mailto:%20harlan@pfcs.com - 56. mailto:%20ken@sdd.hp.com - 57. mailto:%20ajit@ee.udel.edu - 58. mailto:%20tsuruoka@nc.fukuoka-u.ac.jp - 59. mailto:%20vixie@vix.com - 60. mailto:%20Ulrich.Windl@rz.uni-regensburg.de + 31. mailto:%20kardel%20%28at%29%20ntp%20%28dot%29%20org + 32. mailto:kuehn@ntp.org + 33. mailto:%20jones@hermes.chpc.utexas.edu + 34. mailto:%20dkatz@cisco.com + 35. mailto:%20leres@ee.lbl.gov + 36. mailto:%20lindholm@ucs.ubc.ca + 37. mailto:%20louie@ni.umd.edu + 38. mailto:%20thorinn@diku.dk + 39. mailto:%20mayer@ntp.org + 40. mailto:%20mills@udel.edu + 41. mailto:%20moeller@gwdgv1.dnet.gwdg.de + 42. mailto:%20mogul@pa.dec.com + 43. mailto:%20tmoore@fievel.daytonoh.ncr.com + 44. mailto:%20kamal@whence.com + 45. mailto:%20derek@toybox.demon.co.uk + 46. mailto:%20d@hd.org + 47. mailto:%20neal@ntp.org + 48. mailto:%20Rainer.Pruy@informatik.uni-erlangen.de + 49. mailto:%20dirce@zk3.dec.com + 50. mailto:%20wsanchez@apple.com + 51. mailto:%20mrapple@quack.kfu.com + 52. mailto:%20jack@innovativeinternet.com + 53. mailto:%20schnitz@unipress.com + 54. mailto:%20shields@tembel.org + 55. mailto:%20pebbles.jpl.nasa.gov + 56. mailto:%20harlan@pfcs.com + 57. mailto:%20ken@sdd.hp.com + 58. mailto:%20ajit@ee.udel.edu + 59. mailto:%20tsuruoka@nc.fukuoka-u.ac.jp + 60. mailto:%20brian.utterback@oracle.com + 61. mailto:%20loganaden@gmail.com + 62. mailto:%20vixie@vix.com + 63. mailto:%20Ulrich.Windl@rz.uni-regensburg.de Modified: vendor/ntp/dist/ChangeLog ============================================================================== --- vendor/ntp/dist/ChangeLog Sat Dec 20 22:51:01 2014 (r275969) +++ vendor/ntp/dist/ChangeLog Sat Dec 20 22:52:39 2014 (r275970) @@ -1,6 +1,2048 @@ --- +(4.2.8) 2014/12/19 Released by Harlan Stenn + +* [Sec 730] Increase RSA_generate_key modulus. +* [Sec 2666] Use cryptographic random numbers for md5 key generation. +* [Sec 2667] buffer overflow in crypto_recv(). +* [Sec 2668] buffer overflow in ctl_putdata(). +* [Sec 2669] buffer overflow in configure(). +* [Sec 2670] Missing return; from error clause. +* [Sec 2671] vallen in extension fields are not validated. +* [Sec 2672] On some OSes ::1 can be spoofed, bypassing source IP ACLs. +* [Bug 2691] Wrong variable name in refclock_ripencc.c. +(4.2.7p486-RC) 2014/12/18 Released by Harlan Stenn +* [Bug 2687] RefClock 26/hpgps doesn't work at default line speed +(4.2.7p485-RC) 2014/12/12 Released by Harlan Stenn +* [Bug 2686] refclock_gpsdjson needs strtoll(), which is not always present. +(4.2.7p484-RC) 2014/12/11 Released by Harlan Stenn +(4.2.7p483) 2014/12/08 Released by Harlan Stenn +* [Bug 2685] Better document the KOD file for sntp. +(4.2.7p482) 2014/12/02 Released by Harlan Stenn +* [Bug 2641] sntp is installed in the wrong location in Solaris. +* [Bug 2678] nmea_control() now checks 'refclock_params()' result. +(4.2.7p481) 2014/11/22 Released by Harlan Stenn +* [Bug 2314] Only enable PPS if kernel consumer binding succeeds. +* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. +* Rename pps_enable to hardpps_enable. +(4.2.7p480) 2014/11/21 Released by Harlan Stenn +* [Bug 2677] PATH_MAX isn't #define'd under Windows. + Regression from the patch fixing Bug 2639. +(4.2.7p479) 2014/11/15 Released by Harlan Stenn +* [Bug 2651] Certificates with ASN timestamps w/ 4-digit years mis-parsed. +(4.2.7p478) 2014/11/14 Released by Harlan Stenn +* [Sec 2630] buffer overrun in ntpq tokenize(). +* [Bug 2639] Check return value of ntp_adjtime(). +* [Bug 2650] includefile processing broken. +* [Bug 2661] ntpq crashes with mreadvar. +(4.2.7p477) 2014/11/13 Released by Harlan Stenn +* [Bug 2657] Document that "restrict nopeer" intereferes with "pool". +(4.2.7p476) 2014/10/08 Released by Harlan Stenn +* [Bug 2503] SHT utility outdated +(4.2.7p475) 2014/09/11 Released by Harlan Stenn +* [Bug 2654] refclock_true.c doesn't identify the Mk III. +(4.2.7p474) 2014/09/10 Released by Harlan Stenn +* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup. +* [Bug 2649] Clean up html/ page installation. +(4.2.7p473) 2014/09/06 Released by Harlan Stenn +* [Bug 2649] Clean up html/ page installation. +(4.2.7p472) 2014/09/06 Released by Harlan Stenn +* [Bug 2556] mrulist is missing from the generated ntpq man page. +(4.2.7p471) 2014/09/05 Released by Harlan Stenn +* [Bug 2649] "make install" leaves wrong owner for files in html/. +* [Bug 2652] Windows hates directory names that contain a :. +(4.2.7p470) 2014/09/02 Released by Harlan Stenn +* [Bug 2502] Autogen text replacement errors. +* autogen-5.18.5pre1 +* html/ cleanups from Hal Murray. +(4.2.7p469) 2014/09/01 Released by Harlan Stenn +* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup. +(4.2.7p468) 2014/08/31 Released by Harlan Stenn +* [Bug 2556] ntpq man page cleanup. +* autogen-5.18.4 +(4.2.7p467) 2014/08/28 Released by Harlan Stenn +* [Bug 2639] Check return value of ntp_adjtime(). +* [Bug 2640] STA_NANO can result in invalid ntv.constant. +(4.2.7p466) 2014/08/27 Released by Harlan Stenn +* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup. +(4.2.7p465) 2014/08/23 Released by Harlan Stenn +* [Bug 2538] NTP programs print exit code in help/usage text. +* [Bug 2595] Man page quirks: ntpdate references in ntpd. +* [Bug 2613] www.ntp.org/bugs.html tells folks to email doc bugs to DLM. +* [Bug 2636] Clutter in syslog if gpsd not running + - found (hopefully) last cause for clutter in protocol version + - log GPSD revision and release numbers with protocol version +(4.2.7p464) 2014/08/22 Released by Harlan Stenn +* [Bug 2636] Fix coverity warning from previous patch. +(4.2.7p463) 2014/08/21 Released by Harlan Stenn +* [Bug 2636] Clutter in syslog if gpsd not running + - make driver work with GPSD protocol version 3.9 + - use exponential back-off for connection problems + - implement rate-limit for syslog entries +(4.2.7p462) 2014/08/16 Released by Harlan Stenn +* [Bug 2622] Synchronisation problem using SHM [...] + Add 'control' function -- fudge values not available during start. +(4.2.7p461) 2014/08/14 Released by Harlan Stenn +* [Bug 1128] ntpq truncates "remote" host information. +* More autogen-5.18.4pre14 cleanup. +(4.2.7p460) 2014/08/13 Released by Harlan Stenn +* More autogen-5.18.4pre14 cleanup. +(4.2.7p459) 2014/08/12 Released by Harlan Stenn +* [Bug 2630] Limit the ntpq command buffer to 512 bytes. +* FlexeLint cleanups. +* Try bison-3.0.2 instead of bison-2.5. +(4.2.7p458) 2014/08/11 Released by Harlan Stenn +* [Bug 2633] Provide stdnoreturn.h for windows port. +(4.2.7p457) 2014/08/09 Released by Harlan Stenn +* [Bug 2622] Synchronisation problem using SHM when time difference is + more than four hours: Change SHM driver so TOY restricted API is not + used any more. (Plus some minor cleanup in logic and flow control) +* Pass the configration source into the parser as argument rather + than through a global variable. +* Fix nits in the ntpq man page. +* autogen-5.18.4pre14 +(4.2.7p456) 2014/08/07 Released by Harlan Stenn +* CID 739722: Change the way the extention and MAC fields are processed. +(4.2.7p455) 2014/08/03 Released by Harlan Stenn +* [Bug 2565] ntpd sometimes logs unexpected getifaddrs() errors. +* CID 739722: Clean up the definition of the exten field of struct pkt. +(4.2.7p454) 2014/07/30 Released by Harlan Stenn +* [Bug 2628] 'mon_getmoremem()' relies on undefined behaviour +(4.2.7p453) 2014/07/19 Released by Harlan Stenn +* [Bug 2597] leap file loose ends (follow-up) + - uniform expiration check messages for config and timer triggered + leap file loads + - timer triggered loads log messages only once per day +(4.2.7p452) 2014/07/18 Released by Harlan Stenn +* Make all of the html/ .html files use the same format for "Last update". +(4.2.7p451) 2014/07/17 Released by Harlan Stenn +* Fix the "Last update" entries in the html/ subtree. +(4.2.7p450) 2014/07/16 Released by Harlan Stenn +* Distribute the scripts needed for the fix for Bug 2547. +(4.2.7p449) 2014/07/16 Released by Harlan Stenn +* [Bug 2547] Automate update of "Last Update" datestamps in .html files. +* [Bug 2623] Missing {} in refclock_oncore.c. +* Quiet warnings from ntp_calendar.h: avoid using argument names. +* Fix typos in decode.html and debug.html . +(4.2.7p448) 2014/07/15 Released by Harlan Stenn +* [Bug 2621] Avoid use of indeterminate address after 'free()' + (minor C standard conformance issue) +* Quiet warnings from ntp_calendar.h: avoid using argument names. +(4.2.7p447) 2014/07/05 Released by Harlan Stenn +* [Bug 2620] Use version.pm for checking version numbers in NTP::Util. +* [Bug 2624] Fix signed compare on 'l_fp'. +(4.2.7p446) 2014/06/28 Released by Harlan Stenn +* [Bug 2597] leap file processing -- loose ends. +* [Bug 2614] use 'unsigned long' consistently in ntp_random.c + to avoid possibly undefined behaviour in signed int overflow +* [Bug 2619] Save a signed int copy of the return value of i2d_DSA_SIG(). + Provide missing msyslog() message in crypto_alice(). +* Fix a variable lifetime issue. +* Allow for version suffix in libevent in ntp_libevent.m4. +(4.2.7p445) 2014/06/12 Released by Harlan Stenn +* [Bug 2556] mrulist isn't mentioned in the ntpq man page. +(4.2.7p444) 2014/05/19 Released by Harlan Stenn +* [Bug 2597] leap file processing -- loose ends + fixed coverity issues +(4.2.7p443) 2014/05/10 Released by Harlan Stenn +* [Bug 2594] Update the year in sntp/include/copyright.def. +(4.2.7p442) 2014/05/09 Released by Harlan Stenn +* [Bug 2589] Update VS2013 project files for libntp. +* [Bug 2600] Fix "Undisicplined Local Clock" driver1.html page. +(4.2.7p441) 2014/05/04 Released by Harlan Stenn +* [Bug 2597] leap file processing -- loose ends + log daily warning when leap info less than 28 days to expiration or + already expired; nag hourly on last day before expiration; log when + leapfile name is invalid +(4.2.7p440) 2014/04/09 Released by Harlan Stenn +* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup. +* [Bug 2570] cleanup: fix log format for successful leapfile load +(4.2.7p439) 2014/04/03 Released by Harlan Stenn +* [Bug 2589] fix VS2009 compile problem. +(4.2.7p438) 2014/04/01 Released by Harlan Stenn +* [Bug 2546] Windows build documentation updates. +(4.2.7p437) 2014/03/31 Released by Harlan Stenn +* [Bug 2537] ntpd truncates symmetric keys to 20 bytes. +* [Bug 2546] Documentation updates. +(4.2.7p436) 2014/03/31 Released by Harlan Stenn +* Update to libopts-40.2.15, and autogen-5.18.3pre18. +* [Bug 2311] Add more tags to mdoc2xxx. +* [Bug 2502] Assorted text replacement errors in 4.2.7p345 +* [Bug 2538] ntp programs print exit code as part of the "usage" text. +(4.2.7p435) 2014/03/29 Released by Harlan Stenn +* [Bug 2570] cleanup: reduced logging noise, moved some functions + into libntp. +(4.2.7p434) 2014/03/21 Released by Harlan Stenn +* [Bug 2577] Update VS2013 solution and project files. +(4.2.7p433) 2014/03/10 Released by Harlan Stenn +* Clean up last-update timestamps of html/*.html files. +* [Bug 2546] Documentation updates. +(4.2.7p432) 2014/03/09 Released by Harlan Stenn +* CID 711660: Do a non-NULL pointer assertion check a bit earlier. +(4.2.7p431) 2014/03/05 Released by Harlan Stenn +* [Bug 2572] cross-compiling fails for --with-yielding-select. +(4.2.7p430) 2014/03/04 Released by Harlan Stenn +* Upgrade to libevent-2.1.3-alpha-dev. +* [Bug 2572] cross-compiling fails for --with-yielding-select. +(4.2.7p429) 2014/03/03 Released by Harlan Stenn +* CID 1165098: Remove logically dead code from refclock_true.c. +* CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check. +* In ntp_dir_sep.m4, we care about $host_os, not $target_os. +* [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP. +* [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups. +* [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash + -- change reading the hash line code: NIST omits leading zeros. +* [Bug 2576] refclock_gpsdjson.c doesn't compile if CLOCK_GPSDJSON is + not enabled at configure time. +(4.2.7p428) 2014/03/03 Released by Harlan Stenn +* [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash +* [Bug 2562] Distribute the code in libjsmn/ . +(4.2.7p427) 2014/03/02 Released by Harlan Stenn +* [Bug 2562] GPSD_JSON: fix solaris issues (asprintf(), isfinite()) +* [Bug 2562] first release of the GPSD client clock (type 46) +(4.2.7p426) 2014/02/28 Released by Harlan Stenn +* [Bug 2113] Warn about ignored extra args in ntpq. +* [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups. +* [Bug 2561] Allow wildcards in the target of the "interface" command. +* [Bug 2572] cross-compiling fails for --with-yielding_select. +(4.2.7p425) 2014/02/26 Released by Harlan Stenn +* Copyright file update. +(4.2.7p424) 2014/02/24 Released by Harlan Stenn +* [Bug 2541] ntpd terminates itself with SIGHUP unexpectedly. +(4.2.7p423) 2014/02/23 Released by Harlan Stenn +* [Bug 2565] Handle EINTR on getifaddrs(). +(4.2.7p422) 2014/02/17 Released by Harlan Stenn +* [Bug 2536] ntpd sandboxing support (libseccomp2). +(4.2.7p421) 2014/02/10 Released by Harlan Stenn +* [Bug 898] More documentation fixes. +* [Bug 2555] Autogen mdoc man pages all stamped with SunOS 5.10. +* calc_tickadj/Makefile.am man/mdoc page build cleanup. +(4.2.7p420) 2014/02/09 Released by Harlan Stenn +* [Bug 492] Clearly document ntpdate's pending deprecation. +* [Bug 1186] ntpd fails with link local IPv6 addresses. +* [Sec 2542] Strengthen the mrulist nonce. +(4.2.7p419) 2014/02/08 Released by Harlan Stenn +* [Bug 2466] Wrap NMEA timestamps in 1024 week cycles. +(4.2.7p418) 2014/02/05 Released by Harlan Stenn +* [Bug 2551] --disable-local-libevent breaks the build. +(4.2.7p417) 2014/02/02 Released by Harlan Stenn +* [Bug 2539] doc and code tweaks for NMEA driver. +* Add check for enable stats to ntpd/complete.conf.in +* Fix typo in html/confopt.html +(4.2.7p416) 2014/01/31 Released by Harlan Stenn +* Tweak the 'Modified' line on appropriate html pages. +* Note in the deprecation of ntpdc in its documentation. +* [Bug 2332] Be more careful about when we use 'libgcc_s'. +(4.2.7p415) 2014/01/28 Released by Harlan Stenn +* Fix the man page installation for the scripts/ files. +(4.2.7p414) 2014/01/28 Released by Harlan Stenn +* [Bug 792] TrueTime TL-3 WWV refclock support. +* [Bug 898] Documentation fixes. +* [Bug 930] ntpdc docs refer to 'clockinfo', but mean 'clockstat'. +* [Bug 1002] ntp-keygen option and documentation updates: -p/--pvt-passwd + is now -p/--password, and -q/--get-pvt-passwd is now -q/--export-passwd. +* [Bug 1349] statistics command not documented in HTML documentation. + In html/monopt.html, add statistics id, definition, description, and + correct typo. + In html/scripts/monopt.txt, add statistics item, href, and comment. + In ntpd/ntp.conf.def, under statistics correct four to eight kinds. + In ntpd/complete.conf.in, add all eight kinds to statistics. + In html/comdex.html, remove duplicate footer. +* [Bug 1734] Include man page for ntp.conf (fixed in 4.2.7p297). +* [Bug 2049] Clarify ntpdate's -d option behavior. +* [Bug 2366] ntpdc.html: burst/iburst only work on servers. +* [Bug 2493] ntptrace needs a man page (fixed in 4.2.7p402). +* [Bug 2545] Cleanup of scripts/monitoring/ntptrap. +(4.2.7p413) 2014/01/27 Released by Harlan Stenn +* Require a version string for perl scripts that use autogen. +* html/ cleanup. +(4.2.7p412) 2014/01/20 Released by Harlan Stenn +* [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups. +(4.2.7p411) 2014/01/12 Released by Harlan Stenn +* [Bug 2532] Note in ntpdc docs that "enable pps" only works on older ntpd. +(4.2.7p410) 2014/01/08 Released by Harlan Stenn +* [Bug 2332] Force reference to 'libgcc_s' when using GCC, because + threading+restricted user+locked memory otherwise fails on Linux. +* [Bug 2530] Fix documentation for enable/disable mode7 and pps. +* Cleanup to the new scripts/*/Makefile.am files. +(4.2.7p409) 2014/01/04 Released by Harlan Stenn +* [Bug 2060] Warn about restrictions with "kod" but not "limited". +(4.2.7p408) 2013/12/29 Released by Harlan Stenn +* [Bug 2187] Update version number generation scripts. +(4.2.7p407) 2013/12/29 Released by Harlan Stenn +* [Bug 2519] mktime.c does not compile on 64-bit Solaris but we do not + need timegm() and the Solaris provides mktime(). +* [Bug 2522] Revert Bug 2513 fix - it breaks backward compatibility. +(4.2.7p406) 2013/12/28 Released by Harlan Stenn +* [Bug 2521] VPATH tweaks for perl -opts files. +(4.2.7p405) 2013/12/27 Released by Harlan Stenn +* [Bug 2521] bootstrap script needs a tweak for perl -opts files. +* [Bug 2524] Add ntpsweep to sntp/loc/* files. +* [Bug 2526] Add "noinst" support to the sntp/loc/ framework. +(4.2.7p404) 2013/12/24 Released by Harlan Stenn +* [Bug 135] AIX5: "Address already in use" for IPv6 wildcard. +(4.2.7p403) 2013/12/23 Released by Harlan Stenn +* [Bug 2513] Remove any PIDFILE in finish(). +* [Bug 2516] Enable clock_gettime() support for AIX 5+. +* [Bug 2517] Fix peer status errors in decode.html. +(4.2.7p402) 2013/12/23 Released by Harlan Stenn +* Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup. +(4.2.7p401) 2013/11/30 Released by Harlan Stenn +* [Bug 2491] VS20xx compile fixes. +(4.2.7p400) 2013/11/29 Released by Harlan Stenn +* [Bug 2491] VS2013 project files. +(4.2.7p399) 2013/11/28 Released by Harlan Stenn +* [Bug 2326] More leapsecond file notification cleanup. +* [Bug 2506] make sure routing updates are always tracked +* [Bug 2514] secs/* #define usage cleanup. +(4.2.7p398) 2013/11/25 Released by Harlan Stenn +* [Bug 2326] More leapsecond file notification cleanup. +* Improve sntp KoD data file fopen() error message. +(4.2.7p397) 2013/11/20 Released by Harlan Stenn +* [Bug 2326] More leapsecond file notification cleanup. +(4.2.7p396) 2013/11/19 Released by Harlan Stenn +* [Bug 2326] Improve stale leapsecond notifications. +(4.2.7p395) 2013/11/12 Released by Harlan Stenn +* Upgrade to autogen-5.18.3pre5 and libopts-40.1.15. +(4.2.7p394) 2013/11/05 Released by Harlan Stenn +* [Bug 1050] Change ONCORE log message for leap second announcement + to avoid misunderstandings. +* [Bug 2499] Win32 user-space/loopback ppsapi provider drops samples. +* [Bug 2256] Improve configure's function searches in libraries. +(4.2.7p393) 2013/10/16 Released by Harlan Stenn +* [Bug 2272] Use C99 integer types. ntp_calendar.h and ntp_types.h . +(4.2.7p392) 2013/10/15 Released by Harlan Stenn +* [Bug 2375] Improve AIX compatibility. +* [Bug 2490] Fixed non-const initializer coming from [Bug 2250] fix. +(4.2.7p391) 2013/10/12 Released by Harlan Stenn +* [Bug 2250] Rework of leap second handling machine. +* [Bug 2419] [rc-nmea] Improve clockstats reporting when receiver sends + data without valid GPS fix. +(4.2.7p390) 2013/09/26 Released by Harlan Stenn +* [Bug 2482] Cleanup of droproot and jail support for Solaris. +(4.2.7p389) 2013/09/24 Released by Harlan Stenn +* [Bug 2473] revisited: NTPD exits after clock is stepped backwards + Avoid possible unsigned underrun for startup condition when testing + for clock backstep. +* [Bug 2481] ntpd aborts when both user and group are specified with -u. +* [Bug 2482] Add droproot and jail support for Solaris. +(4.2.7p388) 2013/09/19 Released by Harlan Stenn +* [Bug 2473] NTPD exits after clock is stepped backwards externally +(4.2.7p387) 2013/09/16 Released by Harlan Stenn +* [Bug 1642] ntpdsim can't find simnulate block in config file. +(4.2.7p386) 2013/09/01 Released by Harlan Stenn +* [Bug 2472] (WinXP) Avoid self-termination of IO thread during exit(). +(4.2.7p385) 2013/08/19 Released by Harlan Stenn +* CID 975596: Copy/paste error: vallen should be siglen. +* CID 1009579: Check return status of X509_add_ext(). +* [2085] Fix root distance and root dispersion calculations. +* [Bug 2426] Possibly uninitialized data in crypto_send() - CID 975596. +(4.2.7p384) 2013/08/18 Released by Harlan Stenn +* [Bug 2450] --version has bogus short option. +(4.2.7p383) 2013/08/10 Released by Harlan Stenn +* (no changes - force a rebuild for a new Coverity scan) +(4.2.7p382) 2013/08/08 Released by Harlan Stenn +* [Bug 2454] Need way to set file descriptor limit - cleanup. +(4.2.7p381) 2013/08/07 Released by Harlan Stenn +* [Bug 2451] rlimit command is missing from the table of contents in + miscopt.html . +* [Bug 2452] provide io_handler/input_handler only on + non HAVE_IO_COMPLETION_PORT platforms +* [Bug 2453] Need a way to avoid calling mlockall. +* [Bug 2454] Need way to set file descriptor limit. +* [Bug 2458] AM_CONFIG_HEADER is obsolete. +(4.2.7p380) 2013/08/03 Released by Harlan Stenn +* CID 984511: Some systems have different printf needs for sizeof. +(4.2.7p379) 2013/08/02 Released by Harlan Stenn +* CID 739724: Fix printf arg mismatch in a debug line. +* [Bug 2425] compile io_handler() in ntp_io.c unconditionally +* [Bug 2448] Fix checks for configure --with-stack-limit and --with-memlock + values. +(4.2.7p378) 2013/08/01 Released by Harlan Stenn +* [Bug 2425] move part of input handler code from ntpd.c to ntp_io.c + and fix select()-only platforms calling input_handler directly. +* [Bug 2446] Quiet warnings from Oracle's Studio compiler. +* Upgrade to AutoGen-5.18.1pre3 +* Upgrade to libopts-40.1.15. +(4.2.7p377) 2013/07/28 Released by Harlan Stenn +* [Bug 2397] License/copyright cleanup. +* [Bug 2439] Fix check of EscapeCommFunction() in ports/winnt/libntp/termios.c. +(4.2.7p376) 2013/07/24 Released by Harlan Stenn +* [Bug 2322] Oncore driver should send 0 PPS offset to GPS. +(4.2.7p375) 2013/07/22 Released by Harlan Stenn +* [Bug 883] log warning arguments swapped in refclock_gpsvme.c. +* [Bug 2368] Correct bug in previous attempt. +* [Bug 2413] Fix "make check" with automake >= 1.13. +* [Bug 2434] Line-buffer (v. block-buffer) stdout. +(4.2.7p374) 2013/07/21 Released by Harlan Stenn +* [Bug 2368] make check troubles in libevent. +* [Bug 2425] setup SIGIO/SIGPOLL for asyncio on the read side + of a socketpair for the worker thread. +(4.2.7p373) 2013/07/20 Released by Harlan Stenn +* [Bug 2427] configure fails to detect recvmsg() on Solaris. +(4.2.7p372) 2013/07/17 Released by Harlan Stenn +* [Bug 1466] Oncore should set FLAG_PPS. +* [Bug 2375] AIX 7 doesn't like a libevent validation check. +* [Bug 2423] Log command-line args at LOG_INFO. +* [Bug 2428] do_unconf() should reset 'items' before the 2nd loop. +(4.2.7p371) 2013/07/07 Released by Harlan Stenn +* CID 1042586: Check the return value of clock_gettime() in worker_sleep(). +* Upgrade to libopts-39.0.14 from 5.17.5pre10. +(4.2.7p370) 2013/07/06 Released by Harlan Stenn +* Remove \n's from syslog output strings. +(4.2.7p369) 2013/07/05 Released by Harlan Stenn +* [Bug 2415] RES_LIMITED flags check should use &, not &&. +* Have NTP_LIBNTP check for time.h and clock_getres(). +* Fix ntpsweep to use sntp instead of ntpdate, from Oliver Kindernay. +(4.2.7p368) 2013/05/01 Released by Harlan Stenn +* [Bug 2145] ntpq dumps core when displaying sys_var_list and more. +(4.2.7p367) 2013/04/25 Released by Harlan Stenn +* [Bug 1485] Sometimes ntpd crashes +* [Bug 2382] Implement LOGTOD using ldexp() instead of shifting. +(4.2.7p366) 2013/04/17 Released by Harlan Stenn +* [Bug 1866] Disable some debugging output in refclock_oncore. +(4.2.7p365) 2013/04/16 Released by Harlan Stenn +* [Bug 2149] Log an error message if /proc/net/if_inet6 cannot be opened. +(4.2.7p364) 2013/03/26 Released by Harlan Stenn +* Bump sntp/include/autogen-version.def . +(4.2.7p363) 2013/03/26 Released by Harlan Stenn +* [Bug 2357] sntp/libopts/usage.c sometimes needs -lintl. +* Upgrade to libopts from 5.17.3pre10. +(4.2.7p362) 2013/03/19 Released by Harlan Stenn +* [Bug 2364] "sed -i" is not portable. +(4.2.7p361) 2013/03/17 Released by Harlan Stenn +* [Bug 2357] sntp/libopts/usage.c sometimes needs -lintl. +* [Bug 2365] "make check" fails in libevent. +(4.2.7p360) 2013/03/15 Released by Harlan Stenn +* Upgrade libevent (coverity fixes, etc.). +* EEXIST is OK for mkdir() in sntp/kod_management.c. +(4.2.7p359) 2013/03/03 Released by Harlan Stenn +* [Bug 2359] Fix send_via_ntp_signd() prototype. +(4.2.7p358) 2013/02/27 Released by Harlan Stenn +* Upgrade to autogen-5.17.3pre4 and libopts-38.0.13. +* [Bug 2357] sntp/libopts/usage.c on NetBSD needs -lintl. +(4.2.7p357) 2013/02/22 Released by Harlan Stenn +* Upgrade to autogen-5.17.2pre and libopts-38.0.13. +(4.2.7p356) 2013/02/19 Released by Harlan Stenn +* Added loc/debian. +(4.2.7p355) 2013/02/18 Released by Harlan Stenn +* CID 739708: Check return status of fcntl() in refclock_arc.c. +* CID 739709: Check return status of fcntl() in refclock_datum.c. +* CID 739710: Check return status of mkdir() in sntp/kod_management.c. +* CID 739711: Ignore return status of remove() in ntp-keygen.c. +* CID 739723: Print sizeof as unsigned. +* CID 971094: Clean up time of check/time of use in check_leap_file(). +(4.2.7p354) 2013/02/10 Released by Harlan Stenn +* CID 97194: Check return from setsockopt(). +* CID 739473,739532: Out-of-bounds access/illegal address computation. +* CID 739558: Double close. +* CID 739559: Double close. +* CID 739713: devmask/recmask copy/paste error. +* CID 739714: Fix code indentation level. +* CID 739715: Clean up sockaddr_dump(). +(4.2.7p353) 2013/02/09 Released by Harlan Stenn +* [Bug 2326] Check hourly for a new leapfile if the old one expired. +(4.2.7p352) 2013/01/28 Released by Harlan Stenn +* [Bug 2326] Notice when a new leapfile has been installed. +(4.2.7p351) 2013/01/24 Released by Harlan Stenn +* [Bug 2328] Don't apply small time adjustments on Windows versions + which don't support this. +(4.2.7p350) 2013/01/21 Released by Harlan Stenn +* Added sntp/loc/netbsd based on info from Christos Zoulas. +(4.2.7p349) 2013/01/20 Released by Harlan Stenn +* [Bug 2321] Fixed Windows build, but autogen update still required. +(4.2.7p348) 2013/01/17 Released by Harlan Stenn +* [Bug 2327] Rename sntp/ag-tpl/:Old to sntp/ag-tpl/Old. +* Cleanup to ntpsnmpd-opts.def. +* Cleanup to ntpq.texi. +* Documentation cleanup to the ntpd, ntpdc, ntpq and ntp-wait + .def files. +* In ntp.conf.def, cleanup SEE ALSO, document 'rlimit' options. +* Add a reference to RFC5907 in the ntpsnmpd documentation. +(4.2.7p347) 2013/01/07 Released by Harlan Stenn +* [Bug 2325] Re-enable mlockall() check under Linux post-1223 fix. +(4.2.7p346) 2013/01/06 Released by Harlan Stenn +* [Bug 1223] reorganize inclusion of sys/resource.h. +(4.2.7p345) 2013/01/04 Released by Harlan Stenn +* Update several .def files to use autogen-5.17 feature set. +(4.2.7p344) 2013/01/03 Released by Harlan Stenn +* Refactor and enhance mdoc2texi. +* Make sure agtexi-file.tpl defines label-str. +* Cleanup to ntp.conf.def. +* Upgrade to autogen-5.17 and libopts-37.0.12. +(4.2.7p343) 2013/01/02 Released by Harlan Stenn +* Update the copyright year. +(4.2.7p342) 2012/12/31 Released by Harlan Stenn +* [Bug 2081 - Backward Incompatible] rawstats now logs everything. +(4.2.7p341) 2012/12/30 Released by Harlan Stenn +(4.2.7p340) 2012/12/29 Released by Harlan Stenn +* mdoc2texi fixes: trailing punctuation. +(4.2.7p339) 2012/12/26 Released by Harlan Stenn +* mdoc2texi fixes: parseQuote, closing of list item tables. +* ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates. +(4.2.7p338) 2012/12/25 Released by Harlan Stenn +* mdoc2texi fixes: Handle_ArCmFlIc, Handle_Fn, HandleQ. +* ntp-keygen autogen documentation updates. +* ntpq autogen docs. +(4.2.7p337) 2012/12/22 Released by Harlan Stenn +* [Bug 1223] More final cleanup for rlimit changes. +(4.2.7p336) 2012/12/21 Released by Harlan Stenn +* [Bug 1223] Final cleanup for rlimit changes. +(4.2.7p335) 2012/12/18 Released by Harlan Stenn +* Update documentation templates and definitions. +* Create agtexi-file.tpl . +(4.2.7p334) 2012/12/10 Released by Harlan Stenn +* [Bug 2114] Update tests for sntp's synch distance. +* Create ntp-keygen.{html,texi}. +(4.2.7p333) 2012/12/07 Released by Harlan Stenn +* Autogen documentation cleanup. +(4.2.7p332) 2012/12/06 Released by Harlan Stenn +* sntp documentation cleanup. +(4.2.7p331) 2012/12/03 Released by Harlan Stenn +* [Bug 2114] Correctly calculate sntp's synch distance. +(4.2.7p330) 2012/12/03 Released by Harlan Stenn +* autogen doc cleanup +(4.2.7p329) 2012/12/01 Released by Harlan Stenn +* [Bug 2278] ACTS flag3 mismatch between code and driver18.html. +* Use an enum for the ACTS state table. +* html doc reconciliation with DLM's copy. +(4.2.7p328) 2012/11/30 Released by Harlan Stenn +* html doc reconciliation with DLM's copy. +(4.2.7p327) 2012/11/29 Released by Harlan Stenn +* [Bug 2024] Identify Events in the system status word in decode.html.' +* [Bug 2040] Provide a command-line option for the identity key bits. +* Create loc/darwin for Mac OSX +(4.2.7p326) 2012/11/21 Released by Harlan Stenn +* [Bug 1214] 'proto: precision = ...' should be at INFO, not NOTICE. +* [Bug 2246] Clear sys_leap when voting says to disarm the leap. +(4.2.7p325) 2012/11/20 Released by Harlan Stenn +* [Bug 2202] ntpq.html: there is no "acv" billboard. +* [Bug 2306] keep pps hack for Win32 even if user-mode/loopback + PPS API is activated on a serial line. +(4.2.7p324) 2012/11/19 Released by Harlan Stenn +* Reinstate doc fix to authentic.html from Mike T. +* [Bug 1223] cleanup for rlimit changes. +* [Bug 2098] Install DLM's HTML documentation. +* [Bug 2306] Added user-mode/loop-back PPS API provider for Win32 +(4.2.7p323) 2012/11/18 Released by Harlan Stenn +* html/ updates from Dave Mills. +(4.2.7p322) 2012/11/15 Released by Harlan Stenn +* [Bug 1223] Allow configurable values for RLIMIT_STACK and + RLIMIT_MEMLOCK. +* [Bug 1320] Log ntpd's initial command-line parameters. (updated fix) +* [Bug 2120] no sysexits.h under QNX. +* [Bug 2123] cleanup to html/leap.html. +(4.2.7p321) 2012/11/13 Released by Harlan Stenn +* [Bug 1320] Log ntpd's initial command-line parameters. +(4.2.7p320) 2012/11/12 Released by Harlan Stenn +* [Bug 969] Clarify ntpdate.html documentation about -u and ntpd. +* [Bug 1217] libisc/ifiter_sysctl.c:internal_current(): Ignore RTM + messages with wrong version +(4.2.7p319) 2012/11/11 Released by Harlan Stenn +* [Bug 2296] Fix compile problem with building with old OpenSSL. +(4.2.7p318) 2012/11/05 Released by Harlan Stenn +* [Bug 2301] Remove spurious debug output from ntpq. +(4.2.7p317) 2012/11/05 Released by Harlan Stenn +* [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line. +(4.2.7p316) 2012/10/27 Released by Harlan Stenn +* [Bug 2296] Update fix for Bug 2294 to handle --without-crypto. +(4.2.7p315) 2012/10/26 Released by Harlan Stenn +* [Bug 2294] ntpd crashes in FIPS mode. +(4.2.7p314) 2012/10/23 Released by Harlan Stenn +* Document a tricky malloc() of dns_ctx in sntp. +(4.2.7p313) 2012/10/23 Released by Harlan Stenn +* [Bug 2291] sntp should report why it cannot open file.kod. +* [Bug 2293] add support for SO_BINTIME, refine support for + SO_TIMESTAMPNS (bug 1374) +(4.2.7p312) 2012/10/11 Released by Harlan Stenn +* Clean up testing/debugging of fix for [Bug 938] from sntp/main.c . +(4.2.7p311) 2012/10/10 Released by Harlan Stenn +* [Bug 938] The argument to the -D flag takes a number, not a string. +* [Bug 1013] ntpdate's HTML page claims wrong default version. +* [Bug 1374] Support SO_TIMESTAMPNS. +(4.2.7p310) 2012/10/09 Released by Harlan Stenn +* [Bug 1374] Support SO_TIMESTAMPNS. +* [Bug 2266] Remove deprecated refclock_trak.c from Windows Makefile + equivalents. +* [Bug 2274] Bring libopts/enum.c back to (old) ANSI C compliance. +(4.2.7p309) 2012/10/04 Released by Harlan Stenn +* [Bug 2287] ntpdate returns 0 even if adjtime() call fails. +(4.2.7p308) 2012/09/29 Released by Harlan Stenn +* CID 97198: Check return from ioctl() calls in refclock_acts.c. +(4.2.7p307) 2012/09/29 Released by Harlan Stenn +* [Bug 1997] Fix sntp broadcast timeouts. +* [Bug 2234] Fix incorrect ntptrace html documentation. +* [Bug 2262] Install html docs in $htmldir. +* Fix typo in html/select.html. +(4.2.7p306) 2012/09/15 Released by Harlan Stenn +* [Bug 752] ToS cleanup from Mike Tatarinov. +(4.2.7p305) 2012/09/15 Released by Harlan Stenn +* [Bug 752] Use proper ToS network packet markings for IPv4 and IPv6. +* [Bug 1232] Convert SHM refclock to use struct timespec. +* [Bug 2258] Add syslog message about leap insertion. +* [Bug 2263] broadcast server doesn't work for host with + OS_MISSES_SPECIFIC_ROUTE_UPDATES. +* [Bug 2271] Decode refclock types when built with --disable-all-clocks. +* [Bug 2276] clk_sel240x.c #define's _XOPEN_SOURCE, breaking QNX6. +* Updates to driver28.html. +(4.2.7p304) 2012/09/06 Released by Harlan Stenn +* [Bug 2264] Cleanup SEL240X Refclock. +* In refclock_wwv.c rename SECOND to WWV_SEC and MINUTE to WWV_MIN. +(4.2.7p303) 2012/09/05 Released by Harlan Stenn +* [Bug 1232] Add nanosecond support to SHM driver. +(4.2.7p302) 2012/09/05 Released by Harlan Stenn +* [Bug 2160] Log warning about expired leapseconds file. +(4.2.7p301) 2012/09/03 Released by Harlan Stenn +* [Bug 2164] Greater precision needed for ntpq offset report. +* Clean the man5_MANS in ntpd/ . +(4.2.7p300) 2012/09/03 Released by Harlan Stenn +* [Bug 2262] Install sntp.html into htmldir. +* [Bug 2270] Install fails due to repeated man5 page names. +(4.2.7p299) 2012/09/01 Released by Harlan Stenn +* More cleanup to the bootstrap script. +(4.2.7p298) 2012/09/01 Released by Harlan Stenn +* Handle additional man page sections in the bootstrap script. +* Remove extraneous parens. +* Add a missing "%s" syslog format string. +(4.2.7p297) 2012/09/01 Released by Harlan Stenn +* Fix mdoc2man. +* Distribute ntp.conf.def and ntp.keys.def. +(4.2.7p296) 2012/08/31 Released by Harlan Stenn +* Begin support for autogen maintaining ntp.conf and ntp.keys docs. +* Upgrade to autogen-5.16.2 and libopts-36.5.11. +* Potential bugfix for agtexi-cmd.tpl. +(4.2.7p295) 2012/08/11 Released by Harlan Stenn +* Look for syslog's facilitynames[]. +(4.2.7p294) 2012/08/08 Released by Harlan Stenn +* [Bug 2242] configure fails to detect getifaddrs function on Solaris. +* [Bug 2249] Bad operator for 'test' in 'make check' of libevent. +* [Bug 2252] palisade: formats nanosecs to a 6-char field. +* Attempt to resolve strict-aliasing violation in refclock_tsyncpci.c. +* Fix && -> & typo in refclock_palisade.c debug statements. +(4.2.7p293) 2012/08/04 Released by Harlan Stenn +* [Bug 2247] (more) Get rid of the TRAK refclock - deprecated since 2006. +* Documentation cleanup from Mike T. +* Cleanup kclk_sel240x.o rules in libparse/Makefile.am. +(4.2.7p292) 2012/08/02 Released by Harlan Stenn +* [Bug 1545] Note why we are logging the Version string. +* [Bug 1872] Remove legacy ppsclock fdpps, #ifdef PPS. +* [Bug 2075] Fix spelling of 'incompatible'. +* [Bug 2247] Get rid of the TRAK refclock - deprecated since 2006. +* Clean up an exit status in ntpq.c. +(4.2.7p291) 2012/07/31 Released by Harlan Stenn +* [Bug 2241] MDNS registration should only happen if requested. +(4.2.7p290) 2012/07/20 Released by Harlan Stenn +* [Bug 1454] Add parse clock support for the SEL-240x GPS products. +* CID 709185: refclock_chu.c will leak fd==0 (better fix) +(4.2.7p289) 2012/07/16 Released by Harlan Stenn +* CID 97123: Future-proof possible change to refclock_nmea.c. +* CID 97377: ntp-keygen.c's followlink() might not NUL-terminate. +* CID 709185: refclock_chu.c will leak fd==0 (which should be impossible). +(4.2.7p288) 2012/07/03 Released by Harlan Stenn +* CID 709173: Make sure a libisc function we do not use is called properly. +(4.2.7p287) 2012/07/03 Released by Harlan Stenn +* Remove 1024 associations-per-server limit from ntpq. +* Remove blank line between ntpq mreadvar associations. +(4.2.7p286) 2012/06/28 Released by Harlan Stenn +* CID 97193: check return from sscanf() in ntp_config.c. +* CID 709169: check return from open("/dev/null", 0) and friends. +* CID 709207: Initialize "quality" for ulink_receive. +(4.2.7p285) 2012/06/18 Released by Harlan Stenn +* [Bug 2227] Enable mrulist access control via "restrict ... nomrulist". +* Automake-1.12 wants us to use AM_PROG_AR. +* Conditionalize msyslog messages about rejected mode 6 requests due to + nomodify and nomrulist restrictions under "logconfig +sysinfo". +* Increment sys_restricted in a few rejection paths due to nomodify + restrictions where previosuly overlooked. +(4.2.7p284) 2012/06/16 Released by Harlan Stenn +* [Bug 2225] libevent configure hangs. +* Update bundled libevent to git master, post libevent 2.1.1-alpha. +(4.2.7p283) 2012/06/16 Released by Harlan Stenn +* In sntp/m4/ntp_openssl.m4, Support multiple package names for the + crypto library. Add legacy support for -Wl,-rpath. +(4.2.7p282) 2012/06/15 Released by Harlan Stenn +* tickadj may need to be linked with PTHREAD_LIBS. +(4.2.7p281) 2012/06/14 Released by Harlan Stenn +* U_INT32_MAX cleanup in include/ntp_types.h . +* When linking, ntp_keygen and tickadj need $(LIBM). +(4.2.7p280) 2012/06/13 Released by Harlan Stenn +* [Bug 2224] Use-after-free in routing socket code after dropping root. +(4.2.7p279) 2012/06/10 Released by Harlan Stenn +* [Bug 2211] findbcastinter(): possibly undefined variable iface used. +* [Bug 2220] Incorrect check for maximum association id in ntpq. +(4.2.7p278) 2012/06/03 Released by Harlan Stenn +* [Bug 2204] Build with --enable-getifaddrs=glibc fails. +* [Bug 2178] refclock_tsyncpci.c reach register fails to shift. +* [Bug 2191] dcfd -Y y2kcheck on CentOS 6.2 x86_64 breaks make check. +(4.2.7p277) 2012/05/25 Released by Harlan Stenn +* [Bug 2193] Building timestruct tests with Clang 3.1 fails. +(4.2.7p276) 2012/05/15 Released by Harlan Stenn +* [Bug 2179] Remove sntp/header.h. +(4.2.7p275) 2012/04/28 Released by Harlan Stenn +* [Bug 1744] Remove obsolete ntpdate/ntptime* items. +(4.2.7p274) 2012/04/25 Released by Harlan Stenn +* [Bug 2174] ntpd rejects source UDP ports less than 123 as bogus. +(4.2.7p273) 2012/04/19 Released by Harlan Stenn +* [Bug 2141] handle_sigio() calls get_systime(), which must be + reentrant when SIGIO is used. Sanity checks relative to the prior + get_systime() are disabled in ntpd on systems with signaled I/O, but + active in sntp and ntpdate. +* Correct authnumfreekeys accounting broken in 4.2.7p262. +(4.2.7p272) 2012/04/14 Released by Harlan Stenn +* LCRYPTO is gone - replace with VER_SUFFIX. +* Change the link order for ntpsntpd. +* Remove extra 'nlist' check from configure.ac. +(4.2.7p271) 2012/04/11 Released by Harlan Stenn +* [Bug 1122] openssl detection via pkg-config fails when no additional + -Idir flags are needed. +* Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead + they are added to LDFLAGS_NTP. +(4.2.7p270) 2012/03/26 Released by Harlan Stenn +* Update driver45.html page. +(4.2.7p269) 2012/03/25 Released by Harlan Stenn +* Clean up configure.ac. +* Cleanup configure.ac's TSYNC PCI section. +(4.2.7p268) 2012/03/24 Released by Harlan Stenn +* Update driver45.html page. +(4.2.7p267) 2012/03/23 Released by Harlan Stenn +* Initial cut at a basic driver45.html page. +(4.2.7p266) 2012/03/21 Released by Harlan Stenn +* Add refclock_tsyncpci.c (driver 45) supporting Spectracom TSYNC timing + boards. +(4.2.7p265) 2012/03/20 Released by Harlan Stenn +* Treat zero counter as indication of precise system time in Windows + PPSAPI helper function pps_ntp_timestamp_from_counter(), enabling + PPSAPI providers to use the Windows 8 precise clock directly. +(4.2.7p264) 2012/03/14 Released by Harlan Stenn +* [Bug 2160] Note if leapseconds file is past its prime. +* Use GetSystemTimePreciseAsFileTime() on Windows 8. +(4.2.7p263) 2012/03/13 Released by Harlan Stenn +* [Bug 2156] clock instability with LOCAL driver, from Miroslav Lichvar. +* [Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401. +(4.2.7p262) 2012/02/29 Released by Harlan Stenn +* Improve ntpd scalability for servers with many trusted keys. +(4.2.7p261) 2012/02/27 Released by Harlan Stenn +* [Bug 2048] add the clock variable timecode to SHM refclock. +(4.2.7p260) 2012/02/24 Released by Harlan Stenn +* Fix the check-scm-rev invocation in several Makefile.am's. +(4.2.7p259) 2012/02/22 Released by Harlan Stenn +* [Bug 2148] ntpd 4.2.7p258 segfault with 0x0100000 bit in NMEA mode. +* refclock_nmea.c merge cleanup thanks to Juergen Perlinger. +(4.2.7p258) 2012/02/21 Released by Harlan Stenn +* [Bug 2140] Rework of Windows I/O completion port handling to avoid + garbling serial input in UNIX line discipline emulation. +* [Bug 2143] NMEA driver: discard data if quality indication not good, + add statistic counters (mode bit enabled) to clockstats file. +(4.2.7p257) 2012/02/17 Released by Harlan Stenn +* [Bug 2135] defer calls to 'io_input' to main thread under Windows. +(4.2.7p256) 2012/02/08 Released by Harlan Stenn +* [Bug 2131] Set the system variable settimeofday only after clock step. +* [Bug 2134] --enable-C99-snprintf does not force rpl_snprintf use. +(4.2.7p255) 2012/01/29 Released by Harlan Stenn +* [Bug 603] Only link with nlist()-related libraries when needed: + More cleanup. +(4.2.7p254) 2012/01/29 Released by Harlan Stenn +* [Bug 603] Only link with nlist()-related libraries when needed. +(4.2.7p253) 2012/01/26 Released by Harlan Stenn +* [Bug 2126] Compile error on Windows with libopts from Autogen 5.14. +* Update one of the license URLs. +(4.2.7p252) 2012/01/25 Released by Harlan Stenn +* Upgrade to autogen-5.14 (and libopts-36.1.11). +(4.2.7p251) 2012/01/17 Released by Harlan Stenn +* [Bug 2115] ntptrace should accept both rootdispersion and rootdisp. +(4.2.7p250) 2012/01/15 Released by Harlan Stenn +* [Bug 2113] Warn about ignored extra args in ntpq. +* Update the copyright year. +(4.2.7p249) 2012/01/10 Released by Harlan Stenn +* [Bug 2111] Remove minpoll delay before iburst for pool and + manycastclient. +* Move refclock-specific scheduled timer code under #ifdef REFCLOCK + and move "action" and "nextaction" data for same from struct peer to + struct refclockproc. These provide a way to schedule a callback some + seconds in the future. +(4.2.7p248) 2012/01/08 Released by Harlan Stenn +* [Bug 2109] "make clean check" is broken with gtest available. +* [Bug 2110] systime.c typo breaks build on microsecond clocks. +(4.2.7p247) 2012/01/07 Released by Harlan Stenn +* Fix build break triggered by updating deps-ver and libntp/systime.c at + the same time by explicitly depending systime_s.c on systime.c. +(4.2.7p246) 2012/01/06 Released by Harlan Stenn +* [Bug 2104] ntpdc fault with oversize -c command. +* [Bug 2106] Fix warnings when using -Wformat-security. +* Refactor timespecops.h and timevalops.h into inline functions. +(4.2.7p245) 2011/12/31 Released by Harlan Stenn +* [Bug 2100] conversion problem with timespec/timeval <--> l_fp fixed; + added tests to expose the bug. +(4.2.7p244) 2011/12/25 Released by Harlan Stenn +* Updates from 4.2.6p5. +(4.2.7p243) 2011/12/23 Released by Harlan Stenn +* [Bug 2095] ntptrace now needs 'rv' instead of 'pstat', reported + by Michael Tatarinov. +(4.2.7p242) 2011/12/21 Released by Harlan Stenn +* Include missing html/icons/sitemap.png, reported by Michael Tatarinov. +* Documentation updates from Dave Mills. +(4.2.7p241) 2011/12/18 Released by Harlan Stenn +* [Bug 2015] Overriding sys_tick should recalculate sys_precision. +* [Bug 2037] Fuzzed non-interpolated clock may decrease. +* [Bug 2068] "tos ceiling" default and cap changed to 15. +* Floor peer delay using system precision, as with jitter, reflecting + inability to measure shorter intervals. +(4.2.7p240) 2011/12/15 Released by Harlan Stenn +* [Bug 2092] clock_select() selection jitter miscalculated. +* [Bug 2093] Reintroduce smaller stratum factor to system peer metric. +(4.2.7p239) 2011/12/11 Released by Harlan Stenn +* Documentation updates from Dave Mills. +(4.2.7p238) 2011/12/09 Released by Harlan Stenn +* [Bug 2082] from 4.2.6p5-RC3: 3-char refid sent by ntpd 4.2.6p5-RC2 + ends with extra dot. +* [Bug 2085] from 4.2.6p5-RC3: clock_update() sys_rootdisp calculation + omits root delay. +* [Bug 2086] from 4.2.6p5-RC3: get_systime() should not offset by + sys_residual. +* [Bug 2087] from 4.2.6p5-RC3: sys_jitter calculation overweights + sys.peer jitter. +* from 4.2.6p5-RC3: Ensure NULL peer->dstadr is not accessed in orphan + parent selection. +(4.2.7p237) 2011/12/01 Released by Harlan Stenn *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 22:56:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BC76CBA; Sat, 20 Dec 2014 22:56:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2FACA149C; Sat, 20 Dec 2014 22:56:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKMu7WS008606; Sat, 20 Dec 2014 22:56:07 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKMu73a008605; Sat, 20 Dec 2014 22:56:07 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201412202256.sBKMu73a008605@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 20 Dec 2014 22:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275971 - vendor/ntp/4.2.8 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 22:56:07 -0000 Author: cy Date: Sat Dec 20 22:56:06 2014 New Revision: 275971 URL: https://svnweb.freebsd.org/changeset/base/275971 Log: Tag ntp-4.2.8. Reviewed by: roberto Security: VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2 Security: http://www.kb.cert.org/vuls/id/852879 Security: CVE-2014-9293 Security CVE-2014-9294 Security CVE-2014-9295 Security CVE-2014-9296 Added: vendor/ntp/4.2.8/ - copied from r275970, vendor/ntp/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 22:58:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47F4EDFD; Sat, 20 Dec 2014 22:58:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 341CA14B7; Sat, 20 Dec 2014 22:58:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKMwiEZ008917; Sat, 20 Dec 2014 22:58:44 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKMwii9008916; Sat, 20 Dec 2014 22:58:44 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201412202258.sBKMwii9008916@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 20 Dec 2014 22:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r275972 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 22:58:44 -0000 Author: cy Date: Sat Dec 20 22:58:43 2014 New Revision: 275972 URL: https://svnweb.freebsd.org/changeset/base/275972 Log: ntp-4.2.8 vendor import complete. Remove sizelimit restriction. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sat Dec 20 22:56:06 2014 (r275971) +++ svnadmin/conf/sizelimit.conf Sat Dec 20 22:58:43 2014 (r275972) @@ -20,7 +20,7 @@ #lulf # adrian brooks -cy +# cy des dim ed From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 23:15:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 477D1441; Sat, 20 Dec 2014 23:15:41 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5E50177B; Sat, 20 Dec 2014 23:15:40 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id ex7so5100245wid.3; Sat, 20 Dec 2014 15:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ocDksZgYpbntgcmPC5hEPb+VcA5LLCDYON/H8EeJC9U=; b=NzhWgyBBt/pf2EdcTdJQIqxvakDEf4rWfevAk02anh2jAIVlriIC4zZwlhr8MTA8Hm GU62us+6BpG3GkP393c9LySAQzgmTVXijfNjhWL8pZjVJDmGFQJ7aAFQGnjHwErY72tg AypHflCofHY9+7K7dviVmWzDhZXqbY1cciMfR6dAmkYEn28dowqfmyFDmVZu0aINYBQT Z7iQh1dsfzODDHoTsr58AbPtQg4luCCP4tFnIYX4JB4smgthhYXmrSjFNy6VR8hfN/Ts 9OdGzkUnjBO9D39XNv2N60RF1OYd0EebbF1yiDJOnlDNEft14H7+cg/N7vwGLjOLlQT0 tG0g== X-Received: by 10.180.81.169 with SMTP id b9mr18308998wiy.41.1419117339334; Sat, 20 Dec 2014 15:15:39 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id kn5sm17806833wjb.48.2014.12.20.15.15.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Dec 2014 15:15:38 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 21 Dec 2014 00:15:36 +0100 From: Baptiste Daroussin To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r275768 - in head/usr.sbin: . vigr Message-ID: <20141220231536.GH21894@ivaldir.etoilebsd.net> References: <201412141640.sBEGelm0072509@svn.freebsd.org> <20141220135125.GE21894@ivaldir.etoilebsd.net> <867fxm1hle.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SdvjNjn6lL3tIsv0" Content-Disposition: inline In-Reply-To: <867fxm1hle.fsf@nine.des.no> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 23:15:41 -0000 --SdvjNjn6lL3tIsv0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 20, 2014 at 04:11:41PM +0100, Dag-Erling Sm=F8rgrav wrote: > Baptiste Daroussin writes: > > I wonder why you chose making a script instead of using libutil? >=20 > 50 lines of shell vs a few hundred lines of C... Sure I was not thinking of rewriting a full version but rather modify a bit= vipw so if the binary is named vigr it operates on group. regards, Bapt --SdvjNjn6lL3tIsv0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlSWAxUACgkQ8kTtMUmk6EzxLwCfVTLXZj2xiCymrLCooo6nWXho Df8An28dc0Y0Br8AarOjTnLNRjBZNYT3 =Jvrk -----END PGP SIGNATURE----- --SdvjNjn6lL3tIsv0-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 23:41:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD7078F5; Sat, 20 Dec 2014 23:41:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9951F1B25; Sat, 20 Dec 2014 23:41:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKNfc4w030622; Sat, 20 Dec 2014 23:41:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKNfca8030621; Sat, 20 Dec 2014 23:41:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201412202341.sBKNfca8030621@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 20 Dec 2014 23:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275973 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 23:41:38 -0000 Author: adrian Date: Sat Dec 20 23:41:37 2014 New Revision: 275973 URL: https://svnweb.freebsd.org/changeset/base/275973 Log: Add some more debugging to the scan cancel methods - I'd like to see what situations would cause the scan cancel's to not complete. Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Sat Dec 20 22:58:43 2014 (r275972) +++ head/sys/net80211/ieee80211_scan.c Sat Dec 20 23:41:37 2014 (r275973) @@ -698,6 +698,13 @@ ieee80211_cancel_scan(struct ieee80211va SCAN_PRIVATE(ss)->ss_iflags |= ISCAN_CANCEL; /* wake up the scan task */ scan_signal(ss); + } else { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, + "%s: called; F_SCAN=%d, vap=%s, CANCEL=%d\n", + __func__, + !! (ic->ic_flags & IEEE80211_F_SCAN), + (ss->ss_vap == vap ? "match" : "nomatch"), + !! (SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL)); } IEEE80211_UNLOCK(ic); } @@ -724,6 +731,13 @@ ieee80211_cancel_anyscan(struct ieee8021 SCAN_PRIVATE(ss)->ss_iflags |= ISCAN_CANCEL; /* wake up the scan task */ scan_signal(ss); + } else { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, + "%s: called; F_SCAN=%d, vap=%s, CANCEL=%d\n", + __func__, + !! (ic->ic_flags & IEEE80211_F_SCAN), + (ss->ss_vap == vap ? "match" : "nomatch"), + !! (SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL)); } IEEE80211_UNLOCK(ic); }