From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 02:01:52 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E73C6562;
 Sun,  8 Sep 2013 02:01:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B7D242103;
 Sun,  8 Sep 2013 02:01:52 +0000 (UTC)
Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net
 [71.224.221.174])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate) (Authenticated sender: gjb)
 by mail0.glenbarber.us (Postfix) with ESMTPSA id C0F6A212D;
 Sun,  8 Sep 2013 02:01:50 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us C0F6A212D
Authentication-Results: mail0.glenbarber.us; dkim=none
 reason="no signature"; dkim-adsp=none
Date: Sat, 7 Sep 2013 22:01:49 -0400
From: Glen Barber <gjb@FreeBSD.org>
To: Mark Murray <markm@FreeBSD.org>
Subject: Re: svn commit: r255379 - head/sys/dev/random
Message-ID: <20130908020149.GZ77463@glenbarber.us>
References: <201309072207.r87M7aEI020346@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="rYRijwbmzeJBcrGE"
Content-Disposition: inline
In-Reply-To: <201309072207.r87M7aEI020346@svn.freebsd.org>
X-Operating-System: FreeBSD 10.0-CURRENT amd64
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 02:01:53 -0000


--rYRijwbmzeJBcrGE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Sep 07, 2013 at 10:07:36PM +0000, Mark Murray wrote:
> Author: markm
> Date: Sat Sep  7 22:07:36 2013
> New Revision: 255379
> URL: http://svnweb.freebsd.org/changeset/base/255379
>=20
> Log:
>   Fix the build; Certain linkable symbols need to always be present.
>  =20
>   Pass the pointy hat please.
>  =20
>   Also unblock the software (Yarrow) generator for now. This will be
>   reverted; Yarrow needs to block until secure, not this behaviour
>   of serving as soon as asked.
>  =20
>   Folks with specific requiremnts will be able to (can!) unblock this
>   device with any write, and are encouraged to do so in /etc/rc.d/*
>   scripting. ("Any" in this case could be "echo '' > /dev/random" as
>   root).
>=20
> Modified:
>   head/sys/dev/random/pseudo_rng.c
>   head/sys/dev/random/random_adaptors.c
>   head/sys/dev/random/random_adaptors.h
>   head/sys/dev/random/randomdev.c
>   head/sys/dev/random/randomdev.h
>   head/sys/dev/random/randomdev_soft.c
>=20
> Modified: head/sys/dev/random/pseudo_rng.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/random/pseudo_rng.c	Sat Sep  7 20:52:31 2013	(r255378)
> +++ head/sys/dev/random/pseudo_rng.c	Sat Sep  7 22:07:36 2013	(r255379)
> @@ -39,6 +39,12 @@ __FBSDID("$FreeBSD$");
> =20
>  static struct mtx	pseudo_random_block_mtx;
> =20
> +/* Used to fake out unused random calls in random_adaptor */
> +void
> +random_null_func(void)
> +{
> +}
> +
>  static int
>  pseudo_random_block_read(void *buf __unused, int c __unused)
>  {
>=20
> Modified: head/sys/dev/random/random_adaptors.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/random/random_adaptors.c	Sat Sep  7 20:52:31 2013	(r2553=
78)
> +++ head/sys/dev/random/random_adaptors.c	Sat Sep  7 22:07:36 2013	(r2553=
79)
> @@ -53,6 +53,8 @@ static struct sx adaptors_lock; /* need=20
>  /* List for the dynamic sysctls */
>  static struct sysctl_ctx_list random_clist;
> =20
> +struct random_adaptor *random_adaptor;
> +
>  MALLOC_DEFINE(M_RANDOM_ADAPTORS, "random_adaptors", "Random adaptors buf=
fers");
> =20
>  int
> @@ -230,7 +232,7 @@ random_sysctl_active_adaptor_handler(SYS
>  	int error;
> =20
>  	name =3D NULL;
> -	rsp =3D random_get_active_adaptor();
> +	rsp =3D random_adaptor;
> =20
>  	if (rsp !=3D NULL) {
>  		sx_slock(&adaptors_lock);
>=20
> Modified: head/sys/dev/random/random_adaptors.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/random/random_adaptors.h	Sat Sep  7 20:52:31 2013	(r2553=
78)
> +++ head/sys/dev/random/random_adaptors.h	Sat Sep  7 22:07:36 2013	(r2553=
79)
> @@ -41,6 +41,8 @@ struct random_adaptor *random_adaptor_ge
>  int random_adaptor_register(const char *, struct random_adaptor *);
>  void random_adaptor_choose(struct random_adaptor **);
> =20
> +extern struct random_adaptor *random_adaptor;
> +
>  /*
>   * random_adaptor's should be registered prior to
>   * random module (SI_SUB_DRIVERS/SI_ORDER_MIDDLE)
>=20
> Modified: head/sys/dev/random/randomdev.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/random/randomdev.c	Sat Sep  7 20:52:31 2013	(r255378)
> +++ head/sys/dev/random/randomdev.c	Sat Sep  7 22:07:36 2013	(r255379)
> @@ -72,27 +72,12 @@ static struct cdevsw random_cdevsw =3D {
>  	.d_name =3D "random",
>  };
> =20
> -static struct random_adaptor *random_adaptor;
>  static eventhandler_tag attach_tag;
>  static int random_inited;
> =20
> -
>  /* For use with make_dev(9)/destroy_dev(9). */
>  static struct cdev *random_dev;
> =20
> -/* Used to fake out unused random calls in random_adaptor */
> -void
> -random_null_func(void)
> -{
> -}
> -
> -struct random_adaptor *
> -random_get_active_adaptor(void)
> -{=20
> -
> -	return (random_adaptor);
> -}
> -
>  /* ARGSUSED */
>  static int
>  random_close(struct cdev *dev __unused, int flags, int fmt __unused,
>=20
> Modified: head/sys/dev/random/randomdev.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/random/randomdev.h	Sat Sep  7 20:52:31 2013	(r255378)
> +++ head/sys/dev/random/randomdev.h	Sat Sep  7 22:07:36 2013	(r255379)
> @@ -53,4 +53,3 @@ struct random_adaptor {
> =20
>  extern void random_ident_hardware(struct random_adaptor **);
>  extern void random_null_func(void);
> -struct random_adaptor *random_get_active_adaptor(void);
>=20
> Modified: head/sys/dev/random/randomdev_soft.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/random/randomdev_soft.c	Sat Sep  7 20:52:31 2013	(r25537=
8)
> +++ head/sys/dev/random/randomdev_soft.c	Sat Sep  7 22:07:36 2013	(r25537=
9)
> @@ -79,7 +79,7 @@ static struct random_adaptor random_cont
>  	.write =3D randomdev_write,
>  	.poll =3D randomdev_poll,
>  	.reseed =3D randomdev_flush_reseed,
> -	.seeded =3D 0,
> +	.seeded =3D 1,
>  };
>  #define RANDOM_MODULE_NAME	yarrow
>  #define RANDOM_CSPRNG_NAME	"yarrow"
> @@ -95,7 +95,7 @@ static struct random_adaptor random_cont
>  	.write =3D randomdev_write,
>  	.poll =3D randomdev_poll,
>  	.reseed =3D randomdev_flush_reseed,
> -	.seeded =3D 0,
> +	.seeded =3D 1,
>  };
>  #define RANDOM_MODULE_NAME	fortuna
>  #define RANDOM_CSPRNG_NAME	"fortuna"

pseudo_rng.o:(.data+0x3c): undefined reference to `random_null_func'
pseudo_rng.o:(.data+0x44): undefined reference to `random_null_func'
pseudo_rng.o:(.data+0x74): undefined reference to `random_null_func'
pseudo_rng.o:(.data+0x78): undefined reference to `random_null_func'
pseudo_rng.o:(.data+0x84): undefined reference to `random_null_func'
pseudo_rng.o:(.data+0x8c): more undefined references to
`random_null_func' follow
random_adaptors.o: In function `random_sysctl_active_adaptor_handler':
/src/sys/dev/random/random_adaptors.c:233: undefined reference to
`random_get_active_adaptor'
*** Error code 1

Stop.
bmake[1]: stopped in /obj/arm.arm/src/sys/SIMICS
*** Error code 1

Stop.
bmake: stopped in /src
*** Error code 1

Stop in /src.
TB --- 2013-09-07 23:28:23 - WARNING: /usr/bin/make returned exit code
1
TB --- 2013-09-07 23:28:23 - ERROR: failed to build SIMICS kernel
TB --- 2013-09-07 23:28:23 - 13762.27 user 2777.03 system 18481.66 real


http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-arm-arm.full

Glen


--rYRijwbmzeJBcrGE
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQEcBAEBCAAGBQJSK9qNAAoJEFJPDDeguUaj+E0IAJLk9QpAd1AkmDJbNSSvI7iM
x1OujqRFsScr2kmNjdyna1E9lwtMRCKDP2vC76HeJd/8neVrqHRF3RyJmCZZ0nTW
pJmS9QihtdrxUgkYvBrSi6J6wNfR0dJfLbvVzMQKoBebGgk+fc8prCAkj8hPwoXp
yi5sczcknRKPKQbUWyW/pFvpBgdSXUcTHf21QwGg8Nom9pYVT6O8XeiWz075NNb7
3SIlL5eGtHECfJzuCZ9gSxsAsqV+dBDx8+8zbKiH8gIV0D9LB53+sxxfpUcDUkE8
VBHa+KgNDYMNDw5x9I3wOEKVHserLhjBY0Xaak/mzz10ydmc79btyLgsQjJ53Zs=
=hUOc
-----END PGP SIGNATURE-----

--rYRijwbmzeJBcrGE--

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 05:14:00 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0E1009F1;
 Sun,  8 Sep 2013 05:14:00 +0000 (UTC)
 (envelope-from Cy.Schubert@komquats.com)
Received: from smtp-out-04.shaw.ca (smtp-out-04.shaw.ca [64.59.134.12])
 by mx1.freebsd.org (Postfix) with ESMTP id AF36D293E;
 Sun,  8 Sep 2013 05:13:59 +0000 (UTC)
X-Cloudmark-SP-Filtered: true
X-Cloudmark-SP-Result: v=1.1 cv=6HkG4LK5i0ZTEQwzSfMqnsQ8WbrxJ2NwB1mI+RNtyjI=
 c=1 sm=1
 a=woDmJKRLh68A:10 a=QrugwKR0C_UA:10 a=wAGQQ9Az6v0A:10 a=BLceEmwcHowA:10
 a=ICAaq7hcmGcA:10 a=kj9zAlcOel0A:10 a=IbtKDeXwb2+SRU442/pi3A==:17
 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=zlZMkP4hc87TffjmmSMA:9
 a=CjuIK1q_8ugA:10 a=V7tsTZBp22UA:10 a=SV7veod9ZcQA:10
 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
Received: from unknown (HELO spqr.komquats.com) ([96.50.7.119])
 by smtp-out-04.shaw.ca with ESMTP; 07 Sep 2013 23:13:53 -0600
Received: from slippy.cwsent.com (slippy [10.1.1.91])
 by spqr.komquats.com (Postfix) with ESMTP id BE2C569;
 Sat,  7 Sep 2013 22:13:52 -0700 (PDT)
Received: from slippy (localhost [127.0.0.1])
 by slippy.cwsent.com (8.14.7/8.14.7) with ESMTP id r885DqbH010021;
 Sat, 7 Sep 2013 22:13:52 -0700 (PDT)
 (envelope-from Cy.Schubert@komquats.com)
Message-Id: <201309080513.r885DqbH010021@slippy.cwsent.com>
X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.5
From: Cy Schubert <Cy.Schubert@komquats.com>
X-os: FreeBSD
X-Sender: cy@cwsent.com
X-URL: http://www.komquats.com/
To: Gleb Smirnoff <glebius@FreeBSD.org>
Subject: Re: svn commit: r255355 - head/sys/contrib/ipfilter/netinet
In-Reply-To: Message from Gleb Smirnoff <glebius@FreeBSD.org> of "Sat,
 07 Sep 2013 09:47:18 -0000." <201309070947.r879lI4V050809@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Sat, 07 Sep 2013 22:13:52 -0700
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.14
Precedence: list
Reply-To: Cy Schubert <Cy.Schubert@komquats.com>
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 05:14:00 -0000

In message <201309070947.r879lI4V050809@svn.freebsd.org>, Gleb Smirnoff 
writes:
> Author: glebius
> Date: Sat Sep  7 09:47:18 2013
> New Revision: 255355
> URL: http://svnweb.freebsd.org/changeset/base/255355
> 
> Log:
>   Fix !INET6 build.
> 
> Modified:
>   head/sys/contrib/ipfilter/netinet/fil.c
> 
> Modified: head/sys/contrib/ipfilter/netinet/fil.c
> =============================================================================
> =
> --- head/sys/contrib/ipfilter/netinet/fil.c	Sat Sep  7 09:45:43 2013
> 	(r255354)
> +++ head/sys/contrib/ipfilter/netinet/fil.c	Sat Sep  7 09:47:18 2013
> 	(r255355)
> @@ -9862,8 +9862,8 @@ ipf_ht_node_make_key(htp, key, family, a
>  			key->hn_addr.adf_addr.i6[0] = addr->i6[0] &
>  					     htonl(0xffffffff << (32 - bits));
>  		}
> -	}
>  #endif
> +	}
>  }
>  

Thanks.


-- 
Cheers,
Cy Schubert <Cy.Schubert@komquats.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.



From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 06:21:27 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
 id 31CD031D; Sun,  8 Sep 2013 06:21:27 +0000 (UTC)
Date: Sun, 8 Sep 2013 06:21:27 +0000
From: Alexey Dokuchaev <danfe@FreeBSD.org>
To: Edward Tomasz =?koi8-r?Q?Napiera=B3a?= <trasz@FreeBSD.org>
Subject: Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf
Message-ID: <20130908062126.GA12053@FreeBSD.org>
References: <201309062024.r86KOMqm059838@svn.freebsd.org>
 <CAGaYwLcV8hS+k_B2xozcqfdz5TcJ+gyN=6whO8wJ_6puW1_njg@mail.gmail.com>
 <20130907081743.GB95723@zxy.spb.ru>
 <CAGaYwLcibUVY1C8BMUjRart75HBNMu4W-ddjSK5pHb3JYhf1Gg@mail.gmail.com>
 <20130907170700.GB3796@zxy.spb.ru>
 <CAJ-VmoksU9R4cPsVtxzMma_QHv0Hsm8mTCVixOEVKx2_uS-8eA@mail.gmail.com>
 <EE92600F-0A1B-4684-B928-410AE12B128D@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <EE92600F-0A1B-4684-B928-410AE12B128D@FreeBSD.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Adrian Chadd <adrian@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>,
 Bryan Venteicher <bryanv@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 Slawa Olhovchenkov <slw@zxy.spb.ru>,
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 06:21:27 -0000

On Sat, Sep 07, 2013 at 10:48:48PM +0200, Edward Tomasz Napiera³a wrote:
> I have no idea on what's the loader(8) state right now, but long time ago
> I've made a patch that made it significantly faster by making caching
> actually work.

Nice, the patch actually applies against 8-stable.  I will test it next time
I will rebuild the world on my laptop, thanks!

> No idea if anyone picked up the patch [url skipped] though.

Why it was never committed?  Lack of review, or are there any issues/concerns
raised by the patch?

./danfe

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 07:19:27 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 588A2D9A;
 Sun,  8 Sep 2013 07:19:27 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CAB2A2E4D;
 Sun,  8 Sep 2013 07:19:25 +0000 (UTC)
Received: from cell.glebius.int.ru (localhost [127.0.0.1])
 by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r887JCLF030217;
 Sun, 8 Sep 2013 11:19:12 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
Received: (from glebius@localhost)
 by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r887JC18030216;
 Sun, 8 Sep 2013 11:19:12 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to
 glebius@FreeBSD.org using -f
Date: Sun, 8 Sep 2013 11:19:12 +0400
From: Gleb Smirnoff <glebius@FreeBSD.org>
To: Slawa Olhovchenkov <slw@zxy.spb.ru>
Subject: Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf
Message-ID: <20130908071912.GY4574@FreeBSD.org>
References: <201309062024.r86KOMqm059838@svn.freebsd.org>
 <CAGaYwLcV8hS+k_B2xozcqfdz5TcJ+gyN=6whO8wJ_6puW1_njg@mail.gmail.com>
 <20130907081743.GB95723@zxy.spb.ru>
 <CAGaYwLcibUVY1C8BMUjRart75HBNMu4W-ddjSK5pHb3JYhf1Gg@mail.gmail.com>
 <20130907170700.GB3796@zxy.spb.ru>
 <CAJ-VmoksU9R4cPsVtxzMma_QHv0Hsm8mTCVixOEVKx2_uS-8eA@mail.gmail.com>
 <EE92600F-0A1B-4684-B928-410AE12B128D@FreeBSD.org>
 <20130907210244.GE3796@zxy.spb.ru>
 <CAJ-Vmom1iLOZH1mOj6oqr5n4qeymi6k5zVv3sw4WGvnzakKY9g@mail.gmail.com>
 <20130907212957.GF3796@zxy.spb.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130907212957.GF3796@zxy.spb.ru>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Adrian Chadd <adrian@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>,
 Bryan Venteicher <bryanv@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "Andrey V. Elsukov" <ae@freebsd.org>,
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,
 Edward Tomasz Napiera?a <trasz@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 07:19:27 -0000

On Sun, Sep 08, 2013 at 01:29:57AM +0400, Slawa Olhovchenkov wrote:
S> I think now -HEAD can't be more risky by one or two patches.

Yes, it can.

Do you run HEAD actually on regular basis when you make such
an assertion?

-- 
Totus tuus, Glebius.

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 07:22:09 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 5391174
 for <svn-src-all@freebsd.org>; Sun,  8 Sep 2013 07:22:09 +0000 (UTC)
 (envelope-from andre@freebsd.org)
Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id BA0712E9F
 for <svn-src-all@freebsd.org>; Sun,  8 Sep 2013 07:22:08 +0000 (UTC)
Received: (qmail 59868 invoked from network); 8 Sep 2013 08:01:59 -0000
Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2])
 (envelope-sender <andre@freebsd.org>)
 by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP
 for <trociny@FreeBSD.org>; 8 Sep 2013 08:01:59 -0000
Message-ID: <522C2593.9080001@freebsd.org>
Date: Sun, 08 Sep 2013 09:21:55 +0200
From: Andre Oppermann <andre@freebsd.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
 rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: Mikolaj Golub <trociny@FreeBSD.org>
Subject: Re: svn commit: r254773 - head/sys/net
References: <201308241117.r7OBHPQ1032341@svn.freebsd.org>
 <20130907153029.GB7349@gmail.com>
In-Reply-To: <20130907153029.GB7349@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, zec@freebsd.org,
 bz@freebsd.org, svn-src-head@freebsd.org, julian@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 07:22:09 -0000

On 07.09.2013 17:30, Mikolaj Golub wrote:
> Hi,
>
> On Sat, Aug 24, 2013 at 11:17:25AM +0000, Andre Oppermann wrote:
>> Author: andre
>> Date: Sat Aug 24 11:17:25 2013
>> New Revision: 254773
>> URL: http://svnweb.freebsd.org/changeset/base/254773
>>
>> Log:
>>    Resolve the confusion between the head_list and the hook list.
>>
>>    The linked list of pfil hooks is changed to "chain" and this term
>>    is applied consistently.  The head_list remains with "list" term.
>>
>>    Add KASSERT to vnet_pfil_uninit().
>
> ...
>
>>   vnet_pfil_uninit(const void *unused)
>>   {
>>
>> -	/*  XXX should panic if list is not empty */
>> +	KASSERT(LIST_EMPTY(&V_pfil_head_list),
>> +	    ("%s: pfil_head_list %p not empty", __func__, &V_pfil_head_list));
>>   	PFIL_LOCK_DESTROY_REAL(&V_pfil_lock);
>>   	return (0);
>>   }
>>
>
> It is triggered when destroying a vnet, due to inet/inet6 pfil hooks
> are not being unregistered.
>
> The attached patch fixes the issue for me. I am going to commit it if
> there are no objections -- might the unregistration has been skipped
> intentionally due to some unresolved issue?

There's no reason that I know of.  And if there were then unregistering
would be unsafe in any case.

-- 
Andre


From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 07:22:15 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8CE5B194;
 Sun,  8 Sep 2013 07:22:15 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1018B2EA2;
 Sun,  8 Sep 2013 07:22:14 +0000 (UTC)
Received: from cell.glebius.int.ru (localhost [127.0.0.1])
 by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r887M8hH030258;
 Sun, 8 Sep 2013 11:22:08 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
Received: (from glebius@localhost)
 by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r887M8Lp030257;
 Sun, 8 Sep 2013 11:22:08 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to
 glebius@FreeBSD.org using -f
Date: Sun, 8 Sep 2013 11:22:08 +0400
From: Gleb Smirnoff <glebius@FreeBSD.org>
To: Slawa Olhovchenkov <slw@zxy.spb.ru>
Subject: Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf
Message-ID: <20130908072208.GZ4574@FreeBSD.org>
References: <20130907081743.GB95723@zxy.spb.ru>
 <CAGaYwLcibUVY1C8BMUjRart75HBNMu4W-ddjSK5pHb3JYhf1Gg@mail.gmail.com>
 <20130907170700.GB3796@zxy.spb.ru>
 <CAJ-VmoksU9R4cPsVtxzMma_QHv0Hsm8mTCVixOEVKx2_uS-8eA@mail.gmail.com>
 <EE92600F-0A1B-4684-B928-410AE12B128D@FreeBSD.org>
 <20130907210244.GE3796@zxy.spb.ru>
 <CAJ-Vmom1iLOZH1mOj6oqr5n4qeymi6k5zVv3sw4WGvnzakKY9g@mail.gmail.com>
 <20130907212957.GF3796@zxy.spb.ru>
 <CAJ-VmomhCQMUBNF2KNEC_sc=iEmNy-aythX=UaeDmTmjBW5j+w@mail.gmail.com>
 <20130907214728.GG3796@zxy.spb.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130907214728.GG3796@zxy.spb.ru>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Adrian Chadd <adrian@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>,
 Bryan Venteicher <bryanv@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "Andrey V. Elsukov" <ae@freebsd.org>,
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,
 Edward Tomasz Napiera?a <trasz@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 07:22:15 -0000

On Sun, Sep 08, 2013 at 01:47:28AM +0400, Slawa Olhovchenkov wrote:
S> As we can see by activity in list planed: ipf 5.1, native iSCSI,
S> switch off GCC (with broken by clang kernel part), patch ld.so and many others.
S> Changed in loader and take out modules from kernel at this time is little-o.

ipf 5.1 affects only small fraction of users - those who use ipf.
Ditto for iSCSI. Switching off gcc affects only build issues, not
system stability or usability.

Changes in loader affect everyone and any problem in it is difficult
to debug via email.

-- 
Totus tuus, Glebius.

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 07:49:18 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8E73B601;
 Sun,  8 Sep 2013 07:49:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru)
Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98])
 by mx1.freebsd.org (Postfix) with ESMTP id 423732FAD;
 Sun,  8 Sep 2013 07:49:18 +0000 (UTC)
Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD))
 (envelope-from <slw@zxy.spb.ru>)
 id 1VIZm7-000BEj-Cy; Sun, 08 Sep 2013 11:51:15 +0400
Date: Sun, 8 Sep 2013 11:51:15 +0400
From: Slawa Olhovchenkov <slw@zxy.spb.ru>
To: Gleb Smirnoff <glebius@FreeBSD.org>
Subject: Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf
Message-ID: <20130908075115.GA41751@zxy.spb.ru>
References: <CAGaYwLcV8hS+k_B2xozcqfdz5TcJ+gyN=6whO8wJ_6puW1_njg@mail.gmail.com>
 <20130907081743.GB95723@zxy.spb.ru>
 <CAGaYwLcibUVY1C8BMUjRart75HBNMu4W-ddjSK5pHb3JYhf1Gg@mail.gmail.com>
 <20130907170700.GB3796@zxy.spb.ru>
 <CAJ-VmoksU9R4cPsVtxzMma_QHv0Hsm8mTCVixOEVKx2_uS-8eA@mail.gmail.com>
 <EE92600F-0A1B-4684-B928-410AE12B128D@FreeBSD.org>
 <20130907210244.GE3796@zxy.spb.ru>
 <CAJ-Vmom1iLOZH1mOj6oqr5n4qeymi6k5zVv3sw4WGvnzakKY9g@mail.gmail.com>
 <20130907212957.GF3796@zxy.spb.ru>
 <20130908071912.GY4574@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130908071912.GY4574@FreeBSD.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-SA-Exim-Connect-IP: <locally generated>
X-SA-Exim-Mail-From: slw@zxy.spb.ru
X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false
Cc: Adrian Chadd <adrian@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>,
 Bryan Venteicher <bryanv@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "Andrey V. Elsukov" <ae@freebsd.org>,
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,
 Edward Tomasz Napiera?a <trasz@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 07:49:18 -0000

On Sun, Sep 08, 2013 at 11:19:12AM +0400, Gleb Smirnoff wrote:

> On Sun, Sep 08, 2013 at 01:29:57AM +0400, Slawa Olhovchenkov wrote:
> S> I think now -HEAD can't be more risky by one or two patches.
> 
> Yes, it can.
> 
> Do you run HEAD actually on regular basis when you make such
> an assertion?

I am use -HEAD on my notebook. And I run -HEAD with iSCSI patches in
production.

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 07:58:30 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id F302179F;
 Sun,  8 Sep 2013 07:58:29 +0000 (UTC) (envelope-from slw@zxy.spb.ru)
Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98])
 by mx1.freebsd.org (Postfix) with ESMTP id A5C4A2011;
 Sun,  8 Sep 2013 07:58:29 +0000 (UTC)
Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD))
 (envelope-from <slw@zxy.spb.ru>)
 id 1VIZv7-000BIP-Vr; Sun, 08 Sep 2013 12:00:33 +0400
Date: Sun, 8 Sep 2013 12:00:33 +0400
From: Slawa Olhovchenkov <slw@zxy.spb.ru>
To: Gleb Smirnoff <glebius@FreeBSD.org>
Subject: Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf
Message-ID: <20130908080033.GH3796@zxy.spb.ru>
References: <CAGaYwLcibUVY1C8BMUjRart75HBNMu4W-ddjSK5pHb3JYhf1Gg@mail.gmail.com>
 <20130907170700.GB3796@zxy.spb.ru>
 <CAJ-VmoksU9R4cPsVtxzMma_QHv0Hsm8mTCVixOEVKx2_uS-8eA@mail.gmail.com>
 <EE92600F-0A1B-4684-B928-410AE12B128D@FreeBSD.org>
 <20130907210244.GE3796@zxy.spb.ru>
 <CAJ-Vmom1iLOZH1mOj6oqr5n4qeymi6k5zVv3sw4WGvnzakKY9g@mail.gmail.com>
 <20130907212957.GF3796@zxy.spb.ru>
 <CAJ-VmomhCQMUBNF2KNEC_sc=iEmNy-aythX=UaeDmTmjBW5j+w@mail.gmail.com>
 <20130907214728.GG3796@zxy.spb.ru>
 <20130908072208.GZ4574@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130908072208.GZ4574@FreeBSD.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-SA-Exim-Connect-IP: <locally generated>
X-SA-Exim-Mail-From: slw@zxy.spb.ru
X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false
Cc: Adrian Chadd <adrian@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>,
 Bryan Venteicher <bryanv@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "Andrey V. Elsukov" <ae@freebsd.org>,
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,
 Edward Tomasz Napiera?a <trasz@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 07:58:30 -0000

On Sun, Sep 08, 2013 at 11:22:08AM +0400, Gleb Smirnoff wrote:

> On Sun, Sep 08, 2013 at 01:47:28AM +0400, Slawa Olhovchenkov wrote:
> S> As we can see by activity in list planed: ipf 5.1, native iSCSI,
> S> switch off GCC (with broken by clang kernel part), patch ld.so and many others.
> S> Changed in loader and take out modules from kernel at this time is little-o.
> 
> ipf 5.1 affects only small fraction of users - those who use ipf.
> Ditto for iSCSI. Switching off gcc affects only build issues, not
> system stability or usability.

-HEAD, compiled by clang, can't resume from sleep by generating NMI. This
is not system stability or usability?

And I am already wrote about this. nobody cares.

Some time ago -HEAD snapshot can't be installed in virtulabox with
vm_phys_free_pages: page 0xc33fbfb8 has unexpected order 6.
May be this is clang issue? Perhaps. I save state this virtual
machine.

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 08:04:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 25BCB925;
 Sun,  8 Sep 2013 08:04:10 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 99E072072;
 Sun,  8 Sep 2013 08:04:09 +0000 (UTC)
Received: from cell.glebius.int.ru (localhost [127.0.0.1])
 by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r88843QE030508;
 Sun, 8 Sep 2013 12:04:03 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
Received: (from glebius@localhost)
 by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r88843Pi030507;
 Sun, 8 Sep 2013 12:04:03 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to
 glebius@FreeBSD.org using -f
Date: Sun, 8 Sep 2013 12:04:03 +0400
From: Gleb Smirnoff <glebius@FreeBSD.org>
To: Slawa Olhovchenkov <slw@zxy.spb.ru>
Subject: Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf
Message-ID: <20130908080403.GA4574@FreeBSD.org>
References: <20130907170700.GB3796@zxy.spb.ru>
 <CAJ-VmoksU9R4cPsVtxzMma_QHv0Hsm8mTCVixOEVKx2_uS-8eA@mail.gmail.com>
 <EE92600F-0A1B-4684-B928-410AE12B128D@FreeBSD.org>
 <20130907210244.GE3796@zxy.spb.ru>
 <CAJ-Vmom1iLOZH1mOj6oqr5n4qeymi6k5zVv3sw4WGvnzakKY9g@mail.gmail.com>
 <20130907212957.GF3796@zxy.spb.ru>
 <CAJ-VmomhCQMUBNF2KNEC_sc=iEmNy-aythX=UaeDmTmjBW5j+w@mail.gmail.com>
 <20130907214728.GG3796@zxy.spb.ru>
 <20130908072208.GZ4574@FreeBSD.org>
 <20130908080033.GH3796@zxy.spb.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130908080033.GH3796@zxy.spb.ru>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Adrian Chadd <adrian@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>,
 Bryan Venteicher <bryanv@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "Andrey V. Elsukov" <ae@freebsd.org>,
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,
 Edward Tomasz Napiera?a <trasz@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 08:04:10 -0000

On Sun, Sep 08, 2013 at 12:00:33PM +0400, Slawa Olhovchenkov wrote:
S> On Sun, Sep 08, 2013 at 11:22:08AM +0400, Gleb Smirnoff wrote:
S> 
S> > On Sun, Sep 08, 2013 at 01:47:28AM +0400, Slawa Olhovchenkov wrote:
S> > S> As we can see by activity in list planed: ipf 5.1, native iSCSI,
S> > S> switch off GCC (with broken by clang kernel part), patch ld.so and many others.
S> > S> Changed in loader and take out modules from kernel at this time is little-o.
S> > 
S> > ipf 5.1 affects only small fraction of users - those who use ipf.
S> > Ditto for iSCSI. Switching off gcc affects only build issues, not
S> > system stability or usability.
S> 
S> -HEAD, compiled by clang, can't resume from sleep by generating NMI. This
S> is not system stability or usability?

HEAD is compiled by clang for a year, already. Switching gcc off is
a build issue.

-- 
Totus tuus, Glebius.

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 09:40:25 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 2F08815C;
 Sun,  8 Sep 2013 09:40:25 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1BFF4246E;
 Sun,  8 Sep 2013 09:40:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r889eOw7046337;
 Sun, 8 Sep 2013 09:40:24 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r889eNsR046328;
 Sun, 8 Sep 2013 09:40:23 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309080940.r889eNsR046328@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 09:40:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255384 - in head: . etc/mtree share/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 09:40:25 -0000

Author: des
Date: Sun Sep  8 09:40:23 2013
New Revision: 255384
URL: http://svnweb.freebsd.org/changeset/base/255384

Log:
  Create a private library directory (LIBPRIVATEDIR) for libraries which
  we don't want to expose but which can't or shouldn't be static.
  
  To mark a library as private, define PRIVATELIB in its Makefile.  It
  will be installed in LIBPRIVATEDIR, which is normally /usr/lib/private
  (or /usr/lib32/private for 32-bit libraries on 64-bit platforms).
  
  To indicate that a program or library depends on a private library,
  define USEPRIVATELIB in its Makefile.  The correct version of
  LIBPRIVATEDIR will be added to its run-time library search path.
  
  Approved by:	re (blanket)

Modified:
  head/Makefile.inc1
  head/etc/mtree/BSD.usr.dist
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.own.mk
  head/share/mk/bsd.prog.mk

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sun Sep  8 09:06:52 2013	(r255383)
+++ head/Makefile.inc1	Sun Sep  8 09:40:23 2013	(r255384)
@@ -382,6 +382,7 @@ LIB32WMAKEENV+=	MAKEOBJDIRPREFIX=${OBJTR
 		PATH=${TMPPATH} \
 		LIBDIR=/usr/lib32 \
 		SHLIBDIR=/usr/lib32 \
+		LIBPRIVATEDIR=/usr/lib32/private \
 		COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
 LIB32WMAKEFLAGS+=	\
 		CC="${XCC} ${LIB32FLAGS}" \

Modified: head/etc/mtree/BSD.usr.dist
==============================================================================
--- head/etc/mtree/BSD.usr.dist	Sun Sep  8 09:06:52 2013	(r255383)
+++ head/etc/mtree/BSD.usr.dist	Sun Sep  8 09:40:23 2013	(r255384)
@@ -24,12 +24,16 @@
         ..
         i18n
         ..
+        private
+        ..
     ..
     lib32
         dtrace
         ..
         i18n
         ..
+        private
+        ..
     ..
     libdata
         gcc

Modified: head/share/mk/bsd.lib.mk
==============================================================================
--- head/share/mk/bsd.lib.mk	Sun Sep  8 09:06:52 2013	(r255383)
+++ head/share/mk/bsd.lib.mk	Sun Sep  8 09:40:23 2013	(r255384)
@@ -119,16 +119,24 @@ PO_FLAG=-pg
 
 all: objwarn
 
+.if defined(PRIVATELIB)
+_LIBDIR:=${LIBPRIVATEDIR}
+_SHLIBDIR:=${LIBPRIVATEDIR}
+.else
+_LIBDIR:=${LIBDIR}
+_SHLIBDIR:=${SHLIBDIR}
+.endif
+
 .if defined(SHLIB_NAME)
 .if ${MK_DEBUG_FILES} != "no"
 SHLIB_NAME_FULL=${SHLIB_NAME}.full
 # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
-.if ${SHLIBDIR} == "/boot" ||\
+.if ${_SHLIBDIR} == "/boot" ||\
     ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
     ${SHLIBDIR:C%/usr/lib(32)?(/.*)?%/usr/lib%} == "/usr/lib"
-DEBUGFILEDIR=${DEBUGDIR}${SHLIBDIR}
+DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
 .else
-DEBUGFILEDIR=${SHLIBDIR}/.debug
+DEBUGFILEDIR=${_SHLIBDIR}/.debug
 DEBUGMKDIR=
 .endif
 .else
@@ -145,6 +153,10 @@ ${SHLIB_NAME_FULL}:	${VERSION_MAP}
 LDFLAGS+=	-Wl,--version-script=${VERSION_MAP}
 .endif
 
+.if defined(USEPRIVATELIB)
+LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVATEDIR} -rpath ${LIBPRIVATEDIR}
+.endif
+
 .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME)
 OBJS+=		${SRCS:N*.h:R:S/$/.o/}
 .endif
@@ -291,16 +303,16 @@ realinstall: _libinstall
 _libinstall:
 .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no"
 	${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-	    ${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${LIBDIR}
+	    ${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${_LIBDIR}
 .endif
 .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
 	${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-	    ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${LIBDIR}
+	    ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${_LIBDIR}
 .endif
 .if defined(SHLIB_NAME)
 	${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
 	    ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
-	    ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
+	    ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}
 .if ${MK_DEBUG_FILES} != "no"
 .if defined(DEBUGMKDIR)
 	${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}
@@ -328,23 +340,23 @@ _libinstall:
 # installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty
 # because on the target system, libraries are meant to be looked up from /.
 .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT})
-	sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${SHLIBDIR}/${SHLIB_NAME},g' \
-	    -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${LIBDIR},g' \
-	    ${.CURDIR}/${SHLIB_LDSCRIPT} > ${DESTDIR}${LIBDIR}/${SHLIB_LINK:R}.ld
+	sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${_SHLIBDIR}/${SHLIB_NAME},g' \
+	    -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${_LIBDIR},g' \
+	    ${.CURDIR}/${SHLIB_LDSCRIPT} > ${DESTDIR}${_LIBDIR}/${SHLIB_LINK:R}.ld
 	${INSTALL} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-	    ${_INSTALLFLAGS} ${DESTDIR}${LIBDIR}/${SHLIB_LINK:R}.ld \
-	    ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
-	rm -f ${DESTDIR}${LIBDIR}/${SHLIB_LINK:R}.ld
+	    ${_INSTALLFLAGS} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK:R}.ld \
+	    ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
+	rm -f ${DESTDIR}${_LIBDIR}/${SHLIB_LINK:R}.ld
 
 .else
-.if ${SHLIBDIR} == ${LIBDIR}
-	${INSTALL_SYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
+.if ${_SHLIBDIR} == ${_LIBDIR}
+	${INSTALL_SYMLINK} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
 .else
-	${INSTALL_SYMLINK} ${_SHLIBDIRPREFIX}${SHLIBDIR}/${SHLIB_NAME} \
-	    ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
-.if exists(${DESTDIR}${LIBDIR}/${SHLIB_NAME})
-	-chflags noschg ${DESTDIR}${LIBDIR}/${SHLIB_NAME}
-	rm -f ${DESTDIR}${LIBDIR}/${SHLIB_NAME}
+	${INSTALL_SYMLINK} ${_SHLIBDIRPREFIX}${_SHLIBDIR}/${SHLIB_NAME} \
+	    ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
+.if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME})
+	-chflags noschg ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
+	rm -f ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
 .endif
 .endif
 .endif # SHLIB_LDSCRIPT
@@ -352,7 +364,7 @@ _libinstall:
 .endif # SHIB_NAME
 .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
 	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-	    ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
+	    ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}
 .endif
 .if defined(WANT_LINT) && !defined(NO_LINT) && defined(LIB) && !empty(LIB)
 	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \

Modified: head/share/mk/bsd.own.mk
==============================================================================
--- head/share/mk/bsd.own.mk	Sun Sep  8 09:06:52 2013	(r255383)
+++ head/share/mk/bsd.own.mk	Sun Sep  8 09:40:23 2013	(r255384)
@@ -28,6 +28,8 @@
 #
 # LIBCOMPATDIR	Base path for compat libraries. [/usr/lib/compat]
 #
+# LIBPRIVATEDIR	Base path for private libraries. [/usr/lib/private]
+#
 # LIBDATADIR	Base path for misc. utility data files. [/usr/libdata]
 #
 # LIBEXECDIR	Base path for system daemons and utilities. [/usr/libexec]
@@ -144,6 +146,7 @@ KMODMODE?=	${BINMODE}
 
 LIBDIR?=	/usr/lib
 LIBCOMPATDIR?=	/usr/lib/compat
+LIBPRIVATEDIR?=	/usr/lib/private
 LIBDATADIR?=	/usr/libdata
 LIBEXECDIR?=	/usr/libexec
 LINTLIBDIR?=	/usr/libdata/lint

Modified: head/share/mk/bsd.prog.mk
==============================================================================
--- head/share/mk/bsd.prog.mk	Sun Sep  8 09:06:52 2013	(r255383)
+++ head/share/mk/bsd.prog.mk	Sun Sep  8 09:40:23 2013	(r255384)
@@ -52,6 +52,10 @@ STRIP?=	-s
 LDFLAGS+= -static
 .endif
 
+.if defined(USEPRIVATELIB)
+LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVATEDIR} -rpath ${LIBPRIVATEDIR}
+.endif
+
 .if ${MK_DEBUG_FILES} != "no"
 PROG_FULL=${PROG}.full
 # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 09:46:23 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 9CACF3CB;
 Sun,  8 Sep 2013 09:46:23 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 88AFF24BC;
 Sun,  8 Sep 2013 09:46:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r889kNQV050571;
 Sun, 8 Sep 2013 09:46:23 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r889kNSX050568;
 Sun, 8 Sep 2013 09:46:23 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309080946.r889kNSX050568@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 09:46:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255385 - in head/etc: . etc.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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 09:46:23 -0000

Author: des
Date: Sun Sep  8 09:46:22 2013
New Revision: 255385
URL: http://svnweb.freebsd.org/changeset/base/255385

Log:
  Add a stock libmap32.conf for amd64.  The first two lines have no effect
  except to document the hardcoded standard library search path for 32-bit
  binaries.  The third line performs the equivalent substitution for the
  private library directory.
  
  Ironically, these entries rely on functionality which is only available
  in the COMPAT_32BIT version of rtld-elf.
  
  Approved by:	re (blanket)

Added:
  head/etc/etc.amd64/libmap32.conf   (contents, props changed)
Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==============================================================================
--- head/etc/Makefile	Sun Sep  8 09:40:23 2013	(r255384)
+++ head/etc/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
@@ -50,6 +50,10 @@ BIN1=	crontab \
 	syslog.conf \
 	termcap.small
 
+.if ${MACHINE} == "amd64"
+BIN1+=	etc.${MACHINE}/libmap32.conf
+.endif
+
 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
 BIN1+=	etc.${MACHINE}/ttys
 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)

Added: head/etc/etc.amd64/libmap32.conf
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/etc/etc.amd64/libmap32.conf	Sun Sep  8 09:46:22 2013	(r255385)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+/lib			/lib32
+/usr/lib		/usr/lib32
+/usr/lib/private	/usr/lib32/private

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 10:04:30 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 98717868;
 Sun,  8 Sep 2013 10:04:30 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 83E222586;
 Sun,  8 Sep 2013 10:04:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88A4UkX061502;
 Sun, 8 Sep 2013 10:04:30 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88A4RWs061462;
 Sun, 8 Sep 2013 10:04:27 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081004.r88A4RWs061462@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 10:04:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255386 - in head: . lib/libldns
 lib/libpam/modules/pam_ssh secure/lib/libssh secure/libexec/sftp-server
 secure/libexec/ssh-keysign secure/libexec/ssh-pkcs11-helper
 secure/usr.bin/scp s...
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 10:04:30 -0000

Author: des
Date: Sun Sep  8 10:04:26 2013
New Revision: 255386
URL: http://svnweb.freebsd.org/changeset/base/255386

Log:
  Make libldns and libssh private.
  
  Approved by:	re (blanket)

Modified:
  head/ObsoleteFiles.inc
  head/lib/libldns/Makefile
  head/lib/libpam/modules/pam_ssh/Makefile
  head/secure/lib/libssh/Makefile
  head/secure/libexec/sftp-server/Makefile
  head/secure/libexec/ssh-keysign/Makefile
  head/secure/libexec/ssh-pkcs11-helper/Makefile
  head/secure/usr.bin/scp/Makefile
  head/secure/usr.bin/sftp/Makefile
  head/secure/usr.bin/ssh-add/Makefile
  head/secure/usr.bin/ssh-agent/Makefile
  head/secure/usr.bin/ssh-keygen/Makefile
  head/secure/usr.bin/ssh-keyscan/Makefile
  head/secure/usr.bin/ssh/Makefile
  head/secure/usr.sbin/sshd/Makefile
  head/share/mk/bsd.libnames.mk

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/ObsoleteFiles.inc	Sun Sep  8 10:04:26 2013	(r255386)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20130908: libssh becomes private
+OLD_LIBS+=usr/lib/libssh.so.5
+OLD_LIBS+=usr/lib32/libssh.so.5
 # 20130903: gnupatch is no more
 OLD_FILES+=usr/bin/gnupatch
 OLD_FILES+=usr/share/man/man1/gnupatch.1.gz

Modified: head/lib/libldns/Makefile
==============================================================================
--- head/lib/libldns/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/lib/libldns/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -6,7 +6,7 @@ LDNSDIR = ${.CURDIR}/../../contrib/ldns
 .PATH: ${LDNSDIR} ${LDNSDIR}/compat
 
 LIB=	ldns
-INTERNALLIB= true
+PRIVATELIB= true
 
 CFLAGS+= -I${LDNSDIR}
 

Modified: head/lib/libpam/modules/pam_ssh/Makefile
==============================================================================
--- head/lib/libpam/modules/pam_ssh/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/lib/libpam/modules/pam_ssh/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -15,6 +15,7 @@ CFLAGS+= -I${SSHDIR} -include ssh_namesp
 
 DPADD=	${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT}
 LDADD=	-lssh -lcrypto -lcrypt
+USEPRIVATELIB= ssh
 
 .include <bsd.lib.mk>
 

Modified: head/secure/lib/libssh/Makefile
==============================================================================
--- head/secure/lib/libssh/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/lib/libssh/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -3,6 +3,7 @@
 .include <bsd.own.mk>
 
 LIB=	ssh
+PRIVATELIB=	true
 SHLIB_MAJOR=	5
 SRCS=	authfd.c authfile.c bufaux.c bufbn.c buffer.c \
 	canohost.c channels.c cipher.c cipher-aes.c \

Modified: head/secure/libexec/sftp-server/Makefile
==============================================================================
--- head/secure/libexec/sftp-server/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/libexec/sftp-server/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -10,6 +10,7 @@ SRCS+=	roaming_dummy.c
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD=  -lssh -lcrypt -lcrypto -lz
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/libexec/ssh-keysign/Makefile
==============================================================================
--- head/secure/libexec/ssh-keysign/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/libexec/ssh-keysign/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -8,6 +8,7 @@ BINMODE=4555
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD=	-lssh -lcrypt -lcrypto -lz
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/libexec/ssh-pkcs11-helper/Makefile
==============================================================================
--- head/secure/libexec/ssh-pkcs11-helper/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/libexec/ssh-pkcs11-helper/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -8,6 +8,7 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD=	-lssh -lcrypt -lcrypto -lz
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/usr.bin/scp/Makefile
==============================================================================
--- head/secure/usr.bin/scp/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/usr.bin/scp/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -9,6 +9,7 @@ SRCS+=	roaming_dummy.c
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD=	-lssh -lcrypt -lcrypto -lz
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/usr.bin/sftp/Makefile
==============================================================================
--- head/secure/usr.bin/sftp/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/usr.bin/sftp/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -9,6 +9,7 @@ SRCS+=	roaming_dummy.c
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} ${LIBEDIT} ${LIBNCURSES}
 LDADD=	-lssh -lcrypt -lcrypto -lz -ledit -lncurses
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/usr.bin/ssh-add/Makefile
==============================================================================
--- head/secure/usr.bin/ssh-add/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/usr.bin/ssh-add/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -9,6 +9,7 @@ SRCS+=	roaming_dummy.c
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD=	-lssh -lcrypt -lcrypto -lz
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/usr.bin/ssh-agent/Makefile
==============================================================================
--- head/secure/usr.bin/ssh-agent/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/usr.bin/ssh-agent/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -9,6 +9,7 @@ SRCS+=	roaming_dummy.c
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD=	-lssh -lcrypt -lcrypto -lz
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/usr.bin/ssh-keygen/Makefile
==============================================================================
--- head/secure/usr.bin/ssh-keygen/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/usr.bin/ssh-keygen/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -9,6 +9,7 @@ SRCS+=  roaming_dummy.c
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD=	-lssh -lcrypt -lcrypto -lz
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/usr.bin/ssh-keyscan/Makefile
==============================================================================
--- head/secure/usr.bin/ssh-keyscan/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/usr.bin/ssh-keyscan/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -6,6 +6,7 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa
 
 DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD=	-lssh -lcrypt -lcrypto -lz
+USEPRIVATELIB= ssh
 
 .include <bsd.prog.mk>
 

Modified: head/secure/usr.bin/ssh/Makefile
==============================================================================
--- head/secure/usr.bin/ssh/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/usr.bin/ssh/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -18,6 +18,7 @@ SRCS+=	gss-genr.c
 
 DPADD=	${LIBSSH} ${LIBUTIL} ${LIBZ}
 LDADD=	-lssh -lutil -lz
+USEPRIVATELIB= ssh
 
 .if ${MK_KERBEROS_SUPPORT} != "no"
 CFLAGS+= -DGSSAPI -DHAVE_GSSAPI_GSSAPI_H=1 -DKRB5 -DHEIMDAL

Modified: head/secure/usr.sbin/sshd/Makefile
==============================================================================
--- head/secure/usr.sbin/sshd/Makefile	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/secure/usr.sbin/sshd/Makefile	Sun Sep  8 10:04:26 2013	(r255386)
@@ -27,6 +27,7 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa
 
 DPADD=	${LIBSSH} ${LIBUTIL} ${LIBZ} ${LIBWRAP} ${LIBPAM}
 LDADD=	-lssh -lutil -lz -lwrap ${MINUSLPAM}
+USEPRIVATELIB= ssh
 
 .if ${MK_AUDIT} != "no"
 CFLAGS+= -DUSE_BSM_AUDIT -DHAVE_GETAUDIT_ADDR

Modified: head/share/mk/bsd.libnames.mk
==============================================================================
--- head/share/mk/bsd.libnames.mk	Sun Sep  8 09:46:22 2013	(r255385)
+++ head/share/mk/bsd.libnames.mk	Sun Sep  8 10:04:26 2013	(r255386)
@@ -88,7 +88,7 @@ LIBKRB5?=	${DESTDIR}${LIBDIR}/libkrb5.a
 LIBKVM?=	${DESTDIR}${LIBDIR}/libkvm.a
 LIBL?=		${DESTDIR}${LIBDIR}/libl.a
 .if ${MK_LDNS} != "no"
-LIBLDNS?=	${DESTDIR}${LIBDIR}/libldns.a
+LIBLDNS?=	${DESTDIR}${LIBPRIVATEDIR}/libldns.a
 .endif
 LIBLN?=		"don't use LIBLN, use LIBL"
 .if ${MK_BIND} != "no"
@@ -151,7 +151,7 @@ LIBRTLD_DB?=	${DESTDIR}${LIBDIR}/librtld
 LIBSBUF?=	${DESTDIR}${LIBDIR}/libsbuf.a
 LIBSDP?=	${DESTDIR}${LIBDIR}/libsdp.a
 LIBSMB?=	${DESTDIR}${LIBDIR}/libsmb.a
-LIBSSH?=	${DESTDIR}${LIBDIR}/libssh.a
+LIBSSH?=	${DESTDIR}${LIBPRIVATEDIR}/libssh.a
 LIBSSL?=	${DESTDIR}${LIBDIR}/libssl.a
 LIBSTAND?=	${DESTDIR}${LIBDIR}/libstand.a
 LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 10:06:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CB33B9B5;
 Sun,  8 Sep 2013 10:06:10 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 8CE052591;
 Sun,  8 Sep 2013 10:06:10 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id 8F67645AA;
 Sun,  8 Sep 2013 10:06:09 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id EBAF829463; Sun,  8 Sep 2013 12:05:42 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: src-committers@freebsd.org
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
References: <201309080946.r889kNSX050568@svn.freebsd.org>
Date: Sun, 08 Sep 2013 12:05:42 +0200
In-Reply-To: <201309080946.r889kNSX050568@svn.freebsd.org> (Dag-Erling
 SmXXrgrav's message of "Sun, 8 Sep 2013 09:46:23 +0000 (UTC)")
Message-ID: <86wqmrfx1l.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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, powerpc@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 10:06:10 -0000

Dag-Erling SmXXrgrav <des@FreeBSD.org> writes:
> Log:
>   Add a stock libmap32.conf for amd64.  The first two lines have no effect
>   except to document the hardcoded standard library search path for 32-bit
>   binaries.  The third line performs the equivalent substitution for the
>   private library directory.

powerpc64 probably needs this as well, but I know next to nothing about
it and have no way of testing it.

How to test:

% svn co -r255386 svn://svn.freebsd.org/base/head libprivate
% cd libprivate
% make TARGET=3Dfoo64 buildworld
% sudo mkdir /foo64
% sudo make TARGET=3Dfoo64 installworld DESTDIR=3D/foo64
% sudo make TARGET=3Dfoo64 -C etc distribution DESTDIR=3D/foo64
% make TARGET=3Dfoo32 buildworld
% sudo mkdir /foo64/32
% sudo make TARGET=3Dfoo32 installworld DESTDIR=3D/foo64/32
% sudo mount -t dev dev /foo64/dev
% sudo chroot /foo64 /bin/sh
% ldd /32/usr/bin/ssh

With libmap32.conf in place, this should show that libssh.so.5 resolves
to /usr/lib32/private/libssh.so.5; otherwise, it will show up as not
found.

(r255386 is the revision that made libssh private, prior to which there
was no practical need for this mapping)

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 11:04:20 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 049A09C6;
 Sun,  8 Sep 2013 11:04:20 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6C9FA2816;
 Sun,  8 Sep 2013 11:04:19 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r88B4AHo036051;
 Sun, 8 Sep 2013 14:04:10 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r88B4AHo036051
Received: (from kostik@localhost)
 by tom.home (8.14.7/8.14.7/Submit) id r88B4A9v036050;
 Sun, 8 Sep 2013 14:04:10 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Sun, 8 Sep 2013 14:04:10 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: Dag-Erling =?koi8-r?B?U23DuHJncmF2?= <des@FreeBSD.org>
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
Message-ID: <20130908110410.GZ41229@kib.kiev.ua>
References: <201309080946.r889kNSX050568@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="dhwE6X0TwXvg345s"
Content-Disposition: inline
In-Reply-To: <201309080946.r889kNSX050568@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 11:04:20 -0000


--dhwE6X0TwXvg345s
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 08, 2013 at 09:46:23AM +0000, Dag-Erling Sm=C3=B8rgrav wrote:
> +/lib			/lib32
> +/usr/lib		/usr/lib32
There is no /lib32 on 64bit platforms.  I do not understand why these pathes
are neeeded, since compat32 rtld has proper default path built in, but if
anything, /lib should be translated to /usr/lib32.

--dhwE6X0TwXvg345s
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQIcBAEBAgAGBQJSLFmpAAoJEJDCuSvBvK1BLA4P/2ssFJOPCcSG0gF/aRfBGgHj
+Q7+7ibD3tI34rIG7voCEJDw1JKVx1w5se6O6CRaOe1NNB5hSGvsTzcwI5SUb32c
Pq80CbWGpDmOXKFTuQlElS4Tm+fyQYXrpJ1iJem4bmx2V0ulzPb4C5y5IBetmRUZ
4jFCv1y2xJj4lmazEKBOAWQmvq2jrmBncsdj1o0qGZzk1ZZnFMhOBkTbbNBm6Sse
tJfaSC7MIoS7WeLHD0b6D1UzVasYejMQIyQOy+YpJoviK2JkQm3Ym9E/3N8JaPMA
orloD5+qTYgNH956yegw3h+getxijgR60SbzKm3JsJZgJbIyN97YtcDPUOheuehg
Va91RLpNv0qyVo4zUS9ub2VghmGpQRinNR2IQWbPIdLrwga/8v4nXFefMMgpogXr
KGVDFs0WVkZUBvQgSGyQ+vUENcwWYDmiegAOqFZ2yp/dgFuRjjnC1HbFGUSuyXqG
cJlWW1hbYvgTk5nJRsa5p3jnbbQXxpjmxwwU/0l6TV3V9sEbdWxqqszsaRTkWRPA
R/tNo5hAJTu6mjd0/3J021SHNHLEjHbcNMu5g42DHXxfr4ukSZ3pJ9OethFzr393
0WnFGIFKIZ75/mn6O80t0DuX0tISddz3mHmKoxYpL69kXgWtqBPooEkwO+GqIL0G
esOWOZc6Tkg9jxH500GJ
=OPZS
-----END PGP SIGNATURE-----

--dhwE6X0TwXvg345s--

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 11:21:09 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id F126EDE7;
 Sun,  8 Sep 2013 11:21:08 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C340B28D6;
 Sun,  8 Sep 2013 11:21:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88BL8Pt008973;
 Sun, 8 Sep 2013 11:21:08 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88BL8Rs008971;
 Sun, 8 Sep 2013 11:21:08 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081121.r88BL8Rs008971@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 11:21:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r255387 - in vendor/openpam: NUMMULARIA NUMMULARIA/lib
 NUMMULARIA/lib/libpam NUMMULARIA/t dist dist/lib dist/lib/libpam dist/t
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 11:21:09 -0000

Author: des
Date: Sun Sep  8 11:21:08 2013
New Revision: 255387
URL: http://svnweb.freebsd.org/changeset/base/255387

Log:
  Damn autoprops!

Modified:
  vendor/openpam/NUMMULARIA/lib/Makefile.am   (contents, props changed)
  vendor/openpam/dist/lib/Makefile.am   (contents, props changed)
Directory Properties:
  vendor/openpam/NUMMULARIA/lib/Makefile.in   (props changed)
  vendor/openpam/NUMMULARIA/lib/libpam/openpam_asprintf.c   (props changed)
  vendor/openpam/NUMMULARIA/lib/libpam/openpam_asprintf.h   (props changed)
  vendor/openpam/NUMMULARIA/lib/libpam/openpam_cred.h   (props changed)
  vendor/openpam/NUMMULARIA/lib/libpam/openpam_dlfunc.h   (props changed)
  vendor/openpam/NUMMULARIA/lib/libpam/openpam_strlcat.c   (props changed)
  vendor/openpam/NUMMULARIA/lib/libpam/openpam_strlcpy.c   (props changed)
  vendor/openpam/NUMMULARIA/lib/libpam/openpam_vasprintf.c   (props changed)
  vendor/openpam/NUMMULARIA/lib/libpam/openpam_vasprintf.h   (props changed)
  vendor/openpam/NUMMULARIA/mkpkgng.in   (props changed)
  vendor/openpam/NUMMULARIA/t/t_file.c   (props changed)
  vendor/openpam/dist/lib/Makefile.in   (props changed)
  vendor/openpam/dist/lib/libpam/openpam_asprintf.c   (props changed)
  vendor/openpam/dist/lib/libpam/openpam_asprintf.h   (props changed)
  vendor/openpam/dist/lib/libpam/openpam_cred.h   (props changed)
  vendor/openpam/dist/lib/libpam/openpam_dlfunc.h   (props changed)
  vendor/openpam/dist/lib/libpam/openpam_strlcat.c   (props changed)
  vendor/openpam/dist/lib/libpam/openpam_strlcpy.c   (props changed)
  vendor/openpam/dist/lib/libpam/openpam_vasprintf.c   (props changed)
  vendor/openpam/dist/lib/libpam/openpam_vasprintf.h   (props changed)
  vendor/openpam/dist/mkpkgng.in   (props changed)
  vendor/openpam/dist/t/t_file.c   (props changed)

Modified: vendor/openpam/NUMMULARIA/lib/Makefile.am
==============================================================================
--- vendor/openpam/NUMMULARIA/lib/Makefile.am	Sun Sep  8 10:04:26 2013	(r255386)
+++ vendor/openpam/NUMMULARIA/lib/Makefile.am	Sun Sep  8 11:21:08 2013	(r255387)
@@ -1,3 +1,3 @@
-# $Id$
+# $Id: Makefile.am 255365 2013-09-07 16:15:30Z des $
 
 SUBDIRS = libpam

Modified: vendor/openpam/dist/lib/Makefile.am
==============================================================================
--- vendor/openpam/dist/lib/Makefile.am	Sun Sep  8 10:04:26 2013	(r255386)
+++ vendor/openpam/dist/lib/Makefile.am	Sun Sep  8 11:21:08 2013	(r255387)
@@ -1,3 +1,3 @@
-# $Id$
+# $Id: Makefile.am 255365 2013-09-07 16:15:30Z des $
 
 SUBDIRS = libpam

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 11:35:57 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7CA48FC4;
 Sun,  8 Sep 2013 11:35:57 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5003E294F;
 Sun,  8 Sep 2013 11:35:57 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88BZvhh017065;
 Sun, 8 Sep 2013 11:35:57 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88BZu4d017063;
 Sun, 8 Sep 2013 11:35:56 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081135.r88BZu4d017063@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 11:35:56 +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: r255388 - stable/9/usr.sbin/rtadvd
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 11:35:57 -0000

Author: des
Date: Sun Sep  8 11:35:56 2013
New Revision: 255388
URL: http://svnweb.freebsd.org/changeset/base/255388

Log:
  MFH (r254684, r254955): fix segfault on reload.
  MFH (r255156): silence an error message on non-IPv6 interfaces.

Modified:
  stable/9/usr.sbin/rtadvd/config.c
  stable/9/usr.sbin/rtadvd/if.c
Directory Properties:
  stable/9/usr.sbin/rtadvd/   (props changed)

Modified: stable/9/usr.sbin/rtadvd/config.c
==============================================================================
--- stable/9/usr.sbin/rtadvd/config.c	Sun Sep  8 11:21:08 2013	(r255387)
+++ stable/9/usr.sbin/rtadvd/config.c	Sun Sep  8 11:35:56 2013	(r255388)
@@ -296,10 +296,8 @@ rm_rainfo(struct rainfo *rai)
 	if (rai->rai_ra_data != NULL)
 		free(rai->rai_ra_data);
 
-	while ((pfx = TAILQ_FIRST(&rai->rai_prefix)) != NULL) {
-		TAILQ_REMOVE(&rai->rai_prefix, pfx, pfx_next);
-		free(pfx);
-	}
+	while ((pfx = TAILQ_FIRST(&rai->rai_prefix)) != NULL)
+		delete_prefix(pfx);
 	while ((sol = TAILQ_FIRST(&rai->rai_soliciter)) != NULL) {
 		TAILQ_REMOVE(&rai->rai_soliciter, sol, sol_next);
 		free(sol);
@@ -1123,9 +1121,9 @@ add_prefix(struct rainfo *rai, struct in
 	pfx->pfx_onlinkflg = ipr->ipr_raf_onlink;
 	pfx->pfx_autoconfflg = ipr->ipr_raf_auto;
 	pfx->pfx_origin = PREFIX_FROM_DYNAMIC;
+	pfx->pfx_rainfo = rai;
 
 	TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next);
-	pfx->pfx_rainfo = rai;
 
 	syslog(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s",
 	    __func__,

Modified: stable/9/usr.sbin/rtadvd/if.c
==============================================================================
--- stable/9/usr.sbin/rtadvd/if.c	Sun Sep  8 11:21:08 2013	(r255387)
+++ stable/9/usr.sbin/rtadvd/if.c	Sun Sep  8 11:35:56 2013	(r255388)
@@ -394,8 +394,8 @@ update_ifinfo_nd_flags(struct ifinfo *if
 	error = ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd);
 	if (error) {
 		close(s);
-		syslog(LOG_ERR,
-		    "<%s> ioctl() failed.", __func__);
+		if (errno != EPFNOSUPPORT)
+			syslog(LOG_ERR, "<%s> ioctl() failed.", __func__);
 		return (1);
 	}
 	ifi->ifi_nd_flags = nd.ndi.flags;

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 11:49:22 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 27865275;
 Sun,  8 Sep 2013 11:49:22 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id DE27A29C0;
 Sun,  8 Sep 2013 11:49:21 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id E886F46FB;
 Sun,  8 Sep 2013 11:49:20 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id 57B1C294AA; Sun,  8 Sep 2013 13:48:54 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: Konstantin Belousov <kostikbel@gmail.com>
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
References: <201309080946.r889kNSX050568@svn.freebsd.org>
 <20130908110410.GZ41229@kib.kiev.ua>
Date: Sun, 08 Sep 2013 13:48:54 +0200
In-Reply-To: <20130908110410.GZ41229@kib.kiev.ua> (Konstantin Belousov's
 message of "Sun, 8 Sep 2013 14:04:10 +0300")
Message-ID: <86zjrnedp5.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 11:49:22 -0000

Konstantin Belousov <kostikbel@gmail.com> writes:
> There is no /lib32 on 64bit platforms.

It doesn't exist, but it's supported:

#ifdef COMPAT_32BIT
#undef STANDARD_LIBRARY_PATH
#undef _PATH_ELF_HINTS
#define _PATH_ELF_HINTS         "/var/run/ld-elf32.so.hints"
/* For running 32 bit binaries  */
#define STANDARD_LIBRARY_PATH   "/lib32:/usr/lib32"
#define LD_ "LD_32_"
#endif

> I do not understand why these pathes are neeeded, since compat32 rtld
> has proper default path built in

Did you read the log message?  I am perfectly aware that the two lines
you're complaining about are a no-op; they're included mostly for
documentation purposes.  However, if the code that uses them was made
unconditional (it is currently #ifdef COMPAT_32BIT), these lines would
eliminate the need to hardcode a special STANDARD_LIBRARY_PATH in
rtld-elf.

> but if anything, /lib should be translated to /usr/lib32.

Irrelevant, because while rtld-elf won't find anything there it will
still find what it's looking for in /usr/lib32.

These mappings are *not* applied to individual libraries; they are
applied to STANDARD_LIBRARY_PATH, LD_LIBRARY_PATH and the program's or
library's run-time search path (-rpath).

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 13:11:39 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C001C48B;
 Sun,  8 Sep 2013 13:11:39 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 47B6A2D1D;
 Sun,  8 Sep 2013 13:11:38 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id 02CA7479E;
 Sun,  8 Sep 2013 13:11:38 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id 3FC07AD; Sun,  8 Sep 2013 15:11:41 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: src-committers@freebsd.org
Subject: Re: svn commit: r255386 - in head: . lib/libldns
 lib/libpam/modules/pam_ssh secure/lib/libssh secure/libexec/sftp-server
 secure/libexec/ssh-keysign secure/libexec/ssh-pkcs11-helper
 secure/usr.bin/scp s...
References: <201309081004.r88A4RWs061462@svn.freebsd.org>
Date: Sun, 08 Sep 2013 15:11:40 +0200
In-Reply-To: <201309081004.r88A4RWs061462@svn.freebsd.org> (Dag-Erling
 SmXXrgrav's message of "Sun, 8 Sep 2013 10:04:27 +0000 (UTC)")
Message-ID: <86mwnnxxtf.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 13:11:39 -0000

Dag-Erling SmXXrgrav <des@FreeBSD.org> writes:
> Modified: head/ObsoleteFiles.inc
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/ObsoleteFiles.inc	Sun Sep  8 09:46:22 2013	(r255385)
> +++ head/ObsoleteFiles.inc	Sun Sep  8 10:04:26 2013	(r255386)
> @@ -38,6 +38,9 @@
>  #   xargs -n1 | sort | uniq -d;
>  # done
>=20=20
> +# 20130908: libssh becomes private
> +OLD_LIBS+=3Dusr/lib/libssh.so.5
> +OLD_LIBS+=3Dusr/lib32/libssh.so.5
>  # 20130903: gnupatch is no more
>  OLD_FILES+=3Dusr/bin/gnupatch
>  OLD_FILES+=3Dusr/share/man/man1/gnupatch.1.gz
>

I'm not sure I fully understand the standard procedure for obsoleting
libraries.  I now believe that this was insufficient, and that I should
commit the following, which also adds a number of missing entries for
the WITHOUT_OPENSSH case:

Index: tools/build/mk/OptionalObsoleteFiles.inc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tools/build/mk/OptionalObsoleteFiles.inc	(revision 255386)
+++ tools/build/mk/OptionalObsoleteFiles.inc	(working copy)
@@ -3375,6 +3375,19 @@
 OLD_FILES+=3Dusr/share/man/man8/verify_krb5_conf.8.gz
 .endif
=20
+.if ${MK_LDNS} =3D=3D no
+OLD_FILES+=3Dusr/lib/private/libldns.a
+OLD_FILES+=3Dusr/lib/private/libldns.so
+OLD_LIBS+=3Dusr/lib/private/libldns.so.5
+OLD_FILES+=3Dusr/lib/private/libldns_p.a
+.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64"
+OLD_FILES+=3Dusr/lib32/private/libldns.a
+OLD_FILES+=3Dusr/lib32/private/libldns.so
+OLD_LIBS+=3Dusr/lib32/private/libldns.so.5
+OLD_FILES+=3Dusr/lib32/private/libldns_p.a
+.endif
+.endif
+
 #.if ${MK_LIB32} =3D=3D no
 # to be filled in
 #.endif
@@ -3701,8 +3714,28 @@
 #.endif
=20
 .if ${MK_OPENSSH} =3D=3D no
-OLD_FILES+=3Dusr.bin/ssh-copy-id
+OLD_FILES+=3Dusr/bin/sftp
+OLD_FILES+=3Dusr/bin/ssh
+OLD_FILES+=3Dusr/bin/ssh-add
+OLD_FILES+=3Dusr/bin/ssh-agent
+OLD_FILES+=3Dusr/bin/ssh-copy-id
+OLD_FILES+=3Dusr/bin/ssh-keygen
+OLD_FILES+=3Dusr/bin/ssh-keyscan
+OLD_FILES+=3Dusr/lib/private/libssh.a
+OLD_FILES+=3Dusr/lib/private/libssh.so
+OLD_LIBS+=3Dusr/lib/private/libssh.so.5
+OLD_FILES+=3Dusr/lib/private/libssh_p.a
+.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64"
+OLD_FILES+=3Dusr/lib32/private/libssh.a
+OLD_FILES+=3Dusr/lib32/private/libssh.so
+OLD_LIBS+=3Dusr/lib32/private/libssh.so.5
+OLD_FILES+=3Dusr/lib32/private/libssh_p.a
 .endif
+OLD_FILES+=3Dusr/libexec/sftp-server
+OLD_FILES+=3Dusr/libexec/ssh-keysign
+OLD_FILES+=3Dusr/libexec/ssh-pkcs11-helper
+OLD_FILES+=3Dusr/sbin/sshd
+.endif
=20
 #.if ${MK_OPENSSL} =3D=3D no
 # to be filled in
@@ -3958,7 +3991,6 @@
 OLD_FILES+=3Dusr/lib/libsbuf_p.a
 OLD_FILES+=3Dusr/lib/libsdp_p.a
 OLD_FILES+=3Dusr/lib/libsmb_p.a
-OLD_FILES+=3Dusr/lib/libssh_p.a
 OLD_FILES+=3Dusr/lib/libssl_p.a
 OLD_FILES+=3Dusr/lib/libstdc++_p.a
 OLD_FILES+=3Dusr/lib/libsupc++_p.a
@@ -3981,6 +4013,8 @@
 OLD_FILES+=3Dusr/lib/liby_p.a
 OLD_FILES+=3Dusr/lib/libypclnt_p.a
 OLD_FILES+=3Dusr/lib/libz_p.a
+OLD_FILES+=3Dusr/lib/private/libldns_p.a
+OLD_FILES+=3Dusr/lib/private/libssh_p.a
 .endif
=20
 .if ${MK_RCMDS} =3D=3D no

Does anyone care to comment?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 14:39:03 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1B8E87F0;
 Sun,  8 Sep 2013 14:39:03 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 942782104;
 Sun,  8 Sep 2013 14:39:02 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r88EcsFp080975;
 Sun, 8 Sep 2013 17:38:54 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r88EcsFp080975
Received: (from kostik@localhost)
 by tom.home (8.14.7/8.14.7/Submit) id r88EcswG080974;
 Sun, 8 Sep 2013 17:38:54 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Sun, 8 Sep 2013 17:38:54 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: Dag-Erling Sm??rgrav <des@des.no>
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
Message-ID: <20130908143854.GA41229@kib.kiev.ua>
References: <201309080946.r889kNSX050568@svn.freebsd.org>
 <20130908110410.GZ41229@kib.kiev.ua> <86zjrnedp5.fsf@nine.des.no>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="d+OnLgn+wkzLMn3r"
Content-Disposition: inline
In-Reply-To: <86zjrnedp5.fsf@nine.des.no>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 14:39:03 -0000


--d+OnLgn+wkzLMn3r
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 08, 2013 at 01:48:54PM +0200, Dag-Erling Sm??rgrav wrote:
> Konstantin Belousov <kostikbel@gmail.com> writes:
> > There is no /lib32 on 64bit platforms.
>=20
> It doesn't exist, but it's supported:
>=20
> #ifdef COMPAT_32BIT
> #undef STANDARD_LIBRARY_PATH
> #undef _PATH_ELF_HINTS
> #define _PATH_ELF_HINTS         "/var/run/ld-elf32.so.hints"
> /* For running 32 bit binaries  */
> #define STANDARD_LIBRARY_PATH   "/lib32:/usr/lib32"
> #define LD_ "LD_32_"
> #endif
>=20
> > I do not understand why these pathes are neeeded, since compat32 rtld
> > has proper default path built in
>=20
> Did you read the log message?  I am perfectly aware that the two lines
> you're complaining about are a no-op; they're included mostly for
> documentation purposes.  However, if the code that uses them was made
> unconditional (it is currently #ifdef COMPAT_32BIT), these lines would
> eliminate the need to hardcode a special STANDARD_LIBRARY_PATH in
> rtld-elf.
Any line in libmap.conf cannot add to the standard search path.
It only translates existing path.

And, the standard path is specified by the ELF standard, which we try to
follow. I.e., hardcoding STD_LIB_PATH in rtld is basically an external
requirement.

I see no reason not to remove #ifdef COMPAT_32BIT from the
path_enumerate(). At least, it would make the rtld behaviour less
puzzling.

>=20
> > but if anything, /lib should be translated to /usr/lib32.
>=20
> Irrelevant, because while rtld-elf won't find anything there it will
> still find what it's looking for in /usr/lib32.
Not irrelevant. If the 32bit binary is linked with "-z nodefaultlib
-rpath /lib", /usr/lib32 would not be searched. This is not as silly as
it looks, since intent is to provide some private version of the library
which exists in /usr/lib.

The non-existing path in standard search path is harmless, while
translation of the existing path (in native environment) to non-existing
path (in compat32 env) has some side effects. I am trying to point out
that the line spelled as
/lib	/usr/lib32
is more reasonable.

>=20
> These mappings are *not* applied to individual libraries; they are
> applied to STANDARD_LIBRARY_PATH, LD_LIBRARY_PATH and the program's or
> library's run-time search path (-rpath).
>=20
> DES
> --=20
> Dag-Erling Sm??rgrav - des@des.no

--d+OnLgn+wkzLMn3r
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQIcBAEBAgAGBQJSLIv9AAoJEJDCuSvBvK1BZRgP/0thwgOVOI7a0FNtVVcQhXvc
MmIPVsC+5Zyf9GoHfPenKioyBpi3nyNqNnamZ3TZ4PLoswXRAjoav/YSkOuDo//n
x6BBA3GjjJRuIGVyBMFg8F3x8X9RfBbJostflEUekr+Ufcd04Yw7QeKbF+RLPAeR
T7+KC0+FdCjY/+voITup8zrzHX0FiurUIjgqQUZQ3kNy5f1OeFhtxS66QG85WESA
dJ4jml7TXrZJIoQvL8Mav/+ugeaRuyXSP0/jJB0LMNgRLaBpnGy44BtDM0UunhEQ
DQxf7ohEKVVslaBKvyzs/L9Wxk1LjrCh/sOeZE0VXnvq+kULrwwbVLPGGiGR6Xx+
he8qKtxsPbp7IZamSCWcw9JH1mFFFIN/1xuaWavziB7mDw2qz1JF6MbEZDc3tSBt
n1RkupPbuwUi6iG1vTAWxIEdZmFntpSa6o4/TkRLZQJpbeZikNyvUWUvJ6KLhrcQ
F/y47cD1AJFIdGEk6fyEHHsWKNjAfQNuKDtFf5KyyoOxWSFDtqk9JV3x7J3Uv0mX
fKk1oyjVLC5S63y9aFM/rC5btN7ifNQ6nbRmDarHyvNPMxOp5b1ZQ8D1sV7OWSlO
4ajUQfJA7RActBiC202IDjIItnvRG3YGRRbC1XfdWpKgM4FbmCM5toEqa0y768Rc
ZN+rRIshGlzQmV7/5Rdc
=4xnI
-----END PGP SIGNATURE-----

--d+OnLgn+wkzLMn3r--

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 14:47:00 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A1BC1C2D;
 Sun,  8 Sep 2013 14:47:00 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 620542165;
 Sun,  8 Sep 2013 14:47:00 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id 3068348C3;
 Sun,  8 Sep 2013 14:46:59 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id 8013EF3; Sun,  8 Sep 2013 16:46:32 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: Konstantin Belousov <kostikbel@gmail.com>
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
References: <201309080946.r889kNSX050568@svn.freebsd.org>
 <20130908110410.GZ41229@kib.kiev.ua> <86zjrnedp5.fsf@nine.des.no>
 <20130908143854.GA41229@kib.kiev.ua>
Date: Sun, 08 Sep 2013 16:46:32 +0200
In-Reply-To: <20130908143854.GA41229@kib.kiev.ua> (Konstantin Belousov's
 message of "Sun, 8 Sep 2013 17:38:54 +0300")
Message-ID: <86eh8zxtfb.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 14:47:00 -0000

Konstantin Belousov <kostikbel@gmail.com> writes:
> Any line in libmap.conf cannot add to the standard search path.
> It only translates existing path.

I know.

> And, the standard path is specified by the ELF standard, which we try to
> follow. I.e., hardcoding STD_LIB_PATH in rtld is basically an external
> requirement.

I never suggested removing it, but with the appropriate entries in
libmap32.conf, there would be no need to use a different standard
library search path for 32-bit binaries.

I'm not proposing to change this, though.  I'm just mentioning that it
is possible.

> I see no reason not to remove #ifdef COMPAT_32BIT from the
> path_enumerate(). At least, it would make the rtld behaviour less
> puzzling.

Agreed.  The documentation also needs to be updated; it is not very
clear.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 16:24:58 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 6E8BB24B;
 Sun,  8 Sep 2013 16:24:58 +0000 (UTC)
 (envelope-from edschouten@gmail.com)
Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com
 [IPv6:2607:f8b0:400c:c02::22d])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id EAC51258A;
 Sun,  8 Sep 2013 16:24:57 +0000 (UTC)
Received: by mail-vb0-f45.google.com with SMTP id e15so3317597vbg.18
 for <multiple recipients>; Sun, 08 Sep 2013 09:24:56 -0700 (PDT)
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=7//j43qttm7G6L3zRMDPmIPY2HpjxezRAPMLTdHQV/E=;
 b=gjvhHKuRIcp5Zxz5Y0Sb75t7Nik0DbvvyMUfQK4woUHa1w9JhxHiS+vhmtOu7kxxZH
 UAD8gOANfB3wxm4piObhwSCmHFy/rCh7mjFCdVEALrZvwJleoYLTMOt+PT/HJ1LCwAfB
 fqEEEdoYykTytFwkHP+MQaeDMd+HalGjgKZiGRM87F0l6RQQnUfx5fuCnS7QnN0eeshZ
 K5hqK7TQiDSN4UiZzgtQQ4liv6NMtm3FZurDe8og51me+uZ/QJ2xDtrHjUdU3ipmLdpo
 0bbGwO0rxifdzSsz5GUyc26kTinNGya5LDFKP6xW+TZ1NeIW5J0fJT4m8ci/A+jVw06w
 ganA==
MIME-Version: 1.0
X-Received: by 10.58.100.234 with SMTP id fb10mr13150565veb.5.1378657496222;
 Sun, 08 Sep 2013 09:24:56 -0700 (PDT)
Sender: edschouten@gmail.com
Received: by 10.220.115.206 with HTTP; Sun, 8 Sep 2013 09:24:56 -0700 (PDT)
In-Reply-To: <201309071345.r87Djj0P003439@svn.freebsd.org>
References: <201309071345.r87Djj0P003439@svn.freebsd.org>
Date: Sun, 8 Sep 2013 18:24:56 +0200
X-Google-Sender-Auth: _Yrz3lxeMMzzC0AZoacNTlXaLSw
Message-ID: <CAJOYFBAmmmd29N_W+yFK3m=z0otF47dWO2Kd4w42aQcCCt59bg@mail.gmail.com>
Subject: Re: svn commit: r255359 - in head/sys: cddl/dev/dtrace dev/firewire
 dev/vkbd security/audit
From: Ed Schouten <ed@80386.nl>
To: Davide Italiano <davide@freebsd.org>
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 16:24:58 -0000

2013/9/7 Davide Italiano <davide@freebsd.org>:
> Log:
>   - Use make_dev_credf(MAKEDEV_REF) instead of the race-prone make_dev()+
>   dev_ref() in the clone handlers that still use it.
>   - Don't set SI_CHEAPCLONE flag, it's not used anywhere neither in devfs
>   (for anything real)

Wait. This piece of code is never used on FreeBSD HEAD, right? See
dtrace_load.c:

#if __FreeBSD_version < 800039
        /* Enable device cloning. */
        clone_setup(&dtrace_clones);

        /* Setup device cloning events. */
        eh_tag = EVENTHANDLER_REGISTER(dev_clone, dtrace_clone, 0,
1000);
#else
        dtrace_dev = make_dev(&dtrace_cdevsw, 0, UID_ROOT, GID_WHEEL,
0600,
            "dtrace/dtrace");
        helper_dev = make_dev(&helper_cdevsw, 0, UID_ROOT, GID_WHEEL,
0660,
            "dtrace/helper");
#endif

-- 
Ed Schouten <ed@80386.nl>

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 16:26:09 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id AE196387;
 Sun,  8 Sep 2013 16:26:09 +0000 (UTC)
 (envelope-from edschouten@gmail.com)
Received: from mail-vc0-x233.google.com (mail-vc0-x233.google.com
 [IPv6:2607:f8b0:400c:c03::233])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 389D02591;
 Sun,  8 Sep 2013 16:26:09 +0000 (UTC)
Received: by mail-vc0-f179.google.com with SMTP id ht10so3293702vcb.38
 for <multiple recipients>; Sun, 08 Sep 2013 09:26:08 -0700 (PDT)
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=PXaN1G/nZJkcXgKC8AVJQq+imRDvSyoGIRMe9xIvpqg=;
 b=ljmupqr/zJYqKWHU/Mc+5uzXZ9Djw6TjIepBDgUz8x+aXOsGgeItM991On5b5fF2SR
 pthz4EKcfr6vhzmidkEeDD3XgC9wgWdR8kbd9a2czENPKPwCbmSGJf8i/hJ+fYQspEy3
 9cu58YzFQifP1lV3q4U37wDcFfKYblD2f/P3LGO72me0GGE3eqz3phJ2AOu0kcPLh0VW
 /LT9hBxtOA+AOgCeB2MMJHhvWqQiRr1JT7xJqq/tqlawLgoCWHA4uACIElWPu1ohFOgl
 utQEDuGJ9ajCYGU+Omc2eBGIuLOs82Cr9qm0VUdBwdJEWU0ldRdj2/hT8MbE5Rs2l2Tl
 6WEA==
MIME-Version: 1.0
X-Received: by 10.52.117.68 with SMTP id kc4mr10975515vdb.0.1378657568336;
 Sun, 08 Sep 2013 09:26:08 -0700 (PDT)
Sender: edschouten@gmail.com
Received: by 10.220.115.206 with HTTP; Sun, 8 Sep 2013 09:26:08 -0700 (PDT)
In-Reply-To: <201309071350.r87DoDUb005690@svn.freebsd.org>
References: <201309071350.r87DoDUb005690@svn.freebsd.org>
Date: Sun, 8 Sep 2013 18:26:08 +0200
X-Google-Sender-Auth: zO-4vKafDQjytvf8PijZNhumzYE
Message-ID: <CAJOYFBDw6n0uo2LBh5LQkAR2K8+rGWYmfF97jJiPHHucKPOwUg@mail.gmail.com>
Subject: Re: svn commit: r255360 - head/sys/net
From: Ed Schouten <ed@80386.nl>
To: Davide Italiano <davide@freebsd.org>
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 16:26:09 -0000

2013/9/7 Davide Italiano <davide@freebsd.org>:
> Log:
>   Don't clear the unused SI_CHEAPCLONE flag in tap_create()/tuncreate().

Both the tun and the tap driver still use clonelists, right? I'm not
sure this fix is all right.

-- 
Ed Schouten <ed@80386.nl>

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 16:48:04 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 09677C3A;
 Sun,  8 Sep 2013 16:48:04 +0000 (UTC)
 (envelope-from markm@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id EB413266D;
 Sun,  8 Sep 2013 16:48:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88Gm30K008497;
 Sun, 8 Sep 2013 16:48:03 GMT (envelope-from markm@svn.freebsd.org)
Received: (from markm@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88Gm3mh008496;
 Sun, 8 Sep 2013 16:48:03 GMT (envelope-from markm@svn.freebsd.org)
Message-Id: <201309081648.r88Gm3mh008496@svn.freebsd.org>
From: Mark Murray <markm@FreeBSD.org>
Date: Sun, 8 Sep 2013 16:48:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255391 - head/sys/dev/random
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 16:48:04 -0000

Author: markm
Date: Sun Sep  8 16:48:03 2013
New Revision: 255391
URL: http://svnweb.freebsd.org/changeset/base/255391

Log:
  Fix verbose output line; needs <NL>
  
  Submitted by:	Sean Bruno <sean_bruno@yahoo.com>
  Approved by:	re (glebius)

Modified:
  head/sys/dev/random/random_adaptors.c

Modified: head/sys/dev/random/random_adaptors.c
==============================================================================
--- head/sys/dev/random/random_adaptors.c	Sun Sep  8 15:44:34 2013	(r255390)
+++ head/sys/dev/random/random_adaptors.c	Sun Sep  8 16:48:03 2013	(r255391)
@@ -177,7 +177,7 @@ random_adaptor_choose(struct random_adap
 		}
 
 		if (bootverbose && *adaptor)
-			printf("Falling back to <%s> random adaptor",
+			printf("Falling back to <%s> random adaptor\n",
 			    (*adaptor)->ident);
 	}
 }

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 16:50:22 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 41466DFD;
 Sun,  8 Sep 2013 16:50:22 +0000 (UTC)
 (envelope-from davide.italiano@gmail.com)
Received: from mail-vc0-x234.google.com (mail-vc0-x234.google.com
 [IPv6:2607:f8b0:400c:c03::234])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id D0B4F26A6;
 Sun,  8 Sep 2013 16:50:21 +0000 (UTC)
Received: by mail-vc0-f180.google.com with SMTP id gf11so3418162vcb.11
 for <multiple recipients>; Sun, 08 Sep 2013 09:50:21 -0700 (PDT)
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=CYUCji8wT/YYIfsFw4VIOW+ZiUmmkbei5o+xPcwOSV8=;
 b=hXCgRTpmPC7+9yE5NcP7kXpDS2BIXk3Eur88Hfa+/XCSOThnnGBc4NuGR69Cc54sFE
 cpX4nric/rjgWdqGlrZzDGa/2mPJdFeW1ftmJYd6+mKV6IzTDPsBPR4TufPEOI+3cUjm
 BYJSpOx9zzKaV2gj74e34i8wOrslMgGZWqLmPjI16zncszkl9EeWJAz8k1xqld2Pv64V
 hj+N0qZGQC48Uk42JuvVeE63xlkYt2qXkguqV8bXxaUHkCNfntVQFM/xbjHltXhJSzc8
 a0JFT+rgw+WWy0KqflVaj/d3zDAeaGvlPZmh+VZqG/e1wadwzOa0X4U3NgOC0es9v00Y
 X1vw==
MIME-Version: 1.0
X-Received: by 10.52.75.165 with SMTP id d5mr11189633vdw.1.1378659020994; Sun,
 08 Sep 2013 09:50:20 -0700 (PDT)
Sender: davide.italiano@gmail.com
Received: by 10.220.65.132 with HTTP; Sun, 8 Sep 2013 09:50:20 -0700 (PDT)
In-Reply-To: <CAJOYFBAmmmd29N_W+yFK3m=z0otF47dWO2Kd4w42aQcCCt59bg@mail.gmail.com>
References: <201309071345.r87Djj0P003439@svn.freebsd.org>
 <CAJOYFBAmmmd29N_W+yFK3m=z0otF47dWO2Kd4w42aQcCCt59bg@mail.gmail.com>
Date: Sun, 8 Sep 2013 18:50:20 +0200
X-Google-Sender-Auth: rwWP9YwU7zLLLrYLMpIgtx77z5A
Message-ID: <CACYV=-GFJerL+Lg_S8UcRVgXEyxVnF_p+9dSBLSi070CTaLV3w@mail.gmail.com>
Subject: Re: svn commit: r255359 - in head/sys: cddl/dev/dtrace dev/firewire
 dev/vkbd security/audit
From: Davide Italiano <davide@freebsd.org>
To: Ed Schouten <ed@80386.nl>
Content-Type: text/plain; charset=ISO-8859-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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 16:50:22 -0000

On Sun, Sep 8, 2013 at 6:24 PM, Ed Schouten <ed@80386.nl> wrote:
> 2013/9/7 Davide Italiano <davide@freebsd.org>:
>> Log:
>>   - Use make_dev_credf(MAKEDEV_REF) instead of the race-prone make_dev()+
>>   dev_ref() in the clone handlers that still use it.
>>   - Don't set SI_CHEAPCLONE flag, it's not used anywhere neither in devfs
>>   (for anything real)
>
> Wait. This piece of code is never used on FreeBSD HEAD, right? See
> dtrace_load.c:
>
> #if __FreeBSD_version < 800039
>         /* Enable device cloning. */
>         clone_setup(&dtrace_clones);
>
>         /* Setup device cloning events. */
>         eh_tag = EVENTHANDLER_REGISTER(dev_clone, dtrace_clone, 0,
> 1000);
> #else
>         dtrace_dev = make_dev(&dtrace_cdevsw, 0, UID_ROOT, GID_WHEEL,
> 0600,
>             "dtrace/dtrace");
>         helper_dev = make_dev(&helper_cdevsw, 0, UID_ROOT, GID_WHEEL,
> 0660,
>             "dtrace/helper");
> #endif
>
> --
> Ed Schouten <ed@80386.nl>

Hi Ed,
yes, you're right that's never used. I put that there only for
consistency with the behaviour of other drivers. I think it's not good
to leave examples of racy patterns, even if the code is not built
anymore. If you have any kind of objections, I'll revert that.
That said, let me clarify things a bit. Originally my goal was that of
moving every clone handler to cdevpriv(9), but unfortunately 10
slush/freeze approached quicker than I expected, so I preferred to fix
at least this racy behaviour before 10.0 release. I hope to start with
this conversion when HEAD will be open for commit again, but that's
not a priority.

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 16:56:17 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BE098254;
 Sun,  8 Sep 2013 16:56:17 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id AAFD926DF;
 Sun,  8 Sep 2013 16:56:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88GuH7V013629;
 Sun, 8 Sep 2013 16:56:17 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88GuHwB013628;
 Sun, 8 Sep 2013 16:56:17 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081656.r88GuHwB013628@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 16:56:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255393 - in head/contrib/openpam: . lib lib/libpam t
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 16:56:17 -0000

Author: des
Date: Sun Sep  8 16:56:17 2013
New Revision: 255393
URL: http://svnweb.freebsd.org/changeset/base/255393

Log:
  MFV (r255387): undo autoprop damage
  
  Approved by:	re (glebius)

Modified:
  head/contrib/openpam/lib/Makefile.am   (contents, props changed)
Directory Properties:
  head/contrib/openpam/   (props changed)
  head/contrib/openpam/lib/Makefile.in   (props changed)
  head/contrib/openpam/lib/libpam/openpam_asprintf.c   (props changed)
  head/contrib/openpam/lib/libpam/openpam_asprintf.h   (props changed)
  head/contrib/openpam/lib/libpam/openpam_cred.h   (props changed)
  head/contrib/openpam/lib/libpam/openpam_dlfunc.h   (props changed)
  head/contrib/openpam/lib/libpam/openpam_strlcat.c   (props changed)
  head/contrib/openpam/lib/libpam/openpam_strlcpy.c   (props changed)
  head/contrib/openpam/lib/libpam/openpam_vasprintf.c   (props changed)
  head/contrib/openpam/lib/libpam/openpam_vasprintf.h   (props changed)
  head/contrib/openpam/mkpkgng.in   (props changed)
  head/contrib/openpam/t/t_file.c   (props changed)

Modified: head/contrib/openpam/lib/Makefile.am
==============================================================================
--- head/contrib/openpam/lib/Makefile.am	Sun Sep  8 16:53:28 2013	(r255392)
+++ head/contrib/openpam/lib/Makefile.am	Sun Sep  8 16:56:17 2013	(r255393)
@@ -1,3 +1,3 @@
-# $Id$
+# $Id: Makefile.am 255376 2013-09-07 19:43:39Z des $
 
 SUBDIRS = libpam

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 17:00:43 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 27D3F3EA;
 Sun,  8 Sep 2013 17:00:43 +0000 (UTC)
 (envelope-from davide.italiano@gmail.com)
Received: from mail-vb0-x231.google.com (mail-vb0-x231.google.com
 [IPv6:2607:f8b0:400c:c02::231])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B79CC2705;
 Sun,  8 Sep 2013 17:00:42 +0000 (UTC)
Received: by mail-vb0-f49.google.com with SMTP id w16so3290856vbb.36
 for <multiple recipients>; Sun, 08 Sep 2013 10:00:41 -0700 (PDT)
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=Jy0Db+VXkG7x1/KfjPc4CtZgZsj5v0yxlWs7HyN/058=;
 b=Dz6PELnM7abbU1/YV3osUAFcYtPWDITf140sXrwE2hoLz79DvK9Q5NqsmVi7jklQbW
 2DT01YcNCVuKSiyWYBssYVR8PXso2Toaksbtl30uLXsAjFmfuH1WKG9aVuRX8akycS1b
 BnFreRFuEnHtfcj5WwC3EazXRLHyeO0i0b1KEoYKMHpF+hQRaEJCKqITWyQjvsHmnDmt
 tukU5WFsN/jTSKhKD4R6Ry+4cm223PrMGVqZ6u4mvvmHVxtbJyGrVqln5U/suSY+iKxv
 HrlRvs8f3R1aaCT5wIuba1QItQdcIzHygavCDw+IdZ89sTTA7E5jElmPZiD0+QpxWETJ
 3Udg==
MIME-Version: 1.0
X-Received: by 10.52.173.165 with SMTP id bl5mr11497637vdc.18.1378659641916;
 Sun, 08 Sep 2013 10:00:41 -0700 (PDT)
Sender: davide.italiano@gmail.com
Received: by 10.220.65.132 with HTTP; Sun, 8 Sep 2013 10:00:41 -0700 (PDT)
In-Reply-To: <CAJOYFBDw6n0uo2LBh5LQkAR2K8+rGWYmfF97jJiPHHucKPOwUg@mail.gmail.com>
References: <201309071350.r87DoDUb005690@svn.freebsd.org>
 <CAJOYFBDw6n0uo2LBh5LQkAR2K8+rGWYmfF97jJiPHHucKPOwUg@mail.gmail.com>
Date: Sun, 8 Sep 2013 19:00:41 +0200
X-Google-Sender-Auth: DvOCBEuAB9bAMsNUqefn33yoNL8
Message-ID: <CACYV=-HwAPFMUheOPPY=trN9U4y+S=TU2iR6TrHgyTx5ZZcnpg@mail.gmail.com>
Subject: Re: svn commit: r255360 - head/sys/net
From: Davide Italiano <davide@freebsd.org>
To: Ed Schouten <ed@80386.nl>
Content-Type: text/plain; charset=ISO-8859-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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 17:00:43 -0000

On Sun, Sep 8, 2013 at 6:26 PM, Ed Schouten <ed@80386.nl> wrote:
> 2013/9/7 Davide Italiano <davide@freebsd.org>:
>> Log:
>>   Don't clear the unused SI_CHEAPCLONE flag in tap_create()/tuncreate().
>
> Both the tun and the tap driver still use clonelists, right? I'm not
> sure this fix is all right.
>
> --
> Ed Schouten <ed@80386.nl>

Please correct me if I'm wrong, but from what I see r204464 (by kib@)
removed the set of SI_CHEAPCLONE flag from both if_tap and if_tun so I
think that's just a leftover.
Also, SI_CHEAPCLONE implementation inside devfs is pretty unfinished,
so even though we restore that piece of code inside the driver I'm not
sure it will accomplish anything. Most of the drivers already removed
the usage already.

As a side note, I've already discussed with Kostik how to handle this
in the future and he thinks (and I agree) that the right action there
is to remove clones and SI_CHEAPCLONE, or implement the real
SI_CHEAPCLONE semantic.
I would strongly go for the first option, but if that won't be
technically possible I think we should re-evaluate when/how to
reintroduce the SI_CHEAPCLONE flag inside drivers. I hope this makes
sense to you.

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 17:28:11 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A26CD7C4;
 Sun,  8 Sep 2013 17:28:11 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8F83D2806;
 Sun,  8 Sep 2013 17:28:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88HSBOb032243;
 Sun, 8 Sep 2013 17:28:11 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88HSBYq032242;
 Sun, 8 Sep 2013 17:28:11 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081728.r88HSBYq032242@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 17:28:11 +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: r255394 - stable/9/etc/mtree
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 17:28:11 -0000

Author: des
Date: Sun Sep  8 17:28:11 2013
New Revision: 255394
URL: http://svnweb.freebsd.org/changeset/base/255394

Log:
  MFH (r255243): create /var/authpf with correct ownership and permissions.

Modified:
  stable/9/etc/mtree/BSD.var.dist
Directory Properties:
  stable/9/etc/mtree/   (props changed)

Modified: stable/9/etc/mtree/BSD.var.dist
==============================================================================
--- stable/9/etc/mtree/BSD.var.dist	Sun Sep  8 16:56:17 2013	(r255393)
+++ stable/9/etc/mtree/BSD.var.dist	Sun Sep  8 17:28:11 2013	(r255394)
@@ -23,6 +23,8 @@
         remote          uname=auditdistd gname=wheel mode=0700
         ..
     ..
+    authpf              uname=root gname=authpf mode=0770
+    ..
 /set gname=wheel
     backups
     ..

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 17:47:16 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id ECD1ABBA;
 Sun,  8 Sep 2013 17:47:15 +0000 (UTC)
 (envelope-from trociny@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id D791828C2;
 Sun,  8 Sep 2013 17:47:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88HlFci043785;
 Sun, 8 Sep 2013 17:47:15 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88HlF5X043771;
 Sun, 8 Sep 2013 17:47:15 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201309081747.r88HlF5X043771@svn.freebsd.org>
From: Mikolaj Golub <trociny@FreeBSD.org>
Date: Sun, 8 Sep 2013 17:47:15 +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: r255395 - stable/9/sys/netpfil/ipfw
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 17:47:16 -0000

Author: trociny
Date: Sun Sep  8 17:47:14 2013
New Revision: 255395
URL: http://svnweb.freebsd.org/changeset/base/255395

Log:
  MFC r254776:
  
  Make ipfw nat init/unint work correctly for VIMAGE:
  
  * Do per vnet instance cleanup (previously it was only for vnet0 on
    module unload, and led to libalias leaks and possible panics due to
    stale pointer dereferences).
  
  * Instead of protecting ipfw hooks registering/deregistering by only
    vnet0 lock (which does not prevent pointers access from another
    vnets), introduce per vnet ipfw_nat_loaded variable. The variable is
    set after hooks are registered and unset before they are deregistered.
  
  * Devirtualize ifaddr_event_tag as we run only one event handler for
    all vnets.
  
  * It is supposed that ifaddr_change event handler is called in the
    interface vnet context, so add an assertion.
  
  Reviewed by:	zec

Modified:
  stable/9/sys/netpfil/ipfw/ip_fw2.c
  stable/9/sys/netpfil/ipfw/ip_fw_nat.c
  stable/9/sys/netpfil/ipfw/ip_fw_private.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netpfil/ipfw/ip_fw2.c
==============================================================================
--- stable/9/sys/netpfil/ipfw/ip_fw2.c	Sun Sep  8 17:28:11 2013	(r255394)
+++ stable/9/sys/netpfil/ipfw/ip_fw2.c	Sun Sep  8 17:47:14 2013	(r255395)
@@ -142,6 +142,8 @@ VNET_DEFINE(int, verbose_limit);
 /* layer3_chain contains the list of rules for layer 3 */
 VNET_DEFINE(struct ip_fw_chain, layer3_chain);
 
+VNET_DEFINE(int, ipfw_nat_ready) = 0;
+
 ipfw_nat_t *ipfw_nat_ptr = NULL;
 struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int);
 ipfw_nat_cfg_t *ipfw_nat_cfg_ptr;

Modified: stable/9/sys/netpfil/ipfw/ip_fw_nat.c
==============================================================================
--- stable/9/sys/netpfil/ipfw/ip_fw_nat.c	Sun Sep  8 17:28:11 2013	(r255394)
+++ stable/9/sys/netpfil/ipfw/ip_fw_nat.c	Sun Sep  8 17:47:14 2013	(r255395)
@@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/in_cksum.h>	/* XXX for in_cksum */
 
-static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag);
-#define	V_ifaddr_event_tag	VNET(ifaddr_event_tag)
+static eventhandler_tag ifaddr_event_tag;
 
 static void
 ifaddr_change(void *arg __unused, struct ifnet *ifp)
@@ -63,6 +62,8 @@ ifaddr_change(void *arg __unused, struct
 	struct ifaddr *ifa;
 	struct ip_fw_chain *chain;
 
+	KASSERT(curvnet == ifp->if_vnet,
+	    ("curvnet(%p) differs from iface vnet(%p)", curvnet, ifp->if_vnet));
 	chain = &V_layer3_chain;
 	IPFW_WLOCK(chain);
 	/* Check every nat entry... */
@@ -590,11 +591,38 @@ ipfw_nat_get_log(struct sockopt *sopt)
 	return(0);
 }
 
+static int
+vnet_ipfw_nat_init(const void *arg __unused)
+{
+
+	V_ipfw_nat_ready = 1;
+	return (0);
+}
+
+static int
+vnet_ipfw_nat_uninit(const void *arg __unused)
+{
+	struct cfg_nat *ptr, *ptr_temp;
+	struct ip_fw_chain *chain;
+
+	chain = &V_layer3_chain;
+	IPFW_WLOCK(chain);
+	LIST_FOREACH_SAFE(ptr, &chain->nat, _next, ptr_temp) {
+		LIST_REMOVE(ptr, _next);
+		del_redir_spool_cfg(ptr, &ptr->redir_chain);
+		LibAliasUninit(ptr->lib);
+		free(ptr, M_IPFW);
+	}
+	flush_nat_ptrs(chain, -1 /* flush all */);
+	V_ipfw_nat_ready = 0;
+	IPFW_WUNLOCK(chain);
+	return (0);
+}
+
 static void
 ipfw_nat_init(void)
 {
 
-	IPFW_WLOCK(&V_layer3_chain);
 	/* init ipfw hooks */
 	ipfw_nat_ptr = ipfw_nat;
 	lookup_nat_ptr = lookup_nat;
@@ -602,28 +630,16 @@ ipfw_nat_init(void)
 	ipfw_nat_del_ptr = ipfw_nat_del;
 	ipfw_nat_get_cfg_ptr = ipfw_nat_get_cfg;
 	ipfw_nat_get_log_ptr = ipfw_nat_get_log;
-	IPFW_WUNLOCK(&V_layer3_chain);
-	V_ifaddr_event_tag = EVENTHANDLER_REGISTER(
-	    ifaddr_event, ifaddr_change,
+
+	ifaddr_event_tag = EVENTHANDLER_REGISTER(ifaddr_event, ifaddr_change,
 	    NULL, EVENTHANDLER_PRI_ANY);
 }
 
 static void
 ipfw_nat_destroy(void)
 {
-	struct cfg_nat *ptr, *ptr_temp;
-	struct ip_fw_chain *chain;
 
-	chain = &V_layer3_chain;
-	IPFW_WLOCK(chain);
-	LIST_FOREACH_SAFE(ptr, &chain->nat, _next, ptr_temp) {
-		LIST_REMOVE(ptr, _next);
-		del_redir_spool_cfg(ptr, &ptr->redir_chain);
-		LibAliasUninit(ptr->lib);
-		free(ptr, M_IPFW);
-	}
-	EVENTHANDLER_DEREGISTER(ifaddr_event, V_ifaddr_event_tag);
-	flush_nat_ptrs(chain, -1 /* flush all */);
+	EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_event_tag);
 	/* deregister ipfw_nat */
 	ipfw_nat_ptr = NULL;
 	lookup_nat_ptr = NULL;
@@ -631,7 +647,6 @@ ipfw_nat_destroy(void)
 	ipfw_nat_del_ptr = NULL;
 	ipfw_nat_get_cfg_ptr = NULL;
 	ipfw_nat_get_log_ptr = NULL;
-	IPFW_WUNLOCK(chain);
 }
 
 static int
@@ -641,11 +656,9 @@ ipfw_nat_modevent(module_t mod, int type
 
 	switch (type) {
 	case MOD_LOAD:
-		ipfw_nat_init();
 		break;
 
 	case MOD_UNLOAD:
-		ipfw_nat_destroy();
 		break;
 
 	default:
@@ -661,8 +674,25 @@ static moduledata_t ipfw_nat_mod = {
 	0
 };
 
-DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
+/* Define startup order. */
+#define	IPFW_NAT_SI_SUB_FIREWALL	SI_SUB_PROTO_IFATTACHDOMAIN
+#define	IPFW_NAT_MODEVENT_ORDER		(SI_ORDER_ANY - 255)
+#define	IPFW_NAT_MODULE_ORDER		(IPFW_NAT_MODEVENT_ORDER + 1)
+#define	IPFW_NAT_VNET_ORDER		(IPFW_NAT_MODEVENT_ORDER + 2)
+
+DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, IPFW_NAT_SI_SUB_FIREWALL, SI_ORDER_ANY);
 MODULE_DEPEND(ipfw_nat, libalias, 1, 1, 1);
 MODULE_DEPEND(ipfw_nat, ipfw, 2, 2, 2);
 MODULE_VERSION(ipfw_nat, 1);
+
+SYSINIT(ipfw_nat_init, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_MODULE_ORDER,
+    ipfw_nat_init, NULL);
+VNET_SYSINIT(vnet_ipfw_nat_init, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_VNET_ORDER,
+    vnet_ipfw_nat_init, NULL);
+
+SYSUNINIT(ipfw_nat_destroy, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_MODULE_ORDER,
+    ipfw_nat_destroy, NULL);
+VNET_SYSUNINIT(vnet_ipfw_nat_uninit, IPFW_NAT_SI_SUB_FIREWALL,
+    IPFW_NAT_VNET_ORDER, vnet_ipfw_nat_uninit, NULL);
+
 /* end of file */

Modified: stable/9/sys/netpfil/ipfw/ip_fw_private.h
==============================================================================
--- stable/9/sys/netpfil/ipfw/ip_fw_private.h	Sun Sep  8 17:28:11 2013	(r255394)
+++ stable/9/sys/netpfil/ipfw/ip_fw_private.h	Sun Sep  8 17:47:14 2013	(r255395)
@@ -329,9 +329,11 @@ extern struct cfg_nat *(*lookup_nat_ptr)
 typedef int ipfw_nat_t(struct ip_fw_args *, struct cfg_nat *, struct mbuf *);
 typedef int ipfw_nat_cfg_t(struct sockopt *);
 
-extern ipfw_nat_t *ipfw_nat_ptr;
-#define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL)
+VNET_DECLARE(int, ipfw_nat_ready);
+#define	V_ipfw_nat_ready	VNET(ipfw_nat_ready)
+#define	IPFW_NAT_LOADED	(V_ipfw_nat_ready)
 
+extern ipfw_nat_t *ipfw_nat_ptr;
 extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr;
 extern ipfw_nat_cfg_t *ipfw_nat_del_ptr;
 extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr;

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 17:51:23 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 34F07D0D;
 Sun,  8 Sep 2013 17:51:23 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2047D28EF;
 Sun,  8 Sep 2013 17:51:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88HpMNi047153;
 Sun, 8 Sep 2013 17:51:22 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88HpM0s047151;
 Sun, 8 Sep 2013 17:51:22 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309081751.r88HpM0s047151@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Sun, 8 Sep 2013 17:51:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255396 - in head/sys: kern vm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 17:51:23 -0000

Author: kib
Date: Sun Sep  8 17:51:22 2013
New Revision: 255396
URL: http://svnweb.freebsd.org/changeset/base/255396

Log:
  Drain for the xbusy state for two places which potentially do
  pmap_remove_all(). Not doing the drain allows the pmap_enter() to
  proceed in parallel, making the pmap_remove_all() effects void.
  
  The race results in an invalidated page mapped wired by usermode.
  
  Reported and tested by:	pho
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  Approved by:	re (glebius)

Modified:
  head/sys/kern/vfs_bio.c
  head/sys/vm/vm_object.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Sun Sep  8 17:47:14 2013	(r255395)
+++ head/sys/kern/vfs_bio.c	Sun Sep  8 17:51:22 2013	(r255396)
@@ -1693,6 +1693,12 @@ brelse(struct buf *bp)
 
 				KASSERT(presid >= 0, ("brelse: extra page"));
 				VM_OBJECT_WLOCK(obj);
+				while (vm_page_xbusied(m)) {
+					vm_page_lock(m);
+					VM_OBJECT_WUNLOCK(obj);
+					vm_page_busy_sleep(m, "mbncsh");
+					VM_OBJECT_WLOCK(obj);
+				}
 				if (pmap_page_wired_mappings(m) == 0)
 					vm_page_set_invalid(m, poffset, presid);
 				VM_OBJECT_WUNLOCK(obj);

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Sun Sep  8 17:47:14 2013	(r255395)
+++ head/sys/vm/vm_object.c	Sun Sep  8 17:51:22 2013	(r255396)
@@ -1910,6 +1910,12 @@ again:
 		 * not specified.
 		 */
 		vm_page_lock(p);
+		if (vm_page_xbusied(p)) {
+			VM_OBJECT_WUNLOCK(object);
+			vm_page_busy_sleep(p, "vmopax");
+			VM_OBJECT_WLOCK(object);
+			goto again;
+		}
 		if ((wirings = p->wire_count) != 0 &&
 		    (wirings = pmap_page_wired_mappings(p)) != p->wire_count) {
 			if ((options & (OBJPR_NOTWIRED | OBJPR_NOTMAPPED)) ==

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 18:19:40 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B1593282;
 Sun,  8 Sep 2013 18:19:40 +0000 (UTC)
 (envelope-from trociny@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9E9DA2A02;
 Sun,  8 Sep 2013 18:19:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88IJenD062696;
 Sun, 8 Sep 2013 18:19:40 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88IJeJL062695;
 Sun, 8 Sep 2013 18:19:40 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201309081819.r88IJeJL062695@svn.freebsd.org>
From: Mikolaj Golub <trociny@FreeBSD.org>
Date: Sun, 8 Sep 2013 18:19:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255397 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 18:19:40 -0000

Author: trociny
Date: Sun Sep  8 18:19:40 2013
New Revision: 255397
URL: http://svnweb.freebsd.org/changeset/base/255397

Log:
  Relese the interface in the last.
  
  Reviewed by:	glebius
  Approved by:	re (kib)

Modified:
  head/sys/netinet/ip_carp.c

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Sun Sep  8 17:51:22 2013	(r255396)
+++ head/sys/netinet/ip_carp.c	Sun Sep  8 18:19:40 2013	(r255397)
@@ -1605,12 +1605,12 @@ carp_free_if(struct carp_if *cif)
 
 	IF_ADDR_WLOCK(ifp);
 	ifp->if_carp = NULL;
-	if_rele(ifp);
 	IF_ADDR_WUNLOCK(ifp);
 
 	CIF_LOCK_DESTROY(cif);
 
 	ifpromisc(ifp, 0);
+	if_rele(ifp);
 
 	free(cif, M_CARP);
 }

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 18:27:27 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 4959A41F;
 Sun,  8 Sep 2013 18:27:27 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1C5E02A42;
 Sun,  8 Sep 2013 18:27:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88IRQ25067579;
 Sun, 8 Sep 2013 18:27:26 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88IRQT6067577;
 Sun, 8 Sep 2013 18:27:26 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081827.r88IRQT6067577@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 18:27:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255398 - releng/9.2/usr.sbin/rtadvd
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 18:27:27 -0000

Author: des
Date: Sun Sep  8 18:27:26 2013
New Revision: 255398
URL: http://svnweb.freebsd.org/changeset/base/255398

Log:
  MFH (r254684, r254955): fix segfault on reload.
  MFH (r255156): silence an error message on non-IPv6 interfaces.
  
  Approved by:    re (glebius)

Modified:
  releng/9.2/usr.sbin/rtadvd/config.c
  releng/9.2/usr.sbin/rtadvd/if.c
Directory Properties:
  releng/9.2/usr.sbin/rtadvd/   (props changed)

Modified: releng/9.2/usr.sbin/rtadvd/config.c
==============================================================================
--- releng/9.2/usr.sbin/rtadvd/config.c	Sun Sep  8 18:19:40 2013	(r255397)
+++ releng/9.2/usr.sbin/rtadvd/config.c	Sun Sep  8 18:27:26 2013	(r255398)
@@ -296,10 +296,8 @@ rm_rainfo(struct rainfo *rai)
 	if (rai->rai_ra_data != NULL)
 		free(rai->rai_ra_data);
 
-	while ((pfx = TAILQ_FIRST(&rai->rai_prefix)) != NULL) {
-		TAILQ_REMOVE(&rai->rai_prefix, pfx, pfx_next);
-		free(pfx);
-	}
+	while ((pfx = TAILQ_FIRST(&rai->rai_prefix)) != NULL)
+		delete_prefix(pfx);
 	while ((sol = TAILQ_FIRST(&rai->rai_soliciter)) != NULL) {
 		TAILQ_REMOVE(&rai->rai_soliciter, sol, sol_next);
 		free(sol);
@@ -1123,9 +1121,9 @@ add_prefix(struct rainfo *rai, struct in
 	pfx->pfx_onlinkflg = ipr->ipr_raf_onlink;
 	pfx->pfx_autoconfflg = ipr->ipr_raf_auto;
 	pfx->pfx_origin = PREFIX_FROM_DYNAMIC;
+	pfx->pfx_rainfo = rai;
 
 	TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next);
-	pfx->pfx_rainfo = rai;
 
 	syslog(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s",
 	    __func__,

Modified: releng/9.2/usr.sbin/rtadvd/if.c
==============================================================================
--- releng/9.2/usr.sbin/rtadvd/if.c	Sun Sep  8 18:19:40 2013	(r255397)
+++ releng/9.2/usr.sbin/rtadvd/if.c	Sun Sep  8 18:27:26 2013	(r255398)
@@ -394,8 +394,8 @@ update_ifinfo_nd_flags(struct ifinfo *if
 	error = ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd);
 	if (error) {
 		close(s);
-		syslog(LOG_ERR,
-		    "<%s> ioctl() failed.", __func__);
+		if (errno != EPFNOSUPPORT)
+			syslog(LOG_ERR, "<%s> ioctl() failed.", __func__);
 		return (1);
 	}
 	ifi->ifi_nd_flags = nd.ndi.flags;

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 19:13:07 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 86724F1C;
 Sun,  8 Sep 2013 19:13:07 +0000 (UTC)
 (envelope-from bryanv@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 734F72C59;
 Sun,  8 Sep 2013 19:13:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88JD7FS095920;
 Sun, 8 Sep 2013 19:13:07 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88JD7e5095919;
 Sun, 8 Sep 2013 19:13:07 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201309081913.r88JD7e5095919@svn.freebsd.org>
From: Bryan Venteicher <bryanv@FreeBSD.org>
Date: Sun, 8 Sep 2013 19:13:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255400 - head/sys/dev/vmware/vmxnet3
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 19:13:07 -0000

Author: bryanv
Date: Sun Sep  8 19:13:06 2013
New Revision: 255400
URL: http://svnweb.freebsd.org/changeset/base/255400

Log:
  Use correct type for the vmx vlan filter table
  
  Approved by:	re (glebius, gjb)

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmxvar.h

Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmxvar.h	Sun Sep  8 18:58:33 2013	(r255399)
+++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h	Sun Sep  8 19:13:06 2013	(r255400)
@@ -228,7 +228,7 @@ struct vmxnet3_softc {
 	struct ifmedia			 vmx_media;
 	eventhandler_tag		 vmx_vlan_attach;
 	eventhandler_tag		 vmx_vlan_detach;
-	uint8_t				 vmx_vlan_filter[4096/32];
+	uint32_t			 vmx_vlan_filter[4096/32];
 	uint8_t				 vmx_lladdr[ETHER_ADDR_LEN];
 };
 

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 19:29:46 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 085773C1;
 Sun,  8 Sep 2013 19:29:46 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E7C3F2CEA;
 Sun,  8 Sep 2013 19:29:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88JTjNK004363;
 Sun, 8 Sep 2013 19:29:45 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88JTjWY004362;
 Sun, 8 Sep 2013 19:29:45 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081929.r88JTjWY004362@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 19:29:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255401 - releng/9.2/etc/mtree
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 19:29:46 -0000

Author: des
Date: Sun Sep  8 19:29:45 2013
New Revision: 255401
URL: http://svnweb.freebsd.org/changeset/base/255401

Log:
  MFH (r255243): create /var/authpf with correct ownership and permissions.
  
  Approved by:	re (glebius)

Modified:
  releng/9.2/etc/mtree/BSD.var.dist
Directory Properties:
  releng/9.2/etc/   (props changed)
  releng/9.2/etc/mtree/   (props changed)

Modified: releng/9.2/etc/mtree/BSD.var.dist
==============================================================================
--- releng/9.2/etc/mtree/BSD.var.dist	Sun Sep  8 19:13:06 2013	(r255400)
+++ releng/9.2/etc/mtree/BSD.var.dist	Sun Sep  8 19:29:45 2013	(r255401)
@@ -23,6 +23,8 @@
         remote          uname=auditdistd gname=wheel mode=0700
         ..
     ..
+    authpf              uname=root gname=authpf mode=0770
+    ..
 /set gname=wheel
     backups
     ..

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 19:39:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 50F2157E;
 Sun,  8 Sep 2013 19:39:19 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3D99F2D43;
 Sun,  8 Sep 2013 19:39:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88JdJeU010185;
 Sun, 8 Sep 2013 19:39:19 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88JdJ3K010184;
 Sun, 8 Sep 2013 19:39:19 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081939.r88JdJ3K010184@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 19:39:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255402 - head/lib/libldns
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 19:39:19 -0000

Author: des
Date: Sun Sep  8 19:39:18 2013
New Revision: 255402
URL: http://svnweb.freebsd.org/changeset/base/255402

Log:
  LDNS needs OpenSSL.  This wasn't a problem as long as it was only build
  statically, since any program using it would have to link with it anyway.
  
  Approved by:	re (blanket)

Modified:
  head/lib/libldns/Makefile

Modified: head/lib/libldns/Makefile
==============================================================================
--- head/lib/libldns/Makefile	Sun Sep  8 19:29:45 2013	(r255401)
+++ head/lib/libldns/Makefile	Sun Sep  8 19:39:18 2013	(r255402)
@@ -18,6 +18,9 @@ SRCS=	buffer.c dane.c dname.c dnssec.c d
 
 SRCS+=	b32_ntop.c b32_pton.c b64_ntop.c b64_pton.c
 
+DPADD+=	${LIBCRYPTO}
+LDADD+=	-lcrypto
+
 WARNS ?= 3
 
 .include <bsd.lib.mk>

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 19:40:33 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id AF9896BF;
 Sun,  8 Sep 2013 19:40:33 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9C2B72D4C;
 Sun,  8 Sep 2013 19:40:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88JeXoB010947;
 Sun, 8 Sep 2013 19:40:33 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88JeX4x010945;
 Sun, 8 Sep 2013 19:40:33 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309081940.r88JeX4x010945@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 19:40:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255403 - in head: contrib/ldns-host usr.bin/host
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 19:40:33 -0000

Author: des
Date: Sun Sep  8 19:40:32 2013
New Revision: 255403
URL: http://svnweb.freebsd.org/changeset/base/255403

Log:
  Import Magerya Vitaly's ldns-host, and build it instead of the BIND version
  in the WITH_LDNS_UTILS case.
  
  Approved by:	re (blanket)

Added:
  head/contrib/ldns-host/
     - copied from r255390, vendor/ldns-host/dist/
Modified:
  head/contrib/ldns-host/ldns-host.c
  head/usr.bin/host/Makefile

Modified: head/contrib/ldns-host/ldns-host.c
==============================================================================
--- vendor/ldns-host/dist/ldns-host.c	Sun Sep  8 15:44:34 2013	(r255390)
+++ head/contrib/ldns-host/ldns-host.c	Sun Sep  8 19:40:32 2013	(r255403)
@@ -7,13 +7,16 @@
  * without any warranty.
  */
 
-#include <ldns/ldns.h>
+#include <netinet/in.h>
+
 #include <limits.h>
 #include <netdb.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
+#include <ldns/ldns.h>
+
 /* General utilities.
  */
 
@@ -198,11 +201,11 @@ ldns_pkt_filter_answer(ldns_pkt *pkt, ld
         rrtype = ldns_rr_get_type(rr);
         if (type == LDNS_RR_TYPE_ANY ||
             type == rrtype ||
-            type == LDNS_RR_TYPE_AXFR &&
+            (type == LDNS_RR_TYPE_AXFR &&
                 (rrtype == LDNS_RR_TYPE_A ||
-                rrtype == LDNS_RR_TYPE_AAAA ||
-                rrtype == LDNS_RR_TYPE_NS ||
-                rrtype == LDNS_RR_TYPE_PTR))
+		    rrtype == LDNS_RR_TYPE_AAAA ||
+		    rrtype == LDNS_RR_TYPE_NS ||
+		    rrtype == LDNS_RR_TYPE_PTR)))
             ldns_rr_list_set_rr(rrlist, rr, j++);
     }
     ldns_rr_list_set_rr_count(rrlist, j);
@@ -458,8 +461,8 @@ static uint32_t o_ixfr_serial = 0;
 static void
 usage(void) {
     fputs(
-    "Usage: ldns-host [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n"
-    "                 [-t type] [-W wait] name [server]\n"
+    "Usage: host [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n"
+    "            [-t type] [-W wait] name [server]\n"
     "\t-a same as -v -t ANY\n"
     "\t-C query SOA records from all authoritative name servers\n"
     "\t-c use this query class (IN, CH, HS, etc)\n"
@@ -776,10 +779,10 @@ dosoa(ldns_resolver *res, ldns_rdf *doma
         for (j = 0; j < cnt; j++) {
             ldns_resolver_remove_nameservers(res);
             rr = ldns_rr_list_rr(nsaddrs[i], j);
-            if (ldns_resolver_ip6(res) == LDNS_RESOLV_INET &&
-                ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA ||
-                ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 &&
-                ldns_rr_get_type(rr) == LDNS_RR_TYPE_A)
+            if ((ldns_resolver_ip6(res) == LDNS_RESOLV_INET &&
+		    ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) ||
+                (ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 &&
+		    ldns_rr_get_type(rr) == LDNS_RR_TYPE_A))
                 continue;
             if (ldns_resolver_push_nameserver_rr(res, rr) == LDNS_STATUS_OK)
                 /* bind9-host queries for domain, not dname here */

Modified: head/usr.bin/host/Makefile
==============================================================================
--- head/usr.bin/host/Makefile	Sun Sep  8 19:39:18 2013	(r255402)
+++ head/usr.bin/host/Makefile	Sun Sep  8 19:40:32 2013	(r255403)
@@ -1,5 +1,29 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
+.if ${MK_LDNS_UTILS} != "no"
+
+LDNSDIR=	${.CURDIR}/../../contrib/ldns
+LDNSHOSTDIR=	${.CURDIR}/../../contrib/ldns-host
+
+.PATH:		${LDNSHOSTDIR}
+
+PROG=		host
+SRCS=		ldns-host.c
+MAN=		host.1
+
+host.1: ldns-host.1
+	sed -e 's/ldns-//gI' <${.ALLSRC} >${.TARGET} || \
+		(rm -rf ${.TARGET} ; false)
+
+CFLAGS+=	-I${LDNSDIR}
+DPADD+=		${LIBLDNS} ${LIBCRYPTO}
+LDADD+=		-lldns -lcrypto
+USEPRIVATELIB=	ldns
+
+.else
+
 BIND_DIR=	${.CURDIR}/../../contrib/bind9
 LIB_BIND_REL=	../../lib/bind
 LIB_BIND_DIR=	${.CURDIR}/${LIB_BIND_REL}
@@ -20,4 +44,6 @@ WARNS?=		0
 DPADD+=		${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
 LDADD+=		${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
 
+.endif
+
 .include <bsd.prog.mk>

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 19:42:17 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E2E6E908;
 Sun,  8 Sep 2013 19:42:17 +0000 (UTC)
 (envelope-from nwhitehorn@freebsd.org)
Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu
 [144.92.197.222]) (using TLSv1 with cipher RC4-MD5 (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B69FD2D88;
 Sun,  8 Sep 2013 19:42:17 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 8BIT
Content-type: text/plain; charset=UTF-8; format=flowed
Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by
 smtpauth2.wiscmail.wisc.edu
 (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug
 30 2012)) id <0MST00K00NUZF000@smtpauth2.wiscmail.wisc.edu>; Sun,
 08 Sep 2013 14:42:16 -0500 (CDT)
X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014,
 Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.9.8.193024,
 SenderIP=0.0.0.0
X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0
Received: from comporellon.tachypleus.net
 (adsl-76-208-67-185.dsl.mdsnwi.sbcglobal.net [76.208.67.185])
 by smtpauth2.wiscmail.wisc.edu
 (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug
 30 2012)) with ESMTPSA id <0MST00EUHO2FLN00@smtpauth2.wiscmail.wisc.edu>; Sun,
 08 Sep 2013 14:42:16 -0500 (CDT)
Message-id: <522CD317.1090605@freebsd.org>
Date: Sun, 08 Sep 2013 14:42:15 -0500
From: Nathan Whitehorn <nwhitehorn@freebsd.org>
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130810
 Thunderbird/17.0.8
To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@des.no>
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
References: <201309080946.r889kNSX050568@svn.freebsd.org>
 <86wqmrfx1l.fsf@nine.des.no>
In-reply-to: <86wqmrfx1l.fsf@nine.des.no>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, powerpc@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 19:42:18 -0000

On 09/08/13 05:05, Dag-Erling Smørgrav wrote:
> Dag-Erling SmXXrgrav <des@FreeBSD.org> writes:
>> Log:
>>    Add a stock libmap32.conf for amd64.  The first two lines have no effect
>>    except to document the hardcoded standard library search path for 32-bit
>>    binaries.  The third line performs the equivalent substitution for the
>>    private library directory.
> powerpc64 probably needs this as well, but I know next to nothing about
> it and have no way of testing it.
>
> How to test:
>
> % svn co -r255386 svn://svn.freebsd.org/base/head libprivate
> % cd libprivate
> % make TARGET=foo64 buildworld
> % sudo mkdir /foo64
> % sudo make TARGET=foo64 installworld DESTDIR=/foo64
> % sudo make TARGET=foo64 -C etc distribution DESTDIR=/foo64
> % make TARGET=foo32 buildworld
> % sudo mkdir /foo64/32
> % sudo make TARGET=foo32 installworld DESTDIR=/foo64/32
> % sudo mount -t dev dev /foo64/dev
> % sudo chroot /foo64 /bin/sh
> % ldd /32/usr/bin/ssh
>
> With libmap32.conf in place, this should show that libssh.so.5 resolves
> to /usr/lib32/private/libssh.so.5; otherwise, it will show up as not
> found.
>
> (r255386 is the revision that made libssh private, prior to which there
> was no practical need for this mapping)
>
> DES

That works perfectly well on my powerpc64 box -- the binary's libraries 
and the executable runs flawlessly. Why is your stock libmap32.conf 
stuck in etc.amd64? It should be MI for all 64-bit platforms that 
support 32-bit binaries.
-Nathan

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 19:48:07 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1A397B00;
 Sun,  8 Sep 2013 19:48:07 +0000 (UTC)
 (envelope-from edschouten@gmail.com)
Received: from mail-vc0-x22c.google.com (mail-vc0-x22c.google.com
 [IPv6:2607:f8b0:400c:c03::22c])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9510C2DBB;
 Sun,  8 Sep 2013 19:48:06 +0000 (UTC)
Received: by mail-vc0-f172.google.com with SMTP id m17so3494828vca.31
 for <multiple recipients>; Sun, 08 Sep 2013 12:48:05 -0700 (PDT)
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=+bn4SOt497wLoEtVb5P+fiXJD4FkcG6r0n8NxzgNkJg=;
 b=Ika+6saQJ7whCxOeBEQu6TOuuA0XQSAjHtTjaKfMTIgIp1vobRphG/mSn4n74J/D35
 v/frQwHw21O8lH5pVvOVtAUUcrAfXwV4SOs0nn8O9sGHmNQN3FPwB5rOpPGaf7l9BLbQ
 HkX2mDsY5bMwBhNjBITpCyhZkat9XIapS8lBAbzHqsT4XyUOtiEUCKfE30rIM4GF1I7K
 SdQacXIaEyVOdwJVbblwGMXDGWEfgs4kECKiU9Uqss0BohHlioHRgX6JgKJ+BTnbcWI3
 oGolYlN5e5jjU+VJF8C8W2iugjt31g4BFtA04qC1K2UBOE+VtTNyRLpvYrhsxH31+Daw
 D3OQ==
MIME-Version: 1.0
X-Received: by 10.58.108.74 with SMTP id hi10mr14271400veb.14.1378669685720;
 Sun, 08 Sep 2013 12:48:05 -0700 (PDT)
Sender: edschouten@gmail.com
Received: by 10.220.115.206 with HTTP; Sun, 8 Sep 2013 12:48:05 -0700 (PDT)
In-Reply-To: <CACYV=-HwAPFMUheOPPY=trN9U4y+S=TU2iR6TrHgyTx5ZZcnpg@mail.gmail.com>
References: <201309071350.r87DoDUb005690@svn.freebsd.org>
 <CAJOYFBDw6n0uo2LBh5LQkAR2K8+rGWYmfF97jJiPHHucKPOwUg@mail.gmail.com>
 <CACYV=-HwAPFMUheOPPY=trN9U4y+S=TU2iR6TrHgyTx5ZZcnpg@mail.gmail.com>
Date: Sun, 8 Sep 2013 21:48:05 +0200
X-Google-Sender-Auth: OB5-ggZBTdTIy73o2KwZMOqdxNE
Message-ID: <CAJOYFBB6RNr_j6PpT92TXgocFokFLOJyoNWkm7voqbbCmBRd=g@mail.gmail.com>
Subject: Re: svn commit: r255360 - head/sys/net
From: Ed Schouten <ed@80386.nl>
To: Davide Italiano <davide@freebsd.org>
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 19:48:07 -0000

2013/9/8 Davide Italiano <davide@freebsd.org>:
> As a side note, I've already discussed with Kostik how to handle this
> in the future and he thinks (and I agree) that the right action there
> is to remove clones and SI_CHEAPCLONE, or implement the real
> SI_CHEAPCLONE semantic.

Yes. Exactly. I've also noticed that if we get rid of this, we can
also get rid of a couple of members of cdevsw and cdev. Right now it
has to keep track of a couple of lists here and there that are
actually only needed when using clonelists.

If you get rid of clonelists, you'll end up with a system where the
only relationship between cdevsws and devs is the pointer in the cdev
to the cdevsw.

-- 
Ed Schouten <ed@80386.nl>

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 19:59:54 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8874ADFE;
 Sun,  8 Sep 2013 19:59:54 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 42FC32E1C;
 Sun,  8 Sep 2013 19:59:54 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id 218674CB9;
 Sun,  8 Sep 2013 19:59:53 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id 9BDC236117; Sun,  8 Sep 2013 21:59:56 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: Konstantin Belousov <kostikbel@gmail.com>
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
References: <201309080946.r889kNSX050568@svn.freebsd.org>
 <20130908110410.GZ41229@kib.kiev.ua> <86zjrnedp5.fsf@nine.des.no>
 <20130908143854.GA41229@kib.kiev.ua>
Date: Sun, 08 Sep 2013 21:59:55 +0200
In-Reply-To: <20130908143854.GA41229@kib.kiev.ua> (Konstantin Belousov's
 message of "Sun, 8 Sep 2013 17:38:54 +0300")
Message-ID: <86ioybozic.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 19:59:54 -0000

How about this, which eliminates the unneeded mappings and installs
libmap32.conf on powerpc64 as well?

Index: etc/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- etc/Makefile	(revision 255393)
+++ etc/Makefile	(working copy)
@@ -50,8 +50,8 @@
 	syslog.conf \
 	termcap.small
=20
-.if ${MACHINE} =3D=3D "amd64"
-BIN1+=3D	etc.${MACHINE}/libmap32.conf
+.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64"
+BIN1+=3D	libmap32.conf
 .endif
=20
 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
Index: etc/libmap32.conf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- etc/libmap32.conf	(revision 255393)
+++ etc/libmap32.conf	(working copy)
@@ -1,4 +1,2 @@
 # $FreeBSD$
-/lib			/lib32
-/usr/lib		/usr/lib32
 /usr/lib/private	/usr/lib32/private
Index: etc/etc.amd64/libmap32.conf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- etc/etc.amd64/libmap32.conf	(revision 255393)
+++ etc/etc.amd64/libmap32.conf	(working copy)
@@ -1,4 +0,0 @@
-# $FreeBSD$
-/lib			/lib32
-/usr/lib		/usr/lib32
-/usr/lib/private	/usr/lib32/private

We should have a knob that says "this arch supports 32-bit emulation" so
we don't have to edit a million files when somebody implements 32-bit
emulation on a new arch (such as mips64 or arm64).

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 20:18:50 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7776348C;
 Sun,  8 Sep 2013 20:18:50 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 2F3882F00;
 Sun,  8 Sep 2013 20:18:50 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id 6DD034CEF;
 Sun,  8 Sep 2013 20:18:49 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id 0258B36128; Sun,  8 Sep 2013 22:18:22 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: David Chisnall <theraven@FreeBSD.org>
Subject: Re: svn commit: r255321 - in head:
 contrib/llvm/tools/clang/lib/Driver gnu/lib gnu/usr.bin/cc share/mk sys/sys
 tools/build/options
References: <201309062008.r86K836C048843@svn.freebsd.org>
Date: Sun, 08 Sep 2013 22:18:22 +0200
In-Reply-To: <201309062008.r86K836C048843@svn.freebsd.org> (David Chisnall's
 message of "Fri, 6 Sep 2013 20:08:03 +0000 (UTC)")
Message-ID: <86a9jnoynl.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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, dim@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 20:18:50 -0000

David Chisnall <theraven@FreeBSD.org> writes:
> Log:
>   On platforms where clang is the default compiler, don't build gcc or li=
bstdc++.

This uncovers what I think is a bug in bsd.prog.mk:

des@ds4 /usr/src/usr.bin% make
=3D=3D=3D> alias (all)
=3D=3D=3D> apply (all)
=3D=3D=3D> ar (all)
=3D=3D=3D> asa (all)
=3D=3D=3D> at (all)
=3D=3D=3D> atf (all)
=3D=3D=3D> atf/atf-config (all)
make[2]: /usr/obj/usr/src/usr.bin/atf/atf-config/.depend, 111: ignoring sta=
le .depend for /usr/obj/usr/src/tmp/usr/lib/libstdc++.a
c++ -O2 -pipe -march=3Dnative -DGDB=3D\"gdb\" -DHAVE_CONFIG_H -I/usr/src/us=
r.bin/atf/atf-config/../../../contrib/atf -g -Qunused-arguments -fstack-pro=
tector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parame=
ter -Wpointer-arith -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int=
 -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno=
-unused-function -Wno-conversion -Wno-c++11-extensions -g  -o atf-config at=
f-config.o -latf-c++ -latf-c
des@ds4 /usr/src/usr.bin% grep libstdc /usr/obj/usr/src/usr.bin/atf/atf-con=
fig/.depend=20
atf-config: /usr/obj/usr/src/tmp/usr/lib/libstdc++.a
des@ds4 /usr/src/usr.bin% stat /usr/obj/usr/src/tmp/usr/lib/libstdc++.a
stat: /usr/obj/usr/src/tmp/usr/lib/libstdc++.a: stat: No such file or direc=
tory

That line was added by bsd.prog.mk:

.if defined(PROG_CXX)
.if !empty(CXXFLAGS:M-stdlib=3Dlibc++)
        echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
.else
        echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}
.endif
.endif

AFAICT, this logic should be inverted on platforms where clang is the
default compiler - perhaps like this:

Index: share/mk/bsd.prog.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- share/mk/bsd.prog.mk	(revision 255393)
+++ share/mk/bsd.prog.mk	(working copy)
@@ -173,7 +173,7 @@
 .else
 	echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE}
 .if defined(PROG_CXX)
-.if !empty(CXXFLAGS:M-stdlib=3Dlibc++)
+.if ${MK_CLANG_IS_CC} !=3D "no" || !empty(CXXFLAGS:M-stdlib=3Dlibc++)
 	echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
 .else
 	echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}

although this misses the case where CLANG_IS_CC but we still want the
old libstdc++ - is that even possible?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 20:30:52 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CF1FA6CF;
 Sun,  8 Sep 2013 20:30:52 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8ED972F96;
 Sun,  8 Sep 2013 20:30:52 +0000 (UTC)
Received: from [192.168.0.2]
 (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236])
 (authenticated bits=0)
 by theravensnest.org (8.14.5/8.14.5) with ESMTP id r88KUlnv090948
 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
 Sun, 8 Sep 2013 20:30:48 GMT (envelope-from theraven@FreeBSD.org)
Content-Type: text/plain; charset=iso-8859-1
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
Subject: Re: svn commit: r255321 - in head:
 contrib/llvm/tools/clang/lib/Driver gnu/lib gnu/usr.bin/cc share/mk sys/sys
 tools/build/options
From: David Chisnall <theraven@FreeBSD.org>
In-Reply-To: <86a9jnoynl.fsf@nine.des.no>
Date: Sun, 8 Sep 2013 21:30:42 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <B9169D3D-1F3A-46B9-835E-5B3D592D18C7@FreeBSD.org>
References: <201309062008.r86K836C048843@svn.freebsd.org>
 <86a9jnoynl.fsf@nine.des.no>
To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
X-Mailer: Apple Mail (2.1508)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, dim@FreeBSD.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 20:30:53 -0000


On 8 Sep 2013, at 21:18, Dag-Erling Sm=F8rgrav <des@des.no> wrote:

> David Chisnall <theraven@FreeBSD.org> writes:
>> Log:
>>  On platforms where clang is the default compiler, don't build gcc or =
libstdc++.
>=20
> This uncovers what I think is a bug in bsd.prog.mk:
>=20
> des@ds4 /usr/src/usr.bin% make
> =3D=3D=3D> alias (all)
> =3D=3D=3D> apply (all)
> =3D=3D=3D> ar (all)
> =3D=3D=3D> asa (all)
> =3D=3D=3D> at (all)
> =3D=3D=3D> atf (all)
> =3D=3D=3D> atf/atf-config (all)
> make[2]: /usr/obj/usr/src/usr.bin/atf/atf-config/.depend, 111: =
ignoring stale .depend for /usr/obj/usr/src/tmp/usr/lib/libstdc++.a
> c++ -O2 -pipe -march=3Dnative -DGDB=3D\"gdb\" -DHAVE_CONFIG_H =
-I/usr/src/usr.bin/atf/atf-config/../../../contrib/atf -g =
-Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall =
-Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith =
-Wno-uninitialized -Wno-empty-body -Wno-string-plus-int =
-Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality =
-Wno-unused-function -Wno-conversion -Wno-c++11-extensions -g  -o =
atf-config atf-config.o -latf-c++ -latf-c
> des@ds4 /usr/src/usr.bin% grep libstdc =
/usr/obj/usr/src/usr.bin/atf/atf-config/.depend=20
> atf-config: /usr/obj/usr/src/tmp/usr/lib/libstdc++.a
> des@ds4 /usr/src/usr.bin% stat =
/usr/obj/usr/src/tmp/usr/lib/libstdc++.a
> stat: /usr/obj/usr/src/tmp/usr/lib/libstdc++.a: stat: No such file or =
directory
>=20
> That line was added by bsd.prog.mk:
>=20
> .if defined(PROG_CXX)
> .if !empty(CXXFLAGS:M-stdlib=3Dlibc++)
>        echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
> .else
>        echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}
> .endif
> .endif
>=20
> AFAICT, this logic should be inverted on platforms where clang is the
> default compiler - perhaps like this:
>=20
> Index: share/mk/bsd.prog.mk
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- share/mk/bsd.prog.mk	(revision 255393)
> +++ share/mk/bsd.prog.mk	(working copy)
> @@ -173,7 +173,7 @@
> .else
> 	echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE}
> .if defined(PROG_CXX)
> -.if !empty(CXXFLAGS:M-stdlib=3Dlibc++)
> +.if ${MK_CLANG_IS_CC} !=3D "no" || !empty(CXXFLAGS:M-stdlib=3Dlibc++)
> 	echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
> .else
> 	echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}
>=20
> although this misses the case where CLANG_IS_CC but we still want the
> old libstdc++ - is that even possible?

This case is possible with -stdlib=3Dlibstdc++, so similar logic should =
apply.  I think it should say:

.if ${MK_CLANG_IS_CC} !=3D "no" && empty(CXXFLAGS:M-stdlib=3Dlibstdc++)
	echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
.else
	echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}

David


From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 20:48:24 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 69F72D5B;
 Sun,  8 Sep 2013 20:48:24 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 55E76208F;
 Sun,  8 Sep 2013 20:48:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88KmOGt050816;
 Sun, 8 Sep 2013 20:48:24 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88KmO7c050815;
 Sun, 8 Sep 2013 20:48:24 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309082048.r88KmO7c050815@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Sun, 8 Sep 2013 20:48:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255405 - head/usr.bin
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 20:48:24 -0000

Author: des
Date: Sun Sep  8 20:48:23 2013
New Revision: 255405
URL: http://svnweb.freebsd.org/changeset/base/255405

Log:
  Hook host(1) up to the build in the LDNS case.
  
  Approved by:	re (blanket)

Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==============================================================================
--- head/usr.bin/Makefile	Sun Sep  8 19:50:26 2013	(r255404)
+++ head/usr.bin/Makefile	Sun Sep  8 20:48:23 2013	(r255405)
@@ -262,6 +262,10 @@ SUBDIR+=        truss
 SUBDIR+=	compile_et
 .endif
 
+.if ${MK_LDNS_UTILS} != "no"
+SUBDIR+=	host
+.endif
+
 .if ${MK_LIBTHR} != "no"
 SUBDIR+=	csup
 .endif

From owner-svn-src-all@FreeBSD.ORG  Sun Sep  8 21:30:53 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BBB07E54;
 Sun,  8 Sep 2013 21:30:53 +0000 (UTC) (envelope-from alc@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 99CE922D1;
 Sun,  8 Sep 2013 21:30:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88LUrTP076721;
 Sun, 8 Sep 2013 21:30:53 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88LUrnf076720;
 Sun, 8 Sep 2013 21:30:53 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201309082130.r88LUrnf076720@svn.freebsd.org>
From: Alan Cox <alc@FreeBSD.org>
Date: Sun, 8 Sep 2013 21:30:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255409 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Sep 2013 21:30:53 -0000

Author: alc
Date: Sun Sep  8 21:30:53 2013
New Revision: 255409
URL: http://svnweb.freebsd.org/changeset/base/255409

Log:
  Prior to r254304, we only began scanning the active page queue when the
  amount of free memory was close to the point at which we would begin
  reclaiming pages.  Now, we continuously scan the active page queue,
  regardless of the amount of free memory.  Consequently, we are continuously
  calling pmap_ts_referenced() on active pages.
  
  Prior to this change, pmap_ts_referenced() would always demote superpage
  mappings in order to obtain finer-grained reference information.  This made
  sense because we were coming under memory pressure and would soon have to
  begin reclaiming pages.  Now, however, with continuous scanning of the
  active page queue, these demotions are taking a toll on performance.  For
  example, on one of my test machines, the running time for the HPCC Random
  Access benchmark (also known as GUPS) has increased by 54%.  To address this
  problem, I have replaced the demotion with a heuristic for periodically
  clearing the reference flag on superpage mappings.
  
  Reviewed by:	kib
  Approved by:	re (glebius)
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sun Sep  8 21:10:48 2013	(r255408)
+++ head/sys/amd64/amd64/pmap.c	Sun Sep  8 21:30:53 2013	(r255409)
@@ -2900,8 +2900,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e
 	oldpde = *pde;
 	KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V),
 	    ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V"));
-	mpte = pmap_lookup_pt_page(pmap, va);
-	if (mpte != NULL)
+	if ((oldpde & PG_A) != 0 && (mpte = pmap_lookup_pt_page(pmap, va)) !=
+	    NULL)
 		pmap_remove_pt_page(pmap, mpte);
 	else {
 		KASSERT((oldpde & PG_W) == 0,
@@ -5046,6 +5046,8 @@ retry:
 	rw_runlock(&pvh_global_lock);
 }
 
+#define	PMAP_TS_REFERENCED_MAX	5
+
 /*
  *	pmap_ts_referenced:
  *
@@ -5062,25 +5064,29 @@ int
 pmap_ts_referenced(vm_page_t m)
 {
 	struct md_page *pvh;
-	pv_entry_t pv, pvf, pvn;
+	pv_entry_t pv, pvf;
 	pmap_t pmap;
 	struct rwlock *lock;
-	pd_entry_t oldpde, *pde;
+	pd_entry_t *pde;
 	pt_entry_t *pte;
-	vm_offset_t va;
-	int rtval, pvh_gen, md_gen;
+	vm_paddr_t pa;
+	int cleared, md_gen, not_cleared, pvh_gen;
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_ts_referenced: page %p is not managed", m));
+	cleared = 0;
+	pa = VM_PAGE_TO_PHYS(m);
+	lock = PHYS_TO_PV_LIST_LOCK(pa);
+	pvh = pa_to_pvh(pa);
 	rw_rlock(&pvh_global_lock);
-	lock = VM_PAGE_TO_PV_LIST_LOCK(m);
-	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
-	rtval = 0;
 	rw_wlock(lock);
 retry:
-	if ((m->flags & PG_FICTITIOUS) != 0)
+	not_cleared = 0;
+	if ((m->flags & PG_FICTITIOUS) != 0 ||
+	    (pvf = TAILQ_FIRST(&pvh->pv_list)) == NULL)
 		goto small_mappings;
-	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, pvn) {
+	pv = pvf;
+	do {
 		pmap = PV_PMAP(pv);
 		if (!PMAP_TRYLOCK(pmap)) {
 			pvh_gen = pvh->pv_gen;
@@ -5092,78 +5098,85 @@ retry:
 				goto retry;
 			}
 		}
-		va = pv->pv_va;
-		pde = pmap_pde(pmap, va);
-		oldpde = *pde;
-		if ((oldpde & PG_A) != 0) {
-			if (pmap_demote_pde_locked(pmap, pde, va, &lock)) {
-				if ((oldpde & PG_W) == 0) {
-					/*
-					 * Remove the mapping to a single page
-					 * so that a subsequent access may
-					 * repromote.  Since the underlying
-					 * page table page is fully populated,
-					 * this removal never frees a page
-					 * table page.
-					 */
-					va += VM_PAGE_TO_PHYS(m) - (oldpde &
-					    PG_PS_FRAME);
-					pte = pmap_pde_to_pte(pde, va);
-					pmap_remove_pte(pmap, pte, va, *pde,
-					    NULL, &lock);
-					pmap_invalidate_page(pmap, va);
-					rtval++;
-					if (rtval > 4) {
-						PMAP_UNLOCK(pmap);
-						goto out;
-					}
-				}
-			}
-			KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m),
-			    ("inconsistent pv lock %p %p for page %p",
-			    lock, VM_PAGE_TO_PV_LIST_LOCK(m), m));
+		pde = pmap_pde(pmap, pv->pv_va);
+		if ((*pde & PG_A) != 0) {
+			/*
+			 * Since this reference bit is shared by 512 4KB
+			 * pages, it should not be cleared every time it is
+			 * tested.  Apply a simple "hash" function on the
+			 * physical page number, the virtual superpage number,
+			 * and the pmap address to select one 4KB page out of
+			 * the 512 on which testing the reference bit will
+			 * result in clearing that reference bit.  This
+			 * function is designed to avoid the selection of the
+			 * same 4KB page for every 2MB page mapping.
+			 *
+			 * On demotion, a mapping that hasn't been referenced
+			 * is simply destroyed.  To avoid the possibility of a
+			 * subsequent page fault on a demoted wired mapping,
+			 * always leave its reference bit set.  Moreover,
+			 * since the superpage is wired, the current state of
+			 * its reference bit won't affect page replacement.
+			 */
+			if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> PDRSHIFT) ^
+			    (uintptr_t)pmap) & (NPTEPG - 1)) == 0 &&
+			    (*pde & PG_W) == 0) {
+				atomic_clear_long(pde, PG_A);
+				pmap_invalidate_page(pmap, pv->pv_va);
+				cleared++;
+			} else
+				not_cleared++;
 		}
 		PMAP_UNLOCK(pmap);
-	}
+		/* Rotate the PV list if it has more than one entry. */
+		if (TAILQ_NEXT(pv, pv_next) != NULL) {
+			TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);
+			TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next);
+			pvh->pv_gen++;
+		}
+		if (cleared + not_cleared >= PMAP_TS_REFERENCED_MAX)
+			goto out;
+	} while ((pv = TAILQ_FIRST(&pvh->pv_list)) != pvf);
 small_mappings:
-	if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
-		pvf = pv;
-		do {
-			pvn = TAILQ_NEXT(pv, pv_next);
+	if ((pvf = TAILQ_FIRST(&m->md.pv_list)) == NULL)
+		goto out;
+	pv = pvf;
+	do {
+		pmap = PV_PMAP(pv);
+		if (!PMAP_TRYLOCK(pmap)) {
+			pvh_gen = pvh->pv_gen;
+			md_gen = m->md.pv_gen;
+			rw_wunlock(lock);
+			PMAP_LOCK(pmap);
+			rw_wlock(lock);
+			if (pvh_gen != pvh->pv_gen || md_gen != m->md.pv_gen) {
+				PMAP_UNLOCK(pmap);
+				goto retry;
+			}
+		}
+		pde = pmap_pde(pmap, pv->pv_va);
+		KASSERT((*pde & PG_PS) == 0,
+		    ("pmap_ts_referenced: found a 2mpage in page %p's pv list",
+		    m));
+		pte = pmap_pde_to_pte(pde, pv->pv_va);
+		if ((*pte & PG_A) != 0) {
+			atomic_clear_long(pte, PG_A);
+			pmap_invalidate_page(pmap, pv->pv_va);
+			cleared++;
+		}
+		PMAP_UNLOCK(pmap);
+		/* Rotate the PV list if it has more than one entry. */
+		if (TAILQ_NEXT(pv, pv_next) != NULL) {
 			TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
 			TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
 			m->md.pv_gen++;
-			pmap = PV_PMAP(pv);
-			if (!PMAP_TRYLOCK(pmap)) {
-				pvh_gen = pvh->pv_gen;
-				md_gen = m->md.pv_gen;
-				rw_wunlock(lock);
-				PMAP_LOCK(pmap);
-				rw_wlock(lock);
-				if (pvh_gen != pvh->pv_gen ||
-				    md_gen != m->md.pv_gen) {
-					PMAP_UNLOCK(pmap);
-					goto retry;
-				}
-			}
-			pde = pmap_pde(pmap, pv->pv_va);
-			KASSERT((*pde & PG_PS) == 0, ("pmap_ts_referenced:"
-			    " found a 2mpage in page %p's pv list", m));
-			pte = pmap_pde_to_pte(pde, pv->pv_va);
-			if ((*pte & PG_A) != 0) {
-				atomic_clear_long(pte, PG_A);
-				pmap_invalidate_page(pmap, pv->pv_va);
-				rtval++;
-				if (rtval > 4)
-					pvn = NULL;
-			}
-			PMAP_UNLOCK(pmap);
-		} while ((pv = pvn) != NULL && pv != pvf);
-	}
+		}
+	} while ((pv = TAILQ_FIRST(&m->md.pv_list)) != pvf && cleared +
+	    not_cleared < PMAP_TS_REFERENCED_MAX);
 out:
 	rw_wunlock(lock);
 	rw_runlock(&pvh_global_lock);
-	return (rtval);
+	return (cleared + not_cleared);
 }
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 00:17:00 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 69CE5280;
 Mon,  9 Sep 2013 00:17:00 +0000 (UTC) (envelope-from np@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 579F628D2;
 Mon,  9 Sep 2013 00:17:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r890H08w075367;
 Mon, 9 Sep 2013 00:17:00 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r890H0eP075364;
 Mon, 9 Sep 2013 00:17:00 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201309090017.r890H0eP075364@svn.freebsd.org>
From: Navdeep Parhar <np@FreeBSD.org>
Date: Mon, 9 Sep 2013 00:17:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255410 - head/sys/dev/cxgbe/tom
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 00:17:00 -0000

Author: np
Date: Mon Sep  9 00:16:59 2013
New Revision: 255410
URL: http://svnweb.freebsd.org/changeset/base/255410

Log:
  Fix a miscalculation that caused cxgbe/tom to auto-increment
  a TOE socket's tx buffer size too aggressively.
  
  Approved by:	re (delphij)

Modified:
  head/sys/dev/cxgbe/tom/t4_cpl_io.c

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c	Sun Sep  8 21:30:53 2013	(r255409)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c	Mon Sep  9 00:16:59 2013	(r255410)
@@ -604,7 +604,7 @@ t4_push_frames(struct adapter *sc, struc
 		if (sb->sb_flags & SB_AUTOSIZE &&
 		    V_tcp_do_autosndbuf &&
 		    sb->sb_hiwat < V_tcp_autosndbuf_max &&
-		    sbspace(sb) < sb->sb_hiwat / 8 * 7) {
+		    sbspace(sb) < sb->sb_hiwat / 8) {
 			int newsize = min(sb->sb_hiwat + V_tcp_autosndbuf_inc,
 			    V_tcp_autosndbuf_max);
 

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 04:28:47 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 082FD764;
 Mon,  9 Sep 2013 04:28:47 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 999672397;
 Mon,  9 Sep 2013 04:28:46 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r894SfjP055169;
 Mon, 9 Sep 2013 07:28:41 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r894SfjP055169
Received: (from kostik@localhost)
 by tom.home (8.14.7/8.14.7/Submit) id r894Sfd7055168;
 Mon, 9 Sep 2013 07:28:41 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Mon, 9 Sep 2013 07:28:41 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: Dag-Erling Sm??rgrav <des@des.no>
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
Message-ID: <20130909042841.GE41229@kib.kiev.ua>
References: <201309080946.r889kNSX050568@svn.freebsd.org>
 <20130908110410.GZ41229@kib.kiev.ua> <86zjrnedp5.fsf@nine.des.no>
 <20130908143854.GA41229@kib.kiev.ua> <86ioybozic.fsf@nine.des.no>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="iqMm74K5rg2eMP7U"
Content-Disposition: inline
In-Reply-To: <86ioybozic.fsf@nine.des.no>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 04:28:47 -0000


--iqMm74K5rg2eMP7U
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 08, 2013 at 09:59:55PM +0200, Dag-Erling Sm??rgrav wrote:
> How about this, which eliminates the unneeded mappings and installs
> libmap32.conf on powerpc64 as well?
>=20
> Index: etc/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- etc/Makefile	(revision 255393)
> +++ etc/Makefile	(working copy)
> @@ -50,8 +50,8 @@
>  	syslog.conf \
>  	termcap.small
> =20
> -.if ${MACHINE} =3D=3D "amd64"
> -BIN1+=3D	etc.${MACHINE}/libmap32.conf
> +.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64"
> +BIN1+=3D	libmap32.conf
>  .endif
> =20
>  .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
> Index: etc/libmap32.conf
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- etc/libmap32.conf	(revision 255393)
> +++ etc/libmap32.conf	(working copy)
> @@ -1,4 +1,2 @@
>  # $FreeBSD$
> -/lib			/lib32
> -/usr/lib		/usr/lib32
>  /usr/lib/private	/usr/lib32/private
> Index: etc/etc.amd64/libmap32.conf
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- etc/etc.amd64/libmap32.conf	(revision 255393)
> +++ etc/etc.amd64/libmap32.conf	(working copy)
> @@ -1,4 +0,0 @@
> -# $FreeBSD$
> -/lib			/lib32
> -/usr/lib		/usr/lib32
> -/usr/lib/private	/usr/lib32/private
This looks fine.

>=20
> We should have a knob that says "this arch supports 32-bit emulation" so
> we don't have to edit a million files when somebody implements 32-bit
> emulation on a new arch (such as mips64 or arm64).
>=20
The knob does not exists probably because there is the build32 stage.

Are you going to remove COMPAT_32BIT conditional from the rtld.c ?

--iqMm74K5rg2eMP7U
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQIcBAEBAgAGBQJSLU54AAoJEJDCuSvBvK1BR1MQAIa7mReJh9K4I0DrnxiTTnpp
bZIWVlk55PEdRm/VV/x2kx0MTPnDmgY4PcPEVU6ph67slzA4qw1eE8/lC0cNYA9D
KkrRirm/lY5vV2A5BN9qA2GW1kn2qsDHfBT2NhckGyG3mI5lRbplETLzTNXnSvka
/rBVl/qDgFKOeS1emNFx+BSMHJ27hwuHSQwZ+33v2mE8GCKypIML5BQFs6rs1/5N
ZMktIyTW9zDlIDxlHEiYjxXriqJFkNK5APPM80CMx57PfjF4sSmbVvMCJhhqD2t2
iMrNPKe9C1l0kj4vJFjRac9fLCPocJBzGgP7X3BKhg9tE9xP/oUufAWb1ygmGmuH
ijWt3tNoc6l9YV5amrk1KBlmSV9DTKHcj0PWzrAAlrgLLSHkjHr2xNVYDJ7v16Sl
IZHj8wfEyXsQ0os6H7IKrAh6KfEGPS2p25fDRkutR0TOgcn8v/VBPMxZbcsNk3nn
rDNvwS9GIyvwVASKwdijYZlhZ+E78OzA94BuK/q7UGtkOZoysFGs4WQpAsWyUAGI
YqOWuv99xSm/RFplhrPkxcWXdnZFJlhMh/LC9Zy07qkru0gOjaDO8QOyD6dN8f/g
BNpoIFQC87/Ff+MEH2S8VUQRvUG0182jTdj0o8h9T17sQmza4LDWtfpZn5I0xkX9
f+QoP88Ll1Dz2FLmk4Zd
=KZBQ
-----END PGP SIGNATURE-----

--iqMm74K5rg2eMP7U--

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 04:38:58 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id D3CEF930;
 Mon,  9 Sep 2013 04:38:58 +0000 (UTC) (envelope-from np@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C19522403;
 Mon,  9 Sep 2013 04:38:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r894cw1U030124;
 Mon, 9 Sep 2013 04:38:58 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r894cwOv030121;
 Mon, 9 Sep 2013 04:38:58 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201309090438.r894cwOv030121@svn.freebsd.org>
From: Navdeep Parhar <np@FreeBSD.org>
Date: Mon, 9 Sep 2013 04:38:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255411 - head/sys/dev/cxgbe/tom
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 04:38:58 -0000

Author: np
Date: Mon Sep  9 04:38:57 2013
New Revision: 255411
URL: http://svnweb.freebsd.org/changeset/base/255411

Log:
  Rework the tx credit mechanism between the cxgbe/tom driver
  and the card.  This helps smooth out some burstiness in the
  exchange.
  
  Approved by:	re (glebius)

Modified:
  head/sys/dev/cxgbe/tom/t4_cpl_io.c
  head/sys/dev/cxgbe/tom/t4_tom.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c	Mon Sep  9 00:16:59 2013	(r255410)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c	Mon Sep  9 04:38:57 2013	(r255411)
@@ -444,22 +444,12 @@ max_dsgl_nsegs(int tx_credits)
 
 static inline void
 write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen,
-    unsigned int plen, uint8_t credits, int more_to_come)
+    unsigned int plen, uint8_t credits, int shove)
 {
 	struct fw_ofld_tx_data_wr *txwr = dst;
-	int shove = !more_to_come;
-	int compl = 1;
-
-	/*
-	 * We always request completion notifications from the firmware.  The
-	 * only exception is when we know we'll get more data to send shortly
-	 * and that we'll have some tx credits remaining to transmit that data.
-	 */
-	if (more_to_come && toep->tx_credits - credits >= MIN_OFLD_TX_CREDITS)
-		compl = 0;
 
 	txwr->op_to_immdlen = htobe32(V_WR_OP(FW_OFLD_TX_DATA_WR) |
-	    V_FW_WR_COMPL(compl) | V_FW_WR_IMMDLEN(immdlen));
+	    V_FW_WR_IMMDLEN(immdlen));
 	txwr->flowid_len16 = htobe32(V_FW_WR_FLOWID(toep->tid) |
 	    V_FW_WR_LEN16(credits));
 	txwr->tunnel_to_proxy =
@@ -529,19 +519,26 @@ write_tx_sgl(void *dst, struct mbuf *sta
  * The socket's so_snd buffer consists of a stream of data starting with sb_mb
  * and linked together with m_next.  sb_sndptr, if set, is the last mbuf that
  * was transmitted.
+ *
+ * drop indicates the number of bytes that should be dropped from the head of
+ * the send buffer.  It is an optimization that lets do_fw4_ack avoid creating
+ * contention on the send buffer lock (before this change it used to do
+ * sowwakeup and then t4_push_frames right after that when recovering from tx
+ * stalls).  When drop is set this function MUST drop the bytes and wake up any
+ * writers.
  */
 static void
-t4_push_frames(struct adapter *sc, struct toepcb *toep)
+t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
 {
 	struct mbuf *sndptr, *m, *sb_sndptr;
 	struct fw_ofld_tx_data_wr *txwr;
 	struct wrqe *wr;
-	unsigned int plen, nsegs, credits, max_imm, max_nsegs, max_nsegs_1mbuf;
+	u_int plen, nsegs, credits, max_imm, max_nsegs, max_nsegs_1mbuf;
 	struct inpcb *inp = toep->inp;
 	struct tcpcb *tp = intotcpcb(inp);
 	struct socket *so = inp->inp_socket;
 	struct sockbuf *sb = &so->so_snd;
-	int tx_credits;
+	int tx_credits, shove, compl, space, sowwakeup;
 	struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx];
 
 	INP_WLOCK_ASSERT(inp);
@@ -557,8 +554,11 @@ t4_push_frames(struct adapter *sc, struc
 	 * This function doesn't resume by itself.  Someone else must clear the
 	 * flag and call this function.
 	 */
-	if (__predict_false(toep->flags & TPF_TX_SUSPENDED))
+	if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) {
+		KASSERT(drop == 0,
+		    ("%s: drop (%d) != 0 but tx is suspended", __func__, drop));
 		return;
+	}
 
 	do {
 		tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS);
@@ -566,6 +566,11 @@ t4_push_frames(struct adapter *sc, struc
 		max_nsegs = max_dsgl_nsegs(tx_credits);
 
 		SOCKBUF_LOCK(sb);
+		sowwakeup = drop;
+		if (drop) {
+			sbdrop_locked(sb, drop);
+			drop = 0;
+		}
 		sb_sndptr = sb->sb_sndptr;
 		sndptr = sb_sndptr ? sb_sndptr->m_next : sb->sb_mb;
 		plen = 0;
@@ -584,7 +589,11 @@ t4_push_frames(struct adapter *sc, struc
 				if (plen == 0) {
 					/* Too few credits */
 					toep->flags |= TPF_TX_SUSPENDED;
-					SOCKBUF_UNLOCK(sb);
+					if (sowwakeup)
+						sowwakeup_locked(so);
+					else
+						SOCKBUF_UNLOCK(sb);
+					SOCKBUF_UNLOCK_ASSERT(sb);
 					return;
 				}
 				break;
@@ -601,23 +610,32 @@ t4_push_frames(struct adapter *sc, struc
 			}
 		}
 
+		shove = m == NULL && !(tp->t_flags & TF_MORETOCOME);
+		space = sbspace(sb);
+
+		if (space <= sb->sb_hiwat * 3 / 8 &&
+		    toep->plen_nocompl + plen >= sb->sb_hiwat / 4)
+			compl = 1;
+		else
+			compl = 0;
+
 		if (sb->sb_flags & SB_AUTOSIZE &&
 		    V_tcp_do_autosndbuf &&
 		    sb->sb_hiwat < V_tcp_autosndbuf_max &&
-		    sbspace(sb) < sb->sb_hiwat / 8) {
+		    space < sb->sb_hiwat / 8) {
 			int newsize = min(sb->sb_hiwat + V_tcp_autosndbuf_inc,
 			    V_tcp_autosndbuf_max);
 
 			if (!sbreserve_locked(sb, newsize, so, NULL))
 				sb->sb_flags &= ~SB_AUTOSIZE;
-			else {
-				sowwakeup_locked(so);	/* room available */
-				SOCKBUF_UNLOCK_ASSERT(sb);
-				goto unlocked;
-			}
+			else
+				sowwakeup = 1;	/* room available */
 		}
-		SOCKBUF_UNLOCK(sb);
-unlocked:
+		if (sowwakeup)
+			sowwakeup_locked(so);
+		else
+			SOCKBUF_UNLOCK(sb);
+		SOCKBUF_UNLOCK_ASSERT(sb);
 
 		/* nothing to send */
 		if (plen == 0) {
@@ -642,9 +660,9 @@ unlocked:
 			}
 			txwr = wrtod(wr);
 			credits = howmany(wr->wr_len, 16);
-			write_tx_wr(txwr, toep, plen, plen, credits,
-			    tp->t_flags & TF_MORETOCOME);
+			write_tx_wr(txwr, toep, plen, plen, credits, shove);
 			m_copydata(sndptr, 0, plen, (void *)(txwr + 1));
+			nsegs = 0;
 		} else {
 			int wr_len;
 
@@ -660,8 +678,7 @@ unlocked:
 			}
 			txwr = wrtod(wr);
 			credits = howmany(wr_len, 16);
-			write_tx_wr(txwr, toep, 0, plen, credits,
-			    tp->t_flags & TF_MORETOCOME);
+			write_tx_wr(txwr, toep, 0, plen, credits, shove);
 			write_tx_sgl(txwr + 1, sndptr, m, nsegs,
 			    max_nsegs_1mbuf);
 			if (wr_len & 0xf) {
@@ -675,6 +692,17 @@ unlocked:
 			("%s: not enough credits", __func__));
 
 		toep->tx_credits -= credits;
+		toep->tx_nocompl += credits;
+		toep->plen_nocompl += plen;
+		if (toep->tx_credits <= toep->tx_total * 3 / 8 &&
+		    toep->tx_nocompl >= toep->tx_total / 4)
+			compl = 1;
+
+		if (compl) {
+			txwr->op_to_immdlen |= htobe32(F_FW_WR_COMPL);
+			toep->tx_nocompl = 0;
+			toep->plen_nocompl = 0;
+		}
 
 		tp->snd_nxt += plen;
 		tp->snd_max += plen;
@@ -685,6 +713,8 @@ unlocked:
 		SOCKBUF_UNLOCK(sb);
 
 		toep->flags |= TPF_TX_DATA_SENT;
+		if (toep->tx_credits < MIN_OFLD_TX_CREDITS)
+			toep->flags |= TPF_TX_SUSPENDED;
 
 		KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__));
 		txsd->plen = plen;
@@ -718,7 +748,7 @@ t4_tod_output(struct toedev *tod, struct
 	    ("%s: inp %p dropped.", __func__, inp));
 	KASSERT(toep != NULL, ("%s: toep is NULL", __func__));
 
-	t4_push_frames(sc, toep);
+	t4_push_frames(sc, toep, 0);
 
 	return (0);
 }
@@ -738,7 +768,8 @@ t4_send_fin(struct toedev *tod, struct t
 	KASSERT(toep != NULL, ("%s: toep is NULL", __func__));
 
 	toep->flags |= TPF_SEND_FIN;
-	t4_push_frames(sc, toep);
+	if (tp->t_state >= TCPS_ESTABLISHED)
+		t4_push_frames(sc, toep, 0);
 
 	return (0);
 }
@@ -1369,7 +1400,16 @@ do_fw4_ack(struct sge_iq *iq, const stru
 		}
 	}
 
-	if (plen > 0) {
+	if (toep->tx_credits == toep->tx_total) {
+		toep->tx_nocompl = 0;
+		toep->plen_nocompl = 0;
+	}
+
+	if (toep->flags & TPF_TX_SUSPENDED &&
+	    toep->tx_credits >= toep->tx_total / 4) {
+		toep->flags &= ~TPF_TX_SUSPENDED;
+		t4_push_frames(sc, toep, plen);
+	} else if (plen > 0) {
 		struct sockbuf *sb = &so->so_snd;
 
 		SOCKBUF_LOCK(sb);
@@ -1378,14 +1418,6 @@ do_fw4_ack(struct sge_iq *iq, const stru
 		SOCKBUF_UNLOCK_ASSERT(sb);
 	}
 
-	/* XXX */
-	if ((toep->flags & TPF_TX_SUSPENDED &&
-	    toep->tx_credits >= MIN_OFLD_TX_CREDITS) ||
-	    toep->tx_credits == toep->txsd_total *
-	    howmany((sizeof(struct fw_ofld_tx_data_wr) + 1), 16)) {
-		toep->flags &= ~TPF_TX_SUSPENDED;
-		t4_push_frames(sc, toep);
-	}
 	INP_WUNLOCK(inp);
 
 	return (0);

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.c	Mon Sep  9 00:16:59 2013	(r255410)
+++ head/sys/dev/cxgbe/tom/t4_tom.c	Mon Sep  9 04:38:57 2013	(r255411)
@@ -148,6 +148,7 @@ alloc_toepcb(struct port_info *pi, int t
 
 	toep->td = sc->tom_softc;
 	toep->port = pi;
+	toep->tx_total = tx_credits;
 	toep->tx_credits = tx_credits;
 	toep->ofld_txq = &sc->sge.ofld_txq[txqid];
 	toep->ofld_rxq = &sc->sge.ofld_rxq[rxqid];

Modified: head/sys/dev/cxgbe/tom/t4_tom.h
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.h	Mon Sep  9 00:16:59 2013	(r255410)
+++ head/sys/dev/cxgbe/tom/t4_tom.h	Mon Sep  9 04:38:57 2013	(r255411)
@@ -99,7 +99,7 @@ struct ddp_buffer {
 
 struct toepcb {
 	TAILQ_ENTRY(toepcb) link; /* toep_list */
-	unsigned int flags;	/* miscellaneous flags */
+	u_int flags;		/* miscellaneous flags */
 	struct tom_data *td;
 	struct inpcb *inp;	/* backpointer to host stack's PCB */
 	struct port_info *port;	/* physical port */
@@ -109,13 +109,20 @@ struct toepcb {
 	struct l2t_entry *l2te;	/* L2 table entry used by this connection */
 	struct clip_entry *ce;	/* CLIP table entry used by this tid */
 	int tid;		/* Connection identifier */
-	unsigned int tx_credits;/* tx WR credits (in 16 byte units) remaining */
-	unsigned int sb_cc;	/* last noted value of so_rcv->sb_cc */
+
+	/* tx credit handling */
+	u_int tx_total;		/* total tx WR credits (in 16B units) */
+	u_int tx_credits;	/* tx WR credits (in 16B units) available */
+	u_int tx_nocompl;	/* tx WR credits since last compl request */
+	u_int plen_nocompl;	/* payload since last compl request */
+
+	/* rx credit handling */
+	u_int sb_cc;		/* last noted value of so_rcv->sb_cc */
 	int rx_credits;		/* rx credits (in bytes) to be returned to hw */
 
-	unsigned int ulp_mode;	/* ULP mode */
+	u_int ulp_mode;	/* ULP mode */
 
-	unsigned int ddp_flags;
+	u_int ddp_flags;
 	struct ddp_buffer *db[2];
 	time_t ddp_disabled;
 	uint8_t ddp_score;

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 05:01:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8164FC28;
 Mon,  9 Sep 2013 05:01:19 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6D0912515;
 Mon,  9 Sep 2013 05:01:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8951Jp6044839;
 Mon, 9 Sep 2013 05:01:19 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8951J9V044838;
 Mon, 9 Sep 2013 05:01:19 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309090501.r8951J9V044838@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Mon, 9 Sep 2013 05:01:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255412 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 05:01:19 -0000

Author: delphij
Date: Mon Sep  9 05:01:18 2013
New Revision: 255412
URL: http://svnweb.freebsd.org/changeset/base/255412

Log:
  In r243868, the error message buffer errmsg have been changed from
  an on-stack array to a pointer and therefore sizeof(errmsg) would
  become 4 or 8 bytes depending on the architecture.
  
  Fix this by using ERRMSGL in place of sizeof().
  
  Submitted by:	J David <j.david.lists@gmail.com>
  MFC after:	3 days
  Approved by:	re (kib)

Modified:
  head/sys/kern/vfs_mountroot.c

Modified: head/sys/kern/vfs_mountroot.c
==============================================================================
--- head/sys/kern/vfs_mountroot.c	Mon Sep  9 04:38:57 2013	(r255411)
+++ head/sys/kern/vfs_mountroot.c	Mon Sep  9 05:01:18 2013	(r255412)
@@ -710,7 +710,7 @@ parse_mount(char **conf)
 	errmsg = malloc(ERRMSGL, M_TEMP, M_WAITOK | M_ZERO);
 
 	if (vfs_byname(fs) == NULL) {
-		strlcpy(errmsg, "unknown file system", sizeof(errmsg));
+		strlcpy(errmsg, "unknown file system", ERRMSGL);
 		error = ENOENT;
 		goto out;
 	}

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 05:59:36 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A4B8C4C5;
 Mon,  9 Sep 2013 05:59:36 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 66408277F;
 Mon,  9 Sep 2013 05:59:36 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id 39CC340E6;
 Mon,  9 Sep 2013 05:59:35 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id 6A0293610F; Mon,  9 Sep 2013 07:59:04 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: Konstantin Belousov <kostikbel@gmail.com>
Subject: Re: svn commit: r255385 - in head/etc: . etc.amd64
References: <201309080946.r889kNSX050568@svn.freebsd.org>
 <20130908110410.GZ41229@kib.kiev.ua> <86zjrnedp5.fsf@nine.des.no>
 <20130908143854.GA41229@kib.kiev.ua> <86ioybozic.fsf@nine.des.no>
 <20130909042841.GE41229@kib.kiev.ua>
Date: Mon, 09 Sep 2013 07:58:54 +0200
In-Reply-To: <20130909042841.GE41229@kib.kiev.ua> (Konstantin Belousov's
 message of "Mon, 9 Sep 2013 07:28:41 +0300")
Message-ID: <86vc2av8m9.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 05:59:36 -0000

Konstantin Belousov <kostikbel@gmail.com> writes:
> Dag-Erling Sm=C3=B8rgrav <des@des.no> writes:
> > How about this, which eliminates the unneeded mappings and installs
> > libmap32.conf on powerpc64 as well?
> > [...]
> This looks fine.

Thanks.

> Are you going to remove COMPAT_32BIT conditional from the rtld.c ?

I wouldn't want to rob you of the pleasure ;)

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 06:02:31 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1D926619;
 Mon,  9 Sep 2013 06:02:31 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0A31027BB;
 Mon,  9 Sep 2013 06:02:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8962UnR080587;
 Mon, 9 Sep 2013 06:02:30 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8962UIc080584;
 Mon, 9 Sep 2013 06:02:30 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309090602.r8962UIc080584@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Mon, 9 Sep 2013 06:02:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255413 - in head/etc: . etc.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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 06:02:31 -0000

Author: des
Date: Mon Sep  9 06:02:30 2013
New Revision: 255413
URL: http://svnweb.freebsd.org/changeset/base/255413

Log:
  Remove unneeded mappings from libmap32.conf.  Move it up one level and
  install it on powerpc64 in addition to amd64.
  
  Reviewed by:	kib
  Approved by:	re (blanket)

Added:
  head/etc/libmap32.conf
     - copied, changed from r255393, head/etc/etc.amd64/libmap32.conf
Deleted:
  head/etc/etc.amd64/libmap32.conf
Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==============================================================================
--- head/etc/Makefile	Mon Sep  9 05:01:18 2013	(r255412)
+++ head/etc/Makefile	Mon Sep  9 06:02:30 2013	(r255413)
@@ -50,8 +50,8 @@ BIN1=	crontab \
 	syslog.conf \
 	termcap.small
 
-.if ${MACHINE} == "amd64"
-BIN1+=	etc.${MACHINE}/libmap32.conf
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
+BIN1+=	libmap32.conf
 .endif
 
 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)

Copied and modified: head/etc/libmap32.conf (from r255393, head/etc/etc.amd64/libmap32.conf)
==============================================================================
--- head/etc/etc.amd64/libmap32.conf	Sun Sep  8 16:56:17 2013	(r255393, copy source)
+++ head/etc/libmap32.conf	Mon Sep  9 06:02:30 2013	(r255413)
@@ -1,4 +1,2 @@
 # $FreeBSD$
-/lib			/lib32
-/usr/lib		/usr/lib32
 /usr/lib/private	/usr/lib32/private

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 12:44:49 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 47DEFD35;
 Mon,  9 Sep 2013 12:44:49 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 34EFA21BC;
 Mon,  9 Sep 2013 12:44:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Cinfb019479;
 Mon, 9 Sep 2013 12:44:49 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89CinOD019478;
 Mon, 9 Sep 2013 12:44:49 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309091244.r89CinOD019478@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 9 Sep 2013 12:44:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255415 - head/sys/powerpc/include
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 12:44:49 -0000

Author: nwhitehorn
Date: Mon Sep  9 12:44:48 2013
New Revision: 255415
URL: http://svnweb.freebsd.org/changeset/base/255415

Log:
  Use the canonical bits for wired, etc. in the PTE. This is important for
  interactions with certain kinds of hypervisors that look into the PTEs
  more closely than they should.
  
  Approved by:	re (kib)

Modified:
  head/sys/powerpc/include/pte.h

Modified: head/sys/powerpc/include/pte.h
==============================================================================
--- head/sys/powerpc/include/pte.h	Mon Sep  9 08:07:46 2013	(r255414)
+++ head/sys/powerpc/include/pte.h	Mon Sep  9 12:44:48 2013	(r255415)
@@ -96,8 +96,9 @@ struct lpteg {
 #define LPTE_VSID_SHIFT		12
 #define LPTE_AVPN_MASK		0xFFFFFFFFFFFFFF80ULL
 #define LPTE_API		0x0000000000000F80ULL
-#define LPTE_LOCKED		0x0000000000000040ULL
-#define LPTE_WIRED		0x0000000000000008ULL
+#define LPTE_SWBITS		0x0000000000000078ULL
+#define LPTE_WIRED		0x0000000000000010ULL
+#define LPTE_LOCKED		0x0000000000000008ULL
 #define LPTE_BIG		0x0000000000000004ULL	/* 4kb/16Mb page */
 #define LPTE_HID		0x0000000000000002ULL
 #define LPTE_VALID		0x0000000000000001ULL

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 12:45:42 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 90479E7B;
 Mon,  9 Sep 2013 12:45:42 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7B94E21CB;
 Mon,  9 Sep 2013 12:45:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89CjgjL020030;
 Mon, 9 Sep 2013 12:45:42 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89CjguR020029;
 Mon, 9 Sep 2013 12:45:42 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309091245.r89CjguR020029@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 9 Sep 2013 12:45:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255416 - head/sys/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 12:45:42 -0000

Author: nwhitehorn
Date: Mon Sep  9 12:45:41 2013
New Revision: 255416
URL: http://svnweb.freebsd.org/changeset/base/255416

Log:
  Use a spin lock instead of a mutex to gate RTAS. This is required if RTAS
  calls are involved in interrupt handling.
  
  Approved by:	re (kib)

Modified:
  head/sys/powerpc/ofw/rtas.c

Modified: head/sys/powerpc/ofw/rtas.c
==============================================================================
--- head/sys/powerpc/ofw/rtas.c	Mon Sep  9 12:44:48 2013	(r255415)
+++ head/sys/powerpc/ofw/rtas.c	Mon Sep  9 12:45:41 2013	(r255416)
@@ -93,7 +93,7 @@ rtas_setup(void *junk)
 		return;
 	}
 
-	mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0);
+	mtx_init(&rtas_mtx, "RTAS", NULL, MTX_SPIN);
 
 	/* RTAS must be called with everything turned off in MSR */
 	rtasmsr = mfmsr();
@@ -208,7 +208,7 @@ rtas_call_method(cell_t token, int nargs
 	args.token = token;
 	va_start(ap, nreturns);
 
-	mtx_lock(&rtas_mtx);
+	mtx_lock_spin(&rtas_mtx);
 	rtas_bounce_offset = 0;
 
 	args.nargs = nargs;
@@ -232,7 +232,7 @@ rtas_call_method(cell_t token, int nargs
 	__asm __volatile ("sync");
 
 	rtas_real_unmap(argsptr, &args, sizeof(args));
-	mtx_unlock(&rtas_mtx);
+	mtx_unlock_spin(&rtas_mtx);
 
 	if (result < 0)
 		return (result);

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 12:49:20 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 5CFB3FD9;
 Mon,  9 Sep 2013 12:49:20 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 301E321E2;
 Mon,  9 Sep 2013 12:49:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89CnKnX021357;
 Mon, 9 Sep 2013 12:49:20 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89CnJgU021353;
 Mon, 9 Sep 2013 12:49:19 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309091249.r89CnJgU021353@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 9 Sep 2013 12:49:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255417 - in head/sys/powerpc: include powerpc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 12:49:20 -0000

Author: nwhitehorn
Date: Mon Sep  9 12:49:19 2013
New Revision: 255417
URL: http://svnweb.freebsd.org/changeset/base/255417

Log:
  Add hook called when every new processor is brought online -- including the
  BSP -- so that platform modules have a chance to add the new CPU to any
  internal bookkeeping.
  
  Approved by:	re (kib)

Modified:
  head/sys/powerpc/include/platform.h
  head/sys/powerpc/powerpc/mp_machdep.c
  head/sys/powerpc/powerpc/platform.c
  head/sys/powerpc/powerpc/platform_if.m

Modified: head/sys/powerpc/include/platform.h
==============================================================================
--- head/sys/powerpc/include/platform.h	Mon Sep  9 12:45:41 2013	(r255416)
+++ head/sys/powerpc/include/platform.h	Mon Sep  9 12:49:19 2013	(r255417)
@@ -52,6 +52,7 @@ int	platform_smp_first_cpu(struct cpuref
 int	platform_smp_next_cpu(struct cpuref *);
 int	platform_smp_get_bsp(struct cpuref *);
 int	platform_smp_start_cpu(struct pcpu *);
+void	platform_smp_ap_init(void);
   
 const char *installed_platform(void);
 void platform_probe_and_attach(void);

Modified: head/sys/powerpc/powerpc/mp_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/mp_machdep.c	Mon Sep  9 12:45:41 2013	(r255416)
+++ head/sys/powerpc/powerpc/mp_machdep.c	Mon Sep  9 12:49:19 2013	(r255417)
@@ -91,6 +91,9 @@ machdep_ap_bootstrap(void)
 #endif
 	decr_ap_init();
 
+	/* Give platform code a chance to do anything necessary */
+	platform_smp_ap_init();
+
 	/* Serialize console output and AP count increment */
 	mtx_lock_spin(&ap_boot_mtx);
 	ap_awake++;

Modified: head/sys/powerpc/powerpc/platform.c
==============================================================================
--- head/sys/powerpc/powerpc/platform.c	Mon Sep  9 12:45:41 2013	(r255416)
+++ head/sys/powerpc/powerpc/platform.c	Mon Sep  9 12:49:19 2013	(r255417)
@@ -141,6 +141,12 @@ platform_smp_start_cpu(struct pcpu *cpu)
 	return (PLATFORM_SMP_START_CPU(plat_obj, cpu));
 }
 
+void
+platform_smp_ap_init()
+{
+	PLATFORM_SMP_AP_INIT(plat_obj);
+}
+
 #ifdef SMP
 struct cpu_group *
 cpu_topo(void)

Modified: head/sys/powerpc/powerpc/platform_if.m
==============================================================================
--- head/sys/powerpc/powerpc/platform_if.m	Mon Sep  9 12:45:41 2013	(r255416)
+++ head/sys/powerpc/powerpc/platform_if.m	Mon Sep  9 12:49:19 2013	(r255417)
@@ -80,6 +80,10 @@ CODE {
 	{
 		return (VM_MAX_ADDRESS);
 	}
+	static void platform_null_smp_ap_init(platform_t plat)
+	{
+		return;
+	}
 };
 
 /**
@@ -185,6 +189,14 @@ METHOD int smp_start_cpu {
 };
 
 /**
+ * @brief Start a CPU
+ *
+ */
+METHOD void smp_ap_init {
+	platform_t	_plat;
+} DEFAULT platform_null_smp_ap_init;
+
+/**
  * @brief Return SMP topology
  */
 METHOD cpu_group_t smp_topo {

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 12:51:26 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id DEA821D8;
 Mon,  9 Sep 2013 12:51:25 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id BD1862221;
 Mon,  9 Sep 2013 12:51:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89CpPmI024065;
 Mon, 9 Sep 2013 12:51:25 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89CpP6c024050;
 Mon, 9 Sep 2013 12:51:25 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309091251.r89CpP6c024050@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 9 Sep 2013 12:51:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255418 - in head/sys/powerpc: aim powerpc
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 12:51:26 -0000

Author: nwhitehorn
Date: Mon Sep  9 12:51:24 2013
New Revision: 255418
URL: http://svnweb.freebsd.org/changeset/base/255418

Log:
  Add POWER CPUs to the kernel's knowledge. This does not imply we currently
  actually run on any machines with POWER CPUs but avoids closing that door
  unnecessarily.
  
  Approved by:	re (kib)

Modified:
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/aim/mmu_oea64.h
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Mon Sep  9 12:49:19 2013	(r255417)
+++ head/sys/powerpc/aim/mmu_oea64.c	Mon Sep  9 12:51:24 2013	(r255418)
@@ -263,7 +263,7 @@ uintptr_t	moea64_scratchpage_pte[2];
 struct	mtx	moea64_scratchpage_mtx;
 
 uint64_t 	moea64_large_page_mask = 0;
-int		moea64_large_page_size = 0;
+uint64_t	moea64_large_page_size = 0;
 int		moea64_large_page_shift = 0;
 
 /*
@@ -546,12 +546,9 @@ moea64_probe_large_page(void)
 		powerpc_sync(); isync();
 		
 		/* FALLTHROUGH */
-	case IBMCELLBE:
+	default:
 		moea64_large_page_size = 0x1000000; /* 16 MB */
 		moea64_large_page_shift = 24;
-		break;
-	default:
-		moea64_large_page_size = 0;
 	}
 
 	moea64_large_page_mask = moea64_large_page_size - 1;

Modified: head/sys/powerpc/aim/mmu_oea64.h
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.h	Mon Sep  9 12:49:19 2013	(r255417)
+++ head/sys/powerpc/aim/mmu_oea64.h	Mon Sep  9 12:51:24 2013	(r255418)
@@ -70,6 +70,7 @@ extern u_int	moea64_pte_overflow;
 
 extern struct pvo_head *moea64_pvo_table;
 extern int		moea64_large_page_shift;
+extern uint64_t		moea64_large_page_size;
 extern u_int		moea64_pteg_count;
 extern u_int		moea64_pteg_mask;
 

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c	Mon Sep  9 12:49:19 2013	(r255417)
+++ head/sys/powerpc/powerpc/cpu.c	Mon Sep  9 12:51:24 2013	(r255418)
@@ -127,6 +127,20 @@ static const struct cputab models[] = {
         { "IBM PowerPC 970MP",		IBM970MP,	REVFMT_MAJMIN,
 	   PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
 	   cpu_970_setup },
+        { "IBM POWER4",		IBMPOWER4,	REVFMT_MAJMIN,
+	   PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL },
+        { "IBM POWER4+",	IBMPOWER4PLUS,	REVFMT_MAJMIN,
+	   PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL },
+        { "IBM POWER5",		IBMPOWER5,	REVFMT_MAJMIN,
+	   PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL },
+        { "IBM POWER5+",	IBMPOWER5PLUS,	REVFMT_MAJMIN,
+	   PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL },
+        { "IBM POWER6",		IBMPOWER6,	REVFMT_MAJMIN,
+	   PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
+	   NULL },
+        { "IBM POWER7",		IBMPOWER7,	REVFMT_MAJMIN,
+	   PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
+	   NULL },
         { "Motorola PowerPC 7400",	MPC7400,	REVFMT_MAJMIN,
 	   PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup },
         { "Motorola PowerPC 7410",	MPC7410,	REVFMT_MAJMIN,

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 12:52:36 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id F0F383FD;
 Mon,  9 Sep 2013 12:52:35 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C407F2248;
 Mon,  9 Sep 2013 12:52:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89CqZRS024442;
 Mon, 9 Sep 2013 12:52:35 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89CqZgI024436;
 Mon, 9 Sep 2013 12:52:35 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309091252.r89CqZgI024436@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 9 Sep 2013 12:52:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255419 - in head/sys/powerpc: aim include powerpc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 12:52:36 -0000

Author: nwhitehorn
Date: Mon Sep  9 12:52:34 2013
New Revision: 255419
URL: http://svnweb.freebsd.org/changeset/base/255419

Log:
  Raise artificial limits on number of CPUs and number of interrupts.
  
  Approved by:	re (kib)

Modified:
  head/sys/powerpc/aim/nexus.c
  head/sys/powerpc/include/param.h
  head/sys/powerpc/powerpc/intr_machdep.c

Modified: head/sys/powerpc/aim/nexus.c
==============================================================================
--- head/sys/powerpc/aim/nexus.c	Mon Sep  9 12:51:24 2013	(r255418)
+++ head/sys/powerpc/aim/nexus.c	Mon Sep  9 12:52:34 2013	(r255419)
@@ -195,7 +195,8 @@ static driver_t nexus_driver = {
 
 static devclass_t nexus_devclass;
 
-DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
+EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0,
+    BUS_PASS_BUS);
 
 static int
 nexus_probe(device_t dev)
@@ -216,7 +217,7 @@ nexus_attach(device_t dev)
 	sc = device_get_softc(dev);
 
 	start = 0;
-	end = MAX_PICS*INTR_VECTORS - 1;
+	end = ~0;
 
 	sc->sc_rman.rm_start = start;
 	sc->sc_rman.rm_end = end;

Modified: head/sys/powerpc/include/param.h
==============================================================================
--- head/sys/powerpc/include/param.h	Mon Sep  9 12:51:24 2013	(r255418)
+++ head/sys/powerpc/include/param.h	Mon Sep  9 12:52:34 2013	(r255419)
@@ -69,7 +69,7 @@
 
 #if defined(SMP) || defined(KLD_MODULE)
 #ifndef MAXCPU
-#define	MAXCPU		8
+#define	MAXCPU		32	
 #endif
 #else
 #define	MAXCPU		1

Modified: head/sys/powerpc/powerpc/intr_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/intr_machdep.c	Mon Sep  9 12:51:24 2013	(r255418)
+++ head/sys/powerpc/powerpc/intr_machdep.c	Mon Sep  9 12:52:34 2013	(r255419)
@@ -176,7 +176,7 @@ intrcnt_add(const char *name, u_long **c
 static struct powerpc_intr *
 intr_lookup(u_int irq)
 {
-	char intrname[8];
+	char intrname[16];
 	struct powerpc_intr *i, *iscan;
 	int vector;
 

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 12:54:09 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 04A9F55A;
 Mon,  9 Sep 2013 12:54:09 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CBDCD2264;
 Mon,  9 Sep 2013 12:54:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Cs8T6025169;
 Mon, 9 Sep 2013 12:54:08 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89Cs8hV025167;
 Mon, 9 Sep 2013 12:54:08 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309091254.r89Cs8hV025167@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 9 Sep 2013 12:54:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255420 - in head/sys/powerpc: ofw powermac
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 12:54:09 -0000

Author: nwhitehorn
Date: Mon Sep  9 12:54:08 2013
New Revision: 255420
URL: http://svnweb.freebsd.org/changeset/base/255420

Log:
  Attach only on hardware that is actually supported as opposed to hardware
  that seems like it has some of the problems we might want.
  
  Approved by:	re (kib)

Modified:
  head/sys/powerpc/ofw/ofw_syscons.c
  head/sys/powerpc/powermac/platform_powermac.c

Modified: head/sys/powerpc/ofw/ofw_syscons.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_syscons.c	Mon Sep  9 12:52:34 2013	(r255419)
+++ head/sys/powerpc/ofw/ofw_syscons.c	Mon Sep  9 12:54:08 2013	(r255420)
@@ -218,6 +218,7 @@ ofwfb_configure(int flags)
         ihandle_t stdout;
 	phandle_t node;
 	uint32_t fb_phys;
+	ssize_t proplen;
 	int depth;
 	int disable;
 	int len;
@@ -264,12 +265,21 @@ ofwfb_configure(int flags)
 	} else
 		return (0);
 
+	if (OF_getproplen(node, "height") != sizeof(sc->sc_height) ||
+	    OF_getproplen(node, "width") != sizeof(sc->sc_width))
+		return (0);
+
 	sc->sc_depth = depth;
 	sc->sc_node = node;
 	sc->sc_console = 1;
+	sc->sc_stride = -1;
 	OF_getprop(node, "height", &sc->sc_height, sizeof(sc->sc_height));
 	OF_getprop(node, "width", &sc->sc_width, sizeof(sc->sc_width));
-	OF_getprop(node, "linebytes", &sc->sc_stride, sizeof(sc->sc_stride));
+	proplen = OF_getprop(node, "linebytes", &sc->sc_stride,
+	    sizeof(sc->sc_stride));
+	if (proplen != sizeof(sc->sc_stride) ||
+	    sc->sc_stride < sc->sc_width*sc->sc_depth/4)
+		sc->sc_stride = sc->sc_width*sc->sc_depth/4;
 
 	/*
 	 * Grab the physical address of the framebuffer, and then map it
@@ -278,6 +288,8 @@ ofwfb_configure(int flags)
 	 *
 	 * XXX We assume #address-cells is 1 at this point.
 	 */
+	if (OF_getproplen(node, "address") != sizeof(fb_phys))
+		return (0);
 	OF_getprop(node, "address", &fb_phys, sizeof(fb_phys));
 
 	bus_space_map(&bs_be_tag, fb_phys, sc->sc_height * sc->sc_stride,

Modified: head/sys/powerpc/powermac/platform_powermac.c
==============================================================================
--- head/sys/powerpc/powermac/platform_powermac.c	Mon Sep  9 12:52:34 2013	(r255419)
+++ head/sys/powerpc/powermac/platform_powermac.c	Mon Sep  9 12:54:08 2013	(r255420)
@@ -91,8 +91,22 @@ PLATFORM_DEF(powermac_platform);
 static int
 powermac_probe(platform_t plat)
 {
-	if (OF_finddevice("/memory") != -1 || OF_finddevice("/memory@0") != -1)
-		return (BUS_PROBE_GENERIC);
+	char compat[255];
+	ssize_t compatlen;
+	char *curstr;
+	phandle_t root;
+
+	root = OF_peer(0);
+	if (root == 0)
+		return (ENXIO);
+
+	compatlen = OF_getprop(root, "compatible", compat, sizeof(compat));
+	
+	for (curstr = compat; curstr < compat + compatlen;
+	    curstr += strlen(curstr) + 1) {
+		if (strncmp(curstr, "MacRISC", 7) == 0)
+			return (BUS_PROBE_SPECIFIC);
+	}
 
 	return (ENXIO);
 }

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 13:40:54 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0F2764BB;
 Mon,  9 Sep 2013 13:40:54 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id F00AF2651;
 Mon,  9 Sep 2013 13:40:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Derb2053534;
 Mon, 9 Sep 2013 13:40:53 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89Derbm053533;
 Mon, 9 Sep 2013 13:40:53 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309091340.r89Derbm053533@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 9 Sep 2013 13:40:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255421 - head/sys/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 13:40:54 -0000

Author: nwhitehorn
Date: Mon Sep  9 13:40:53 2013
New Revision: 255421
URL: http://svnweb.freebsd.org/changeset/base/255421

Log:
  Revert r255420. This seems to break some Powermac systems and will be
  revisited much later.
  
  Pointy hat to:		me
  Approved by:		re (kib, implicit due to breakage 10 minutes ago)

Modified:
  head/sys/powerpc/ofw/ofw_syscons.c

Modified: head/sys/powerpc/ofw/ofw_syscons.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_syscons.c	Mon Sep  9 12:54:08 2013	(r255420)
+++ head/sys/powerpc/ofw/ofw_syscons.c	Mon Sep  9 13:40:53 2013	(r255421)
@@ -218,7 +218,6 @@ ofwfb_configure(int flags)
         ihandle_t stdout;
 	phandle_t node;
 	uint32_t fb_phys;
-	ssize_t proplen;
 	int depth;
 	int disable;
 	int len;
@@ -265,21 +264,12 @@ ofwfb_configure(int flags)
 	} else
 		return (0);
 
-	if (OF_getproplen(node, "height") != sizeof(sc->sc_height) ||
-	    OF_getproplen(node, "width") != sizeof(sc->sc_width))
-		return (0);
-
 	sc->sc_depth = depth;
 	sc->sc_node = node;
 	sc->sc_console = 1;
-	sc->sc_stride = -1;
 	OF_getprop(node, "height", &sc->sc_height, sizeof(sc->sc_height));
 	OF_getprop(node, "width", &sc->sc_width, sizeof(sc->sc_width));
-	proplen = OF_getprop(node, "linebytes", &sc->sc_stride,
-	    sizeof(sc->sc_stride));
-	if (proplen != sizeof(sc->sc_stride) ||
-	    sc->sc_stride < sc->sc_width*sc->sc_depth/4)
-		sc->sc_stride = sc->sc_width*sc->sc_depth/4;
+	OF_getprop(node, "linebytes", &sc->sc_stride, sizeof(sc->sc_stride));
 
 	/*
 	 * Grab the physical address of the framebuffer, and then map it
@@ -288,8 +278,6 @@ ofwfb_configure(int flags)
 	 *
 	 * XXX We assume #address-cells is 1 at this point.
 	 */
-	if (OF_getproplen(node, "address") != sizeof(fb_phys))
-		return (0);
 	OF_getprop(node, "address", &fb_phys, sizeof(fb_phys));
 
 	bus_space_map(&bs_be_tag, fb_phys, sc->sc_height * sc->sc_stride,

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 13:56:59 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1EF48C31;
 Mon,  9 Sep 2013 13:56:59 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0AE00281E;
 Mon,  9 Sep 2013 13:56:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Duxcj061712;
 Mon, 9 Sep 2013 13:56:59 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89DuwsC061707;
 Mon, 9 Sep 2013 13:56:58 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309091356.r89DuwsC061707@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Mon, 9 Sep 2013 13:56:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255422 - in head/crypto/openssh: . openbsd-compat
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 13:56:59 -0000

Author: des
Date: Mon Sep  9 13:56:58 2013
New Revision: 255422
URL: http://svnweb.freebsd.org/changeset/base/255422

Log:
  These three files appeared in 6.0p1, which was imported into the vendor
  branch but never merged to head.  They were inadvertantly left out when
  6.1p1 was merged to head.  It didn't make any difference at the time,
  because they were unused, but one of them is required for DNS-based host
  key verification.
  
  Approved by:	re (blanket)

Added:
  head/crypto/openssh/openbsd-compat/getrrsetbyname-ldns.c
     - copied unchanged from r255414, vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c
  head/crypto/openssh/openbsd-compat/strnlen.c
     - copied unchanged from r255414, vendor-crypto/openssh/dist/openbsd-compat/strnlen.c
  head/crypto/openssh/sandbox-seccomp-filter.c
     - copied unchanged from r255414, vendor-crypto/openssh/dist/sandbox-seccomp-filter.c

Copied: head/crypto/openssh/openbsd-compat/getrrsetbyname-ldns.c (from r255414, vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/crypto/openssh/openbsd-compat/getrrsetbyname-ldns.c	Mon Sep  9 13:56:58 2013	(r255422, copy of r255414, vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c)
@@ -0,0 +1,285 @@
+/* $OpenBSD: getrrsetbyname.c,v 1.10 2005/03/30 02:58:28 tedu Exp $ */
+
+/*
+ * Copyright (c) 2007 Simon Vallet / Genoscope <svallet@genoscope.cns.fr>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "includes.h"
+
+#if !defined (HAVE_GETRRSETBYNAME) && defined (HAVE_LDNS)
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <ldns/ldns.h>
+
+#include "getrrsetbyname.h"
+#include "log.h"
+#include "xmalloc.h"
+
+#define malloc(x)	(xmalloc(x))
+#define calloc(x, y)	(xcalloc((x),(y)))
+#define free(x)		(xfree(x))
+
+int
+getrrsetbyname(const char *hostname, unsigned int rdclass,
+	       unsigned int rdtype, unsigned int flags,
+	       struct rrsetinfo **res)
+{
+	int result;
+	unsigned int i, j, index_ans, index_sig;
+	struct rrsetinfo *rrset = NULL;
+	struct rdatainfo *rdata;
+	size_t len;
+	ldns_resolver *ldns_res;
+	ldns_rdf *domain = NULL;
+	ldns_pkt *pkt = NULL;
+	ldns_rr_list *rrsigs = NULL, *rrdata = NULL;
+	ldns_status err;
+	ldns_rr *rr;
+
+	/* check for invalid class and type */
+	if (rdclass > 0xffff || rdtype > 0xffff) {
+		result = ERRSET_INVAL;
+		goto fail;
+	}
+
+	/* don't allow queries of class or type ANY */
+	if (rdclass == 0xff || rdtype == 0xff) {
+		result = ERRSET_INVAL;
+		goto fail;
+	}
+
+	/* don't allow flags yet, unimplemented */
+	if (flags) {
+		result = ERRSET_INVAL;
+		goto fail;
+	}
+
+	/* Initialize resolver from resolv.conf */
+	domain = ldns_dname_new_frm_str(hostname);
+	if ((err = ldns_resolver_new_frm_file(&ldns_res, NULL)) != \
+	    LDNS_STATUS_OK) {
+		result = ERRSET_FAIL;
+		goto fail;
+	}
+
+#ifdef LDNS_DEBUG
+	ldns_resolver_set_debug(ldns_res, true);
+#endif /* LDNS_DEBUG */
+
+	ldns_resolver_set_dnssec(ldns_res, true); /* Use DNSSEC */
+
+	/* make query */
+	pkt = ldns_resolver_query(ldns_res, domain, rdtype, rdclass, LDNS_RD);
+
+	/*** TODO: finer errcodes -- see original **/
+	if (!pkt || ldns_pkt_ancount(pkt) < 1) {
+		result = ERRSET_FAIL;
+		goto fail;
+	}
+
+	/* initialize rrset */
+	rrset = calloc(1, sizeof(struct rrsetinfo));
+	if (rrset == NULL) {
+		result = ERRSET_NOMEMORY;
+		goto fail;
+	}
+
+	rrdata = ldns_pkt_rr_list_by_type(pkt, rdtype, LDNS_SECTION_ANSWER);
+	rrset->rri_nrdatas = ldns_rr_list_rr_count(rrdata);
+	if (!rrset->rri_nrdatas) {
+		result = ERRSET_NODATA;
+		goto fail;
+	}
+
+	/* copy name from answer section */
+	len = ldns_rdf_size(ldns_rr_owner(ldns_rr_list_rr(rrdata, 0)));
+	if ((rrset->rri_name = malloc(len)) == NULL) {
+		result = ERRSET_NOMEMORY;
+		goto fail;
+	}
+	memcpy(rrset->rri_name,
+	    ldns_rdf_data(ldns_rr_owner(ldns_rr_list_rr(rrdata, 0))), len);
+
+	rrset->rri_rdclass = ldns_rr_get_class(ldns_rr_list_rr(rrdata, 0));
+	rrset->rri_rdtype = ldns_rr_get_type(ldns_rr_list_rr(rrdata, 0));
+	rrset->rri_ttl = ldns_rr_ttl(ldns_rr_list_rr(rrdata, 0));
+
+	debug2("ldns: got %u answers from DNS", rrset->rri_nrdatas);
+
+	/* Check for authenticated data */
+	if (ldns_pkt_ad(pkt)) {
+		rrset->rri_flags |= RRSET_VALIDATED;
+	} else { /* AD is not set, try autonomous validation */
+		ldns_rr_list * trusted_keys = ldns_rr_list_new();
+
+		debug2("ldns: trying to validate RRset");
+		/* Get eventual sigs */
+		rrsigs = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_RRSIG,
+		    LDNS_SECTION_ANSWER);
+
+		rrset->rri_nsigs = ldns_rr_list_rr_count(rrsigs);
+		debug2("ldns: got %u signature(s) (RRTYPE %u) from DNS",
+		       rrset->rri_nsigs, LDNS_RR_TYPE_RRSIG);
+
+		if ((err = ldns_verify_trusted(ldns_res, rrdata, rrsigs,
+		     trusted_keys)) == LDNS_STATUS_OK) {
+			rrset->rri_flags |= RRSET_VALIDATED;
+			debug2("ldns: RRset is signed with a valid key");
+		} else {
+			debug2("ldns: RRset validation failed: %s",
+			    ldns_get_errorstr_by_id(err));
+		}
+
+		ldns_rr_list_deep_free(trusted_keys);
+	}
+
+	/* allocate memory for answers */
+	rrset->rri_rdatas = calloc(rrset->rri_nrdatas,
+	   sizeof(struct rdatainfo));
+
+	if (rrset->rri_rdatas == NULL) {
+		result = ERRSET_NOMEMORY;
+		goto fail;
+	}
+
+	/* allocate memory for signatures */
+	if (rrset->rri_nsigs > 0) {
+		rrset->rri_sigs = calloc(rrset->rri_nsigs,
+		    sizeof(struct rdatainfo));
+
+		if (rrset->rri_sigs == NULL) {
+			result = ERRSET_NOMEMORY;
+			goto fail;
+		}
+	}
+
+	/* copy answers & signatures */
+	for (i=0, index_ans=0, index_sig=0; i< pkt->_header->_ancount; i++) {
+		rdata = NULL;
+		rr = ldns_rr_list_rr(ldns_pkt_answer(pkt), i);
+
+		if (ldns_rr_get_class(rr) == rrset->rri_rdclass &&
+		    ldns_rr_get_type(rr) == rrset->rri_rdtype) {
+			rdata = &rrset->rri_rdatas[index_ans++];
+		}
+
+		if (rr->_rr_class == rrset->rri_rdclass &&
+		    rr->_rr_type == LDNS_RR_TYPE_RRSIG &&
+		    rrset->rri_sigs) {
+			rdata = &rrset->rri_sigs[index_sig++];
+		}
+
+		if (rdata) {
+			size_t rdata_offset = 0;
+
+			rdata->rdi_length = 0;
+			for (j=0; j< rr->_rd_count; j++) {
+				rdata->rdi_length +=
+				    ldns_rdf_size(ldns_rr_rdf(rr, j));
+			}
+
+			rdata->rdi_data = malloc(rdata->rdi_length);
+			if (rdata->rdi_data == NULL) {
+				result = ERRSET_NOMEMORY;
+				goto fail;
+			}
+
+			/* Re-create the raw DNS RDATA */
+			for (j=0; j< rr->_rd_count; j++) {
+				len = ldns_rdf_size(ldns_rr_rdf(rr, j));
+				memcpy(rdata->rdi_data + rdata_offset,
+				       ldns_rdf_data(ldns_rr_rdf(rr, j)), len);
+				rdata_offset += len;
+			}
+		}
+	}
+
+	*res = rrset;
+	result = ERRSET_SUCCESS;
+
+fail:
+	/* freerrset(rrset); */
+	ldns_rdf_deep_free(domain);
+	ldns_pkt_free(pkt);
+	ldns_rr_list_deep_free(rrsigs);
+	ldns_rr_list_deep_free(rrdata);
+	ldns_resolver_deep_free(ldns_res);
+
+	return result;
+}
+
+
+void
+freerrset(struct rrsetinfo *rrset)
+{
+	u_int16_t i;
+
+	if (rrset == NULL)
+		return;
+
+	if (rrset->rri_rdatas) {
+		for (i = 0; i < rrset->rri_nrdatas; i++) {
+			if (rrset->rri_rdatas[i].rdi_data == NULL)
+				break;
+			free(rrset->rri_rdatas[i].rdi_data);
+		}
+		free(rrset->rri_rdatas);
+	}
+
+	if (rrset->rri_sigs) {
+		for (i = 0; i < rrset->rri_nsigs; i++) {
+			if (rrset->rri_sigs[i].rdi_data == NULL)
+				break;
+			free(rrset->rri_sigs[i].rdi_data);
+		}
+		free(rrset->rri_sigs);
+	}
+
+	if (rrset->rri_name)
+		free(rrset->rri_name);
+	free(rrset);
+}
+
+
+#endif /* !defined (HAVE_GETRRSETBYNAME) && defined (HAVE_LDNS) */

Copied: head/crypto/openssh/openbsd-compat/strnlen.c (from r255414, vendor-crypto/openssh/dist/openbsd-compat/strnlen.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/crypto/openssh/openbsd-compat/strnlen.c	Mon Sep  9 13:56:58 2013	(r255422, copy of r255414, vendor-crypto/openssh/dist/openbsd-compat/strnlen.c)
@@ -0,0 +1,37 @@
+/*	$OpenBSD: strnlen.c,v 1.3 2010/06/02 12:58:12 millert Exp $	*/
+
+/*
+ * Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* OPENBSD ORIGINAL: lib/libc/string/strnlen.c */
+
+#include "config.h"
+#ifndef HAVE_STRNLEN
+#include <sys/types.h>
+
+#include <string.h>
+
+size_t
+strnlen(const char *str, size_t maxlen)
+{
+	const char *cp;
+
+	for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--)
+		;
+
+	return (size_t)(cp - str);
+}
+#endif

Copied: head/crypto/openssh/sandbox-seccomp-filter.c (from r255414, vendor-crypto/openssh/dist/sandbox-seccomp-filter.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/crypto/openssh/sandbox-seccomp-filter.c	Mon Sep  9 13:56:58 2013	(r255422, copy of r255414, vendor-crypto/openssh/dist/sandbox-seccomp-filter.c)
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2012 Will Drewry <wad@dataspill.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Uncomment the SANDBOX_SECCOMP_FILTER_DEBUG macro below to help diagnose
+ * filter breakage during development. *Do not* use this in production,
+ * as it relies on making library calls that are unsafe in signal context.
+ *
+ * Instead, live systems the auditctl(8) may be used to monitor failures.
+ * E.g.
+ *   auditctl -a task,always -F uid=<privsep uid>
+ */
+/* #define SANDBOX_SECCOMP_FILTER_DEBUG 1 */
+
+#ifdef SANDBOX_SECCOMP_FILTER_DEBUG
+/* Use the kernel headers in case of an older toolchain. */
+# include <asm/siginfo.h>
+# define __have_siginfo_t 1
+# define __have_sigval_t 1
+# define __have_sigevent_t 1
+#endif /* SANDBOX_SECCOMP_FILTER_DEBUG */
+
+#include "includes.h"
+
+#ifdef SANDBOX_SECCOMP_FILTER
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <sys/prctl.h>
+
+#include <linux/audit.h>
+#include <linux/filter.h>
+#include <linux/seccomp.h>
+#include <elf.h>
+
+#include <asm/unistd.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stddef.h>  /* for offsetof */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "log.h"
+#include "ssh-sandbox.h"
+#include "xmalloc.h"
+
+/* Linux seccomp_filter sandbox */
+#define SECCOMP_FILTER_FAIL SECCOMP_RET_KILL
+
+/* Use a signal handler to emit violations when debugging */
+#ifdef SANDBOX_SECCOMP_FILTER_DEBUG
+# undef SECCOMP_FILTER_FAIL
+# define SECCOMP_FILTER_FAIL SECCOMP_RET_TRAP
+#endif /* SANDBOX_SECCOMP_FILTER_DEBUG */
+
+/* Simple helpers to avoid manual errors (but larger BPF programs). */
+#define SC_DENY(_nr, _errno) \
+	BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, __NR_ ## _nr, 0, 1), \
+	BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ERRNO|(_errno))
+#define SC_ALLOW(_nr) \
+	BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, __NR_ ## _nr, 0, 1), \
+	BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW)
+
+/* Syscall filtering set for preauth. */
+static const struct sock_filter preauth_insns[] = {
+	/* Ensure the syscall arch convention is as expected. */
+	BPF_STMT(BPF_LD+BPF_W+BPF_ABS,
+		offsetof(struct seccomp_data, arch)),
+	BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
+	BPF_STMT(BPF_RET+BPF_K, SECCOMP_FILTER_FAIL),
+	/* Load the syscall number for checking. */
+	BPF_STMT(BPF_LD+BPF_W+BPF_ABS,
+		offsetof(struct seccomp_data, nr)),
+	SC_DENY(open, EACCES),
+	SC_ALLOW(getpid),
+	SC_ALLOW(gettimeofday),
+#ifdef __NR_time /* not defined on EABI ARM */
+	SC_ALLOW(time),
+#endif
+	SC_ALLOW(read),
+	SC_ALLOW(write),
+	SC_ALLOW(close),
+	SC_ALLOW(brk),
+	SC_ALLOW(poll),
+#ifdef __NR__newselect
+	SC_ALLOW(_newselect),
+#else
+	SC_ALLOW(select),
+#endif
+	SC_ALLOW(madvise),
+#ifdef __NR_mmap2 /* EABI ARM only has mmap2() */
+	SC_ALLOW(mmap2),
+#endif
+#ifdef __NR_mmap
+	SC_ALLOW(mmap),
+#endif
+	SC_ALLOW(munmap),
+	SC_ALLOW(exit_group),
+#ifdef __NR_rt_sigprocmask
+	SC_ALLOW(rt_sigprocmask),
+#else
+	SC_ALLOW(sigprocmask),
+#endif
+	BPF_STMT(BPF_RET+BPF_K, SECCOMP_FILTER_FAIL),
+};
+
+static const struct sock_fprog preauth_program = {
+	.len = (unsigned short)(sizeof(preauth_insns)/sizeof(preauth_insns[0])),
+	.filter = (struct sock_filter *)preauth_insns,
+};
+
+struct ssh_sandbox {
+	pid_t child_pid;
+};
+
+struct ssh_sandbox *
+ssh_sandbox_init(void)
+{
+	struct ssh_sandbox *box;
+
+	/*
+	 * Strictly, we don't need to maintain any state here but we need
+	 * to return non-NULL to satisfy the API.
+	 */
+	debug3("%s: preparing seccomp filter sandbox", __func__);
+	box = xcalloc(1, sizeof(*box));
+	box->child_pid = 0;
+
+	return box;
+}
+
+#ifdef SANDBOX_SECCOMP_FILTER_DEBUG
+extern struct monitor *pmonitor;
+void mm_log_handler(LogLevel level, const char *msg, void *ctx);
+
+static void
+ssh_sandbox_violation(int signum, siginfo_t *info, void *void_context)
+{
+	char msg[256];
+
+	snprintf(msg, sizeof(msg),
+	    "%s: unexpected system call (arch:0x%x,syscall:%d @ %p)",
+	    __func__, info->si_arch, info->si_syscall, info->si_call_addr);
+	mm_log_handler(SYSLOG_LEVEL_FATAL, msg, pmonitor);
+	_exit(1);
+}
+
+static void
+ssh_sandbox_child_debugging(void)
+{
+	struct sigaction act;
+	sigset_t mask;
+
+	debug3("%s: installing SIGSYS handler", __func__);
+	memset(&act, 0, sizeof(act));
+	sigemptyset(&mask);
+	sigaddset(&mask, SIGSYS);
+
+	act.sa_sigaction = &ssh_sandbox_violation;
+	act.sa_flags = SA_SIGINFO;
+	if (sigaction(SIGSYS, &act, NULL) == -1)
+		fatal("%s: sigaction(SIGSYS): %s", __func__, strerror(errno));
+	if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == -1)
+		fatal("%s: sigprocmask(SIGSYS): %s",
+		      __func__, strerror(errno));
+}
+#endif /* SANDBOX_SECCOMP_FILTER_DEBUG */
+
+void
+ssh_sandbox_child(struct ssh_sandbox *box)
+{
+	struct rlimit rl_zero;
+	int nnp_failed = 0;
+
+	/* Set rlimits for completeness if possible. */
+	rl_zero.rlim_cur = rl_zero.rlim_max = 0;
+	if (setrlimit(RLIMIT_FSIZE, &rl_zero) == -1)
+		fatal("%s: setrlimit(RLIMIT_FSIZE, { 0, 0 }): %s",
+			__func__, strerror(errno));
+	if (setrlimit(RLIMIT_NOFILE, &rl_zero) == -1)
+		fatal("%s: setrlimit(RLIMIT_NOFILE, { 0, 0 }): %s",
+			__func__, strerror(errno));
+	if (setrlimit(RLIMIT_NPROC, &rl_zero) == -1)
+		fatal("%s: setrlimit(RLIMIT_NPROC, { 0, 0 }): %s",
+			__func__, strerror(errno));
+
+#ifdef SANDBOX_SECCOMP_FILTER_DEBUG
+	ssh_sandbox_child_debugging();
+#endif /* SANDBOX_SECCOMP_FILTER_DEBUG */
+
+	debug3("%s: setting PR_SET_NO_NEW_PRIVS", __func__);
+	if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) == -1) {
+		debug("%s: prctl(PR_SET_NO_NEW_PRIVS): %s",
+		      __func__, strerror(errno));
+		nnp_failed = 1;
+	}
+	debug3("%s: attaching seccomp filter program", __func__);
+	if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &preauth_program) == -1)
+		debug("%s: prctl(PR_SET_SECCOMP): %s",
+		      __func__, strerror(errno));
+	else if (nnp_failed)
+		fatal("%s: SECCOMP_MODE_FILTER activated but "
+		    "PR_SET_NO_NEW_PRIVS failed", __func__);
+}
+
+void
+ssh_sandbox_parent_finish(struct ssh_sandbox *box)
+{
+	free(box);
+	debug3("%s: finished", __func__);
+}
+
+void
+ssh_sandbox_parent_preauth(struct ssh_sandbox *box, pid_t child_pid)
+{
+	box->child_pid = child_pid;
+}
+
+#endif /* SANDBOX_SECCOMP_FILTER */

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 15:38:52 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 2625693D;
 Mon,  9 Sep 2013 15:38:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 124242EE4;
 Mon,  9 Sep 2013 15:38:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Fcpwv022454;
 Mon, 9 Sep 2013 15:38:51 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89FcpG4022453;
 Mon, 9 Sep 2013 15:38:51 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309091538.r89FcpG4022453@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Mon, 9 Sep 2013 15:38:51 +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: r255423 - stable/8/lib/libpam/modules/pam_ssh
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 15:38:52 -0000

Author: jhb
Date: Mon Sep  9 15:38:51 2013
New Revision: 255423
URL: http://svnweb.freebsd.org/changeset/base/255423

Log:
  MFC 236106:
  Passing NULL as a key casues a segfault when loading SSH 1 keys.  Use
  an empty string instead.

Modified:
  stable/8/lib/libpam/modules/pam_ssh/pam_ssh.c
Directory Properties:
  stable/8/lib/libpam/   (props changed)

Modified: stable/8/lib/libpam/modules/pam_ssh/pam_ssh.c
==============================================================================
--- stable/8/lib/libpam/modules/pam_ssh/pam_ssh.c	Mon Sep  9 13:56:58 2013	(r255422)
+++ stable/8/lib/libpam/modules/pam_ssh/pam_ssh.c	Mon Sep  9 15:38:51 2013	(r255423)
@@ -110,7 +110,7 @@ pam_ssh_load_key(const char *dir, const 
 	 * with an empty passphrase, and if the key is not encrypted,
 	 * accept only an empty passphrase.
 	 */
-	key = key_load_private(fn, NULL, &comment);
+	key = key_load_private(fn, "", &comment);
 	if (key != NULL && !(*passphrase == '\0' && nullok)) {
 		key_free(key);
 		return (NULL);

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 15:57:25 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E8286E4;
 Mon,  9 Sep 2013 15:57:25 +0000 (UTC)
 (envelope-from jase@FreeBSD.org)
Received: from smtp.btshosting.co.uk (mx-2.btshosting.co.uk
 [IPv6:2a01:4f8:121:2403:2::])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4AAA32072;
 Mon,  9 Sep 2013 15:57:25 +0000 (UTC)
Received: from [192.168.1.65] (unknown [90.202.210.251])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by svr06-mx.btshosting.co.uk (Postfix) with ESMTPSA id E0BC359459;
 Mon,  9 Sep 2013 15:57:14 +0000 (UTC)
Message-ID: <522DEFC8.3010704@FreeBSD.org>
Date: Mon, 09 Sep 2013 16:56:56 +0100
From: Jase Thew <jase@FreeBSD.org>
Organization: The FreeBSD Project
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64;
 rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@FreeBSD.org>
Subject: Re: svn commit: r255413 - in head/etc: . etc.amd64
References: <201309090602.r8962UIc080584@svn.freebsd.org>
In-Reply-To: <201309090602.r8962UIc080584@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 15:57:26 -0000

On 09/09/2013 07:02, Dag-Erling Smørgrav wrote:
> Author: des
> Date: Mon Sep  9 06:02:30 2013
> New Revision: 255413
> URL: http://svnweb.freebsd.org/changeset/base/255413
>
> Log:
>    Remove unneeded mappings from libmap32.conf.  Move it up one level and
>    install it on powerpc64 in addition to amd64.
>
>    Reviewed by:	kib
>    Approved by:	re (blanket)
>
> Added:
>    head/etc/libmap32.conf
>       - copied, changed from r255393, head/etc/etc.amd64/libmap32.conf
> Deleted:
>    head/etc/etc.amd64/libmap32.conf
> Modified:
>    head/etc/Makefile
>
> Modified: head/etc/Makefile
> ==============================================================================
> --- head/etc/Makefile	Mon Sep  9 05:01:18 2013	(r255412)
> +++ head/etc/Makefile	Mon Sep  9 06:02:30 2013	(r255413)
> @@ -50,8 +50,8 @@ BIN1=	crontab \
>   	syslog.conf \
>   	termcap.small
>
> -.if ${MACHINE} == "amd64"
> -BIN1+=	etc.${MACHINE}/libmap32.conf
> +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
> +BIN1+=	libmap32.conf
>   .endif
>
>   .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
>

Hi des,

This appears to break "make distribution" (in this example, called as 
part of ezjail-admin update -i) :

===> libheimipcs (install)
cd /usr/src/libexec/rtld-elf;  PROG=ld-elf32.so.1 MACHINE=i386 
MACHINE_ARCH=i386 MACHINE_CPU="i686 mmx sse sse2" 
MAKEOBJDIRPREFIX=/usr/obj/lib32 _SHLIBDIRPREFIX=/usr/obj/usr/src/lib32 
VERSION="FreeBSD 10.0-CURRENT amd64 1000054" 
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/tmp/install.soOoCtKH 
LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 LIBPRIVATEDIR=/usr/lib32/private 
COMPILER_TYPE=clang make AS="as --32" LD="ld -m elf_i386_fbsd -Y 
P,/usr/obj/usr/src/lib32/usr/lib32" CC="cc -m32 -march=i686 -mmmx -msse 
-msse2 -DCOMPAT_32BIT  -isystem /usr/obj/usr/src/lib32/usr/include/ 
-L/usr/obj/usr/src/lib32/usr/lib32  -B/usr/obj/usr/src/lib32/usr/lib32" 
CXX="c++ -m32 -march=i686 -mmmx -msse -msse2 -DCOMPAT_32BIT  -isystem 
/usr/obj/usr/src/lib32/usr/include/  -L/usr/obj/usr/src/lib32/usr/lib32 
  -B/usr/obj/usr/src/lib32/usr/lib32" -DCOMPAT_32BIT -DLIBRARIES_ONLY 
-DNO_CPU_CFLAGS -DNO_CTF -DNO_LINT -DWITHOUT_BIND -DWITHOUT_MAN 
-DWITHOUT_INFO -DWITHOUT_HTML -DNO_INCS   install
install -s -o root -g wheel -m 555  -C -b -fschg -S ld-elf32.so.1 
/usr/jails/fulljail/libexec/ld-elf32.so.1
/usr/jails/fulljail/usr/libexec/ld-elf32.so.1 -> /libexec/ld-elf32.so.1
cd /usr/src/usr.bin/ldd; PROG=ldd32 MACHINE=i386 MACHINE_ARCH=i386 
MACHINE_CPU="i686 mmx sse sse2" MAKEOBJDIRPREFIX=/usr/obj/lib32 
_SHLIBDIRPREFIX=/usr/obj/usr/src/lib32 VERSION="FreeBSD 10.0-CURRENT 
amd64 1000054" 
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/tmp/install.soOoCtKH 
LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 LIBPRIVATEDIR=/usr/lib32/private 
COMPILER_TYPE=clang make AS="as --32" LD="ld -m elf_i386_fbsd -Y 
P,/usr/obj/usr/src/lib32/usr/lib32" CC="cc -m32 -march=i686 -mmmx -msse 
-msse2 -DCOMPAT_32BIT  -isystem /usr/obj/usr/src/lib32/usr/include/ 
-L/usr/obj/usr/src/lib32/usr/lib32  -B/usr/obj/usr/src/lib32/usr/lib32" 
CXX="c++ -m32 -march=i686 -mmmx -msse -msse2 -DCOMPAT_32BIT  -isystem 
/usr/obj/usr/src/lib32/usr/include/  -L/usr/obj/usr/src/lib32/usr/lib32 
  -B/usr/obj/usr/src/lib32/usr/lib32" -DCOMPAT_32BIT -DLIBRARIES_ONLY 
-DNO_CPU_CFLAGS -DNO_CTF -DNO_LINT -DWITHOUT_BIND -DWITHOUT_MAN 
-DWITHOUT_INFO -DWITHOUT_HTML -DNO_INCS   install
install -s -o root -g wheel -m 555   ldd32 /usr/jails/fulljail/usr/bin/ldd32
make: "/usr/src/etc/Makefile" line 53: Malformed conditional 
(${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64")
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/src/etc
Error: The command 'make distribution' failed.
   Refer to the error report(s) above.

â””[~]> uname -a
FreeBSD fbsd10-dev.localdomain 10.0-CURRENT FreeBSD 10.0-CURRENT #0 
r255414M: Mon Sep  9 15:46:28 BST 2013 
toor@fbsd10-dev.localdomain:/usr/obj/usr/src/sys/GENERIC  amd64

Regards,

Jase.
-- 
Jase Thew
jase@FreeBSD.org
FreeBSD Ports Committer


From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 16:10:22 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CAC095F1;
 Mon,  9 Sep 2013 16:10:22 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 8C3E82180;
 Mon,  9 Sep 2013 16:10:22 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id A548F4A0C;
 Mon,  9 Sep 2013 16:10:21 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id CA7E736206; Mon,  9 Sep 2013 18:09:51 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: Jase Thew <jase@FreeBSD.org>
Subject: Re: svn commit: r255413 - in head/etc: . etc.amd64
References: <201309090602.r8962UIc080584@svn.freebsd.org>
 <522DEFC8.3010704@FreeBSD.org>
Date: Mon, 09 Sep 2013 18:09:51 +0200
In-Reply-To: <522DEFC8.3010704@FreeBSD.org> (Jase Thew's message of "Mon, 09
 Sep 2013 16:56:56 +0100")
Message-ID: <86li360yeo.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 16:10:22 -0000

Jase Thew <jase@FreeBSD.org> writes:
> This appears to break "make distribution" (in this example, called as
> part of ezjail-admin update -i) :

Can you try replacing TARGET_ARCH with MACHINE?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 16:22:59 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 00FB099F;
 Mon,  9 Sep 2013 16:22:58 +0000 (UTC) (envelope-from ian@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C7A1F226C;
 Mon,  9 Sep 2013 16:22:58 +0000 (UTC)
Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52]
 helo=damnhippie.dyndns.org)
 by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256)
 (Exim 4.72) (envelope-from <ian@FreeBSD.org>)
 id 1VJ4Er-00024b-Fe; Mon, 09 Sep 2013 16:22:57 +0000
Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240])
 by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r89GMtEW001930;
 Mon, 9 Sep 2013 10:22:55 -0600 (MDT) (envelope-from ian@FreeBSD.org)
X-Mail-Handler: Dyn Standard SMTP by Dyn
X-Originating-IP: 24.8.230.52
X-Report-Abuse-To: abuse@dyndns.com (see
 http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse
 reporting information)
X-MHO-User: U2FsdGVkX19o8ouZXkHumYPy4XEre0rP
Subject: Re: svn commit: r255413 - in head/etc: . etc.amd64
From: Ian Lepore <ian@FreeBSD.org>
To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= <des@des.no>
In-Reply-To: <86li360yeo.fsf@nine.des.no>
References: <201309090602.r8962UIc080584@svn.freebsd.org>
 <522DEFC8.3010704@FreeBSD.org>  <86li360yeo.fsf@nine.des.no>
Content-Type: text/plain; charset="ISO-8859-1"
Date: Mon, 09 Sep 2013 10:22:55 -0600
Message-ID: <1378743775.1111.573.camel@revolution.hippie.lan>
Mime-Version: 1.0
X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port 
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org
 id r89GMtEW001930
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, Jase Thew <jase@FreeBSD.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 16:22:59 -0000

On Mon, 2013-09-09 at 18:09 +0200, Dag-Erling Sm=F8rgrav wrote:
> Jase Thew <jase@FreeBSD.org> writes:
> > This appears to break "make distribution" (in this example, called as
> > part of ezjail-admin update -i) :
>=20
> Can you try replacing TARGET_ARCH with MACHINE?
>=20
> DES

That doesn't sound right... what if you're doing a cross-build/install?

-- Ian



From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 16:38:15 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 9B355F1A;
 Mon,  9 Sep 2013 16:38:15 +0000 (UTC)
 (envelope-from jase@FreeBSD.org)
Received: from smtp.btshosting.co.uk (mx-2.btshosting.co.uk
 [IPv6:2a01:4f8:121:2403:2::])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5B97F237A;
 Mon,  9 Sep 2013 16:38:15 +0000 (UTC)
Received: from [192.168.1.65] (unknown [90.202.210.251])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by svr06-mx.btshosting.co.uk (Postfix) with ESMTPSA id BDF8159FDB;
 Mon,  9 Sep 2013 16:38:13 +0000 (UTC)
Message-ID: <522DF963.5000604@FreeBSD.org>
Date: Mon, 09 Sep 2013 17:37:55 +0100
From: Jase Thew <jase@FreeBSD.org>
Organization: The FreeBSD Project
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64;
 rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@des.no>
Subject: Re: svn commit: r255413 - in head/etc: . etc.amd64
References: <201309090602.r8962UIc080584@svn.freebsd.org>
 <522DEFC8.3010704@FreeBSD.org> <86li360yeo.fsf@nine.des.no>
In-Reply-To: <86li360yeo.fsf@nine.des.no>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 16:38:15 -0000

On 09/09/2013 17:09, Dag-Erling Smørgrav wrote:
> Jase Thew <jase@FreeBSD.org> writes:
>> This appears to break "make distribution" (in this example, called as
>> part of ezjail-admin update -i) :
>
> Can you try replacing TARGET_ARCH with MACHINE?
>
> DES
>

Changing it back from TARGET_ARCH to MACHINE allows make distribution to 
successfully complete.

Regards,

Jase.
-- 
Jase Thew
jase@FreeBSD.org
FreeBSD Ports Committer


From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 16:42:26 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7A9F1196;
 Mon,  9 Sep 2013 16:42:26 +0000 (UTC)
 (envelope-from nwhitehorn@freebsd.org)
Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119])
 by mx1.freebsd.org (Postfix) with ESMTP id 5074423CD;
 Mon,  9 Sep 2013 16:42:25 +0000 (UTC)
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.icecube.wisc.edu (Postfix) with ESMTP id 6338358385;
 Mon,  9 Sep 2013 11:42:19 -0500 (CDT)
X-Virus-Scanned: amavisd-new at icecube.wisc.edu
Received: from mail.icecube.wisc.edu ([127.0.0.1])
 by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030)
 with ESMTP id 7RRpdYdh+o3z; Mon,  9 Sep 2013 11:42:19 -0500 (CDT)
Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu
 [172.16.223.97])
 by mail.icecube.wisc.edu (Postfix) with ESMTP id 4305E58380;
 Mon,  9 Sep 2013 11:42:19 -0500 (CDT)
Message-ID: <522DFA6B.7030404@freebsd.org>
Date: Mon, 09 Sep 2013 11:42:19 -0500
From: Nathan Whitehorn <nwhitehorn@freebsd.org>
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:17.0) Gecko/20130906 Thunderbird/17.0.8
MIME-Version: 1.0
To: Jase Thew <jase@FreeBSD.org>
Subject: Re: svn commit: r255413 - in head/etc: . etc.amd64
References: <201309090602.r8962UIc080584@svn.freebsd.org>
 <522DEFC8.3010704@FreeBSD.org> <86li360yeo.fsf@nine.des.no>
 <522DF963.5000604@FreeBSD.org>
In-Reply-To: <522DF963.5000604@FreeBSD.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Cc: svn-src-head@freebsd.org,
 =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@des.no>, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 16:42:26 -0000

On 09/09/13 11:37, Jase Thew wrote:
> On 09/09/2013 17:09, Dag-Erling Smørgrav wrote:
>> Jase Thew <jase@FreeBSD.org> writes:
>>> This appears to break "make distribution" (in this example, called as
>>> part of ezjail-admin update -i) :
>>
>> Can you try replacing TARGET_ARCH with MACHINE?
>>
>> DES
>>
>
> Changing it back from TARGET_ARCH to MACHINE allows make distribution 
> to successfully complete.
>
> Regards,
>
> Jase.

I think you want MACHINE_ARCH instead of MACHINE? The Makefile.inc1 
stuff usually takes care of permuting TARGET* into MACHINE*.
-Nathan

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 16:51:36 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 46AFE514;
 Mon,  9 Sep 2013 16:51:36 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3365024EE;
 Mon,  9 Sep 2013 16:51:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Gpa8Q067257;
 Mon, 9 Sep 2013 16:51:36 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89GpaRA067256;
 Mon, 9 Sep 2013 16:51:36 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309091651.r89GpaRA067256@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Mon, 9 Sep 2013 16:51:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255424 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 16:51:36 -0000

Author: nwhitehorn
Date: Mon Sep  9 16:51:35 2013
New Revision: 255424
URL: http://svnweb.freebsd.org/changeset/base/255424

Log:
  Make the primary name of the OF console device /dev/ofwcons, and only
  alias it to the contents of the output property if it is defined. This
  avoids a panic when booting machines (QEMU) where the output-device
  property is not defined.
  
  Since output-device is free-form and potentially conflicts with other
  entries in /dev, I also am not sure we should be doing the aliasing at
  all, but this at least makes things work again.
  
  Approved by:	re (kib)

Modified:
  head/sys/dev/ofw/ofw_console.c

Modified: head/sys/dev/ofw/ofw_console.c
==============================================================================
--- head/sys/dev/ofw/ofw_console.c	Mon Sep  9 15:38:51 2013	(r255423)
+++ head/sys/dev/ofw/ofw_console.c	Mon Sep  9 16:51:35 2013	(r255424)
@@ -88,17 +88,19 @@ cn_drvinit(void *unused)
 
 	if (ofw_consdev.cn_pri != CN_DEAD &&
 	    ofw_consdev.cn_name[0] != '\0') {
-		if ((options = OF_finddevice("/options")) == -1 ||
-		    OF_getprop(options, "output-device", output,
-		    sizeof(output)) == -1)
-			return;
+		tp = tty_alloc(&ofw_ttydevsw, NULL);
+		tty_makedev(tp, NULL, "%s", "ofwcons");
+
 		/*
 		 * XXX: This is a hack and it may result in two /dev/ttya
 		 * XXX: devices on platforms where the sab driver works.
 		 */
-		tp = tty_alloc(&ofw_ttydevsw, NULL);
-		tty_makedev(tp, NULL, "%s", output);
-		tty_makealias(tp, "ofwcons");
+		if ((options = OF_finddevice("/options")) == -1 ||
+		    OF_getprop(options, "output-device", output,
+		    sizeof(output)) == -1)
+			return;
+		if (strlen(output) > 0)
+			tty_makealias(tp, output);
 	}
 }
 

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 17:37:08 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A7767F4C;
 Mon,  9 Sep 2013 17:37:08 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 6846D279F;
 Mon,  9 Sep 2013 17:37:08 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id 41D5A4B43;
 Mon,  9 Sep 2013 17:37:07 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id 6CA763621E; Mon,  9 Sep 2013 19:36:37 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: Ian Lepore <ian@FreeBSD.org>
Subject: Re: svn commit: r255413 - in head/etc: . etc.amd64
References: <201309090602.r8962UIc080584@svn.freebsd.org>
 <522DEFC8.3010704@FreeBSD.org> <86li360yeo.fsf@nine.des.no>
 <1378743775.1111.573.camel@revolution.hippie.lan>
Date: Mon, 09 Sep 2013 19:36:37 +0200
In-Reply-To: <1378743775.1111.573.camel@revolution.hippie.lan> (Ian Lepore's
 message of "Mon, 09 Sep 2013 10:22:55 -0600")
Message-ID: <8638pd99sq.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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, Jase Thew <jase@FreeBSD.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 17:37:08 -0000

Ian Lepore <ian@FreeBSD.org> writes:
> Dag-Erling Sm=C3=B8rgrav <des@des.no> writes:
> > Can you try replacing TARGET_ARCH with MACHINE?
> That doesn't sound right... what if you're doing a cross-build/install?

My thoughts exactly, but judging from the rest of the Makefile, the
correct variable is MACHINE_ARCH, not TARGET_ARCH.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 17:38:03 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0CC10128;
 Mon,  9 Sep 2013 17:38:03 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id EEAB627AE;
 Mon,  9 Sep 2013 17:38:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Hc2UZ094297;
 Mon, 9 Sep 2013 17:38:02 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89Hc2ix094296;
 Mon, 9 Sep 2013 17:38:02 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309091738.r89Hc2ix094296@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Mon, 9 Sep 2013 17:38:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255425 - head/etc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 17:38:03 -0000

Author: des
Date: Mon Sep  9 17:38:02 2013
New Revision: 255425
URL: http://svnweb.freebsd.org/changeset/base/255425

Log:
  The correct variable is apparently MACHINE_ARCH, not TARGET_ARCH.
  
  Approved by:	re (blanket)

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==============================================================================
--- head/etc/Makefile	Mon Sep  9 16:51:35 2013	(r255424)
+++ head/etc/Makefile	Mon Sep  9 17:38:02 2013	(r255425)
@@ -50,7 +50,7 @@ BIN1=	crontab \
 	syslog.conf \
 	termcap.small
 
-.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
 BIN1+=	libmap32.conf
 .endif
 

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 17:46:07 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0292D3C2;
 Mon,  9 Sep 2013 17:46:07 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C89A9283D;
 Mon,  9 Sep 2013 17:46:06 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id D1776B9AD;
 Mon,  9 Sep 2013 13:46:05 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: "=?iso-8859-15?q?Jean-S=E9bastien?= =?iso-8859-15?q?_P=E9dron?="
 <dumbbell@freebsd.org>
Subject: Re: svn commit: r254882 - head/sys/dev/pci
Date: Mon, 9 Sep 2013 11:51:24 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201308251809.r7PI9CsE052978@svn.freebsd.org>
 <201309031410.46052.jhb@freebsd.org> <52298BCA.7040602@FreeBSD.org>
In-Reply-To: <52298BCA.7040602@FreeBSD.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Message-Id: <201309091151.24587.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 09 Sep 2013 13:46:05 -0400 (EDT)
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 17:46:07 -0000

On Friday, September 06, 2013 4:01:14 am Jean-S=E9bastien P=E9dron wrote:
> Le 03/09/2013 20:10, John Baldwin a =E9crit :
> > Yes, orm0 is eating it.  Try this along with using RF_SHAREABLE in your
> > call to BUS_ALLOC_RESOURCE():
> >
> > Index: x86/isa/orm.c
> > (...)
> > -		res =3D bus_alloc_resource_any(child, SYS_RES_MEMORY, &rid, 0);
> > +		res =3D bus_alloc_resource_any(child, SYS_RES_MEMORY, &rid,
> > +		    RF_SHAREABLE);
>=20
> I tried this patch + RF_SHAREABLE in vga_pci.c but without success. In=20
> the call to BUS_ALLOC_RESOURCE in vga_pci.c, I tried with various=20
> "parents"/"grand-parents" but it always returns NULL.

Ok, let's punt on changing the API perhaps, but use the vgapci softc to fin=
d=20
the resource:

Index: vga_pci.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- vga_pci.c	(revision 255414)
+++ vga_pci.c	(working copy)
@@ -67,6 +67,12 @@ struct vga_pci_softc {
=20
 SYSCTL_DECL(_hw_pci);
=20
+static struct vga_resource *lookup_res(struct vga_pci_softc *sc, int rid);
+static struct resource *vga_pci_alloc_resource(device_t dev, device_t chil=
d,
+    int type, int *rid, u_long start, u_long end, u_long count, u_int flag=
s);
+static int	vga_pci_release_resource(device_t dev, device_t child, int type,
+    int rid, struct resource *r);
+
 int vga_pci_default_unit =3D -1;
 TUNABLE_INT("hw.pci.default_vgapci_unit", &vga_pci_default_unit);
 SYSCTL_INT(_hw_pci, OID_AUTO, default_vgapci_unit, CTLFLAG_RDTUN,
@@ -80,7 +86,6 @@ vga_pci_is_boot_display(device_t dev)
 	 * Return true if the given device is the default display used
 	 * at boot time.
 	 */
=2D
 	return (
 	    (pci_get_class(dev) =3D=3D PCIC_DISPLAY ||
 	     (pci_get_class(dev) =3D=3D PCIC_OLD &&
@@ -111,7 +116,8 @@ vga_pci_map_bios(device_t dev, size_t *size)
 #endif
=20
 	rid =3D PCIR_BIOS;
=2D	res =3D bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+	res =3D vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0ul,
+	    ~0ul, 1, RF_ACTIVE);
 	if (res =3D=3D NULL) {
 		return (NULL);
 	}
@@ -123,8 +129,7 @@ vga_pci_map_bios(device_t dev, size_t *size)
 void
 vga_pci_unmap_bios(device_t dev, void *bios)
 {
=2D	int rid;
=2D	struct resource *res;
+	struct vga_resource *vr;
=20
 	if (bios =3D=3D NULL) {
 		return;
@@ -140,25 +145,15 @@ vga_pci_unmap_bios(device_t dev, void *bios)
 #endif
=20
 	/*
=2D	 * FIXME: We returned only the virtual address of the resource
=2D	 * to the caller. Now, to get the resource struct back, we
=2D	 * allocate it again: the struct exists once in memory in
=2D	 * device softc. Therefore, we release twice now to release the
=2D	 * reference we just obtained to get the structure back and the
=2D	 * caller's reference.
+	 * Look up the PCIR_BIOS resource in our softc.  It should match
+	 * the address we returned previously.
 	 */
=2D
=2D	rid =3D PCIR_BIOS;
=2D	res =3D bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
=2D
=2D	KASSERT(res !=3D NULL,
=2D	    ("%s: Can't get BIOS resource back", __func__));
=2D	KASSERT(bios =3D=3D rman_get_virtual(res),
=2D	    ("%s: Given BIOS address doesn't match "
=2D	     "resource virtual address", __func__));
=2D
=2D	bus_release_resource(dev, SYS_RES_MEMORY, rid, bios);
=2D	bus_release_resource(dev, SYS_RES_MEMORY, rid, bios);
+	vr =3D lookup_res(device_get_softc(dev), PCIR_BIOS);
+	KASSERT(vr->vr_res !=3D NULL, ("vga_pci_unmap_bios: bios not mapped"));
+	KASSERT(rman_get_virtual(vr->vr_res) =3D=3D bios,
+	    ("vga_pci_unmap_bios: mismatch"));
+	vga_pci_release_resource(dev, NULL, SYS_RES_MEMORY, PCIR_BIOS,
+	    vr->vr_res);
 }
=20
 static int


=2D-=20
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 17:46:14 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E06BE521;
 Mon,  9 Sep 2013 17:46:14 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id BA4DD2845;
 Mon,  9 Sep 2013 17:46:14 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id B3284B99B;
 Mon,  9 Sep 2013 13:46:13 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: Adrian Chadd <adrian@freebsd.org>
Subject: Re: svn commit: r254199 - in head/sys: contrib/dev/iwn
 modules/iwnfw/iwn6000g2a
Date: Mon, 9 Sep 2013 13:37:29 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201308110103.r7B13WJn070719@svn.freebsd.org>
In-Reply-To: <201308110103.r7B13WJn070719@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201309091337.29326.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 09 Sep 2013 13:46:13 -0400 (EDT)
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 17:46:15 -0000

On Saturday, August 10, 2013 9:03:32 pm Adrian Chadd wrote:
> Author: adrian
> Date: Sun Aug 11 01:03:32 2013
> New Revision: 254199
> URL: http://svnweb.freebsd.org/changeset/base/254199
> 
> Log:
>   Update the 6000g2a image.
>   
>   Obtained from:	Linux, Intel
> 
> Added:
>   head/sys/contrib/dev/iwn/iwlwifi-6000g2a-18.168.6.1.fw.uu
> Modified:
>   head/sys/modules/iwnfw/iwn6000g2a/Makefile

This exposed a bug in sys/conf/kmod.mk for me.  I use NO_KERNELCLEAN by 
default when upgrading my kernels (and have for many years), but the version 
information in the 'FIRMWS' variable used to generate the C stub is not 
treated as a dependency of the generated stub.  Thus, when I upgraded past 
this, the firmware module reused the previous C stub which used a symbol that 
hardcoded the previous firmware version number, so the linker saw it as an 
unresolved symbol and failed to load it.  I don't think anything is wrong with 
this commit at all.  I just wonder if there's a good way to make the C stub 
depend on the value of FIRMWS and have it be regenerated if FIRMWS changes.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 17:51:05 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8BE6CA8E;
 Mon,  9 Sep 2013 17:51:05 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
 by mx1.freebsd.org (Postfix) with ESMTP id 4B9E828AE;
 Mon,  9 Sep 2013 17:51:05 +0000 (UTC)
Received: from nine.des.no (smtp.des.no [194.63.250.102])
 by smtp-int.des.no (Postfix) with ESMTP id 4E6C34B8E;
 Mon,  9 Sep 2013 17:50:58 +0000 (UTC)
Received: by nine.des.no (Postfix, from userid 1001)
 id 7317336224; Mon,  9 Sep 2013 19:50:28 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: Ian Lepore <ian@FreeBSD.org>
Subject: Re: svn commit: r255413 - in head/etc: . etc.amd64
References: <201309090602.r8962UIc080584@svn.freebsd.org>
 <522DEFC8.3010704@FreeBSD.org> <86li360yeo.fsf@nine.des.no>
 <1378743775.1111.573.camel@revolution.hippie.lan>
 <8638pd99sq.fsf@nine.des.no>
Date: Mon, 09 Sep 2013 19:50:28 +0200
In-Reply-To: <8638pd99sq.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?=
 =?utf-8?Q?grav=22's?= message of
 "Mon, 09 Sep 2013 19:36:37 +0200")
Message-ID: <86sixd7ul7.fsf@nine.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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, Jase Thew <jase@FreeBSD.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 17:51:05 -0000

Dag-Erling Sm=C3=B8rgrav <des@des.no> writes:
> Ian Lepore <ian@FreeBSD.org> writes:
> > That doesn't sound right... what if you're doing a cross-build/install?
> My thoughts exactly, but judging from the rest of the Makefile, the
> correct variable is MACHINE_ARCH, not TARGET_ARCH.

This (in Makefile.inc1) is why it works:

CROSSENV=3D       MAKEOBJDIRPREFIX=3D${OBJTREE} \
                MACHINE_ARCH=3D${TARGET_ARCH} \
                MACHINE=3D${TARGET} \
                CPUTYPE=3D${TARGET_CPUTYPE}
# ...
distrib-dirs distribution:
        cd ${.CURDIR}/etc; ${CROSSENV} PATH=3D${TMPPATH} ${MAKE} \
            ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=3D${METALOG} ${.TARGET}

although I would have written it differently:

distrib-dirs distribution:
        (cd ${.CURDIR}/etc && ${CROSSENV} PATH=3D${TMPPATH} ${MAKE} \
            ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=3D${METALOG} ${.TARGET})

but that's a nit.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 18:12:05 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 75C82423;
 Mon,  9 Sep 2013 18:12:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6077429F6;
 Mon,  9 Sep 2013 18:12:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89IC5kR015901;
 Mon, 9 Sep 2013 18:12:05 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89IC0YH015840;
 Mon, 9 Sep 2013 18:12:00 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309091812.r89IC0YH015840@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Mon, 9 Sep 2013 18:12:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255426 - in head: lib/libc/sys sys/compat/freebsd32
 sys/compat/linux sys/compat/svr4 sys/dev/drm2/i915 sys/i386/ibcs2
 sys/i386/linux sys/ia64/ia32 sys/kern sys/sparc64/sparc64 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 18:12:05 -0000

Author: jhb
Date: Mon Sep  9 18:11:59 2013
New Revision: 255426
URL: http://svnweb.freebsd.org/changeset/base/255426

Log:
  Add a mmap flag (MAP_32BIT) on 64-bit platforms to request that a mapping use
  an address in the first 2GB of the process's address space.  This flag should
  have the same semantics as the same flag on Linux.
  
  To facilitate this, add a new parameter to vm_map_find() that specifies an
  optional maximum virtual address.  While here, fix several callers of
  vm_map_find() to use a VMFS_* constant for the findspace argument instead of
  TRUE and FALSE.
  
  Reviewed by:	alc
  Approved by:	re (kib)

Modified:
  head/lib/libc/sys/mmap.2
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/linux/linux_misc.c
  head/sys/compat/svr4/imgact_svr4.c
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/i386/ibcs2/imgact_coff.c
  head/sys/i386/linux/imgact_linux.c
  head/sys/ia64/ia32/ia32_signal.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/imgact_gzip.c
  head/sys/kern/init_main.c
  head/sys/kern/link_elf.c
  head/sys/kern/link_elf_obj.c
  head/sys/kern/sys_pipe.c
  head/sys/kern/sysv_shm.c
  head/sys/kern/uipc_shm.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/sys/mman.h
  head/sys/vm/vm_init.c
  head/sys/vm/vm_kern.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h
  head/sys/vm/vm_mmap.c
  head/usr.bin/kdump/mksubr
  head/usr.bin/truss/syscalls.c

Modified: head/lib/libc/sys/mmap.2
==============================================================================
--- head/lib/libc/sys/mmap.2	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/lib/libc/sys/mmap.2	Mon Sep  9 18:11:59 2013	(r255426)
@@ -28,7 +28,7 @@
 .\"	@(#)mmap.2	8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd August 16, 2013
+.Dd September 9, 2013
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -98,6 +98,12 @@ argument by
 .Em or Ns 'ing
 the following values:
 .Bl -tag -width MAP_PREFAULT_READ
+.It Dv MAP_32BIT
+Request a region in the first 2GB of the current process's address space.
+If a suitable region cannot be found,
+.Fn mmap
+will fail.
+This flag is only available on 64-bit platforms.
 .It Dv MAP_ALIGNED Ns Pq Fa n
 Align the region on a requested boundary.
 If a suitable region cannot be found,
@@ -362,6 +368,13 @@ was specified and the
 argument was not page aligned, or part of the desired address space
 resides out of the valid address space for a user process.
 .It Bq Er EINVAL
+Both
+.Dv MAP_FIXED
+and
+.Dv MAP_32BIT
+were specified and part of the desired address space resides outside
+of the first 2GB of user address space.
+.It Bq Er EINVAL
 The
 .Fa len
 argument

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -448,9 +448,8 @@ freebsd32_mmap_partial(struct thread *td
 		}
 	} else {
 		vm_offset_t addr = trunc_page(start);
-		rv = vm_map_find(map, 0, 0,
-				 &addr, PAGE_SIZE, FALSE, prot,
-				 VM_PROT_ALL, 0);
+		rv = vm_map_find(map, NULL, 0, &addr, PAGE_SIZE, 0,
+		    VMFS_NO_SPACE, prot, VM_PROT_ALL, 0);
 		if (rv != KERN_SUCCESS)
 			return (EINVAL);
 	}
@@ -542,9 +541,8 @@ freebsd32_mmap(struct thread *td, struct
 			rv = vm_map_remove(map, start, end);
 			if (rv != KERN_SUCCESS)
 				return (EINVAL);
-			rv = vm_map_find(map, 0, 0,
-					 &start, end - start, FALSE,
-					 prot, VM_PROT_ALL, 0);
+			rv = vm_map_find(map, NULL, 0, &start, end - start,
+			    0, VMFS_NO_SPACE, prot, VM_PROT_ALL, 0);
 			if (rv != KERN_SUCCESS)
 				return (EINVAL);
 			r.fd = fd;

Modified: head/sys/compat/linux/linux_misc.c
==============================================================================
--- head/sys/compat/linux/linux_misc.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/compat/linux/linux_misc.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -410,8 +410,8 @@ linux_uselib(struct thread *td, struct l
 
 		/* get anon user mapping, read+write+execute */
 		error = vm_map_find(&td->td_proc->p_vmspace->vm_map, NULL, 0,
-		    &vmaddr, a_out->a_text + a_out->a_data, FALSE, VM_PROT_ALL,
-		    VM_PROT_ALL, 0);
+		    &vmaddr, a_out->a_text + a_out->a_data, 0, VMFS_NO_SPACE,
+		    VM_PROT_ALL, VM_PROT_ALL, 0);
 		if (error)
 			goto cleanup;
 
@@ -455,7 +455,8 @@ linux_uselib(struct thread *td, struct l
 
 		/* allocate some 'anon' space */
 		error = vm_map_find(&td->td_proc->p_vmspace->vm_map, NULL, 0,
-		    &vmaddr, bss_size, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0);
+		    &vmaddr, bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL,
+		    VM_PROT_ALL, 0);
 		if (error)
 			goto cleanup;
 	}

Modified: head/sys/compat/svr4/imgact_svr4.c
==============================================================================
--- head/sys/compat/svr4/imgact_svr4.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/compat/svr4/imgact_svr4.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -140,8 +140,8 @@ exec_svr4_imgact(imgp)
 	 */
 	vmaddr = virtual_offset;
 	error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
-		    	    a_out->a_text + a_out->a_data + bss_size, FALSE,
-			    VM_PROT_ALL, VM_PROT_ALL, 0);
+	    a_out->a_text + a_out->a_data + bss_size, 0, VMFS_NO_SPACE,
+	    VM_PROT_ALL, VM_PROT_ALL, 0);
 	if (error)
 	    goto fail;
 
@@ -204,7 +204,7 @@ exec_svr4_imgact(imgp)
 	if (bss_size != 0) {
 	    vmaddr = virtual_offset + a_out->a_text + a_out->a_data;
 	    error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, 
-				bss_size, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0);
+		bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
 	    if (error)
 		goto fail;
 #ifdef DEBUG

Modified: head/sys/dev/drm2/i915/i915_gem.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_gem.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/dev/drm2/i915/i915_gem.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -1291,7 +1291,7 @@ i915_gem_mmap_ioctl(struct drm_device *d
 	addr = 0;
 	vm_object_reference(obj->vm_obj);
 	DRM_UNLOCK(dev);
-	rv = vm_map_find(map, obj->vm_obj, args->offset, &addr, args->size,
+	rv = vm_map_find(map, obj->vm_obj, args->offset, &addr, args->size, 0,
 	    VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE,
 	    VM_PROT_READ | VM_PROT_WRITE, MAP_INHERIT_SHARE);
 	if (rv != KERN_SUCCESS) {

Modified: head/sys/i386/ibcs2/imgact_coff.c
==============================================================================
--- head/sys/i386/ibcs2/imgact_coff.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/i386/ibcs2/imgact_coff.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -128,7 +128,7 @@ load_coff_section(struct vmspace *vmspac
 
 	if (map_len != 0) {
 		error = vm_map_find(&vmspace->vm_map, NULL, 0, &map_addr,
-		    map_len, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
+		    map_len, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
 		if (error)
 			return (vm_mmap_to_errno(error));
 	}
@@ -473,7 +473,7 @@ exec_coff_imgact(imgp)
         DPRINTF(("imgact: error = %d\n", error));
 
 	vm_map_find(&vmspace->vm_map, NULL, 0,
-	    (vm_offset_t *)&hole, PAGE_SIZE, VMFS_NO_SPACE,
+	    (vm_offset_t *)&hole, PAGE_SIZE, 0, VMFS_NO_SPACE,
 	    VM_PROT_ALL, VM_PROT_ALL, 0);
 	DPRINTF(("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%p end = 0x%p\n",
 		ctob(vmspace->vm_dsize), vmspace->vm_daddr,

Modified: head/sys/i386/linux/imgact_linux.c
==============================================================================
--- head/sys/i386/linux/imgact_linux.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/i386/linux/imgact_linux.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -139,8 +139,8 @@ exec_linux_imgact(struct image_params *i
 	 */
 	vmaddr = virtual_offset;
 	error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
-			    a_out->a_text + a_out->a_data + bss_size, FALSE,
-			    VM_PROT_ALL, VM_PROT_ALL, 0);
+	    a_out->a_text + a_out->a_data + bss_size, 0, VMFS_NO_SPACE,
+	    VM_PROT_ALL, VM_PROT_ALL, 0);
 	if (error)
 	    goto fail;
 
@@ -204,7 +204,7 @@ exec_linux_imgact(struct image_params *i
 	if (bss_size != 0) {
 	    vmaddr = virtual_offset + a_out->a_text + a_out->a_data;
 	    error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
-				bss_size, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0);
+		bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
 	    if (error)
 		goto fail;
 #ifdef DEBUG

Modified: head/sys/ia64/ia32/ia32_signal.c
==============================================================================
--- head/sys/ia64/ia32/ia32_signal.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/ia64/ia32/ia32_signal.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -169,8 +169,8 @@ ia32_setregs(struct thread *td, struct i
 	 * Build the GDT and LDT.
 	 */
 	gdt = sv->sv_usrstack;
-	vm_map_find(&vmspace->vm_map, 0, 0, &gdt, IA32_PAGE_SIZE << 1, 0,
-	    VM_PROT_ALL, VM_PROT_ALL, 0);
+	vm_map_find(&vmspace->vm_map, NULL, 0, &gdt, IA32_PAGE_SIZE << 1, 0,
+	    VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
 	ldt = gdt + IA32_PAGE_SIZE;
 
 	desc.sd_lolimit = 8*NLDT-1;

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/kern/imgact_elf.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -417,8 +417,9 @@ __elfN(map_insert)(vm_map_t map, vm_obje
 			 * The mapping is not page aligned. This means we have
 			 * to copy the data. Sigh.
 			 */
-			rv = vm_map_find(map, NULL, 0, &start, end - start,
-			    FALSE, prot | VM_PROT_WRITE, VM_PROT_ALL, 0);
+			rv = vm_map_find(map, NULL, 0, &start, end - start, 0,
+			    VMFS_NO_SPACE, prot | VM_PROT_WRITE, VM_PROT_ALL,
+			    0);
 			if (rv)
 				return (rv);
 			if (object == NULL)

Modified: head/sys/kern/imgact_gzip.c
==============================================================================
--- head/sys/kern/imgact_gzip.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/kern/imgact_gzip.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -269,12 +269,9 @@ do_aout_hdr(struct imgact_gzip * gz)
 		 */
 		vmaddr = gz->virtual_offset + gz->a_out.a_text + 
 			gz->a_out.a_data;
-		error = vm_map_find(&vmspace->vm_map,
-				NULL,
-				0,
-				&vmaddr, 
-				gz->bss_size,
-				FALSE, VM_PROT_ALL, VM_PROT_ALL, 0);
+		error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
+		    gz->bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL,
+		    0);
 		if (error) {
 			gz->where = __LINE__;
 			return (error);

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/kern/init_main.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -709,8 +709,8 @@ start_init(void *dummy)
 	 * Need just enough stack to hold the faked-up "execve()" arguments.
 	 */
 	addr = p->p_sysent->sv_usrstack - PAGE_SIZE;
-	if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE,
-			FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0)
+	if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE, 0,
+	    VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0)
 		panic("init: couldn't allocate argument space");
 	p->p_vmspace->vm_maxsaddr = (caddr_t)addr;
 	p->p_vmspace->vm_ssize = 1;

Modified: head/sys/kern/link_elf.c
==============================================================================
--- head/sys/kern/link_elf.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/kern/link_elf.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -891,7 +891,7 @@ link_elf_load_file(linker_class_t cls, c
 	}
 	ef->address = (caddr_t) vm_map_min(kernel_map);
 	error = vm_map_find(kernel_map, ef->object, 0,
-	    (vm_offset_t *) &ef->address, mapsize, 1,
+	    (vm_offset_t *) &ef->address, mapsize, 0, VMFS_OPTIMAL_SPACE,
 	    VM_PROT_ALL, VM_PROT_ALL, 0);
 	if (error != 0) {
 		vm_object_deallocate(ef->object);

Modified: head/sys/kern/link_elf_obj.c
==============================================================================
--- head/sys/kern/link_elf_obj.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/kern/link_elf_obj.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -689,7 +689,8 @@ link_elf_load_file(linker_class_t cls, c
 	mapbase = VM_MIN_KERNEL_ADDRESS;
 #endif
 	error = vm_map_find(kernel_map, ef->object, 0, &mapbase,
-	    round_page(mapsize), TRUE, VM_PROT_ALL, VM_PROT_ALL, FALSE);
+	    round_page(mapsize), 0, VMFS_OPTIMAL_SPACE, VM_PROT_ALL,
+	    VM_PROT_ALL, 0);
 	if (error) {
 		vm_object_deallocate(ef->object);
 		ef->object = 0;

Modified: head/sys/kern/sys_pipe.c
==============================================================================
--- head/sys/kern/sys_pipe.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/kern/sys_pipe.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -524,7 +524,7 @@ retry:
 	buffer = (caddr_t) vm_map_min(pipe_map);
 
 	error = vm_map_find(pipe_map, NULL, 0,
-		(vm_offset_t *) &buffer, size, 1,
+		(vm_offset_t *) &buffer, size, 0, VMFS_ANY_SPACE,
 		VM_PROT_ALL, VM_PROT_ALL, 0);
 	if (error != KERN_SUCCESS) {
 		if ((cpipe->pipe_buffer.buffer == NULL) &&

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/kern/sysv_shm.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -413,7 +413,7 @@ kern_shmat(td, shmid, shmaddr, shmflg)
 
 	vm_object_reference(shmseg->object);
 	rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object,
-	    0, &attach_va, size, (flags & MAP_FIXED) ? VMFS_NO_SPACE :
+	    0, &attach_va, size, 0, (flags & MAP_FIXED) ? VMFS_NO_SPACE :
 	    VMFS_OPTIMAL_SPACE, prot, prot, MAP_INHERIT_SHARE);
 	if (rv != KERN_SUCCESS) {
 		vm_object_deallocate(shmseg->object);

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/kern/uipc_shm.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -954,7 +954,7 @@ shm_map(struct file *fp, size_t size, of
 	ofs = offset & PAGE_MASK;
 	offset = trunc_page(offset);
 	size = round_page(size + ofs);
-	rv = vm_map_find(kernel_map, obj, offset, &kva, size,
+	rv = vm_map_find(kernel_map, obj, offset, &kva, size, 0,
 	    VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE,
 	    VM_PROT_READ | VM_PROT_WRITE, 0);
 	if (rv == KERN_SUCCESS) {

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/sparc64/sparc64/pmap.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -786,7 +786,7 @@ pmap_init(void)
 			continue;
 		if (addr < VM_MIN_PROM_ADDRESS || addr > VM_MAX_PROM_ADDRESS)
 			continue;
-		result = vm_map_find(kernel_map, NULL, 0, &addr, size,
+		result = vm_map_find(kernel_map, NULL, 0, &addr, size, 0,
 		    VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT);
 		if (result != KERN_SUCCESS || addr != translations[i].om_start)
 			panic("pmap_init: vm_map_find");

Modified: head/sys/sys/mman.h
==============================================================================
--- head/sys/sys/mman.h	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/sys/mman.h	Mon Sep  9 18:11:59 2013	(r255426)
@@ -91,6 +91,9 @@
  */
 #define	MAP_NOCORE	 0x00020000 /* dont include these pages in a coredump */
 #define	MAP_PREFAULT_READ 0x00040000 /* prefault mapping for reading */
+#ifdef __LP64__
+#define	MAP_32BIT	 0x00080000 /* map in the low 2GB of address space */
+#endif
 
 /*
  * Request specific alignment (n == log2 of the desired alignment).

Modified: head/sys/vm/vm_init.c
==============================================================================
--- head/sys/vm/vm_init.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/vm/vm_init.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -111,7 +111,7 @@ kva_import(void *unused, vmem_size_t siz
 	int result;
  
 	addr = vm_map_min(kernel_map);
-	result = vm_map_find(kernel_map, NULL, 0, &addr, size,
+	result = vm_map_find(kernel_map, NULL, 0, &addr, size, 0,
 	    VMFS_SUPER_SPACE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT);
 	if (result != KERN_SUCCESS)
                 return (ENOMEM);

Modified: head/sys/vm/vm_kern.c
==============================================================================
--- head/sys/vm/vm_kern.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/vm/vm_kern.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -285,7 +285,7 @@ kmem_suballoc(vm_map_t parent, vm_offset
 	size = round_page(size);
 
 	*min = vm_map_min(parent);
-	ret = vm_map_find(parent, NULL, 0, min, size, superpage_align ?
+	ret = vm_map_find(parent, NULL, 0, min, size, 0, superpage_align ?
 	    VMFS_SUPER_SPACE : VMFS_ANY_SPACE, VM_PROT_ALL, VM_PROT_ALL,
 	    MAP_ACC_NO_CHARGE);
 	if (ret != KERN_SUCCESS)

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/vm/vm_map.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -1432,8 +1432,8 @@ vm_map_fixed(vm_map_t map, vm_object_t o
 int
 vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
 	    vm_offset_t *addr,	/* IN/OUT */
-	    vm_size_t length, int find_space, vm_prot_t prot,
-	    vm_prot_t max, int cow)
+	    vm_size_t length, vm_offset_t max_addr, int find_space,
+	    vm_prot_t prot, vm_prot_t max, int cow)
 {
 	vm_offset_t alignment, initial_addr, start;
 	int result;
@@ -1452,7 +1452,8 @@ again:
 	vm_map_lock(map);
 	do {
 		if (find_space != VMFS_NO_SPACE) {
-			if (vm_map_findspace(map, start, length, addr)) {
+			if (vm_map_findspace(map, start, length, addr) ||
+			    (max_addr != 0 && *addr + length > max_addr)) {
 				vm_map_unlock(map);
 				if (find_space == VMFS_OPTIMAL_SPACE) {
 					find_space = VMFS_ANY_SPACE;

Modified: head/sys/vm/vm_map.h
==============================================================================
--- head/sys/vm/vm_map.h	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/vm/vm_map.h	Mon Sep  9 18:11:59 2013	(r255426)
@@ -366,7 +366,7 @@ boolean_t vm_map_check_protection (vm_ma
 vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t);
 int vm_map_delete(vm_map_t, vm_offset_t, vm_offset_t);
 int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t,
-    int, vm_prot_t, vm_prot_t, int);
+    vm_offset_t, int, vm_prot_t, vm_prot_t, int);
 int vm_map_fixed(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_size_t,
     vm_prot_t, vm_prot_t, int);
 int vm_map_findspace (vm_map_t, vm_offset_t, vm_size_t, vm_offset_t *);

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/sys/vm/vm_mmap.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -94,10 +94,8 @@ SYSCTL_INT(_vm, OID_AUTO, old_mlock, CTL
     "Do not apply RLIMIT_MEMLOCK on mlockall");
 TUNABLE_INT("vm.old_mlock", &old_mlock);
 
-#ifndef _SYS_SYSPROTO_H_
-struct sbrk_args {
-	int incr;
-};
+#ifdef MAP_32BIT
+#define	MAP_32BIT_MAX_ADDR	((vm_offset_t)1 << 31)
 #endif
 
 static int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *,
@@ -107,6 +105,12 @@ static int vm_mmap_cdev(struct thread *,
 static int vm_mmap_shm(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *,
     int *, struct shmfd *, vm_ooffset_t, vm_object_t *);
 
+#ifndef _SYS_SYSPROTO_H_
+struct sbrk_args {
+	int incr;
+};
+#endif
+
 /*
  * MPSAFE
  */
@@ -278,6 +282,18 @@ sys_mmap(td, uap)
 			return (EINVAL);
 		if (addr + size < addr)
 			return (EINVAL);
+#ifdef MAP_32BIT
+		if (flags & MAP_32BIT && addr + size > MAP_32BIT_MAX_ADDR)
+			return (EINVAL);
+	} else if (flags & MAP_32BIT) {
+		/*
+		 * For MAP_32BIT, override the hint if it is too high and
+		 * do not bother moving the mapping past the heap (since
+		 * the heap is usually above 2GB).
+		 */
+		if (addr + size > MAP_32BIT_MAX_ADDR)
+			addr = 0;
+#endif
 	} else {
 		/*
 		 * XXX for non-fixed mappings where no hint is provided or
@@ -1620,8 +1636,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr,
 			    MAP_ALIGNMENT_SHIFT);
 		else
 			findspace = VMFS_OPTIMAL_SPACE;
-		rv = vm_map_find(map, object, foff, addr, size, findspace,
-		    prot, maxprot, docow);
+		rv = vm_map_find(map, object, foff, addr, size,
+#ifdef MAP_32BIT
+		    flags & MAP_32BIT ? MAP_32BIT_MAX_ADDR :
+#endif
+		    0, findspace, prot, maxprot, docow);
 	} else
 		rv = vm_map_fixed(map, object, foff, *addr, size,
 				 prot, maxprot, docow);

Modified: head/usr.bin/kdump/mksubr
==============================================================================
--- head/usr.bin/kdump/mksubr	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/usr.bin/kdump/mksubr	Mon Sep  9 18:11:59 2013	(r255426)
@@ -497,6 +497,10 @@ egrep "^#[[:space:]]*define[[:space:]]+M
 		++i; \
 		printf "\tif (!((flags > 0) ^ ((%s) > 0)))\n\t\tif_print_or(flags, %s, or);\n", $i, $i }'
 cat <<_EOF_
+#ifdef MAP_32BIT
+	if (!((flags > 0) ^ ((MAP_32BIT) > 0)))
+		if_print_or(flags, MAP_32BIT, or);
+#endif
 	align = flags & MAP_ALIGNMENT_MASK;
 	if (align != 0) {
 		if (align == MAP_ALIGNED_SUPER)

Modified: head/usr.bin/truss/syscalls.c
==============================================================================
--- head/usr.bin/truss/syscalls.c	Mon Sep  9 17:38:02 2013	(r255425)
+++ head/usr.bin/truss/syscalls.c	Mon Sep  9 18:11:59 2013	(r255426)
@@ -296,7 +296,11 @@ static struct xlat mmap_flags[] = {
 	X(MAP_SHARED) X(MAP_PRIVATE) X(MAP_FIXED) X(MAP_RENAME)
 	X(MAP_NORESERVE) X(MAP_RESERVED0080) X(MAP_RESERVED0100)
 	X(MAP_HASSEMAPHORE) X(MAP_STACK) X(MAP_NOSYNC) X(MAP_ANON)
-	X(MAP_NOCORE) X(MAP_PREFAULT_READ) XEND
+	X(MAP_NOCORE) X(MAP_PREFAULT_READ)
+#ifdef MAP_32BIT
+	X(MAP_32BIT)
+#endif
+	XEND
 };
 
 static struct xlat mprot_flags[] = {

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 20:36:29 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 32730BF4;
 Mon,  9 Sep 2013 20:36:29 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1F2142282;
 Mon,  9 Sep 2013 20:36:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89KaSYV001999;
 Mon, 9 Sep 2013 20:36:28 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89KaSHH001996;
 Mon, 9 Sep 2013 20:36:28 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309092036.r89KaSHH001996@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Mon, 9 Sep 2013 20:36:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255428 - head/usr.sbin/mergemaster
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 20:36:29 -0000

Author: delphij
Date: Mon Sep  9 20:36:28 2013
New Revision: 255428
URL: http://svnweb.freebsd.org/changeset/base/255428

Log:
  Pass -n (do not emit comments) when saving mtree information for future
  mergemaster(8) runs.
  
  MFC after:	3 days
  Approved by:	re (kib)

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.sh	Mon Sep  9 19:27:44 2013	(r255427)
+++ head/usr.sbin/mergemaster/mergemaster.sh	Mon Sep  9 20:36:28 2013	(r255428)
@@ -707,7 +707,7 @@ case "${RERUN}" in
   # Build the mtree database in a temporary location.
   case "${PRE_WORLD}" in
   '') MTREENEW=`mktemp -t mergemaster.mtree`
-      mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
+      mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
       ;;
   *) # We don't want to mess with the mtree database on a pre-world run or
      # when re-scanning a previously-built tree.

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 21:00:04 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BAEE6229;
 Mon,  9 Sep 2013 21:00:04 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A7C3F23CC;
 Mon,  9 Sep 2013 21:00:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89L04Fc015224;
 Mon, 9 Sep 2013 21:00:04 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89L04KC015216;
 Mon, 9 Sep 2013 21:00:04 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201309092100.r89L04KC015216@svn.freebsd.org>
From: Sean Bruno <sbruno@FreeBSD.org>
Date: Mon, 9 Sep 2013 21:00:04 +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: r255429 - stable/9/usr.sbin/mfiutil
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 21:00:04 -0000

Author: sbruno
Date: Mon Sep  9 21:00:03 2013
New Revision: 255429
URL: http://svnweb.freebsd.org/changeset/base/255429

Log:
  MFC r254906 -- add SYSPD (real jbod) support to mfiutil
  
  Add support to reconfigure a drive as SYSPD (real JBOD in LSI
  terminology).
  
  Adds command "mfiutil syspd <drive#>" to change a drive to SYSPD.  Drive
  will then be scanned/reported immediately as /dev/mfisyspdX by the host.
  
  "mfiutil good <drive#>" clears SYSPD mode, remove /dev/mfisyspdX and
  sets disk into UNCONFIGURED mode.
  
  Tested on Dell H310 SAS/SATA RAID controller.

Modified:
  stable/9/usr.sbin/mfiutil/mfi_drive.c
  stable/9/usr.sbin/mfiutil/mfiutil.8
  stable/9/usr.sbin/mfiutil/mfiutil.c
Directory Properties:
  stable/9/usr.sbin/mfiutil/   (props changed)

Modified: stable/9/usr.sbin/mfiutil/mfi_drive.c
==============================================================================
--- stable/9/usr.sbin/mfiutil/mfi_drive.c	Mon Sep  9 20:36:28 2013	(r255428)
+++ stable/9/usr.sbin/mfiutil/mfi_drive.c	Mon Sep  9 21:00:03 2013	(r255429)
@@ -474,6 +474,20 @@ rebuild_drive(int ac, char **av)
 MFI_COMMAND(top, rebuild, rebuild_drive);
 
 static int
+syspd_drive(int ac, char **av)
+{
+
+	if (ac != 2) {
+		warnx("syspd: %s", ac > 2 ? "extra arguments" :
+		    "drive required");
+		return (EINVAL);
+	}
+
+	return (drive_set_state(av[1], MFI_PD_STATE_SYSTEM));
+}
+MFI_COMMAND(top, syspd, syspd_drive);
+
+static int
 start_rebuild(int ac, char **av)
 {
 	struct mfi_pd_info info;

Modified: stable/9/usr.sbin/mfiutil/mfiutil.8
==============================================================================
--- stable/9/usr.sbin/mfiutil/mfiutil.8	Mon Sep  9 20:36:28 2013	(r255428)
+++ stable/9/usr.sbin/mfiutil/mfiutil.8	Mon Sep  9 21:00:03 2013	(r255429)
@@ -91,6 +91,9 @@
 .Cm rebuild Ar drive
 .Nm
 .Op Fl u Ar unit
+.Cm syspd Ar drive
+.Nm
+.Op Fl u Ar unit
 .Cm drive progress Ar drive
 .Nm
 .Op Fl u Ar unit
@@ -372,6 +375,11 @@ Mark a failed
 that is still part of an array as a good drive suitable for a rebuild.
 The firmware should kick off an array rebuild on its own if a failed drive
 is marked as a rebuild drive.
+.It Cm syspd Ar drive
+Present the drive to the host operating system as a disk SYSPD block device in
+the format /dev/mfisyspdX.  Clear this flag with
+.Cm good
+.Ar drive
 .It Cm drive progress Ar drive
 Report the current progress and estimated completion time of drive operations
 such as rebuilds or patrol reads.
@@ -679,6 +687,10 @@ Add the drive in slot 2 in the main chas
 .Pp
 .Dl Nm Cm add s2 mfid0
 .Pp
+Reconfigure a disk as a SYSPD block device with no RAID
+.Pp
+.Dl Nm Cm syspd 0
+.Pp
 Configure the adapter to run periodic patrol reads once a week with the first
 patrol read starting in 5 minutes:
 .Pp

Modified: stable/9/usr.sbin/mfiutil/mfiutil.c
==============================================================================
--- stable/9/usr.sbin/mfiutil/mfiutil.c	Mon Sep  9 20:36:28 2013	(r255428)
+++ stable/9/usr.sbin/mfiutil/mfiutil.c	Mon Sep  9 21:00:03 2013	(r255429)
@@ -66,8 +66,9 @@ usage(void)
 	fprintf(stderr, "    show patrol               - display patrol read status\n");
 	fprintf(stderr, "    show progress             - display status of active operations\n");
 	fprintf(stderr, "    fail <drive>              - fail a physical drive\n");
-	fprintf(stderr, "    good <drive>              - mark a bad physical drive as good\n");
+	fprintf(stderr, "    good <drive>              - set a failed/SYSPD drive as UNCONFIGURED\n");
 	fprintf(stderr, "    rebuild <drive>           - mark failed drive ready for rebuild\n");
+	fprintf(stderr, "    syspd <drive>             - set drive into use as SYSPD JBOD\n");
 	fprintf(stderr, "    drive progress <drive>    - display status of active operations\n");
 	fprintf(stderr, "    drive clear <drive> <start|stop> - clear a drive with all 0x00\n");
 	fprintf(stderr, "    start rebuild <drive>\n");
@@ -103,7 +104,7 @@ static int
 version(int ac __unused, char **av __unused)
 {
 
-	printf("mfiutil version 1.0.14");
+	printf("mfiutil version 1.0.15");
 #ifdef DEBUG
 	printf(" (DEBUG)");
 #endif

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 21:05:02 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 6F2FE562;
 Mon,  9 Sep 2013 21:05:02 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5BC41243F;
 Mon,  9 Sep 2013 21:05:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89L520F019677;
 Mon, 9 Sep 2013 21:05:02 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89L51uo019649;
 Mon, 9 Sep 2013 21:05:01 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201309092105.r89L51uo019649@svn.freebsd.org>
From: Sean Bruno <sbruno@FreeBSD.org>
Date: Mon, 9 Sep 2013 21:05:01 +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: r255430 - stable/8/usr.sbin/mfiutil
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 21:05:02 -0000

Author: sbruno
Date: Mon Sep  9 21:05:01 2013
New Revision: 255430
URL: http://svnweb.freebsd.org/changeset/base/255430

Log:
  MFC r254906 -- add SYSPD (real jbod) support to mfiutil
  
  Add support to reconfigure a drive as SYSPD (real JBOD in LSI
  terminology).
  
  Adds command "mfiutil syspd <drive#>" to change a drive to SYSPD.  Drive
  will then be scanned/reported immediately as /dev/mfisyspdX by the host.
  
  "mfiutil good <drive#>" clears SYSPD mode, remove /dev/mfisyspdX and
  sets disk into UNCONFIGURED mode.
  
  Tested on Dell H310 SAS/SATA RAID controller.

Modified:
  stable/8/usr.sbin/mfiutil/mfi_drive.c
  stable/8/usr.sbin/mfiutil/mfiutil.8
  stable/8/usr.sbin/mfiutil/mfiutil.c
Directory Properties:
  stable/8/usr.sbin/mfiutil/   (props changed)

Modified: stable/8/usr.sbin/mfiutil/mfi_drive.c
==============================================================================
--- stable/8/usr.sbin/mfiutil/mfi_drive.c	Mon Sep  9 21:00:03 2013	(r255429)
+++ stable/8/usr.sbin/mfiutil/mfi_drive.c	Mon Sep  9 21:05:01 2013	(r255430)
@@ -474,6 +474,20 @@ rebuild_drive(int ac, char **av)
 MFI_COMMAND(top, rebuild, rebuild_drive);
 
 static int
+syspd_drive(int ac, char **av)
+{
+
+	if (ac != 2) {
+		warnx("syspd: %s", ac > 2 ? "extra arguments" :
+		    "drive required");
+		return (EINVAL);
+	}
+
+	return (drive_set_state(av[1], MFI_PD_STATE_SYSTEM));
+}
+MFI_COMMAND(top, syspd, syspd_drive);
+
+static int
 start_rebuild(int ac, char **av)
 {
 	struct mfi_pd_info info;

Modified: stable/8/usr.sbin/mfiutil/mfiutil.8
==============================================================================
--- stable/8/usr.sbin/mfiutil/mfiutil.8	Mon Sep  9 21:00:03 2013	(r255429)
+++ stable/8/usr.sbin/mfiutil/mfiutil.8	Mon Sep  9 21:05:01 2013	(r255430)
@@ -88,6 +88,9 @@
 .Cm rebuild Ar drive
 .Nm
 .Op Fl u Ar unit
+.Cm syspd Ar drive
+.Nm
+.Op Fl u Ar unit
 .Cm drive progress Ar drive
 .Nm
 .Op Fl u Ar unit
@@ -352,6 +355,11 @@ Mark a failed
 that is still part of an array as a good drive suitable for a rebuild.
 The firmware should kick off an array rebuild on its own if a failed drive
 is marked as a rebuild drive.
+.It Cm syspd Ar drive
+Present the drive to the host operating system as a disk SYSPD block device in
+the format /dev/mfisyspdX.  Clear this flag with
+.Cm good
+.Ar drive
 .It Cm drive progress Ar drive
 Report the current progress and estimated completion time of drive operations
 such as rebuilds or patrol reads.
@@ -630,6 +638,10 @@ Add the drive in slot 2 in the main chas
 .Pp
 .Dl Nm Cm add s2 mfid0
 .Pp
+Reconfigure a disk as a SYSPD block device with no RAID
+.Pp
+.Dl Nm Cm syspd 0
+.Pp
 Configure the adapter to run periodic patrol reads once a week with the first
 patrol read starting in 5 minutes:
 .Pp

Modified: stable/8/usr.sbin/mfiutil/mfiutil.c
==============================================================================
--- stable/8/usr.sbin/mfiutil/mfiutil.c	Mon Sep  9 21:00:03 2013	(r255429)
+++ stable/8/usr.sbin/mfiutil/mfiutil.c	Mon Sep  9 21:05:01 2013	(r255430)
@@ -65,8 +65,9 @@ usage(void)
 	fprintf(stderr, "    show patrol               - display patrol read status\n");
 	fprintf(stderr, "    show progress             - display status of active operations\n");
 	fprintf(stderr, "    fail <drive>              - fail a physical drive\n");
-	fprintf(stderr, "    good <drive>              - mark a bad physical drive as good\n");
+	fprintf(stderr, "    good <drive>              - set a failed/SYSPD drive as UNCONFIGURED\n");
 	fprintf(stderr, "    rebuild <drive>           - mark failed drive ready for rebuild\n");
+	fprintf(stderr, "    syspd <drive>             - set drive into use as SYSPD JBOD\n");
 	fprintf(stderr, "    drive progress <drive>    - display status of active operations\n");
 	fprintf(stderr, "    drive clear <drive> <start|stop> - clear a drive with all 0x00\n");
 	fprintf(stderr, "    start rebuild <drive>\n");
@@ -97,7 +98,7 @@ static int
 version(int ac __unused, char **av __unused)
 {
 
-	printf("mfiutil version 1.0.14");
+	printf("mfiutil version 1.0.15");
 #ifdef DEBUG
 	printf(" (DEBUG)");
 #endif

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 21:18:17 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 36974AF4;
 Mon,  9 Sep 2013 21:18:17 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 245E724E6;
 Mon,  9 Sep 2013 21:18:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89LIH3S027122;
 Mon, 9 Sep 2013 21:18:17 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89LIG2G027121;
 Mon, 9 Sep 2013 21:18:16 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309092118.r89LIG2G027121@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Mon, 9 Sep 2013 21:18:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255431 - head/share/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 21:18:17 -0000

Author: des
Date: Mon Sep  9 21:18:16 2013
New Revision: 255431
URL: http://svnweb.freebsd.org/changeset/base/255431

Log:
  Emit the correct standard library dependency line for C++ programs.  In
  the CLANG_IS_CC case, the default is now libc++.  Only use libstdc++ if
  !CLANG_IS_CC or it was explicitly requested in CXXFLAGS.
  
  Submitted by:	theraven
  Approved by:	re (gjb)

Modified:
  head/share/mk/bsd.prog.mk

Modified: head/share/mk/bsd.prog.mk
==============================================================================
--- head/share/mk/bsd.prog.mk	Mon Sep  9 21:05:01 2013	(r255430)
+++ head/share/mk/bsd.prog.mk	Mon Sep  9 21:18:16 2013	(r255431)
@@ -173,7 +173,7 @@ _EXTRADEPEND:
 .else
 	echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE}
 .if defined(PROG_CXX)
-.if !empty(CXXFLAGS:M-stdlib=libc++)
+.if ${MK_CLANG_IS_CC} != "no" && empty(CXXFLAGS:M-stdlib=libstdc++)
 	echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
 .else
 	echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 21:25:35 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 00155FBF;
 Mon,  9 Sep 2013 21:25:34 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C764E2570;
 Mon,  9 Sep 2013 21:25:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89LPYJ3032138;
 Mon, 9 Sep 2013 21:25:34 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89LPYtP032136;
 Mon, 9 Sep 2013 21:25:34 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201309092125.r89LPYtP032136@svn.freebsd.org>
From: Sean Bruno <sbruno@FreeBSD.org>
Date: Mon, 9 Sep 2013 21:25:34 +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: r255432 - in stable/9: share/man/man4 sys/dev/ciss
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 21:25:35 -0000

Author: sbruno
Date: Mon Sep  9 21:25:34 2013
New Revision: 255432
URL: http://svnweb.freebsd.org/changeset/base/255432

Log:
  MFC r253980 - new pciids for ciss(4) support

Modified:
  stable/9/share/man/man4/ciss.4
  stable/9/sys/dev/ciss/ciss.c
Directory Properties:
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/share/man/man4/ciss.4
==============================================================================
--- stable/9/share/man/man4/ciss.4	Mon Sep  9 21:18:16 2013	(r255431)
+++ stable/9/share/man/man4/ciss.4	Mon Sep  9 21:25:34 2013	(r255432)
@@ -125,6 +125,8 @@ HP Smart Array P220i
 .It
 HP Smart Array P222
 .It
+HP Smart Array P230i
+.It
 HP Smart Array P400
 .It
 HP Smart Array P400i
@@ -141,14 +143,30 @@ HP Smart Array P420i
 .It
 HP Smart Array P421
 .It
+HP Smart Array P430
+.It
+HP Smart Array P430i
+.It
+HP Smart Array P431
+.It
+HP Smart Array P530
+.It
+HP Smart Array P531
+.It
 HP Smart Array P600
 .It
 HP Smart Array P721m
 .It
+HP Smart Array P731m
+.It
 HP Smart Array P800
 .It
 HP Smart Array P812
 .It
+HP Smart Array P830
+.It
+HP Smart Array P830i
+.It
 HP Modular Smart Array 20 (MSA20)
 .It
 HP Modular Smart Array 500 (MSA500)

Modified: stable/9/sys/dev/ciss/ciss.c
==============================================================================
--- stable/9/sys/dev/ciss/ciss.c	Mon Sep  9 21:18:16 2013	(r255431)
+++ stable/9/sys/dev/ciss/ciss.c	Mon Sep  9 21:25:34 2013	(r255432)
@@ -338,6 +338,15 @@ static struct
     { 0x103C, 0x3354, CISS_BOARD_SA5,   "HP Smart Array P420i" },
     { 0x103C, 0x3355, CISS_BOARD_SA5,   "HP Smart Array P220i" },
     { 0x103C, 0x3356, CISS_BOARD_SA5,   "HP Smart Array P721m" },
+    { 0x103C, 0x1920, CISS_BOARD_SA5,   "HP Smart Array P430i" },
+    { 0x103C, 0x1921, CISS_BOARD_SA5,   "HP Smart Array P830i" },
+    { 0x103C, 0x1922, CISS_BOARD_SA5,   "HP Smart Array P430" },
+    { 0x103C, 0x1923, CISS_BOARD_SA5,   "HP Smart Array P431" },
+    { 0x103C, 0x1924, CISS_BOARD_SA5,   "HP Smart Array P830" },
+    { 0x103C, 0x1926, CISS_BOARD_SA5,   "HP Smart Array P731m" },
+    { 0x103C, 0x1928, CISS_BOARD_SA5,   "HP Smart Array P230i" },
+    { 0x103C, 0x1929, CISS_BOARD_SA5,   "HP Smart Array P530" },
+    { 0x103C, 0x192A, CISS_BOARD_SA5,   "HP Smart Array P531" },
     { 0, 0, 0, NULL }
 };
 

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 21:26:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 55ABB185;
 Mon,  9 Sep 2013 21:26:19 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 290B4257A;
 Mon,  9 Sep 2013 21:26:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89LQJV5032392;
 Mon, 9 Sep 2013 21:26:19 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89LQIdm032390;
 Mon, 9 Sep 2013 21:26:18 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201309092126.r89LQIdm032390@svn.freebsd.org>
From: Sean Bruno <sbruno@FreeBSD.org>
Date: Mon, 9 Sep 2013 21:26:18 +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: r255433 - in stable/8: share/man/man4 sys/dev/ciss
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 21:26:19 -0000

Author: sbruno
Date: Mon Sep  9 21:26:18 2013
New Revision: 255433
URL: http://svnweb.freebsd.org/changeset/base/255433

Log:
  MFC r253980 -- add new pciids for ciss(4)

Modified:
  stable/8/share/man/man4/ciss.4
  stable/8/sys/dev/ciss/ciss.c
Directory Properties:
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/ciss/   (props changed)

Modified: stable/8/share/man/man4/ciss.4
==============================================================================
--- stable/8/share/man/man4/ciss.4	Mon Sep  9 21:25:34 2013	(r255432)
+++ stable/8/share/man/man4/ciss.4	Mon Sep  9 21:26:18 2013	(r255433)
@@ -125,6 +125,8 @@ HP Smart Array P220i
 .It
 HP Smart Array P222
 .It
+HP Smart Array P230i
+.It
 HP Smart Array P400
 .It
 HP Smart Array P400i
@@ -141,14 +143,30 @@ HP Smart Array P420i
 .It
 HP Smart Array P421
 .It
+HP Smart Array P430
+.It
+HP Smart Array P430i
+.It
+HP Smart Array P431
+.It
+HP Smart Array P530
+.It
+HP Smart Array P531
+.It
 HP Smart Array P600
 .It
 HP Smart Array P721m
 .It
+HP Smart Array P731m
+.It
 HP Smart Array P800
 .It
 HP Smart Array P812
 .It
+HP Smart Array P830
+.It
+HP Smart Array P830i
+.It
 HP Modular Smart Array 20 (MSA20)
 .It
 HP Modular Smart Array 500 (MSA500)

Modified: stable/8/sys/dev/ciss/ciss.c
==============================================================================
--- stable/8/sys/dev/ciss/ciss.c	Mon Sep  9 21:25:34 2013	(r255432)
+++ stable/8/sys/dev/ciss/ciss.c	Mon Sep  9 21:26:18 2013	(r255433)
@@ -337,6 +337,15 @@ static struct
     { 0x103C, 0x3354, CISS_BOARD_SA5,   "HP Smart Array P420i" },
     { 0x103C, 0x3355, CISS_BOARD_SA5,   "HP Smart Array P220i" },
     { 0x103C, 0x3356, CISS_BOARD_SA5,   "HP Smart Array P721m" },
+    { 0x103C, 0x1920, CISS_BOARD_SA5,   "HP Smart Array P430i" },
+    { 0x103C, 0x1921, CISS_BOARD_SA5,   "HP Smart Array P830i" },
+    { 0x103C, 0x1922, CISS_BOARD_SA5,   "HP Smart Array P430" },
+    { 0x103C, 0x1923, CISS_BOARD_SA5,   "HP Smart Array P431" },
+    { 0x103C, 0x1924, CISS_BOARD_SA5,   "HP Smart Array P830" },
+    { 0x103C, 0x1926, CISS_BOARD_SA5,   "HP Smart Array P731m" },
+    { 0x103C, 0x1928, CISS_BOARD_SA5,   "HP Smart Array P230i" },
+    { 0x103C, 0x1929, CISS_BOARD_SA5,   "HP Smart Array P530" },
+    { 0x103C, 0x192A, CISS_BOARD_SA5,   "HP Smart Array P531" },
     { 0, 0, 0, NULL }
 };
 

From owner-svn-src-all@FreeBSD.ORG  Mon Sep  9 21:40:08 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 6B0A44A5;
 Mon,  9 Sep 2013 21:40:08 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 58EE52625;
 Mon,  9 Sep 2013 21:40:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Le8nV039780;
 Mon, 9 Sep 2013 21:40:08 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89Le8oe039779;
 Mon, 9 Sep 2013 21:40:08 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201309092140.r89Le8oe039779@svn.freebsd.org>
From: Michael Tuexen <tuexen@FreeBSD.org>
Date: Mon, 9 Sep 2013 21:40:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255434 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Sep 2013 21:40:08 -0000

Author: tuexen
Date: Mon Sep  9 21:40:07 2013
New Revision: 255434
URL: http://svnweb.freebsd.org/changeset/base/255434

Log:
  Fix the aborting of association with the iterator using an empty
  user initiated error cause (using SCTP_ABORT|SCTP_SENDALL).
  
  Approved by: re (delphij)
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Mon Sep  9 21:26:18 2013	(r255433)
+++ head/sys/netinet/sctp_output.c	Mon Sep  9 21:40:07 2013	(r255434)
@@ -6412,7 +6412,7 @@ sctp_sendall_iterator(struct sctp_inpcb 
 		/* TSNH */
 		return;
 	}
-	if ((ca->m) && ca->sndlen) {
+	if (ca->sndlen > 0) {
 		m = SCTP_M_COPYM(ca->m, 0, M_COPYALL, M_NOWAIT);
 		if (m == NULL) {
 			/* can't copy so we are done */
@@ -6441,38 +6441,40 @@ sctp_sendall_iterator(struct sctp_inpcb 
 	}
 	if (ca->sndrcv.sinfo_flags & SCTP_ABORT) {
 		/* Abort this assoc with m as the user defined reason */
-		if (m) {
+		if (m != NULL) {
+			SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), M_NOWAIT);
+		} else {
+			m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr),
+			    0, M_NOWAIT, 1, MT_DATA);
+			SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr);
+		}
+		if (m != NULL) {
 			struct sctp_paramhdr *ph;
 
-			SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), M_NOWAIT);
-			if (m) {
-				ph = mtod(m, struct sctp_paramhdr *);
-				ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT);
-				ph->param_length = htons(sizeof(struct sctp_paramhdr) + ca->sndlen);
-			}
-			/*
-			 * We add one here to keep the assoc from
-			 * dis-appearing on us.
-			 */
-			atomic_add_int(&stcb->asoc.refcnt, 1);
-			sctp_abort_an_association(inp, stcb, m, SCTP_SO_NOT_LOCKED);
-			/*
-			 * sctp_abort_an_association calls sctp_free_asoc()
-			 * free association will NOT free it since we
-			 * incremented the refcnt .. we do this to prevent
-			 * it being freed and things getting tricky since we
-			 * could end up (from free_asoc) calling inpcb_free
-			 * which would get a recursive lock call to the
-			 * iterator lock.. But as a consequence of that the
-			 * stcb will return to us un-locked.. since
-			 * free_asoc returns with either no TCB or the TCB
-			 * unlocked, we must relock.. to unlock in the
-			 * iterator timer :-0
-			 */
-			SCTP_TCB_LOCK(stcb);
-			atomic_add_int(&stcb->asoc.refcnt, -1);
-			goto no_chunk_output;
+			ph = mtod(m, struct sctp_paramhdr *);
+			ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT);
+			ph->param_length = htons(sizeof(struct sctp_paramhdr) + ca->sndlen);
 		}
+		/*
+		 * We add one here to keep the assoc from dis-appearing on
+		 * us.
+		 */
+		atomic_add_int(&stcb->asoc.refcnt, 1);
+		sctp_abort_an_association(inp, stcb, m, SCTP_SO_NOT_LOCKED);
+		/*
+		 * sctp_abort_an_association calls sctp_free_asoc() free
+		 * association will NOT free it since we incremented the
+		 * refcnt .. we do this to prevent it being freed and things
+		 * getting tricky since we could end up (from free_asoc)
+		 * calling inpcb_free which would get a recursive lock call
+		 * to the iterator lock.. But as a consequence of that the
+		 * stcb will return to us un-locked.. since free_asoc
+		 * returns with either no TCB or the TCB unlocked, we must
+		 * relock.. to unlock in the iterator timer :-0
+		 */
+		SCTP_TCB_LOCK(stcb);
+		atomic_add_int(&stcb->asoc.refcnt, -1);
+		goto no_chunk_output;
 	} else {
 		if (m) {
 			ret = sctp_msg_append(stcb, net, m,
@@ -6566,8 +6568,7 @@ sctp_sendall_iterator(struct sctp_inpcb 
 
 	if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) &&
 	    (stcb->asoc.total_flight > 0) &&
-	    (un_sent < (int)(stcb->asoc.smallest_mtu - SCTP_MIN_OVERHEAD))
-	    ) {
+	    (un_sent < (int)(stcb->asoc.smallest_mtu - SCTP_MIN_OVERHEAD))) {
 		do_chunk_output = 0;
 	}
 	if (do_chunk_output)
@@ -6696,13 +6697,10 @@ sctp_sendall(struct sctp_inpcb *inp, str
 		/* Gather the length of the send */
 		struct mbuf *mat;
 
-		mat = m;
 		ca->sndlen = 0;
-		while (m) {
-			ca->sndlen += SCTP_BUF_LEN(m);
-			m = SCTP_BUF_NEXT(m);
+		for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) {
+			ca->sndlen += SCTP_BUF_LEN(mat);
 		}
-		ca->m = mat;
 	}
 	ret = sctp_initiate_iterator(NULL, sctp_sendall_iterator, NULL,
 	    SCTP_PCB_ANY_FLAGS, SCTP_PCB_ANY_FEATURES,

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 00:40:22 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8C8DCE52;
 Tue, 10 Sep 2013 00:40:22 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7AC992E80;
 Tue, 10 Sep 2013 00:40:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8A0eM0U052137;
 Tue, 10 Sep 2013 00:40:22 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8A0eMI5052136;
 Tue, 10 Sep 2013 00:40:22 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309100040.r8A0eMI5052136@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Tue, 10 Sep 2013 00:40:22 +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: r255435 - stable/9/sys/dev/hpt27xx
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 00:40:22 -0000

Author: delphij
Date: Tue Sep 10 00:40:21 2013
New Revision: 255435
URL: http://svnweb.freebsd.org/changeset/base/255435

Log:
  MFC r255320:
  
  Return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC.
  
  This change is a 9.2-RELEASE candidate.

Modified:
  stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
==============================================================================
--- stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c	Mon Sep  9 21:40:07 2013	(r255434)
+++ stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c	Tue Sep 10 00:40:21 2013	(r255435)
@@ -52,7 +52,7 @@ static int hpt_probe(device_t dev)
 				memset(hba, 0, sizeof(HBA));
 				hba->ext_type = EXT_TYPE_HBA;
 				hba->ldm_adapter.him = him;
-				return 0;
+				return (BUS_PROBE_DEFAULT);
 			}
 		}
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 01:38:42 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 6953E739;
 Tue, 10 Sep 2013 01:38:42 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2F48720DE;
 Tue, 10 Sep 2013 01:38:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8A1cg04085913;
 Tue, 10 Sep 2013 01:38:42 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8A1cggx085912;
 Tue, 10 Sep 2013 01:38:42 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309100138.r8A1cggx085912@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Tue, 10 Sep 2013 01:38:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255436 - releng/9.2/sys/dev/hpt27xx
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 01:38:42 -0000

Author: delphij
Date: Tue Sep 10 01:38:41 2013
New Revision: 255436
URL: http://svnweb.freebsd.org/changeset/base/255436

Log:
  MFS r255435: MFC r255320:
  
  Return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC.
  
  Approved by:	re (hrs)

Modified:
  releng/9.2/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
Directory Properties:
  releng/9.2/sys/   (props changed)
  releng/9.2/sys/dev/   (props changed)

Modified: releng/9.2/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
==============================================================================
--- releng/9.2/sys/dev/hpt27xx/hpt27xx_osm_bsd.c	Tue Sep 10 00:40:21 2013	(r255435)
+++ releng/9.2/sys/dev/hpt27xx/hpt27xx_osm_bsd.c	Tue Sep 10 01:38:41 2013	(r255436)
@@ -52,7 +52,7 @@ static int hpt_probe(device_t dev)
 				memset(hba, 0, sizeof(HBA));
 				hba->ext_type = EXT_TYPE_HBA;
 				hba->ldm_adapter.him = him;
-				return 0;
+				return (BUS_PROBE_DEFAULT);
 			}
 		}
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 01:46:50 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 4F977988;
 Tue, 10 Sep 2013 01:46:50 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3B2CB2145;
 Tue, 10 Sep 2013 01:46:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8A1koYC091184;
 Tue, 10 Sep 2013 01:46:50 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8A1kmri091170;
 Tue, 10 Sep 2013 01:46:48 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309100146.r8A1kmri091170@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Tue, 10 Sep 2013 01:46:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255437 - in head:
 cddl/contrib/opensolaris/lib/libzpool/common
 cddl/contrib/opensolaris/lib/libzpool/common/sys
 sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 01:46:50 -0000

Author: delphij
Date: Tue Sep 10 01:46:47 2013
New Revision: 255437
URL: http://svnweb.freebsd.org/changeset/base/255437

Log:
  MFV r247844 (illumos-gate 13975:ef6409bc370f)
  
  Illumos ZFS issues:
    3582 zfs_delay() should support a variable resolution
    3584 DTrace sdt probes for ZFS txg states
  
  Provide a compatibility shim for Solaris's cv_timedwait_hires
  to help aid future porting.
  
  Approved by:	re (ZFS blanket)

Modified:
  head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
  head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
  head/sys/cddl/compat/opensolaris/sys/kcondvar.h
  head/sys/cddl/compat/opensolaris/sys/time.h
  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_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c	Tue Sep 10 01:46:47 2013	(r255437)
@@ -349,6 +349,41 @@ top:
 	return (1);
 }
 
+/*ARGSUSED*/
+clock_t
+cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res,
+    int flag)
+{
+	int error;
+	timestruc_t ts;
+	hrtime_t delta;
+
+	ASSERT(flag == 0);
+
+top:
+	delta = tim - gethrtime();
+	if (delta <= 0)
+		return (-1);
+
+	ts.tv_sec = delta / NANOSEC;
+	ts.tv_nsec = delta % NANOSEC;
+
+	ASSERT(mutex_owner(mp) == curthread);
+	mp->m_owner = NULL;
+	error = pthread_cond_timedwait(cv, &mp->m_lock, &ts);
+	mp->m_owner = curthread;
+
+	if (error == ETIMEDOUT)
+		return (-1);
+
+	if (error == EINTR)
+		goto top;
+
+	ASSERT(error == 0);
+
+	return (1);
+}
+
 void
 cv_signal(kcondvar_t *cv)
 {

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h	Tue Sep 10 01:46:47 2013	(r255437)
@@ -313,6 +313,8 @@ extern void cv_init(kcondvar_t *cv, char
 extern void cv_destroy(kcondvar_t *cv);
 extern void cv_wait(kcondvar_t *cv, kmutex_t *mp);
 extern clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime);
+extern clock_t cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim,
+    hrtime_t res, int flag);
 extern void cv_signal(kcondvar_t *cv);
 extern void cv_broadcast(kcondvar_t *cv);
 

Modified: head/sys/cddl/compat/opensolaris/sys/kcondvar.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/kcondvar.h	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/compat/opensolaris/sys/kcondvar.h	Tue Sep 10 01:46:47 2013	(r255437)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
+ * Copyright (c) 2013 iXsystems, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,6 +37,7 @@
 
 #include <sys/mutex.h>
 #include <sys/condvar.h>
+#include <sys/time.h>
 
 typedef struct cv	kcondvar_t;
 
@@ -57,6 +59,19 @@ typedef enum {
 } while (0)
 #define	cv_init(cv, name, type, arg)	zfs_cv_init(cv, name, type, arg)
 
+static clock_t
+cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
+    int flag)
+{
+	sbintime_t sbt;
+	sbintime_t pr;
+
+	sbt = tim * SBT_1NS;
+	pr = res * SBT_1NS;
+
+	return (cv_timedwait_sbt(cvp, mp, sbt, pr, 0));
+}
+
 #endif	/* _KERNEL */
 
 #endif	/* _OPENSOLARIS_SYS_CONDVAR_H_ */

Modified: head/sys/cddl/compat/opensolaris/sys/time.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/time.h	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/compat/opensolaris/sys/time.h	Tue Sep 10 01:46:47 2013	(r255437)
@@ -37,6 +37,9 @@
 #define NANOSEC		1000000000
 #define TIME_MAX	LLONG_MAX
 
+#define	MSEC2NSEC(m)	((hrtime_t)(m) * (NANOSEC / MILLISEC))
+#define	NSEC2MSEC(n)	((n) / (NANOSEC / MILLISEC))
+
 typedef longlong_t	hrtime_t;
 
 #if defined(__i386__) || defined(__powerpc__)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c	Tue Sep 10 01:46:47 2013	(r255437)
@@ -744,7 +744,8 @@ dsl_dir_tempreserve_space(dsl_dir_t *dd,
 		err = dsl_pool_tempreserve_space(dd->dd_pool, asize, tx);
 	} else {
 		if (err == EAGAIN) {
-			txg_delay(dd->dd_pool, tx->tx_txg, 1);
+			txg_delay(dd->dd_pool, tx->tx_txg,
+			    MSEC2NSEC(10), MSEC2NSEC(10));
 			err = SET_ERROR(ERESTART);
 		}
 		dsl_pool_memory_pressure(dd->dd_pool);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Tue Sep 10 01:46:47 2013	(r255437)
@@ -85,6 +85,9 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, write_l
     &zfs_write_limit_override, 0,
     "Force a txg if dirty buffers exceed this value (bytes)");
 
+hrtime_t zfs_throttle_delay = MSEC2NSEC(10);
+hrtime_t zfs_throttle_resolution = MSEC2NSEC(10);
+
 int
 dsl_pool_open_special_dir(dsl_pool_t *dp, const char *name, dsl_dir_t **ddp)
 {
@@ -538,12 +541,13 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t
 	 * Weight the throughput calculation towards the current value:
 	 * 	thru = 3/4 old_thru + 1/4 new_thru
 	 *
-	 * Note: write_time is in nanosecs, so write_time/MICROSEC
-	 * yields millisecs
+	 * Note: write_time is in nanosecs while dp_throughput is expressed in
+	 * bytes per millisecond.
 	 */
 	ASSERT(zfs_write_limit_min > 0);
-	if (data_written > zfs_write_limit_min / 8 && write_time > MICROSEC) {
-		uint64_t throughput = data_written / (write_time / MICROSEC);
+	if (data_written > zfs_write_limit_min / 8 &&
+	    write_time > MSEC2NSEC(1)) {
+		uint64_t throughput = data_written / NSEC2MSEC(write_time);
 
 		if (dp->dp_throughput)
 			dp->dp_throughput = throughput / 4 +
@@ -641,8 +645,10 @@ dsl_pool_tempreserve_space(dsl_pool_t *d
 	 * the caller 1 clock tick.  This will slow down the "fill"
 	 * rate until the sync process can catch up with us.
 	 */
-	if (reserved && reserved > (write_limit - (write_limit >> 3)))
-		txg_delay(dp, tx->tx_txg, 1);
+	if (reserved && reserved > (write_limit - (write_limit >> 3))) {
+		txg_delay(dp, tx->tx_txg, zfs_throttle_delay,
+		    zfs_throttle_resolution);
+	}
 
 	return (0);
 }

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	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Tue Sep 10 01:46:47 2013	(r255437)
@@ -444,7 +444,7 @@ dsl_scan_check_pause(dsl_scan_t *scn, co
 	    zfs_resilver_min_time_ms : zfs_scan_min_time_ms;
 	elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
 	if (elapsed_nanosecs / NANOSEC > zfs_txg_timeout ||
-	    (elapsed_nanosecs / MICROSEC > mintime &&
+	    (NSEC2MSEC(elapsed_nanosecs) > mintime &&
 	    txg_sync_waiting(scn->scn_dp)) ||
 	    spa_shutting_down(scn->scn_dp->dp_spa)) {
 		if (zb) {
@@ -1349,7 +1349,7 @@ dsl_scan_free_should_pause(dsl_scan_t *s
 
 	elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
 	return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout ||
-	    (elapsed_nanosecs / MICROSEC > zfs_free_min_time_ms &&
+	    (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms &&
 	    txg_sync_waiting(scn->scn_dp)) ||
 	    spa_shutting_down(scn->scn_dp->dp_spa));
 }
@@ -1473,7 +1473,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
 			    "free_bpobj/bptree txg %llu",
 			    (longlong_t)scn->scn_visited_this_txg,
 			    (longlong_t)
-			    (gethrtime() - scn->scn_sync_start_time) / MICROSEC,
+			    NSEC2MSEC(gethrtime() - scn->scn_sync_start_time),
 			    (longlong_t)tx->tx_txg);
 			scn->scn_visited_this_txg = 0;
 			/*
@@ -1531,7 +1531,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
 
 	zfs_dbgmsg("visited %llu blocks in %llums",
 	    (longlong_t)scn->scn_visited_this_txg,
-	    (longlong_t)(gethrtime() - scn->scn_sync_start_time) / MICROSEC);
+	    (longlong_t)NSEC2MSEC(gethrtime() - scn->scn_sync_start_time));
 
 	if (!scn->scn_pausing) {
 		scn->scn_done_txg = tx->tx_txg + 1;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Tue Sep 10 01:46:47 2013	(r255437)
@@ -534,8 +534,8 @@ spa_add(const char *name, nvlist_t *conf
 	hdlr.cyh_level = CY_LOW_LEVEL;
 #endif
 
-	spa->spa_deadman_synctime = zfs_deadman_synctime *
-	    zfs_txg_synctime_ms * MICROSEC;
+	spa->spa_deadman_synctime = MSEC2NSEC(zfs_deadman_synctime *
+	    zfs_txg_synctime_ms);
 
 #ifdef illumos
 	/*
@@ -544,7 +544,7 @@ spa_add(const char *name, nvlist_t *conf
 	 * an expensive operation we don't want to check too frequently.
 	 * Instead wait for 5 synctimes before checking again.
 	 */
-	when.cyt_interval = 5ULL * zfs_txg_synctime_ms * MICROSEC;
+	when.cyt_interval = MSEC2NSEC(5 * zfs_txg_synctime_ms);
 	when.cyt_when = CY_INFINITY;
 	mutex_enter(&cpu_lock);
 	spa->spa_deadman_cycid = cyclic_add(&hdlr, &when);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h	Tue Sep 10 01:46:47 2013	(r255437)
@@ -74,13 +74,8 @@ extern void txg_rele_to_quiesce(txg_hand
 extern void txg_rele_to_sync(txg_handle_t *txghp);
 extern void txg_register_callbacks(txg_handle_t *txghp, list_t *tx_callbacks);
 
-/*
- * Delay the caller by the specified number of ticks or until
- * the txg closes (whichever comes first).  This is intended
- * to be used to throttle writers when the system nears its
- * capacity.
- */
-extern void txg_delay(struct dsl_pool *dp, uint64_t txg, int ticks);
+extern void txg_delay(struct dsl_pool *dp, uint64_t txg, hrtime_t delta,
+    hrtime_t resolution);
 
 /*
  * Wait until the given transaction group has finished syncing.

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h	Tue Sep 10 01:46:47 2013	(r255437)
@@ -70,7 +70,7 @@ struct tx_cpu {
 	kmutex_t	tc_open_lock;	/* protects tx_open_txg */
 	kmutex_t	tc_lock;	/* protects the rest of this struct */
 	kcondvar_t	tc_cv[TXG_SIZE];
-	uint64_t	tc_count[TXG_SIZE];
+	uint64_t	tc_count[TXG_SIZE];	/* tx hold count on each txg */
 	list_t		tc_callbacks[TXG_SIZE]; /* commit cb list */
 	char		tc_pad[8];		/* pad to fill 3 cache lines */
 };
@@ -87,8 +87,8 @@ struct tx_cpu {
  * every cpu (see txg_quiesce()).
  */
 typedef struct tx_state {
-	tx_cpu_t	*tx_cpu;	/* protects right to enter txg	*/
-	kmutex_t	tx_sync_lock;	/* protects tx_state_t */
+	tx_cpu_t	*tx_cpu;	/* protects access to tx_open_txg */
+	kmutex_t	tx_sync_lock;	/* protects the rest of this struct */
 	uint64_t	tx_open_txg;	/* currently open txg id */
 	uint64_t	tx_quiesced_txg; /* quiesced txg waiting for sync */
 	uint64_t	tx_syncing_txg;	/* currently syncing txg id */

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Tue Sep 10 01:38:41 2013	(r255436)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Tue Sep 10 01:46:47 2013	(r255437)
@@ -241,7 +241,7 @@ txg_thread_exit(tx_state_t *tx, callb_cp
 }
 
 static void
-txg_thread_wait(tx_state_t *tx, callb_cpr_t *cpr, kcondvar_t *cv, uint64_t time)
+txg_thread_wait(tx_state_t *tx, callb_cpr_t *cpr, kcondvar_t *cv, clock_t time)
 {
 	CALLB_CPR_SAFE_BEGIN(cpr);
 
@@ -370,6 +370,9 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg
 	ASSERT(txg == tx->tx_open_txg);
 	tx->tx_open_txg++;
 
+	DTRACE_PROBE2(txg__quiescing, dsl_pool_t *, dp, uint64_t, txg);
+	DTRACE_PROBE2(txg__opened, dsl_pool_t *, dp, uint64_t, tx->tx_open_txg);
+
 	/*
 	 * Now that we've incremented tx_open_txg, we can let threads
 	 * enter the next transaction group.
@@ -501,6 +504,7 @@ txg_sync_thread(void *arg)
 		txg = tx->tx_quiesced_txg;
 		tx->tx_quiesced_txg = 0;
 		tx->tx_syncing_txg = txg;
+		DTRACE_PROBE2(txg__syncing, dsl_pool_t *, dp, uint64_t, txg);
 		cv_broadcast(&tx->tx_quiesce_more_cv);
 
 		dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n",
@@ -514,6 +518,7 @@ txg_sync_thread(void *arg)
 		mutex_enter(&tx->tx_sync_lock);
 		tx->tx_synced_txg = txg;
 		tx->tx_syncing_txg = 0;
+		DTRACE_PROBE2(txg__synced, dsl_pool_t *, dp, uint64_t, txg);
 		cv_broadcast(&tx->tx_sync_done_cv);
 
 		/*
@@ -563,21 +568,22 @@ txg_quiesce_thread(void *arg)
 		 */
 		dprintf("quiesce done, handing off txg %llu\n", txg);
 		tx->tx_quiesced_txg = txg;
+		DTRACE_PROBE2(txg__quiesced, dsl_pool_t *, dp, uint64_t, txg);
 		cv_broadcast(&tx->tx_sync_more_cv);
 		cv_broadcast(&tx->tx_quiesce_done_cv);
 	}
 }
 
 /*
- * Delay this thread by 'ticks' if we are still in the open transaction
- * group and there is already a waiting txg quiescing or quiesced.
- * Abort the delay if this txg stalls or enters the quiescing state.
+ * Delay this thread by delay nanoseconds if we are still in the open
+ * transaction group and there is already a waiting txg quiesing or quiesced.
+ * Abort the delay if this txg stalls or enters the quiesing state.
  */
 void
-txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks)
+txg_delay(dsl_pool_t *dp, uint64_t txg, hrtime_t delay, hrtime_t resolution)
 {
 	tx_state_t *tx = &dp->dp_tx;
-	clock_t timeout = ddi_get_lbolt() + ticks;
+	hrtime_t start = gethrtime();
 
 	/* don't delay if this txg could transition to quiescing immediately */
 	if (tx->tx_open_txg > txg ||
@@ -590,10 +596,11 @@ txg_delay(dsl_pool_t *dp, uint64_t txg, 
 		return;
 	}
 
-	while (ddi_get_lbolt() < timeout &&
-	    tx->tx_syncing_txg < txg-1 && !txg_stalled(dp))
-		(void) cv_timedwait(&tx->tx_quiesce_more_cv, &tx->tx_sync_lock,
-		    timeout - ddi_get_lbolt());
+	while (gethrtime() - start < delay &&
+	    tx->tx_syncing_txg < txg-1 && !txg_stalled(dp)) {
+		(void) cv_timedwait_hires(&tx->tx_quiesce_more_cv,
+		    &tx->tx_sync_lock, delay, resolution, 0);
+	}
 
 	mutex_exit(&tx->tx_sync_lock);
 }

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 03:48:18 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id EC929AB9;
 Tue, 10 Sep 2013 03:48:18 +0000 (UTC)
 (envelope-from grehan@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id BEBBF26C7;
 Tue, 10 Sep 2013 03:48:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8A3mIPm065596;
 Tue, 10 Sep 2013 03:48:18 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8A3mIoS065592;
 Tue, 10 Sep 2013 03:48:18 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201309100348.r8A3mIoS065592@svn.freebsd.org>
From: Peter Grehan <grehan@FreeBSD.org>
Date: Tue, 10 Sep 2013 03:48:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255438 - in head: sys/amd64/include usr.sbin/bhyve
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 03:48:19 -0000

Author: grehan
Date: Tue Sep 10 03:48:18 2013
New Revision: 255438
URL: http://svnweb.freebsd.org/changeset/base/255438

Log:
  Go way past 11 and bump bhyve's max vCPUs to 16.
  
  This should be sufficient for 10.0 and will do
  until forthcoming work to avoid limitations
  in this area is complete.
  
  Thanks to Bela Lubkin at tidalscale for the
  headsup on the apic/cpu id/io apic ASL parameters
  that are actually hex values and broke when
  written as decimal when 11 vCPUs were configured.
  
  Approved by:	re@

Modified:
  head/sys/amd64/include/vmm.h
  head/usr.sbin/bhyve/acpi.c

Modified: head/sys/amd64/include/vmm.h
==============================================================================
--- head/sys/amd64/include/vmm.h	Tue Sep 10 01:46:47 2013	(r255437)
+++ head/sys/amd64/include/vmm.h	Tue Sep 10 03:48:18 2013	(r255438)
@@ -150,7 +150,7 @@ void vm_interrupt_hostcpu(struct vm *vm,
 
 #include <machine/vmm_instruction_emul.h>
 
-#define	VM_MAXCPU	8			/* maximum virtual cpus */
+#define	VM_MAXCPU	16			/* maximum virtual cpus */
 
 /*
  * Identifiers for events that can be injected into the VM

Modified: head/usr.sbin/bhyve/acpi.c
==============================================================================
--- head/usr.sbin/bhyve/acpi.c	Tue Sep 10 01:46:47 2013	(r255437)
+++ head/usr.sbin/bhyve/acpi.c	Tue Sep 10 03:48:18 2013	(r255438)
@@ -241,8 +241,9 @@ basl_fwrite_madt(FILE *fp)
 	for (i = 0; i < basl_ncpu; i++) {
 		EFPRINTF(fp, "[0001]\t\tSubtable Type : 00\n");
 		EFPRINTF(fp, "[0001]\t\tLength : 08\n");
-		EFPRINTF(fp, "[0001]\t\tProcessor ID : %02d\n", i);
-		EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02d\n", i);
+		/* iasl expects hex values for the proc and apic id's */
+		EFPRINTF(fp, "[0001]\t\tProcessor ID : %02x\n", i);
+		EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i);
 		EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n");
 		EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n");
 		EFPRINTF(fp, "\n");
@@ -251,7 +252,8 @@ basl_fwrite_madt(FILE *fp)
 	/* Always a single IOAPIC entry, with ID ncpu+1 */
 	EFPRINTF(fp, "[0001]\t\tSubtable Type : 01\n");
 	EFPRINTF(fp, "[0001]\t\tLength : 0C\n");
-	EFPRINTF(fp, "[0001]\t\tI/O Apic ID : %02d\n", basl_ncpu);
+	/* iasl expects a hex value for the i/o apic id */
+	EFPRINTF(fp, "[0001]\t\tI/O Apic ID : %02x\n", basl_ncpu);
 	EFPRINTF(fp, "[0001]\t\tReserved : 00\n");
 	EFPRINTF(fp, "[0004]\t\tAddress : fec00000\n");
 	EFPRINTF(fp, "[0004]\t\tInterrupt : 00000000\n");

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 05:17:54 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id F2CAC82D;
 Tue, 10 Sep 2013 05:17:53 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C6B4B2A6D;
 Tue, 10 Sep 2013 05:17:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8A5Hr3h020359;
 Tue, 10 Sep 2013 05:17:53 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8A5HrHY020358;
 Tue, 10 Sep 2013 05:17:53 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309100517.r8A5HrHY020358@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Tue, 10 Sep 2013 05:17:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255439 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 05:17:54 -0000

Author: kib
Date: Tue Sep 10 05:17:53 2013
New Revision: 255439
URL: http://svnweb.freebsd.org/changeset/base/255439

Log:
  Call free() on the pointer returned from malloc().
  
  Reported and tested by:	Oliver Pinter <oliver.pntr@gmail.com>
  Sponsored by:	The FreeBSD Foundation
  MFC after:	3 days
  Approved by:	re (delphij)

Modified:
  head/sys/dev/cpuctl/cpuctl.c

Modified: head/sys/dev/cpuctl/cpuctl.c
==============================================================================
--- head/sys/dev/cpuctl/cpuctl.c	Tue Sep 10 03:48:18 2013	(r255438)
+++ head/sys/dev/cpuctl/cpuctl.c	Tue Sep 10 05:17:53 2013	(r255439)
@@ -295,10 +295,10 @@ cpuctl_do_update(int cpu, cpuctl_update_
 static int
 update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
-	void *ptr = NULL;
+	void *ptr;
 	uint64_t rev0, rev1;
 	uint32_t tmp[4];
-	int is_bound = 0;
+	int is_bound;
 	int oldcpu;
 	int ret;
 
@@ -312,10 +312,11 @@ update_intel(int cpu, cpuctl_update_args
 	}
 
 	/*
-	 * 16 byte alignment required.
+	 * 16 byte alignment required.  Rely on the fact that
+	 * malloc(9) always returns the pointer aligned at least on
+	 * the size of the allocation.
 	 */
 	ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
-	ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
 	if (copyin(args->data, ptr, args->size) != 0) {
 		DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
 		    __LINE__, args->data, ptr, args->size);
@@ -408,10 +409,10 @@ fail:
 static int
 update_via(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
-	void *ptr = NULL;
+	void *ptr;
 	uint64_t rev0, rev1, res;
 	uint32_t tmp[4];
-	int is_bound = 0;
+	int is_bound;
 	int oldcpu;
 	int ret;
 
@@ -427,8 +428,7 @@ update_via(int cpu, cpuctl_update_args_t
 	/*
 	 * 4 byte alignment required.
 	 */
-	ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
-	ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
+	ptr = malloc(args->size, M_CPUCTL, M_WAITOK);
 	if (copyin(args->data, ptr, args->size) != 0) {
 		DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
 		    __LINE__, args->data, ptr, args->size);

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 05:49:32 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 93CA0100;
 Tue, 10 Sep 2013 05:49:32 +0000 (UTC)
 (envelope-from obrien@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 671B12BB2;
 Tue, 10 Sep 2013 05:49:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8A5nWUx038952;
 Tue, 10 Sep 2013 05:49:32 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8A5nVPw038949;
 Tue, 10 Sep 2013 05:49:31 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <201309100549.r8A5nVPw038949@svn.freebsd.org>
From: "David E. O'Brien" <obrien@FreeBSD.org>
Date: Tue, 10 Sep 2013 05:49:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255440 - in head/sys: conf modules/aesni
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 05:49:32 -0000

Author: obrien
Date: Tue Sep 10 05:49:31 2013
New Revision: 255440
URL: http://svnweb.freebsd.org/changeset/base/255440

Log:
  Only use a clang'ism if ${CC} is clang.
  
  Reviewed by:	sjg
  Approved by:	re (kib)

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/modules/aesni/Makefile

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Tue Sep 10 05:17:53 2013	(r255439)
+++ head/sys/conf/files.amd64	Tue Sep 10 05:49:31 2013	(r255440)
@@ -142,7 +142,7 @@ crypto/aesni/aeskeys_amd64.S	optional ae
 crypto/aesni/aesni.c		optional aesni
 aesni_wrap.o			optional aesni				\
 	dependency	"$S/crypto/aesni/aesni_wrap.c"			\
-	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -maes ${.IMPSRC}" \
+	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse ${COMPILER_TYPE:Mclang:S/clang/-maes} ${.IMPSRC}" \
 	no-implicit-rule						\
 	clean		"aesni_wrap.o"
 crypto/blowfish/bf_enc.c	optional	crypto | ipsec

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Tue Sep 10 05:17:53 2013	(r255439)
+++ head/sys/conf/files.i386	Tue Sep 10 05:49:31 2013	(r255440)
@@ -128,7 +128,7 @@ crypto/aesni/aeskeys_i386.S	optional aes
 crypto/aesni/aesni.c		optional aesni
 aesni_wrap.o			optional aesni				\
 	dependency	"$S/crypto/aesni/aesni_wrap.c"			\
-	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -maes ${.IMPSRC}" \
+	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse ${COMPILER_TYPE} ${COMPILER_TYPE:Mclang:S/clang/-maes} ${.IMPSRC}" \
 	no-implicit-rule						\
 	clean		"aesni_wrap.o"
 crypto/des/arch/i386/des_enc.S	optional crypto | ipsec | netsmb

Modified: head/sys/modules/aesni/Makefile
==============================================================================
--- head/sys/modules/aesni/Makefile	Tue Sep 10 05:17:53 2013	(r255439)
+++ head/sys/modules/aesni/Makefile	Tue Sep 10 05:49:31 2013	(r255440)
@@ -12,7 +12,7 @@ OBJS+=	aesni_wrap.o
 # Remove -nostdinc so we can get the intrinsics.
 aesni_wrap.o: aesni_wrap.c
 	${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
-	     -mmmx -msse -maes ${.IMPSRC}
+	     -mmmx -msse ${COMPILER_TYPE:Mclang:S/clang/-maes/} ${.IMPSRC}
 	${CTFCONVERT_CMD}
 
 .include <bsd.kmod.mk>

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 06:01:33 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 60C0A4D6;
 Tue, 10 Sep 2013 06:01:33 +0000 (UTC)
 (envelope-from obrien@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
 [IPv6:2001:1900:2254:206c::16:87])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 49F522C67;
 Tue, 10 Sep 2013 06:01:33 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
 by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r8A61XT4052678;
 Tue, 10 Sep 2013 06:01:33 GMT
 (envelope-from obrien@freefall.freebsd.org)
Received: (from obrien@localhost)
 by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r8A61XBV052586;
 Tue, 10 Sep 2013 06:01:33 GMT (envelope-from obrien)
Date: Mon, 9 Sep 2013 23:01:32 -0700
From: "David O'Brien" <obrien@FreeBSD.org>
To: John-Mark Gurney <jmg@FreeBSD.org>, re@freebsd.org
Subject: Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni
Message-ID: <20130910060132.GA61541@dragon.NUXI.org>
References: <201309031831.r83IVNkh026523@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201309031831.r83IVNkh026523@svn.freebsd.org>
X-Operating-System: FreeBSD 10.0-CURRENT
X-MUA-Host: dragon.NUXI.org
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger?
X-NSA-real-insignia: https://www.eff.org/sites/default/files/nsa-all-your-data.png
User-Agent: Mutt/1.5.20 (2009-06-14)
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.14
Precedence: list
Reply-To: obrien@freebsd.org
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 06:01:33 -0000

On Tue, Sep 03, 2013 at 06:31:23PM +0000, John-Mark Gurney wrote:
> Log:
>   Use the fact that the AES-NI instructions can be pipelined to improve
>   performance... Use SSE2 instructions for calculating the XTS tweek
>   factor...  Let the compiler do more work and handle register allocation
>   by using intrinsics, now only the key schedule is in assembly...

Hi John-Mark,
Unfortunately this does not work with /usr/bin/gcc (which I still use as
/usr/bin/cc on this old IBM T60 laptop due to clang's enormous pestimation
on 'make world' and build times.

Please fix this ASAP or back it out out of 10-CURRENT as it does not work
with /usr/bin/gcc:

1. /usr/bin/gcc cannot handle the "-maes" option.
I committed r255440 to address this.

2. /usr/src/sys/modules/aesni/../../crypto/aesni/aesencdec.h:30:23: error: wmmintrin.h: No such file or directory
and then a cascade of errors follow.

For now, I've sent a patch to re@ for approval to remove the 'aesni'
module from the build if not using clang.  But the LINT build is
still broken with /usr/bin/gcc.


>   Replace .byte hard coded instructions w/ the proper instructions now
>   that both clang and gcc support them...

Is this out-of-tree latest GCC that supports this?

thanks,
-- 
-- David  (obrien@FreeBSD.org)

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 06:41:57 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 2A381EC0;
 Tue, 10 Sep 2013 06:41:57 +0000 (UTC)
 (envelope-from jmg@h2.funkthat.com)
Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id DB3CB2E51;
 Tue, 10 Sep 2013 06:41:56 +0000 (UTC)
Received: from h2.funkthat.com (localhost [127.0.0.1])
 by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r8A6foDt053621
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Mon, 9 Sep 2013 23:41:50 -0700 (PDT)
 (envelope-from jmg@h2.funkthat.com)
Received: (from jmg@localhost)
 by h2.funkthat.com (8.14.3/8.14.3/Submit) id r8A6fnvR053620;
 Mon, 9 Sep 2013 23:41:49 -0700 (PDT) (envelope-from jmg)
Date: Mon, 9 Sep 2013 23:41:49 -0700
From: John-Mark Gurney <jmg@funkthat.com>
To: "David O'Brien" <obrien@FreeBSD.org>
Subject: Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni
Message-ID: <20130910064149.GS68682@funkthat.com>
References: <201309031831.r83IVNkh026523@svn.freebsd.org>
 <20130910060132.GA61541@dragon.NUXI.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130910060132.GA61541@dragon.NUXI.org>
User-Agent: Mutt/1.4.2.3i
X-Operating-System: FreeBSD 7.2-RELEASE i386
X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88  9322 9CB1 8F74 6D3F A396
X-Files: The truth is out there
X-URL: http://resnet.uoregon.edu/~gurney_j/
X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger?
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
 (h2.funkthat.com [127.0.0.1]); Mon, 09 Sep 2013 23:41:50 -0700 (PDT)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, re@FreeBSD.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 06:41:57 -0000

David O'Brien wrote this message on Mon, Sep 09, 2013 at 23:01 -0700:
> On Tue, Sep 03, 2013 at 06:31:23PM +0000, John-Mark Gurney wrote:
> > Log:
> >   Use the fact that the AES-NI instructions can be pipelined to improve
> >   performance... Use SSE2 instructions for calculating the XTS tweek
> >   factor...  Let the compiler do more work and handle register allocation
> >   by using intrinsics, now only the key schedule is in assembly...
> 
> Hi John-Mark,
> Unfortunately this does not work with /usr/bin/gcc (which I still use as
> /usr/bin/cc on this old IBM T60 laptop due to clang's enormous pestimation
> on 'make world' and build times.
> 
> Please fix this ASAP or back it out out of 10-CURRENT as it does not work
> with /usr/bin/gcc:
> 
> 1. /usr/bin/gcc cannot handle the "-maes" option.
> I committed r255440 to address this.

Please back that out until you have an understand of what the real
problem is...  I'm sad that the commit was approved w/o bothering to
attempt to figure out the problem...

> 2. /usr/src/sys/modules/aesni/../../crypto/aesni/aesencdec.h:30:23: error: wmmintrin.h: No such file or directory
> and then a cascade of errors follow.

Sounds like you don't have the latest in-tree gcc... I've been
compiling the AES module w/ the in tree gcc for a while..  This is
w/ the changes in r255185...

> For now, I've sent a patch to re@ for approval to remove the 'aesni'
> module from the build if not using clang.  But the LINT build is
> still broken with /usr/bin/gcc.

I'll strongly object to this change...

> >   Replace .byte hard coded instructions w/ the proper instructions now
> >   that both clang and gcc support them...
> 
> Is this out-of-tree latest GCC that supports this?

Nope, in-tree...  Sounds like you haven't installed the latest version
of gcc in tree...

It could be a problem with a bad interaction w/ delete-old as glebius
added the wmmintrin.h header to the delete-old target in r255354...

I'll take a closer look at this in the morning, but next time please
attempt to contact the author before taking such actions...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 09:23:23 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
 id C56426CF; Tue, 10 Sep 2013 09:23:23 +0000 (UTC)
Date: Tue, 10 Sep 2013 09:23:23 +0000
From: Alexey Dokuchaev <danfe@FreeBSD.org>
To: John Baldwin <jhb@FreeBSD.org>
Subject: Re: svn commit: r255426 - in head: lib/libc/sys sys/compat/freebsd32
 sys/compat/linux sys/compat/svr4 sys/dev/drm2/i915 sys/i386/ibcs2
 sys/i386/linux sys/ia64/ia32 sys/kern sys/sparc64/sparc64 sys/sys ...
Message-ID: <20130910092323.GA58955@FreeBSD.org>
References: <201309091812.r89IC0YH015840@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201309091812.r89IC0YH015840@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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 09:23:23 -0000

On Mon, Sep 09, 2013 at 06:12:00PM +0000, John Baldwin wrote:
> New Revision: 255426
> URL: http://svnweb.freebsd.org/changeset/base/255426
> 
> Log:
> [...]
>   To facilitate this, add a new parameter to vm_map_find() that specifies an
>   optional maximum virtual address.  While here, fix several callers of
>   vm_map_find() to use a VMFS_* constant for the findspace argument instead
>   of TRUE and FALSE.

This commit breaks NVidia driver port, and (again) there was no corresponding
__FreeBSD_version bump.

This is another recent incident with -CURRENT silently changing KPIs that are
publicly used.

./danfe

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 09:33:50 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id AF0009DD;
 Tue, 10 Sep 2013 09:33:50 +0000 (UTC) (envelope-from fidaj@ukr.net)
Received: from fsm1.ukr.net (fsm1.ukr.net [195.214.192.120])
 (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 524B92782;
 Tue, 10 Sep 2013 09:33:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net;
 s=fsm; 
 h=Content-Transfer-Encoding:Content-Type:Mime-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date;
 bh=W9tVNNocxy8EkpFSHpyjAc/enAxk0Xw7ZO6WFKGo2AQ=; 
 b=UVnsLkSpOXF1QzoMGdSa+XiqG014HPe7wsDWqCUVCmFjSB7TDr9rBGYXR3wY6fjmuYmhD83FrUUSBxCbM9GyqOnR/7v6KSUorXvpeEuff12jfcxRCB/YDZTh6Sq3eiiwhmLbK+nykev804PTUjZE26CpjXgtdJZVOCcW9SG4OGs=;
Received: from [178.137.138.140] (helo=nonamehost.local)
 by fsm1.ukr.net with esmtpsa ID 1VJKKP-0001Bf-BV
 ; Tue, 10 Sep 2013 12:33:45 +0300
Date: Tue, 10 Sep 2013 12:33:44 +0300
From: Ivan Klymenko <fidaj@ukr.net>
To: Alexey Dokuchaev <danfe@FreeBSD.org>
Subject: Re: svn commit: r255426 - in head: lib/libc/sys
 sys/compat/freebsd32 sys/compat/linux sys/compat/svr4 sys/dev/drm2/i915
 sys/i386/ibcs2 sys/i386/linux sys/ia64/ia32 sys/kern sys/sparc64/sparc64
 sys/sys ...
Message-ID: <20130910123344.100bc664@nonamehost.local>
In-Reply-To: <20130910092323.GA58955@FreeBSD.org>
References: <201309091812.r89IC0YH015840@svn.freebsd.org>
 <20130910092323.GA58955@FreeBSD.org>
X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; amd64-portbld-freebsd10.0)
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Authentication-Result: IP=178.137.138.140; mail.from=fidaj@ukr.net; dkim=pass;
 header.d=ukr.net
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, John Baldwin <jhb@FreeBSD.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 09:33:50 -0000

=D0=92 Tue, 10 Sep 2013 09:23:23 +0000
Alexey Dokuchaev <danfe@FreeBSD.org> =D0=BF=D0=B8=D1=88=D0=B5=D1=82:

> This commit breaks NVidia driver port
and emulators/virtualbox-ose-kmod* too

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:06:00 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 94F67CD3;
 Tue, 10 Sep 2013 10:06:00 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 734BA2A25;
 Tue, 10 Sep 2013 10:06:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AA60Dd096475;
 Tue, 10 Sep 2013 10:06:00 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AA5xNN096462;
 Tue, 10 Sep 2013 10:05:59 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101005.r8AA5xNN096462@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 10:05:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255442 - in head/sys: fs/nullfs kern net netinet6 netnatm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:06:00 -0000

Author: des
Date: Tue Sep 10 10:05:59 2013
New Revision: 255442
URL: http://svnweb.freebsd.org/changeset/base/255442

Log:
  Fix the length calculation for the final block of a sendfile(2)
  transmission which could be tricked into rounding up to the nearest
  page size, leaking up to a page of kernel memory.  [13:11]
  
  In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
  and SIOCSIFNETMASK at the socket layer rather than pass them on to the
  link layer without validation or credential checks.  [SA-13:12]
  
  Prevent cross-mount hardlinks between different nullfs mounts of the
  same underlying filesystem.  [SA-13:13]
  
  Security:	CVE-2013-5666
  Security:	FreeBSD-SA-13:11.sendfile
  Security:	CVE-2013-5691
  Security:	FreeBSD-SA-13:12.ifioctl
  Security:	CVE-2013-5710
  Security:	FreeBSD-SA-13:13.nullfs
  Approved by:	re

Modified:
  head/sys/fs/nullfs/null_vnops.c
  head/sys/kern/uipc_syscalls.c
  head/sys/net/if.c
  head/sys/netinet6/in6.c
  head/sys/netnatm/natm.c

Modified: head/sys/fs/nullfs/null_vnops.c
==============================================================================
--- head/sys/fs/nullfs/null_vnops.c	Tue Sep 10 05:59:09 2013	(r255441)
+++ head/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:05:59 2013	(r255442)
@@ -858,6 +858,15 @@ null_vptocnp(struct vop_vptocnp_args *ap
 	return (error);
 }
 
+static int
+null_link(struct vop_link_args *ap)
+{
+
+	if (ap->a_tdvp->v_mount != ap->a_vp->v_mount)
+		return (EXDEV);
+	return (null_bypass((struct vop_generic_args *)ap));
+}
+
 /*
  * Global vfs data structures
  */
@@ -871,6 +880,7 @@ struct vop_vector null_vnodeops = {
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,
 	.vop_islocked =		vop_stdislocked,
+	.vop_link =		null_link,
 	.vop_lock1 =		null_lock,
 	.vop_lookup =		null_lookup,
 	.vop_open =		null_open,

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Tue Sep 10 05:59:09 2013	(r255441)
+++ head/sys/kern/uipc_syscalls.c	Tue Sep 10 10:05:59 2013	(r255442)
@@ -2221,11 +2221,10 @@ retry_space:
 			 * or the passed in nbytes.
 			 */
 			pgoff = (vm_offset_t)(off & PAGE_MASK);
-			if (nbytes)
-				rem = (nbytes - fsbytes - loopbytes);
-			else
-				rem = va.va_size -
-				    offset - fsbytes - loopbytes;
+			rem = va.va_size - offset;
+			if (nbytes != 0)
+				rem = omin(rem, nbytes);
+			rem -= fsbytes + loopbytes;
 			xfsize = omin(PAGE_SIZE - pgoff, rem);
 			xfsize = omin(space - loopbytes, xfsize);
 			if (xfsize <= 0) {

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Tue Sep 10 05:59:09 2013	(r255441)
+++ head/sys/net/if.c	Tue Sep 10 10:05:59 2013	(r255442)
@@ -2553,11 +2553,23 @@ ifioctl(struct socket *so, u_long cmd, c
 		CURVNET_RESTORE();
 		return (EOPNOTSUPP);
 	}
+
+	/*
+	 * Pass the request on to the socket control method, and if the
+	 * latter returns EOPNOTSUPP, directly to the interface.
+	 *
+	 * Make an exception for the legacy SIOCSIF* requests.  Drivers
+	 * trust SIOCSIFADDR et al to come from an already privileged
+	 * layer, and do not perform any credentials checks or input
+	 * validation.
+	 */
 #ifndef COMPAT_43
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
-	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL &&
+	    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+	    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
@@ -2601,7 +2613,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   data,
 								   ifp, td));
 		if (error == EOPNOTSUPP && ifp != NULL &&
-		    ifp->if_ioctl != NULL)
+		    ifp->if_ioctl != NULL &&
+		    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+		    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Tue Sep 10 05:59:09 2013	(r255441)
+++ head/sys/netinet6/in6.c	Tue Sep 10 10:05:59 2013	(r255442)
@@ -431,6 +431,18 @@ in6_control(struct socket *so, u_long cm
 	case SIOCGIFSTAT_ICMP6:
 		sa6 = &ifr->ifr_addr;
 		break;
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-INET6 ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
 	default:
 		sa6 = NULL;
 		break;

Modified: head/sys/netnatm/natm.c
==============================================================================
--- head/sys/netnatm/natm.c	Tue Sep 10 05:59:09 2013	(r255441)
+++ head/sys/netnatm/natm.c	Tue Sep 10 10:05:59 2013	(r255442)
@@ -339,6 +339,21 @@ natm_usr_control(struct socket *so, u_lo
 	npcb = (struct natmpcb *)so->so_pcb;
 	KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL"));
 
+	switch (cmd) {
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-ATM ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
+	}
+
 	if (ifp == NULL || ifp->if_ioctl == NULL)
 		return (EOPNOTSUPP);
 	return ((*ifp->if_ioctl)(ifp, cmd, arg));

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:07:23 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 15D2BE27;
 Tue, 10 Sep 2013 10:07:23 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E6B462A39;
 Tue, 10 Sep 2013 10:07:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AA7MKN097289;
 Tue, 10 Sep 2013 10:07:22 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AA7LWJ097283;
 Tue, 10 Sep 2013 10:07:21 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101007.r8AA7LWJ097283@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 10:07: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: r255443 - in stable/9/sys: fs/nullfs kern net netinet6
 netnatm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:07:23 -0000

Author: des
Date: Tue Sep 10 10:07:21 2013
New Revision: 255443
URL: http://svnweb.freebsd.org/changeset/base/255443

Log:
  Fix the length calculation for the final block of a sendfile(2)
  transmission which could be tricked into rounding up to the nearest
  page size, leaking up to a page of kernel memory.  [13:11]
  
  In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
  and SIOCSIFNETMASK at the socket layer rather than pass them on to the
  link layer without validation or credential checks.  [SA-13:12]
  
  Prevent cross-mount hardlinks between different nullfs mounts of the
  same underlying filesystem.  [SA-13:13]
  
  Security:	CVE-2013-5666
  Security:	FreeBSD-SA-13:11.sendfile
  Security:	CVE-2013-5691
  Security:	FreeBSD-SA-13:12.ifioctl
  Security:	CVE-2013-5710
  Security:	FreeBSD-SA-13:13.nullfs
  Approved by:	so

Modified:
  stable/9/sys/fs/nullfs/null_vnops.c
  stable/9/sys/kern/uipc_syscalls.c
  stable/9/sys/net/if.c
  stable/9/sys/netinet6/in6.c
  stable/9/sys/netnatm/natm.c

Modified: stable/9/sys/fs/nullfs/null_vnops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:05:59 2013	(r255442)
+++ stable/9/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:07:21 2013	(r255443)
@@ -858,6 +858,15 @@ null_vptocnp(struct vop_vptocnp_args *ap
 	return (error);
 }
 
+static int
+null_link(struct vop_link_args *ap)
+{
+
+	if (ap->a_tdvp->v_mount != ap->a_vp->v_mount)
+		return (EXDEV);
+	return (null_bypass((struct vop_generic_args *)ap));
+}
+
 /*
  * Global vfs data structures
  */
@@ -871,6 +880,7 @@ struct vop_vector null_vnodeops = {
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,
 	.vop_islocked =		vop_stdislocked,
+	.vop_link =		null_link,
 	.vop_lock1 =		null_lock,
 	.vop_lookup =		null_lookup,
 	.vop_open =		null_open,

Modified: stable/9/sys/kern/uipc_syscalls.c
==============================================================================
--- stable/9/sys/kern/uipc_syscalls.c	Tue Sep 10 10:05:59 2013	(r255442)
+++ stable/9/sys/kern/uipc_syscalls.c	Tue Sep 10 10:07:21 2013	(r255443)
@@ -2126,11 +2126,10 @@ retry_space:
 			 * or the passed in nbytes.
 			 */
 			pgoff = (vm_offset_t)(off & PAGE_MASK);
-			if (uap->nbytes)
-				rem = (uap->nbytes - fsbytes - loopbytes);
-			else
-				rem = va.va_size -
-				    uap->offset - fsbytes - loopbytes;
+			rem = va.va_size - uap->offset;
+			if (uap->nbytes != 0)
+				rem = omin(rem, uap->nbytes);
+			rem -= fsbytes + loopbytes;
 			xfsize = omin(PAGE_SIZE - pgoff, rem);
 			xfsize = omin(space - loopbytes, xfsize);
 			if (xfsize <= 0) {

Modified: stable/9/sys/net/if.c
==============================================================================
--- stable/9/sys/net/if.c	Tue Sep 10 10:05:59 2013	(r255442)
+++ stable/9/sys/net/if.c	Tue Sep 10 10:07:21 2013	(r255443)
@@ -2555,11 +2555,23 @@ ifioctl(struct socket *so, u_long cmd, c
 		CURVNET_RESTORE();
 		return (EOPNOTSUPP);
 	}
+
+	/*
+	 * Pass the request on to the socket control method, and if the
+	 * latter returns EOPNOTSUPP, directly to the interface.
+	 *
+	 * Make an exception for the legacy SIOCSIF* requests.  Drivers
+	 * trust SIOCSIFADDR et al to come from an already privileged
+	 * layer, and do not perform any credentials checks or input
+	 * validation.
+	 */
 #ifndef COMPAT_43
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
-	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL &&
+	    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+	    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
@@ -2603,7 +2615,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   data,
 								   ifp, td));
 		if (error == EOPNOTSUPP && ifp != NULL &&
-		    ifp->if_ioctl != NULL)
+		    ifp->if_ioctl != NULL &&
+		    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+		    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 

Modified: stable/9/sys/netinet6/in6.c
==============================================================================
--- stable/9/sys/netinet6/in6.c	Tue Sep 10 10:05:59 2013	(r255442)
+++ stable/9/sys/netinet6/in6.c	Tue Sep 10 10:07:21 2013	(r255443)
@@ -422,6 +422,18 @@ in6_control(struct socket *so, u_long cm
 	case SIOCGIFSTAT_ICMP6:
 		sa6 = &ifr->ifr_addr;
 		break;
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-INET6 ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
 	default:
 		sa6 = NULL;
 		break;

Modified: stable/9/sys/netnatm/natm.c
==============================================================================
--- stable/9/sys/netnatm/natm.c	Tue Sep 10 10:05:59 2013	(r255442)
+++ stable/9/sys/netnatm/natm.c	Tue Sep 10 10:07:21 2013	(r255443)
@@ -339,6 +339,21 @@ natm_usr_control(struct socket *so, u_lo
 	npcb = (struct natmpcb *)so->so_pcb;
 	KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL"));
 
+	switch (cmd) {
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-ATM ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
+	}
+
 	if (ifp == NULL || ifp->if_ioctl == NULL)
 		return (EOPNOTSUPP);
 	return ((*ifp->if_ioctl)(ifp, cmd, arg));

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:08:21 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C5C34F68;
 Tue, 10 Sep 2013 10:08:21 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A34622A4D;
 Tue, 10 Sep 2013 10:08:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AA8LMc097845;
 Tue, 10 Sep 2013 10:08:21 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AA8KJa097830;
 Tue, 10 Sep 2013 10:08:20 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101008.r8AA8KJa097830@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 10:08:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255444 - in releng/9.2/sys: conf fs/nullfs net netinet6
 netnatm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:08:21 -0000

Author: des
Date: Tue Sep 10 10:08:20 2013
New Revision: 255444
URL: http://svnweb.freebsd.org/changeset/base/255444

Log:
  In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
  and SIOCSIFNETMASK at the socket layer rather than pass them on to the
  link layer without validation or credential checks.  [SA-13:12]
  
  Prevent cross-mount hardlinks between different nullfs mounts of the
  same underlying filesystem.  [SA-13:13]
  
  Security:	CVE-2013-5691
  Security:	FreeBSD-SA-13:12.ifioctl
  Security:	CVE-2013-5710
  Security:	FreeBSD-SA-13:13.nullfs
  Approved by:	re

Modified:
  releng/9.2/sys/conf/newvers.sh
  releng/9.2/sys/fs/nullfs/null_vnops.c
  releng/9.2/sys/net/if.c
  releng/9.2/sys/netinet6/in6.c
  releng/9.2/sys/netnatm/natm.c

Modified: releng/9.2/sys/conf/newvers.sh
==============================================================================
--- releng/9.2/sys/conf/newvers.sh	Tue Sep 10 10:07:21 2013	(r255443)
+++ releng/9.2/sys/conf/newvers.sh	Tue Sep 10 10:08:20 2013	(r255444)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="9.2"
-BRANCH="RC3"
+BRANCH="RC3-p1"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/9.2/sys/fs/nullfs/null_vnops.c
==============================================================================
--- releng/9.2/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:07:21 2013	(r255443)
+++ releng/9.2/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:08:20 2013	(r255444)
@@ -858,6 +858,15 @@ null_vptocnp(struct vop_vptocnp_args *ap
 	return (error);
 }
 
+static int
+null_link(struct vop_link_args *ap)
+{
+
+	if (ap->a_tdvp->v_mount != ap->a_vp->v_mount)
+		return (EXDEV);
+	return (null_bypass((struct vop_generic_args *)ap));
+}
+
 /*
  * Global vfs data structures
  */
@@ -871,6 +880,7 @@ struct vop_vector null_vnodeops = {
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,
 	.vop_islocked =		vop_stdislocked,
+	.vop_link =		null_link,
 	.vop_lock1 =		null_lock,
 	.vop_lookup =		null_lookup,
 	.vop_open =		null_open,

Modified: releng/9.2/sys/net/if.c
==============================================================================
--- releng/9.2/sys/net/if.c	Tue Sep 10 10:07:21 2013	(r255443)
+++ releng/9.2/sys/net/if.c	Tue Sep 10 10:08:20 2013	(r255444)
@@ -2555,11 +2555,23 @@ ifioctl(struct socket *so, u_long cmd, c
 		CURVNET_RESTORE();
 		return (EOPNOTSUPP);
 	}
+
+	/*
+	 * Pass the request on to the socket control method, and if the
+	 * latter returns EOPNOTSUPP, directly to the interface.
+	 *
+	 * Make an exception for the legacy SIOCSIF* requests.  Drivers
+	 * trust SIOCSIFADDR et al to come from an already privileged
+	 * layer, and do not perform any credentials checks or input
+	 * validation.
+	 */
 #ifndef COMPAT_43
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
-	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL &&
+	    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+	    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
@@ -2603,7 +2615,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   data,
 								   ifp, td));
 		if (error == EOPNOTSUPP && ifp != NULL &&
-		    ifp->if_ioctl != NULL)
+		    ifp->if_ioctl != NULL &&
+		    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+		    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 

Modified: releng/9.2/sys/netinet6/in6.c
==============================================================================
--- releng/9.2/sys/netinet6/in6.c	Tue Sep 10 10:07:21 2013	(r255443)
+++ releng/9.2/sys/netinet6/in6.c	Tue Sep 10 10:08:20 2013	(r255444)
@@ -422,6 +422,18 @@ in6_control(struct socket *so, u_long cm
 	case SIOCGIFSTAT_ICMP6:
 		sa6 = &ifr->ifr_addr;
 		break;
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-INET6 ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
 	default:
 		sa6 = NULL;
 		break;

Modified: releng/9.2/sys/netnatm/natm.c
==============================================================================
--- releng/9.2/sys/netnatm/natm.c	Tue Sep 10 10:07:21 2013	(r255443)
+++ releng/9.2/sys/netnatm/natm.c	Tue Sep 10 10:08:20 2013	(r255444)
@@ -339,6 +339,21 @@ natm_usr_control(struct socket *so, u_lo
 	npcb = (struct natmpcb *)so->so_pcb;
 	KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL"));
 
+	switch (cmd) {
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-ATM ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
+	}
+
 	if (ifp == NULL || ifp->if_ioctl == NULL)
 		return (EOPNOTSUPP);
 	return ((*ifp->if_ioctl)(ifp, cmd, arg));

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:12:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8FB7E1FA;
 Tue, 10 Sep 2013 10:12:10 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6CC492AAE;
 Tue, 10 Sep 2013 10:12:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AACAwx001297;
 Tue, 10 Sep 2013 10:12:10 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AAC9hY001288;
 Tue, 10 Sep 2013 10:12:09 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101012.r8AAC9hY001288@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 10:12:09 +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: r255445 - in stable/8/sys: fs/nullfs net netinet6 netnatm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:12:10 -0000

Author: des
Date: Tue Sep 10 10:12:09 2013
New Revision: 255445
URL: http://svnweb.freebsd.org/changeset/base/255445

Log:
  In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
  and SIOCSIFNETMASK at the socket layer rather than pass them on to the
  link layer without validation or credential checks.  [SA-13:12]
  
  Prevent cross-mount hardlinks between different nullfs mounts of the
  same underlying filesystem.  [SA-13:13]
  
  Security:	CVE-2013-5691
  Security:	FreeBSD-SA-13:12.ifioctl
  Security:	CVE-2013-5710
  Security:	FreeBSD-SA-13:13.nullfs
  Approved by:	so

Modified:
  stable/8/sys/fs/nullfs/null_vnops.c
  stable/8/sys/net/if.c
  stable/8/sys/netinet6/in6.c
  stable/8/sys/netnatm/natm.c

Modified: stable/8/sys/fs/nullfs/null_vnops.c
==============================================================================
--- stable/8/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:08:20 2013	(r255444)
+++ stable/8/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:12:09 2013	(r255445)
@@ -816,6 +816,15 @@ null_vptocnp(struct vop_vptocnp_args *ap
 	return (error);
 }
 
+static int
+null_link(struct vop_link_args *ap)
+{
+
+	if (ap->a_tdvp->v_mount != ap->a_vp->v_mount)
+		return (EXDEV);
+	return (null_bypass((struct vop_generic_args *)ap));
+}
+
 /*
  * Global vfs data structures
  */
@@ -828,6 +837,7 @@ struct vop_vector null_vnodeops = {
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,
 	.vop_islocked =		vop_stdislocked,
+	.vop_link =		null_link,
 	.vop_lock1 =		null_lock,
 	.vop_lookup =		null_lookup,
 	.vop_open =		null_open,

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Tue Sep 10 10:08:20 2013	(r255444)
+++ stable/8/sys/net/if.c	Tue Sep 10 10:12:09 2013	(r255445)
@@ -2603,11 +2603,23 @@ ifioctl(struct socket *so, u_long cmd, c
 		CURVNET_RESTORE();
 		return (EOPNOTSUPP);
 	}
+
+	/*
+	 * Pass the request on to the socket control method, and if the
+	 * latter returns EOPNOTSUPP, directly to the interface.
+	 *
+	 * Make an exception for the legacy SIOCSIF* requests.  Drivers
+	 * trust SIOCSIFADDR et al to come from an already privileged
+	 * layer, and do not perform any credentials checks or input
+	 * validation.
+	 */
 #ifndef COMPAT_43
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
-	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL &&
+	    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+	    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
@@ -2651,7 +2663,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   data,
 								   ifp, td));
 		if (error == EOPNOTSUPP && ifp != NULL &&
-		    ifp->if_ioctl != NULL)
+		    ifp->if_ioctl != NULL &&
+		    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+		    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 

Modified: stable/8/sys/netinet6/in6.c
==============================================================================
--- stable/8/sys/netinet6/in6.c	Tue Sep 10 10:08:20 2013	(r255444)
+++ stable/8/sys/netinet6/in6.c	Tue Sep 10 10:12:09 2013	(r255445)
@@ -344,6 +344,18 @@ in6_control(struct socket *so, u_long cm
 	case SIOCGIFSTAT_ICMP6:
 		sa6 = &ifr->ifr_addr;
 		break;
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-INET6 ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
 	default:
 		sa6 = NULL;
 		break;

Modified: stable/8/sys/netnatm/natm.c
==============================================================================
--- stable/8/sys/netnatm/natm.c	Tue Sep 10 10:08:20 2013	(r255444)
+++ stable/8/sys/netnatm/natm.c	Tue Sep 10 10:12:09 2013	(r255445)
@@ -339,6 +339,21 @@ natm_usr_control(struct socket *so, u_lo
 	npcb = (struct natmpcb *)so->so_pcb;
 	KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL"));
 
+	switch (cmd) {
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-ATM ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
+	}
+
 	if (ifp == NULL || ifp->if_ioctl == NULL)
 		return (EOPNOTSUPP);
 	return ((*ifp->if_ioctl)(ifp, cmd, arg));

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:13:16 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 92B8033E;
 Tue, 10 Sep 2013 10:13:16 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7E6642ABA;
 Tue, 10 Sep 2013 10:13:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AADGpM001832;
 Tue, 10 Sep 2013 10:13:16 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AADFwF001822;
 Tue, 10 Sep 2013 10:13:15 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101013.r8AADFwF001822@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 10:13:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255446 - in releng/8.3: . sys/conf sys/fs/nullfs sys/net
 sys/netinet6 sys/netnatm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:13:16 -0000

Author: des
Date: Tue Sep 10 10:13:14 2013
New Revision: 255446
URL: http://svnweb.freebsd.org/changeset/base/255446

Log:
  In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
  and SIOCSIFNETMASK at the socket layer rather than pass them on to the
  link layer without validation or credential checks.  [SA-13:12]
  
  Prevent cross-mount hardlinks between different nullfs mounts of the
  same underlying filesystem.  [SA-13:13]
  
  Security:	CVE-2013-5691
  Security:	FreeBSD-SA-13:12.ifioctl
  Security:	CVE-2013-5710
  Security:	FreeBSD-SA-13:13.nullfs
  Approved by:	so

Modified:
  releng/8.3/UPDATING
  releng/8.3/sys/conf/newvers.sh
  releng/8.3/sys/fs/nullfs/null_vnops.c
  releng/8.3/sys/net/if.c
  releng/8.3/sys/netinet6/in6.c
  releng/8.3/sys/netnatm/natm.c

Modified: releng/8.3/UPDATING
==============================================================================
--- releng/8.3/UPDATING	Tue Sep 10 10:12:09 2013	(r255445)
+++ releng/8.3/UPDATING	Tue Sep 10 10:13:14 2013	(r255446)
@@ -15,6 +15,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	debugging tools present in HEAD were left in place because
 	sun4v support still needs work to become production ready.
 
+20130910:	p11	FreeBSD-SA-13:12.ifioctl
+			FreeBSD-SA-13:13.nullfs
+
+	In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR,
+	SIOCSIFDSTADDR and SIOCSIFNETMASK at the socket layer rather
+	than pass them on to the link layer without validation or
+	credential checks.  [SA-13:12]
+
+	Prevent cross-mount hardlinks between different nullfs mounts
+	of the same underlying filesystem.  [SA-13:13]
+
 20130822:	p10	FreeBSD-SA-13:09.ip_multicast
 			FreeBSD-SA-13:10.sctp
 	Fix an integer overflow in computing the size of a temporary buffer

Modified: releng/8.3/sys/conf/newvers.sh
==============================================================================
--- releng/8.3/sys/conf/newvers.sh	Tue Sep 10 10:12:09 2013	(r255445)
+++ releng/8.3/sys/conf/newvers.sh	Tue Sep 10 10:13:14 2013	(r255446)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="8.3"
-BRANCH="RELEASE-p10"
+BRANCH="RELEASE-p11"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/8.3/sys/fs/nullfs/null_vnops.c
==============================================================================
--- releng/8.3/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:12:09 2013	(r255445)
+++ releng/8.3/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:13:14 2013	(r255446)
@@ -817,6 +817,15 @@ null_vptocnp(struct vop_vptocnp_args *ap
 	return (error);
 }
 
+static int
+null_link(struct vop_link_args *ap)
+{
+
+	if (ap->a_tdvp->v_mount != ap->a_vp->v_mount)
+		return (EXDEV);
+	return (null_bypass((struct vop_generic_args *)ap));
+}
+
 /*
  * Global vfs data structures
  */
@@ -829,6 +838,7 @@ struct vop_vector null_vnodeops = {
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,
 	.vop_islocked =		vop_stdislocked,
+	.vop_link =		null_link,
 	.vop_lock1 =		null_lock,
 	.vop_lookup =		null_lookup,
 	.vop_open =		null_open,

Modified: releng/8.3/sys/net/if.c
==============================================================================
--- releng/8.3/sys/net/if.c	Tue Sep 10 10:12:09 2013	(r255445)
+++ releng/8.3/sys/net/if.c	Tue Sep 10 10:13:14 2013	(r255446)
@@ -2606,11 +2606,23 @@ ifioctl(struct socket *so, u_long cmd, c
 		CURVNET_RESTORE();
 		return (EOPNOTSUPP);
 	}
+
+	/*
+	 * Pass the request on to the socket control method, and if the
+	 * latter returns EOPNOTSUPP, directly to the interface.
+	 *
+	 * Make an exception for the legacy SIOCSIF* requests.  Drivers
+	 * trust SIOCSIFADDR et al to come from an already privileged
+	 * layer, and do not perform any credentials checks or input
+	 * validation.
+	 */
 #ifndef COMPAT_43
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
-	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL &&
+	    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+	    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
@@ -2654,7 +2666,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   data,
 								   ifp, td));
 		if (error == EOPNOTSUPP && ifp != NULL &&
-		    ifp->if_ioctl != NULL)
+		    ifp->if_ioctl != NULL &&
+		    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+		    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 

Modified: releng/8.3/sys/netinet6/in6.c
==============================================================================
--- releng/8.3/sys/netinet6/in6.c	Tue Sep 10 10:12:09 2013	(r255445)
+++ releng/8.3/sys/netinet6/in6.c	Tue Sep 10 10:13:14 2013	(r255446)
@@ -339,6 +339,18 @@ in6_control(struct socket *so, u_long cm
 	case SIOCGIFSTAT_ICMP6:
 		sa6 = &ifr->ifr_addr;
 		break;
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-INET6 ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
 	default:
 		sa6 = NULL;
 		break;

Modified: releng/8.3/sys/netnatm/natm.c
==============================================================================
--- releng/8.3/sys/netnatm/natm.c	Tue Sep 10 10:12:09 2013	(r255445)
+++ releng/8.3/sys/netnatm/natm.c	Tue Sep 10 10:13:14 2013	(r255446)
@@ -339,6 +339,21 @@ natm_usr_control(struct socket *so, u_lo
 	npcb = (struct natmpcb *)so->so_pcb;
 	KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL"));
 
+	switch (cmd) {
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-ATM ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
+	}
+
 	if (ifp == NULL || ifp->if_ioctl == NULL)
 		return (EOPNOTSUPP);
 	return ((*ifp->if_ioctl)(ifp, cmd, arg));

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:14:20 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C4AFD472;
 Tue, 10 Sep 2013 10:14:20 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B16882AC6;
 Tue, 10 Sep 2013 10:14:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AAEK30002387;
 Tue, 10 Sep 2013 10:14:20 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AAEJHZ002344;
 Tue, 10 Sep 2013 10:14:19 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101014.r8AAEJHZ002344@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 10:14:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255447 - in releng/8.4: . sys/conf sys/fs/nullfs sys/net
 sys/netinet6 sys/netnatm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:14:20 -0000

Author: des
Date: Tue Sep 10 10:14:19 2013
New Revision: 255447
URL: http://svnweb.freebsd.org/changeset/base/255447

Log:
  In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
  and SIOCSIFNETMASK at the socket layer rather than pass them on to the
  link layer without validation or credential checks.  [SA-13:12]
  
  Prevent cross-mount hardlinks between different nullfs mounts of the
  same underlying filesystem.  [SA-13:13]
  
  Security:	CVE-2013-5691
  Security:	FreeBSD-SA-13:12.ifioctl
  Security:	CVE-2013-5710
  Security:	FreeBSD-SA-13:13.nullfs
  Approved by:	so

Modified:
  releng/8.4/UPDATING
  releng/8.4/sys/conf/newvers.sh
  releng/8.4/sys/fs/nullfs/null_vnops.c
  releng/8.4/sys/net/if.c
  releng/8.4/sys/netinet6/in6.c
  releng/8.4/sys/netnatm/natm.c

Modified: releng/8.4/UPDATING
==============================================================================
--- releng/8.4/UPDATING	Tue Sep 10 10:13:14 2013	(r255446)
+++ releng/8.4/UPDATING	Tue Sep 10 10:14:19 2013	(r255447)
@@ -15,6 +15,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	debugging tools present in HEAD were left in place because
 	sun4v support still needs work to become production ready.
 
+20130910:	p4	FreeBSD-SA-13:12.ifioctl
+			FreeBSD-SA-13:13.nullfs
+
+	In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR,
+	SIOCSIFDSTADDR and SIOCSIFNETMASK at the socket layer rather
+	than pass them on to the link layer without validation or
+	credential checks.  [SA-13:12]
+
+	Prevent cross-mount hardlinks between different nullfs mounts
+	of the same underlying filesystem.  [SA-13:13]
+
 20130822:	p3	FreeBSD-SA-13:09.ip_multicast
 			FreeBSD-SA-13:10.sctp
 	Fix an integer overflow in computing the size of a temporary buffer

Modified: releng/8.4/sys/conf/newvers.sh
==============================================================================
--- releng/8.4/sys/conf/newvers.sh	Tue Sep 10 10:13:14 2013	(r255446)
+++ releng/8.4/sys/conf/newvers.sh	Tue Sep 10 10:14:19 2013	(r255447)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="8.4"
-BRANCH="RELEASE-p3"
+BRANCH="RELEASE-p4"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/8.4/sys/fs/nullfs/null_vnops.c
==============================================================================
--- releng/8.4/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:13:14 2013	(r255446)
+++ releng/8.4/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:14:19 2013	(r255447)
@@ -816,6 +816,15 @@ null_vptocnp(struct vop_vptocnp_args *ap
 	return (error);
 }
 
+static int
+null_link(struct vop_link_args *ap)
+{
+
+	if (ap->a_tdvp->v_mount != ap->a_vp->v_mount)
+		return (EXDEV);
+	return (null_bypass((struct vop_generic_args *)ap));
+}
+
 /*
  * Global vfs data structures
  */
@@ -828,6 +837,7 @@ struct vop_vector null_vnodeops = {
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,
 	.vop_islocked =		vop_stdislocked,
+	.vop_link =		null_link,
 	.vop_lock1 =		null_lock,
 	.vop_lookup =		null_lookup,
 	.vop_open =		null_open,

Modified: releng/8.4/sys/net/if.c
==============================================================================
--- releng/8.4/sys/net/if.c	Tue Sep 10 10:13:14 2013	(r255446)
+++ releng/8.4/sys/net/if.c	Tue Sep 10 10:14:19 2013	(r255447)
@@ -2602,11 +2602,23 @@ ifioctl(struct socket *so, u_long cmd, c
 		CURVNET_RESTORE();
 		return (EOPNOTSUPP);
 	}
+
+	/*
+	 * Pass the request on to the socket control method, and if the
+	 * latter returns EOPNOTSUPP, directly to the interface.
+	 *
+	 * Make an exception for the legacy SIOCSIF* requests.  Drivers
+	 * trust SIOCSIFADDR et al to come from an already privileged
+	 * layer, and do not perform any credentials checks or input
+	 * validation.
+	 */
 #ifndef COMPAT_43
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
-	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL &&
+	    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+	    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
@@ -2650,7 +2662,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   data,
 								   ifp, td));
 		if (error == EOPNOTSUPP && ifp != NULL &&
-		    ifp->if_ioctl != NULL)
+		    ifp->if_ioctl != NULL &&
+		    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+		    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 

Modified: releng/8.4/sys/netinet6/in6.c
==============================================================================
--- releng/8.4/sys/netinet6/in6.c	Tue Sep 10 10:13:14 2013	(r255446)
+++ releng/8.4/sys/netinet6/in6.c	Tue Sep 10 10:14:19 2013	(r255447)
@@ -344,6 +344,18 @@ in6_control(struct socket *so, u_long cm
 	case SIOCGIFSTAT_ICMP6:
 		sa6 = &ifr->ifr_addr;
 		break;
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-INET6 ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
 	default:
 		sa6 = NULL;
 		break;

Modified: releng/8.4/sys/netnatm/natm.c
==============================================================================
--- releng/8.4/sys/netnatm/natm.c	Tue Sep 10 10:13:14 2013	(r255446)
+++ releng/8.4/sys/netnatm/natm.c	Tue Sep 10 10:14:19 2013	(r255447)
@@ -339,6 +339,21 @@ natm_usr_control(struct socket *so, u_lo
 	npcb = (struct natmpcb *)so->so_pcb;
 	KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL"));
 
+	switch (cmd) {
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-ATM ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
+	}
+
 	if (ifp == NULL || ifp->if_ioctl == NULL)
 		return (EOPNOTSUPP);
 	return ((*ifp->if_ioctl)(ifp, cmd, arg));

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:15:35 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 924805CC;
 Tue, 10 Sep 2013 10:15:35 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7ECD12ADF;
 Tue, 10 Sep 2013 10:15:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AAFZq1003104;
 Tue, 10 Sep 2013 10:15:35 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AAFYeX003097;
 Tue, 10 Sep 2013 10:15:34 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101015.r8AAFYeX003097@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 10:15:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255448 - in releng/9.1: . sys/conf sys/fs/nullfs sys/net
 sys/netinet6 sys/netnatm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:15:35 -0000

Author: des
Date: Tue Sep 10 10:15:33 2013
New Revision: 255448
URL: http://svnweb.freebsd.org/changeset/base/255448

Log:
  In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
  and SIOCSIFNETMASK at the socket layer rather than pass them on to the
  link layer without validation or credential checks.  [SA-13:12]
  
  Prevent cross-mount hardlinks between different nullfs mounts of the
  same underlying filesystem.  [SA-13:13]
  
  Security:	CVE-2013-5691
  Security:	FreeBSD-SA-13:12.ifioctl
  Security:	CVE-2013-5710
  Security:	FreeBSD-SA-13:13.nullfs
  Approved by:	so

Modified:
  releng/9.1/UPDATING
  releng/9.1/sys/conf/newvers.sh
  releng/9.1/sys/fs/nullfs/null_vnops.c
  releng/9.1/sys/net/if.c
  releng/9.1/sys/netinet6/in6.c
  releng/9.1/sys/netnatm/natm.c

Modified: releng/9.1/UPDATING
==============================================================================
--- releng/9.1/UPDATING	Tue Sep 10 10:14:19 2013	(r255447)
+++ releng/9.1/UPDATING	Tue Sep 10 10:15:33 2013	(r255448)
@@ -9,6 +9,17 @@ handbook.
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running portupgrade.
 
+20130910:	p7	FreeBSD-SA-13:12.ifioctl
+			FreeBSD-SA-13:13.nullfs
+
+	In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR,
+	SIOCSIFDSTADDR and SIOCSIFNETMASK at the socket layer rather
+	than pass them on to the link layer without validation or
+	credential checks.  [SA-13:12]
+
+	Prevent cross-mount hardlinks between different nullfs mounts
+	of the same underlying filesystem.  [SA-13:13]
+
 20130822:	p6	FreeBSD-SA-13:09.ip_multicast
 			FreeBSD-SA-13:10.sctp
 			FreeBSD-EN-13:03.mfi

Modified: releng/9.1/sys/conf/newvers.sh
==============================================================================
--- releng/9.1/sys/conf/newvers.sh	Tue Sep 10 10:14:19 2013	(r255447)
+++ releng/9.1/sys/conf/newvers.sh	Tue Sep 10 10:15:33 2013	(r255448)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="9.1"
-BRANCH="RELEASE-p6"
+BRANCH="RELEASE-p7"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/9.1/sys/fs/nullfs/null_vnops.c
==============================================================================
--- releng/9.1/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:14:19 2013	(r255447)
+++ releng/9.1/sys/fs/nullfs/null_vnops.c	Tue Sep 10 10:15:33 2013	(r255448)
@@ -815,6 +815,15 @@ null_vptocnp(struct vop_vptocnp_args *ap
 	return (error);
 }
 
+static int
+null_link(struct vop_link_args *ap)
+{
+
+	if (ap->a_tdvp->v_mount != ap->a_vp->v_mount)
+		return (EXDEV);
+	return (null_bypass((struct vop_generic_args *)ap));
+}
+
 /*
  * Global vfs data structures
  */
@@ -828,6 +837,7 @@ struct vop_vector null_vnodeops = {
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,
 	.vop_islocked =		vop_stdislocked,
+	.vop_link =		null_link,
 	.vop_lock1 =		null_lock,
 	.vop_lookup =		null_lookup,
 	.vop_open =		null_open,

Modified: releng/9.1/sys/net/if.c
==============================================================================
--- releng/9.1/sys/net/if.c	Tue Sep 10 10:14:19 2013	(r255447)
+++ releng/9.1/sys/net/if.c	Tue Sep 10 10:15:33 2013	(r255448)
@@ -2542,11 +2542,23 @@ ifioctl(struct socket *so, u_long cmd, c
 		CURVNET_RESTORE();
 		return (EOPNOTSUPP);
 	}
+
+	/*
+	 * Pass the request on to the socket control method, and if the
+	 * latter returns EOPNOTSUPP, directly to the interface.
+	 *
+	 * Make an exception for the legacy SIOCSIF* requests.  Drivers
+	 * trust SIOCSIFADDR et al to come from an already privileged
+	 * layer, and do not perform any credentials checks or input
+	 * validation.
+	 */
 #ifndef COMPAT_43
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
-	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL &&
+	    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+	    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
@@ -2590,7 +2602,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   data,
 								   ifp, td));
 		if (error == EOPNOTSUPP && ifp != NULL &&
-		    ifp->if_ioctl != NULL)
+		    ifp->if_ioctl != NULL &&
+		    cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR &&
+		    cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK)
 			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 

Modified: releng/9.1/sys/netinet6/in6.c
==============================================================================
--- releng/9.1/sys/netinet6/in6.c	Tue Sep 10 10:14:19 2013	(r255447)
+++ releng/9.1/sys/netinet6/in6.c	Tue Sep 10 10:15:33 2013	(r255448)
@@ -421,6 +421,18 @@ in6_control(struct socket *so, u_long cm
 	case SIOCGIFSTAT_ICMP6:
 		sa6 = &ifr->ifr_addr;
 		break;
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-INET6 ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
 	default:
 		sa6 = NULL;
 		break;

Modified: releng/9.1/sys/netnatm/natm.c
==============================================================================
--- releng/9.1/sys/netnatm/natm.c	Tue Sep 10 10:14:19 2013	(r255447)
+++ releng/9.1/sys/netnatm/natm.c	Tue Sep 10 10:15:33 2013	(r255448)
@@ -339,6 +339,21 @@ natm_usr_control(struct socket *so, u_lo
 	npcb = (struct natmpcb *)so->so_pcb;
 	KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL"));
 
+	switch (cmd) {
+	case SIOCSIFADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCSIFNETMASK:
+		/*
+		 * Although we should pass any non-ATM ioctl requests
+		 * down to driver, we filter some legacy INET requests.
+		 * Drivers trust SIOCSIFADDR et al to come from an already
+		 * privileged layer, and do not perform any credentials
+		 * checks or input validation.
+		 */
+		return (EINVAL);
+	}
+
 	if (ifp == NULL || ifp->if_ioctl == NULL)
 		return (EOPNOTSUPP);
 	return ((*ifp->if_ioctl)(ifp, cmd, arg));

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:38:16 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 32027B17;
 Tue, 10 Sep 2013 10:38:16 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1F8EC2C1C;
 Tue, 10 Sep 2013 10:38:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AAcFl9016100;
 Tue, 10 Sep 2013 10:38:15 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AAcFaE016099;
 Tue, 10 Sep 2013 10:38:15 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201309101038.r8AAcFaE016099@svn.freebsd.org>
From: Gleb Smirnoff <glebius@FreeBSD.org>
Date: Tue, 10 Sep 2013 10:38:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255449 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:38:16 -0000

Author: glebius
Date: Tue Sep 10 10:38:15 2013
New Revision: 255449
URL: http://svnweb.freebsd.org/changeset/base/255449

Log:
  Make a bump for r255426.
  
  Approved by:	re (gjb)

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Tue Sep 10 10:15:33 2013	(r255448)
+++ head/sys/sys/param.h	Tue Sep 10 10:38:15 2013	(r255449)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1000054	/* Master, propagated to newvers */
+#define __FreeBSD_version 1000055	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 10:39:33 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 71E6BC61;
 Tue, 10 Sep 2013 10:39:33 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id EA83E2C2B;
 Tue, 10 Sep 2013 10:39:32 +0000 (UTC)
Received: from cell.glebius.int.ru (localhost [127.0.0.1])
 by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r8AAdUAM044097;
 Tue, 10 Sep 2013 14:39:30 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
Received: (from glebius@localhost)
 by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r8AAdU2c044096;
 Tue, 10 Sep 2013 14:39:30 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to
 glebius@FreeBSD.org using -f
Date: Tue, 10 Sep 2013 14:39:30 +0400
From: Gleb Smirnoff <glebius@FreeBSD.org>
To: Ivan Klymenko <fidaj@ukr.net>
Subject: Re: svn commit: r255426 - in head: lib/libc/sys sys/compat/freebsd32
 sys/compat/linux sys/compat/svr4 sys/dev/drm2/i915 sys/i386/ibcs2
 sys/i386/linux sys/ia64/ia32 sys/kern sys/sparc64/sparc64 sys/sys ...
Message-ID: <20130910103930.GA4574@FreeBSD.org>
References: <201309091812.r89IC0YH015840@svn.freebsd.org>
 <20130910092323.GA58955@FreeBSD.org>
 <20130910123344.100bc664@nonamehost.local>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20130910123344.100bc664@nonamehost.local>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, Alexey Dokuchaev <danfe@FreeBSD.org>,
 src-committers@freebsd.org, svn-src-all@freebsd.org,
 John Baldwin <jhb@FreeBSD.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 10:39:33 -0000

On Tue, Sep 10, 2013 at 12:33:44PM +0300, Ivan Klymenko wrote:
I> Ð’ Tue, 10 Sep 2013 09:23:23 +0000
I> Alexey Dokuchaev <danfe@FreeBSD.org> пишет:
I> 
I> > This commit breaks NVidia driver port
I> and emulators/virtualbox-ose-kmod* too

I've bumped to 1000055 in r255449.

Please fix the precious ports :)

-- 
Totus tuus, Glebius.

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 11:21:36 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BD6D746E;
 Tue, 10 Sep 2013 11:21:36 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 41D222EB2;
 Tue, 10 Sep 2013 11:21:36 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r8ABLUqS081787;
 Tue, 10 Sep 2013 14:21:30 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r8ABLUqS081787
Received: (from kostik@localhost)
 by tom.home (8.14.7/8.14.7/Submit) id r8ABLURK081786;
 Tue, 10 Sep 2013 14:21:30 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 10 Sep 2013 14:21:30 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: John-Mark Gurney <jmg@funkthat.com>
Subject: Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni
Message-ID: <20130910112130.GV41229@kib.kiev.ua>
References: <201309031831.r83IVNkh026523@svn.freebsd.org>
 <20130910060132.GA61541@dragon.NUXI.org>
 <20130910064149.GS68682@funkthat.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="DeQ9GnsEQp3CI+P2"
Content-Disposition: inline
In-Reply-To: <20130910064149.GS68682@funkthat.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, re@FreeBSD.org, David O'Brien <obrien@FreeBSD.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 11:21:36 -0000


--DeQ9GnsEQp3CI+P2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Sep 09, 2013 at 11:41:49PM -0700, John-Mark Gurney wrote:
> David O'Brien wrote this message on Mon, Sep 09, 2013 at 23:01 -0700:
> > On Tue, Sep 03, 2013 at 06:31:23PM +0000, John-Mark Gurney wrote:
> > > Log:
> > >   Use the fact that the AES-NI instructions can be pipelined to impro=
ve
> > >   performance... Use SSE2 instructions for calculating the XTS tweek
> > >   factor...  Let the compiler do more work and handle register alloca=
tion
> > >   by using intrinsics, now only the key schedule is in assembly...
> >=20
> > Hi John-Mark,
> > Unfortunately this does not work with /usr/bin/gcc (which I still use as
> > /usr/bin/cc on this old IBM T60 laptop due to clang's enormous pestimat=
ion
> > on 'make world' and build times.
> >=20
> > Please fix this ASAP or back it out out of 10-CURRENT as it does not wo=
rk
> > with /usr/bin/gcc:
> >=20
> > 1. /usr/bin/gcc cannot handle the "-maes" option.
> > I committed r255440 to address this.
>=20
> Please back that out until you have an understand of what the real
> problem is...  I'm sad that the commit was approved w/o bothering to
> attempt to figure out the problem...
>=20
> > 2. /usr/src/sys/modules/aesni/../../crypto/aesni/aesencdec.h:30:23: err=
or: wmmintrin.h: No such file or directory
> > and then a cascade of errors follow.
>=20
> Sounds like you don't have the latest in-tree gcc... I've been
> compiling the AES module w/ the in tree gcc for a while..  This is
> w/ the changes in r255185...
>=20
> > For now, I've sent a patch to re@ for approval to remove the 'aesni'
> > module from the build if not using clang.  But the LINT build is
> > still broken with /usr/bin/gcc.
>=20
> I'll strongly object to this change...
Sorry for my mistake, I agree with you.

IMO this change should be reverted.
>=20
> > >   Replace .byte hard coded instructions w/ the proper instructions now
> > >   that both clang and gcc support them...
> >=20
> > Is this out-of-tree latest GCC that supports this?
>=20
> Nope, in-tree...  Sounds like you haven't installed the latest version
> of gcc in tree...
>=20
> It could be a problem with a bad interaction w/ delete-old as glebius
> added the wmmintrin.h header to the delete-old target in r255354...
>=20
> I'll take a closer look at this in the morning, but next time please
> attempt to contact the author before taking such actions...
>=20
> --=20
>   John-Mark Gurney				Voice: +1 415 225 5579
>=20
>      "All that I will do, has been done, All that I have, has not."

--DeQ9GnsEQp3CI+P2
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQIcBAEBAgAGBQJSLwC5AAoJEJDCuSvBvK1BXvEP/RCyrvLik2bM441bbCnihGOk
Ky3Uwm5wMClbvhtM0rmbr6dlARdI+LxuqRvVILnDpKpyEM3kgI3SG5lhqEemT87B
XYWdrvKd+q1FyBWJYoiwwVaWnJDwuZVvgVdW8sFBIsio19s06Dc2DkPm11Mdpir0
tkQ2z49F20dhN6GgViufh6ImZqxdpND/urIATdxu3fOkAg8zPZshShgwq5Nkwv3b
6OP5iYi7IFyQDM8s5QmaiGT2eIR5irxTI07A2qcc4sJvBHzA7ZV7rmzumeY9mRUH
a6MAmpseqf+ShaeZLXA2rxNRQz52Ne4G3tdklyN0JOifhAcoKE7Q2mQNsSVqrYPb
NeED0i2LgNIeEarEqfyRrDmjaJyBzbGP1yO4spKzBKfDN6fx/o++tPrc5K6b1xPR
W3gUOrBqUAZitEWeficafSsyb6VTN5QC4tm9W7js16j/zF0crEV3ThQ6Scdc6RzY
R6M6CjEC+5IB6h/9PatW6U2Y5KHNlIYJOb2a/HXBAqsdQbA+6OyWYBS6ETYCiRgZ
23XABhEM+Pq/GAL2Iqwi6ZxakmzyWY7Rch3zveQkTeovE6dOuj5HN7pYKxLygKoZ
+rxQ4LxMTHkMkE6bcWT43IJoZOuGre1+6mGS6v/dFLx+576L86qmmnQaUC0IM1nX
ID/Lbding0Mg1FS9l6Mm
=xcOe
-----END PGP SIGNATURE-----

--DeQ9GnsEQp3CI+P2--

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 12:03:06 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 4497D704;
 Tue, 10 Sep 2013 12:03:06 +0000 (UTC)
 (envelope-from davide.italiano@gmail.com)
Received: from mail-vb0-x232.google.com (mail-vb0-x232.google.com
 [IPv6:2607:f8b0:400c:c02::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id BFEA12383;
 Tue, 10 Sep 2013 12:03:05 +0000 (UTC)
Received: by mail-vb0-f50.google.com with SMTP id x14so5104428vbb.9
 for <multiple recipients>; Tue, 10 Sep 2013 05:03:04 -0700 (PDT)
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=ThEVo0Z9g7CGDdoOrWPDiARWWS/ugxsS1fNPp9oYraI=;
 b=DCe2uLYGR0oQIJjtoRjBqPw/WTE54KMQrcLFHraXWFniBfKB5kokx0mEnkpa/4El9T
 JnuXYAxZtJ6Ck4fFyoIl/FtUHikURAP0L1f6lEsPmMp5YvU12/c/H32edD9CVRP7Jqd6
 Q4vh7LK6Giqt5BmSAiqnBTOwVQ9ZJ+TqO/uQnmWwpwxtjaPN0MYWQE9sREtOe47pK2uH
 QcHviBedhpKEdHMc8HKwajs/jBAm6u/IrKhv1TcX/E6bBq02CwgqouhwtyKPozcS2H0g
 EUzMSvja2ePDRkKU9FMfqGuva8BCgHwF2oyN23B/ZONaxqrgIK97bSW9658R8303TARl
 YtHQ==
MIME-Version: 1.0
X-Received: by 10.52.120.78 with SMTP id la14mr19427822vdb.9.1378814584826;
 Tue, 10 Sep 2013 05:03:04 -0700 (PDT)
Sender: davide.italiano@gmail.com
Received: by 10.220.65.132 with HTTP; Tue, 10 Sep 2013 05:03:04 -0700 (PDT)
In-Reply-To: <201309100146.r8A1kmri091170@svn.freebsd.org>
References: <201309100146.r8A1kmri091170@svn.freebsd.org>
Date: Tue, 10 Sep 2013 14:03:04 +0200
X-Google-Sender-Auth: QBk7a9ZBA9yTbu-lxr5EIzmpEeg
Message-ID: <CACYV=-EfAH583bY1rkXkskefvRS_4n9VBtG6KLw0mdJvpiWSTQ@mail.gmail.com>
Subject: Re: svn commit: r255437 - in head:
 cddl/contrib/opensolaris/lib/libzpool/common
 cddl/contrib/opensolaris/lib/libzpool/common/sys
 sys/cddl/compat/opensolaris/sys
 sys/cddl/contrib/opensolaris/uts/common/...
From: Davide Italiano <davide@freebsd.org>
To: Xin LI <delphij@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 12:03:06 -0000

On Tue, Sep 10, 2013 at 3:46 AM, Xin LI <delphij@freebsd.org> wrote:

[snip]

> +static clock_t
> +cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
> +    int flag)
> +{
> +       sbintime_t sbt;
> +       sbintime_t pr;
> +
> +       sbt = tim * SBT_1NS;
> +       pr = res * SBT_1NS;
> +
> +       return (cv_timedwait_sbt(cvp, mp, sbt, pr, 0));
> +}
> +
>  #endif /* _KERNEL */
>

The Illumos cv_timedwait_hires() doesn't use 'res' argument so if you
want to be consistent with their behaviour you should pass '0' as
precision argument to cv_timedwait_sbt(). Also, I'm not sure there's
an 1:1 mapping between ours 'pr' and their 'res'. Even if there is,
considering you're dealing with nanoseconds I don't think you will see
great advantage from specifying precision argument in most of the
cases (hardware clock resolution is in the common case 10^-6).


> @@ -1473,7 +1473,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
>                             "free_bpobj/bptree txg %llu",
>                             (longlong_t)scn->scn_visited_this_txg,
>                             (longlong_t)
> -                           (gethrtime() - scn->scn_sync_start_time) / MICROSEC,
> +                           NSEC2MSEC(gethrtime() - scn->scn_sync_start_time),
>                             (longlong_t)tx->tx_txg);
>                         scn->scn_visited_this_txg = 0;
>                         /*

The usage of gethrtime() as-it-is in FreeBSD goes against your
precision requirements. In fact, it's implemented as a wrapper to
getnanouptime(), which could be defined as "fast but not precise" as
it read a cached value which is upadted from time to time rather than
going into the underlying hardware to get the information required.
More precisely speaking, in case hz=1000, you might be 1 millisecond
away from the value you're looking for.

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 13:48:35 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 15639E98;
 Tue, 10 Sep 2013 13:48:35 +0000 (UTC) (envelope-from cy@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id DBB242B9D;
 Tue, 10 Sep 2013 13:48:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8ADmYWx037510;
 Tue, 10 Sep 2013 13:48:34 GMT (envelope-from cy@svn.freebsd.org)
Received: (from cy@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8ADmYS7037507;
 Tue, 10 Sep 2013 13:48:34 GMT (envelope-from cy@svn.freebsd.org)
Message-Id: <201309101348.r8ADmYS7037507@svn.freebsd.org>
From: Cy Schubert <cy@FreeBSD.org>
Date: Tue, 10 Sep 2013 13:48:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255450 - head/etc/rc.d
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 13:48:35 -0000

Author: cy
Date: Tue Sep 10 13:48:33 2013
New Revision: 255450
URL: http://svnweb.freebsd.org/changeset/base/255450

Log:
  ipfilter 5.1.2 no longer supports sysctl. Use ipf -V to determine if
  available (the kernel module is loaded or compiled into the kernel).
  
  Approved by:	glebius (mentor)
  Approved by:	re (blanket)

Modified:
  head/etc/rc.d/ipfilter
  head/etc/rc.d/ipfs
  head/etc/rc.d/ipmon

Modified: head/etc/rc.d/ipfilter
==============================================================================
--- head/etc/rc.d/ipfilter	Tue Sep 10 10:38:15 2013	(r255449)
+++ head/etc/rc.d/ipfilter	Tue Sep 10 13:48:33 2013	(r255450)
@@ -29,7 +29,7 @@ required_modules="ipl:ipfilter"
 ipfilter_start()
 {
 	echo "Enabling ipfilter."
-	if [ `sysctl -n net.inet.ipf.fr_running` -le 0 ]; then
+	if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes'; then
 		${ipfilter_program:-/sbin/ipf} -E
 	fi
 	${ipfilter_program:-/sbin/ipf} -Fa
@@ -37,7 +37,6 @@ ipfilter_start()
 		${ipfilter_program:-/sbin/ipf} \
 		    -f "${ipfilter_rules}" ${ipfilter_flags}
 	fi
-	${ipfilter_program:-/sbin/ipf} -6 -Fa
 	if [ -r "${ipv6_ipfilter_rules}" ]; then
 		${ipfilter_program:-/sbin/ipf} -6 \
 		    -f "${ipv6_ipfilter_rules}" ${ipfilter_flags}
@@ -46,8 +45,7 @@ ipfilter_start()
 
 ipfilter_stop()
 {
-	# XXX - The ipf -D command is not effective for 'lkm's
-	if [ `sysctl -n net.inet.ipf.fr_running` -eq 1 ]; then
+	if ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes'; then
 		echo "Saving firewall state tables"
 		${ipfs_program:-/sbin/ipfs} -W ${ipfs_flags}
 		echo "Disabling ipfilter."

Modified: head/etc/rc.d/ipfs
==============================================================================
--- head/etc/rc.d/ipfs	Tue Sep 10 10:38:15 2013	(r255449)
+++ head/etc/rc.d/ipfs	Tue Sep 10 13:48:33 2013	(r255450)
@@ -23,7 +23,7 @@ ipfs_prestart()
 	if ! checkyesno ipfilter_enable -o ! checkyesno ipnat_enable ; then
 		err 1  "${name} requires either ipfilter or ipnat enabled"
 	fi
-	if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then
+	if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then
 		err 1 "ipfilter module is not loaded"
 	fi
 	return 0

Modified: head/etc/rc.d/ipmon
==============================================================================
--- head/etc/rc.d/ipmon	Tue Sep 10 10:38:15 2013	(r255449)
+++ head/etc/rc.d/ipmon	Tue Sep 10 13:48:33 2013	(r255450)
@@ -23,7 +23,7 @@ ipmon_precmd()
 	if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then
 		err 1  "${name} requires either ipfilter or ipnat enabled"
 	fi
-	if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then
+	if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then
 		err 1 "ipfilter module is not loaded"
 	fi
 	return 0

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 13:51:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A9E9C18E;
 Tue, 10 Sep 2013 13:51:19 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 868FC2BFB;
 Tue, 10 Sep 2013 13:51:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8ADpJwo041148;
 Tue, 10 Sep 2013 13:51:19 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8ADpJuD041147;
 Tue, 10 Sep 2013 13:51:19 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201309101351.r8ADpJuD041147@svn.freebsd.org>
From: Ed Maste <emaste@FreeBSD.org>
Date: Tue, 10 Sep 2013 13:51:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255451 - head/tools/regression/sockets/sendfile
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 13:51:19 -0000

Author: emaste
Date: Tue Sep 10 13:51:19 2013
New Revision: 255451
URL: http://svnweb.freebsd.org/changeset/base/255451

Log:
  Add a sendfile regression test for transmit length > file size.
  
  This test identified the issue fixed in FreeBSD-SA-13:11.sendfile.
  
  Sponsored by:	The FreeBSD Foundation
  Approved by:	re (glebius)

Modified:
  head/tools/regression/sockets/sendfile/sendfile.c

Modified: head/tools/regression/sockets/sendfile/sendfile.c
==============================================================================
--- head/tools/regression/sockets/sendfile/sendfile.c	Tue Sep 10 13:48:33 2013	(r255450)
+++ head/tools/regression/sockets/sendfile/sendfile.c	Tue Sep 10 13:51:19 2013	(r255451)
@@ -74,12 +74,13 @@ struct sendfile_test {
 	uint32_t	hdr_length;
 	uint32_t	offset;
 	uint32_t	length;
+	uint32_t	file_size;
 };
 
-int	file_fd;
-char	path[PATH_MAX];
-int	listen_socket;
-int	accept_socket;
+static int	file_fd;
+static char	path[PATH_MAX];
+static int	listen_socket;
+static int	accept_socket;
 
 static int test_th(struct test_header *th, uint32_t *header_length,
 		uint32_t *offset, uint32_t *length);
@@ -92,6 +93,7 @@ static int new_test_socket(int *connect_
 static void init_th(struct test_header *th, uint32_t header_length, 
 		uint32_t offset, uint32_t length);
 static int send_test(int connect_socket, struct sendfile_test);
+static int write_test_file(size_t file_size);
 static void run_parent(void);
 static void cleanup(void);
 
@@ -278,15 +280,12 @@ send_test(int connect_socket, struct sen
 	if (len != 0)
 		FAIL_ERR("lseek")
 
-	if (test.length == 0) {
-		struct stat st;
-		if (fstat(file_fd, &st) < 0)
-			FAIL_ERR("fstat")
-		length = st.st_size - test.offset;
-	}
-	else {
+	struct stat st;
+	if (fstat(file_fd, &st) < 0)
+		FAIL_ERR("fstat")
+	length = st.st_size - test.offset;
+	if (test.length > 0 && test.length < (uint32_t)length)
 		length = test.length;
-	}
 
 	init_th(&th, test.hdr_length, test.offset, length);
 
@@ -336,17 +335,55 @@ send_test(int connect_socket, struct sen
 	return (0);
 }
 
+static int
+write_test_file(size_t file_size)
+{
+	char *page_buffer;
+	ssize_t len;
+	static size_t current_file_size = 0;
+
+	if (file_size == current_file_size)
+		return (0);
+	else if (file_size < current_file_size) {
+		if (ftruncate(file_fd, file_size) != 0)
+			FAIL_ERR("ftruncate");
+		current_file_size = file_size;
+		return (0);
+	}
+
+	page_buffer = malloc(file_size);
+	if (page_buffer == NULL)
+		FAIL_ERR("malloc")
+	bzero(page_buffer, file_size);
+
+	len = write(file_fd, page_buffer, file_size);
+	if (len < 0)
+		FAIL_ERR("write")
+
+	len = lseek(file_fd, 0, SEEK_SET);
+	if (len < 0)
+		FAIL_ERR("lseek")
+	if (len != 0)
+		FAIL("len != 0")
+
+	free(page_buffer);
+	current_file_size = file_size;
+	return (0);
+}
+
 static void
 run_parent(void)
 {
 	int connect_socket;
 	int status;
 	int test_num;
+	int test_count;
 	int pid;
+	size_t desired_file_size = 0;
 
 	const int pagesize = getpagesize();
 
-	struct sendfile_test tests[10] = {
+	struct sendfile_test tests[] = {
  		{ .hdr_length = 0, .offset = 0, .length = 1 },
 		{ .hdr_length = 0, .offset = 0, .length = pagesize },
 		{ .hdr_length = 0, .offset = 1, .length = 1 },
@@ -356,12 +393,23 @@ run_parent(void)
 		{ .hdr_length = 0, .offset = 0, .length = 0 },
 		{ .hdr_length = 0, .offset = pagesize, .length = 0 },
 		{ .hdr_length = 0, .offset = 2*pagesize, .length = 0 },
-		{ .hdr_length = 0, .offset = TEST_PAGES*pagesize, .length = 0 }
+		{ .hdr_length = 0, .offset = TEST_PAGES*pagesize, .length = 0 },
+		{ .hdr_length = 0, .offset = 0, .length = pagesize,
+		    .file_size = 1 }
 	};
 
-	printf("1..10\n");
+	test_count = sizeof(tests) / sizeof(tests[0]);
+	printf("1..%d\n", test_count);
 
-	for (test_num = 1; test_num <= 10; test_num++) {
+	for (test_num = 1; test_num <= test_count; test_num++) {
+
+		desired_file_size = tests[test_num - 1].file_size;
+		if (desired_file_size == 0)
+			desired_file_size = TEST_PAGES * pagesize;
+		if (write_test_file(desired_file_size) != 0) {
+			printf("not ok %d\n", test_num);
+			continue;
+		}
 
 		pid = fork();
 		if (pid == -1) {
@@ -411,17 +459,11 @@ cleanup(void)
 int
 main(int argc, char *argv[])
 {
-	char *page_buffer;
 	int pagesize;
-	ssize_t len;
 
 	*path = '\0';
 
 	pagesize = getpagesize();
-	page_buffer = malloc(TEST_PAGES * pagesize);
-	if (page_buffer == NULL)
-		FAIL_ERR("malloc")
-	bzero(page_buffer, TEST_PAGES * pagesize);
 
 	if (argc == 1) {
 		snprintf(path, PATH_MAX, "/tmp/sendfile.XXXXXXXXXXXX");
@@ -439,16 +481,6 @@ main(int argc, char *argv[])
 
 	atexit(cleanup);
 
-	len = write(file_fd, page_buffer, TEST_PAGES * pagesize);
-	if (len < 0)
-		FAIL_ERR("write")
-
-	len = lseek(file_fd, 0, SEEK_SET);
-	if (len < 0)
-		FAIL_ERR("lseek")
-	if (len != 0)
-		FAIL("len != 0")
-
 	run_parent();
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 14:29:52 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id DD882118;
 Tue, 10 Sep 2013 14:29:52 +0000 (UTC)
 (envelope-from mdf356@gmail.com)
Received: from mail-oa0-x22b.google.com (mail-oa0-x22b.google.com
 [IPv6:2607:f8b0:4003:c02::22b])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7F0922EF5;
 Tue, 10 Sep 2013 14:29:52 +0000 (UTC)
Received: by mail-oa0-f43.google.com with SMTP id i10so8050812oag.30
 for <multiple recipients>; Tue, 10 Sep 2013 07:29:51 -0700 (PDT)
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=c1owzkcVoCjN6kQy7R5KkCKPXfYI+Y16+w8X1rsOI0o=;
 b=AlV/dZMk3msDjK56H/j6pz3grqQKEVlayGTSLn7sTxk56JpgOdYtaqJ8s0+jG5Ov29
 ZXUBSzlfSh1C8e3EsHLnM4h9UQWokTG8bF7VYplLwGs6DLySdzynbsLU6xSuyR1fOtWN
 ScBA1kEWU4h/GYN1Te1dOtVnP/neBtcfdCkxwLuYDEAZ1NIzvaVgwl6y8OpioqCwr4Y0
 Ryyd1mimkH1J8bfyBW1qrTvwkEuTJB/cX39uR9I3CyguwJS1uT8P6vzohCh8ET81zqDD
 TymlBZSKKtG+ALtmlcjgSwyBcggIKnqYfNvH3QRGSMR3yl7P6wO4byqZmu1mYeFhBAuG
 XRkQ==
MIME-Version: 1.0
X-Received: by 10.182.230.135 with SMTP id sy7mr15989760obc.24.1378823391731; 
 Tue, 10 Sep 2013 07:29:51 -0700 (PDT)
Sender: mdf356@gmail.com
Received: by 10.182.75.9 with HTTP; Tue, 10 Sep 2013 07:29:51 -0700 (PDT)
In-Reply-To: <201309100517.r8A5HrHY020358@svn.freebsd.org>
References: <201309100517.r8A5HrHY020358@svn.freebsd.org>
Date: Tue, 10 Sep 2013 07:29:51 -0700
X-Google-Sender-Auth: 1og7CEYaWU_-V1tJLGyD4dRaMQ0
Message-ID: <CAMBSHm89omtP=G6eHCHbx+XOxHKSgEB4qFBpYvE7=7CAriQfvg@mail.gmail.com>
Subject: Re: svn commit: r255439 - head/sys/dev/cpuctl
From: Matthew Fleming <mdf@FreeBSD.org>
To: Konstantin Belousov <kib@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 14:29:52 -0000

On Mon, Sep 9, 2013 at 10:17 PM, Konstantin Belousov <kib@freebsd.org>wrote:

> Author: kib
> Date: Tue Sep 10 05:17:53 2013
> New Revision: 255439
> URL: http://svnweb.freebsd.org/changeset/base/255439
>
> Log:
>   Call free() on the pointer returned from malloc().
>
>   Reported and tested by:       Oliver Pinter <oliver.pntr@gmail.com>
>   Sponsored by: The FreeBSD Foundation
>   MFC after:    3 days
>   Approved by:  re (delphij)
>
> Modified:
>   head/sys/dev/cpuctl/cpuctl.c
>
> Modified: head/sys/dev/cpuctl/cpuctl.c
>
> ==============================================================================
> --- head/sys/dev/cpuctl/cpuctl.c        Tue Sep 10 03:48:18 2013
>  (r255438)
> +++ head/sys/dev/cpuctl/cpuctl.c        Tue Sep 10 05:17:53 2013
>  (r255439)
> @@ -295,10 +295,10 @@ cpuctl_do_update(int cpu, cpuctl_update_
>  static int
>  update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td)
>  {
> -       void *ptr = NULL;
> +       void *ptr;
>         uint64_t rev0, rev1;
>         uint32_t tmp[4];
> -       int is_bound = 0;
> +       int is_bound;
>         int oldcpu;
>         int ret;
>
> @@ -312,10 +312,11 @@ update_intel(int cpu, cpuctl_update_args
>         }
>
>         /*
> -        * 16 byte alignment required.
> +        * 16 byte alignment required.  Rely on the fact that
> +        * malloc(9) always returns the pointer aligned at least on
> +        * the size of the allocation.
>          */
>         ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
> -       ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
>         if (copyin(args->data, ptr, args->size) != 0) {
>                 DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
>                     __LINE__, args->data, ptr, args->size);
> @@ -408,10 +409,10 @@ fail:
>  static int
>  update_via(int cpu, cpuctl_update_args_t *args, struct thread *td)
>  {
> -       void *ptr = NULL;
> +       void *ptr;
>         uint64_t rev0, rev1, res;
>         uint32_t tmp[4];
> -       int is_bound = 0;
> +       int is_bound;
>         int oldcpu;
>         int ret;
>
> @@ -427,8 +428,7 @@ update_via(int cpu, cpuctl_update_args_t
>         /*
>          * 4 byte alignment required.
>          */
> -       ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
> -       ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
> +       ptr = malloc(args->size, M_CPUCTL, M_WAITOK);
>         if (copyin(args->data, ptr, args->size) != 0) {
>                 DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
>                     __LINE__, args->data, ptr, args->size);
>

I don't know exactly what the stock malloc(9) will return, but memguard(9),
under its default mode with vm.memguard.options having MG_GUARD_AROUND set
will align the returned pointer to only 16 bytes.  When I added that
feature I almost made it 8 bytes, but I think I saw that uma(9) had a
16-byte alignment so I preserved that.  I.e., this code does still work
with malloc(9) and memguard(9).

But why does this need 16 byte alignment?  Especially when one of the
comments says 4-byte alignment?

Thanks,
matthew

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 15:10:04 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CD8BFE6A;
 Tue, 10 Sep 2013 15:10:04 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2B779223A;
 Tue, 10 Sep 2013 15:10:03 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r8AF9sbq029307;
 Tue, 10 Sep 2013 18:09:55 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r8AF9sbq029307
Received: (from kostik@localhost)
 by tom.home (8.14.7/8.14.7/Submit) id r8AF9sYC029306;
 Tue, 10 Sep 2013 18:09:54 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 10 Sep 2013 18:09:54 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: Matthew Fleming <mdf@FreeBSD.org>
Subject: Re: svn commit: r255439 - head/sys/dev/cpuctl
Message-ID: <20130910150954.GW41229@kib.kiev.ua>
References: <201309100517.r8A5HrHY020358@svn.freebsd.org>
 <CAMBSHm89omtP=G6eHCHbx+XOxHKSgEB4qFBpYvE7=7CAriQfvg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="ben6AifVmj+t9BPa"
Content-Disposition: inline
In-Reply-To: <CAMBSHm89omtP=G6eHCHbx+XOxHKSgEB4qFBpYvE7=7CAriQfvg@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home
Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 15:10:04 -0000


--ben6AifVmj+t9BPa
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Sep 10, 2013 at 07:29:51AM -0700, Matthew Fleming wrote:
> I don't know exactly what the stock malloc(9) will return, but memguard(9=
),
> under its default mode with vm.memguard.options having MG_GUARD_AROUND set
> will align the returned pointer to only 16 bytes.  When I added that
> feature I almost made it 8 bytes, but I think I saw that uma(9) had a
> 16-byte alignment so I preserved that.  I.e., this code does still work
> with malloc(9) and memguard(9).
>=20
> But why does this need 16 byte alignment?  Especially when one of the
> comments says 4-byte alignment?

The comment about 4-byte alignment is for VIA.

For Intel, citing the IA-32 SDM rev. 47, Vol.3, 9.11.6 Microcode Update Loa=
der:
"The microcode update data requires a 16-byte boundary alignment".
I.e. CPU takes the linear address of the buffer, which must be aligned
on 16 bytes.

--ben6AifVmj+t9BPa
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQIcBAEBAgAGBQJSLzZCAAoJEJDCuSvBvK1ByxcP/RZscqNhXWdzAITJdE9T/6k2
T4nsl05pp29JLRFxOadu/q6aLLLM6ICKvmL4NdFGREw/tuZM63+Fnon2TAQkzZqw
JZBF8vRaF2ohtUIL+lXCj6rxCyHMrmwopvTT6NrBTiMeacHd1t6OotERyuDMDjNS
mND1QxoDfK/WpHPaf+KMjFz6a7MvXQvz0UF3d3eSqtXBOtDN+35mKdStB2814lJt
oOkIgLf9Vy2UYtJ/wUVGyoXs8sVVHtEwjPwGioJ/xruAwzY5w6dkdN3wWSN3WcVe
r+DcnHjPpAf7ee7AGcfjSubiU9+rk7Jj1Ft8MXVFlFEVLU0BsQgylHdyxKQrXPe1
S1S4/hEdnJUP23X8Sf+R0KpcKcFRVxRMBUFdTrK3Fkz+s/afSyCYL7OJ+X403S+d
2wFCa5YxzY4hfjffgcE3YCDHvHlYa/LNeTpoV3+oZ6Re55sdMOMW3l6x9URf0qwX
5XtC7+2WtcnSA7t/V+VkbYmEYK6r+zBc61DwzuL31I2GvVyt6/+5jL75nS25zgzR
n9jY3ztHMIZEBItwbNn6zqskg9lb8qxAwC8wlPDPYnuPmzSXrc5WqE6Q+AGZEQ6d
2TE+GDNwJHw0SxpFfBq6cbYAakLPKDD1hIOjtvqreLWabr8p9bClvoc7OKO7Gp06
c7TO0taxvkmRr7R6uHkV
=8wqz
-----END PGP SIGNATURE-----

--ben6AifVmj+t9BPa--

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 15:12:18 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 99E94348;
 Tue, 10 Sep 2013 15:12:18 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1F8BC2285;
 Tue, 10 Sep 2013 15:12:17 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r8AFCDj2030355;
 Tue, 10 Sep 2013 18:12:13 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r8AFCDj2030355
Received: (from kostik@localhost)
 by tom.home (8.14.7/8.14.7/Submit) id r8AFCDfB030354;
 Tue, 10 Sep 2013 18:12:13 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 10 Sep 2013 18:12:13 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: Matthew Fleming <mdf@FreeBSD.org>
Subject: Re: svn commit: r255439 - head/sys/dev/cpuctl
Message-ID: <20130910151213.GX41229@kib.kiev.ua>
References: <201309100517.r8A5HrHY020358@svn.freebsd.org>
 <CAMBSHm89omtP=G6eHCHbx+XOxHKSgEB4qFBpYvE7=7CAriQfvg@mail.gmail.com>
 <20130910150954.GW41229@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="e/XVYMvPYdBe01jS"
Content-Disposition: inline
In-Reply-To: <20130910150954.GW41229@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home
Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "src-committers@freebsd.org" <src-committers@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 15:12:18 -0000


--e/XVYMvPYdBe01jS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Sep 10, 2013 at 06:09:54PM +0300, Konstantin Belousov wrote:
> On Tue, Sep 10, 2013 at 07:29:51AM -0700, Matthew Fleming wrote:
> > I don't know exactly what the stock malloc(9) will return, but memguard=
(9),
> > under its default mode with vm.memguard.options having MG_GUARD_AROUND =
set
> > will align the returned pointer to only 16 bytes.  When I added that
> > feature I almost made it 8 bytes, but I think I saw that uma(9) had a
> > 16-byte alignment so I preserved that.  I.e., this code does still work
> > with malloc(9) and memguard(9).
> >=20
> > But why does this need 16 byte alignment?  Especially when one of the
> > comments says 4-byte alignment?
>=20
> The comment about 4-byte alignment is for VIA.
>=20
> For Intel, citing the IA-32 SDM rev. 47, Vol.3, 9.11.6 Microcode Update L=
oader:
> "The microcode update data requires a 16-byte boundary alignment".
> I.e. CPU takes the linear address of the buffer, which must be aligned
> on 16 bytes.

Sent too fast.  There is at least one more instance of the same use,
see bus_dmamem_alloc() in sys/x86/x86/busdma_machdep.c.

--e/XVYMvPYdBe01jS
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQIcBAEBAgAGBQJSLzbMAAoJEJDCuSvBvK1BmmEP/j1wqPDvwOPdhFnRlmsZttCs
qBf2lDvodZ86Yr5vfpiaS8DYMI0eRruRiAKctfE5QK02+7E0Eo1Bpwr0SoeJP7pt
8eYJB7LRbM+UDgHncaYRO0WyZ1mhc1HdDHbUbqCO1oQSpvcfFzqTmk3EjawCBPk7
lqLWiKsbcsrnqsA8gHzPA/s2ekWn2ffkbxWJiNxyEAPJmgJr8/wFxa7NZl5QkdSb
WhQa3AvIerT3vrrNDBRd8dOmZU5LEp7xkbzU8X8c9XUxrednMD9ozzkvpnxyMCKr
HST9Ulhv3RtIErFLKHe+t1jeJkb24l8B0Us+8nRSm+2+cYKs3l/aBmYxRZIpr2hT
mpmMcyp/201s924S40SBVI5O94IHMralKwZqG0t6pFX2WlHfrvQH4lGDCM57kAgR
+l06z9OffS9j72Lu0tjd9IzgcBP8JjQtcXQ52zC1DW1ix6tKalMzJK1vCwlzvdQd
eaV4DuPzRrK1kzbweH0jwW2lnSEtTGYeQGm0SNJz4sDYDTbX5QToqSYFhUmsgva7
Vocde215hdLVYKw0nII2O30Whi1eQz7VNcdvsoJYpDMlPu2sQHIKQg6/W6RzAxII
5FcuAMK5ZJrYpQOPs8CF7mjd1BRbQF6Tk8tcSxOfB3jXtV1GjlL0WYxbbtW+LrIV
63CgwmHijWbyeDFhMYLw
=jUQ9
-----END PGP SIGNATURE-----

--e/XVYMvPYdBe01jS--

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 15:56:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B4BE6EF4;
 Tue, 10 Sep 2013 15:56:19 +0000 (UTC)
 (envelope-from jmg@h2.funkthat.com)
Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 665AE25A3;
 Tue, 10 Sep 2013 15:56:18 +0000 (UTC)
Received: from h2.funkthat.com (localhost [127.0.0.1])
 by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r8AFuHgL060876
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Tue, 10 Sep 2013 08:56:17 -0700 (PDT)
 (envelope-from jmg@h2.funkthat.com)
Received: (from jmg@localhost)
 by h2.funkthat.com (8.14.3/8.14.3/Submit) id r8AFuHOp060875;
 Tue, 10 Sep 2013 08:56:17 -0700 (PDT) (envelope-from jmg)
Date: Tue, 10 Sep 2013 08:56:17 -0700
From: John-Mark Gurney <jmg@funkthat.com>
To: Konstantin Belousov <kib@FreeBSD.org>
Subject: Re: svn commit: r255439 - head/sys/dev/cpuctl
Message-ID: <20130910155617.GU68682@funkthat.com>
References: <201309100517.r8A5HrHY020358@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201309100517.r8A5HrHY020358@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Operating-System: FreeBSD 7.2-RELEASE i386
X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88  9322 9CB1 8F74 6D3F A396
X-Files: The truth is out there
X-URL: http://resnet.uoregon.edu/~gurney_j/
X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger?
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
 (h2.funkthat.com [127.0.0.1]); Tue, 10 Sep 2013 08:56:18 -0700 (PDT)
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 15:56:19 -0000

Konstantin Belousov wrote this message on Tue, Sep 10, 2013 at 05:17 +0000:
> Author: kib
> Date: Tue Sep 10 05:17:53 2013
> New Revision: 255439
> URL: http://svnweb.freebsd.org/changeset/base/255439
> 
> Log:
>   Call free() on the pointer returned from malloc().

We really should add a KASSERT for these cases, incase this breaks in
the future..

> -	ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 16:50:14 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 347DA6BB;
 Tue, 10 Sep 2013 16:50:14 +0000 (UTC)
 (envelope-from obrien@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 07C5A29C1;
 Tue, 10 Sep 2013 16:50:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AGoDVR049347;
 Tue, 10 Sep 2013 16:50:13 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AGoDJP049342;
 Tue, 10 Sep 2013 16:50:13 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <201309101650.r8AGoDJP049342@svn.freebsd.org>
From: "David E. O'Brien" <obrien@FreeBSD.org>
Date: Tue, 10 Sep 2013 16:50:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255452 - in head/sys: conf modules/aesni
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 16:50:14 -0000

Author: obrien
Date: Tue Sep 10 16:50:13 2013
New Revision: 255452
URL: http://svnweb.freebsd.org/changeset/base/255452

Log:
  Back out r255440.  /usr/bin/gcc @r255185 (2013-09-03) can build this.
  
  Approved by:	re (kib)

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/modules/aesni/Makefile

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Tue Sep 10 13:51:19 2013	(r255451)
+++ head/sys/conf/files.amd64	Tue Sep 10 16:50:13 2013	(r255452)
@@ -142,7 +142,7 @@ crypto/aesni/aeskeys_amd64.S	optional ae
 crypto/aesni/aesni.c		optional aesni
 aesni_wrap.o			optional aesni				\
 	dependency	"$S/crypto/aesni/aesni_wrap.c"			\
-	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse ${COMPILER_TYPE:Mclang:S/clang/-maes} ${.IMPSRC}" \
+	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -maes ${.IMPSRC}" \
 	no-implicit-rule						\
 	clean		"aesni_wrap.o"
 crypto/blowfish/bf_enc.c	optional	crypto | ipsec

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Tue Sep 10 13:51:19 2013	(r255451)
+++ head/sys/conf/files.i386	Tue Sep 10 16:50:13 2013	(r255452)
@@ -128,7 +128,7 @@ crypto/aesni/aeskeys_i386.S	optional aes
 crypto/aesni/aesni.c		optional aesni
 aesni_wrap.o			optional aesni				\
 	dependency	"$S/crypto/aesni/aesni_wrap.c"			\
-	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse ${COMPILER_TYPE} ${COMPILER_TYPE:Mclang:S/clang/-maes} ${.IMPSRC}" \
+	compile-with	"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -maes ${.IMPSRC}" \
 	no-implicit-rule						\
 	clean		"aesni_wrap.o"
 crypto/des/arch/i386/des_enc.S	optional crypto | ipsec | netsmb

Modified: head/sys/modules/aesni/Makefile
==============================================================================
--- head/sys/modules/aesni/Makefile	Tue Sep 10 13:51:19 2013	(r255451)
+++ head/sys/modules/aesni/Makefile	Tue Sep 10 16:50:13 2013	(r255452)
@@ -12,7 +12,7 @@ OBJS+=	aesni_wrap.o
 # Remove -nostdinc so we can get the intrinsics.
 aesni_wrap.o: aesni_wrap.c
 	${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
-	     -mmmx -msse ${COMPILER_TYPE:Mclang:S/clang/-maes/} ${.IMPSRC}
+	     -mmmx -msse -maes ${.IMPSRC}
 	${CTFCONVERT_CMD}
 
 .include <bsd.kmod.mk>

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 16:51:29 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0E88D828;
 Tue, 10 Sep 2013 16:51:29 +0000 (UTC)
 (envelope-from obrien@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
 [IPv6:2001:1900:2254:206c::16:87])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E8EEA29FD;
 Tue, 10 Sep 2013 16:51:28 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
 by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AGpStf067810;
 Tue, 10 Sep 2013 16:51:28 GMT
 (envelope-from obrien@freefall.freebsd.org)
Received: (from obrien@localhost)
 by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r8AGpRlB066052;
 Tue, 10 Sep 2013 16:51:27 GMT (envelope-from obrien)
Date: Tue, 10 Sep 2013 09:51:27 -0700
From: "David O'Brien" <obrien@FreeBSD.org>
To: John-Mark Gurney <jmg@funkthat.com>
Subject: Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni
Message-ID: <20130910165127.GA69190@dragon.NUXI.org>
References: <201309031831.r83IVNkh026523@svn.freebsd.org>
 <20130910060132.GA61541@dragon.NUXI.org>
 <20130910064149.GS68682@funkthat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130910064149.GS68682@funkthat.com>
X-Operating-System: FreeBSD 10.0-CURRENT
X-MUA-Host: dragon.NUXI.org
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger?
X-NSA-real-insignia: https://www.eff.org/sites/default/files/nsa-all-your-data.png
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@FreeBSD.org, Konstantin Belousov <kostikbel@gmail.com>,
 svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, re@FreeBSD.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: obrien@freebsd.org
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 16:51:29 -0000

On Mon, Sep 09, 2013 at 11:41:49PM -0700, John-Mark Gurney wrote:
> David O'Brien wrote this message on Mon, Sep 09, 2013 at 23:01 -0700:
> Please back that out until you have an understand of what the real
> problem is...

Folks use FreeBSD for real work -- I have a window of opportunity to
install a new world + kernel.  When I tried updating this laptop in
early August the kernel build was broken.  It appeared broken again
this time.

The issue is you added a new feature to the GCC compiler
(r255185 2013-09-03), and then immediately consumed it in the kernel
build (r255187 2013-09-03 11:31:23).  You did not put anything in
UPDATING warning folks of this.


Robert Watson used to often remind folks that when we add features to
the toolchain we give a reasonable amount of time for them to work
their way into folks userland before using them in the kernel build.


My userland sources are from Sunday September 1st when I started my
'make buildworld' + 'mergemaster -p' + 'make installworld' +
'mergemaster -i' sequence.  Sorry it takes so long to build world with
clang on a T60.  I updated my kernel sources and tried to build a new
kernel before rebooting.  I had no reason to not expect a 2 day old
compiler could not build a kernel during a code freeze.

I've backed out r255440 as r255452.

Please add a note to UPDATING.

-- 
-- David  (obrien@FreeBSD.org)

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 17:26:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 996D65F1;
 Tue, 10 Sep 2013 17:26:10 +0000 (UTC) (envelope-from jmg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 856272C43;
 Tue, 10 Sep 2013 17:26:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AHQAwj071896;
 Tue, 10 Sep 2013 17:26:10 GMT (envelope-from jmg@svn.freebsd.org)
Received: (from jmg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AHQAZa071894;
 Tue, 10 Sep 2013 17:26:10 GMT (envelope-from jmg@svn.freebsd.org)
Message-Id: <201309101726.r8AHQAZa071894@svn.freebsd.org>
From: John-Mark Gurney <jmg@FreeBSD.org>
Date: Tue, 10 Sep 2013 17:26:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255453 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 17:26:10 -0000

Author: jmg
Date: Tue Sep 10 17:26:09 2013
New Revision: 255453
URL: http://svnweb.freebsd.org/changeset/base/255453

Log:
  add note about gcc and aesni...
  
  Approved by:	re (gjb, kib)

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Sep 10 16:50:13 2013	(r255452)
+++ head/UPDATING	Tue Sep 10 17:26:09 2013	(r255453)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	advised: libc, libprocstat, dhclient, tcpdump, hastd, hastctl,
 	kdump, procstat, rwho, rwhod, uniq.
 
+20130903:
+       AES-NI intrinsic support has been added to gcc.  The AES-NI module
+       has been updated to use this support.  A new gcc is required to build
+       the aesni module on both i386 and amd64.
+
 20130827:
         Thomas Dickey (vendor author thereof) reports that dialog(1) since
         2011/10/18 has a bug in handling --hline. Testers and I noticed the

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 17:45:44 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A7F68B58;
 Tue, 10 Sep 2013 17:45:44 +0000 (UTC)
 (envelope-from dumbbell@FreeBSD.org)
Received: from mail.made4.biz (unknown [IPv6:2001:41d0:1:7018::1:3])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6BB202D8B;
 Tue, 10 Sep 2013 17:45:44 +0000 (UTC)
Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=[192.168.1.179])
 by mail.made4.biz with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256)
 (Exim 4.80.1 (FreeBSD)) (envelope-from <dumbbell@FreeBSD.org>)
 id 1VJS0T-000Hi7-Kv; Tue, 10 Sep 2013 19:45:42 +0200
Message-ID: <522F5AC4.3040807@FreeBSD.org>
Date: Tue, 10 Sep 2013 19:45:40 +0200
From: =?ISO-8859-15?Q?Jean-S=E9bastien_P=E9dron?= <dumbbell@FreeBSD.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
 rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: John Baldwin <jhb@freebsd.org>
Subject: Re: svn commit: r254882 - head/sys/dev/pci
References: <201308251809.r7PI9CsE052978@svn.freebsd.org>
 <201309031410.46052.jhb@freebsd.org> <52298BCA.7040602@FreeBSD.org>
 <201309091151.24587.jhb@freebsd.org>
In-Reply-To: <201309091151.24587.jhb@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 17:45:44 -0000

Le 09/09/2013 17:51, John Baldwin a écrit :
> Ok, let's punt on changing the API perhaps, but use the vgapci softc to find
> the resource:

This patch builds for me, but I can't tell if it works, as my computer 
only uses the pmap_mapbios() case. That's also why I never noticed the 
bogus behavior earlier.

-- 
Jean-Sébastien Pédron

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 18:26:35 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B4A7E78C;
 Tue, 10 Sep 2013 18:26:35 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 888522057;
 Tue, 10 Sep 2013 18:26:35 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 73E59B976;
 Tue, 10 Sep 2013 14:26:34 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: Alexey Dokuchaev <danfe@freebsd.org>
Subject: Re: svn commit: r255426 - in head: lib/libc/sys sys/compat/freebsd32
 sys/compat/linux sys/compat/svr4 sys/dev/drm2/i915 sys/i386/ibcs2
 sys/i386/linux sys/ia64/ia32 sys/kern sys/sparc64/sparc64 sys/sys ...
Date: Tue, 10 Sep 2013 14:24:39 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201309091812.r89IC0YH015840@svn.freebsd.org>
 <20130910092323.GA58955@FreeBSD.org>
In-Reply-To: <20130910092323.GA58955@FreeBSD.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201309101424.39322.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Tue, 10 Sep 2013 14:26:34 -0400 (EDT)
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 18:26:35 -0000

On Tuesday, September 10, 2013 5:23:23 am Alexey Dokuchaev wrote:
> On Mon, Sep 09, 2013 at 06:12:00PM +0000, John Baldwin wrote:
> > New Revision: 255426
> > URL: http://svnweb.freebsd.org/changeset/base/255426
> > 
> > Log:
> > [...]
> >   To facilitate this, add a new parameter to vm_map_find() that specifies an
> >   optional maximum virtual address.  While here, fix several callers of
> >   vm_map_find() to use a VMFS_* constant for the findspace argument instead
> >   of TRUE and FALSE.
> 
> This commit breaks NVidia driver port, and (again) there was no corresponding
> __FreeBSD_version bump.

My bad, I completely missed the version bump.  Userland consumers can use
#ifdef MAP_32BIT which is why I didn't add one.

> This is another recent incident with -CURRENT silently changing KPIs that are
> publicly used.

To be fair, these are fairly internal KPIs unlike, say, the cdevsw interface that
is widely used in many drivers.  You can count all of the internal and external
users of this function on two hands.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 18:26:36 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 20AFD78D;
 Tue, 10 Sep 2013 18:26:36 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id EBA382058;
 Tue, 10 Sep 2013 18:26:35 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 93279B964;
 Tue, 10 Sep 2013 14:26:32 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: "=?iso-8859-15?q?Jean-S=E9bastien?= =?iso-8859-15?q?_P=E9dron?="
 <dumbbell@freebsd.org>
Subject: Re: svn commit: r254882 - head/sys/dev/pci
Date: Tue, 10 Sep 2013 14:18:19 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201308251809.r7PI9CsE052978@svn.freebsd.org>
 <201309091151.24587.jhb@freebsd.org> <522F5AC4.3040807@FreeBSD.org>
In-Reply-To: <522F5AC4.3040807@FreeBSD.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Message-Id: <201309101418.19178.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Tue, 10 Sep 2013 14:26:32 -0400 (EDT)
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 18:26:36 -0000

On Tuesday, September 10, 2013 1:45:40 pm Jean-S=E9bastien P=E9dron wrote:
> Le 09/09/2013 17:51, John Baldwin a =E9crit :
> > Ok, let's punt on changing the API perhaps, but use the vgapci softc to=
=20
find
> > the resource:
>=20
> This patch builds for me, but I can't tell if it works, as my computer=20
> only uses the pmap_mapbios() case. That's also why I never noticed the=20
> bogus behavior earlier.

What if you try to force it to always use the PCIR_BIOS case?

=2D-=20
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 18:26:36 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A3F5178F;
 Tue, 10 Sep 2013 18:26:36 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7A02B2059;
 Tue, 10 Sep 2013 18:26:36 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id E6010B968;
 Tue, 10 Sep 2013 14:26:33 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: obrien@freebsd.org
Subject: Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni
Date: Tue, 10 Sep 2013 14:22:01 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201309031831.r83IVNkh026523@svn.freebsd.org>
 <20130910064149.GS68682@funkthat.com>
 <20130910165127.GA69190@dragon.NUXI.org>
In-Reply-To: <20130910165127.GA69190@dragon.NUXI.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201309101422.01635.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Tue, 10 Sep 2013 14:26:34 -0400 (EDT)
Cc: src-committers@freebsd.org, re@freebsd.org,
 John-Mark Gurney <jmg@funkthat.com>, Konstantin Belousov <kostikbel@gmail.com>,
 svn-src-head@freebsd.org, svn-src-all@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 18:26:36 -0000

On Tuesday, September 10, 2013 12:51:27 pm David O'Brien wrote:
> On Mon, Sep 09, 2013 at 11:41:49PM -0700, John-Mark Gurney wrote:
> > David O'Brien wrote this message on Mon, Sep 09, 2013 at 23:01 -0700:
> > Please back that out until you have an understand of what the real
> > problem is...
> 
> Folks use FreeBSD for real work -- I have a window of opportunity to
> install a new world + kernel.  When I tried updating this laptop in
> early August the kernel build was broken.  It appeared broken again
> this time.
> 
> The issue is you added a new feature to the GCC compiler
> (r255185 2013-09-03), and then immediately consumed it in the kernel
> build (r255187 2013-09-03 11:31:23).  You did not put anything in
> UPDATING warning folks of this.
> 
> 
> Robert Watson used to often remind folks that when we add features to
> the toolchain we give a reasonable amount of time for them to work
> their way into folks userland before using them in the kernel build.
> 
> 
> My userland sources are from Sunday September 1st when I started my
> 'make buildworld' + 'mergemaster -p' + 'make installworld' +
> 'mergemaster -i' sequence.  Sorry it takes so long to build world with
> clang on a T60.  I updated my kernel sources and tried to build a new
> kernel before rebooting.  I had no reason to not expect a 2 day old
> compiler could not build a kernel during a code freeze.

Err, you are running head.  If you get a compile failure when you have updated 
your kernel to newer than world, your first reponse should be to make your 
kernel sources match your world, not committing an untested change.

Also, the level of change in the tree is always the _worst_ right at code 
freeze.  You can debate whether or not it should be that way, but in practice 
it always is and you should know better.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 18:34:39 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 107F3C13;
 Tue, 10 Sep 2013 18:34:39 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id F0FC320F6;
 Tue, 10 Sep 2013 18:34:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AIYcTl014110;
 Tue, 10 Sep 2013 18:34:38 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AIYcl6014109;
 Tue, 10 Sep 2013 18:34:38 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101834.r8AIYcl6014109@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 18:34:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255454 - head/tools
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 18:34:39 -0000

Author: des
Date: Tue Sep 10 18:34:38 2013
New Revision: 255454
URL: http://svnweb.freebsd.org/changeset/base/255454

Log:
  Make this more deterministic by sorting the libraries before processing
  them and ensuring that we always use the samme collation rules.
  
  Approved by:	re (gjb)

Modified:
  head/tools/make_libdeps.sh

Modified: head/tools/make_libdeps.sh
==============================================================================
--- head/tools/make_libdeps.sh	Tue Sep 10 17:26:09 2013	(r255453)
+++ head/tools/make_libdeps.sh	Tue Sep 10 18:34:38 2013	(r255454)
@@ -28,6 +28,7 @@
 
 export PATH=/bin:/usr/bin
 
+LC_ALL=C			# make sort deterministic
 FS=': '				# internal field separator
 LIBDEPENDS=./_libdeps		# intermediate output file
 USRSRC=${1:-/usr/src}		# source root
@@ -64,7 +65,7 @@ genlibdepends()
 {
 	(
 		cd ${USRSRC}
-		find ${LIBS} -mindepth 1 -name Makefile |
+		find -s ${LIBS} -mindepth 1 -name Makefile |
 		xargs grep -l 'bsd\.lib\.mk' |
 		while read makefile; do
 			libdir=$(dirname ${makefile})

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 18:40:45 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7D91B1AE;
 Tue, 10 Sep 2013 18:40:45 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 696AA217A;
 Tue, 10 Sep 2013 18:40:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AIejHN017103;
 Tue, 10 Sep 2013 18:40:45 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AIehmO017094;
 Tue, 10 Sep 2013 18:40:43 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309101840.r8AIehmO017094@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 18:40:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255455 - in head: kerberos5 kerberos5/lib/libheimipcc
 kerberos5/lib/libheimipcs kerberos5/lib/libkrb5
 kerberos5/libexec/digest-service kerberos5/libexec/kcm share/mk
 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 18:40:45 -0000

Author: des
Date: Tue Sep 10 18:40:43 2013
New Revision: 255455
URL: http://svnweb.freebsd.org/changeset/base/255455

Log:
  Clean up the Kerberos build by turning libheimipcc and libheimipcs into
  private shared libraries, instead of hacked-together archives of PIC
  objects.  This makes it possible to build a static libkrb5 that works.
  
  Reviewed by:	stas
  Approved by:	re (gjb)

Modified:
  head/kerberos5/Makefile.inc
  head/kerberos5/lib/libheimipcc/Makefile
  head/kerberos5/lib/libheimipcs/Makefile
  head/kerberos5/lib/libkrb5/Makefile
  head/kerberos5/libexec/digest-service/Makefile
  head/kerberos5/libexec/kcm/Makefile
  head/share/mk/bsd.libnames.mk
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/kerberos5/Makefile.inc
==============================================================================
--- head/kerberos5/Makefile.inc	Tue Sep 10 18:34:38 2013	(r255454)
+++ head/kerberos5/Makefile.inc	Tue Sep 10 18:40:43 2013	(r255455)
@@ -14,8 +14,6 @@ LDAPCFLAGS=	-I${OPENLDAPBASE}/include -D
 LDAPLDFLAGS=	-L${OPENLDAPBASE}/lib -Wl,-rpath,${OPENLDAPBASE}/lib
 .endif
 
-LIBHEIMIPCC=	${.OBJDIR}/../../lib/libheimipcc/libheimipcc.a
-LIBHEIMIPCS=	${.OBJDIR}/../../lib/libheimipcs/libheimipcs.a
 LIBVERS=	${.OBJDIR}/../../lib/libvers/libvers.a
 LIBSL=		${.OBJDIR}/../../lib/libsl/libsl.a
 

Modified: head/kerberos5/lib/libheimipcc/Makefile
==============================================================================
--- head/kerberos5/lib/libheimipcc/Makefile	Tue Sep 10 18:34:38 2013	(r255454)
+++ head/kerberos5/lib/libheimipcc/Makefile	Tue Sep 10 18:40:43 2013	(r255455)
@@ -1,7 +1,7 @@
 #$FreeBSD$
 
 LIB=	heimipcc
-INTERNALLIB=
+PRIVATELIB=
 LDADD=	-lheimbase -lroken -lpthread
 DPADD=	${LIBHEIMBASE} ${LIBROKEN} ${LIBPTHREAD}
 
@@ -9,7 +9,6 @@ SRCS=	\
 	client.c \
 	common.c
 
-CFLAGS+=	-DPIC ${PICFLAG}
 CFLAGS+=	-I${KRB5DIR}/lib/roken \
 		-I${KRB5DIR}/base \
 		-I${KRB5DIR}/lib/ipc

Modified: head/kerberos5/lib/libheimipcs/Makefile
==============================================================================
--- head/kerberos5/lib/libheimipcs/Makefile	Tue Sep 10 18:34:38 2013	(r255454)
+++ head/kerberos5/lib/libheimipcs/Makefile	Tue Sep 10 18:40:43 2013	(r255455)
@@ -1,7 +1,7 @@
 #$FreeBSD$
 
 LIB=	heimipcs
-INTERNALLIB=
+PRIVATELIB=
 LDADD=	-lheimbase -lroken
 LDFLAGS=	-pthread
 DPADD=	${LIBHEIMBASE} ${LIBROKEN}
@@ -10,7 +10,6 @@ SRCS=	\
 	server.c \
 	common.c
 
-CFLAGS+=	-DPIC ${PICFLAG}
 CFLAGS+=	-I${KRB5DIR}/lib/roken \
 		-I${KRB5DIR}/base \
 		-I${KRB5DIR}/lib/ipc -I.

Modified: head/kerberos5/lib/libkrb5/Makefile
==============================================================================
--- head/kerberos5/lib/libkrb5/Makefile	Tue Sep 10 18:34:38 2013	(r255454)
+++ head/kerberos5/lib/libkrb5/Makefile	Tue Sep 10 18:40:43 2013	(r255455)
@@ -3,8 +3,9 @@
 LIB=	krb5
 LDFLAGS=	-Wl,--no-undefined
 VERSION_MAP= ${KRB5DIR}/lib/krb5/version-script.map
-LDADD=	-lasn1 -lcom_err -lcrypt -lcrypto -lhx509 -lroken -lwind -lheimbase ${LIBHEIMIPCC}
+LDADD=	-lasn1 -lcom_err -lcrypt -lcrypto -lhx509 -lroken -lwind -lheimbase -lheimipcc
 DPADD=	${LIBASN1} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO} ${LIBHX509} ${LIBROKEN} ${LIBWIND} ${LIBHEIMBASE} ${LIBHEIMIPCC}
+USEPRIVATELIB= heimipcc
 
 INCS=	heim_err.h \
 	heim_threads.h \

Modified: head/kerberos5/libexec/digest-service/Makefile
==============================================================================
--- head/kerberos5/libexec/digest-service/Makefile	Tue Sep 10 18:34:38 2013	(r255454)
+++ head/kerberos5/libexec/digest-service/Makefile	Tue Sep 10 18:40:43 2013	(r255455)
@@ -8,10 +8,11 @@ CFLAGS+=	-I${KRB5DIR}/kdc \
 		-I${KRB5DIR}/lib/ipc \
 		-I${KRB5DIR}/lib/wind \
 		-I${KRB5DIR}/lib/roken
-DPADD=	${LIBHDB} ${LIBKDC} ${LIBHEIMIPCS} ${LIBKRB5} ${LIBROKEN} ${LIBASN1} ${LIBCRYPTO} \
-	${LIBCRYPT} ${LIBVERS}
-LDADD=	-lhdb -lkdc ${LIBHEIMIPCS} -lkrb5 -lroken -lasn1 -lcrypto -lcrypt \
+DPADD=	${LIBHDB} ${LIBKDC} ${LIBHEIMIPCS} ${LIBKRB5} ${LIBROKEN} ${LIBASN1} \
+	${LIBCRYPTO} ${LIBCRYPT} ${LIBVERS}
+LDADD=	-lhdb -lkdc -lheimipcs -lkrb5 -lroken -lasn1 -lcrypto -lcrypt \
 	${LIBVERS} -lheimntlm
+USEPRIVATELIB= heimipcs
 
 .include <bsd.prog.mk>
 

Modified: head/kerberos5/libexec/kcm/Makefile
==============================================================================
--- head/kerberos5/libexec/kcm/Makefile	Tue Sep 10 18:34:38 2013	(r255454)
+++ head/kerberos5/libexec/kcm/Makefile	Tue Sep 10 18:40:43 2013	(r255455)
@@ -21,8 +21,9 @@ CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DI
 	-I${KRB5DIR}/kcm -I${KRB5DIR}/lib/ipc ${LDAPCFLAGS}
 DPADD=	${LIBHDB} ${LIBKRB5} ${LIBROKEN} ${LIBASN1} ${LIBHEIMNTLM} \
 	${LIBHEIMIPCS} ${LIBCRYPTO} ${LIBCRYPT} ${LIBVERS} ${LDAPDPADD}
-LDADD=	-lhdb -lkrb5 -lroken -lasn1 -lheimntlm ${LIBHEIMIPCS} \
+LDADD=	-lhdb -lkrb5 -lroken -lasn1 -lheimntlm -lheimipcs \
 	-lcrypto -lcrypt ${LIBVERS} ${LDAPLDADD}
+USEPRIVATELIB= heimipcs
 LDFLAGS=${LDAPLDFLAGS}
 
 .include <bsd.prog.mk>

Modified: head/share/mk/bsd.libnames.mk
==============================================================================
--- head/share/mk/bsd.libnames.mk	Tue Sep 10 18:34:38 2013	(r255454)
+++ head/share/mk/bsd.libnames.mk	Tue Sep 10 18:40:43 2013	(r255455)
@@ -65,6 +65,8 @@ LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/lib
 LIBHDB?=	${DESTDIR}${LIBDIR}/libhdb.a
 LIBHISTORY?=	${DESTDIR}${LIBDIR}/libhistory.a
 LIBHEIMBASE?=	${DESTDIR}${LIBDIR}/libheimbase.a
+LIBHEIMIPCC?=	${DESTDIR}${LIBPRIVATEDIR}/libheimipcc.a
+LIBHEIMIPCS?=	${DESTDIR}${LIBPRIVATEDIR}/libheimipcs.a
 LIBHEIMNTLM?=	${DESTDIR}${LIBDIR}/libheimntlm.a
 LIBHEIMSQLITE?=	${DESTDIR}${LIBDIR}/libheimsqlite.a
 LIBHX509?=	${DESTDIR}${LIBDIR}/libhx509.a

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Tue Sep 10 18:34:38 2013	(r255454)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Tue Sep 10 18:40:43 2013	(r255455)
@@ -2548,6 +2548,14 @@ OLD_FILES+=usr/lib/pam_krb5.so
 OLD_LIBS+=usr/lib/pam_krb5.so.5
 OLD_FILES+=usr/lib/pam_ksu.so
 OLD_LIBS+=usr/lib/pam_ksu.so.5
+OLD_FILES+=usr/lib/private/libheimipcc.a
+OLD_FILES+=usr/lib/private/libheimipcc.so
+OLD_LIBS+=usr/lib/private/libheimipcc.so.11
+OLD_FILES+=usr/lib/private/libheimipcc_p.a
+OLD_FILES+=usr/lib/private/libheimipcs.a
+OLD_FILES+=usr/lib/private/libheimipcs.so
+OLD_LIBS+=usr/lib/private/libheimipcs.so.11
+OLD_FILES+=usr/lib/private/libheimipcs_p.a
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
 OLD_FILES+=usr/lib32/libasn1.a
 OLD_FILES+=usr/lib32/libasn1.so
@@ -2617,6 +2625,14 @@ OLD_FILES+=usr/lib32/pam_krb5.so
 OLD_LIBS+=usr/lib32/pam_krb5.so.5
 OLD_FILES+=usr/lib32/pam_ksu.so
 OLD_LIBS+=usr/lib32/pam_ksu.so.5
+OLD_FILES+=usr/lib32/private/libheimipcc.a
+OLD_FILES+=usr/lib32/private/libheimipcc.so
+OLD_LIBS+=usr/lib32/private/libheimipcc.so.11
+OLD_FILES+=usr/lib32/private/libheimipcc_p.a
+OLD_FILES+=usr/lib32/private/libheimipcs.a
+OLD_FILES+=usr/lib32/private/libheimipcs.so
+OLD_LIBS+=usr/lib32/private/libheimipcs.so.11
+OLD_FILES+=usr/lib32/private/libheimipcs_p.a
 .endif
 OLD_FILES+=usr/libexec/digest-service
 OLD_FILES+=usr/libexec/hprop

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 19:00:32 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A3E30628;
 Tue, 10 Sep 2013 19:00:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 920E62316;
 Tue, 10 Sep 2013 19:00:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AJ0Wfv030044;
 Tue, 10 Sep 2013 19:00:32 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AJ0WnI030043;
 Tue, 10 Sep 2013 19:00:32 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201309101900.r8AJ0WnI030043@svn.freebsd.org>
From: Glen Barber <gjb@FreeBSD.org>
Date: Tue, 10 Sep 2013 19:00:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255456 - releng/9.2/sys/kern
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 19:00:32 -0000

Author: gjb
Date: Tue Sep 10 19:00:32 2013
New Revision: 255456
URL: http://svnweb.freebsd.org/changeset/base/255456

Log:
  Reintegrate r250907 (previously reverted as r254754) plus MFS r254947,
  r255443:
  
  r250907 (scottl):
    MFC r248830, r250027, r250409: Several fixes and improvements
    to sendfile()
  
  r254947 (kib):
    NFS implementation of VOP_READ() sometimes upgrades the vnode lock,
    which causes drop of the shared lock and sleep for exclusive.  As
    result, busying of the page before the call to vn_rdwr() makes NFS
    code to wait for vnode lock while page is busy, which contradicts the
    proper order of vnode lock -> busy.
  
  r255443 (des):
    Fix the length calculation for the final block of a sendfile(2)
    transmission which could be tricked into rounding up to the nearest
    page size, leaking up to a page of kernel memory.  [13:11]
  
  Approved by:	re (delphij)
  Sponsored by:	The FreeBSD Foundation

Modified:
  releng/9.2/sys/kern/uipc_syscalls.c
Directory Properties:
  releng/9.2/sys/   (props changed)

Modified: releng/9.2/sys/kern/uipc_syscalls.c
==============================================================================
--- releng/9.2/sys/kern/uipc_syscalls.c	Tue Sep 10 18:40:43 2013	(r255455)
+++ releng/9.2/sys/kern/uipc_syscalls.c	Tue Sep 10 19:00:32 2013	(r255456)
@@ -1835,9 +1835,11 @@ kern_sendfile(struct thread *td, struct 
 	struct mbuf *m = NULL;
 	struct sf_buf *sf;
 	struct vm_page *pg;
+	struct vattr va;
 	off_t off, xfsize, fsbytes = 0, sbytes = 0, rem = 0;
 	int error, hdrlen = 0, mnw = 0;
 	int vfslocked;
+	int bsize;
 	struct sendfile_sync *sfs = NULL;
 
 	/*
@@ -1852,6 +1854,18 @@ kern_sendfile(struct thread *td, struct 
 	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
 	vn_lock(vp, LK_SHARED | LK_RETRY);
 	if (vp->v_type == VREG) {
+		bsize = vp->v_mount->mnt_stat.f_iosize;
+		if (uap->nbytes == 0) {
+			error = VOP_GETATTR(vp, &va, td->td_ucred);
+			if (error != 0) {
+				VOP_UNLOCK(vp, 0);
+				VFS_UNLOCK_GIANT(vfslocked);
+				obj = NULL;
+				goto out;
+			}
+			rem = va.va_size;
+		} else
+			rem = uap->nbytes;
 		obj = vp->v_object;
 		if (obj != NULL) {
 			/*
@@ -1869,7 +1883,8 @@ kern_sendfile(struct thread *td, struct 
 				obj = NULL;
 			}
 		}
-	}
+	} else
+		bsize = 0;	/* silence gcc */
 	VOP_UNLOCK(vp, 0);
 	VFS_UNLOCK_GIANT(vfslocked);
 	if (obj == NULL) {
@@ -1962,11 +1977,20 @@ kern_sendfile(struct thread *td, struct 
 	 * The outer loop checks the state and available space of the socket
 	 * and takes care of the overall progress.
 	 */
-	for (off = uap->offset, rem = uap->nbytes; ; ) {
-		struct mbuf *mtail = NULL;
-		int loopbytes = 0;
-		int space = 0;
-		int done = 0;
+	for (off = uap->offset; ; ) {
+		struct mbuf *mtail;
+		int loopbytes;
+		int space;
+		int done;
+
+		if ((uap->nbytes != 0 && uap->nbytes == fsbytes) ||
+		    (uap->nbytes == 0 && va.va_size == fsbytes))
+			break;
+
+		mtail = NULL;
+		loopbytes = 0;
+		space = 0;
+		done = 0;
 
 		/*
 		 * Check the socket state for ongoing connection,
@@ -2034,6 +2058,20 @@ retry_space:
 		 */
 		space -= hdrlen;
 
+		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
+		error = vn_lock(vp, LK_SHARED);
+		if (error != 0) {
+			VFS_UNLOCK_GIANT(vfslocked);
+			goto done;
+		}
+		error = VOP_GETATTR(vp, &va, td->td_ucred);
+		if (error != 0 || off >= va.va_size) {
+			VOP_UNLOCK(vp, 0);
+			VFS_UNLOCK_GIANT(vfslocked);
+			goto done;
+		}
+		VFS_UNLOCK_GIANT(vfslocked);
+
 		/*
 		 * Loop and construct maximum sized mbuf chain to be bulk
 		 * dumped into socket buffer.
@@ -2043,25 +2081,19 @@ retry_space:
 			vm_offset_t pgoff;
 			struct mbuf *m0;
 
-			VM_OBJECT_LOCK(obj);
 			/*
 			 * Calculate the amount to transfer.
 			 * Not to exceed a page, the EOF,
 			 * or the passed in nbytes.
 			 */
 			pgoff = (vm_offset_t)(off & PAGE_MASK);
-			xfsize = omin(PAGE_SIZE - pgoff,
-			    obj->un_pager.vnp.vnp_size - uap->offset -
-			    fsbytes - loopbytes);
-			if (uap->nbytes)
-				rem = (uap->nbytes - fsbytes - loopbytes);
-			else
-				rem = obj->un_pager.vnp.vnp_size -
-				    uap->offset - fsbytes - loopbytes;
-			xfsize = omin(rem, xfsize);
+			rem = va.va_size - uap->offset;
+			if (uap->nbytes != 0)
+				rem = omin(rem, uap->nbytes);
+			rem -= fsbytes + loopbytes;
+			xfsize = omin(PAGE_SIZE - pgoff, rem);
 			xfsize = omin(space - loopbytes, xfsize);
 			if (xfsize <= 0) {
-				VM_OBJECT_UNLOCK(obj);
 				done = 1;		/* all data sent */
 				break;
 			}
@@ -2071,6 +2103,7 @@ retry_space:
 			 * if not found or wait and loop if busy.
 			 */
 			pindex = OFF_TO_IDX(off);
+			VM_OBJECT_LOCK(obj);
 			pg = vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY |
 			    VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_RETRY);
 
@@ -2088,42 +2121,25 @@ retry_space:
 			else if (uap->flags & SF_NODISKIO)
 				error = EBUSY;
 			else {
-				int bsize;
 				ssize_t resid;
 
-				/*
-				 * Ensure that our page is still around
-				 * when the I/O completes.
-				 */
-				vm_page_io_start(pg);
 				VM_OBJECT_UNLOCK(obj);
 
 				/*
 				 * Get the page from backing store.
-				 */
-				vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-				error = vn_lock(vp, LK_SHARED);
-				if (error != 0)
-					goto after_read;
-				bsize = vp->v_mount->mnt_stat.f_iosize;
-
-				/*
 				 * XXXMAC: Because we don't have fp->f_cred
 				 * here, we pass in NOCRED.  This is probably
 				 * wrong, but is consistent with our original
 				 * implementation.
 				 */
+				vfslocked = VFS_LOCK_GIANT(vp->v_mount);
 				error = vn_rdwr(UIO_READ, vp, NULL, MAXBSIZE,
 				    trunc_page(off), UIO_NOCOPY, IO_NODELOCKED |
 				    IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT),
 				    td->td_ucred, NOCRED, &resid, td);
-				VOP_UNLOCK(vp, 0);
-			after_read:
 				VFS_UNLOCK_GIANT(vfslocked);
-				VM_OBJECT_LOCK(obj);
-				vm_page_io_finish(pg);
-				if (!error)
-					VM_OBJECT_UNLOCK(obj);
+				if (error)
+					VM_OBJECT_LOCK(obj);
 				mbstat.sf_iocnt++;
 			}
 			if (error) {
@@ -2174,7 +2190,7 @@ retry_space:
 			m0 = m_get((mnw ? M_NOWAIT : M_WAITOK), MT_DATA);
 			if (m0 == NULL) {
 				error = (mnw ? EAGAIN : ENOBUFS);
-				sf_buf_mext((void *)sf_buf_kva(sf), sf);
+				sf_buf_mext(NULL, sf);
 				break;
 			}
 			MEXTADD(m0, sf_buf_kva(sf), PAGE_SIZE, sf_buf_mext,
@@ -2202,6 +2218,8 @@ retry_space:
 			}
 		}
 
+		VOP_UNLOCK(vp, 0);
+
 		/* Add the buffer chain to the socket buffer. */
 		if (m != NULL) {
 			int mlen, err;

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 20:56:01 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BAB673DE;
 Tue, 10 Sep 2013 20:56:01 +0000 (UTC)
 (envelope-from bapt@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 96ECE2B21;
 Tue, 10 Sep 2013 20:56:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AKu1s0000443;
 Tue, 10 Sep 2013 20:56:01 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AKu1rQ000442;
 Tue, 10 Sep 2013 20:56:01 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201309102056.r8AKu1rQ000442@svn.freebsd.org>
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Tue, 10 Sep 2013 20:56:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255457 - head/usr.sbin/pkg
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 20:56:01 -0000

Author: bapt
Date: Tue Sep 10 20:56:01 2013
New Revision: 255457
URL: http://svnweb.freebsd.org/changeset/base/255457

Log:
  Add support to detect arm vs armv6
  
  There are two different versions of the ARM ABI depending on the
  TARGET_ARCH. As these are sligntly different a package built for
  one may not work on another. We need to detect which one we are on
  by parsing the .ARM.attributes section.
  
  This will only work on the ARM EABI as this section is part of the
  ABI definition. As armv6 only supports the ARM EABI this is not a
  problem for the oabi.
  
  Older versions of libelf in FreeBSD fail to read the
  .ARM.attributes section needed. As armv6 is unsupported on these
  versions we can assume we are running on arm.
  
  Submitted by:	andrew
  Approved by:	re (delphij)
  Obtained from:	pkgng git

Modified:
  head/usr.sbin/pkg/config.c

Modified: head/usr.sbin/pkg/config.c
==============================================================================
--- head/usr.sbin/pkg/config.c	Tue Sep 10 19:00:32 2013	(r255456)
+++ head/usr.sbin/pkg/config.c	Tue Sep 10 20:56:01 2013	(r255457)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/elf_common.h>
 #include <sys/endian.h>
 
+#include <assert.h>
 #include <bsdyml.h>
 #include <ctype.h>
 #include <err.h>
@@ -100,6 +101,138 @@ elf_corres_to_string(struct _elf_corres 
 	return ("unknown");
 }
 
+static const char *
+aeabi_parse_arm_attributes(void *data, size_t length) 
+{
+	uint32_t sect_len;
+	uint8_t *section = data;
+
+#define	MOVE(len) do {            \
+	assert(length >= (len));  \
+	section += (len);         \
+	length -= (len);          \
+} while (0)
+
+	if (length == 0 || *section != 'A')
+		return (NULL);
+
+	MOVE(1);
+
+	/* Read the section length */
+	if (length < sizeof(sect_len))
+		return (NULL);
+
+	memcpy(&sect_len, section, sizeof(sect_len));
+
+	/*
+	 * The section length should be no longer than the section it is within
+	 */
+	if (sect_len > length)
+		return (NULL);
+
+	MOVE(sizeof(sect_len));
+
+	/* Skip the vendor name */
+	while (length != 0) {
+		if (*section == '\0')
+			break;
+		MOVE(1);
+	}
+	if (length == 0)
+		return (NULL);
+	MOVE(1);
+
+	while (length != 0) {
+		uint32_t tag_length;
+
+	switch(*section) {
+	case 1: /* Tag_File */
+		MOVE(1);
+		if (length < sizeof(tag_length))
+			return (NULL);
+		memcpy(&tag_length, section, sizeof(tag_length));
+		break;
+	case 2: /* Tag_Section */
+	case 3: /* Tag_Symbol */
+	default:
+		return (NULL);
+	}
+	/* At least space for the tag and size */
+	if (tag_length <= 5)
+		return (NULL);
+	tag_length--;
+	/* Check the tag fits */
+	if (tag_length > length)
+		return (NULL);
+
+#define  MOVE_TAG(len) do {           \
+	assert(tag_length >= (len));  \
+	MOVE(len);                    \
+	tag_length -= (len);          \
+} while(0)
+
+		MOVE(sizeof(tag_length));
+		tag_length -= sizeof(tag_length);
+
+		while (tag_length != 0) {
+			uint8_t tag;
+
+			assert(tag_length >= length);
+
+			tag = *section;
+			MOVE_TAG(1);
+
+			/*
+			 * These tag values come from:
+			 * 
+			 * Addenda to, and Errata in, the ABI for the
+			 * ARM Architecture. Release 2.08, section 2.3.
+			 */
+			if (tag == 6) { /* == Tag_CPU_arch */
+				uint8_t val;
+
+				val = *section;
+				/*
+				 * We don't support values that require
+				 * more than one byte.
+				 */
+				if (val & (1 << 7))
+					return (NULL);
+
+				/* We have an ARMv4 or ARMv5 */
+				if (val <= 5)
+					return ("arm");
+				else /* We have an ARMv6+ */
+					return ("armv6");
+			} else if (tag == 4 || tag == 5 || tag == 32 ||
+			    tag == 65 || tag == 67) {
+				while (*section != '\0' && length != 0)
+					MOVE_TAG(1);
+				if (tag_length == 0)
+					return (NULL);
+				/* Skip the last byte */
+				MOVE_TAG(1);
+			} else if ((tag >= 7 && tag <= 31) || tag == 34 ||
+			    tag == 36 || tag == 38 || tag == 42 || tag == 44 ||
+			    tag == 64 || tag == 66 || tag == 68 || tag == 70) {
+				/* Skip the uleb128 data */
+				while (*section & (1 << 7) && length != 0)
+					MOVE_TAG(1);
+				if (tag_length == 0)
+					return (NULL);
+				/* Skip the last byte */
+				MOVE_TAG(1);
+			} else
+				return (NULL);
+#undef MOVE_TAG
+		}
+
+		break;
+	}
+	return (NULL);
+#undef MOVE
+}
+
 static int
 pkg_get_myabi(char *dest, size_t sz)
 {
@@ -108,7 +241,8 @@ pkg_get_myabi(char *dest, size_t sz)
 	Elf_Note note;
 	Elf_Scn *scn;
 	char *src, *osname;
-	const char *abi, *fpu;
+	const char *arch, *abi, *fpu, *endian_corres_str;
+	const char *wordsize_corres_str;
 	GElf_Ehdr elfhdr;
 	GElf_Shdr shdr;
 	int fd, i, ret;
@@ -177,21 +311,72 @@ pkg_get_myabi(char *dest, size_t sz)
 	for (i = 0; osname[i] != '\0'; i++)
 		osname[i] = (char)tolower(osname[i]);
 
-	snprintf(dest, sz, "%s:%d:%s:%s",
-	    osname, version / 100000,
-	    elf_corres_to_string(mach_corres, (int)elfhdr.e_machine),
-	    elf_corres_to_string(wordsize_corres,
-	    (int)elfhdr.e_ident[EI_CLASS]));
+	wordsize_corres_str = elf_corres_to_string(wordsize_corres,
+	    (int)elfhdr.e_ident[EI_CLASS]);
+
+	arch = elf_corres_to_string(mach_corres, (int) elfhdr.e_machine);
+
+	snprintf(dest, sz, "%s:%d",
+	    osname, version / 100000);
 
 	ret = 0;
 
 	switch (elfhdr.e_machine) {
 	case EM_ARM:
+		endian_corres_str = elf_corres_to_string(endian_corres,
+		    (int)elfhdr.e_ident[EI_DATA]);
+
 		/* FreeBSD doesn't support the hard-float ABI yet */
 		fpu = "softfp";
 		if ((elfhdr.e_flags & 0xFF000000) != 0) {
+			const char *sh_name = NULL;
+			size_t shstrndx;
+
 			/* This is an EABI file, the conformance level is set */
 			abi = "eabi";
+			/* Find which TARGET_ARCH we are building for. */
+			elf_getshdrstrndx(elf, &shstrndx);
+			while ((scn = elf_nextscn(elf, scn)) != NULL) {
+				sh_name = NULL;
+				if (gelf_getshdr(scn, &shdr) != &shdr) {
+					scn = NULL;
+					break;
+				}
+
+				sh_name = elf_strptr(elf, shstrndx,
+				    shdr.sh_name);
+				if (sh_name == NULL)
+					continue;
+				if (strcmp(".ARM.attributes", sh_name) == 0)
+					break;
+			}
+			if (scn != NULL && sh_name != NULL) {
+				data = elf_getdata(scn, NULL);
+				/*
+				 * Prior to FreeBSD 10.0 libelf would return
+				 * NULL from elf_getdata on the .ARM.attributes
+				 * section. As this was the first release to
+				 * get armv6 support assume a NULL value means
+				 * arm.
+				 *
+				 * This assumption can be removed when 9.x
+				 * is unsupported.
+				 */
+				if (data != NULL) {
+					arch = aeabi_parse_arm_attributes(
+					    data->d_buf, data->d_size);
+					if (arch == NULL) {
+						ret = 1;
+						warn("unknown ARM ARCH");
+						goto cleanup;
+					}
+				}
+			} else {
+				ret = 1;
+				warn("Unable to find the .ARM.attributes "
+				    "section");
+				goto cleanup;
+			}
 		} else if (elfhdr.e_ident[EI_OSABI] != ELFOSABI_NONE) {
 			/*
 			 * EABI executables all have this field set to
@@ -200,12 +385,12 @@ pkg_get_myabi(char *dest, size_t sz)
 			abi = "oabi";
 		} else {
 			ret = 1;
+			warn("unknown ARM ABI");
 			goto cleanup;
 		}
 		snprintf(dest + strlen(dest), sz - strlen(dest),
-		    ":%s:%s:%s", elf_corres_to_string(endian_corres,
-		    (int)elfhdr.e_ident[EI_DATA]),
-		    abi, fpu);
+		    ":%s:%s:%s:%s:%s", arch, wordsize_corres_str,
+		    endian_corres_str, abi, fpu);
 		break;
 	case EM_MIPS:
 		/*
@@ -230,10 +415,15 @@ pkg_get_myabi(char *dest, size_t sz)
 				abi = "n64";
 			break;
 		}
-		snprintf(dest + strlen(dest), sz - strlen(dest),
-		    ":%s:%s", elf_corres_to_string(endian_corres,
-		    (int)elfhdr.e_ident[EI_DATA]), abi);
+		endian_corres_str = elf_corres_to_string(endian_corres,
+		    (int)elfhdr.e_ident[EI_DATA]);
+
+		snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s:%s:%s",
+		    arch, wordsize_corres_str, endian_corres_str, abi);
 		break;
+	default:
+		snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s",
+		    arch, wordsize_corres_str);
 	}
 
 cleanup:

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 21:16:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 76D83C02;
 Tue, 10 Sep 2013 21:16:19 +0000 (UTC)
 (envelope-from cperciva@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 63DA62CA7;
 Tue, 10 Sep 2013 21:16:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8ALGJmI013005;
 Tue, 10 Sep 2013 21:16:19 GMT
 (envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8ALGJRL013004;
 Tue, 10 Sep 2013 21:16:19 GMT
 (envelope-from cperciva@svn.freebsd.org)
Message-Id: <201309102116.r8ALGJRL013004@svn.freebsd.org>
From: Colin Percival <cperciva@FreeBSD.org>
Date: Tue, 10 Sep 2013 21:16:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255459 - head/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 21:16:19 -0000

Author: cperciva
Date: Tue Sep 10 21:16:18 2013
New Revision: 255459
URL: http://svnweb.freebsd.org/changeset/base/255459

Log:
  Remove documentation describing functionality which geom(4) does not,
  in fact, provide.
  
  Reviewed by:	phk
  MFC after:	3 days
  Approved by:	re (gjb)

Modified:
  head/share/man/man4/geom.4

Modified: head/share/man/man4/geom.4
==============================================================================
--- head/share/man/man4/geom.4	Tue Sep 10 21:09:20 2013	(r255458)
+++ head/share/man/man4/geom.4	Tue Sep 10 21:16:18 2013	(r255459)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 14, 2013
+.Dd September 10, 2013
 .Dt GEOM 4
 .Os
 .Sh NAME
@@ -354,24 +354,6 @@ only be done with their cooperation.
 Finally: the spoiling only happens when the write count goes from
 zero to non-zero and the retasting happens only when the write count goes
 from non-zero to zero.
-.It Em INSERT/DELETE
-are very special operations which allow a new geom
-to be instantiated between a consumer and a provider attached to
-each other and to remove it again.
-.Pp
-To understand the utility of this, imagine a provider
-being mounted as a file system.
-Between the DEVFS geom's consumer and its provider we insert
-a mirror module which configures itself with one mirror
-copy and consequently is transparent to the I/O requests
-on the path.
-We can now configure yet a mirror copy on the mirror geom,
-request a synchronization, and finally drop the first mirror
-copy.
-We have now, in essence, moved a mounted file system from one
-disk to another while it was being used.
-At this point the mirror geom can be deleted from the path
-again; it has served its purpose.
 .It Em CONFIGURE
 is the process where the administrator issues instructions
 for a particular class to instantiate itself.

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 21:16:40 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 16B37D41;
 Tue, 10 Sep 2013 21:16:40 +0000 (UTC)
 (envelope-from davide.italiano@gmail.com)
Received: from mail-ve0-x22d.google.com (mail-ve0-x22d.google.com
 [IPv6:2607:f8b0:400c:c01::22d])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8A5502CAF;
 Tue, 10 Sep 2013 21:16:39 +0000 (UTC)
Received: by mail-ve0-f173.google.com with SMTP id cz12so4914967veb.4
 for <multiple recipients>; Tue, 10 Sep 2013 14:16:38 -0700 (PDT)
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=1V2xiV+JcTbwaIWy5NQZ/Ex3WfYQkDTG56yzoeARpJc=;
 b=yUztzZJ3yr+E9lsJIpba6sZoiNQuKxq0D+S5ygDKNfA2m25AmKgLGQVyHrWhzok9bO
 RR5oLEENgxU2oT1IOI8uk0ZNVlqFdxDOZkRRNdnlaF+/tEm6BRpjXNf2ZZvHNr5lw+NA
 XSqXeG9gwN+rhQAkn3mEr/K344VJByPudNbj+PbcRcJEQ2KCRGeOnGbgUTyZB4+hL3uT
 cnf41wBI3FnZtElX8wDEUT0lxlq/s6HiY9EUNChRSKJmWz6sZ5VAR4/SV2oej3YZMFRU
 WPzrx9UR2FaurDTQvhQQmeOdRCta2PtfO6XJkxpM8iUSkbiwBqoFja7dwBx96KPWoWyS
 ue0Q==
MIME-Version: 1.0
X-Received: by 10.220.10.194 with SMTP id q2mr24383404vcq.2.1378847798735;
 Tue, 10 Sep 2013 14:16:38 -0700 (PDT)
Sender: davide.italiano@gmail.com
Received: by 10.220.65.132 with HTTP; Tue, 10 Sep 2013 14:16:38 -0700 (PDT)
In-Reply-To: <201308301039.r7UAduI1052038@svn.freebsd.org>
References: <201308301039.r7UAduI1052038@svn.freebsd.org>
Date: Tue, 10 Sep 2013 23:16:38 +0200
X-Google-Sender-Auth: PG5w4v8djNCv-qPqXFINWQumoG8
Message-ID: <CACYV=-Gd3ip+ukcNfwCUOVZ+ySKLsY3-AD5=f3naHuKhYu9Uew@mail.gmail.com>
Subject: Re: svn commit: r255067 - head/sys/kern
From: Davide Italiano <davide@freebsd.org>
To: Hans Petter Selasky <hselasky@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 21:16:40 -0000

> ==============================================================================
> --- head/sys/kern/kern_synch.c  Fri Aug 30 10:10:22 2013        (r255066)
> +++ head/sys/kern/kern_synch.c  Fri Aug 30 10:39:56 2013        (r255067)
> @@ -356,10 +356,7 @@ msleep_spin_sbt(void *ident, struct mtx
>  int
>  pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
>  {
> -       int sbt_sec;
> -
> -       sbt_sec = sbintime_getsec(sbt);
> -       KASSERT(sbt_sec >= 0, ("pause: timo must be >= 0"));
> +       KASSERT(sbt >= 0, ("pause: timeout must be >= 0"));
>

Hi Hans,
sorry for the late answer/review but I completely missed this patch
when you posted on mailing lists.
That said, I think this commit is correct and also makes the code more
readable. As an added bonus, this fixes a "bug" introduced while
hacking on callout rejuvenation. The original assertion was actually
checking for timo  >= 0 but when we switched to 'struct bintime' for
callout that assertion was changed to check for bt.sec >=0. After
that, when we introduced sbintime_t that assertion was never changed
back to his original form, which is more correct. Also, the assertion
message is more explicative, at least IMHO.

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 21:22:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id AA537F1A;
 Tue, 10 Sep 2013 21:22:10 +0000 (UTC)
 (envelope-from davide.italiano@gmail.com)
Received: from mail-vc0-x232.google.com (mail-vc0-x232.google.com
 [IPv6:2607:f8b0:400c:c03::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 32A412D27;
 Tue, 10 Sep 2013 21:22:10 +0000 (UTC)
Received: by mail-vc0-f178.google.com with SMTP id ha12so5391815vcb.37
 for <multiple recipients>; Tue, 10 Sep 2013 14:22:09 -0700 (PDT)
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=xuLVtUVedbH4m5D12nbCx4EQBmvgMtGElpQc2KHmx64=;
 b=T/lbv/pNstklLuouMyamChqcrSKloVdvP3R6DAuZU/ecQnQiCb1neM5qlZfM4oV6eJ
 ijR8ytndcu7fjcTK/s4IXNQCFIl1KPUtE6YPPGq0Am3N5K0DljB5ejvce9iG3NguPYwg
 6SHFAgIHj2Q3ZM2SST58wnRr9pJ0vNq3U2vAel6FcQc4qkDw/alcuX3dHGeQIgr/1g1n
 ++jdEDD6XXCCTsn9tK8Q8/s/WsPswbS48U4hzYWUOGsQhyxMm5t1nipYOs189xePn0A1
 YdGynx+Pa+QkU0qr98+dfq+5X1ZL1P43A7WSvCEG+zCblWYRz8M4HHqiBpE11Q6cPrjj
 6toA==
MIME-Version: 1.0
X-Received: by 10.58.155.68 with SMTP id vu4mr3422359veb.21.1378848129211;
 Tue, 10 Sep 2013 14:22:09 -0700 (PDT)
Sender: davide.italiano@gmail.com
Received: by 10.220.65.132 with HTTP; Tue, 10 Sep 2013 14:22:09 -0700 (PDT)
In-Reply-To: <CACYV=-Gd3ip+ukcNfwCUOVZ+ySKLsY3-AD5=f3naHuKhYu9Uew@mail.gmail.com>
References: <201308301039.r7UAduI1052038@svn.freebsd.org>
 <CACYV=-Gd3ip+ukcNfwCUOVZ+ySKLsY3-AD5=f3naHuKhYu9Uew@mail.gmail.com>
Date: Tue, 10 Sep 2013 23:22:09 +0200
X-Google-Sender-Auth: Z9O8_6Og8XYT8vqLkFWWJlpszY0
Message-ID: <CACYV=-GS3SgiYJkzi-bCsqerZmcfm25k8z6o0HqibZ+8cH7Nrg@mail.gmail.com>
Subject: Re: svn commit: r255067 - head/sys/kern
From: Davide Italiano <davide@freebsd.org>
To: Hans Petter Selasky <hselasky@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 21:22:10 -0000

On Tue, Sep 10, 2013 at 11:16 PM, Davide Italiano <davide@freebsd.org> wrote:
>> ==============================================================================
>> --- head/sys/kern/kern_synch.c  Fri Aug 30 10:10:22 2013        (r255066)
>> +++ head/sys/kern/kern_synch.c  Fri Aug 30 10:39:56 2013        (r255067)
>> @@ -356,10 +356,7 @@ msleep_spin_sbt(void *ident, struct mtx
>>  int
>>  pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
>>  {
>> -       int sbt_sec;
>> -
>> -       sbt_sec = sbintime_getsec(sbt);
>> -       KASSERT(sbt_sec >= 0, ("pause: timo must be >= 0"));
>> +       KASSERT(sbt >= 0, ("pause: timeout must be >= 0"));
>>
>
> Hi Hans,
> sorry for the late answer/review but I completely missed this patch
> when you posted on mailing lists.
> That said, I think this commit is correct and also makes the code more
> readable. As an added bonus, this fixes a "bug" introduced while
> hacking on callout rejuvenation. The original assertion was actually
> checking for timo  >= 0 but when we switched to 'struct bintime' for
> callout that assertion was changed to check for bt.sec >=0. After
> that, when we introduced sbintime_t that assertion was never changed
> back to his original form, which is more correct. Also, the assertion
> message is more explicative, at least IMHO.
>
> Thanks,
>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare

I've just noticed the comment just before pause_sbt() still refers to
pause() function and should be rephrased to reflect the new world
order, if you're interested in seeing this fixed.

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 22:26:14 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 613C3C9;
 Tue, 10 Sep 2013 22:26:14 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 31C202254;
 Tue, 10 Sep 2013 22:26:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AMQElY055766;
 Tue, 10 Sep 2013 22:26:14 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AMQBRr055749;
 Tue, 10 Sep 2013 22:26:11 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309102226.r8AMQBRr055749@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 22:26:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255460 - in head: . secure/lib/libssh
 secure/libexec/sftp-server secure/libexec/ssh-keysign
 secure/libexec/ssh-pkcs11-helper secure/usr.bin/scp secure/usr.bin/sftp
 secure/usr.bin/ssh s...
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 22:26:14 -0000

Author: des
Date: Tue Sep 10 22:26:11 2013
New Revision: 255460
URL: http://svnweb.freebsd.org/changeset/base/255460

Log:
  Clean up the OpenSSH build.  It is now possible to build most components
  as static binaries, if desired.  The one exception is sshd, which runs
  into trouble due to libpam.a's includion of pam_ssh.
  
  Make OpenSSH use LDNS if available.  This allows it to verify signed
  SSHFP records.
  
  Approved by:	re (blanket)

Modified:
  head/Makefile.inc1
  head/secure/lib/libssh/Makefile
  head/secure/libexec/sftp-server/Makefile
  head/secure/libexec/ssh-keysign/Makefile
  head/secure/libexec/ssh-pkcs11-helper/Makefile
  head/secure/usr.bin/scp/Makefile
  head/secure/usr.bin/sftp/Makefile
  head/secure/usr.bin/ssh-add/Makefile
  head/secure/usr.bin/ssh-agent/Makefile
  head/secure/usr.bin/ssh-keygen/Makefile
  head/secure/usr.bin/ssh-keyscan/Makefile
  head/secure/usr.bin/ssh/Makefile
  head/secure/usr.sbin/sshd/Makefile

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/Makefile.inc1	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1470,8 +1470,8 @@ _prebuild_libs=	${_kerberos5_lib_libasn1
 		${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
 		${_cddl_lib_libzfs_core} \
 		lib/libutil ${_lib_libypclnt} lib/libz lib/msun \
-		${_secure_lib_libcrypto} ${_secure_lib_libssh} \
-		${_secure_lib_libssl}
+		${_secure_lib_libcrypto} ${_lib_libldns} \
+		${_secure_lib_libssh} ${_secure_lib_libssl}
 
 .if ${MK_ATF} != "no"
 _lib_atf_libatf_c=	lib/atf/libatf-c
@@ -1507,9 +1507,16 @@ cddl/lib/libzfs_core__L: cddl/lib/libnvp
 _secure_lib_libcrypto= secure/lib/libcrypto
 _secure_lib_libssl= secure/lib/libssl
 lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
+.if ${MK_LDNS} != "no"
+_lib_libldns= lib/libldns
+lib/libldns__L: secure/lib/libcrypto__L
+.endif
 .if ${MK_OPENSSH} != "no"
 _secure_lib_libssh= secure/lib/libssh
 secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
+.if ${MK_LDNS} != "no"
+secure/lib/libssh__L: lib/libldns__L
+.endif
 .if ${MK_KERBEROS_SUPPORT} != "no"
 secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
     kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \

Modified: head/secure/lib/libssh/Makefile
==============================================================================
--- head/secure/lib/libssh/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/lib/libssh/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -21,17 +21,22 @@ SRCS=	authfd.c authfile.c bufaux.c bufbn
 # compiled directly into sshd instead.
 
 # Portability layer
-SRCS+=	bsd-misc.c fmt_scaled.c getrrsetbyname.c glob.c \
+SRCS+=	bsd-misc.c fmt_scaled.c glob.c \
 	openssl-compat.c port-tun.c strtonum.c timingsafe_bcmp.c \
 	vis.c xcrypt.c xmmap.c
 
-.if defined(COMPAT_GETADDRINFO)
-SRCS+=	getaddrinfo.c getnameinfo.c name6.c rcmd.c bindresvport.c
+.if ${MK_LDNS} == "no"
+SRCS+=	getrrsetbyname.c
+.else
+LDNSDIR=	${.CURDIR}/../../../contrib/ldns
+CFLAGS+=	-DHAVE_LDNS=1 -I${LDNSDIR}
+SRCS+=	getrrsetbyname-ldns.c
+DPADD+=	${LIBLDNS}
+LDADD+=	-lldns
+USEPRIVATELIB+= ldns
 .endif
 
 CFLAGS+= -I${SSHDIR} -include ssh_namespace.h
-DPADD=	${LIBZ}
-LDADD=	-lz
 
 .if ${MK_KERBEROS_SUPPORT} != "no"
 CFLAGS+= -DGSSAPI -DHAVE_GSSAPI_GSSAPI_H=1 -DKRB5 -DHEIMDAL
@@ -45,8 +50,8 @@ CFLAGS+= -DNONE_CIPHER_ENABLED
 
 NO_LINT=
 
-DPADD+=	${LIBCRYPTO} ${LIBCRYPT}
-LDADD+=	-lcrypto -lcrypt
+DPADD+=	${LIBCRYPTO} ${LIBCRYPT} ${LIBZ}
+LDADD+=	-lcrypto -lcrypt -lz
 
 .include <bsd.lib.mk>
 

Modified: head/secure/libexec/sftp-server/Makefile
==============================================================================
--- head/secure/libexec/sftp-server/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/libexec/sftp-server/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,17 +1,31 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=   sftp-server
 SRCS=   sftp-server.c sftp-common.c sftp-server-main.c
 MAN=	sftp-server.8
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
-# required when linking with a dynamic libssh 
+.if !defined(NO_SHARED)
+# required when linking with a dynamic libssh
 SRCS+=	roaming_dummy.c
+.endif
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
-LDADD=  -lssh -lcrypt -lcrypto -lz
+DPADD=	${LIBSSH}
+LDADD=  -lssh
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
+DPADD+=	${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+=	-lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/libexec/ssh-keysign/Makefile
==============================================================================
--- head/secure/libexec/ssh-keysign/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/libexec/ssh-keysign/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,15 +1,27 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	ssh-keysign
-SRCS=	ssh-keysign.c readconf.c roaming_dummy.c
+SRCS=	ssh-keysign.c roaming_dummy.c readconf.c
 MAN=	ssh-keysign.8
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 BINMODE=4555
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
-LDADD=	-lssh -lcrypt -lcrypto -lz
+DPADD=	${LIBSSH}
+LDADD=	-lssh
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/libexec/ssh-pkcs11-helper/Makefile
==============================================================================
--- head/secure/libexec/ssh-pkcs11-helper/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/libexec/ssh-pkcs11-helper/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,15 +1,31 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	ssh-pkcs11-helper
 SRCS=	ssh-pkcs11.c ssh-pkcs11-helper.c
-SRCS+=	roaming_dummy.c
 MAN=	ssh-pkcs11-helper.8
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
-LDADD=	-lssh -lcrypt -lcrypto -lz
+.if !defined(NO_SHARED)
+# required when linking with a dynamic libssh
+SRCS+=	roaming_dummy.c
+.endif
+
+DPADD=	${LIBSSH}
+LDADD=	-lssh
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/usr.bin/scp/Makefile
==============================================================================
--- head/secure/usr.bin/scp/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/usr.bin/scp/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,16 +1,30 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	scp
 SRCS=	scp.c
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
+.if !defined(NO_SHARED)
 # required when linking with a dynamic libssh
 SRCS+=	roaming_dummy.c
+.endif
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
-LDADD=	-lssh -lcrypt -lcrypto -lz
+DPADD=	${LIBSSH}
+LDADD=	-lssh
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/usr.bin/sftp/Makefile
==============================================================================
--- head/secure/usr.bin/sftp/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/usr.bin/sftp/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,16 +1,30 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	sftp
 SRCS=   sftp.c sftp-client.c sftp-common.c sftp-glob.c progressmeter.c
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
-# required when linking with a dynamic libssh 
+.if !defined(NO_SHARED)
+# required when linking with a dynamic libssh
 SRCS+=	roaming_dummy.c
+.endif
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} ${LIBEDIT} ${LIBNCURSES}
-LDADD=	-lssh -lcrypt -lcrypto -lz -ledit -lncurses
+DPADD=	${LIBSSH} ${LIBEDIT} ${LIBNCURSES}
+LDADD=	-lssh -ledit -lncurses
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/usr.bin/ssh-add/Makefile
==============================================================================
--- head/secure/usr.bin/ssh-add/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/usr.bin/ssh-add/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,16 +1,30 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	ssh-add
 SRCS+=	ssh-add.c
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
-# required when linking with a dynamic libssh 
+.if !defined(NO_SHARED)
+# required when linking with a dynamic libssh
 SRCS+=	roaming_dummy.c
+.endif
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
-LDADD=	-lssh -lcrypt -lcrypto -lz
+DPADD=	${LIBSSH}
+LDADD=	-lssh
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/usr.bin/ssh-agent/Makefile
==============================================================================
--- head/secure/usr.bin/ssh-agent/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/usr.bin/ssh-agent/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,16 +1,30 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	ssh-agent
 SRCS=	ssh-agent.c
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
-# required when linking with a dynamic libssh 
+.if !defined(NO_SHARED)
+# required when linking with a dynamic libssh
 SRCS+=	roaming_dummy.c
+.endif
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
-LDADD=	-lssh -lcrypt -lcrypto -lz
+DPADD=	${LIBSSH}
+LDADD=	-lssh
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/usr.bin/ssh-keygen/Makefile
==============================================================================
--- head/secure/usr.bin/ssh-keygen/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/usr.bin/ssh-keygen/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,16 +1,30 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	ssh-keygen
 SRCS=	ssh-keygen.c
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
-# required when linking with a dynamic libssh 
-SRCS+=  roaming_dummy.c
+.if !defined(NO_SHARED)
+# required when linking with a dynamic libssh
+SRCS+=	roaming_dummy.c
+.endif
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
-LDADD=	-lssh -lcrypt -lcrypto -lz
+DPADD=	${LIBSSH}
+LDADD=	-lssh
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+DPADD+=	${LIBLDNS}
+LDADD+=	-lldns
+USEPRIVATELIB+= ldns
+.endif
+
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/usr.bin/ssh-keyscan/Makefile
==============================================================================
--- head/secure/usr.bin/ssh-keyscan/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/usr.bin/ssh-keyscan/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,13 +1,25 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	ssh-keyscan
 SRCS=	ssh-keyscan.c roaming_dummy.c
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
-DPADD=	${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
-LDADD=	-lssh -lcrypt -lcrypto -lz
+DPADD=	${LIBSSH}
+LDADD=	-lssh
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}

Modified: head/secure/usr.bin/ssh/Makefile
==============================================================================
--- head/secure/usr.bin/ssh/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/usr.bin/ssh/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,5 +1,4 @@
 # $FreeBSD$
-#
 
 .include <bsd.own.mk>
 
@@ -16,10 +15,17 @@ SRCS=	ssh.c readconf.c clientloop.c ssht
 # gss-genr.c really belongs in libssh; see src/secure/lib/libssh/Makefile
 SRCS+=	gss-genr.c
 
-DPADD=	${LIBSSH} ${LIBUTIL} ${LIBZ}
-LDADD=	-lssh -lutil -lz
+DPADD=	${LIBSSH} ${LIBUTIL}
+LDADD=	-lssh -lutil
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+DPADD+=	${LIBLDNS}
+LDADD+=	-lldns
+USEPRIVATELIB+= ldns
+.endif
+
 .if ${MK_KERBEROS_SUPPORT} != "no"
 CFLAGS+= -DGSSAPI -DHAVE_GSSAPI_GSSAPI_H=1 -DKRB5 -DHEIMDAL
 DPADD+=	 ${LIBGSSAPI}
@@ -30,8 +36,8 @@ LDADD+=	 -lgssapi
 CFLAGS+= -DNONE_CIPHER_ENABLED
 .endif
 
-DPADD+=	${LIBCRYPT} ${LIBCRYPTO}
-LDADD+=	-lcrypt -lcrypto
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
 
 .if defined(LOCALBASE)
 CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"

Modified: head/secure/usr.sbin/sshd/Makefile
==============================================================================
--- head/secure/usr.sbin/sshd/Makefile	Tue Sep 10 21:16:18 2013	(r255459)
+++ head/secure/usr.sbin/sshd/Makefile	Tue Sep 10 22:26:11 2013	(r255460)
@@ -1,5 +1,4 @@
 # $FreeBSD$
-#
 
 .include <bsd.own.mk>
 
@@ -25,10 +24,17 @@ SRCS+=	gss-genr.c
 MAN=	sshd.8 sshd_config.5
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 
-DPADD=	${LIBSSH} ${LIBUTIL} ${LIBZ} ${LIBWRAP} ${LIBPAM}
-LDADD=	-lssh -lutil -lz -lwrap ${MINUSLPAM}
+DPADD=	${LIBSSH} ${LIBUTIL} ${LIBWRAP} ${LIBPAM}
+LDADD=	-lssh -lutil -lwrap ${MINUSLPAM}
 USEPRIVATELIB= ssh
 
+.if ${MK_LDNS} != "no"
+CFLAGS+=	-DHAVE_LDNS=1
+#DPADD+=	${LIBLDNS}
+#LDADD+=	-lldns
+#USEPRIVATELIB+= ldns
+.endif
+
 .if ${MK_AUDIT} != "no"
 CFLAGS+= -DUSE_BSM_AUDIT -DHAVE_GETAUDIT_ADDR
 DPADD+=  ${LIBBSM}
@@ -36,17 +42,20 @@ LDADD+=  -lbsm
 .endif
 
 .if ${MK_KERBEROS_SUPPORT} != "no"
-CFLAGS+= -DGSSAPI -DHAVE_GSSAPI_GSSAPI_H=1 -DHAVE_GSSAPI_GSSAPI_KRB5_H=1 -DKRB5 -DHEIMDAL
-DPADD+=	 ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LIBASN1}
-LDADD+=	 -lgssapi_krb5 -lgssapi -lkrb5 -lasn1
+CFLAGS+= -DGSSAPI -DKRB5 -DHEIMDAL \
+	-DHAVE_GSSAPI_GSSAPI_H=1 -DHAVE_GSSAPI_GSSAPI_KRB5_H=1
+DPADD+=	 ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} \
+	${LIBCOM_ERR} ${LIBROKEN} ${LIBWIND} ${LIBHEIMBASE} ${LIBHEIMIPCC}
+LDADD+=	 -lgssapi_krb5 -lgssapi -lkrb5 -lhx509 -lasn1 \
+	-lcom_err -lroken -lwind -lheimbase -lheimipcc
 .endif
 
 .if ${MK_OPENSSH_NONE_CIPHER} != "no"
 CFLAGS+= -DNONE_CIPHER_ENABLED
 .endif
 
-DPADD+=	${LIBCRYPTO} ${LIBCRYPT}
-LDADD+=	-lcrypto -lcrypt
+DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
+LDADD+= -lcrypt -lcrypto -lz
 
 .if defined(LOCALBASE)
 CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 22:30:24 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 04577310;
 Tue, 10 Sep 2013 22:30:24 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CB14A22E5;
 Tue, 10 Sep 2013 22:30:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AMUNTj059250;
 Tue, 10 Sep 2013 22:30:23 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AMUNAm059244;
 Tue, 10 Sep 2013 22:30:23 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309102230.r8AMUNAm059244@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 22:30:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255461 - head/crypto/openssh
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 22:30:24 -0000

Author: des
Date: Tue Sep 10 22:30:22 2013
New Revision: 255461
URL: http://svnweb.freebsd.org/changeset/base/255461

Log:
  Change the default value of VerifyHostKeyDNS to "yes" if compiled with
  LDNS.  With that setting, OpenSSH will silently accept host keys that
  match verified SSHFP records.  If an SSHFP record exists but could not
  be verified, OpenSSH will print a message and prompt the user as usual.
  
  Approved by:	re (blanket)

Modified:
  head/crypto/openssh/readconf.c
  head/crypto/openssh/ssh_config
  head/crypto/openssh/ssh_config.5

Modified: head/crypto/openssh/readconf.c
==============================================================================
--- head/crypto/openssh/readconf.c	Tue Sep 10 22:26:11 2013	(r255460)
+++ head/crypto/openssh/readconf.c	Tue Sep 10 22:30:22 2013	(r255461)
@@ -1435,8 +1435,14 @@ fill_default_options(Options * options)
 		options->enable_ssh_keysign = 0;
 	if (options->rekey_limit == -1)
 		options->rekey_limit = 0;
+#if HAVE_LDNS
+	if (options->verify_host_key_dns == -1)
+		/* automatically trust a verified SSHFP record */
+		options->verify_host_key_dns = 1;
+#else
 	if (options->verify_host_key_dns == -1)
 		options->verify_host_key_dns = 0;
+#endif
 	if (options->server_alive_interval == -1)
 		options->server_alive_interval = 0;
 	if (options->server_alive_count_max == -1)

Modified: head/crypto/openssh/ssh_config
==============================================================================
--- head/crypto/openssh/ssh_config	Tue Sep 10 22:26:11 2013	(r255460)
+++ head/crypto/openssh/ssh_config	Tue Sep 10 22:30:22 2013	(r255461)
@@ -46,4 +46,5 @@
 #   PermitLocalCommand no
 #   VisualHostKey no
 #   ProxyCommand ssh -q -W %h:%p gateway.example.com
+#   VerifyHostKeyDNS yes
 #   VersionAddendum FreeBSD-20130515

Modified: head/crypto/openssh/ssh_config.5
==============================================================================
--- head/crypto/openssh/ssh_config.5	Tue Sep 10 22:26:11 2013	(r255460)
+++ head/crypto/openssh/ssh_config.5	Tue Sep 10 22:30:22 2013	(r255461)
@@ -1219,7 +1219,10 @@ The argument must be
 or
 .Dq ask .
 The default is
-.Dq no .
+.Dq yes
+if compiled with LDNS and
+.Dq no
+otherwise.
 Note that this option applies to protocol version 2 only.
 .Pp
 See also

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 22:40:39 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1FE2D69F;
 Tue, 10 Sep 2013 22:40:39 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0C36923A9;
 Tue, 10 Sep 2013 22:40:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AMecd0063996;
 Tue, 10 Sep 2013 22:40:38 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AMecW7063993;
 Tue, 10 Sep 2013 22:40:38 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309102240.r8AMecW7063993@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Tue, 10 Sep 2013 22:40:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255462 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 22:40:39 -0000

Author: des
Date: Tue Sep 10 22:40:38 2013
New Revision: 255462
URL: http://svnweb.freebsd.org/changeset/base/255462

Log:
  Missed in r255386: libssh is more than just the .so file itself.
  
  Approved by:	re (blanket)

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Tue Sep 10 22:30:22 2013	(r255461)
+++ head/ObsoleteFiles.inc	Tue Sep 10 22:40:38 2013	(r255462)
@@ -39,8 +39,14 @@
 # done
 
 # 20130908: libssh becomes private
+OLD_FILES+=usr/lib/libssh.a
+OLD_FILES+=usr/lib/libssh.so
 OLD_LIBS+=usr/lib/libssh.so.5
+OLD_FILES+=usr/lib/libssh_p.a
+OLD_FILES+=usr/lib32/libssh.a
+OLD_FILES+=usr/lib32/libssh.so
 OLD_LIBS+=usr/lib32/libssh.so.5
+OLD_FILES+=usr/lib32/libssh_p.a
 # 20130903: gnupatch is no more
 OLD_FILES+=usr/bin/gnupatch
 OLD_FILES+=usr/share/man/man1/gnupatch.1.gz

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 10 23:31:39 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 64EFD4BB;
 Tue, 10 Sep 2013 23:31:39 +0000 (UTC) (envelope-from sjg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 53902269B;
 Tue, 10 Sep 2013 23:31:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8ANVdAR099068;
 Tue, 10 Sep 2013 23:31:39 GMT (envelope-from sjg@svn.freebsd.org)
Received: (from sjg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8ANVdJ9099067;
 Tue, 10 Sep 2013 23:31:39 GMT (envelope-from sjg@svn.freebsd.org)
Message-Id: <201309102331.r8ANVdJ9099067@svn.freebsd.org>
From: "Simon J. Gerraty" <sjg@FreeBSD.org>
Date: Tue, 10 Sep 2013 23:31:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255463 - head/usr.bin/bmake
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Sep 2013 23:31:39 -0000

Author: sjg
Date: Tue Sep 10 23:31:38 2013
New Revision: 255463
URL: http://svnweb.freebsd.org/changeset/base/255463

Log:
  Stick to traditional DEFAULT_SYS_PATH (/usr/share/mk)
  
  Reviewed by:	obrien
  Approved by:	re

Modified:
  head/usr.bin/bmake/Makefile

Modified: head/usr.bin/bmake/Makefile
==============================================================================
--- head/usr.bin/bmake/Makefile	Tue Sep 10 22:40:38 2013	(r255462)
+++ head/usr.bin/bmake/Makefile	Tue Sep 10 23:31:38 2013	(r255463)
@@ -167,6 +167,7 @@ accept test:
 # override some simple things
 BINDIR= /usr/bin
 MANDIR= /usr/share/man/man
+DEFAULT_SYS_PATH= /usr/share/mk
 
 # make sure we get this
 CFLAGS+= ${COPTS.${.IMPSRC:T}}

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 00:42:51 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 829A71D1;
 Wed, 11 Sep 2013 00:42:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6FAA429CD;
 Wed, 11 Sep 2013 00:42:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8B0gpw4042643;
 Wed, 11 Sep 2013 00:42:51 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8B0gpfs042640;
 Wed, 11 Sep 2013 00:42:51 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201309110042.r8B0gpfs042640@svn.freebsd.org>
From: Glen Barber <gjb@FreeBSD.org>
Date: Wed, 11 Sep 2013 00:42:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-releng@freebsd.org
Subject: svn commit: r255465 - in releng/9.2: release 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 00:42:51 -0000

Author: gjb
Date: Wed Sep 11 00:42:50 2013
New Revision: 255465
URL: http://svnweb.freebsd.org/changeset/base/255465

Log:
  Update releng/9.2 to -RC4.
  
  Approved by:	re (implicit)

Modified:
  releng/9.2/release/Makefile.sysinstall
  releng/9.2/sys/conf/newvers.sh

Modified: releng/9.2/release/Makefile.sysinstall
==============================================================================
--- releng/9.2/release/Makefile.sysinstall	Wed Sep 11 00:19:16 2013	(r255464)
+++ releng/9.2/release/Makefile.sysinstall	Wed Sep 11 00:42:50 2013	(r255465)
@@ -24,7 +24,7 @@
 # Set these, release builder!
 #
 # Fixed version:
-#BUILDNAME=9.2-RC3
+#BUILDNAME=9.2-RC4
 #
 # Automatic SNAP versioning:
 DATE != date +%Y%m%d

Modified: releng/9.2/sys/conf/newvers.sh
==============================================================================
--- releng/9.2/sys/conf/newvers.sh	Wed Sep 11 00:19:16 2013	(r255464)
+++ releng/9.2/sys/conf/newvers.sh	Wed Sep 11 00:42:50 2013	(r255465)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="9.2"
-BRANCH="RC3-p1"
+BRANCH="RC4"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 03:29:48 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 5272C84D;
 Wed, 11 Sep 2013 03:29:48 +0000 (UTC)
 (envelope-from nwhitehorn@freebsd.org)
Received: from smtpauth4.wiscmail.wisc.edu (wmauth4.doit.wisc.edu
 [144.92.197.145]) (using TLSv1 with cipher RC4-MD5 (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C917E21AC;
 Wed, 11 Sep 2013 03:29:47 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from avs-daemon.smtpauth4.wiscmail.wisc.edu by
 smtpauth4.wiscmail.wisc.edu
 (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug
 30 2012)) id <0MSX00500YXQPH00@smtpauth4.wiscmail.wisc.edu>; Tue,
 10 Sep 2013 22:29:41 -0500 (CDT)
X-Spam-PmxInfo: Server=avs-4, Version=6.0.3.2322014,
 Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.9.11.32414,
 SenderIP=0.0.0.0
X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0
Received: from comporellon.tachypleus.net (unknown [76.210.62.152])
 by smtpauth4.wiscmail.wisc.edu
 (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug
 30 2012)) with ESMTPSA id <0MSX00JMVZ1EIE40@smtpauth4.wiscmail.wisc.edu>; Tue,
 10 Sep 2013 22:29:40 -0500 (CDT)
Message-id: <522FE3A2.2090405@freebsd.org>
Date: Tue, 10 Sep 2013 22:29:38 -0500
From: Nathan Whitehorn <nwhitehorn@freebsd.org>
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130907
 Thunderbird/17.0.8
To: Baptiste Daroussin <bapt@FreeBSD.org>
Subject: Re: svn commit: r255457 - head/usr.sbin/pkg
References: <201309102056.r8AKu1rQ000442@svn.freebsd.org>
In-reply-to: <201309102056.r8AKu1rQ000442@svn.freebsd.org>
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 03:29:48 -0000

On 09/10/13 15:56, Baptiste Daroussin wrote:
> Author: bapt
> Date: Tue Sep 10 20:56:01 2013
> New Revision: 255457
> URL: http://svnweb.freebsd.org/changeset/base/255457
>
> Log:
>    Add support to detect arm vs armv6
>    
>    There are two different versions of the ARM ABI depending on the
>    TARGET_ARCH. As these are sligntly different a package built for
>    one may not work on another. We need to detect which one we are on
>    by parsing the .ARM.attributes section.
>    
>    This will only work on the ARM EABI as this section is part of the
>    ABI definition. As armv6 only supports the ARM EABI this is not a
>    problem for the oabi.
>    
>    Older versions of libelf in FreeBSD fail to read the
>    .ARM.attributes section needed. As armv6 is unsupported on these
>    versions we can assume we are running on arm.
>    

Picking a random commit: I don't suppose we can just use MACHINE_ARCH 
for these identifiers? It encapsulates everything needed for compatibility.
-Nathan

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 05:49:13 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7EBB6CF5;
 Wed, 11 Sep 2013 05:49:13 +0000 (UTC)
 (envelope-from baptiste.daroussin@gmail.com)
Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com
 [IPv6:2a00:1450:400c:c00::229])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A180626A3;
 Wed, 11 Sep 2013 05:49:12 +0000 (UTC)
Received: by mail-wg0-f41.google.com with SMTP id a12so1430949wgh.4
 for <multiple recipients>; Tue, 10 Sep 2013 22:49:10 -0700 (PDT)
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=FXOM3MPZbR9H7gu/uD8IHMyN5WV0mMhzOdXAbMF6kns=;
 b=Qe6XktBh9k9QGBnF1eM8xqN7lxq4Nv3h8FZ2tRYkjcPqG3wyEPJH87YOtla3GkgV+7
 jD680wenDK7lFleP4+Tth7Xv0GToBBUQYRBVAeOr/xJXrWxU88c7wPo0iIF8lmbanCM9
 LsV8apB0KvytvYg4Becz8u0mgLCPI1GSwGY2y4JLhVu5IspVqB0oeMic+ApuwjpCNvvC
 SCMk4HZh1L/6AUoligEZdE2WA072pPfAwFea391cSrlckgc3FZoc/sWD8px2hi9WNuU6
 ojOfYdm9zG/OAAwZBh7Iry4AnIAKgyGrynvFISrjx5ccEQVBD+F41EKNW6NK9aKQ1Rn1
 pC5Q==
X-Received: by 10.180.13.83 with SMTP id f19mr15944117wic.54.1378878550914;
 Tue, 10 Sep 2013 22:49:10 -0700 (PDT)
Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188])
 by mx.google.com with ESMTPSA id jf2sm7960898wic.2.1969.12.31.16.00.00
 (version=TLSv1 cipher=RC4-SHA bits=128/128);
 Tue, 10 Sep 2013 22:49:10 -0700 (PDT)
Sender: Baptiste Daroussin <baptiste.daroussin@gmail.com>
Date: Wed, 11 Sep 2013 07:49:07 +0200
From: Baptiste Daroussin <bapt@FreeBSD.org>
To: Nathan Whitehorn <nwhitehorn@freebsd.org>
Subject: Re: svn commit: r255457 - head/usr.sbin/pkg
Message-ID: <20130911054907.GK40186@ithaqua.etoilebsd.net>
References: <201309102056.r8AKu1rQ000442@svn.freebsd.org>
 <522FE3A2.2090405@freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="bPg9NdpM9EETxvqt"
Content-Disposition: inline
In-Reply-To: <522FE3A2.2090405@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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 05:49:13 -0000


--bPg9NdpM9EETxvqt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Sep 10, 2013 at 10:29:38PM -0500, Nathan Whitehorn wrote:
> On 09/10/13 15:56, Baptiste Daroussin wrote:
> > Author: bapt
> > Date: Tue Sep 10 20:56:01 2013
> > New Revision: 255457
> > URL: http://svnweb.freebsd.org/changeset/base/255457
> >
> > Log:
> >    Add support to detect arm vs armv6
> >   =20
> >    There are two different versions of the ARM ABI depending on the
> >    TARGET_ARCH. As these are sligntly different a package built for
> >    one may not work on another. We need to detect which one we are on
> >    by parsing the .ARM.attributes section.
> >   =20
> >    This will only work on the ARM EABI as this section is part of the
> >    ABI definition. As armv6 only supports the ARM EABI this is not a
> >    problem for the oabi.
> >   =20
> >    Older versions of libelf in FreeBSD fail to read the
> >    .ARM.attributes section needed. As armv6 is unsupported on these
> >    versions we can assume we are running on arm.
> >   =20
>=20
> Picking a random commit: I don't suppose we can just use MACHINE_ARCH=20
> for these identifiers? It encapsulates everything needed for compatibilit=
y.
> -Nathan

Yes we probably can, it encapsulates everything since recently! It wasn't t=
he
case when ABI string was defined, and it lacks an important part of why the=
 ABI
string has been designed on pkgng: making a package match multiple arch via
simple glob on the ABI line.

So as I already said to Warner, Yes now that it properly works on all arche=
s we
could use it but that is not that easy.

People wanting to go that way should:
1. provide a way for pkgng to extract MARCHE_ARCH out of a binary (/bin/ls)
(dynamic cross installation ABI detection)
2. provide a way to create multiarch ABI out of MACHINE_ARCH
3. provide an upgrade path with compatibility for the current string (pkgng=
 is
already largely deployed)
4. have time to do it

There is so much work pending on pkgng, in particular for 10.0 that I just =
have
no time to work on it.

regards,
Bapt

--bPg9NdpM9EETxvqt
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlIwBFMACgkQ8kTtMUmk6EyDAACeNr0ekbof6H/uHYuzismf/iKr
W1kAniJ5z0SWLnLmRlZcniQ9lUwpY/dw
=CRDN
-----END PGP SIGNATURE-----

--bPg9NdpM9EETxvqt--

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 06:41:16 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C38F5A38;
 Wed, 11 Sep 2013 06:41:16 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A21CD2839;
 Wed, 11 Sep 2013 06:41:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8B6fGcm018861;
 Wed, 11 Sep 2013 06:41:16 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8B6fGQU018859;
 Wed, 11 Sep 2013 06:41:16 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309110641.r8B6fGQU018859@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Wed, 11 Sep 2013 06:41:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255467 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 06:41:16 -0000

Author: kib
Date: Wed Sep 11 06:41:15 2013
New Revision: 255467
URL: http://svnweb.freebsd.org/changeset/base/255467

Log:
  Implement sendfile(2) for the posix shared memory segment file descriptor,
  in addition to the regular files.
  
  Requested by:	alc
  Discussed with:	emaste
  Tested by:	pho (previous version)
  Sponsored by:	The FreeBSD Foundation
  Approved by:	re (hrs)

Modified:
  head/sys/kern/uipc_shm.c
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c	Wed Sep 11 06:16:12 2013	(r255466)
+++ head/sys/kern/uipc_shm.c	Wed Sep 11 06:41:15 2013	(r255467)
@@ -134,7 +134,7 @@ static struct fileops shm_ops = {
 	.fo_close = shm_close,
 	.fo_chmod = shm_chmod,
 	.fo_chown = shm_chown,
-	.fo_sendfile = invfo_sendfile,
+	.fo_sendfile = vn_sendfile,
 	.fo_seek = shm_seek,
 	.fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE
 };

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Wed Sep 11 06:16:12 2013	(r255466)
+++ head/sys/kern/uipc_syscalls.c	Wed Sep 11 06:41:15 2013	(r255467)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/capability.h>
+#include <sys/condvar.h>
 #include <sys/kernel.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
@@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/file.h>
 #include <sys/filio.h>
 #include <sys/jail.h>
+#include <sys/mman.h>
 #include <sys/mount.h>
 #include <sys/mbuf.h>
 #include <sys/protosw.h>
@@ -86,7 +88,7 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_param.h>
 #include <vm/vm_object.h>
 #include <vm/vm_page.h>
-#include <vm/vm_pageout.h>
+#include <vm/vm_pager.h>
 #include <vm/vm_kern.h>
 #include <vm/vm_extern.h>
 
@@ -1850,8 +1852,6 @@ getsockaddr(namp, uaddr, len)
 	return (error);
 }
 
-#include <sys/condvar.h>
-
 struct sendfile_sync {
 	struct mtx	mtx;
 	struct cv	cv;
@@ -1917,6 +1917,10 @@ do_sendfile(struct thread *td, struct se
 	cap_rights_t rights;
 	int error;
 
+	/*
+	 * File offset must be positive.  If it goes beyond EOF
+	 * we send only the header/trailer and no payload data.
+	 */
 	if (uap->offset < 0)
 		return (EINVAL);
 
@@ -1978,79 +1982,240 @@ freebsd4_sendfile(struct thread *td, str
 }
 #endif /* COMPAT_FREEBSD4 */
 
-int
-vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio,
-    struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags,
-    int kflags, struct thread *td)
+static int
+sendfile_readpage(vm_object_t obj, struct vnode *vp, int nd,
+    off_t off, int xfsize, int bsize, struct thread *td, vm_page_t *res)
 {
-	struct vnode *vp = fp->f_vnode;
-	struct file *sock_fp;
-	struct vm_object *obj = NULL;
-	struct socket *so = NULL;
-	struct mbuf *m = NULL;
-	struct sf_buf *sf;
-	struct vm_page *pg;
-	struct vattr va;
-	struct sendfile_sync *sfs = NULL;
-	cap_rights_t rights;
-	off_t off, xfsize, fsbytes = 0, sbytes = 0, rem = 0;
-	int bsize, error, hdrlen = 0, mnw = 0;
+	vm_page_t m;
+	vm_pindex_t pindex;
+	ssize_t resid;
+	int error, readahead, rv;
+
+	pindex = OFF_TO_IDX(off);
+	VM_OBJECT_WLOCK(obj);
+	m = vm_page_grab(obj, pindex, (vp != NULL ? VM_ALLOC_NOBUSY |
+	    VM_ALLOC_IGN_SBUSY : 0) | VM_ALLOC_WIRED | VM_ALLOC_NORMAL);
 
-	vn_lock(vp, LK_SHARED | LK_RETRY);
-	if (vp->v_type == VREG) {
-		bsize = vp->v_mount->mnt_stat.f_iosize;
-		if (nbytes == 0) {
-			error = VOP_GETATTR(vp, &va, td->td_ucred);
-			if (error != 0) {
-				VOP_UNLOCK(vp, 0);
-				obj = NULL;
-				goto out;
+	/*
+	 * Check if page is valid for what we need, otherwise initiate I/O.
+	 *
+	 * The non-zero nd argument prevents disk I/O, instead we
+	 * return the caller what he specified in nd.  In particular,
+	 * if we already turned some pages into mbufs, nd == EAGAIN
+	 * and the main function send them the pages before we come
+	 * here again and block.
+	 */
+	if (m->valid != 0 && vm_page_is_valid(m, off & PAGE_MASK, xfsize)) {
+		if (vp == NULL)
+			vm_page_xunbusy(m);
+		VM_OBJECT_WUNLOCK(obj);
+		*res = m;
+		return (0);
+	} else if (nd != 0) {
+		if (vp == NULL)
+			vm_page_xunbusy(m);
+		error = nd;
+		goto free_page;
+	}
+
+	/*
+	 * Get the page from backing store.
+	 */
+	error = 0;
+	if (vp != NULL) {
+		VM_OBJECT_WUNLOCK(obj);
+		readahead = sfreadahead * MAXBSIZE;
+
+		/*
+		 * Use vn_rdwr() instead of the pager interface for
+		 * the vnode, to allow the read-ahead.
+		 *
+		 * XXXMAC: Because we don't have fp->f_cred here, we
+		 * pass in NOCRED.  This is probably wrong, but is
+		 * consistent with our original implementation.
+		 */
+		error = vn_rdwr(UIO_READ, vp, NULL, readahead, trunc_page(off),
+		    UIO_NOCOPY, IO_NODELOCKED | IO_VMIO | ((readahead /
+		    bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td);
+		SFSTAT_INC(sf_iocnt);
+		VM_OBJECT_WLOCK(obj);
+	} else {
+		if (vm_pager_has_page(obj, pindex, NULL, NULL)) {
+			rv = vm_pager_get_pages(obj, &m, 1, 0);
+			SFSTAT_INC(sf_iocnt);
+			m = vm_page_lookup(obj, pindex);
+			if (m == NULL)
+				error = EIO;
+			else if (rv != VM_PAGER_OK) {
+				vm_page_lock(m);
+				vm_page_free(m);
+				vm_page_unlock(m);
+				m = NULL;
+				error = EIO;
 			}
-			rem = va.va_size;
-		} else
-			rem = nbytes;
+		} else {
+			pmap_zero_page(m);
+			m->valid = VM_PAGE_BITS_ALL;
+			m->dirty = 0;
+		}
+		if (m != NULL)
+			vm_page_xunbusy(m);
+	}
+	if (error == 0) {
+		*res = m;
+	} else if (m != NULL) {
+free_page:
+		vm_page_lock(m);
+		vm_page_unwire(m, 0);
+
+		/*
+		 * See if anyone else might know about this page.  If
+		 * not and it is not valid, then free it.
+		 */
+		if (m->wire_count == 0 && m->valid == 0 && !vm_page_busied(m))
+			vm_page_free(m);
+		vm_page_unlock(m);
+	}
+	VM_OBJECT_WUNLOCK(obj);
+	KASSERT(error != 0 || (m->wire_count > 0 && m->valid ==
+	    VM_PAGE_BITS_ALL),
+	    ("wrong page state m %p", m));
+	return (error);
+}
+
+static int
+sendfile_getobj(struct thread *td, struct file *fp, vm_object_t *obj_res,
+    struct vnode **vp_res, struct shmfd **shmfd_res, off_t *obj_size,
+    int *bsize)
+{
+	struct vattr va;
+	vm_object_t obj;
+	struct vnode *vp;
+	struct shmfd *shmfd;
+	int error;
+
+	vp = *vp_res = NULL;
+	obj = NULL;
+	shmfd = *shmfd_res = NULL;
+	*bsize = 0;
+
+	/*
+	 * The file descriptor must be a regular file and have a
+	 * backing VM object.
+	 */
+	if (fp->f_type == DTYPE_VNODE) {
+		vp = fp->f_vnode;
+		vn_lock(vp, LK_SHARED | LK_RETRY);
+		if (vp->v_type != VREG) {
+			error = EINVAL;
+			goto out;
+		}
+		*bsize = vp->v_mount->mnt_stat.f_iosize;
+		error = VOP_GETATTR(vp, &va, td->td_ucred);
+		if (error != 0)
+			goto out;
+		*obj_size = va.va_size;
 		obj = vp->v_object;
-		if (obj != NULL) {
-			/*
-			 * Temporarily increase the backing VM
-			 * object's reference count so that a forced
-			 * reclamation of its vnode does not
-			 * immediately destroy it.
-			 */
-			VM_OBJECT_WLOCK(obj);
-			if ((obj->flags & OBJ_DEAD) == 0) {
-				vm_object_reference_locked(obj);
-				VM_OBJECT_WUNLOCK(obj);
-			} else {
-				VM_OBJECT_WUNLOCK(obj);
-				obj = NULL;
-			}
+		if (obj == NULL) {
+			error = EINVAL;
+			goto out;
 		}
-	} else
-		bsize = 0;	/* silence gcc */
-	VOP_UNLOCK(vp, 0);
-	if (obj == NULL) {
+	} else if (fp->f_type == DTYPE_SHM) {
+		shmfd = fp->f_data;
+		obj = shmfd->shm_object;
+		*obj_size = shmfd->shm_size;
+	} else {
 		error = EINVAL;
 		goto out;
 	}
 
+	VM_OBJECT_WLOCK(obj);
+	if ((obj->flags & OBJ_DEAD) != 0) {
+		VM_OBJECT_WUNLOCK(obj);
+		error = EBADF;
+		goto out;
+	}
+
+	/*
+	 * Temporarily increase the backing VM object's reference
+	 * count so that a forced reclamation of its vnode does not
+	 * immediately destroy it.
+	 */
+	vm_object_reference_locked(obj);
+	VM_OBJECT_WUNLOCK(obj);
+	*obj_res = obj;
+	*vp_res = vp;
+	*shmfd_res = shmfd;
+
+out:
+	if (vp != NULL)
+		VOP_UNLOCK(vp, 0);
+	return (error);
+}
+
+static int
+kern_sendfile_getsock(struct thread *td, int s, struct file **sock_fp,
+    struct socket **so)
+{
+	cap_rights_t rights;
+	int error;
+
+	*sock_fp = NULL;
+	*so = NULL;
+
 	/*
 	 * The socket must be a stream socket and connected.
-	 * Remember if it a blocking or non-blocking socket.
 	 */
-	error = getsock_cap(td->td_proc->p_fd, sockfd,
-	    cap_rights_init(&rights, CAP_SEND), &sock_fp, NULL);
+	error = getsock_cap(td->td_proc->p_fd, s, cap_rights_init(&rights,
+	    CAP_SEND), sock_fp, NULL);
+	if (error != 0)
+		return (error);
+	*so = (*sock_fp)->f_data;
+	if ((*so)->so_type != SOCK_STREAM)
+		return (EINVAL);
+	if (((*so)->so_state & SS_ISCONNECTED) == 0)
+		return (ENOTCONN);
+	return (0);
+}
+
+int
+vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio,
+    struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags,
+    int kflags, struct thread *td)
+{
+	struct file *sock_fp;
+	struct vnode *vp;
+	struct vm_object *obj;
+	struct socket *so;
+	struct mbuf *m;
+	struct sf_buf *sf;
+	struct vm_page *pg;
+	struct shmfd *shmfd;
+	struct sendfile_sync *sfs;
+	struct vattr va;
+	off_t off, xfsize, fsbytes, sbytes, rem, obj_size;
+	int error, bsize, nd, hdrlen, mnw;
+	bool inflight_called;
+
+	obj = NULL;
+	so = NULL;
+	m = NULL;
+	sfs = NULL;
+	fsbytes = sbytes = 0;
+	hdrlen = mnw = 0;
+	rem = nbytes;
+	inflight_called = false;
+
+	error = sendfile_getobj(td, fp, &obj, &vp, &shmfd, &obj_size, &bsize);
+	if (error != 0)
+		return (error);
+	if (rem == 0)
+		rem = obj_size;
+
+	error = kern_sendfile_getsock(td, sockfd, &sock_fp, &so);
 	if (error != 0)
 		goto out;
-	so = sock_fp->f_data;
-	if (so->so_type != SOCK_STREAM) {
-		error = EINVAL;
-		goto out;
-	}
-	if ((so->so_state & SS_ISCONNECTED) == 0) {
-		error = ENOTCONN;
-		goto out;
-	}
+
 	/*
 	 * Do not wait on memory allocations but return ENOMEM for
 	 * caller to retry later.
@@ -2123,7 +2288,7 @@ vn_sendfile(struct file *fp, int sockfd,
 		int done;
 
 		if ((nbytes != 0 && nbytes == fsbytes) ||
-		    (nbytes == 0 && va.va_size == fsbytes))
+		    (nbytes == 0 && obj_size == fsbytes))
 			break;
 
 		mtail = NULL;
@@ -2197,13 +2362,16 @@ retry_space:
 		 */
 		space -= hdrlen;
 
-		error = vn_lock(vp, LK_SHARED);
-		if (error != 0)
-			goto done;
-		error = VOP_GETATTR(vp, &va, td->td_ucred);
-		if (error != 0 || off >= va.va_size) {
-			VOP_UNLOCK(vp, 0);
-			goto done;
+		if (vp != NULL) {
+			error = vn_lock(vp, LK_SHARED);
+			if (error != 0)
+				goto done;
+			error = VOP_GETATTR(vp, &va, td->td_ucred);
+			if (error != 0 || off >= va.va_size) {
+				VOP_UNLOCK(vp, 0);
+				goto done;
+			}
+			obj_size = va.va_size;
 		}
 
 		/*
@@ -2211,7 +2379,6 @@ retry_space:
 		 * dumped into socket buffer.
 		 */
 		while (space > loopbytes) {
-			vm_pindex_t pindex;
 			vm_offset_t pgoff;
 			struct mbuf *m0;
 
@@ -2221,7 +2388,7 @@ retry_space:
 			 * or the passed in nbytes.
 			 */
 			pgoff = (vm_offset_t)(off & PAGE_MASK);
-			rem = va.va_size - offset;
+			rem = obj_size - offset;
 			if (nbytes != 0)
 				rem = omin(rem, nbytes);
 			rem -= fsbytes + loopbytes;
@@ -2236,59 +2403,15 @@ retry_space:
 			 * Attempt to look up the page.  Allocate
 			 * if not found or wait and loop if busy.
 			 */
-			pindex = OFF_TO_IDX(off);
-			VM_OBJECT_WLOCK(obj);
-			pg = vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY |
-			    VM_ALLOC_IGN_SBUSY | VM_ALLOC_NORMAL |
-			    VM_ALLOC_WIRED);
-
-			/*
-			 * Check if page is valid for what we need,
-			 * otherwise initiate I/O.
-			 * If we already turned some pages into mbufs,
-			 * send them off before we come here again and
-			 * block.
-			 */
-			if (pg->valid && vm_page_is_valid(pg, pgoff, xfsize))
-				VM_OBJECT_WUNLOCK(obj);
-			else if (m != NULL)
-				error = EAGAIN;	/* send what we already got */
-			else if (flags & SF_NODISKIO)
-				error = EBUSY;
-			else {
-				ssize_t resid;
-				int readahead = sfreadahead * MAXBSIZE;
-
-				VM_OBJECT_WUNLOCK(obj);
-
-				/*
-				 * Get the page from backing store.
-				 * XXXMAC: Because we don't have fp->f_cred
-				 * here, we pass in NOCRED.  This is probably
-				 * wrong, but is consistent with our original
-				 * implementation.
-				 */
-				error = vn_rdwr(UIO_READ, vp, NULL, readahead,
-				    trunc_page(off), UIO_NOCOPY, IO_NODELOCKED |
-				    IO_VMIO | ((readahead / bsize) << IO_SEQSHIFT),
-				    td->td_ucred, NOCRED, &resid, td);
-				SFSTAT_INC(sf_iocnt);
-				if (error != 0)
-					VM_OBJECT_WLOCK(obj);
-			}
+			if (m != NULL)
+				nd = EAGAIN; /* send what we already got */
+			else if ((flags & SF_NODISKIO) != 0)
+				nd = EBUSY;
+			else
+				nd = 0;
+			error = sendfile_readpage(obj, vp, nd, off,
+			    xfsize, bsize, td, &pg);
 			if (error != 0) {
-				vm_page_lock(pg);
-				vm_page_unwire(pg, 0);
-				/*
-				 * See if anyone else might know about
-				 * this page.  If not and it is not valid,
-				 * then free it.
-				 */
-				if (pg->wire_count == 0 && pg->valid == 0 &&
-				    !vm_page_busied(pg))
-					vm_page_free(pg);
-				vm_page_unlock(pg);
-				VM_OBJECT_WUNLOCK(obj);
 				if (error == EAGAIN)
 					error = 0;	/* not a real error */
 				break;
@@ -2358,7 +2481,8 @@ retry_space:
 			}
 		}
 
-		VOP_UNLOCK(vp, 0);
+		if (vp != NULL)
+			VOP_UNLOCK(vp, 0);
 
 		/* Add the buffer chain to the socket buffer. */
 		if (m != NULL) {

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 06:42:56 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 37246BCB;
 Wed, 11 Sep 2013 06:42:56 +0000 (UTC)
 (envelope-from bapt@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 251812847;
 Wed, 11 Sep 2013 06:42:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8B6guBR019538;
 Wed, 11 Sep 2013 06:42:56 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8B6gtTq019537;
 Wed, 11 Sep 2013 06:42:55 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201309110642.r8B6gtTq019537@svn.freebsd.org>
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Wed, 11 Sep 2013 06:42:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255468 - head/usr.sbin/pkg
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 06:42:56 -0000

Author: bapt
Date: Wed Sep 11 06:42:55 2013
New Revision: 255468
URL: http://svnweb.freebsd.org/changeset/base/255468

Log:
  Cleanup elf macros
  
  Only define EF_MIPS_ABI when not already supplied
  Remove old now unused ARM macros
  
  Reported by:	imp
  Approved by:	re (kib)

Modified:
  head/usr.sbin/pkg/elf_tables.h

Modified: head/usr.sbin/pkg/elf_tables.h
==============================================================================
--- head/usr.sbin/pkg/elf_tables.h	Wed Sep 11 06:41:15 2013	(r255467)
+++ head/usr.sbin/pkg/elf_tables.h	Wed Sep 11 06:42:55 2013	(r255468)
@@ -58,16 +58,12 @@ static struct _elf_corres endian_corres[
 	{ -1, NULL}
 };
 
-#define EF_MIPS_ABI	0x0000F000
+#ifndef EF_MIPS_ABI
+#define EF_MIPS_ABI	0x0000f000
+#endif
 #define E_MIPS_ABI_O32	0x00001000
 #define E_MIPS_ABI_N32	0x00000020
 
-#define EF_ARM_NEW_ABI	0x80
-#define EF_ARM_OLD_ABI	0x100
-
-#define EF_ARM_SOFT_FLOAT	0x200
-#define EF_ARM_VFP_FLOAT	0x400
-
 #define NT_VERSION	1
 #define NT_ARCH	2
 

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 07:11:15 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CC81E72E;
 Wed, 11 Sep 2013 07:11:15 +0000 (UTC)
 (envelope-from neel@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A0DC2298B;
 Wed, 11 Sep 2013 07:11:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8B7BFQD031340;
 Wed, 11 Sep 2013 07:11:15 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8B7BFfZ031334;
 Wed, 11 Sep 2013 07:11:15 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201309110711.r8B7BFfZ031334@svn.freebsd.org>
From: Neel Natu <neel@FreeBSD.org>
Date: Wed, 11 Sep 2013 07:11:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255469 - in 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 07:11:15 -0000

Author: neel
Date: Wed Sep 11 07:11:14 2013
New Revision: 255469
URL: http://svnweb.freebsd.org/changeset/base/255469

Log:
  Fix a limitation in bhyve that would limit the number of virtual machines to
  the maximum number of VT-d domains (256 on a Sandybridge). We now allocate a
  VT-d domain for a guest only if the administrator has explicitly configured
  one or more PCI passthru device(s).
  
  If there are no PCI passthru devices configured (the common case) then the
  number of virtual machines is no longer limited by the maximum number of
  VT-d domains.
  
  Reviewed by: grehan@
  Approved by: re@

Modified:
  head/sys/amd64/vmm/io/ppt.c
  head/sys/amd64/vmm/io/ppt.h
  head/sys/amd64/vmm/vmm.c

Modified: head/sys/amd64/vmm/io/ppt.c
==============================================================================
--- head/sys/amd64/vmm/io/ppt.c	Wed Sep 11 06:42:55 2013	(r255468)
+++ head/sys/amd64/vmm/io/ppt.c	Wed Sep 11 07:11:14 2013	(r255469)
@@ -592,3 +592,9 @@ ppt_setup_msix(struct vm *vm, int vcpu, 
 	return (0);
 }
 
+int
+ppt_num_devices(void)
+{
+
+	return (num_pptdevs);
+}

Modified: head/sys/amd64/vmm/io/ppt.h
==============================================================================
--- head/sys/amd64/vmm/io/ppt.h	Wed Sep 11 06:42:55 2013	(r255468)
+++ head/sys/amd64/vmm/io/ppt.h	Wed Sep 11 07:11:14 2013	(r255469)
@@ -38,4 +38,5 @@ int	ppt_setup_msi(struct vm *vm, int vcp
 		      int destcpu, int vector, int numvec);
 int	ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func,
 		       int idx, uint32_t msg, uint32_t vector_control, uint64_t addr);
+int	ppt_num_devices(void);
 #endif

Modified: head/sys/amd64/vmm/vmm.c
==============================================================================
--- head/sys/amd64/vmm/vmm.c	Wed Sep 11 06:42:55 2013	(r255468)
+++ head/sys/amd64/vmm/vmm.c	Wed Sep 11 07:11:14 2013	(r255469)
@@ -213,7 +213,8 @@ vmm_handler(module_t mod, int what, void
 	switch (what) {
 	case MOD_LOAD:
 		vmmdev_init();
-		iommu_init();
+		if (ppt_num_devices() > 0)
+			iommu_init();
 		error = vmm_init();
 		if (error == 0)
 			vmm_initialized = 1;

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 07:24:48 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 16793CFC;
 Wed, 11 Sep 2013 07:24:48 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E9BEC29FF;
 Wed, 11 Sep 2013 07:24:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8B7Olku037600;
 Wed, 11 Sep 2013 07:24:47 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8B7OkdJ037593;
 Wed, 11 Sep 2013 07:24:46 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201309110724.r8B7OkdJ037593@svn.freebsd.org>
From: Devin Teske <dteske@FreeBSD.org>
Date: Wed, 11 Sep 2013 07:24:46 +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: r255470 - in stable/8/sys: net netinet netinet6
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 07:24:48 -0000

Author: dteske
Date: Wed Sep 11 07:24:46 2013
New Revision: 255470
URL: http://svnweb.freebsd.org/changeset/base/255470

Log:
  Merge from stable/9 SVN r250927: MFC: r249628, r249742
  
  - recover missing arp_ifinit() call.
  - plug static llentry leak (ipv4 & ipv6 were affected).
  
  PR:		kern/172985
  
  Also merge from stable/9 SVN r240313:
  
  Merge r238990 (manually resolving absence of r237263):
    Fix races between in_lltable_prefix_free(), lla_lookup(),
    llentry_free() and arptimer():
  
    o Use callout_init_rw() for lle timeout, this allows us safely
      disestablish them.
      - This allows us to simplify the arptimer() and make it
        race safe.
    o Consistently use ifp->if_afdata_lock to lock access to
      linked lists in the lle hashes.
    o Introduce new lle flag LLE_LINKED, which marks an entry that
      is attached to the hash.
      - Use LLE_LINKED to avoid double unlinking via consequent
        calls to llentry_free().
      - Mark lle with LLE_DELETED via |= operation istead of =,
        so that other flags won't be lost.
    o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more
      consistent and provide more informative KASSERTs.
  
    The patch is a collaborative work of all submitters and myself.
  
    PR:		kern/165863
    Submitted by:	zont, rstone
    Submitted by:	Eric van Gyzen <eric_van_gyzen dell.com>

Modified:
  stable/8/sys/net/if_llatbl.c
  stable/8/sys/net/if_llatbl.h
  stable/8/sys/net/if_var.h
  stable/8/sys/net/if_vlan.c
  stable/8/sys/netinet/if_ether.c
  stable/8/sys/netinet/in.c
  stable/8/sys/netinet6/in6.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/net/   (props changed)
  stable/8/sys/netinet/   (props changed)
  stable/8/sys/netinet6/   (props changed)

Modified: stable/8/sys/net/if_llatbl.c
==============================================================================
--- stable/8/sys/net/if_llatbl.c	Wed Sep 11 07:11:14 2013	(r255469)
+++ stable/8/sys/net/if_llatbl.c	Wed Sep 11 07:24:46 2013	(r255470)
@@ -109,10 +109,19 @@ llentry_free(struct llentry *lle)
 	size_t pkts_dropped;
 	struct mbuf *next;
 
-	pkts_dropped = 0;
+	IF_AFDATA_WLOCK_ASSERT(lle->lle_tbl->llt_ifp);
 	LLE_WLOCK_ASSERT(lle);
+
+	/* XXX: guard against race with other llentry_free(). */
+	if (!(lle->la_flags & LLE_LINKED)) {
+		LLE_FREE_LOCKED(lle);
+		return (0);
+	}
+
 	LIST_REMOVE(lle, lle_next);
+	lle->la_flags &= ~(LLE_VALID | LLE_LINKED);
 
+	pkts_dropped = 0;
 	while ((lle->la_numheld > 0) && (lle->la_hold != NULL)) {
 		next = lle->la_hold->m_nextpkt;
 		m_freem(lle->la_hold);
@@ -125,7 +134,6 @@ llentry_free(struct llentry *lle)
 		("%s: la_numheld %d > 0, pkts_droped %zd", __func__, 
 		 lle->la_numheld, pkts_dropped));
 
-	lle->la_flags &= ~LLE_VALID;
 	LLE_FREE_LOCKED(lle);
 
 	return (pkts_dropped);
@@ -185,17 +193,16 @@ lltable_free(struct lltable *llt)
 	SLIST_REMOVE(&V_lltables, llt, lltable, llt_link);
 	LLTABLE_WUNLOCK();
 
-	for (i=0; i < LLTBL_HASHTBL_SIZE; i++) {
+	IF_AFDATA_WLOCK(llt->llt_ifp);
+	for (i = 0; i < LLTBL_HASHTBL_SIZE; i++) {
 		LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {
-			int canceled;
-
-			canceled = callout_drain(&lle->la_timer);
 			LLE_WLOCK(lle);
-			if (canceled)
+			if (callout_stop(&lle->la_timer))
 				LLE_REMREF(lle);
 			llentry_free(lle);
 		}
 	}
+	IF_AFDATA_WUNLOCK(llt->llt_ifp);
 
 	free(llt, M_LLTABLE);
 }

Modified: stable/8/sys/net/if_llatbl.h
==============================================================================
--- stable/8/sys/net/if_llatbl.h	Wed Sep 11 07:11:14 2013	(r255469)
+++ stable/8/sys/net/if_llatbl.h	Wed Sep 11 07:24:46 2013	(r255470)
@@ -97,26 +97,28 @@ struct llentry {
 #define	LLE_ADDREF(lle) do {					\
 	LLE_WLOCK_ASSERT(lle);					\
 	KASSERT((lle)->lle_refcnt >= 0,				\
-		("negative refcnt %d", (lle)->lle_refcnt));	\
+	    ("negative refcnt %d on lle %p",			\
+	    (lle)->lle_refcnt, (lle)));				\
 	(lle)->lle_refcnt++;					\
 } while (0)
 
 #define	LLE_REMREF(lle)	do {					\
 	LLE_WLOCK_ASSERT(lle);					\
-	KASSERT((lle)->lle_refcnt > 1,				\
-		("bogus refcnt %d", (lle)->lle_refcnt));	\
+	KASSERT((lle)->lle_refcnt > 0,				\
+	    ("bogus refcnt %d on lle %p",			\
+	    (lle)->lle_refcnt, (lle)));				\
 	(lle)->lle_refcnt--;					\
 } while (0)
 
 #define	LLE_FREE_LOCKED(lle) do {				\
-	if ((lle)->lle_refcnt <= 1)				\
+	if ((lle)->lle_refcnt == 1)				\
 		(lle)->lle_tbl->llt_free((lle)->lle_tbl, (lle));\
 	else {							\
-		(lle)->lle_refcnt--;				\
+		LLE_REMREF(lle);				\
 		LLE_WUNLOCK(lle);				\
 	}							\
 	/* guard against invalid refs */			\
-	lle = NULL;						\
+	(lle) = NULL;						\
 } while (0)
 
 #define	LLE_FREE(lle) do {					\
@@ -167,9 +169,10 @@ MALLOC_DECLARE(M_LLTABLE);
 #define	LLE_VALID	0x0008	/* ll_addr is valid */
 #define	LLE_PROXY	0x0010	/* proxy entry ??? */
 #define	LLE_PUB		0x0020	/* publish entry ??? */
+#define	LLE_LINKED	0x0040	/* linked to lookup structure */
+#define	LLE_EXCLUSIVE	0x2000	/* return lle xlocked  */
 #define	LLE_DELETE	0x4000	/* delete on a lookup - match LLE_IFADDR */
 #define	LLE_CREATE	0x8000	/* create on a lookup miss */
-#define	LLE_EXCLUSIVE	0x2000	/* return lle xlocked  */
 
 #define LLATBL_HASH(key, mask) \
 	(((((((key >> 8) ^ key) >> 8) ^ key) >> 8) ^ key) & mask)

Modified: stable/8/sys/net/if_var.h
==============================================================================
--- stable/8/sys/net/if_var.h	Wed Sep 11 07:11:14 2013	(r255469)
+++ stable/8/sys/net/if_var.h	Wed Sep 11 07:24:46 2013	(r255470)
@@ -406,6 +406,8 @@ EVENTHANDLER_DECLARE(group_change_event,
 #define	IF_AFDATA_DESTROY(ifp)	rw_destroy(&(ifp)->if_afdata_lock)
 
 #define	IF_AFDATA_LOCK_ASSERT(ifp)	rw_assert(&(ifp)->if_afdata_lock, RA_LOCKED)
+#define	IF_AFDATA_RLOCK_ASSERT(ifp)	rw_assert(&(ifp)->if_afdata_lock, RA_RLOCKED)
+#define	IF_AFDATA_WLOCK_ASSERT(ifp)	rw_assert(&(ifp)->if_afdata_lock, RA_WLOCKED)
 #define	IF_AFDATA_UNLOCK_ASSERT(ifp)	rw_assert(&(ifp)->if_afdata_lock, RA_UNLOCKED)
 
 int	if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp,

Modified: stable/8/sys/net/if_vlan.c
==============================================================================
--- stable/8/sys/net/if_vlan.c	Wed Sep 11 07:11:14 2013	(r255469)
+++ stable/8/sys/net/if_vlan.c	Wed Sep 11 07:24:46 2013	(r255470)
@@ -41,6 +41,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_inet.h"
 #include "opt_vlan.h"
 
 #include <sys/param.h>
@@ -65,6 +66,11 @@ __FBSDID("$FreeBSD$");
 #include <net/if_vlan_var.h>
 #include <net/vnet.h>
 
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#endif
+
 #define VLANNAME	"vlan"
 #define	VLAN_DEF_HWIDTH	4
 #define	VLAN_IFFLAGS	(IFF_BROADCAST | IFF_MULTICAST)

Modified: stable/8/sys/netinet/if_ether.c
==============================================================================
--- stable/8/sys/netinet/if_ether.c	Wed Sep 11 07:11:14 2013	(r255469)
+++ stable/8/sys/netinet/if_ether.c	Wed Sep 11 07:24:46 2013	(r255470)
@@ -167,38 +167,30 @@ arp_ifscrub(struct ifnet *ifp, uint32_t 
 static void
 arptimer(void *arg)
 {
+	struct llentry *lle = (struct llentry *)arg;
 	struct ifnet *ifp;
-	struct llentry   *lle;
-	int pkts_dropped;
+	size_t pkts_dropped;
+
+	if (lle->la_flags & LLE_STATIC) {
+		LLE_WUNLOCK(lle);
+		return;
+	}
 
-	KASSERT(arg != NULL, ("%s: arg NULL", __func__));
-	lle = (struct llentry *)arg;
 	ifp = lle->lle_tbl->llt_ifp;
 	CURVNET_SET(ifp->if_vnet);
+
+	callout_stop(&lle->la_timer);
+
+	/* XXX: LOR avoidance. We still have ref on lle. */
+	LLE_WUNLOCK(lle);
 	IF_AFDATA_LOCK(ifp);
 	LLE_WLOCK(lle);
-	if (lle->la_flags & LLE_STATIC)
-		LLE_WUNLOCK(lle);
-	else {
-		if (!callout_pending(&lle->la_timer) &&
-		    callout_active(&lle->la_timer)) {
-			callout_stop(&lle->la_timer);
-			LLE_REMREF(lle);
-			pkts_dropped = llentry_free(lle);
-			ARPSTAT_ADD(dropped, pkts_dropped);
-			ARPSTAT_INC(timeouts);
-		} else {
-#ifdef DIAGNOSTIC
-			struct sockaddr *l3addr = L3_ADDR(lle);
-			log(LOG_INFO, 
-			    "arptimer issue: %p, IPv4 address: \"%s\"\n", lle,
-			    inet_ntoa(
-			        ((const struct sockaddr_in *)l3addr)->sin_addr));
-#endif
-			LLE_WUNLOCK(lle);
-		}
-	}
+
+	LLE_REMREF(lle);
+	pkts_dropped = llentry_free(lle);
 	IF_AFDATA_UNLOCK(ifp);
+	ARPSTAT_ADD(dropped, pkts_dropped);
+	ARPSTAT_INC(timeouts);
 	CURVNET_RESTORE();
 }
 

Modified: stable/8/sys/netinet/in.c
==============================================================================
--- stable/8/sys/netinet/in.c	Wed Sep 11 07:11:14 2013	(r255469)
+++ stable/8/sys/netinet/in.c	Wed Sep 11 07:24:46 2013	(r255470)
@@ -1350,7 +1350,6 @@ in_lltable_new(const struct sockaddr *l3
 	if (lle == NULL)		/* NB: caller generates msg */
 		return NULL;
 
-	callout_init(&lle->base.la_timer, CALLOUT_MPSAFE);
 	/*
 	 * For IPv4 this will trigger "arpresolve" to generate
 	 * an ARP request.
@@ -1359,7 +1358,10 @@ in_lltable_new(const struct sockaddr *l3
 	lle->l3_addr4 = *(const struct sockaddr_in *)l3addr;
 	lle->base.lle_refcnt = 1;
 	LLE_LOCK_INIT(&lle->base);
-	return &lle->base;
+	callout_init_rw(&lle->base.la_timer, &lle->base.lle_lock,
+	    CALLOUT_RETURNUNLOCKED);
+
+	return (&lle->base);
 }
 
 /*
@@ -1392,7 +1394,8 @@ in_lltable_prefix_free(struct lltable *l
 	register int i;
 	size_t pkts_dropped;
 
-	for (i=0; i < LLTBL_HASHTBL_SIZE; i++) {
+	IF_AFDATA_WLOCK(llt->llt_ifp);
+	for (i = 0; i < LLTBL_HASHTBL_SIZE; i++) {
 		LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {
 
 		        /* 
@@ -1402,17 +1405,15 @@ in_lltable_prefix_free(struct lltable *l
 			if (IN_ARE_MASKED_ADDR_EQUAL((struct sockaddr_in *)L3_ADDR(lle), 
 						     pfx, msk) &&
 			    ((flags & LLE_STATIC) || !(lle->la_flags & LLE_STATIC))) {
-				int canceled;
-
-				canceled = callout_drain(&lle->la_timer);
 				LLE_WLOCK(lle);
-				if (canceled)
+				if (callout_stop(&lle->la_timer))
 					LLE_REMREF(lle);
 				pkts_dropped = llentry_free(lle);
 				ARPSTAT_ADD(dropped, pkts_dropped);
 			}
 		}
 	}
+	IF_AFDATA_WUNLOCK(llt->llt_ifp);
 }
 
 
@@ -1545,15 +1546,20 @@ in_lltable_lookup(struct lltable *llt, u
 
 		lle->lle_tbl  = llt;
 		lle->lle_head = lleh;
+		lle->la_flags |= LLE_LINKED;
 		LIST_INSERT_HEAD(lleh, lle, lle_next);
 	} else if (flags & LLE_DELETE) {
 		if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) {
 			LLE_WLOCK(lle);
-			lle->la_flags = LLE_DELETED;
-			LLE_WUNLOCK(lle);
+			lle->la_flags |= LLE_DELETED;
 #ifdef DIAGNOSTIC
-			log(LOG_INFO, "ifaddr cache = %p  is deleted\n", lle);	
+			log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle);
 #endif
+			if ((lle->la_flags &
+			    (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC)
+				llentry_free(lle);
+			else
+				LLE_WUNLOCK(lle);
 		}
 		lle = (void *)-1;
 		

Modified: stable/8/sys/netinet6/in6.c
==============================================================================
--- stable/8/sys/netinet6/in6.c	Wed Sep 11 07:11:14 2013	(r255469)
+++ stable/8/sys/netinet6/in6.c	Wed Sep 11 07:24:46 2013	(r255470)
@@ -1377,10 +1377,10 @@ in6_purgeaddr(struct ifaddr *ifa)
 	nd6_dad_stop(ifa);
 
 	/* Remove local address entry from lltable. */
-	IF_AFDATA_LOCK(ifp);
-	lla_lookup(LLTABLE6(ifp), (LLE_DELETE | LLE_IFADDR),
-	    (struct sockaddr *)&ia->ia_addr);
-	IF_AFDATA_UNLOCK(ifp);
+	memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr));
+	memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask));
+	lltable_prefix_free(AF_INET6, (struct sockaddr *)&addr,
+		(struct sockaddr *)&mask, LLE_STATIC);
 
 	/*
 	 * initialize for rtmsg generation
@@ -1393,8 +1393,6 @@ in6_purgeaddr(struct ifaddr *ifa)
 	/* */
 	bzero(&rt0, sizeof(rt0));
 	rt0.rt_gateway = (struct sockaddr *)&gateway;
-	memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask));
-	memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr));
 	rt_mask(&rt0) = (struct sockaddr *)&mask;
 	rt_key(&rt0) = (struct sockaddr *)&addr;
 	rt0.rt_flags = RTF_HOST | RTF_STATIC;
@@ -2392,23 +2390,22 @@ in6_lltable_prefix_free(struct lltable *
 	 * (flags & LLE_STATIC) means deleting all entries 
 	 * including static ND6 entries
 	 */
-	for (i=0; i < LLTBL_HASHTBL_SIZE; i++) {
+	IF_AFDATA_WLOCK(llt->llt_ifp);
+	for (i = 0; i < LLTBL_HASHTBL_SIZE; i++) {
 		LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {
 			if (IN6_ARE_MASKED_ADDR_EQUAL(
-				    &((struct sockaddr_in6 *)L3_ADDR(lle))->sin6_addr, 
-				    &pfx->sin6_addr, 
-				    &msk->sin6_addr) &&
-			    ((flags & LLE_STATIC) || !(lle->la_flags & LLE_STATIC))) {
-				int canceled;
-
-				canceled = callout_drain(&lle->la_timer);
+			    &satosin6(L3_ADDR(lle))->sin6_addr,
+			    &pfx->sin6_addr, &msk->sin6_addr) &&
+			    ((flags & LLE_STATIC) ||
+			    !(lle->la_flags & LLE_STATIC))) {
 				LLE_WLOCK(lle);
-				if (canceled)
+				if (callout_stop(&lle->la_timer))
 					LLE_REMREF(lle);
 				llentry_free(lle);
 			}
 		}
 	}
+	IF_AFDATA_WUNLOCK(llt->llt_ifp);
 }
 
 static int
@@ -2500,15 +2497,20 @@ in6_lltable_lookup(struct lltable *llt, 
 
 		lle->lle_tbl  = llt;
 		lle->lle_head = lleh;
+		lle->la_flags |= LLE_LINKED;
 		LIST_INSERT_HEAD(lleh, lle, lle_next);
 	} else if (flags & LLE_DELETE) {
 		if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) {
 			LLE_WLOCK(lle);
-			lle->la_flags = LLE_DELETED;
-			LLE_WUNLOCK(lle);
+			lle->la_flags |= LLE_DELETED;
 #ifdef DIAGNOSTIC
-			log(LOG_INFO, "ifaddr cache = %p  is deleted\n", lle);	
-#endif	
+			log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle);
+#endif
+			if ((lle->la_flags &
+			    (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC)
+				llentry_free(lle);
+			else
+				LLE_WUNLOCK(lle);
 		}
 		lle = (void *)-1;
 	}

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 09:19:46 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7454432D;
 Wed, 11 Sep 2013 09:19:46 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 612EE2F04;
 Wed, 11 Sep 2013 09:19:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8B9JkoP085424;
 Wed, 11 Sep 2013 09:19:46 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8B9Ji32085412;
 Wed, 11 Sep 2013 09:19:44 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201309110919.r8B9Ji32085412@svn.freebsd.org>
From: Gleb Smirnoff <glebius@FreeBSD.org>
Date: Wed, 11 Sep 2013 09:19:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255471 - in head/sys: dev/iicbus dev/lmc dev/ppbus
 dev/usb/net 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 09:19:46 -0000

Author: glebius
Date: Wed Sep 11 09:19:44 2013
New Revision: 255471
URL: http://svnweb.freebsd.org/changeset/base/255471

Log:
    Clean up SIOCSIFDSTADDR usage from ifnet drivers. The ioctl itself is
  extremely outdated, and I doubt that it was ever used for ifnet drivers.
  It was used for AF_INET sockets in pre-FreeBSD time.
  
  Approved by:	re (hrs)
  Sponsored by:	Nginx, Inc.

Modified:
  head/sys/dev/iicbus/if_ic.c
  head/sys/dev/lmc/if_lmc.c
  head/sys/dev/ppbus/if_plip.c
  head/sys/dev/usb/net/if_usie.c
  head/sys/dev/usb/net/uhso.c
  head/sys/net/if_gif.c
  head/sys/net/if_gre.c
  head/sys/net/if_spppsubr.c
  head/sys/net/if_tun.c

Modified: head/sys/dev/iicbus/if_ic.c
==============================================================================
--- head/sys/dev/iicbus/if_ic.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/dev/iicbus/if_ic.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -204,7 +204,6 @@ icioctl(struct ifnet *ifp, u_long cmd, c
 
 	switch (cmd) {
 
-	case SIOCSIFDSTADDR:
 	case SIOCAIFADDR:
 	case SIOCSIFADDR:
 		if (ifa->ifa_addr->sa_family != AF_INET)

Modified: head/sys/dev/lmc/if_lmc.c
==============================================================================
--- head/sys/dev/lmc/if_lmc.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/dev/lmc/if_lmc.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -4480,7 +4480,6 @@ lmc_raw_ioctl(struct ifnet *ifp, u_long 
 # if (defined(__FreeBSD__) && defined(DEVICE_POLLING))  /* XXX necessary? */
     case SIOCSIFCAP:
 # endif
-    case SIOCSIFDSTADDR:
     case SIOCAIFADDR:
     case SIOCSIFFLAGS:
 #if 0

Modified: head/sys/dev/ppbus/if_plip.c
==============================================================================
--- head/sys/dev/ppbus/if_plip.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/dev/ppbus/if_plip.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -410,7 +410,6 @@ lpioctl(struct ifnet *ifp, u_long cmd, c
 	int error;
 
 	switch (cmd) {
-	case SIOCSIFDSTADDR:
 	case SIOCAIFADDR:
 	case SIOCSIFADDR:
 		if (ifa->ifa_addr->sa_family != AF_INET)

Modified: head/sys/dev/usb/net/if_usie.c
==============================================================================
--- head/sys/dev/usb/net/if_usie.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/dev/usb/net/if_usie.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -1324,7 +1324,6 @@ usie_if_ioctl(struct ifnet *ifp, u_long 
 		break;
 
 	case SIOCSIFADDR:
-	case SIOCSIFDSTADDR:
 		break;
 
 	default:

Modified: head/sys/dev/usb/net/uhso.c
==============================================================================
--- head/sys/dev/usb/net/uhso.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/dev/usb/net/uhso.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -1854,7 +1854,6 @@ uhso_if_ioctl(struct ifnet *ifp, u_long 
 		}
 		break;
 	case SIOCSIFADDR:
-	case SIOCSIFDSTADDR:
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
 		break;

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/net/if_gif.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -687,9 +687,6 @@ gif_ioctl(ifp, cmd, data)
 		ifp->if_flags |= IFF_UP;
 		break;
 		
-	case SIOCSIFDSTADDR:
-		break;
-
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
 		break;

Modified: head/sys/net/if_gre.c
==============================================================================
--- head/sys/net/if_gre.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/net/if_gre.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -534,8 +534,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCSIFADDR:
 		ifp->if_flags |= IFF_UP;
 		break;
-	case SIOCSIFDSTADDR:
-		break;
 	case SIOCSIFFLAGS:
 		/*
 		 * XXXRW: Isn't this priv_check() redundant to the ifnet

Modified: head/sys/net/if_spppsubr.c
==============================================================================
--- head/sys/net/if_spppsubr.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/net/if_spppsubr.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -1200,7 +1200,6 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_
 	rv = 0;
 	switch (cmd) {
 	case SIOCAIFADDR:
-	case SIOCSIFDSTADDR:
 		break;
 
 	case SIOCSIFADDR:

Modified: head/sys/net/if_tun.c
==============================================================================
--- head/sys/net/if_tun.c	Wed Sep 11 07:24:46 2013	(r255470)
+++ head/sys/net/if_tun.c	Wed Sep 11 09:19:44 2013	(r255471)
@@ -552,10 +552,6 @@ tunifioctl(struct ifnet *ifp, u_long cmd
 		tuninit(ifp);
 		TUNDEBUG(ifp, "address set\n");
 		break;
-	case SIOCSIFDSTADDR:
-		tuninit(ifp);
-		TUNDEBUG(ifp, "destination address set\n");
-		break;
 	case SIOCSIFMTU:
 		ifp->if_mtu = ifr->ifr_mtu;
 		TUNDEBUG(ifp, "mtu set\n");

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 10:18:37 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 617EC34A;
 Wed, 11 Sep 2013 10:18:37 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4E8CE21B5;
 Wed, 11 Sep 2013 10:18:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BAIbhT010674;
 Wed, 11 Sep 2013 10:18:37 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BAIbou010673;
 Wed, 11 Sep 2013 10:18:37 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201309111018.r8BAIbou010673@svn.freebsd.org>
From: Hans Petter Selasky <hselasky@FreeBSD.org>
Date: Wed, 11 Sep 2013 10:18:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255472 - head/sys/dev/usb/storage
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 10:18:37 -0000

Author: hselasky
Date: Wed Sep 11 10:18:36 2013
New Revision: 255472
URL: http://svnweb.freebsd.org/changeset/base/255472

Log:
  Clear correct data structure.
  
  MFC after:	1 week
  Approved by:	re (hrs)

Modified:
  head/sys/dev/usb/storage/umass.c

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c	Wed Sep 11 09:19:44 2013	(r255471)
+++ head/sys/dev/usb/storage/umass.c	Wed Sep 11 10:18:36 2013	(r255472)
@@ -1321,10 +1321,12 @@ umass_t_bbb_command_callback(struct usb_
 			}
 			sc->cbw.bCDBLength = sc->sc_transfer.cmd_len;
 
+			/* copy SCSI command data */
 			memcpy(sc->cbw.CBWCDB, sc->sc_transfer.cmd_data,
 			    sc->sc_transfer.cmd_len);
 
-			memset(sc->sc_transfer.cmd_data +
+			/* clear remaining command area */
+			memset(sc->cbw.CBWCDB +
 			    sc->sc_transfer.cmd_len, 0,
 			    sizeof(sc->cbw.CBWCDB) -
 			    sc->sc_transfer.cmd_len);

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 17:23:43 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 60C815D2;
 Wed, 11 Sep 2013 17:23:43 +0000 (UTC) (envelope-from alc@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4D7702A4A;
 Wed, 11 Sep 2013 17:23:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BHNhA6003311;
 Wed, 11 Sep 2013 17:23:43 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BHNhjF003310;
 Wed, 11 Sep 2013 17:23:43 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201309111723.r8BHNhjF003310@svn.freebsd.org>
From: Alan Cox <alc@FreeBSD.org>
Date: Wed, 11 Sep 2013 17:23:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255474 - head/sys/i386/i386
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 17:23:43 -0000

Author: alc
Date: Wed Sep 11 17:23:42 2013
New Revision: 255474
URL: http://svnweb.freebsd.org/changeset/base/255474

Log:
  Prior to r254304, we only began scanning the active page queue when the
  amount of free memory was close to the point at which we would begin
  reclaiming pages.  Now, we continuously scan the active page queue,
  regardless of the amount of free memory.  Consequently, we are continuously
  calling pmap_ts_referenced() on active pages.
  
  Prior to this change, pmap_ts_referenced() would always demote superpage
  mappings in order to obtain finer-grained reference information.  This made
  sense because we were coming under memory pressure and would soon have to
  begin reclaiming pages.  Now, however, with continuous scanning of the
  active page queue, these demotions are taking a toll on performance.  To
  address this problem, I have replaced the demotion with a heuristic for
  periodically clearing the reference flag on superpage mappings.
  
  Approved by:	re (kib)
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Wed Sep 11 10:51:02 2013	(r255473)
+++ head/sys/i386/i386/pmap.c	Wed Sep 11 17:23:42 2013	(r255474)
@@ -2639,8 +2639,8 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t 
 	oldpde = *pde;
 	KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V),
 	    ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V"));
-	mpte = pmap_lookup_pt_page(pmap, va);
-	if (mpte != NULL)
+	if ((oldpde & PG_A) != 0 && (mpte = pmap_lookup_pt_page(pmap, va)) !=
+	    NULL)
 		pmap_remove_pt_page(pmap, mpte);
 	else {
 		KASSERT((oldpde & PG_W) == 0,
@@ -4744,6 +4744,8 @@ retry:
 	rw_wunlock(&pvh_global_lock);
 }
 
+#define	PMAP_TS_REFERENCED_MAX	5
+
 /*
  *	pmap_ts_referenced:
  *
@@ -4760,73 +4762,88 @@ int
 pmap_ts_referenced(vm_page_t m)
 {
 	struct md_page *pvh;
-	pv_entry_t pv, pvf, pvn;
+	pv_entry_t pv, pvf;
 	pmap_t pmap;
-	pd_entry_t oldpde, *pde;
+	pd_entry_t *pde;
 	pt_entry_t *pte;
-	vm_offset_t va;
+	vm_paddr_t pa;
 	int rtval = 0;
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_ts_referenced: page %p is not managed", m));
-	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
+	pa = VM_PAGE_TO_PHYS(m);
+	pvh = pa_to_pvh(pa);
 	rw_wlock(&pvh_global_lock);
 	sched_pin();
-	if ((m->flags & PG_FICTITIOUS) != 0)
+	if ((m->flags & PG_FICTITIOUS) != 0 ||
+	    (pvf = TAILQ_FIRST(&pvh->pv_list)) == NULL)
 		goto small_mappings;
-	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, pvn) {
-		va = pv->pv_va;
+	pv = pvf;
+	do {
 		pmap = PV_PMAP(pv);
 		PMAP_LOCK(pmap);
-		pde = pmap_pde(pmap, va);
-		oldpde = *pde;
-		if ((oldpde & PG_A) != 0) {
-			if (pmap_demote_pde(pmap, pde, va)) {
-				if ((oldpde & PG_W) == 0) {
-					/*
-					 * Remove the mapping to a single page
-					 * so that a subsequent access may
-					 * repromote.  Since the underlying
-					 * page table page is fully populated,
-					 * this removal never frees a page
-					 * table page.
-					 */
-					va += VM_PAGE_TO_PHYS(m) - (oldpde &
-					    PG_PS_FRAME);
-					pmap_remove_page(pmap, va, NULL);
-					rtval++;
-					if (rtval > 4) {
-						PMAP_UNLOCK(pmap);
-						goto out;
-					}
-				}
+		pde = pmap_pde(pmap, pv->pv_va);
+		if ((*pde & PG_A) != 0) {
+			/*
+			 * Since this reference bit is shared by either 1024
+			 * or 512 4KB pages, it should not be cleared every
+			 * time it is tested.  Apply a simple "hash" function
+			 * on the physical page number, the virtual superpage
+			 * number, and the pmap address to select one 4KB page
+			 * out of the 1024 or 512 on which testing the
+			 * reference bit will result in clearing that bit.
+			 * This function is designed to avoid the selection of
+			 * the same 4KB page for every 2- or 4MB page mapping.
+			 *
+			 * On demotion, a mapping that hasn't been referenced
+			 * is simply destroyed.  To avoid the possibility of a
+			 * subsequent page fault on a demoted wired mapping,
+			 * always leave its reference bit set.  Moreover,
+			 * since the superpage is wired, the current state of
+			 * its reference bit won't affect page replacement.
+			 */
+			if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> PDRSHIFT) ^
+			    (uintptr_t)pmap) & (NPTEPG - 1)) == 0 &&
+			    (*pde & PG_W) == 0) {
+				atomic_clear_int((u_int *)pde, PG_A);
+				pmap_invalidate_page(pmap, pv->pv_va);
 			}
+			rtval++;
 		}
 		PMAP_UNLOCK(pmap);
-	}
+		/* Rotate the PV list if it has more than one entry. */
+		if (TAILQ_NEXT(pv, pv_next) != NULL) {
+			TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);
+			TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next);
+		}
+		if (rtval >= PMAP_TS_REFERENCED_MAX)
+			goto out;
+	} while ((pv = TAILQ_FIRST(&pvh->pv_list)) != pvf);
 small_mappings:
-	if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
-		pvf = pv;
-		do {
-			pvn = TAILQ_NEXT(pv, pv_next);
+	if ((pvf = TAILQ_FIRST(&m->md.pv_list)) == NULL)
+		goto out;
+	pv = pvf;
+	do {
+		pmap = PV_PMAP(pv);
+		PMAP_LOCK(pmap);
+		pde = pmap_pde(pmap, pv->pv_va);
+		KASSERT((*pde & PG_PS) == 0,
+		    ("pmap_ts_referenced: found a 4mpage in page %p's pv list",
+		    m));
+		pte = pmap_pte_quick(pmap, pv->pv_va);
+		if ((*pte & PG_A) != 0) {
+			atomic_clear_int((u_int *)pte, PG_A);
+			pmap_invalidate_page(pmap, pv->pv_va);
+			rtval++;
+		}
+		PMAP_UNLOCK(pmap);
+		/* Rotate the PV list if it has more than one entry. */
+		if (TAILQ_NEXT(pv, pv_next) != NULL) {
 			TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
 			TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
-			pmap = PV_PMAP(pv);
-			PMAP_LOCK(pmap);
-			pde = pmap_pde(pmap, pv->pv_va);
-			KASSERT((*pde & PG_PS) == 0, ("pmap_ts_referenced:"
-			    " found a 4mpage in page %p's pv list", m));
-			pte = pmap_pte_quick(pmap, pv->pv_va);
-			if ((*pte & PG_A) != 0) {
-				atomic_clear_int((u_int *)pte, PG_A);
-				pmap_invalidate_page(pmap, pv->pv_va);
-				rtval++;
-				if (rtval > 4)
-					pvn = NULL;
-			}
-			PMAP_UNLOCK(pmap);
-		} while ((pv = pvn) != NULL && pv != pvf);
-	}
+		}
+	} while ((pv = TAILQ_FIRST(&m->md.pv_list)) != pvf && rtval <
+	    PMAP_TS_REFERENCED_MAX);
 out:
 	sched_unpin();
 	rw_wunlock(&pvh_global_lock);

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 17:31:23 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 46481931;
 Wed, 11 Sep 2013 17:31:23 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3287E2ADC;
 Wed, 11 Sep 2013 17:31:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BHVNk7008313;
 Wed, 11 Sep 2013 17:31:23 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BHVNtY008312;
 Wed, 11 Sep 2013 17:31:23 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309111731.r8BHVNtY008312@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Wed, 11 Sep 2013 17:31:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255475 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 17:31:23 -0000

Author: kib
Date: Wed Sep 11 17:31:22 2013
New Revision: 255475
URL: http://svnweb.freebsd.org/changeset/base/255475

Log:
  Fix build with gcc.
  
  Build-tested by:	gjb
  Approved by:	re (glebius)

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Wed Sep 11 17:23:42 2013	(r255474)
+++ head/sys/kern/uipc_syscalls.c	Wed Sep 11 17:31:22 2013	(r255475)
@@ -2197,6 +2197,7 @@ vn_sendfile(struct file *fp, int sockfd,
 	int error, bsize, nd, hdrlen, mnw;
 	bool inflight_called;
 
+	pg = NULL;
 	obj = NULL;
 	so = NULL;
 	m = NULL;
@@ -2204,6 +2205,7 @@ vn_sendfile(struct file *fp, int sockfd,
 	fsbytes = sbytes = 0;
 	hdrlen = mnw = 0;
 	rem = nbytes;
+	obj_size = 0;
 	inflight_called = false;
 
 	error = sendfile_getobj(td, fp, &obj, &vp, &shmfd, &obj_size, &bsize);

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 17:42:35 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id DE9BECFD;
 Wed, 11 Sep 2013 17:42:35 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CAE1E2B7F;
 Wed, 11 Sep 2013 17:42:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BHgZQS014506;
 Wed, 11 Sep 2013 17:42:35 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BHgZax014505;
 Wed, 11 Sep 2013 17:42:35 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309111742.r8BHgZax014505@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Wed, 11 Sep 2013 17:42:35 +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: r255476 - in stable: 8/usr.sbin/mergemaster
 9/usr.sbin/mergemaster
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 17:42:36 -0000

Author: delphij
Date: Wed Sep 11 17:42:35 2013
New Revision: 255476
URL: http://svnweb.freebsd.org/changeset/base/255476

Log:
  MFC r255428:
  
  Pass -n (do not emit comments) when saving mtree information for future
  mergemaster(8) runs.

Modified:
  stable/9/usr.sbin/mergemaster/mergemaster.sh
Directory Properties:
  stable/9/usr.sbin/mergemaster/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/8/usr.sbin/mergemaster/mergemaster.sh
Directory Properties:
  stable/8/usr.sbin/mergemaster/   (props changed)

Modified: stable/9/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- stable/9/usr.sbin/mergemaster/mergemaster.sh	Wed Sep 11 17:31:22 2013	(r255475)
+++ stable/9/usr.sbin/mergemaster/mergemaster.sh	Wed Sep 11 17:42:35 2013	(r255476)
@@ -707,7 +707,7 @@ case "${RERUN}" in
   # Build the mtree database in a temporary location.
   case "${PRE_WORLD}" in
   '') MTREENEW=`mktemp -t mergemaster.mtree`
-      mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
+      mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
       ;;
   *) # We don't want to mess with the mtree database on a pre-world run or
      # when re-scanning a previously-built tree.

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 17:42:36 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 3EC53CFE;
 Wed, 11 Sep 2013 17:42:36 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2A9862B80;
 Wed, 11 Sep 2013 17:42:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BHgaf6014512;
 Wed, 11 Sep 2013 17:42:36 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BHgaIR014511;
 Wed, 11 Sep 2013 17:42:36 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309111742.r8BHgaIR014511@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Wed, 11 Sep 2013 17:42:36 +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: r255476 - in stable: 8/usr.sbin/mergemaster
 9/usr.sbin/mergemaster
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 17:42:36 -0000

Author: delphij
Date: Wed Sep 11 17:42:35 2013
New Revision: 255476
URL: http://svnweb.freebsd.org/changeset/base/255476

Log:
  MFC r255428:
  
  Pass -n (do not emit comments) when saving mtree information for future
  mergemaster(8) runs.

Modified:
  stable/8/usr.sbin/mergemaster/mergemaster.sh
Directory Properties:
  stable/8/usr.sbin/mergemaster/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/usr.sbin/mergemaster/mergemaster.sh
Directory Properties:
  stable/9/usr.sbin/mergemaster/   (props changed)

Modified: stable/8/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- stable/8/usr.sbin/mergemaster/mergemaster.sh	Wed Sep 11 17:31:22 2013	(r255475)
+++ stable/8/usr.sbin/mergemaster/mergemaster.sh	Wed Sep 11 17:42:35 2013	(r255476)
@@ -710,7 +710,7 @@ case "${RERUN}" in
   # Build the mtree database in a temporary location.
   case "${PRE_WORLD}" in
   '') MTREENEW=`mktemp -t mergemaster.mtree`
-      mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
+      mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
       ;;
   *) # We don't want to mess with the mtree database on a pre-world run or
      # when re-scanning a previously-built tree.

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 18:10:12 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B4B7EA4B;
 Wed, 11 Sep 2013 18:10:12 +0000 (UTC)
 (envelope-from davide.italiano@gmail.com)
Received: from mail-ve0-x231.google.com (mail-ve0-x231.google.com
 [IPv6:2607:f8b0:400c:c01::231])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3DAAF2D3B;
 Wed, 11 Sep 2013 18:10:12 +0000 (UTC)
Received: by mail-ve0-f177.google.com with SMTP id db12so5950900veb.8
 for <multiple recipients>; Wed, 11 Sep 2013 11:10:11 -0700 (PDT)
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=FQrjyRPXcRdLPSHpNPUqVlnIPgsIUGLn9VW08ZGYy1Q=;
 b=owDvInnaqSqyp1aYjV+n6HkcI54f1yEiqo0lOEWjvnu/d6EX7qlPexn1JA26wr3wPH
 L0/vTlP5tOCBqaclZU2f84rROiBTKYUudGnVIFdONQznNlQ+W7NEgQ3fQm4rceVkjvUF
 lydpQnM8AsLa1Vok1SpHiLF0k46U7EqvhRo2NSCbYHeQVCwk6DncDz2B2WS/AfOxHZwM
 grc1bWYnDr5nrUlF138oNLy5nuw6xnQy4Mlk3EfSCYrH4VJ1Eu9piAOVIctX5fZiw7rf
 /rrtrwgnXkfSAnpOsynkZ2LUpSmxHG6WSVfwOC7K1hiBLfe0m0wP2yhngTHW5ulrXkud
 8Bgg==
MIME-Version: 1.0
X-Received: by 10.58.67.9 with SMTP id j9mr2475618vet.22.1378923011342; Wed,
 11 Sep 2013 11:10:11 -0700 (PDT)
Sender: davide.italiano@gmail.com
Received: by 10.220.65.132 with HTTP; Wed, 11 Sep 2013 11:10:11 -0700 (PDT)
In-Reply-To: <201308261502.13277.jhb@freebsd.org>
References: <201308231412.r7NECdG7081565@svn.freebsd.org>
 <201308231258.50969.jhb@freebsd.org>
 <CACYV=-ELQNPR3_Ok12J5UbUpROcr5oEVv6ndnnpnU781tyKgrw@mail.gmail.com>
 <201308261502.13277.jhb@freebsd.org>
Date: Wed, 11 Sep 2013 20:10:11 +0200
X-Google-Sender-Auth: JNiOBf3A-GQOaxfc__wK4L9G0s8
Message-ID: <CACYV=-FiOyVsjbnPA5qLXK2OvN_Y9AgWpqOyYzEuJ7a2o8dp1g@mail.gmail.com>
Subject: Re: svn commit: r254703 - in head: share/man/man9 sys/sys
From: Davide Italiano <davide@freebsd.org>
To: John Baldwin <jhb@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 18:10:12 -0000

[snip]

> Well, I've thought about changing lc_lock/unlock to return a uintptr_t or
> void * instead of an int and then I could make rm_sleep work fine.  However,
> that still doesn't solve the callout case.  The callout case can't be fixed
> easily without explicitly allocating storage in the softclock thread itself.
>
> Also, I don't think you want a pointer in a lock_object.  Imagine if two
> threads both locked and then slept on the same rm lock in succession while
> waiting for a wakeup.  You would have two trackers to keep track of, but only
> one pointer in the lock_object.
>
> I'm not sure you need to revert your commit.  It should pretty much panic
> instantly if someone tries to use it with a read lock instead of a write
> lock, even without INVARIANTS.
>
> --
> John Baldwin

Hi John,
I've finally gotten around to dedicate some time to this.
The following patch :
http://people.freebsd.org/~davide/review/callout_sharedrm.diff is a
proposed fix the problem for the callout_rm shared case, based on your
suggestions.
I've overloaded the lc_lock/lc_unlock functions so that they take an
additional void *arg argument which in the callout rm shared case is a
pointer to priotracker structure (I used a void * so that it could be
used for some other purposes in the future, if any).
I've also added a MPASS in the lc_lock()/lc_unlock() functions for all
the primitives but rmlock so that is ensured that arg passed is NULL.
I'm not completely sure this is required but I put that there as
safety belt.
The KPI is highly disturbed by this change, but unfortunately I wasn't
able to find out a way to workaround the problem without this
breakage. While we're breaking things, I guess we can fix the
rm_sleep() case as well instead of causing a double breakage.
My only doubt is what exactly we should return from lc_unlock/lc_lock,
as long as in the, e.g. rwlock case we need to return a boolean that
contains lock state (shared/exclusive) whilst in the rmlock case we
need to return both the lock state and a pointer to struct
rm_priotracker. My best guess is that of introducing a 'struct
lockstate' (sorry for the poor name choice, just to give you the idea)
which contains these two informations, but probably we can
alternatively use a single pointer and store the information about
lock state in the low order bits.
What's your opinion about?

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 18:22:30 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CC3FBF23;
 Wed, 11 Sep 2013 18:22:30 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B9FFD2E15;
 Wed, 11 Sep 2013 18:22:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BIMUcl040504;
 Wed, 11 Sep 2013 18:22:30 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BIMUe8040503;
 Wed, 11 Sep 2013 18:22:30 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201309111822.r8BIMUe8040503@svn.freebsd.org>
From: Gleb Smirnoff <glebius@FreeBSD.org>
Date: Wed, 11 Sep 2013 18:22:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255478 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 18:22:30 -0000

Author: glebius
Date: Wed Sep 11 18:22:30 2013
New Revision: 255478
URL: http://svnweb.freebsd.org/changeset/base/255478

Log:
  Provide pr_ctloutput method for AF_LOCAL/SOCK_SEQPACKET sockets.
  This makes setsockopt() on them working.
  
  Reported by:	Yuri <yuri rawbw.com>
  Approved by:	re (kib)

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c	Wed Sep 11 18:16:18 2013	(r255477)
+++ head/sys/kern/uipc_usrreq.c	Wed Sep 11 18:22:30 2013	(r255478)
@@ -325,6 +325,7 @@ static struct protosw localsw[] = {
 	 */
 	.pr_flags =		PR_ADDR|PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|
 				    PR_RIGHTS,
+	.pr_ctloutput =		&uipc_ctloutput,
 	.pr_usrreqs =		&uipc_usrreqs_seqpacket,
 },
 };

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 19:20:54 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 17675C6D;
 Wed, 11 Sep 2013 19:20:54 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 045F521F8;
 Wed, 11 Sep 2013 19:20:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BJKrQ6075163;
 Wed, 11 Sep 2013 19:20:53 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BJKrWJ075162;
 Wed, 11 Sep 2013 19:20:53 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201309111920.r8BJKrWJ075162@svn.freebsd.org>
From: Sean Bruno <sbruno@FreeBSD.org>
Date: Wed, 11 Sep 2013 19:20: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: r255479 - stable/9/sys/dev/mfi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 19:20:54 -0000

Author: sbruno
Date: Wed Sep 11 19:20:53 2013
New Revision: 255479
URL: http://svnweb.freebsd.org/changeset/base/255479

Log:
  MFC r254330 -- allow users to run SYS_PD mode JBOD with a non-default MAXPHYS

Modified:
  stable/9/sys/dev/mfi/mfi_syspd.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/mfi/mfi_syspd.c
==============================================================================
--- stable/9/sys/dev/mfi/mfi_syspd.c	Wed Sep 11 18:22:30 2013	(r255478)
+++ stable/9/sys/dev/mfi/mfi_syspd.c	Wed Sep 11 19:20:53 2013	(r255479)
@@ -126,7 +126,8 @@ mfi_syspd_attach(device_t dev)
 		      sectors / (1024 * 1024 / secsize), sectors, sc->pd_id);
 	sc->pd_disk = disk_alloc();
 	sc->pd_disk->d_drv1 = sc;
-	sc->pd_disk->d_maxsize = sc->pd_controller->mfi_max_io * secsize;
+	sc->pd_disk->d_maxsize = min(sc->pd_controller->mfi_max_io * secsize,
+		(sc->pd_controller->mfi_max_sge - 1) * PAGE_SIZE);
 	sc->pd_disk->d_name = "mfisyspd";
 	sc->pd_disk->d_open = mfi_syspd_open;
 	sc->pd_disk->d_close = mfi_syspd_close;

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 19:38:11 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0B4E74E3;
 Wed, 11 Sep 2013 19:38:11 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id D42B122D5;
 Wed, 11 Sep 2013 19:38:10 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6C8A2B958;
 Wed, 11 Sep 2013 15:38:07 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: Baptiste Daroussin <bapt@freebsd.org>
Subject: Re: svn commit: r255457 - head/usr.sbin/pkg
Date: Wed, 11 Sep 2013 09:56:11 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201309102056.r8AKu1rQ000442@svn.freebsd.org>
 <522FE3A2.2090405@freebsd.org> <20130911054907.GK40186@ithaqua.etoilebsd.net>
In-Reply-To: <20130911054907.GK40186@ithaqua.etoilebsd.net>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Message-Id: <201309110956.11782.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Wed, 11 Sep 2013 15:38:07 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Nathan Whitehorn <nwhitehorn@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 19:38:11 -0000

On Wednesday, September 11, 2013 1:49:07 am Baptiste Daroussin wrote:
> On Tue, Sep 10, 2013 at 10:29:38PM -0500, Nathan Whitehorn wrote:
> > On 09/10/13 15:56, Baptiste Daroussin wrote:
> > > Author: bapt
> > > Date: Tue Sep 10 20:56:01 2013
> > > New Revision: 255457
> > > URL: http://svnweb.freebsd.org/changeset/base/255457
> > >
> > > Log:
> > >    Add support to detect arm vs armv6
> > >    
> > >    There are two different versions of the ARM ABI depending on the
> > >    TARGET_ARCH. As these are sligntly different a package built for
> > >    one may not work on another. We need to detect which one we are on
> > >    by parsing the .ARM.attributes section.
> > >    
> > >    This will only work on the ARM EABI as this section is part of the
> > >    ABI definition. As armv6 only supports the ARM EABI this is not a
> > >    problem for the oabi.
> > >    
> > >    Older versions of libelf in FreeBSD fail to read the
> > >    .ARM.attributes section needed. As armv6 is unsupported on these
> > >    versions we can assume we are running on arm.
> > >    
> > 
> > Picking a random commit: I don't suppose we can just use MACHINE_ARCH 
> > for these identifiers? It encapsulates everything needed for compatibility.
> > -Nathan
> 
> Yes we probably can, it encapsulates everything since recently! It wasn't the
> case when ABI string was defined, and it lacks an important part of why the ABI
> string has been designed on pkgng: making a package match multiple arch via
> simple glob on the ABI line.
> 
> So as I already said to Warner, Yes now that it properly works on all arches we
> could use it but that is not that easy.
> 
> People wanting to go that way should:
> 1. provide a way for pkgng to extract MARCHE_ARCH out of a binary (/bin/ls)
> (dynamic cross installation ABI detection)
> 2. provide a way to create multiarch ABI out of MACHINE_ARCH
> 3. provide an upgrade path with compatibility for the current string (pkgng is
> already largely deployed)
> 4. have time to do it
> 
> There is so much work pending on pkgng, in particular for 10.0 that I just have
> no time to work on it.

We actually had a thread about this on arch@ a while back where I think we did
largely satisfy your concerns.  However, one of the open items is to convert
amd64, i386, and pc98 to set MACHINE_CPUARCH to x86 instead of amd64/i386 (this
would clean up several other things as well).  I do think it would be helpful
if pkgng used arch strings that were consistent with MACHINE_ARCH so that the
transition is easier (e.g. x86:i386 and x86:amd64 instead of x86:32 and
x86:64).

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 11 21:45:03 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 67188471;
 Wed, 11 Sep 2013 21:45:03 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 52C072ABF;
 Wed, 11 Sep 2013 21:45:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BLj3m8064552;
 Wed, 11 Sep 2013 21:45:03 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BLj30O064551;
 Wed, 11 Sep 2013 21:45:03 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201309112145.r8BLj30O064551@svn.freebsd.org>
From: Sean Bruno <sbruno@FreeBSD.org>
Date: Wed, 11 Sep 2013 21:45:03 +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: r255480 - stable/8/sys/dev/mfi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Sep 2013 21:45:03 -0000

Author: sbruno
Date: Wed Sep 11 21:45:02 2013
New Revision: 255480
URL: http://svnweb.freebsd.org/changeset/base/255480

Log:
  MFC r254330 -- allow users to run SYS_PD mode JBOD with a non-default MAXPHYS

Modified:
  stable/8/sys/dev/mfi/mfi_syspd.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/mfi/   (props changed)

Modified: stable/8/sys/dev/mfi/mfi_syspd.c
==============================================================================
--- stable/8/sys/dev/mfi/mfi_syspd.c	Wed Sep 11 19:20:53 2013	(r255479)
+++ stable/8/sys/dev/mfi/mfi_syspd.c	Wed Sep 11 21:45:02 2013	(r255480)
@@ -126,7 +126,8 @@ mfi_syspd_attach(device_t dev)
 		      sectors / (1024 * 1024 / secsize), sectors, sc->pd_id);
 	sc->pd_disk = disk_alloc();
 	sc->pd_disk->d_drv1 = sc;
-	sc->pd_disk->d_maxsize = sc->pd_controller->mfi_max_io * secsize;
+	sc->pd_disk->d_maxsize = min(sc->pd_controller->mfi_max_io * secsize,
+		(sc->pd_controller->mfi_max_sge - 1) * PAGE_SIZE);
 	sc->pd_disk->d_name = "mfisyspd";
 	sc->pd_disk->d_open = mfi_syspd_open;
 	sc->pd_disk->d_close = mfi_syspd_close;

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 00:14:26 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 3F5D8C18;
 Thu, 12 Sep 2013 00:14:26 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2E2B22225;
 Thu, 12 Sep 2013 00:14:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8C0EPXx057767;
 Thu, 12 Sep 2013 00:14:25 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8C0EPvW057766;
 Thu, 12 Sep 2013 00:14:25 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309120014.r8C0EPvW057766@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Thu, 12 Sep 2013 00:14:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255483 - head/usr.sbin/mtree
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 00:14:26 -0000

Author: delphij
Date: Thu Sep 12 00:14:25 2013
New Revision: 255483
URL: http://svnweb.freebsd.org/changeset/base/255483

Log:
  Do not emit size for non-regular files.  There is nothing that
  mtree(1) can do in this situation and would cause confusion.
  
  MFC candidate.
  
  Approved by:	re (hrs)

Modified:
  head/usr.sbin/mtree/create.c

Modified: head/usr.sbin/mtree/create.c
==============================================================================
--- head/usr.sbin/mtree/create.c	Wed Sep 11 23:36:56 2013	(r255482)
+++ head/usr.sbin/mtree/create.c	Thu Sep 12 00:14:25 2013	(r255483)
@@ -208,7 +208,7 @@ statf(int indent, FTSENT *p)
 		output(indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS);
 	if (keys & F_NLINK && p->fts_statp->st_nlink != 1)
 		output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink);
-	if (keys & F_SIZE)
+	if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode))
 		output(indent, &offset, "size=%jd",
 		    (intmax_t)p->fts_statp->st_size);
 	if (keys & F_TIME)

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 00:23:09 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BCA331D6;
 Thu, 12 Sep 2013 00:23:09 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id AB68122D0;
 Thu, 12 Sep 2013 00:23:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8C0N9mL063786;
 Thu, 12 Sep 2013 00:23:09 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8C0N91Q063784;
 Thu, 12 Sep 2013 00:23:09 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201309120023.r8C0N91Q063784@svn.freebsd.org>
From: Ed Maste <emaste@FreeBSD.org>
Date: Thu, 12 Sep 2013 00:23:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255484 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 00:23:09 -0000

Author: emaste
Date: Thu Sep 12 00:23:09 2013
New Revision: 255484
URL: http://svnweb.freebsd.org/changeset/base/255484

Log:
  Fix make bootstrapping with WITH_DEBUG_FILES=
  
  A HEAD buildworld on 9.x first bootstraps bmake, but this failed when
  building with standalone debug.  Pass in the PROGNAME override to the
  'make all' stage as well as 'make install' so that the .debug file is
  created with the correct name.
  
  Reviewed by:	sjg
  Sponsored by:	The FreeBSD Foundation
  Approved by:	re (rodrigc)

Modified:
  head/Makefile

Modified: head/Makefile
==============================================================================
--- head/Makefile	Thu Sep 12 00:14:25 2013	(r255483)
+++ head/Makefile	Thu Sep 12 00:23:09 2013	(r255484)
@@ -351,7 +351,7 @@ make bmake: .PHONY
 	${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \
 		${MMAKE} obj DESTDIR= && \
 		${MMAKE} depend DESTDIR= && \
-		${MMAKE} all DESTDIR= && \
+		${MMAKE} all DESTDIR= PROGNAME=${MYMAKE:T} && \
 		${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= PROGNAME=${MYMAKE:T}
 
 tinderbox toolchains kernel-toolchains: upgrade_checks

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 00:46:33 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id F33AF71E;
 Thu, 12 Sep 2013 00:46:32 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E08D023BD;
 Thu, 12 Sep 2013 00:46:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8C0kWRR076978;
 Thu, 12 Sep 2013 00:46:32 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8C0kWDe076977;
 Thu, 12 Sep 2013 00:46:32 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201309120046.r8C0kWDe076977@svn.freebsd.org>
From: Xin LI <delphij@FreeBSD.org>
Date: Thu, 12 Sep 2013 00:46:32 +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: r255485 - stable/9/sys/kern
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 00:46:33 -0000

Author: delphij
Date: Thu Sep 12 00:46:32 2013
New Revision: 255485
URL: http://svnweb.freebsd.org/changeset/base/255485

Log:
  MFC r255412:
  
  In r243868, the error message buffer errmsg have been changed from
  an on-stack array to a pointer and therefore sizeof(errmsg) would
  become 4 or 8 bytes depending on the architecture.
  
  Fix this by using ERRMSGL in place of sizeof().
  
  Submitted by:	J David <j.david.lists@gmail.com>

Modified:
  stable/9/sys/kern/vfs_mountroot.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/vfs_mountroot.c
==============================================================================
--- stable/9/sys/kern/vfs_mountroot.c	Thu Sep 12 00:23:09 2013	(r255484)
+++ stable/9/sys/kern/vfs_mountroot.c	Thu Sep 12 00:46:32 2013	(r255485)
@@ -710,7 +710,7 @@ parse_mount(char **conf)
 	errmsg = malloc(ERRMSGL, M_TEMP, M_WAITOK | M_ZERO);
 
 	if (vfs_byname(fs) == NULL) {
-		strlcpy(errmsg, "unknown file system", sizeof(errmsg));
+		strlcpy(errmsg, "unknown file system", ERRMSGL);
 		error = ENOENT;
 		goto out;
 	}

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 00:53:39 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CE68CCE8;
 Thu, 12 Sep 2013 00:53:39 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id ADD38241D;
 Thu, 12 Sep 2013 00:53:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8C0rdNb082021;
 Thu, 12 Sep 2013 00:53:39 GMT
 (envelope-from bdrewery@svn.freebsd.org)
Received: (from bdrewery@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8C0rc7H082015;
 Thu, 12 Sep 2013 00:53:38 GMT
 (envelope-from bdrewery@svn.freebsd.org)
Message-Id: <201309120053.r8C0rc7H082015@svn.freebsd.org>
From: Bryan Drewery <bdrewery@FreeBSD.org>
Date: Thu, 12 Sep 2013 00:53:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255486 - in head/lib/libc: gen 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 00:53:39 -0000

Author: bdrewery (ports committer)
Date: Thu Sep 12 00:53:38 2013
New Revision: 255486
URL: http://svnweb.freebsd.org/changeset/base/255486

Log:
  Consistently reference file descriptors as "fd". 55 other manpages
  used "fd", while these used "d" and "filedes".
  
  MFC after:	1 week
  Approved by:	gjb
  Approved by:	re (delphij)

Modified:
  head/lib/libc/gen/lockf.3
  head/lib/libc/sys/close.2
  head/lib/libc/sys/ioctl.2
  head/lib/libc/sys/read.2
  head/lib/libc/sys/socketpair.2
  head/lib/libc/sys/write.2

Modified: head/lib/libc/gen/lockf.3
==============================================================================
--- head/lib/libc/gen/lockf.3	Thu Sep 12 00:46:32 2013	(r255485)
+++ head/lib/libc/gen/lockf.3	Thu Sep 12 00:53:38 2013	(r255486)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 19, 1997
+.Dd September 11, 2013
 .Dt LOCKF 3
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Sh SYNOPSIS
 .In unistd.h
 .Ft int
-.Fn lockf "int filedes" "int function" "off_t size"
+.Fn lockf "int fd" "int function" "off_t size"
 .Sh DESCRIPTION
 The
 .Fn lockf
@@ -52,7 +52,7 @@ either return an error value or block un
 All the locks for a process are removed when the process terminates.
 .Pp
 The argument
-.Fa filedes
+.Fa fd
 is an open file descriptor.
 The file descriptor must have been opened either for write-only
 .Dv ( O_WRONLY )
@@ -207,7 +207,7 @@ or
 and the section is already locked by another process.
 .It Bq Er EBADF
 The argument
-.Fa filedes
+.Fa fd
 is not a valid open file descriptor.
 .Pp
 The argument
@@ -217,7 +217,7 @@ is
 or
 .Dv F_TLOCK ,
 and
-.Fa filedes
+.Fa fd
 is not a valid file descriptor open for writing.
 .It Bq Er EDEADLK
 The argument
@@ -243,7 +243,7 @@ or
 .Dv F_TEST .
 .Pp
 The argument
-.Fa filedes
+.Fa fd
 refers to a file that does not support locking.
 .It Bq Er ENOLCK
 The argument

Modified: head/lib/libc/sys/close.2
==============================================================================
--- head/lib/libc/sys/close.2	Thu Sep 12 00:46:32 2013	(r255485)
+++ head/lib/libc/sys/close.2	Thu Sep 12 00:53:38 2013	(r255486)
@@ -28,7 +28,7 @@
 .\"     @(#)close.2	8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd January 22, 2012
+.Dd September 11, 2013
 .Dt CLOSE 2
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Sh SYNOPSIS
 .In unistd.h
 .Ft int
-.Fn close "int d"
+.Fn close "int fd"
 .Sh DESCRIPTION
 The
 .Fn close
@@ -107,7 +107,7 @@ system call will fail if:
 .Bl -tag -width Er
 .It Bq Er EBADF
 The
-.Fa d
+.Fa fd
 argument
 is not an active descriptor.
 .It Bq Er EINTR

Modified: head/lib/libc/sys/ioctl.2
==============================================================================
--- head/lib/libc/sys/ioctl.2	Thu Sep 12 00:46:32 2013	(r255485)
+++ head/lib/libc/sys/ioctl.2	Thu Sep 12 00:53:38 2013	(r255486)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 11, 2010
+.Dd September 11, 2013
 .Dt IOCTL 2
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Sh SYNOPSIS
 .In sys/ioctl.h
 .Ft int
-.Fn ioctl "int d" "unsigned long request" ...
+.Fn ioctl "int fd" "unsigned long request" ...
 .Sh DESCRIPTION
 The
 .Fn ioctl
@@ -51,7 +51,7 @@ may be controlled with
 .Fn ioctl
 requests.
 The argument
-.Fa d
+.Fa fd
 must be an open file descriptor.
 .Pp
 The third argument to
@@ -116,19 +116,19 @@ will fail if:
 .Bl -tag -width Er
 .It Bq Er EBADF
 The
-.Fa d
+.Fa fd
 argument
 is not a valid descriptor.
 .It Bq Er ENOTTY
 The
-.Fa d
+.Fa fd
 argument
 is not associated with a character
 special device.
 .It Bq Er ENOTTY
 The specified request does not apply to the kind
 of object that the descriptor
-.Fa d
+.Fa fd
 references.
 .It Bq Er EINVAL
 The

Modified: head/lib/libc/sys/read.2
==============================================================================
--- head/lib/libc/sys/read.2	Thu Sep 12 00:46:32 2013	(r255485)
+++ head/lib/libc/sys/read.2	Thu Sep 12 00:53:38 2013	(r255486)
@@ -28,7 +28,7 @@
 .\"     @(#)read.2	8.4 (Berkeley) 2/26/94
 .\" $FreeBSD$
 .\"
-.Dd January 22, 2012
+.Dd September 11, 2013
 .Dt READ 2
 .Os
 .Sh NAME
@@ -43,14 +43,14 @@
 .In sys/types.h
 .In unistd.h
 .Ft ssize_t
-.Fn read "int d" "void *buf" "size_t nbytes"
+.Fn read "int fd" "void *buf" "size_t nbytes"
 .Ft ssize_t
-.Fn pread "int d" "void *buf" "size_t nbytes" "off_t offset"
+.Fn pread "int fd" "void *buf" "size_t nbytes" "off_t offset"
 .In sys/uio.h
 .Ft ssize_t
-.Fn readv "int d" "const struct iovec *iov" "int iovcnt"
+.Fn readv "int fd" "const struct iovec *iov" "int iovcnt"
 .Ft ssize_t
-.Fn preadv "int d" "const struct iovec *iov" "int iovcnt" "off_t offset"
+.Fn preadv "int fd" "const struct iovec *iov" "int iovcnt" "off_t offset"
 .Sh DESCRIPTION
 The
 .Fn read
@@ -58,7 +58,7 @@ system call
 attempts to read
 .Fa nbytes
 of data from the object referenced by the descriptor
-.Fa d
+.Fa fd
 into the buffer pointed to by
 .Fa buf .
 The
@@ -107,7 +107,7 @@ On objects capable of seeking, the
 .Fn read
 starts at a position
 given by the pointer associated with
-.Fa d
+.Fa fd
 (see
 .Xr lseek 2 ) .
 Upon return from
@@ -149,12 +149,12 @@ will succeed unless:
 .Bl -tag -width Er
 .It Bq Er EBADF
 The
-.Fa d
+.Fa fd
 argument
 is not a valid file or socket descriptor open for reading.
 .It Bq Er ECONNRESET
 The
-.Fa d
+.Fa fd
 argument refers to a socket, and the remote socket end is
 forcibly closed.
 .It Bq Er EFAULT
@@ -173,7 +173,7 @@ was interrupted by the delivery of a sig
 before any data arrived.
 .It Bq Er EINVAL
 The pointer associated with
-.Fa d
+.Fa fd
 was negative.
 .It Bq Er EAGAIN
 The file was marked for non-blocking I/O,

Modified: head/lib/libc/sys/socketpair.2
==============================================================================
--- head/lib/libc/sys/socketpair.2	Thu Sep 12 00:46:32 2013	(r255485)
+++ head/lib/libc/sys/socketpair.2	Thu Sep 12 00:53:38 2013	(r255486)
@@ -28,7 +28,7 @@
 .\"     @(#)socketpair.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd March 19, 2013
+.Dd September 11, 2013
 .Dt SOCKETPAIR 2
 .Os
 .Sh NAME
@@ -40,13 +40,13 @@
 .In sys/types.h
 .In sys/socket.h
 .Ft int
-.Fn socketpair "int d" "int type" "int protocol" "int *sv"
+.Fn socketpair "int fd" "int type" "int protocol" "int *sv"
 .Sh DESCRIPTION
 The
 .Fn socketpair
 system call creates an unnamed pair of connected sockets in
 the specified domain
-.Fa d ,
+.Fa fd ,
 of the specified
 .Fa type ,
 and using the optionally specified

Modified: head/lib/libc/sys/write.2
==============================================================================
--- head/lib/libc/sys/write.2	Thu Sep 12 00:46:32 2013	(r255485)
+++ head/lib/libc/sys/write.2	Thu Sep 12 00:53:38 2013	(r255486)
@@ -28,7 +28,7 @@
 .\"     @(#)write.2	8.5 (Berkeley) 4/2/94
 .\" $FreeBSD$
 .\"
-.Dd January 22, 2012
+.Dd September 11, 2013
 .Dt WRITE 2
 .Os
 .Sh NAME
@@ -43,14 +43,14 @@
 .In sys/types.h
 .In unistd.h
 .Ft ssize_t
-.Fn write "int d" "const void *buf" "size_t nbytes"
+.Fn write "int fd" "const void *buf" "size_t nbytes"
 .Ft ssize_t
-.Fn pwrite "int d" "const void *buf" "size_t nbytes" "off_t offset"
+.Fn pwrite "int fd" "const void *buf" "size_t nbytes" "off_t offset"
 .In sys/uio.h
 .Ft ssize_t
-.Fn writev "int d" "const struct iovec *iov" "int iovcnt"
+.Fn writev "int fd" "const struct iovec *iov" "int iovcnt"
 .Ft ssize_t
-.Fn pwritev "int d" "const struct iovec *iov" "int iovcnt" "off_t offset"
+.Fn pwritev "int fd" "const struct iovec *iov" "int iovcnt" "off_t offset"
 .Sh DESCRIPTION
 The
 .Fn write
@@ -58,7 +58,7 @@ system call
 attempts to write
 .Fa nbytes
 of data to the object referenced by the descriptor
-.Fa d
+.Fa fd
 from the buffer pointed to by
 .Fa buf .
 The
@@ -107,7 +107,7 @@ On objects capable of seeking, the
 .Fn write
 starts at a position
 given by the pointer associated with
-.Fa d ,
+.Fa fd ,
 see
 .Xr lseek 2 .
 Upon return from
@@ -154,7 +154,7 @@ will fail and the file pointer will rema
 .Bl -tag -width Er
 .It Bq Er EBADF
 The
-.Fa d
+.Fa fd
 argument
 is not a valid descriptor open for writing.
 .It Bq Er EPIPE
@@ -174,7 +174,7 @@ or data to be written to the file
 points outside the process's allocated address space.
 .It Bq Er EINVAL
 The pointer associated with
-.Fa d
+.Fa fd
 was negative.
 .It Bq Er ENOSPC
 There is no free space remaining on the file system

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 02:31:32 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BADE4F93;
 Thu, 12 Sep 2013 02:31:32 +0000 (UTC)
 (envelope-from hiren@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A95CC27F0;
 Thu, 12 Sep 2013 02:31:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8C2VWMa041901;
 Thu, 12 Sep 2013 02:31:32 GMT (envelope-from hiren@svn.freebsd.org)
Received: (from hiren@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8C2VW8s041900;
 Thu, 12 Sep 2013 02:31:32 GMT (envelope-from hiren@svn.freebsd.org)
Message-Id: <201309120231.r8C2VW8s041900@svn.freebsd.org>
From: Hiren Panchasara <hiren@FreeBSD.org>
Date: Thu, 12 Sep 2013 02:31:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255487 - head/tools/tools/net80211/wlanstats
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 02:31:32 -0000

Author: hiren
Date: Thu Sep 12 02:31:32 2013
New Revision: 255487
URL: http://svnweb.freebsd.org/changeset/base/255487

Log:
  We are exceeding default limit (256) of bracket nesting and clang does not like
  it. We should probably fix the code but appeasing clang with this fix for now.
  gcc does not have such limit.
  
  Reviewed by:	jmg
  Approved by:	re (hrs), sbruno (mentor, implicit)

Modified:
  head/tools/tools/net80211/wlanstats/Makefile

Modified: head/tools/tools/net80211/wlanstats/Makefile
==============================================================================
--- head/tools/tools/net80211/wlanstats/Makefile	Thu Sep 12 00:53:38 2013	(r255486)
+++ head/tools/tools/net80211/wlanstats/Makefile	Thu Sep 12 02:31:32 2013	(r255487)
@@ -1,9 +1,14 @@
 # $FreeBSD$
 
+.include <bsd.compiler.mk>
+
 PROG=	wlanstats
 BINDIR=	/usr/local/bin
 NO_MAN=
 
 SRCS=	statfoo.c wlanstats.c main.c
+.if ${COMPILER_TYPE} == "clang"
+CFLAGS+= -fbracket-depth=512
+.endif
 
 .include <bsd.prog.mk>

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 06:03:54 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 9159AAC4;
 Thu, 12 Sep 2013 06:03:54 +0000 (UTC)
 (envelope-from baptiste.daroussin@gmail.com)
Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com
 [IPv6:2a00:1450:400c:c03::22a])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8ACB022B6;
 Thu, 12 Sep 2013 06:03:53 +0000 (UTC)
Received: by mail-we0-f170.google.com with SMTP id w62so7824810wes.15
 for <multiple recipients>; Wed, 11 Sep 2013 23:03:52 -0700 (PDT)
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=k0cibDRmsVkp+5yWebgEas4TzoAS6k/opmvZiM5ht+E=;
 b=R1zkRhGsdxZKDIzv7V8dKV/f04H49zUwR7yr/YutcSw1sGYeeVcfM8dL7BcBNz4CTh
 R/RDBs0gnDIp+m7AdTXMoZ8Xtv+ouW/CUv3ukPWCORNricgX/W56BLPC8rlR1iosnKp1
 WEd6rwryT0CMmyDVxvM8ErAiqcDUngxqiid0xv6Bof5VZ8tUHCri6vjrQwlDEj9oVXQA
 nly4df1eqUYg+zsJ8DA/RC2K9hhbVdRCnutZwDcdWfA37zDJpNFM6AH9cdTmsQNhgMH7
 TRSuT1JdMbTe5E685OTOrBSEEXg9aPQT0GVtu3Z1CwVCd3dbKZ2ehL9Q4utBMmF3N13d
 dkLw==
X-Received: by 10.180.21.170 with SMTP id w10mr3233941wie.62.1378965832080;
 Wed, 11 Sep 2013 23:03:52 -0700 (PDT)
Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188])
 by mx.google.com with ESMTPSA id gp9sm15044698wib.8.1969.12.31.16.00.00
 (version=TLSv1 cipher=RC4-SHA bits=128/128);
 Wed, 11 Sep 2013 23:03:51 -0700 (PDT)
Sender: Baptiste Daroussin <baptiste.daroussin@gmail.com>
Date: Thu, 12 Sep 2013 08:03:49 +0200
From: Baptiste Daroussin <bapt@freebsd.org>
To: John Baldwin <jhb@freebsd.org>
Subject: Re: svn commit: r255457 - head/usr.sbin/pkg
Message-ID: <20130912060348.GB33103@ithaqua.etoilebsd.net>
References: <201309102056.r8AKu1rQ000442@svn.freebsd.org>
 <522FE3A2.2090405@freebsd.org>
 <20130911054907.GK40186@ithaqua.etoilebsd.net>
 <201309110956.11782.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM"
Content-Disposition: inline
In-Reply-To: <201309110956.11782.jhb@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, Nathan Whitehorn <nwhitehorn@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 06:03:54 -0000


--ZfOjI3PrQbgiZnxM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 11, 2013 at 09:56:11AM -0400, John Baldwin wrote:
> On Wednesday, September 11, 2013 1:49:07 am Baptiste Daroussin wrote:
> > On Tue, Sep 10, 2013 at 10:29:38PM -0500, Nathan Whitehorn wrote:
> > > On 09/10/13 15:56, Baptiste Daroussin wrote:
> > > > Author: bapt
> > > > Date: Tue Sep 10 20:56:01 2013
> > > > New Revision: 255457
> > > > URL: http://svnweb.freebsd.org/changeset/base/255457
> > > >
> > > > Log:
> > > >    Add support to detect arm vs armv6
> > > >   =20
> > > >    There are two different versions of the ARM ABI depending on the
> > > >    TARGET_ARCH. As these are sligntly different a package built for
> > > >    one may not work on another. We need to detect which one we are =
on
> > > >    by parsing the .ARM.attributes section.
> > > >   =20
> > > >    This will only work on the ARM EABI as this section is part of t=
he
> > > >    ABI definition. As armv6 only supports the ARM EABI this is not a
> > > >    problem for the oabi.
> > > >   =20
> > > >    Older versions of libelf in FreeBSD fail to read the
> > > >    .ARM.attributes section needed. As armv6 is unsupported on these
> > > >    versions we can assume we are running on arm.
> > > >   =20
> > >=20
> > > Picking a random commit: I don't suppose we can just use MACHINE_ARCH=
=20
> > > for these identifiers? It encapsulates everything needed for compatib=
ility.
> > > -Nathan
> >=20
> > Yes we probably can, it encapsulates everything since recently! It wasn=
't the
> > case when ABI string was defined, and it lacks an important part of why=
 the ABI
> > string has been designed on pkgng: making a package match multiple arch=
 via
> > simple glob on the ABI line.
> >=20
> > So as I already said to Warner, Yes now that it properly works on all a=
rches we
> > could use it but that is not that easy.
> >=20
> > People wanting to go that way should:
> > 1. provide a way for pkgng to extract MARCHE_ARCH out of a binary (/bin=
/ls)
> > (dynamic cross installation ABI detection)
> > 2. provide a way to create multiarch ABI out of MACHINE_ARCH
> > 3. provide an upgrade path with compatibility for the current string (p=
kgng is
> > already largely deployed)
> > 4. have time to do it
> >=20
> > There is so much work pending on pkgng, in particular for 10.0 that I j=
ust have
> > no time to work on it.
>=20
> We actually had a thread about this on arch@ a while back where I think w=
e did
> largely satisfy your concerns.  However, one of the open items is to conv=
ert
> amd64, i386, and pc98 to set MACHINE_CPUARCH to x86 instead of amd64/i386=
 (this
> would clean up several other things as well).  I do think it would be hel=
pful
> if pkgng used arch strings that were consistent with MACHINE_ARCH so that=
 the
> transition is easier (e.g. x86:i386 and x86:amd64 instead of x86:32 and
> x86:64).
>=20

I had followed the discussion but I have missed the commit reflecting that.=
 So I
wasn't aware this has been done. I will have a look to integrate it and use=
 it
in pkgng, won't be for 10.0  packages, but I'll make it for 11.* packages a=
nd
probably 10.1.

regards,
Bapt

--ZfOjI3PrQbgiZnxM
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlIxWUQACgkQ8kTtMUmk6ExIgACgnseQ6YPXEhzxbiO7sBpo2LUG
BycAnid5l0grpFJjSPkIMGN/uZLxjx0C
=hNf3
-----END PGP SIGNATURE-----

--ZfOjI3PrQbgiZnxM--

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 10:39:39 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 5CE1FE67;
 Thu, 12 Sep 2013 10:39:39 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4970F2768;
 Thu, 12 Sep 2013 10:39:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CAddvb035584;
 Thu, 12 Sep 2013 10:39:39 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CAddtR035583;
 Thu, 12 Sep 2013 10:39:39 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201309121039.r8CAddtR035583@svn.freebsd.org>
From: Hans Petter Selasky <hselasky@FreeBSD.org>
Date: Thu, 12 Sep 2013 10:39:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255488 - head/sys/dev/usb
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 10:39:39 -0000

Author: hselasky
Date: Thu Sep 12 10:39:38 2013
New Revision: 255488
URL: http://svnweb.freebsd.org/changeset/base/255488

Log:
  Don't issue USB resume signalling in USB device mode, if the USB power
  mode is ON and suspend is detected. This confuses iPads running in USB
  host mode at least.
  
  MFC after:	1 week
  Approved by:	re (hrs)

Modified:
  head/sys/dev/usb/usb_hub.c

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c	Thu Sep 12 02:31:32 2013	(r255487)
+++ head/sys/dev/usb/usb_hub.c	Thu Sep 12 10:39:38 2013	(r255488)
@@ -2083,7 +2083,8 @@ usbd_transfer_power_ref(struct usb_xfer 
 static uint8_t
 usb_peer_should_wakeup(struct usb_device *udev)
 {
-	return ((udev->power_mode == USB_POWER_MODE_ON) ||
+	return (((udev->power_mode == USB_POWER_MODE_ON) &&
+	    (udev->flags.usb_mode == USB_MODE_HOST)) ||
 	    (udev->driver_added_refcount != udev->bus->driver_added_refcount) ||
 	    (udev->re_enumerate_wait != 0) ||
 	    (udev->pwr_save.type_refs[UE_ISOCHRONOUS] != 0) ||

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 11:37:23 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CD6FA7FF;
 Thu, 12 Sep 2013 11:37:23 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from mail.allbsd.org (gatekeeper.allbsd.org
 [IPv6:2001:2f0:104:e001::32])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4FF712B4D;
 Thu, 12 Sep 2013 11:37:23 +0000 (UTC)
Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp
 [122.26.101.49]) (authenticated bits=128)
 by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r8CBb4x7000248
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Thu, 12 Sep 2013 20:37:14 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0)
 by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r8CBb3F4097196;
 Thu, 12 Sep 2013 20:37:03 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Date: Thu, 12 Sep 2013 20:36:12 +0900 (JST)
Message-Id: <20130912.203612.1272738297998644471.hrs@allbsd.org>
To: bdrewery@FreeBSD.org
Subject: Re: svn commit: r255486 - in head/lib/libc: gen sys
From: Hiroki Sato <hrs@FreeBSD.org>
In-Reply-To: <201309120053.r8C0rc7H082015@svn.freebsd.org>
References: <201309120053.r8C0rc7H082015@svn.freebsd.org>
X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530  FFD7 4F2C D3D8 2793 CF2D
X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Multipart/Signed; protocol="application/pgp-signature";
 micalg=pgp-sha1;
 boundary="--Security_Multipart(Thu_Sep_12_20_36_12_2013_431)--"
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org
X-Virus-Status: Clean
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (mail.allbsd.org [133.31.130.32]); Thu, 12 Sep 2013 20:37:14 +0900 (JST)
X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT,
 DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no
 version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
 gatekeeper.allbsd.org
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 11:37:23 -0000

----Security_Multipart(Thu_Sep_12_20_36_12_2013_431)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Bryan Drewery <bdrewery@FreeBSD.org> wrote
  in <201309120053.r8C0rc7H082015@svn.freebsd.org>:

bd> Author: bdrewery (ports committer)
bd> Date: Thu Sep 12 00:53:38 2013
bd> New Revision: 255486
bd> URL: http://svnweb.freebsd.org/changeset/base/255486
bd>
bd> Log:
bd>   Consistently reference file descriptors as "fd". 55 other manpages
bd>   used "fd", while these used "d" and "filedes".
bd>
bd>   MFC after:	1 week
bd>   Approved by:	gjb
bd>   Approved by:	re (delphij)

 I think this kind of changes need a consensus because several POSIX
 functions use "filedes" in the specification document.  r254484 by
 pjd was a similar change (s/type/af/ in gethostbyaddr()).

 In SUSv4, fdopen() uses "filedes" and openat() uses "fd", for
 example.  Consistency throughout our manual pages is generally good.
 However, I also see the benefit of using the same expression as the
 specification even if it is inconsistent.  What do you think?

-- Hiroki

----Security_Multipart(Thu_Sep_12_20_36_12_2013_431)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (FreeBSD)

iEYEABECAAYFAlIxpywACgkQTyzT2CeTzy3M/wCcDMf3Q3x27Y5ZHUc++g1Q6NWf
6QUAn0Arm8IrFqddfCVW10I0R6WXoJaw
=7nWS
-----END PGP SIGNATURE-----

----Security_Multipart(Thu_Sep_12_20_36_12_2013_431)----

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 11:41:28 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 4F0D5AE4
 for <svn-src-all@FreeBSD.org>; Thu, 12 Sep 2013 11:41:28 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
 [IPv6:2001:1900:2254:206c::16:87])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 148762BA2
 for <svn-src-all@FreeBSD.org>; Thu, 12 Sep 2013 11:41:28 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
 by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CBfR8D057989
 for <svn-src-all@FreeBSD.org>; Thu, 12 Sep 2013 11:41:27 GMT
 (envelope-from bdrewery@freefall.freebsd.org)
Received: (from bdrewery@localhost)
 by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r8CBfRIu057984
 for svn-src-all@FreeBSD.org; Thu, 12 Sep 2013 11:41:27 GMT
 (envelope-from bdrewery)
Received: (qmail 85428 invoked from network); 12 Sep 2013 06:41:26 -0500
Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24)
 by sweb.xzibition.com with ESMTPA; 12 Sep 2013 06:41:26 -0500
Message-ID: <5231A85E.5050802@FreeBSD.org>
Date: Thu, 12 Sep 2013 06:41:18 -0500
From: Bryan Drewery <bdrewery@FreeBSD.org>
Organization: FreeBSD
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
 rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: Hiroki Sato <hrs@FreeBSD.org>
Subject: Re: svn commit: r255486 - in head/lib/libc: gen sys
References: <201309120053.r8C0rc7H082015@svn.freebsd.org>
 <20130912.203612.1272738297998644471.hrs@allbsd.org>
In-Reply-To: <20130912.203612.1272738297998644471.hrs@allbsd.org>
X-Enigmail-Version: 1.5.2
OpenPGP: id=3C9B0CF9;
	url=http://www.shatow.net/bryan/bryan.asc
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="pFAQXViDLLbN0OcEm32lMLaOSwXQrneB2"
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 11:41:28 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--pFAQXViDLLbN0OcEm32lMLaOSwXQrneB2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 9/12/2013 6:36 AM, Hiroki Sato wrote:
> Bryan Drewery <bdrewery@FreeBSD.org> wrote
>   in <201309120053.r8C0rc7H082015@svn.freebsd.org>:
>=20
> bd> Author: bdrewery (ports committer)
> bd> Date: Thu Sep 12 00:53:38 2013
> bd> New Revision: 255486
> bd> URL: http://svnweb.freebsd.org/changeset/base/255486
> bd>
> bd> Log:
> bd>   Consistently reference file descriptors as "fd". 55 other manpage=
s
> bd>   used "fd", while these used "d" and "filedes".
> bd>
> bd>   MFC after:	1 week
> bd>   Approved by:	gjb
> bd>   Approved by:	re (delphij)
>=20
>  I think this kind of changes need a consensus because several POSIX
>  functions use "filedes" in the specification document.  r254484 by
>  pjd was a similar change (s/type/af/ in gethostbyaddr()).
>=20
>  In SUSv4, fdopen() uses "filedes" and openat() uses "fd", for
>  example.  Consistency throughout our manual pages is generally good.
>  However, I also see the benefit of using the same expression as the
>  specification even if it is inconsistent.  What do you think?
>=20
> -- Hiroki
>=20

I did notice that 'filedes' was referenced in some specs, but it's very
weird to open multiple manpages and expect 'fd' and find 'd' and rework
my brain to understand that 'd' or 'filedes' is just a 'fd'. Takes a
second of thinking.

It was "surprising" to me when I noticed it, especially given how many
used 'fd'.

--=20
Regards,
Bryan Drewery


--pFAQXViDLLbN0OcEm32lMLaOSwXQrneB2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSMaheAAoJEG54KsA8mwz5UBIP/3YpaLiXokF1ulw0e8ABT32A
RQ5tCf7Shr9R+ZkswKI7w+oIYM1tIX7p9N1/YWz6iUQdc+45WKzYIyFuB9GS2IJO
x3AmKaBVL2BXjthAFaSDPzEi1PZVzJn6Xnzy2VfyUFVT/eaHtPLVuIyqB08hhhP3
zrSXc+BtVXFFBAplA8+pBzzFrywOX+B2XFldp7z6WTCV029gP0YTqgIfs/eQlIRR
ZhSLi+iYDKkdAEyZAmrE8k2z2uCsRDCQdpBaIp+ir7XvME4LWI1T/GZvDkLU+uyP
U9k2H7DNAvCAEwnOBOFTk08gNZpZS0fhMO5jfsYqFh8K7/8oXP8jIMh8lujKKCK2
3x0phkCKlHjYonPBo6N/JIbukwZnQse6JYe2FTaC8CH2iz6kVfYN2wUL66VdtI5W
dPv3YQne4ZaZmtARypPQi64bmtQJqKh0Cq1R/Q0oyVSi1ujlpc5NH9qQd1ZP7vYu
er6pwFq68JspZbr7zgAIwsPWuS+gy+4mBexhsC8ikKAA6zyvnTtjNo67rFGHYTu/
NMrvpOi3HuzIPLlxhfkURHYg5N6eehG7WjR8ttmidGICuCt5H/DJuLtATObOPaz1
tW1dP8u5VU1wkf2k9ODnQEl2BHdSzkJxPPL49d8j4zSKU91DAcMyMI1ILsoAkoAq
kR84tNiVEXicRZxBnAie
=IEXp
-----END PGP SIGNATURE-----

--pFAQXViDLLbN0OcEm32lMLaOSwXQrneB2--

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 13:16:07 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 186557B6;
 Thu, 12 Sep 2013 13:16:07 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au
 [211.29.132.249])
 by mx1.freebsd.org (Postfix) with ESMTP id 6CF1E2216;
 Thu, 12 Sep 2013 13:16:06 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 6E32D104116F;
 Thu, 12 Sep 2013 23:15:42 +1000 (EST)
Date: Thu, 12 Sep 2013 23:15:41 +1000 (EST)
From: Bruce Evans <brde@optusnet.com.au>
X-X-Sender: bde@besplex.bde.org
To: Bryan Drewery <bdrewery@freebsd.org>
Subject: Re: svn commit: r255486 - in head/lib/libc: gen sys
In-Reply-To: <5231A85E.5050802@FreeBSD.org>
Message-ID: <20130912222312.K1155@besplex.bde.org>
References: <201309120053.r8C0rc7H082015@svn.freebsd.org>
 <20130912.203612.1272738297998644471.hrs@allbsd.org>
 <5231A85E.5050802@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.1 cv=DstvpgP+ c=1 sm=1 tr=0
 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=9LJJTqj_-eAA:10
 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=EEHEvLDpRZ4A:10 a=6I5d2MoRAAAA:8
 a=y5nq32_YDeEx1DahF4sA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Hiroki Sato <hrs@freebsd.org>, src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 13:16:07 -0000

On Thu, 12 Sep 2013, Bryan Drewery wrote:

> On 9/12/2013 6:36 AM, Hiroki Sato wrote:
>> Bryan Drewery <bdrewery@FreeBSD.org> wrote
>>   in <201309120053.r8C0rc7H082015@svn.freebsd.org>:
>>
>> bd> Author: bdrewery (ports committer)
>> bd> Date: Thu Sep 12 00:53:38 2013
>> bd> New Revision: 255486
>> bd> URL: http://svnweb.freebsd.org/changeset/base/255486
>> bd>
>> bd> Log:
>> bd>   Consistently reference file descriptors as "fd". 55 other manpages

Inconsistently...

>> bd>   used "fd", while these used "d" and "filedes".

... About 57 man pages (counting links multiply) in /usr/share/man[23]
still use the POSIX spelling "fildes".

POSIX never uses the spelling "filedes", at least in the old 2001
draft7.txt.  But it is inconsistent between "fildes" and "fd".  In the
old draft, it uses "int fildes" on 67 lines (including for most of the
functions changed in this commit).  It uses "int fd" on 40 lines.  But
most of the latter are not for prototypes.  The only exceptions are
for posix_fadvise() and posix_fallocate().

Anyway, this change mainly improves "d" to "fd".  "filedes" -> "fd" is not
so clearly an improvement, but "filedes" was only used in a couple of
files and thus rarely changed.

I think chroot.2 still has the grammar error "filedescriptors" in
descriptions.  Normal English grammar "file descriptors" is used in
about 872 man pages (counting links multiply) in /usr/share/man[23].

>> bd>
>> bd>   MFC after:	1 week
>> bd>   Approved by:	gjb
>> bd>   Approved by:	re (delphij)
>>
>>  I think this kind of changes need a consensus because several POSIX
>>  functions use "filedes" in the specification document.  r254484 by
>>  pjd was a similar change (s/type/af/ in gethostbyaddr()).
>>
>>  In SUSv4, fdopen() uses "filedes" and openat() uses "fd", for
>>  example.  Consistency throughout our manual pages is generally good.
>>  However, I also see the benefit of using the same expression as the
>>  specification even if it is inconsistent.  What do you think?

Does it really use "filedes"?  POSIX still never uses this in the 2007
draft (austin-d2r.pdf).  It uses "fildes" for fdopen(), but "fd" for
fdopendir() and openat().  It still uses "fd" for posix_fadvise() and
posix_fallocate().  I now think that the "fd"s in POSIX are just
style bugs.  The normal "fildes" had only rotted to "fd" in 2 places
in 2001, but rotted much further in 2007.

If we ever copied the POSIX spec to improve FreeBSD man pages, then
it would be painful to make any changes to the text (other than
deshallify, and I wouldn't trust that either).  FreeBSD now copies the
POSIX inconsistencies for "fildes" vs "fd" for at least fdopen() and
fdopendir(), although it doesn't copy whole sections of POSIX for these
functions (or any at all?).

> I did notice that 'filedes' was referenced in some specs, but it's very
> weird to open multiple manpages and expect 'fd' and find 'd' and rework
> my brain to understand that 'd' or 'filedes' is just a 'fd'. Takes a
> second of thinking.
>
> It was "surprising" to me when I noticed it, especially given how many
> used 'fd'.

"fd" is a good abbreviation, but "fildes" is more formal.  I actually
prefer "fd" throughout.  "fildes" is not such a good abbreviation, since
it is half-way.  Using both is just a style bug that is not quite as
confusing as using "d" and "fd".  Using "d", "fd", "fildes" and "filedes"
was a larger style bug.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 15:59:59 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 2A3074AD;
 Thu, 12 Sep 2013 15:59:59 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id EF3FC2CAA;
 Thu, 12 Sep 2013 15:59:58 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 08708B958;
 Thu, 12 Sep 2013 11:59:58 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: Davide Italiano <davide@freebsd.org>
Subject: Re: svn commit: r254703 - in head: share/man/man9 sys/sys
Date: Thu, 12 Sep 2013 10:08:00 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201308231412.r7NECdG7081565@svn.freebsd.org>
 <201308261502.13277.jhb@freebsd.org>
 <CACYV=-FiOyVsjbnPA5qLXK2OvN_Y9AgWpqOyYzEuJ7a2o8dp1g@mail.gmail.com>
In-Reply-To: <CACYV=-FiOyVsjbnPA5qLXK2OvN_Y9AgWpqOyYzEuJ7a2o8dp1g@mail.gmail.com>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201309121008.01115.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Thu, 12 Sep 2013 11:59:58 -0400 (EDT)
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 15:59:59 -0000

On Wednesday, September 11, 2013 2:10:11 pm Davide Italiano wrote:
> [snip]
> 
> > Well, I've thought about changing lc_lock/unlock to return a uintptr_t or
> > void * instead of an int and then I could make rm_sleep work fine.  
However,
> > that still doesn't solve the callout case.  The callout case can't be 
fixed
> > easily without explicitly allocating storage in the softclock thread 
itself.
> >
> > Also, I don't think you want a pointer in a lock_object.  Imagine if two
> > threads both locked and then slept on the same rm lock in succession while
> > waiting for a wakeup.  You would have two trackers to keep track of, but 
only
> > one pointer in the lock_object.
> >
> > I'm not sure you need to revert your commit.  It should pretty much panic
> > instantly if someone tries to use it with a read lock instead of a write
> > lock, even without INVARIANTS.
> >
> > --
> > John Baldwin
> 
> Hi John,
> I've finally gotten around to dedicate some time to this.
> The following patch :
> http://people.freebsd.org/~davide/review/callout_sharedrm.diff is a
> proposed fix the problem for the callout_rm shared case, based on your
> suggestions.
> I've overloaded the lc_lock/lc_unlock functions so that they take an
> additional void *arg argument which in the callout rm shared case is a
> pointer to priotracker structure (I used a void * so that it could be
> used for some other purposes in the future, if any).
> I've also added a MPASS in the lc_lock()/lc_unlock() functions for all
> the primitives but rmlock so that is ensured that arg passed is NULL.
> I'm not completely sure this is required but I put that there as
> safety belt.
> The KPI is highly disturbed by this change, but unfortunately I wasn't
> able to find out a way to workaround the problem without this
> breakage. While we're breaking things, I guess we can fix the
> rm_sleep() case as well instead of causing a double breakage.
> My only doubt is what exactly we should return from lc_unlock/lc_lock,
> as long as in the, e.g. rwlock case we need to return a boolean that
> contains lock state (shared/exclusive) whilst in the rmlock case we
> need to return both the lock state and a pointer to struct
> rm_priotracker. My best guess is that of introducing a 'struct
> lockstate' (sorry for the poor name choice, just to give you the idea)
> which contains these two informations, but probably we can
> alternatively use a single pointer and store the information about
> lock state in the low order bits.
> What's your opinion about?

Hmm, I think I had envisioned something a bit simpler.  Namely, I would
change lc_lock/lc_unlock to return a uintptr_t instead of an int, and
I would then change lc_unlock for an rm lock to return a pointer to the
current thread's tracker as the 'how' and 0 for a write lock.  Note
that you have to use the existing tracker to make this work correctly
for the sleep case where you unlock/lock.

For the callout case I figured you would just hack it explicitly like
this:

	if (flags & CALLOUT_SHAREDRM)
		rm_rlock(...)
	else
		lock->lc_lock();

However, if you make my suggested change to make the 'how' a uintptr_t
that passes the tracker you can actually do this in the callout case:

	struct rm_priotracker tracker;
	uintptr_t how;

	how = 0;
	if (flags & CALLOUT_SHAREDLOCK)
		how = 1;
	else if (flags & CALLOUT_SHAREDRM)
		how = (uintptr_t)&tracker;
	...

	class->lc_lock(lock, how);

Now, it would be even nicer to make prevent footshooting perhaps by
checking the lock class directly:

	how = 0;
	if (flags & CALLOUT_SHAREDLOCK) {
		if (class == &lock_class_rm || class == &lock_class_rm_sleepable)
			how = (uintptr_t)&tracker;
		else
			how = 1;
	}

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 15:59:59 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B145F4AF;
 Thu, 12 Sep 2013 15:59:59 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 812B82CAB;
 Thu, 12 Sep 2013 15:59:59 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7F2F8B962;
 Thu, 12 Sep 2013 11:59:58 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: Baptiste Daroussin <bapt@freebsd.org>
Subject: Re: svn commit: r255457 - head/usr.sbin/pkg
Date: Thu, 12 Sep 2013 10:09:05 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201309102056.r8AKu1rQ000442@svn.freebsd.org>
 <201309110956.11782.jhb@freebsd.org>
 <20130912060348.GB33103@ithaqua.etoilebsd.net>
In-Reply-To: <20130912060348.GB33103@ithaqua.etoilebsd.net>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Message-Id: <201309121009.05749.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Thu, 12 Sep 2013 11:59:58 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Nathan Whitehorn <nwhitehorn@freebsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 15:59:59 -0000

On Thursday, September 12, 2013 2:03:49 am Baptiste Daroussin wrote:
> On Wed, Sep 11, 2013 at 09:56:11AM -0400, John Baldwin wrote:
> > On Wednesday, September 11, 2013 1:49:07 am Baptiste Daroussin wrote:
> > > On Tue, Sep 10, 2013 at 10:29:38PM -0500, Nathan Whitehorn wrote:
> > > > On 09/10/13 15:56, Baptiste Daroussin wrote:
> > > > > Author: bapt
> > > > > Date: Tue Sep 10 20:56:01 2013
> > > > > New Revision: 255457
> > > > > URL: http://svnweb.freebsd.org/changeset/base/255457
> > > > >
> > > > > Log:
> > > > >    Add support to detect arm vs armv6
> > > > >    
> > > > >    There are two different versions of the ARM ABI depending on the
> > > > >    TARGET_ARCH. As these are sligntly different a package built for
> > > > >    one may not work on another. We need to detect which one we are on
> > > > >    by parsing the .ARM.attributes section.
> > > > >    
> > > > >    This will only work on the ARM EABI as this section is part of the
> > > > >    ABI definition. As armv6 only supports the ARM EABI this is not a
> > > > >    problem for the oabi.
> > > > >    
> > > > >    Older versions of libelf in FreeBSD fail to read the
> > > > >    .ARM.attributes section needed. As armv6 is unsupported on these
> > > > >    versions we can assume we are running on arm.
> > > > >    
> > > > 
> > > > Picking a random commit: I don't suppose we can just use MACHINE_ARCH 
> > > > for these identifiers? It encapsulates everything needed for compatibility.
> > > > -Nathan
> > > 
> > > Yes we probably can, it encapsulates everything since recently! It wasn't the
> > > case when ABI string was defined, and it lacks an important part of why the ABI
> > > string has been designed on pkgng: making a package match multiple arch via
> > > simple glob on the ABI line.
> > > 
> > > So as I already said to Warner, Yes now that it properly works on all arches we
> > > could use it but that is not that easy.
> > > 
> > > People wanting to go that way should:
> > > 1. provide a way for pkgng to extract MARCHE_ARCH out of a binary (/bin/ls)
> > > (dynamic cross installation ABI detection)
> > > 2. provide a way to create multiarch ABI out of MACHINE_ARCH
> > > 3. provide an upgrade path with compatibility for the current string (pkgng is
> > > already largely deployed)
> > > 4. have time to do it
> > > 
> > > There is so much work pending on pkgng, in particular for 10.0 that I just have
> > > no time to work on it.
> > 
> > We actually had a thread about this on arch@ a while back where I think we did
> > largely satisfy your concerns.  However, one of the open items is to convert
> > amd64, i386, and pc98 to set MACHINE_CPUARCH to x86 instead of amd64/i386 (this
> > would clean up several other things as well).  I do think it would be helpful
> > if pkgng used arch strings that were consistent with MACHINE_ARCH so that the
> > transition is easier (e.g. x86:i386 and x86:amd64 instead of x86:32 and
> > x86:64).
> > 
> 
> I had followed the discussion but I have missed the commit reflecting that. So I
> wasn't aware this has been done. I will have a look to integrate it and use it
> in pkgng, won't be for 10.0  packages, but I'll make it for 11.* packages and
> probably 10.1.

It is an open item, meaning not done yet. :(  I think you would have to special case
amd64/i386/pc98 for now as a hack knowing you can eventually remove it.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 17:51:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 76613E42;
 Thu, 12 Sep 2013 17:51:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 62C85246B;
 Thu, 12 Sep 2013 17:51:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CHpJmE097440;
 Thu, 12 Sep 2013 17:51:19 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CHpJPr097433;
 Thu, 12 Sep 2013 17:51:19 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201309121751.r8CHpJPr097433@svn.freebsd.org>
From: Glen Barber <gjb@FreeBSD.org>
Date: Thu, 12 Sep 2013 17:51:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255489 - head/sys/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 17:51:19 -0000

Author: gjb
Date: Thu Sep 12 17:51:18 2013
New Revision: 255489
URL: http://svnweb.freebsd.org/changeset/base/255489

Log:
  Update head/ to -ALPHA1 status, as part of the 10.0-RELEASE
  cycle.
  
  Approved by:	re (implicit)
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Thu Sep 12 10:39:38 2013	(r255488)
+++ head/sys/conf/newvers.sh	Thu Sep 12 17:51:18 2013	(r255489)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.0"
-BRANCH="CURRENT"
+BRANCH="ALPHA1"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 17:52:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 03849F91;
 Thu, 12 Sep 2013 17:52:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E432A2482;
 Thu, 12 Sep 2013 17:52:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CHqIQM097944;
 Thu, 12 Sep 2013 17:52:18 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CHqIZO097943;
 Thu, 12 Sep 2013 17:52:18 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309121752.r8CHqIZO097943@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 12 Sep 2013 17:52:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255490 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 17:52:19 -0000

Author: jhb
Date: Thu Sep 12 17:52:18 2013
New Revision: 255490
URL: http://svnweb.freebsd.org/changeset/base/255490

Log:
  Fix the type of the idtype argument to wait6() in syscalls.master.
  
  Approved by:	re (kib)
  MFC after:	1 week

Modified:
  head/sys/kern/syscalls.master

Modified: head/sys/kern/syscalls.master
==============================================================================
--- head/sys/kern/syscalls.master	Thu Sep 12 17:51:18 2013	(r255489)
+++ head/sys/kern/syscalls.master	Thu Sep 12 17:52:18 2013	(r255490)
@@ -952,7 +952,7 @@
 				    off_t offset, off_t len); }
 531	AUE_NULL	STD	{ int posix_fadvise(int fd, off_t offset, \
 				    off_t len, int advice); }
-532	AUE_WAIT6	STD	{ int wait6(int idtype, id_t id, \
+532	AUE_WAIT6	STD	{ int wait6(idtype_t idtype, id_t id, \
 				    int *status, int options, \
 				    struct __wrusage *wrusage, \
 				    siginfo_t *info); }

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 18:01:13 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BE5BC480;
 Thu, 12 Sep 2013 18:01:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id AADAA2516;
 Thu, 12 Sep 2013 18:01:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CI1DQF003723;
 Thu, 12 Sep 2013 18:01:13 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CI1Dng003722;
 Thu, 12 Sep 2013 18:01:13 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309121801.r8CI1Dng003722@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 12 Sep 2013 18:01:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255491 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 18:01:13 -0000

Author: jhb
Date: Thu Sep 12 18:01:13 2013
New Revision: 255491
URL: http://svnweb.freebsd.org/changeset/base/255491

Log:
  Fix the type of the idtype argument to wait6() in syscalls.master.
  
  (Accidentally missed this in the previous commit)
  
  Approved by:	re (kib)
  MFC after:	1 week

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==============================================================================
--- head/sys/kern/makesyscalls.sh	Thu Sep 12 17:52:18 2013	(r255490)
+++ head/sys/kern/makesyscalls.sh	Thu Sep 12 18:01:13 2013	(r255491)
@@ -156,7 +156,8 @@ s/\$//g
 		printf "#include <sys/cpuset.h>\n" > sysarg
 		printf "#include <sys/_ffcounter.h>\n" > sysarg
 		printf "#include <sys/_semaphore.h>\n" > sysarg
-		printf "#include <sys/ucontext.h>\n\n" > sysarg
+		printf "#include <sys/ucontext.h>\n" > sysarg
+		printf "#include <sys/wait.h>\n\n" > sysarg
 		printf "#include <bsm/audit_kevents.h>\n\n" > sysarg
 		printf "struct proc;\n\n" > sysarg
 		printf "struct thread;\n\n" > sysarg

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 18:03:52 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B09D9677;
 Thu, 12 Sep 2013 18:03:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9CAD62545;
 Thu, 12 Sep 2013 18:03:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CI3q43004835;
 Thu, 12 Sep 2013 18:03:52 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CI3pkK004825;
 Thu, 12 Sep 2013 18:03:51 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309121803.r8CI3pkK004825@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 12 Sep 2013 18:03:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255492 - in head/sys: kern 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 18:03:52 -0000

Author: jhb
Date: Thu Sep 12 18:03:51 2013
New Revision: 255492
URL: http://svnweb.freebsd.org/changeset/base/255492

Log:
  Regen.
  
  Approved by:	re (kib)

Modified:
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/kern/init_sysent.c
==============================================================================
--- head/sys/kern/init_sysent.c	Thu Sep 12 18:01:13 2013	(r255491)
+++ head/sys/kern/init_sysent.c	Thu Sep 12 18:03:51 2013	(r255492)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 255219 2013-09-05 00:09:56Z pjd 
+ * created from FreeBSD: head/sys/kern/syscalls.master 255490 2013-09-12 17:52:18Z jhb 
  */
 
 #include "opt_compat.h"

Modified: head/sys/kern/syscalls.c
==============================================================================
--- head/sys/kern/syscalls.c	Thu Sep 12 18:01:13 2013	(r255491)
+++ head/sys/kern/syscalls.c	Thu Sep 12 18:03:51 2013	(r255492)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 255219 2013-09-05 00:09:56Z pjd 
+ * created from FreeBSD: head/sys/kern/syscalls.master 255490 2013-09-12 17:52:18Z jhb 
  */
 
 const char *syscallnames[] = {

Modified: head/sys/kern/systrace_args.c
==============================================================================
--- head/sys/kern/systrace_args.c	Thu Sep 12 18:01:13 2013	(r255491)
+++ head/sys/kern/systrace_args.c	Thu Sep 12 18:03:51 2013	(r255492)
@@ -3270,7 +3270,7 @@ systrace_args(int sysnum, void *params, 
 	/* wait6 */
 	case 532: {
 		struct wait6_args *p = params;
-		iarg[0] = p->idtype; /* int */
+		iarg[0] = p->idtype; /* idtype_t */
 		iarg[1] = p->id; /* id_t */
 		uarg[2] = (intptr_t) p->status; /* int * */
 		iarg[3] = p->options; /* int */
@@ -8804,7 +8804,7 @@ systrace_entry_setargdesc(int sysnum, in
 	case 532:
 		switch(ndx) {
 		case 0:
-			p = "int";
+			p = "idtype_t";
 			break;
 		case 1:
 			p = "id_t";

Modified: head/sys/sys/syscall.h
==============================================================================
--- head/sys/sys/syscall.h	Thu Sep 12 18:01:13 2013	(r255491)
+++ head/sys/sys/syscall.h	Thu Sep 12 18:03:51 2013	(r255492)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 255219 2013-09-05 00:09:56Z pjd 
+ * created from FreeBSD: head/sys/kern/syscalls.master 255490 2013-09-12 17:52:18Z jhb 
  */
 
 #define	SYS_syscall	0

Modified: head/sys/sys/syscall.mk
==============================================================================
--- head/sys/sys/syscall.mk	Thu Sep 12 18:01:13 2013	(r255491)
+++ head/sys/sys/syscall.mk	Thu Sep 12 18:03:51 2013	(r255492)
@@ -1,7 +1,7 @@
 # FreeBSD system call names.
 # DO NOT EDIT-- this file is automatically generated.
 # $FreeBSD$
-# created from FreeBSD: head/sys/kern/syscalls.master 255219 2013-09-05 00:09:56Z pjd 
+# created from FreeBSD: head/sys/kern/syscalls.master 255490 2013-09-12 17:52:18Z jhb 
 MIASM =  \
 	syscall.o \
 	exit.o \

Modified: head/sys/sys/sysproto.h
==============================================================================
--- head/sys/sys/sysproto.h	Thu Sep 12 18:01:13 2013	(r255491)
+++ head/sys/sys/sysproto.h	Thu Sep 12 18:03:51 2013	(r255492)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 255219 2013-09-05 00:09:56Z pjd 
+ * created from FreeBSD: head/sys/kern/syscalls.master 255490 2013-09-12 17:52:18Z jhb 
  */
 
 #ifndef _SYS_SYSPROTO_H_
@@ -15,6 +15,7 @@
 #include <sys/_ffcounter.h>
 #include <sys/_semaphore.h>
 #include <sys/ucontext.h>
+#include <sys/wait.h>
 
 #include <bsm/audit_kevents.h>
 
@@ -1752,7 +1753,7 @@ struct posix_fadvise_args {
 	char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)];
 };
 struct wait6_args {
-	char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)];
+	char idtype_l_[PADL_(idtype_t)]; idtype_t idtype; char idtype_r_[PADR_(idtype_t)];
 	char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)];
 	char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)];
 	char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)];

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 18:08:26 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 85E2294C;
 Thu, 12 Sep 2013 18:08:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 61C1C2599;
 Thu, 12 Sep 2013 18:08:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CI8QbC006561;
 Thu, 12 Sep 2013 18:08:26 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CI8P7m006557;
 Thu, 12 Sep 2013 18:08:25 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309121808.r8CI8P7m006557@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 12 Sep 2013 18:08:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255493 - in head/usr.bin: kdump truss
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 18:08:26 -0000

Author: jhb
Date: Thu Sep 12 18:08:25 2013
New Revision: 255493
URL: http://svnweb.freebsd.org/changeset/base/255493

Log:
  - Decode the idtype argument passed to wait6() in kdump and truss.
  - Don't treat an options argument of 0 to wait4() as an error in
    kdump.
  - Decode the wait options passed to wait4() and wait6() in truss
    and decode the returned rusage and exit status.
  
  Approved by:	re (kib)
  MFC after:	1 week

Modified:
  head/usr.bin/kdump/kdump.c
  head/usr.bin/kdump/mksubr
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/kdump/kdump.c
==============================================================================
--- head/usr.bin/kdump/kdump.c	Thu Sep 12 18:03:51 2013	(r255492)
+++ head/usr.bin/kdump/kdump.c	Thu Sep 12 18:08:25 2013	(r255493)
@@ -59,6 +59,7 @@ extern int errno;
 #include <sys/sysent.h>
 #include <sys/un.h>
 #include <sys/queue.h>
+#include <sys/wait.h>
 #ifdef IPX
 #include <sys/types.h>
 #include <netipx/ipx.h>
@@ -666,8 +667,30 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
 			case SYS_wait4:
 				print_number(ip, narg, c);
 				print_number(ip, narg, c);
+				/*
+				 * A flags value of zero is valid for
+				 * wait4() but not for wait6(), so
+				 * handle zero special here.
+				 */
+				if (*ip == 0) {
+					print_number(ip, narg, c);
+				} else {
+					putchar(',');
+					wait6optname(*ip);
+					ip++;
+					narg--;
+				}
+				break;
+			case SYS_wait6:
+				putchar('(');
+				idtypename(*ip, decimal);
+				c = ',';
+				ip++;
+				narg--;
+				print_number(ip, narg, c);
+				print_number(ip, narg, c);
 				putchar(',');
-				wait4optname(*ip);
+				wait6optname(*ip);
 				ip++;
 				narg--;
 				break;

Modified: head/usr.bin/kdump/mksubr
==============================================================================
--- head/usr.bin/kdump/mksubr	Thu Sep 12 18:03:51 2013	(r255492)
+++ head/usr.bin/kdump/mksubr	Thu Sep 12 18:08:25 2013	(r255493)
@@ -327,6 +327,68 @@ flagsandmodename(int flags, int mode, in
 	}
 }
 
+/* MANUAL */
+void
+idtypename(idtype_t idtype, int decimal)
+{
+	switch(idtype) {
+	case P_PID:
+		printf("P_PID");
+		break;
+	case P_PPID:
+		printf("P_PPID");
+		break;
+	case P_PGID:
+		printf("P_PGID");
+		break;
+	case P_SID:
+		printf("P_SID");
+		break;
+	case P_CID:
+		printf("P_CID");
+		break;
+	case P_UID:
+		printf("P_UID");
+		break;
+	case P_GID:
+		printf("P_GID");
+		break;
+	case P_ALL:
+		printf("P_ALL");
+		break;
+	case P_LWPID:
+		printf("P_LWPID");
+		break;
+	case P_TASKID:
+		printf("P_TASKID");
+		break;
+	case P_PROJID:
+		printf("P_PROJID");
+		break;
+	case P_POOLID:
+		printf("P_POOLID");
+		break;
+	case P_JAILID:
+		printf("P_JAILID");
+		break;
+	case P_CTID:
+		printf("P_CTID");
+		break;
+	case P_CPUID:
+		printf("P_CPUID");
+		break;
+	case P_PSETID:
+		printf("P_PSETID");
+		break;
+	default:
+		if (decimal) {
+			printf("%d", idtype);
+		} else {
+			printf("%#x", idtype);
+		}
+	}
+}
+
 /*
  * MANUAL
  *
@@ -426,7 +488,7 @@ auto_switch_type "sockoptname"         "
 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 "vmresultname"        "KERN_[A-Z]+[[:space:]]+[0-9]+"                "vm/vm_param.h"
-auto_or_type     "wait4optname"        "W[A-Z]+[[:space:]]+[0-9]+"                    "sys/wait.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"
 
 cat <<_EOF_

Modified: head/usr.bin/truss/syscall.h
==============================================================================
--- head/usr.bin/truss/syscall.h	Thu Sep 12 18:03:51 2013	(r255492)
+++ head/usr.bin/truss/syscall.h	Thu Sep 12 18:08:25 2013	(r255493)
@@ -40,7 +40,7 @@ enum Argtype { None = 1, Hex, Octal, Int
 	Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres,
 	Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open,
 	Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2,
-	Pathconf, Rforkflags };
+	Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype };
 
 #define	ARG_MASK	0xff
 #define	OUT	0x100

Modified: head/usr.bin/truss/syscalls.c
==============================================================================
--- head/usr.bin/truss/syscalls.c	Thu Sep 12 18:03:51 2013	(r255492)
+++ head/usr.bin/truss/syscalls.c	Thu Sep 12 18:08:25 2013	(r255493)
@@ -39,12 +39,13 @@ static const char rcsid[] =
  * arguments.
  */
 
-#include <sys/mman.h>
 #include <sys/types.h>
+#include <sys/mman.h>
 #include <sys/ptrace.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/un.h>
+#include <sys/wait.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <sys/ioccom.h>
@@ -263,6 +264,12 @@ static struct syscall syscalls[] = {
 	  .args = { { Name , 0 } , { Name, 1 } } },
 	{ .name = "posix_openpt", .ret_type = 1, .nargs = 1,
 	  .args = { { Open, 0 } } },
+	{ .name = "wait4", .ret_type = 1, .nargs = 4,
+	  .args = { { Int, 0 }, { ExitStatus | OUT, 1 }, { Waitoptions, 2 },
+		    { Rusage | OUT, 3 } } },
+	{ .name = "wait6", .ret_type = 1, .nargs = 6,
+	  .args = { { Idtype, 0 }, { Int, 1 }, { ExitStatus | OUT, 2 },
+		    { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } },
 	{ .name = 0 },
 };
 
@@ -381,6 +388,17 @@ static struct xlat rfork_flags[] = {
 	X(RFSIGSHARE) X(RFTSIGZMB) X(RFLINUXTHPN) XEND
 };
 
+static struct xlat wait_options[] = {
+	X(WNOHANG) X(WUNTRACED) X(WCONTINUED) X(WNOWAIT) X(WEXITED)
+	X(WTRAPPED) XEND
+};
+
+static struct xlat idtype_arg[] = {
+	X(P_PID) X(P_PPID) X(P_PGID) X(P_SID) X(P_CID) X(P_UID) X(P_GID)
+	X(P_ALL) X(P_LWPID) X(P_TASKID) X(P_PROJID) X(P_POOLID) X(P_JAILID)
+	X(P_CTID) X(P_CPUID) X(P_PSETID) XEND
+};
+
 #undef X
 #undef XEND
 
@@ -537,6 +555,16 @@ get_string(pid_t pid, void *offset, int 
 	}
 }
 
+static char *
+strsig2(int sig)
+{
+	char *tmp;
+
+	tmp = strsig(sig);
+	if (tmp == NULL)
+		asprintf(&tmp, "%d", sig);
+	return (tmp);
+}
 
 /*
  * print_arg
@@ -822,19 +850,14 @@ print_arg(struct syscall_args *sc, unsig
 		free(fds);
 		break;
 	}
-	case Signal: {
-		long sig;
-
-		sig = args[sc->offset];
-		tmp = strsig(sig);
-		if (tmp == NULL)
-			asprintf(&tmp, "%ld", sig);
+	case Signal:
+		tmp = strsig2(args[sc->offset]);
 		break;
-	}
 	case Sigset: {
 		long sig;
 		sigset_t ss;
 		int i, used;
+		char *signame;
 
 		sig = args[sc->offset];
 		if (get_struct(pid, (void *)args[sc->offset], (void *)&ss,
@@ -845,8 +868,11 @@ print_arg(struct syscall_args *sc, unsig
 		tmp = malloc(sys_nsig * 8); /* 7 bytes avg per signal name */
 		used = 0;
 		for (i = 1; i < sys_nsig; i++) {
-			if (sigismember(&ss, i))
-				used += sprintf(tmp + used, "%s|", strsig(i));
+			if (sigismember(&ss, i)) {
+				signame = strsig(i);
+				used += sprintf(tmp + used, "%s|", signame);
+				free(signame);
+			}
 		}
 		if (used)
 			tmp[used-1] = 0;
@@ -1143,6 +1169,35 @@ print_arg(struct syscall_args *sc, unsig
 			asprintf(&tmp, "0x%lx", args[sc->offset]);
 		break;
 	}
+	case ExitStatus: {
+		char *signame;
+		int status;
+		signame = NULL;
+		if (get_struct(pid, (void *)args[sc->offset], &status,
+		    sizeof(status)) != -1) {
+			if (WIFCONTINUED(status))
+				tmp = strdup("{ CONTINUED }");
+			else if (WIFEXITED(status))
+				asprintf(&tmp, "{ EXITED,val=%d }",
+				    WEXITSTATUS(status));
+			else if (WIFSIGNALED(status))
+				asprintf(&tmp, "{ SIGNALED,sig=%s%s }",
+				    signame = strsig2(WTERMSIG(status)),
+				    WCOREDUMP(status) ? ",cored" : "");
+			else
+				asprintf(&tmp, "{ STOPPED,sig=%s }",
+				    signame = strsig2(WTERMSIG(status)));
+		} else
+			asprintf(&tmp, "0x%lx", args[sc->offset]);
+		free(signame);
+		break;
+	}
+	case Waitoptions:
+		tmp = strdup(xlookup_bits(wait_options, args[sc->offset]));
+		break;
+	case Idtype:
+		tmp = strdup(xlookup(idtype_arg, args[sc->offset]));
+		break;
 	default:
 		errx(1, "Invalid argument type %d\n", sc->type & ARG_MASK);
 	}

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 19:12:24 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A8179925;
 Thu, 12 Sep 2013 19:12:24 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8080A2DDE;
 Thu, 12 Sep 2013 19:12:24 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id A43C1B946;
 Thu, 12 Sep 2013 15:12:23 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: src-committers@freebsd.org
Subject: Re: svn commit: r255493 - in head/usr.bin: kdump truss
Date: Thu, 12 Sep 2013 15:02:01 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; )
References: <201309121808.r8CI8P7m006557@svn.freebsd.org>
In-Reply-To: <201309121808.r8CI8P7m006557@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201309121502.02022.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Thu, 12 Sep 2013 15:12:23 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 19:12:24 -0000

On Thursday, September 12, 2013 2:08:25 pm John Baldwin wrote:
> Author: jhb
> Date: Thu Sep 12 18:08:25 2013
> New Revision: 255493
> URL: http://svnweb.freebsd.org/changeset/base/255493
> 
> Log:
>   - Decode the idtype argument passed to wait6() in kdump and truss.
>   - Don't treat an options argument of 0 to wait4() as an error in
>     kdump.
>   - Decode the wait options passed to wait4() and wait6() in truss
>     and decode the returned rusage and exit status.
>   
>   Approved by:	re (kib)
>   MFC after:	1 week

Sample truss output:

wait4(70956,{ EXITED,val=1 },0x0,{ u=0.000000,s=0.000255,in=0,out=0 }) = 70956 (0x1152c)
wait4(70957,{ SIGNALED,sig=62,cored },WNOHANG,{ u=0.000000,s=0.000058,in=0,out=0 }) = 0 (0x0)
wait4(70957,{ SIGNALED,sig=SIGILL,cored },0x0,{ u=0.000000,s=0.018391,in=0,out=135 }) = 70957 (0x1152d)
wait6(P_PID,70973,{ SIGNALED,sig=SIGTERM },WEXITED,{ u=0.000000,s=0.000176,in=0,out=0 },0x0) = 70973 (0x1153d)

Sample kdump output (same test code, different pids):

  2782 wait     CALL  wait4(0xadf,0x7fffffffd514,0,0x7fffffffd518)
  2782 wait     RET   wait4 2783/0xadf
  2782 wait     CALL  wait4(0xae0,0x7fffffffd514,0x1<WNOHANG>,0x7fffffffd518)
  2782 wait     RET   wait4 0
  2782 wait     CALL  wait4(0xae0,0x7fffffffd514,0,0x7fffffffd518)
  2782 wait     RET   wait4 2784/0xae0
  2782 wait     CALL  wait6(P_PID,0xaf0,0x7fffffffd514,0x10<WEXITED>,0x7fffffffd5a8,0)
  2782 wait     RET   wait6 2800/0xaf0

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 19:29:14 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B77C1123;
 Thu, 12 Sep 2013 19:29:14 +0000 (UTC)
 (envelope-from andrew@fubar.geek.nz)
Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198])
 by mx1.freebsd.org (Postfix) with ESMTP id 7BB702FD4;
 Thu, 12 Sep 2013 19:29:14 +0000 (UTC)
Received: from bender.Home (97e5e46b.skybroadband.com [151.229.228.107])
 by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 0CC285DFFE;
 Thu, 12 Sep 2013 19:29:06 +0000 (UTC)
Date: Thu, 12 Sep 2013 20:29:00 +0100
From: Andrew Turner <andrew@fubar.geek.nz>
To: Nathan Whitehorn <nwhitehorn@freebsd.org>
Subject: Re: svn commit: r255457 - head/usr.sbin/pkg
Message-ID: <20130912202900.4eb17e6f@bender.Home>
In-Reply-To: <522FE3A2.2090405@freebsd.org>
References: <201309102056.r8AKu1rQ000442@svn.freebsd.org>
 <522FE3A2.2090405@freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="MP_/NDatlV/4QluxpO6avFylBzL"
Cc: svn-src-head@freebsd.org, Baptiste Daroussin <bapt@FreeBSD.org>,
 src-committers@freebsd.org, svn-src-all@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 19:29:14 -0000

--MP_/NDatlV/4QluxpO6avFylBzL
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tue, 10 Sep 2013 22:29:38 -0500
Nathan Whitehorn <nwhitehorn@freebsd.org> wrote:

> On 09/10/13 15:56, Baptiste Daroussin wrote:
> > Author: bapt
> > Date: Tue Sep 10 20:56:01 2013
> > New Revision: 255457
> > URL: http://svnweb.freebsd.org/changeset/base/255457
> >
> > Log:
> >    Add support to detect arm vs armv6
> >    
> >    There are two different versions of the ARM ABI depending on the
> >    TARGET_ARCH. As these are sligntly different a package built for
> >    one may not work on another. We need to detect which one we are
> > on by parsing the .ARM.attributes section.
> >    
> >    This will only work on the ARM EABI as this section is part of
> > the ABI definition. As armv6 only supports the ARM EABI this is not
> > a problem for the oabi.
> >    
> >    Older versions of libelf in FreeBSD fail to read the
> >    .ARM.attributes section needed. As armv6 is unsupported on these
> >    versions we can assume we are running on arm.
> >    
> 
> Picking a random commit: I don't suppose we can just use MACHINE_ARCH 
> for these identifiers? It encapsulates everything needed for
> compatibility. -Nathan
> 
> 

I have the attached patch to add a MACHINE_ARCH elf note. It would
remove the need to parse the .ARM.attributes section. NetBSD is doing
something similar to the patch where it appears they have
a .note.netbsd.march section.

Andrew
--MP_/NDatlV/4QluxpO6avFylBzL
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=machine_arch_note.diff

Index: lib/csu/common/crtbrand.c
===================================================================
--- lib/csu/common/crtbrand.c	(revision 252514)
+++ lib/csu/common/crtbrand.c	(working copy)
@@ -64,3 +64,17 @@
 	.name = NOTE_FREEBSD_VENDOR,
 	.desc = __FreeBSD_version
 };
+
+static const struct {
+	int32_t	namesz;
+	int32_t	descsz;
+	int32_t	type;
+	char	name[sizeof(NOTE_FREEBSD_VENDOR)];
+	char	desc[sizeof(MACHINE_ARCH)];
+} archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = {
+	.namesz = sizeof(NOTE_FREEBSD_VENDOR),
+	.descsz = sizeof(MACHINE_ARCH),
+	.type = ARCH_NOTETYPE,
+	.name = NOTE_FREEBSD_VENDOR,
+	.desc = MACHINE_ARCH
+};
Index: lib/csu/common/notes.h
===================================================================
--- lib/csu/common/notes.h	(revision 252514)
+++ lib/csu/common/notes.h	(working copy)
@@ -34,5 +34,6 @@
 
 #define ABI_NOTETYPE		1
 #define	CRT_NOINIT_NOTETYPE	2
+#define	ARCH_NOTETYPE		3
 
 #endif

--MP_/NDatlV/4QluxpO6avFylBzL--

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 19:36:04 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 9AB9653F;
 Thu, 12 Sep 2013 19:36:04 +0000 (UTC)
 (envelope-from mckusick@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 85FD720EA;
 Thu, 12 Sep 2013 19:36:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CJa4Rl060100;
 Thu, 12 Sep 2013 19:36:04 GMT
 (envelope-from mckusick@svn.freebsd.org)
Received: (from mckusick@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CJa4Q6060099;
 Thu, 12 Sep 2013 19:36:04 GMT
 (envelope-from mckusick@svn.freebsd.org)
Message-Id: <201309121936.r8CJa4Q6060099@svn.freebsd.org>
From: Kirk McKusick <mckusick@FreeBSD.org>
Date: Thu, 12 Sep 2013 19:36:04 +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: r255494 - stable/9/sys/ufs/ffs
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 19:36:04 -0000

Author: mckusick
Date: Thu Sep 12 19:36:04 2013
New Revision: 255494
URL: http://svnweb.freebsd.org/changeset/base/255494

Log:
  MFC of 254995:
  
  A performance problem was reported in PR kern/181226:
  
      I have 25TB Dell PERC 6 RAID5 array. When it becomes almost
      full (10-20GB free), processes which write data to it start
      eating 100% CPU and write speed drops below 1MB/sec (normally
      to gives 400MB/sec). The revision at which it first became
      apparent was http://svnweb.freebsd.org/changeset/base/249782.
  
  The offending change reserved an area in each cylinder group to
  store metadata. The new algorithm attempts to save this area for
  metadata and allows its use for non-metadata only after all the
  data areas have been exhausted. The size of the reserved area
  defaults to half of minfree, so the filesystem reports full before
  the data area can completely fill. However, in this report, the
  filesystem has had minfree reduced to 1% thus forcing the metadata
  area to be used for data. As the filesystem approached full, it
  had only metadata areas left to allocate. The result was that
  every block allocation had to scan summary data for 30,000 cylinder
  groups before falling back to searching up to 30,000 metadata areas.
  
  The fix is to give up on saving the metadata areas once the free
  space reserve drops below 2%. The effect of this change is to use
  the old algorithm of just accepting the first available block that
  we find. Since most filesystems use the default 5% minfree, this
  will have no effect on their operation. For those that want to push
  to the limit, they will get their crappy block placements quickly.
  
  Submitted by:  Dmitry Sivachenko
  Fix Tested by: Dmitry Sivachenko
  PR:            kern/181226
  
  MFC of 254996:
  
  In looking at block layouts as part of fixing filesystem block
  allocations under low free-space conditions (-r254995), determine
  that old block-preference search order used before -r249782 worked
  a bit better. This change reverts to that block-preference search order.

Modified:
  stable/9/sys/ufs/ffs/ffs_alloc.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ufs/ffs/ffs_alloc.c
==============================================================================
--- stable/9/sys/ufs/ffs/ffs_alloc.c	Thu Sep 12 18:08:25 2013	(r255493)
+++ stable/9/sys/ufs/ffs/ffs_alloc.c	Thu Sep 12 19:36:04 2013	(r255494)
@@ -516,7 +516,13 @@ ffs_reallocblks_ufs1(ap)
 	ip = VTOI(vp);
 	fs = ip->i_fs;
 	ump = ip->i_ump;
-	if (fs->fs_contigsumsize <= 0)
+	/*
+	 * If we are not tracking block clusters or if we have less than 2%
+	 * free blocks left, then do not attempt to cluster. Running with
+	 * less than 5% free block reserve is not recommended and those that
+	 * choose to do so do not expect to have good file layout.
+	 */
+	if (fs->fs_contigsumsize <= 0 || freespace(fs, 2) < 0)
 		return (ENOSPC);
 	buflist = ap->a_buflist;
 	len = buflist->bs_nchildren;
@@ -736,7 +742,13 @@ ffs_reallocblks_ufs2(ap)
 	ip = VTOI(vp);
 	fs = ip->i_fs;
 	ump = ip->i_ump;
-	if (fs->fs_contigsumsize <= 0)
+	/*
+	 * If we are not tracking block clusters or if we have less than 2%
+	 * free blocks left, then do not attempt to cluster. Running with
+	 * less than 5% free block reserve is not recommended and those that
+	 * choose to do so do not expect to have good file layout.
+	 */
+	if (fs->fs_contigsumsize <= 0 || freespace(fs, 2) < 0)
 		return (ENOSPC);
 	buflist = ap->a_buflist;
 	len = buflist->bs_nchildren;
@@ -1173,7 +1185,7 @@ ffs_dirpref(pip)
 			if (fs->fs_contigdirs[cg] < maxcontigdirs)
 				return ((ino_t)(fs->fs_ipg * cg));
 		}
-	for (cg = prefcg - 1; cg >= 0; cg--)
+	for (cg = 0; cg < prefcg; cg++)
 		if (fs->fs_cs(fs, cg).cs_ndir < maxndir &&
 		    fs->fs_cs(fs, cg).cs_nifree >= minifree &&
 	    	    fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
@@ -1186,7 +1198,7 @@ ffs_dirpref(pip)
 	for (cg = prefcg; cg < fs->fs_ncg; cg++)
 		if (fs->fs_cs(fs, cg).cs_nifree >= avgifree)
 			return ((ino_t)(fs->fs_ipg * cg));
-	for (cg = prefcg - 1; cg >= 0; cg--)
+	for (cg = 0; cg < prefcg; cg++)
 		if (fs->fs_cs(fs, cg).cs_nifree >= avgifree)
 			break;
 	return ((ino_t)(fs->fs_ipg * cg));

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 19:51:41 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 270A0DC8;
 Thu, 12 Sep 2013 19:51:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 12EEB227E;
 Thu, 12 Sep 2013 19:51:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CJpeeC070191;
 Thu, 12 Sep 2013 19:51:40 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CJpebt070189;
 Thu, 12 Sep 2013 19:51:40 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309121951.r8CJpebt070189@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 12 Sep 2013 19:51:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255495 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 19:51:41 -0000

Author: jhb
Date: Thu Sep 12 19:51:40 2013
New Revision: 255495
URL: http://svnweb.freebsd.org/changeset/base/255495

Log:
  Document several recent changes to vm_map_find(9):
  - Document the max_addr parameter that restricts mappings to a subset of
    the map's address space.
  - Document VMFS_ALIGNED_SPACE and update for the rename of VMFS_SUPER_SPACE.
    In addition, use a table that describes the different find space
    strategies in more detail.
  
  Reviewed by:	alc
  Approved by:	re (kib)

Modified:
  head/share/man/man9/vm_map_find.9

Modified: head/share/man/man9/vm_map_find.9
==============================================================================
--- head/share/man/man9/vm_map_find.9	Thu Sep 12 19:36:04 2013	(r255494)
+++ head/share/man/man9/vm_map_find.9	Thu Sep 12 19:51:40 2013	(r255495)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 10, 2008
+.Dd September 12, 2013
 .Dt VM_MAP_FIND 9
 .Os
 .Sh NAME
@@ -38,8 +38,8 @@
 .Ft int
 .Fo vm_map_find
 .Fa "vm_map_t map" "vm_object_t object" "vm_ooffset_t offset"
-.Fa "vm_offset_t *addr" "vm_size_t length" "int find_space"
-.Fa "vm_prot_t prot" "vm_prot_t max" "int cow"
+.Fa "vm_offset_t *addr" "vm_size_t length" "vm_offset_t max_addr"
+.Fa "int find_space" "vm_prot_t prot" "vm_prot_t max" "int cow"
 .Fc
 .Sh DESCRIPTION
 The
@@ -47,9 +47,13 @@ The
 function attempts to find a free region in the target
 .Fa map ,
 with the given
-.Fa length ,
-and will also optionally create a mapping of
-.Fa object .
+.Fa length.
+If a free region is found,
+.Fn vm_map_find
+creates a mapping of
+.Fa object
+via a call to
+.Xr vm_map_insert 9 .
 .Pp
 The arguments
 .Fa offset ,
@@ -69,26 +73,56 @@ the reference count on the object must b
 by the caller before calling this function to account for the new entry.
 .Pp
 If
+.Fa max_addr
+is non-zero,
+it specifies an upper bound on the mapping.
+The mapping will only succeed if a free region can be found that resides
+entirely below
+.Fa max_addr .
+.Pp
+The
 .Fa find_space
-is either
-.Dv VMFS_ALIGNED_SPACE
-or
-.Dv VMFS_ANY_SPACE ,
-the function will call
+argument specifies the strategy to use when searching for a free region of
+the requested length.
+For all values other than
+.Dv VMFS_NO_SPACE ,
 .Xr vm_map_findspace 9
-to discover a free region.
-Moreover, if
-.Fa find_space
+is called to locate a free region of the requested length with a starting
+address at or above
+.Fa *addr .
+The following strategies are supported:
+.Bl -tag -width Dv VMFS_ALIGNED_SPACE Ns Pq Fa n
+.It Dv VMFS_NO_SPACE
+The mapping will only succeed if there is a free region of the requested
+length at the given address
+.Fa *addr .
+.It Dv VMFS_ANY_SPACE
+The mapping will succeed as long as there is a free region.
+.It Dv VMFS_SUPER_SPACE
+The mapping will succeed as long as there is a free region that begins on
+a superpage boundary.
+If
+.Fa object
 is
-.Dv VMFS_ALIGNED_SPACE ,
-the address of the free region will be optimized for the use of superpages.
-Otherwise, if
-.Fa find_space
+.Pf non- Dv NULL
+and is already backed by superpages,
+then the mapping will require a free region that aligns relative to the
+existing superpages rather than one beginning on a superpage boundary.
+.It Dv VMFS_OPTIMAL_SPACE
+The mapping will succeed as long as there is a free region.
+However, if
+.Fa object
 is
-.Dv VMFS_NO_SPACE ,
-.Xr vm_map_insert 9
-is called with the given address,
-.Fa addr .
+.Pf non- Dv NULL
+and is already backed by superpages,
+this strategy will attempt to find a free region aligned relative to
+the existing superpages.
+.It Dv VMFS_ALIGNED_SPACE Ns Pq Fa n
+The mapping will succeed as long as there is a free region that aligns on
+a
+.Pf 2^ Fa n
+boundary.
+.El
 .Sh IMPLEMENTATION NOTES
 This function acquires a lock on
 .Fa map

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 19:52:23 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B7CD8F0A;
 Thu, 12 Sep 2013 19:52:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A537B228A;
 Thu, 12 Sep 2013 19:52:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CJqNOx070508;
 Thu, 12 Sep 2013 19:52:23 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CJqN2A070507;
 Thu, 12 Sep 2013 19:52:23 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309121952.r8CJqN2A070507@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 12 Sep 2013 19:52:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255496 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 19:52:23 -0000

Author: jhb
Date: Thu Sep 12 19:52:23 2013
New Revision: 255496
URL: http://svnweb.freebsd.org/changeset/base/255496

Log:
  Fix a typo.
  
  Approved by:	re (gjb)

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Thu Sep 12 19:51:40 2013	(r255495)
+++ head/sys/sys/sysctl.h	Thu Sep 12 19:52:23 2013	(r255496)
@@ -389,7 +389,7 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
 	    SYSCTL_ADD_ASSERT_TYPE(UINT64, ptr), 0,			\
 	    sysctl_handle_64, "QU", __DESCR(descr))
 
-/* Oid for a 64-bin unsigned counter(9).  The pointer must be non NULL. */
+/* Oid for a 64-bit unsigned counter(9).  The pointer must be non NULL. */
 #define	SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, val, descr)	\
 	SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name);			\
 	SYSCTL_OID(parent, nbr, name,					\

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 20:46:33 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 6579D303;
 Thu, 12 Sep 2013 20:46:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 53117263B;
 Thu, 12 Sep 2013 20:46:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CKkXUV002020;
 Thu, 12 Sep 2013 20:46:33 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CKkXw4002019;
 Thu, 12 Sep 2013 20:46:33 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309122046.r8CKkXw4002019@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 12 Sep 2013 20:46:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255497 - head/sys/vm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 20:46:33 -0000

Author: jhb
Date: Thu Sep 12 20:46:32 2013
New Revision: 255497
URL: http://svnweb.freebsd.org/changeset/base/255497

Log:
  Fix an off-by-one error when populating mincore(2) entries for
  skipped entries.  lastvecindex references the last valid byte,
  so the new bytes should come after it.
  
  Approved by:	re (kib)
  MFC after:	1 week

Modified:
  head/sys/vm/vm_mmap.c

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c	Thu Sep 12 19:52:23 2013	(r255496)
+++ head/sys/vm/vm_mmap.c	Thu Sep 12 20:46:32 2013	(r255497)
@@ -984,12 +984,12 @@ RestartScan:
 			 * the byte vector is zeroed for those skipped entries.
 			 */
 			while ((lastvecindex + 1) < vecindex) {
+				++lastvecindex;
 				error = subyte(vec + lastvecindex, 0);
 				if (error) {
 					error = EFAULT;
 					goto done2;
 				}
-				++lastvecindex;
 			}
 
 			/*
@@ -1025,12 +1025,12 @@ RestartScan:
 	 */
 	vecindex = OFF_TO_IDX(end - first_addr);
 	while ((lastvecindex + 1) < vecindex) {
+		++lastvecindex;
 		error = subyte(vec + lastvecindex, 0);
 		if (error) {
 			error = EFAULT;
 			goto done2;
 		}
-		++lastvecindex;
 	}
 
 	/*

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 20:49:21 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C7FFC464;
 Thu, 12 Sep 2013 20:49:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A5B252654;
 Thu, 12 Sep 2013 20:49:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CKnLQb003200;
 Thu, 12 Sep 2013 20:49:21 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CKnL8n003197;
 Thu, 12 Sep 2013 20:49:21 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201309122049.r8CKnL8n003197@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 12 Sep 2013 20:49:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255498 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 20:49:21 -0000

Author: jhb
Date: Thu Sep 12 20:49:20 2013
New Revision: 255498
URL: http://svnweb.freebsd.org/changeset/base/255498

Log:
  - Document the UQUAD sysctl variants.
  - Clarify that exactly one of the "access" flags is required and
    list the optional flags in a separate list.  Prefer bundling
    CTLFLAG_TUN into the access flag by not documenting it as an
    optional flag to set.
  
  Approved by:	re (glebius)
  MFC after:	1 week

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/sysctl.9
  head/share/man/man9/sysctl_add_oid.9

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Thu Sep 12 20:46:32 2013	(r255497)
+++ head/share/man/man9/Makefile	Thu Sep 12 20:49:20 2013	(r255498)
@@ -1304,22 +1304,24 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \
 	sysctl.9 SYSCTL_NODE.9 \
 	sysctl.9 SYSCTL_OPAQUE.9 \
 	sysctl.9 SYSCTL_PROC.9 \
+	sysctl.9 SYSCTL_QUAD.9 \
 	sysctl.9 SYSCTL_STRING.9 \
 	sysctl.9 SYSCTL_STRUCT.9 \
 	sysctl.9 SYSCTL_UINT.9 \
 	sysctl.9 SYSCTL_ULONG.9 \
-	sysctl.9 SYSCTL_QUAD.9
+	sysctl.9 SYSCTL_UQUAD.9
 MLINKS+=sysctl_add_oid.9 SYSCTL_ADD_INT.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_LONG.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_NODE.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_OID.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_OPAQUE.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_PROC.9 \
+	sysctl_add_oid.9 SYSCTL_ADD_QUAD.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_STRING.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_STRUCT.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_UINT.9 \
 	sysctl_add_oid.9 SYSCTL_ADD_ULONG.9 \
-	sysctl_add_oid.9 SYSCTL_ADD_QUAD.9 \
+	sysctl_add_oid.9 SYSCTL_ADD_UQUAD.9 \
 	sysctl_add_oid.9 SYSCTL_CHILDREN.9 \
 	sysctl_add_oid.9 sysctl_move_oid.9 \
 	sysctl_add_oid.9 sysctl_remove_oid.9 \

Modified: head/share/man/man9/sysctl.9
==============================================================================
--- head/share/man/man9/sysctl.9	Thu Sep 12 20:46:32 2013	(r255497)
+++ head/share/man/man9/sysctl.9	Thu Sep 12 20:49:20 2013	(r255498)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 16, 2010
+.Dd September 12, 2013
 .Dt SYSCTL 9
 .Os
 .Sh NAME
@@ -35,11 +35,12 @@
 .Nm SYSCTL_NODE ,
 .Nm SYSCTL_OPAQUE ,
 .Nm SYSCTL_PROC ,
+.Nm SYSCTL_QUAD ,
 .Nm SYSCTL_STRING ,
 .Nm SYSCTL_STRUCT ,
 .Nm SYSCTL_UINT ,
 .Nm SYSCTL_ULONG ,
-.Nm SYSCTL_QUAD
+.Nm SYSCTL_UQUAD
 .Nd Static sysctl declaration functions
 .Sh SYNOPSIS
 .In sys/types.h
@@ -50,11 +51,12 @@
 .Fn SYSCTL_NODE parent nbr name access handler descr
 .Fn SYSCTL_OPAQUE parent nbr name access ptr len fmt descr
 .Fn SYSCTL_PROC parent nbr name access ptr arg handler fmt descr
+.Fn SYSCTL_QUAD parent nbr name access ptr val descr
 .Fn SYSCTL_STRING parent nbr name access arg len descr
 .Fn SYSCTL_STRUCT parent nbr name access ptr type descr
 .Fn SYSCTL_UINT parent nbr name access ptr val descr
 .Fn SYSCTL_ULONG parent nbr name access ptr val descr
-.Fn SYSCTL_QUAD parent nbr name access ptr val descr
+.Fn SYSCTL_UQUAD parent nbr name access ptr val descr
 .Sh DESCRIPTION
 The
 .Nm SYSCTL
@@ -76,12 +78,13 @@ New nodes are declared using one of
 .Fn SYSCTL_NODE ,
 .Fn SYSCTL_OPAQUE ,
 .Fn SYSCTL_PROC ,
+.Fn SYSCTL_QUAD ,
 .Fn SYSCTL_STRING ,
 .Fn SYSCTL_STRUCT ,
 .Fn SYSCTL_UINT ,
 .Fn SYSCTL_ULONG ,
 and
-.Fn SYSCTL_QUAD .
+.Fn SYSCTL_UQUAD .
 Each macro accepts a parent name, as declared using
 .Fn SYSCTL_DECL ,
 an OID number, typically
@@ -118,15 +121,23 @@ This is an unsigned long.
 This is a 64-bit unsigned integer.
 .El
 .Pp
-All sysctl types except for new node declarations require one or more flags
-to be set indicating the read and write disposition of the sysctl:
+All sysctl types except for new node declarations require one of the following
+flags to be set indicating the read and write disposition of the sysctl:
 .Bl -tag -width ".Dv CTLFLAG_ANYBODY"
 .It Dv CTLFLAG_RD
 This is a read-only sysctl.
+.It Dv CTLFLAG_RDTUN
+This is a read-only sysctl which can be set by a system tunable.
 .It Dv CTLFLAG_WR
 This is a writable sysctl.
 .It Dv CTLFLAG_RW
 This sysctl is readable and writable.
+.It Dv CTLFLAG_RWTUN
+This sysctl is readable and writable and can also be set by a system tunable.
+.El
+.Pp
+Additionally, any of the following optional flags may also be specified:
+.Bl -tag -width ".Dv CTLFLAG_ANYBODY"
 .It Dv CTLFLAG_ANYBODY
 Any user or process can write to this sysctl.
 .It Dv CTLFLAG_SECURE
@@ -139,9 +150,6 @@ This sysctl can be written to by process
 When iterating the sysctl name space, do not list this sysctl.
 .It Dv CTLFLAG_TUN
 Advisory flag that a system tunable also exists for this variable.
-.It Dv CTLFLAG_RDTUN
-Advisory flag that a system tunable also exists for this variable;
-however, the run-time variable is read-only.
 .El
 .Pp
 When creating new sysctls, careful attention should be paid to the security

Modified: head/share/man/man9/sysctl_add_oid.9
==============================================================================
--- head/share/man/man9/sysctl_add_oid.9	Thu Sep 12 20:46:32 2013	(r255497)
+++ head/share/man/man9/sysctl_add_oid.9	Thu Sep 12 20:49:20 2013	(r255498)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2000
+.Dd September 12, 2013
 .Dt SYSCTL_ADD_OID 9
 .Os
 .Sh NAME
@@ -157,6 +157,16 @@
 .Fa "const char *descr"
 .Fc
 .Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_UQUAD
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int access"
+.Fa "uint64_t *arg"
+.Fa "const char *descr"
+.Fc
+.Ft struct sysctl_oid *
 .Fo SYSCTL_ADD_OPAQUE
 .Fa "struct sysctl_ctx_list *ctx"
 .Fa "struct sysctl_oid_list *parent"

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 20:51:48 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CB879714;
 Thu, 12 Sep 2013 20:51:48 +0000 (UTC) (envelope-from dim@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B8D4826A9;
 Thu, 12 Sep 2013 20:51:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CKpmX2005831;
 Thu, 12 Sep 2013 20:51:48 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CKpm9J005830;
 Thu, 12 Sep 2013 20:51:48 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201309122051.r8CKpm9J005830@svn.freebsd.org>
From: Dimitry Andric <dim@FreeBSD.org>
Date: Thu, 12 Sep 2013 20:51:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255499 - head/lib/msun
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 20:51:48 -0000

Author: dim
Date: Thu Sep 12 20:51:48 2013
New Revision: 255499
URL: http://svnweb.freebsd.org/changeset/base/255499

Log:
  After r255294, building lib/msun's symbol map (using clang as the
  preprocessor) gives the following error:
  
  --- Version.map ---
  <stdin>:287:4: error: invalid preprocessing directive
          # Implemented as weak aliases for imprecise versions
            ^
  1 error generated.
  
  Change the comment to a C-style one, to prevent this error.
  
  Approved by:	re (hrs)

Modified:
  head/lib/msun/Symbol.map

Modified: head/lib/msun/Symbol.map
==============================================================================
--- head/lib/msun/Symbol.map	Thu Sep 12 20:49:20 2013	(r255498)
+++ head/lib/msun/Symbol.map	Thu Sep 12 20:51:48 2013	(r255499)
@@ -270,7 +270,7 @@ FBSD_1.3 {
 	log1pl;
 	log2l;
 	logl;
-	# Implemented as weak aliases for imprecise versions
+	/* Implemented as weak aliases for imprecise versions */
 	coshl;
 	erfcl;
 	erfl;

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 21:25:00 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 2F758ED5;
 Thu, 12 Sep 2013 21:25:00 +0000 (UTC) (envelope-from dim@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1C8892885;
 Thu, 12 Sep 2013 21:25:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CLOxhR025248;
 Thu, 12 Sep 2013 21:24:59 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CLOxXl025246;
 Thu, 12 Sep 2013 21:24:59 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201309122124.r8CLOxXl025246@svn.freebsd.org>
From: Dimitry Andric <dim@FreeBSD.org>
Date: Thu, 12 Sep 2013 21:24:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255500 - in head/gnu/lib: libstdc++ libsupc++
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 21:25:00 -0000

Author: dim
Date: Thu Sep 12 21:24:59 2013
New Revision: 255500
URL: http://svnweb.freebsd.org/changeset/base/255500

Log:
  After r255321, clang uses libc++ by default.  This leads to a lot of
  errors when you enable WITH_GNUCXX to build libstdc++, since it will
  include C++ headers from the libc++ installation under ${WORLDTMP}, and
  those are not compatible with libstdc++ at all.
  
  To fix this, add -stdlib=libstdc++ to CXXFLAGS when building libstdc++
  (and its companion libsupc++) with clang.
  
  Approved by:	re (delphij)

Modified:
  head/gnu/lib/libstdc++/Makefile
  head/gnu/lib/libsupc++/Makefile

Modified: head/gnu/lib/libstdc++/Makefile
==============================================================================
--- head/gnu/lib/libstdc++/Makefile	Thu Sep 12 20:51:48 2013	(r255499)
+++ head/gnu/lib/libstdc++/Makefile	Thu Sep 12 21:24:59 2013	(r255500)
@@ -636,3 +636,7 @@ CLEANFILES+=	${VERSION_MAP}
 
 # Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98.
 CXXFLAGS:=	${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]}
+
+.if ${COMPILER_TYPE} == "clang"
+CXXFLAGS+=	-stdlib=libstdc++
+.endif

Modified: head/gnu/lib/libsupc++/Makefile
==============================================================================
--- head/gnu/lib/libsupc++/Makefile	Thu Sep 12 20:51:48 2013	(r255499)
+++ head/gnu/lib/libsupc++/Makefile	Thu Sep 12 21:24:59 2013	(r255500)
@@ -56,3 +56,7 @@ VERSION_MAP=	${.CURDIR}/Version.map
 
 # Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98.
 CXXFLAGS:=	${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]}
+
+.if ${COMPILER_TYPE} == "clang"
+CXXFLAGS+=	-stdlib=libstdc++
+.endif

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 22:06:13 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 3EEAAD80;
 Thu, 12 Sep 2013 22:06:13 +0000 (UTC) (envelope-from ken@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2BDA12B36;
 Thu, 12 Sep 2013 22:06:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CM6Dam049095;
 Thu, 12 Sep 2013 22:06:13 GMT (envelope-from ken@svn.freebsd.org)
Received: (from ken@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CM6CpB049094;
 Thu, 12 Sep 2013 22:06:12 GMT (envelope-from ken@svn.freebsd.org)
Message-Id: <201309122206.r8CM6CpB049094@svn.freebsd.org>
From: "Kenneth D. Merry" <ken@FreeBSD.org>
Date: Thu, 12 Sep 2013 22:06:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255501 - head/sys/dev/mps
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 22:06:13 -0000

Author: ken
Date: Thu Sep 12 22:06:12 2013
New Revision: 255501
URL: http://svnweb.freebsd.org/changeset/base/255501

Log:
  Fix an issue that caused Integrated RAID volumes on LSI mps(4) controllers
  to not get scanned on boot.
  
  The problem originated in change 253549.  With the change to the mps(4)
  driver to scan only targets that it knows it has (as opposed to scanning
  the entire bus), scanning RAID volumes on boot was omitted.
  
  So, for versions of FreeBSD that have the scanning changes
  (__FreeBSD_version 1000039 and higher), scan RAID volumes that are added
  whether or not we're booting.
  
  PR:		kern/181784
  Reported by:	Xiguang Wang <kurapica@gmail.com>
  Tested by:	Dennis Glatting <dg@pki2.com>
  Sponsored by:	Spectra Logic
  Approved by:	re (delphij)
  MFC After:	3 days

Modified:
  head/sys/dev/mps/mps_sas_lsi.c

Modified: head/sys/dev/mps/mps_sas_lsi.c
==============================================================================
--- head/sys/dev/mps/mps_sas_lsi.c	Thu Sep 12 21:24:59 2013	(r255500)
+++ head/sys/dev/mps/mps_sas_lsi.c	Thu Sep 12 22:06:12 2013	(r255501)
@@ -898,7 +898,9 @@ mpssas_volume_add(struct mps_softc *sc, 
 		free(lun, M_MPT2);
 	}
 	SLIST_INIT(&targ->luns);
+#if __FreeBSD_version < 1000039
 	if ((sassc->flags & MPSSAS_IN_STARTUP) == 0)
+#endif
 		mpssas_rescan_target(sc, targ);
 	mps_dprint(sc, MPS_MAPPING, "RAID target id %d added (WWID = 0x%jx)\n",
 	    targ->tid, wwid);

From owner-svn-src-all@FreeBSD.ORG  Thu Sep 12 22:19:44 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 818DE147;
 Thu, 12 Sep 2013 22:19:44 +0000 (UTC) (envelope-from jilles@stack.nl)
Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3A9412C33;
 Thu, 12 Sep 2013 22:19:44 +0000 (UTC)
Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132])
 by mx1.stack.nl (Postfix) with ESMTP id 48ED4120207;
 Fri, 13 Sep 2013 00:19:27 +0200 (CEST)
Received: by turtle.stack.nl (Postfix, from userid 1677)
 id 2BBCACB4E; Fri, 13 Sep 2013 00:19:27 +0200 (CEST)
Date: Fri, 13 Sep 2013 00:19:27 +0200
From: Jilles Tjoelker <jilles@stack.nl>
To: Joel Dahl <joel@vnode.se>
Subject: Re: svn commit: r254273 - in head: . include lib lib/libc/iconv
 lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk
Message-ID: <20130912221927.GA473@stack.nl>
References: <201308130715.r7D7F1nu076335@svn.freebsd.org>
 <20130822155835.GA52789@devbox.vnode.local>
 <20130903195241.GA93218@devbox.vnode.local>
 <201309051013.35286.jhb@freebsd.org>
 <20130905201540.GA23637@devbox.vnode.local>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130905201540.GA23637@devbox.vnode.local>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: src-committers@freebsd.org, John Baldwin <jhb@freebsd.org>,
 Peter Wemm <peter@freebsd.org>, svn-src-all@freebsd.org,
 Dimitry Andric <dim@freebsd.org>, gabor@freebsd.org, svn-src-head@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 22:19:44 -0000

On Thu, Sep 05, 2013 at 10:15:40PM +0200, Joel Dahl wrote:
> Installworld is still broken on systems with readonly /usr/obj.

I use this. It makes the mapper.dir and similar files depend on their
actual sources instead of phony targets, and therefore only rebuilt when
needed.

Index: share/i18n/csmapper/Makefile
===================================================================
--- share/i18n/csmapper/Makefile	(revision 255496)
+++ share/i18n/csmapper/Makefile	(working copy)
@@ -6,7 +6,16 @@
 SUBDIR=	APPLE AST BIG5 CNS CP EBCDIC GB GEORGIAN ISO646 ISO-8859 JIS \
 	KAZAKH KOI KS MISC TCVN
 
-mapper.dir: ${SUBDIR}
+.for i in ${SUBDIR}
+${i}/mapper.dir.${i}:
+	${MAKE} -C ${.CURDIR}/${i} all
+mapper.dir: ${i}/mapper.dir.${i}
+${i}/charset.pivot.${i}:
+	${MAKE} -C ${.CURDIR}/${i} all
+charset.pivot: ${i}/charset.pivot.${i}
+.endfor
+
+mapper.dir:
 	> ${.TARGET}
 .for i in ${SUBDIR}
 	cat ${i}/mapper.dir.${i} >> ${.TARGET}
@@ -17,7 +26,7 @@
 FILES+=	mapper.dir mapper.dir.db
 CLEANFILES+= mapper.dir mapper.dir.db
 
-charset.pivot: ${SUBDIR}
+charset.pivot:
 	> ${.TARGET}
 .for i in ${SUBDIR}
 	cat ${i}/charset.pivot.${i} >> ${.TARGET}
Index: share/i18n/esdb/Makefile
===================================================================
--- share/i18n/esdb/Makefile	(revision 255496)
+++ share/i18n/esdb/Makefile	(working copy)
@@ -9,7 +9,16 @@
 FILES+=	esdb.dir esdb.dir.db esdb.alias esdb.alias.db
 CLEANFILES= ${FILES}
 
-esdb.dir: ${SUBDIR}
+.for i in ${SUBDIR}
+${i}/esdb.dir.${i}:
+	${MAKE} -C ${.CURDIR}/${i} all
+esdb.dir: ${i}/esdb.dir.${i}
+${i}/esdb.alias.${i}:
+	${MAKE} -C ${.CURDIR}/${i} all
+esdb.alias: ${i}/esdb.alias.${i}
+.endfor
+
+esdb.dir:
 	> $@
 .for i in ${SUBDIR}
 	cat ${i}/esdb.dir.${i} >>${.TARGET}
@@ -17,7 +26,7 @@
 esdb.dir.db: esdb.dir
 	${MKESDB} -m -o ${.TARGET} ${.ALLSRC}
 
-esdb.alias: ${SUBDIR}
+esdb.alias:
 	> $@
 .for i in ${SUBDIR}
 	cat ${i}/esdb.alias.${i} >>${.TARGET}

-- 
Jilles Tjoelker

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 00:51:37 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E1E8C949;
 Fri, 13 Sep 2013 00:51:37 +0000 (UTC)
 (envelope-from cperciva@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CF1C32AA5;
 Fri, 13 Sep 2013 00:51:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8D0pbDT049664;
 Fri, 13 Sep 2013 00:51:37 GMT
 (envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8D0pbbP049663;
 Fri, 13 Sep 2013 00:51:37 GMT
 (envelope-from cperciva@svn.freebsd.org)
Message-Id: <201309130051.r8D0pbbP049663@svn.freebsd.org>
From: Colin Percival <cperciva@FreeBSD.org>
Date: Fri, 13 Sep 2013 00:51:37 +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: r255502 - stable/9/share/man/man4
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 00:51:38 -0000

Author: cperciva
Date: Fri Sep 13 00:51:37 2013
New Revision: 255502
URL: http://svnweb.freebsd.org/changeset/base/255502

Log:
  MFC r255459:
    Remove documentation describing functionality which geom(4) does not,
    in fact, provide.

Modified:
  stable/9/share/man/man4/geom.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/geom.4
==============================================================================
--- stable/9/share/man/man4/geom.4	Thu Sep 12 22:06:12 2013	(r255501)
+++ stable/9/share/man/man4/geom.4	Fri Sep 13 00:51:37 2013	(r255502)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 25, 2006
+.Dd September 10, 2013
 .Dt GEOM 4
 .Os
 .Sh NAME
@@ -319,24 +319,6 @@ only be done with their cooperation.
 Finally: the spoiling only happens when the write count goes from
 zero to non-zero and the retasting happens only when the write count goes
 from non-zero to zero.
-.It Em INSERT/DELETE
-are very special operations which allow a new geom
-to be instantiated between a consumer and a provider attached to
-each other and to remove it again.
-.Pp
-To understand the utility of this, imagine a provider
-being mounted as a file system.
-Between the DEVFS geom's consumer and its provider we insert
-a mirror module which configures itself with one mirror
-copy and consequently is transparent to the I/O requests
-on the path.
-We can now configure yet a mirror copy on the mirror geom,
-request a synchronization, and finally drop the first mirror
-copy.
-We have now, in essence, moved a mounted file system from one
-disk to another while it was being used.
-At this point the mirror geom can be deleted from the path
-again; it has served its purpose.
 .It Em CONFIGURE
 is the process where the administrator issues instructions
 for a particular class to instantiate itself.

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 01:12:46 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7D3DFEE8;
 Fri, 13 Sep 2013 01:12:46 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6B9F42BC1;
 Fri, 13 Sep 2013 01:12:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8D1CkoS062013;
 Fri, 13 Sep 2013 01:12:46 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8D1CkJ4062012;
 Fri, 13 Sep 2013 01:12:46 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201309130112.r8D1CkJ4062012@svn.freebsd.org>
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
Date: Fri, 13 Sep 2013 01:12:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255503 - head/sys/powerpc/aim
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 01:12:46 -0000

Author: nwhitehorn
Date: Fri Sep 13 01:12:45 2013
New Revision: 255503
URL: http://svnweb.freebsd.org/changeset/base/255503

Log:
  Change VM object lock assertion to match locking higher in the call
  chain. This repairs a panic observed during pageout on some 64-bit
  PowerPC systems.
  
  Submitted by:	grehan
  Approved by:	re (kib)
  MFC after:	2 weeks
  Revisit after:	10.0

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Fri Sep 13 00:51:37 2013	(r255502)
+++ head/sys/powerpc/aim/mmu_oea64.c	Fri Sep 13 01:12:45 2013	(r255503)
@@ -1523,7 +1523,7 @@ moea64_is_modified(mmu_t mmu, vm_page_t 
 	 * concurrently set while the object is locked.  Thus, if PGA_WRITEABLE
 	 * is clear, no PTEs can have LPTE_CHG set.
 	 */
-	VM_OBJECT_ASSERT_WLOCKED(m->object);
+	VM_OBJECT_ASSERT_LOCKED(m->object);
 	if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0)
 		return (FALSE);
 	return (moea64_query_bit(mmu, m, LPTE_CHG));

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 03:39:20 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0F84BFF8;
 Fri, 13 Sep 2013 03:39:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id F0E7822EC;
 Fri, 13 Sep 2013 03:39:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8D3dJVx048603;
 Fri, 13 Sep 2013 03:39:19 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8D3dJ8Y048602;
 Fri, 13 Sep 2013 03:39:19 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201309130339.r8D3dJ8Y048602@svn.freebsd.org>
From: Glen Barber <gjb@FreeBSD.org>
Date: Fri, 13 Sep 2013 03:39:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255505 - head/share/man/man5
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 03:39:20 -0000

Author: gjb
Date: Fri Sep 13 03:39:19 2013
New Revision: 255505
URL: http://svnweb.freebsd.org/changeset/base/255505

Log:
  Do not install freebsd-update.conf.5 manual if WITHOUT_FREEBSD_UPDATE is
  set.
  
  MFC after:	3 days
  Approved by:	re (delphij)
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/share/man/man5/Makefile

Modified: head/share/man/man5/Makefile
==============================================================================
--- head/share/man/man5/Makefile	Fri Sep 13 02:28:44 2013	(r255504)
+++ head/share/man/man5/Makefile	Fri Sep 13 03:39:19 2013	(r255505)
@@ -26,7 +26,6 @@ MAN=	acct.5 \
 	fbtab.5 \
 	fdescfs.5 \
 	forward.5 \
-	freebsd-update.conf.5 \
 	fs.5 \
 	fstab.5 \
 	group.5 \
@@ -87,6 +86,10 @@ ATF=			${.CURDIR}/../../../contrib/atf
 _atf_formats.5=		atf-formats.5
 .endif
 
+.if ${MK_FREEBSD_UPDATE} != "no"
+MAN+=	freebsd-update.conf.5
+.endif
+
 .if ${MK_HESIOD} != "no"
 MAN+=	hesiod.conf.5 
 .endif

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 06:07:26 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 95C55470;
 Fri, 13 Sep 2013 06:07:26 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 694022935;
 Fri, 13 Sep 2013 06:07:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8D67QUJ035598;
 Fri, 13 Sep 2013 06:07:26 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8D67PW7035597;
 Fri, 13 Sep 2013 06:07:25 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309130607.r8D67PW7035597@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 13 Sep 2013 06:07:25 +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: r255507 - stable/9/sys/dev/cpuctl
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 06:07:26 -0000

Author: kib
Date: Fri Sep 13 06:07:25 2013
New Revision: 255507
URL: http://svnweb.freebsd.org/changeset/base/255507

Log:
  MFC r255439:
  Call free() on the pointer returned from malloc().

Modified:
  stable/9/sys/dev/cpuctl/cpuctl.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/cpuctl/cpuctl.c
==============================================================================
--- stable/9/sys/dev/cpuctl/cpuctl.c	Fri Sep 13 04:04:21 2013	(r255506)
+++ stable/9/sys/dev/cpuctl/cpuctl.c	Fri Sep 13 06:07:25 2013	(r255507)
@@ -295,10 +295,10 @@ cpuctl_do_update(int cpu, cpuctl_update_
 static int
 update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
-	void *ptr = NULL;
+	void *ptr;
 	uint64_t rev0, rev1;
 	uint32_t tmp[4];
-	int is_bound = 0;
+	int is_bound;
 	int oldcpu;
 	int ret;
 
@@ -312,10 +312,11 @@ update_intel(int cpu, cpuctl_update_args
 	}
 
 	/*
-	 * 16 byte alignment required.
+	 * 16 byte alignment required.  Rely on the fact that
+	 * malloc(9) always returns the pointer aligned at least on
+	 * the size of the allocation.
 	 */
 	ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
-	ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
 	if (copyin(args->data, ptr, args->size) != 0) {
 		DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
 		    __LINE__, args->data, ptr, args->size);
@@ -408,10 +409,10 @@ fail:
 static int
 update_via(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
-	void *ptr = NULL;
+	void *ptr;
 	uint64_t rev0, rev1, res;
 	uint32_t tmp[4];
-	int is_bound = 0;
+	int is_bound;
 	int oldcpu;
 	int ret;
 
@@ -427,8 +428,7 @@ update_via(int cpu, cpuctl_update_args_t
 	/*
 	 * 4 byte alignment required.
 	 */
-	ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
-	ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
+	ptr = malloc(args->size, M_CPUCTL, M_WAITOK);
 	if (copyin(args->data, ptr, args->size) != 0) {
 		DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
 		    __LINE__, args->data, ptr, args->size);

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 06:18:34 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1CFA48DA;
 Fri, 13 Sep 2013 06:18:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E445329C0;
 Fri, 13 Sep 2013 06:18:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8D6IXPj041906;
 Fri, 13 Sep 2013 06:18:33 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8D6IXvm041905;
 Fri, 13 Sep 2013 06:18:33 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309130618.r8D6IXvm041905@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 13 Sep 2013 06:18:33 +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: r255508 - stable/8/sys/dev/cpuctl
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 06:18:34 -0000

Author: kib
Date: Fri Sep 13 06:18:33 2013
New Revision: 255508
URL: http://svnweb.freebsd.org/changeset/base/255508

Log:
  MFC r255439:
  Call free() on the pointer returned from malloc().

Modified:
  stable/8/sys/dev/cpuctl/cpuctl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/cpuctl/   (props changed)

Modified: stable/8/sys/dev/cpuctl/cpuctl.c
==============================================================================
--- stable/8/sys/dev/cpuctl/cpuctl.c	Fri Sep 13 06:07:25 2013	(r255507)
+++ stable/8/sys/dev/cpuctl/cpuctl.c	Fri Sep 13 06:18:33 2013	(r255508)
@@ -295,10 +295,10 @@ cpuctl_do_update(int cpu, cpuctl_update_
 static int
 update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
-	void *ptr = NULL;
+	void *ptr;
 	uint64_t rev0, rev1;
 	uint32_t tmp[4];
-	int is_bound = 0;
+	int is_bound;
 	int oldcpu;
 	int ret;
 
@@ -312,10 +312,11 @@ update_intel(int cpu, cpuctl_update_args
 	}
 
 	/*
-	 * 16 byte alignment required.
+	 * 16 byte alignment required.  Rely on the fact that
+	 * malloc(9) always returns the pointer aligned at least on
+	 * the size of the allocation.
 	 */
 	ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
-	ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
 	if (copyin(args->data, ptr, args->size) != 0) {
 		DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
 		    __LINE__, args->data, ptr, args->size);
@@ -408,10 +409,10 @@ fail:
 static int
 update_via(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
-	void *ptr = NULL;
+	void *ptr;
 	uint64_t rev0, rev1, res;
 	uint32_t tmp[4];
-	int is_bound = 0;
+	int is_bound;
 	int oldcpu;
 	int ret;
 
@@ -427,8 +428,7 @@ update_via(int cpu, cpuctl_update_args_t
 	/*
 	 * 4 byte alignment required.
 	 */
-	ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
-	ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
+	ptr = malloc(args->size, M_CPUCTL, M_WAITOK);
 	if (copyin(args->data, ptr, args->size) != 0) {
 		DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
 		    __LINE__, args->data, ptr, args->size);

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 06:39:11 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 3D98EBC9;
 Fri, 13 Sep 2013 06:39:11 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 29EBC2AB4;
 Fri, 13 Sep 2013 06:39:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8D6dBNk053664;
 Fri, 13 Sep 2013 06:39:11 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8D6dBnC053663;
 Fri, 13 Sep 2013 06:39:11 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309130639.r8D6dBnC053663@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 13 Sep 2013 06:39:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255509 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 06:39:11 -0000

Author: kib
Date: Fri Sep 13 06:39:10 2013
New Revision: 255509
URL: http://svnweb.freebsd.org/changeset/base/255509

Log:
  Reduce the scope of the proctree_lock. If several processes cause
  continuous calls to the uprintf(9), the proctree_lock could be
  shared-locked for indefinite amount of time, starving exclusive
  requests. Since proctree_lock is needed for fork() and exit(), this
  effectively stops the machine.
  
  While there, do the similar reduction for tprintf(9).
  
  Reported and tested by: pho
  Reviewed by:    ed
  Sponsored by:   The FreeBSD Foundation
  MFC after:	1 week
  Approved by:	re (glebius)

Modified:
  head/sys/kern/subr_prf.c

Modified: head/sys/kern/subr_prf.c
==============================================================================
--- head/sys/kern/subr_prf.c	Fri Sep 13 06:18:33 2013	(r255508)
+++ head/sys/kern/subr_prf.c	Fri Sep 13 06:39:10 2013	(r255509)
@@ -151,26 +151,25 @@ uprintf(const char *fmt, ...)
 	PROC_LOCK(p);
 	if ((p->p_flag & P_CONTROLT) == 0) {
 		PROC_UNLOCK(p);
-		retval = 0;
-		goto out;
+		sx_sunlock(&proctree_lock);
+		return (0);
 	}
 	SESS_LOCK(p->p_session);
 	pca.tty = p->p_session->s_ttyp;
 	SESS_UNLOCK(p->p_session);
 	PROC_UNLOCK(p);
 	if (pca.tty == NULL) {
-		retval = 0;
-		goto out;
+		sx_sunlock(&proctree_lock);
+		return (0);
 	}
 	pca.flags = TOTTY;
 	pca.p_bufr = NULL;
 	va_start(ap, fmt);
 	tty_lock(pca.tty);
+	sx_sunlock(&proctree_lock);
 	retval = kvprintf(fmt, putchar, &pca, 10, ap);
 	tty_unlock(pca.tty);
 	va_end(ap);
-out:
-	sx_sunlock(&proctree_lock);
 	return (retval);
 }
 
@@ -219,13 +218,13 @@ vtprintf(struct proc *p, int pri, const 
 	pca.p_bufr = NULL;
 	if (pca.tty != NULL)
 		tty_lock(pca.tty);
+	sx_sunlock(&proctree_lock);
 	kvprintf(fmt, putchar, &pca, 10, ap);
 	if (pca.tty != NULL)
 		tty_unlock(pca.tty);
 	if (sess != NULL)
 		sess_release(sess);
 	msgbuftrigger = 1;
-	sx_sunlock(&proctree_lock);
 }
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 06:52:24 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 24EE2DB1;
 Fri, 13 Sep 2013 06:52:24 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 12CC02B4F;
 Fri, 13 Sep 2013 06:52:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8D6qNWo062852;
 Fri, 13 Sep 2013 06:52:23 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8D6qNpC062851;
 Fri, 13 Sep 2013 06:52:23 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309130652.r8D6qNpC062851@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 13 Sep 2013 06:52:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255510 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 06:52:24 -0000

Author: kib
Date: Fri Sep 13 06:52:23 2013
New Revision: 255510
URL: http://svnweb.freebsd.org/changeset/base/255510

Log:
  When opening or closing fifo, ensure that the vnode is locked
  exclusively.  Filesystems are assumed to disable shared locking for
  the fifo vnode locks, but some do not.
  
  Reported and tested by:	olgeni
  Discussed with:	avg
  Sponsored by:   The FreeBSD Foundation
  MFC after:	1 week
  Approved by:	re (glebius)

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Fri Sep 13 06:39:10 2013	(r255509)
+++ head/sys/kern/vfs_vnops.c	Fri Sep 13 06:52:23 2013	(r255510)
@@ -267,6 +267,8 @@ vn_open_vnode(struct vnode *vp, int fmod
 				return (error);
 		}
 	}
+	if (vp->v_type == VFIFO && VOP_ISLOCKED(vp) != LK_EXCLUSIVE)
+		vn_lock(vp, LK_UPGRADE | LK_RETRY);
 	if ((error = VOP_OPEN(vp, fmode, cred, td, fp)) != 0)
 		return (error);
 
@@ -358,7 +360,7 @@ vn_close(vp, flags, file_cred, td)
 	struct mount *mp;
 	int error, lock_flags;
 
-	if (!(flags & FWRITE) && vp->v_mount != NULL &&
+	if (vp->v_type != VFIFO && !(flags & FWRITE) && vp->v_mount != NULL &&
 	    vp->v_mount->mnt_kern_flag & MNTK_EXTENDED_SHARED)
 		lock_flags = LK_SHARED;
 	else

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 10:31:36 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 2D13BB11;
 Fri, 13 Sep 2013 10:31:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from mail.allbsd.org (gatekeeper.allbsd.org
 [IPv6:2001:2f0:104:e001::32])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 20C6A27E5;
 Fri, 13 Sep 2013 10:31:34 +0000 (UTC)
Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp
 [122.26.101.49]) (authenticated bits=128)
 by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r8DAVGsH054014
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Fri, 13 Sep 2013 19:31:26 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0)
 by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r8DAVDSC009727;
 Fri, 13 Sep 2013 19:31:16 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Date: Fri, 13 Sep 2013 19:31:07 +0900 (JST)
Message-Id: <20130913.193107.442415180280716069.hrs@allbsd.org>
To: brde@optusnet.com.au
Subject: Re: svn commit: r255486 - in head/lib/libc: gen sys
From: Hiroki Sato <hrs@FreeBSD.org>
In-Reply-To: <20130912222312.K1155@besplex.bde.org>
References: <20130912.203612.1272738297998644471.hrs@allbsd.org>
 <5231A85E.5050802@FreeBSD.org>
 <20130912222312.K1155@besplex.bde.org>
X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530  FFD7 4F2C D3D8 2793 CF2D
X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Multipart/Signed; protocol="application/pgp-signature";
 micalg=pgp-sha1;
 boundary="--Security_Multipart(Fri_Sep_13_19_31_07_2013_994)--"
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org
X-Virus-Status: Clean
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (mail.allbsd.org [133.31.130.32]); Fri, 13 Sep 2013 19:31:27 +0900 (JST)
X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT,
 DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no
 version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
 gatekeeper.allbsd.org
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, bdrewery@FreeBSD.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 10:31:36 -0000

----Security_Multipart(Fri_Sep_13_19_31_07_2013_994)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Bruce Evans <brde@optusnet.com.au> wrote
  in <20130912222312.K1155@besplex.bde.org>:

br> > On 9/12/2013 6:36 AM, Hiroki Sato wrote:
br> >>  I think this kind of changes need a consensus because several POSIX
br> >>  functions use "filedes" in the specification document.  r254484 by
br> >>  pjd was a similar change (s/type/af/ in gethostbyaddr()).
br> >>
br> >>  In SUSv4, fdopen() uses "filedes" and openat() uses "fd", for
br> >>  example.  Consistency throughout our manual pages is generally good.
br> >>  However, I also see the benefit of using the same expression as the
br> >>  specification even if it is inconsistent.  What do you think?
br>
br> Does it really use "filedes"?  POSIX still never uses this in the 2007
br> draft (austin-d2r.pdf).  It uses "fildes" for fdopen(), but "fd" for
br> fdopendir() and openat().  It still uses "fd" for posix_fadvise() and
br> posix_fallocate().  I now think that the "fd"s in POSIX are just
br> style bugs.  The normal "fildes" had only rotted to "fd" in 2 places
br> in 2001, but rotted much further in 2007.

 No, it was fildes, not filedes, as you pointed out.  It seems that my
 fingers preferred "e" over "d" after "fil"...

-- Hiroki

----Security_Multipart(Fri_Sep_13_19_31_07_2013_994)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (FreeBSD)

iEYEABECAAYFAlIy6WsACgkQTyzT2CeTzy2nqACgxSZ9F2ZTUbfmmHSdJ6nHjAeS
N9UAoLuevbIzepH36JjndEwoSKzWrBoi
=u3Jw
-----END PGP SIGNATURE-----

----Security_Multipart(Fri_Sep_13_19_31_07_2013_994)----

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 10:37:25 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0D821CF1;
 Fri, 13 Sep 2013 10:37:25 +0000 (UTC) (envelope-from des@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id EEDC7282A;
 Fri, 13 Sep 2013 10:37:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DAbOLE094741;
 Fri, 13 Sep 2013 10:37:24 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DAbOLd094740;
 Fri, 13 Sep 2013 10:37:24 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201309131037.r8DAbOLd094740@svn.freebsd.org>
From: Dag-Erling Smørgrav <des@FreeBSD.org>
Date: Fri, 13 Sep 2013 10:37:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255511 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 10:37:25 -0000

Author: des
Date: Fri Sep 13 10:37:24 2013
New Revision: 255511
URL: http://svnweb.freebsd.org/changeset/base/255511

Log:
  Note about the OpenSSH change.
  
  Approved by:	re (gjb)

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Fri Sep 13 06:52:23 2013	(r255510)
+++ head/UPDATING	Fri Sep 13 10:37:24 2013	(r255511)
@@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20130911:
+	OpenSSH is now built with DNSSEC support, and will by default
+	silently trust signed SSHFP records.  This can be controlled with
+	the VerifyHostKeyDNS client configuration setting.  DNSSEC support
+	can be disabled entirely with the WITHOUT_LDNS option in src.conf.
+
 20130906:
 	The GNU Compiler Collection and C++ standard library (libstdc++)
 	are no longer built by default on platforms where clang is the system

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 11:57:53 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id F220DDD2;
 Fri, 13 Sep 2013 11:57:52 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id DF0532CBB;
 Fri, 13 Sep 2013 11:57:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DBvqaE041692;
 Fri, 13 Sep 2013 11:57:52 GMT
 (envelope-from bdrewery@svn.freebsd.org)
Received: (from bdrewery@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DBvq01041691;
 Fri, 13 Sep 2013 11:57:52 GMT
 (envelope-from bdrewery@svn.freebsd.org)
Message-Id: <201309131157.r8DBvq01041691@svn.freebsd.org>
From: Bryan Drewery <bdrewery@FreeBSD.org>
Date: Fri, 13 Sep 2013 11:57:52 +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: r255514 - stable/9
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 11:57:53 -0000

Author: bdrewery (ports committer)
Date: Fri Sep 13 11:57:52 2013
New Revision: 255514
URL: http://svnweb.freebsd.org/changeset/base/255514

Log:
  MFC r255048:
  
    - Fix LOCAL_MTREE so it properly handles multiple files and quotes
      its value into submakes
  
  PR:		conf/179466
  Submitted by:	Garrett Cooper <yaneurabeya@gmail.com>
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  stable/9/Makefile.inc1   (contents, props changed)
Directory Properties:
  stable/9/   (props changed)

Modified: stable/9/Makefile.inc1
==============================================================================
--- stable/9/Makefile.inc1	Fri Sep 13 11:25:42 2013	(r255513)
+++ stable/9/Makefile.inc1	Fri Sep 13 11:57:52 2013	(r255514)
@@ -270,7 +270,7 @@ WMAKEENV=	${CROSSENV} \
 		PATH=${TMPPATH}
 
 # make hierarchy
-HMAKE=		PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE}
+HMAKE=		PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q}
 .if defined(NO_ROOT)
 HMAKE+=		PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT
 .endif
@@ -768,7 +768,7 @@ distributeworld installworld: installche
 	cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
 	    METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \
 	    DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \
-	    LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs
+	    LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
 .endif
 	${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
 	    ${IMAKEENV} rm -rf ${INSTALLTMP}
@@ -814,7 +814,7 @@ reinstall:
 	@echo ">>> Making hierarchy"
 	@echo "--------------------------------------------------------------"
 	${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
-	    LOCAL_MTREE=${LOCAL_MTREE} hierarchy
+	    LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy
 	@echo
 	@echo "--------------------------------------------------------------"
 	@echo ">>> Installing everything"

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 13:53:22 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 31EB2B37;
 Fri, 13 Sep 2013 13:53:22 +0000 (UTC) (envelope-from avg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1E8592446;
 Fri, 13 Sep 2013 13:53:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DDrL1b010686;
 Fri, 13 Sep 2013 13:53:21 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DDrLeb010685;
 Fri, 13 Sep 2013 13:53:21 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201309131353.r8DDrLeb010685@svn.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Date: Fri, 13 Sep 2013 13:53: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: r255515 - stable/9/sys/cddl/dev/fbt
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 13:53:22 -0000

Author: avg
Date: Fri Sep 13 13:53:21 2013
New Revision: 255515
URL: http://svnweb.freebsd.org/changeset/base/255515

Log:
  MFC r254713: fbt: drop a local write-only variable

Modified:
  stable/9/sys/cddl/dev/fbt/fbt.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cddl/dev/fbt/fbt.c
==============================================================================
--- stable/9/sys/cddl/dev/fbt/fbt.c	Fri Sep 13 11:57:52 2013	(r255514)
+++ stable/9/sys/cddl/dev/fbt/fbt.c	Fri Sep 13 13:53:21 2013	(r255515)
@@ -574,7 +574,6 @@ static int
 fbt_ctfoff_init(modctl_t *lf, linker_ctf_t *lc)
 {
 	const Elf_Sym *symp = lc->symtab;;
-	const char *name;
 	const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;
 	const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t);
 	int i;
@@ -606,11 +605,6 @@ fbt_ctfoff_init(modctl_t *lf, linker_ctf
 			continue;
 		}
 
-		if (symp->st_name < lc->strcnt)
-			name = lc->strtab + symp->st_name;
-		else
-			name = "(?)";
-
 		switch (ELF_ST_TYPE(symp->st_info)) {
 		case STT_OBJECT:
 			if (objtoff >= hp->cth_funcoff ||

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 13:53:48 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 3975EC64;
 Fri, 13 Sep 2013 13:53:48 +0000 (UTC) (envelope-from avg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 261DE244B;
 Fri, 13 Sep 2013 13:53:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DDrmp3010915;
 Fri, 13 Sep 2013 13:53:48 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DDrmdR010914;
 Fri, 13 Sep 2013 13:53:48 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201309131353.r8DDrmdR010914@svn.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Date: Fri, 13 Sep 2013 13:53:47 +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: r255516 - stable/8/sys/cddl/dev/fbt
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 13:53:48 -0000

Author: avg
Date: Fri Sep 13 13:53:47 2013
New Revision: 255516
URL: http://svnweb.freebsd.org/changeset/base/255516

Log:
  MFC r254713: fbt: drop a local write-only variable

Modified:
  stable/8/sys/cddl/dev/fbt/fbt.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/   (props changed)

Modified: stable/8/sys/cddl/dev/fbt/fbt.c
==============================================================================
--- stable/8/sys/cddl/dev/fbt/fbt.c	Fri Sep 13 13:53:21 2013	(r255515)
+++ stable/8/sys/cddl/dev/fbt/fbt.c	Fri Sep 13 13:53:47 2013	(r255516)
@@ -574,7 +574,6 @@ static int
 fbt_ctfoff_init(modctl_t *lf, linker_ctf_t *lc)
 {
 	const Elf_Sym *symp = lc->symtab;;
-	const char *name;
 	const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;
 	const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t);
 	int i;
@@ -606,11 +605,6 @@ fbt_ctfoff_init(modctl_t *lf, linker_ctf
 			continue;
 		}
 
-		if (symp->st_name < lc->strcnt)
-			name = lc->strtab + symp->st_name;
-		else
-			name = "(?)";
-
 		switch (ELF_ST_TYPE(symp->st_info)) {
 		case STT_OBJECT:
 			if (objtoff >= hp->cth_funcoff ||

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 14:03:40 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1D42B19B;
 Fri, 13 Sep 2013 14:03:40 +0000 (UTC) (envelope-from avg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 05CC024DE;
 Fri, 13 Sep 2013 14:03:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DE3dah017097;
 Fri, 13 Sep 2013 14:03:39 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DE3ddx017094;
 Fri, 13 Sep 2013 14:03:39 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201309131403.r8DE3ddx017094@svn.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Date: Fri, 13 Sep 2013 14:03:39 +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: r255517 - in
 stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 14:03:40 -0000

Author: avg
Date: Fri Sep 13 14:03:39 2013
New Revision: 255517
URL: http://svnweb.freebsd.org/changeset/base/255517

Log:
  MFC r254445,254711: zfs: inline and remove zfs_vnode_lock

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h	Fri Sep 13 13:53:47 2013	(r255516)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h	Fri Sep 13 14:03:39 2013	(r255517)
@@ -153,7 +153,6 @@ extern int zfs_set_version(zfsvfs_t *zfs
 extern int zfsvfs_create(const char *name, zfsvfs_t **zfvp);
 extern void zfsvfs_free(zfsvfs_t *zfsvfs);
 extern int zfs_check_global_label(const char *dsname, const char *hexsl);
-extern int zfs_vnode_lock(vnode_t *vp, int flags);
 
 #ifdef _KERNEL
 extern void zfsvfs_update_fromname(const char *oldname, const char *newname);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Fri Sep 13 13:53:47 2013	(r255516)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Fri Sep 13 14:03:39 2013	(r255517)
@@ -1797,17 +1797,6 @@ zfs_statfs(vfs_t *vfsp, struct statfs *s
 	return (0);
 }
 
-int
-zfs_vnode_lock(vnode_t *vp, int flags)
-{
-	int error;
-
-	ASSERT(vp != NULL);
-
-	error = vn_lock(vp, flags);
-	return (error);
-}
-
 static int
 zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp)
 {
@@ -1824,7 +1813,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 	ZFS_EXIT(zfsvfs);
 
 	if (error == 0) {
-		error = zfs_vnode_lock(*vpp, flags);
+		error = vn_lock(*vpp, flags);
 		if (error == 0)
 			(*vpp)->v_vflag |= VV_ROOT;
 	}
@@ -2083,7 +2072,7 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla
 		*vpp = ZTOV(zp);
 	ZFS_EXIT(zfsvfs);
 	if (err == 0)
-		err = zfs_vnode_lock(*vpp, flags);
+		err = vn_lock(*vpp, flags);
 	if (err != 0)
 		*vpp = NULL;
 	else
@@ -2182,7 +2171,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int
 			VN_HOLD(*vpp);
 		}
 		ZFS_EXIT(zfsvfs);
-		err = zfs_vnode_lock(*vpp, flags);
+		err = vn_lock(*vpp, flags);
 		if (err != 0)
 			*vpp = NULL;
 		return (err);
@@ -2209,7 +2198,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int
 
 	*vpp = ZTOV(zp);
 	ZFS_EXIT(zfsvfs);
-	err = zfs_vnode_lock(*vpp, flags | LK_RETRY);
+	err = vn_lock(*vpp, flags | LK_RETRY);
 	if (err == 0)
 		vnode_create_vobject(*vpp, zp->z_size, curthread);
 	else

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	Fri Sep 13 13:53:47 2013	(r255516)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Fri Sep 13 14:03:39 2013	(r255517)
@@ -1520,7 +1520,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode
 			VOP_UNLOCK(dvp, 0);
 		}
 		ZFS_EXIT(zfsvfs);
-		error = zfs_vnode_lock(*vpp, cnp->cn_lkflags);
+		error = vn_lock(*vpp, cnp->cn_lkflags);
 		if (cnp->cn_flags & ISDOTDOT)
 			vn_lock(dvp, ltype | LK_RETRY);
 		if (error != 0) {

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 14:07:33 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 4AA3E306;
 Fri, 13 Sep 2013 14:07:33 +0000 (UTC) (envelope-from avg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 35FB724FE;
 Fri, 13 Sep 2013 14:07:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DE7X31018448;
 Fri, 13 Sep 2013 14:07:33 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DE7Wnv018442;
 Fri, 13 Sep 2013 14:07:32 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201309131407.r8DE7Wnv018442@svn.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Date: Fri, 13 Sep 2013 14:07:32 +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: r255518 - in
 stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 14:07:33 -0000

Author: avg
Date: Fri Sep 13 14:07:32 2013
New Revision: 255518
URL: http://svnweb.freebsd.org/changeset/base/255518

Log:
  MFC r254445,254711: zfs: inline and remove zfs_vnode_lock

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h	Fri Sep 13 14:03:39 2013	(r255517)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h	Fri Sep 13 14:07:32 2013	(r255518)
@@ -153,7 +153,6 @@ extern int zfs_set_version(zfsvfs_t *zfs
 extern int zfsvfs_create(const char *name, zfsvfs_t **zfvp);
 extern void zfsvfs_free(zfsvfs_t *zfsvfs);
 extern int zfs_check_global_label(const char *dsname, const char *hexsl);
-extern int zfs_vnode_lock(vnode_t *vp, int flags);
 
 #ifdef _KERNEL
 extern void zfsvfs_update_fromname(const char *oldname, const char *newname);

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Fri Sep 13 14:03:39 2013	(r255517)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Fri Sep 13 14:07:32 2013	(r255518)
@@ -1793,17 +1793,6 @@ zfs_statfs(vfs_t *vfsp, struct statfs *s
 	return (0);
 }
 
-int
-zfs_vnode_lock(vnode_t *vp, int flags)
-{
-	int error;
-
-	ASSERT(vp != NULL);
-
-	error = vn_lock(vp, flags);
-	return (error);
-}
-
 static int
 zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp)
 {
@@ -1820,7 +1809,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 	ZFS_EXIT(zfsvfs);
 
 	if (error == 0) {
-		error = zfs_vnode_lock(*vpp, flags);
+		error = vn_lock(*vpp, flags);
 		if (error == 0)
 			(*vpp)->v_vflag |= VV_ROOT;
 	}
@@ -2079,7 +2068,7 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla
 		*vpp = ZTOV(zp);
 	ZFS_EXIT(zfsvfs);
 	if (err == 0)
-		err = zfs_vnode_lock(*vpp, flags);
+		err = vn_lock(*vpp, flags);
 	if (err != 0)
 		*vpp = NULL;
 	return (err);
@@ -2176,7 +2165,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno
 			VN_HOLD(*vpp);
 		}
 		ZFS_EXIT(zfsvfs);
-		err = zfs_vnode_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
+		err = vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
 		if (err != 0)
 			*vpp = NULL;
 		return (err);
@@ -2203,7 +2192,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno
 
 	*vpp = ZTOV(zp);
 	ZFS_EXIT(zfsvfs);
-	err = zfs_vnode_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
+	err = vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
 	if (err == 0)
 		vnode_create_vobject(*vpp, zp->z_size, curthread);
 	else

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Fri Sep 13 14:03:39 2013	(r255517)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Fri Sep 13 14:07:32 2013	(r255518)
@@ -1509,7 +1509,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode
 			VOP_UNLOCK(dvp, 0);
 		}
 		ZFS_EXIT(zfsvfs);
-		error = zfs_vnode_lock(*vpp, cnp->cn_lkflags);
+		error = vn_lock(*vpp, cnp->cn_lkflags);
 		if (cnp->cn_flags & ISDOTDOT)
 			vn_lock(dvp, ltype | LK_RETRY);
 		if (error != 0) {

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 14:15:38 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C279F5E2;
 Fri, 13 Sep 2013 14:15:38 +0000 (UTC) (envelope-from avg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id AD5C0256E;
 Fri, 13 Sep 2013 14:15:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DEFcio023978;
 Fri, 13 Sep 2013 14:15:38 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DEFccp023977;
 Fri, 13 Sep 2013 14:15:38 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201309131415.r8DEFccp023977@svn.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Date: Fri, 13 Sep 2013 14:15:38 +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: r255519 -
 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 14:15:38 -0000

Author: avg
Date: Fri Sep 13 14:15:38 2013
New Revision: 255519
URL: http://svnweb.freebsd.org/changeset/base/255519

Log:
  MFC r254714: zfs: do not reject any operations on a pool just because
  it's a boot pool

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  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_ioctl.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Fri Sep 13 14:07:32 2013	(r255518)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Fri Sep 13 14:15:38 2013	(r255519)
@@ -1828,6 +1828,7 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc)
 	(void) nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_SPARES,
 	    &spares, &nspares);
 
+#ifdef illumos
 	/*
 	 * A root pool with concatenated devices is not supported.
 	 * Thus, can not add a device to a root pool.
@@ -1843,6 +1844,7 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc)
 		spa_close(spa, FTAG);
 		return (SET_ERROR(EDOM));
 	}
+#endif /* illumos */
 
 	if (error == 0) {
 		error = spa_vdev_add(spa, config);

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 14:15:52 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E9AD370F;
 Fri, 13 Sep 2013 14:15:52 +0000 (UTC) (envelope-from avg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id D694B2571;
 Fri, 13 Sep 2013 14:15:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DEFqEc024119;
 Fri, 13 Sep 2013 14:15:52 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DEFqC5024118;
 Fri, 13 Sep 2013 14:15:52 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201309131415.r8DEFqC5024118@svn.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Date: Fri, 13 Sep 2013 14:15:52 +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: r255520 -
 stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 14:15:53 -0000

Author: avg
Date: Fri Sep 13 14:15:52 2013
New Revision: 255520
URL: http://svnweb.freebsd.org/changeset/base/255520

Log:
  MFC r254714: zfs: do not reject any operations on a pool just because
  it's a boot pool

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Fri Sep 13 14:15:38 2013	(r255519)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Fri Sep 13 14:15:52 2013	(r255520)
@@ -1828,6 +1828,7 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc)
 	(void) nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_SPARES,
 	    &spares, &nspares);
 
+#ifdef illumos
 	/*
 	 * A root pool with concatenated devices is not supported.
 	 * Thus, can not add a device to a root pool.
@@ -1843,6 +1844,7 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc)
 		spa_close(spa, FTAG);
 		return (SET_ERROR(EDOM));
 	}
+#endif /* illumos */
 
 	if (error == 0) {
 		error = spa_vdev_add(spa, config);

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 16:57:29 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E86F1271;
 Fri, 13 Sep 2013 16:57:28 +0000 (UTC) (envelope-from jmg@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C621D2EC6;
 Fri, 13 Sep 2013 16:57:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DGvSRG020063;
 Fri, 13 Sep 2013 16:57:28 GMT (envelope-from jmg@svn.freebsd.org)
Received: (from jmg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DGvSnd020061;
 Fri, 13 Sep 2013 16:57:28 GMT (envelope-from jmg@svn.freebsd.org)
Message-Id: <201309131657.r8DGvSnd020061@svn.freebsd.org>
From: John-Mark Gurney <jmg@FreeBSD.org>
Date: Fri, 13 Sep 2013 16:57:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255521 - head/usr.sbin/daemon
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 16:57:29 -0000

Author: jmg
Date: Fri Sep 13 16:57:28 2013
New Revision: 255521
URL: http://svnweb.freebsd.org/changeset/base/255521

Log:
  add support for writing the pid of the daemon program to a pid file so
  that daemon can be used w/ rc.subr and ports can use the additional
  functionality, such as keeping the ldap daemon up and running, and have
  the proper program to signal to exit..
  
  PR:		bin/181341
  Submitted by:	feld
  Approved by:	re (glebius)

Modified:
  head/usr.sbin/daemon/daemon.8
  head/usr.sbin/daemon/daemon.c

Modified: head/usr.sbin/daemon/daemon.8
==============================================================================
--- head/usr.sbin/daemon/daemon.8	Fri Sep 13 14:15:52 2013	(r255520)
+++ head/usr.sbin/daemon/daemon.8	Fri Sep 13 16:57:28 2013	(r255521)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 4, 2012
+.Dd September 13, 2013
 .Dt DAEMON 8
 .Os
 .Sh NAME
@@ -35,7 +35,8 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl cfr
-.Op Fl p Ar pidfile
+.Op Fl p Ar child_pidfile
+.Op Fl P Ar supervisor_pidfile
 .Op Fl u Ar user
 .Ar command arguments ...
 .Sh DESCRIPTION
@@ -53,19 +54,39 @@ Change the current working directory to 
 .It Fl f
 Redirect standard input, standard output and standard error to
 .Pa /dev/null .
-.It Fl p Ar file
+.It Fl p Ar child_pidfile
 Write the ID of the created process into the
-.Ar file
+.Ar child_pidfile
 using the
 .Xr pidfile 3
 functionality.
 The program is executed in a spawned child process while the
 .Nm
 waits until it terminates to keep the
-.Ar file
+.Ar child_pidfile
 locked and removes it after the process exits.
 The
-.Ar file
+.Ar child_pidfile
+owner is the user who runs the
+.Nm
+regardless of whether the
+.Fl u
+option is used or not.
+.It Fl P Ar supervisor_pidfile
+Write the ID of the 
+.Nm
+process into the
+.Ar supervisor_pidfile
+using the
+.Xr pidfile 3
+functionality.
+The program is executed in a spawned child process while the
+.Nm
+waits until it terminates to keep the
+.Ar supervisor_pidfile
+locked and removes it after the process exits.
+The
+.Ar supervisor_pidfile
 owner is the user who runs the
 .Nm
 regardless of whether the
@@ -79,27 +100,46 @@ Requires adequate superuser privileges.
 .El
 .Pp
 If the
-.Fl p
+.Fl p ,
+.Fl P
 or
 .Fl r
 option is specified the program is executed in a spawned child process.
 The
 .Nm
-waits until it terminates to keep the pid file locked and removes it
+waits until it terminates to keep the pid file(s) locked and removes them
 after the process exits or restarts the program.
 In this case if the monitoring
 .Nm
 receives software termination signal (SIGTERM) it forwards it to the
 spawned process.
-Normally it will cause the child to exit followed by the termination
-of the supervising process after removing the pidfile.
+Normally it will cause the child to exit, remove the pidfile(s)
+and then terminate.
+.Pp
+The
+.Fl P
+option is useful combined with the
+.Fl r
+option as 
+.Ar supervisor_pidfile
+contains the ID of the supervisor
+not the child. This is especially important if you use
+.Fl r
+in an rc script as the
+.Fl p
+option will give you the child's ID to signal when you attempt to
+stop the service, causing 
+.Nm
+to restart the child.
 .Sh EXIT STATUS
 The
 .Nm
 utility exits 1 if an error is returned by the
 .Xr daemon 3
-library routine, 2 if the
-.Ar pidfile
+library routine, 2 if
+.Ar child_pidfile
+or
+.Ar supervisor_pidfile
 is requested, but cannot be opened, 3 if process is already running (pidfile
 exists and is locked),
 otherwise 0.

Modified: head/usr.sbin/daemon/daemon.c
==============================================================================
--- head/usr.sbin/daemon/daemon.c	Fri Sep 13 14:15:52 2013	(r255520)
+++ head/usr.sbin/daemon/daemon.c	Fri Sep 13 16:57:28 2013	(r255521)
@@ -53,16 +53,17 @@ static void usage(void);
 int
 main(int argc, char *argv[])
 {
-	struct pidfh *pfh = NULL;
+	struct pidfh  *ppfh, *pfh;
 	sigset_t mask, oldmask;
 	int ch, nochdir, noclose, restart;
-	const char *pidfile, *user;
+	const char *pidfile, *ppidfile,  *user;
 	pid_t otherpid, pid;
 
 	nochdir = noclose = 1;
 	restart = 0;
-	pidfile = user = NULL;
-	while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) {
+	ppfh = pfh = NULL;
+	ppidfile = pidfile = user = NULL;
+	while ((ch = getopt(argc, argv, "cfp:P:ru:")) != -1) {
 		switch (ch) {
 		case 'c':
 			nochdir = 0;
@@ -73,6 +74,9 @@ main(int argc, char *argv[])
 		case 'p':
 			pidfile = optarg;
 			break;
+		case 'P':
+			ppidfile = optarg;
+			break;
 		case 'r':
 			restart = 1;
 			break;
@@ -89,7 +93,7 @@ main(int argc, char *argv[])
 	if (argc == 0)
 		usage();
 
-	pfh = NULL;
+	ppfh = pfh = NULL;
 	/*
 	 * Try to open the pidfile before calling daemon(3),
 	 * to be able to report the error intelligently
@@ -104,6 +108,18 @@ main(int argc, char *argv[])
 			err(2, "pidfile ``%s''", pidfile);
 		}
 	}
+	
+	/* do same for actual daemon process */
+	if (ppidfile != NULL) {
+		ppfh = pidfile_open(ppidfile, 0600, &otherpid);
+		if (ppfh == NULL) {
+			if (errno == EEXIST) {
+				errx(3, "process already running, pid: %d",
+				     otherpid);
+			}
+			err(2, "ppidfile ``%s''", ppidfile);
+		}
+	}
 
 	if (daemon(nochdir, noclose) == -1)
 		err(1, NULL);
@@ -176,12 +192,17 @@ restart:
 		 */
 		err(1, "%s", argv[0]);
 	}
+	/* write out parent pidfile if needed */
+	if (ppidfile != NULL)
+		pidfile_write(ppfh);
+
 	setproctitle("%s[%d]", argv[0], pid);
 	if (wait_child(pid, &mask) == 0 && restart) {
 		sleep(1);
 		goto restart;
 	}
 	pidfile_remove(pfh);
+	pidfile_remove(ppfh);
 	exit(0); /* Exit status does not matter. */
 }
 
@@ -240,7 +261,7 @@ static void
 usage(void)
 {
 	(void)fprintf(stderr,
-	    "usage: daemon [-cfr] [-p pidfile] [-u user] command "
-		"arguments ...\n");
+	    "usage: daemon [-cfr] [-p child_pidfile] [-P supervisor_pidfile] "
+	    "[-u user]\n              command arguments ...\n");
 	exit(1);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 18:21:32 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1138A7B9;
 Fri, 13 Sep 2013 18:21:32 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E3EC72765;
 Fri, 13 Sep 2013 18:21:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DILVL0071703;
 Fri, 13 Sep 2013 18:21:31 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DILV9o071701;
 Fri, 13 Sep 2013 18:21:31 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201309131821.r8DILV9o071701@svn.freebsd.org>
From: Ed Maste <emaste@FreeBSD.org>
Date: Fri, 13 Sep 2013 18:21:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255522 - in head/contrib/binutils: binutils include/elf
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 18:21:32 -0000

Author: emaste
Date: Fri Sep 13 18:21:31 2013
New Revision: 255522
URL: http://svnweb.freebsd.org/changeset/base/255522

Log:
  Improve readelf notes output for Linux ELF files
  
  Add four ELF note constants:
  - NT_FILE and NT_SIGINFO (core file notes output by recent Linux kernels)
  - NT_GNU_ABI_TAG (was incorrectly reported as NT_VERSION)
  - NT_GNU_BUILD_ID (used for locating standalone debug files)
  
  Approved by:	re (kib)

Modified:
  head/contrib/binutils/binutils/readelf.c
  head/contrib/binutils/include/elf/common.h

Modified: head/contrib/binutils/binutils/readelf.c
==============================================================================
--- head/contrib/binutils/binutils/readelf.c	Fri Sep 13 16:57:28 2013	(r255521)
+++ head/contrib/binutils/binutils/readelf.c	Fri Sep 13 18:21:31 2013	(r255522)
@@ -9109,6 +9109,10 @@ get_note_type (unsigned e_type)
 	return _("NT_LWPSINFO (lwpsinfo_t structure)");
       case NT_WIN32PSTATUS:
 	return _("NT_WIN32PSTATUS (win32_pstatus structure)");
+      case NT_FILE:
+        return _("NT_FILE");
+      case NT_SIGINFO:
+        return _("NT_SIGINFO");
       default:
 	break;
       }
@@ -9174,6 +9178,23 @@ get_freebsd_note_type (unsigned e_type)
 }
 
 static const char *
+get_gnu_note_type (unsigned e_type)
+{
+  static char buff[64];
+
+  switch (e_type)
+    {
+    case NT_GNU_ABI_TAG:
+      return _("NT_GNU_ABI_TAG");
+    case NT_GNU_BUILD_ID:
+      return _("NT_GNU_BUILD_ID");
+    }
+
+  snprintf (buff, sizeof(buff), _("Unknown GNU note type: (0x%08x)"), e_type);
+  return buff;
+}
+
+static const char *
 get_netbsd_elfcore_note_type (unsigned e_type)
 {
   static char buff[64];
@@ -9254,6 +9275,10 @@ process_note (Elf_Internal_Note *pnote)
     /* FreeBSD-specific core file notes.  */
     nt = get_freebsd_note_type (pnote->type);
 
+  else if (const_strneq (pnote->namedata, "GNU"))
+    /* GNU-specific notes */
+    nt = get_gnu_note_type (pnote->type);
+
   else if (const_strneq (pnote->namedata, "NetBSD-CORE"))
     /* NetBSD-specific core file notes.  */
     nt = get_netbsd_elfcore_note_type (pnote->type);

Modified: head/contrib/binutils/include/elf/common.h
==============================================================================
--- head/contrib/binutils/include/elf/common.h	Fri Sep 13 16:57:28 2013	(r255521)
+++ head/contrib/binutils/include/elf/common.h	Fri Sep 13 18:21:31 2013	(r255522)
@@ -388,8 +388,10 @@
 #define NT_PRPSINFO	3		/* Contains copy of prpsinfo struct */
 #define NT_TASKSTRUCT	4		/* Contains copy of task struct */
 #define NT_AUXV		6		/* Contains copy of Elfxx_auxv_t */
+#define NT_FILE		0x46494c45
 #define NT_PRXFPREG	0x46e62b7f	/* Contains a user_xfpregs_struct; */
 					/*   note name must be "LINUX".  */
+#define NT_SIGINFO	0x53494749
 
 /* Note segments for core files on dir-style procfs systems.  */
 
@@ -435,6 +437,9 @@
 #define GNU_ABI_TAG_FREEBSD	3
 #define GNU_ABI_TAG_NETBSD	4
 
+/* Values for GNU .note.gnu.build-id notes.  Note name is "GNU"." */
+#define NT_GNU_BUILD_ID		3
+
 /* Values for NetBSD .note.netbsd.ident notes.  Note name is "NetBSD".  */
 
 #define NT_NETBSD_IDENT		1

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 18:45:11 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1041950C;
 Fri, 13 Sep 2013 18:45:11 +0000 (UTC)
 (envelope-from trociny@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id F256C2A2D;
 Fri, 13 Sep 2013 18:45:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DIjAhC085071;
 Fri, 13 Sep 2013 18:45:10 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DIjAlb085069;
 Fri, 13 Sep 2013 18:45:10 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201309131845.r8DIjAlb085069@svn.freebsd.org>
From: Mikolaj Golub <trociny@FreeBSD.org>
Date: Fri, 13 Sep 2013 18:45:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255523 - in head/sys: netinet 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 18:45:11 -0000

Author: trociny
Date: Fri Sep 13 18:45:10 2013
New Revision: 255523
URL: http://svnweb.freebsd.org/changeset/base/255523

Log:
  Unregister inet/inet6 pfil hooks on vnet destroy.
  
  Discussed with:	andre
  Approved by:	re (rodrigc)

Modified:
  head/sys/netinet/ip_input.c
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Fri Sep 13 18:21:31 2013	(r255522)
+++ head/sys/netinet/ip_input.c	Fri Sep 13 18:45:10 2013	(r255523)
@@ -363,6 +363,11 @@ ip_init(void)
 void
 ip_destroy(void)
 {
+	int i;
+
+	if ((i = pfil_head_unregister(&V_inet_pfil_hook)) != 0)
+		printf("%s: WARNING: unable to unregister pfil hook, "
+		    "error %d\n", __func__, i);
 
 	/* Cleanup in_ifaddr hash table; should be empty. */
 	hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask);

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Fri Sep 13 18:21:31 2013	(r255522)
+++ head/sys/netinet6/ip6_input.c	Fri Sep 13 18:45:10 2013	(r255523)
@@ -307,7 +307,11 @@ ip6proto_unregister(short ip6proto)
 void
 ip6_destroy()
 {
+	int i;
 
+	if ((i = pfil_head_unregister(&V_inet6_pfil_hook)) != 0)
+		printf("%s: WARNING: unable to unregister pfil hook, "
+		    "error %d\n", __func__, i);
 	hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask);
 	nd6_destroy();
 	callout_drain(&V_in6_tmpaddrtimer_ch);

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 18:47:59 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 9F33C662;
 Fri, 13 Sep 2013 18:47:59 +0000 (UTC)
 (envelope-from grehan@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 720F82A43;
 Fri, 13 Sep 2013 18:47:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DIlxX1085993;
 Fri, 13 Sep 2013 18:47:59 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DIlw3k085966;
 Fri, 13 Sep 2013 18:47:58 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201309131847.r8DIlw3k085966@svn.freebsd.org>
From: Peter Grehan <grehan@FreeBSD.org>
Date: Fri, 13 Sep 2013 18:47:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255524 - in head/sys: amd64/conf conf dev/hyperv modules
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 18:47:59 -0000

Author: grehan
Date: Fri Sep 13 18:47:58 2013
New Revision: 255524
URL: http://svnweb.freebsd.org/changeset/base/255524

Log:
  Import Hyper-V paravirtualized drivers from projects/hyperv
  branch into head.
  
  Approved by:	re@ (hrs)
  Obtained from:	Microsoft, NetApp, and Citrix.

Added:
  head/sys/dev/hyperv/
     - copied from r255521, projects/hyperv/sys/dev/hyperv/
     - copied from r255521, projects/hyperv/sys/modules/hyperv/
Directory Properties:
  head/sys/modules/hyperv/   (props changed)
Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/conf/files.amd64
  head/sys/modules/Makefile

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Fri Sep 13 18:45:10 2013	(r255523)
+++ head/sys/amd64/conf/GENERIC	Fri Sep 13 18:47:58 2013	(r255524)
@@ -340,3 +340,7 @@ device		vtnet		# VirtIO Ethernet device
 device		virtio_blk	# VirtIO Block device
 device		virtio_scsi	# VirtIO SCSI device
 device		virtio_balloon	# VirtIO Memory Balloon device
+
+# HyperV drivers
+device		hyperv		# HyperV drivers
+

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Fri Sep 13 18:45:10 2013	(r255523)
+++ head/sys/conf/files.amd64	Fri Sep 13 18:47:58 2013	(r255524)
@@ -221,6 +221,18 @@ dev/hwpmc/hwpmc_uncore.c	optional	hwpmc
 dev/hwpmc/hwpmc_piv.c		optional	hwpmc
 dev/hwpmc/hwpmc_tsc.c		optional	hwpmc
 dev/hwpmc/hwpmc_x86.c		optional	hwpmc
+dev/hyperv/netvsc/hv_net_vsc.c				optional	hyperv
+dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c		optional	hyperv
+dev/hyperv/netvsc/hv_rndis_filter.c			optional	hyperv
+dev/hyperv/stordisengage/hv_ata_pci_disengage.c		optional	hyperv
+dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c		optional	hyperv
+dev/hyperv/utilities/hv_util.c				optional	hyperv
+dev/hyperv/vmbus/hv_channel.c				optional	hyperv
+dev/hyperv/vmbus/hv_channel_mgmt.c			optional	hyperv
+dev/hyperv/vmbus/hv_connection.c			optional	hyperv
+dev/hyperv/vmbus/hv_hv.c				optional	hyperv
+dev/hyperv/vmbus/hv_ring_buffer.c			optional	hyperv
+dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c			optional	hyperv
 dev/kbd/kbd.c			optional	atkbd | sc | ukbd
 dev/lindev/full.c		optional	lindev
 dev/lindev/lindev.c		optional	lindev

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Fri Sep 13 18:45:10 2013	(r255523)
+++ head/sys/modules/Makefile	Fri Sep 13 18:47:58 2013	(r255524)
@@ -126,6 +126,7 @@ SUBDIR=	\
 	${_hptnr} \
 	${_hptrr} \
 	hwpmc \
+	${_hyperv} \
 	${_i2c} \
 	${_ibcs2} \
 	${_ichwd} \
@@ -671,6 +672,7 @@ _hptmv=		hptmv
 _hptnr=		hptnr
 _hptrr=		hptrr
 .endif
+_hyperv=	hyperv
 _i2c=		i2c
 _ichwd=		ichwd
 _ida=		ida

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 19:08:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B2AAFB7E;
 Fri, 13 Sep 2013 19:08:10 +0000 (UTC)
 (envelope-from joel@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A13102B38;
 Fri, 13 Sep 2013 19:08:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DJ8A3S098064;
 Fri, 13 Sep 2013 19:08:10 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DJ8ASD098061;
 Fri, 13 Sep 2013 19:08:10 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201309131908.r8DJ8ASD098061@svn.freebsd.org>
From: Joel Dahl <joel@FreeBSD.org>
Date: Fri, 13 Sep 2013 19:08:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255525 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 19:08:10 -0000

Author: joel (doc committer)
Date: Fri Sep 13 19:08:10 2013
New Revision: 255525
URL: http://svnweb.freebsd.org/changeset/base/255525

Log:
  mdoc: fix list width.
  
  Approved by:	re (blanket)

Modified:
  head/share/man/man9/vm_map_find.9

Modified: head/share/man/man9/vm_map_find.9
==============================================================================
--- head/share/man/man9/vm_map_find.9	Fri Sep 13 18:47:58 2013	(r255524)
+++ head/share/man/man9/vm_map_find.9	Fri Sep 13 19:08:10 2013	(r255525)
@@ -91,7 +91,7 @@ is called to locate a free region of the
 address at or above
 .Fa *addr .
 The following strategies are supported:
-.Bl -tag -width Dv VMFS_ALIGNED_SPACE Ns Pq Fa n
+.Bl -tag -width "Dv VMFS_ALIGNED_SPACE Ns"
 .It Dv VMFS_NO_SPACE
 The mapping will only succeed if there is a free region of the requested
 length at the given address

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 19:19:21 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A9FE7EC9;
 Fri, 13 Sep 2013 19:19:21 +0000 (UTC)
 (envelope-from joel@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 96D2B2BE6;
 Fri, 13 Sep 2013 19:19:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DJJL7f004943;
 Fri, 13 Sep 2013 19:19:21 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DJJLnw004942;
 Fri, 13 Sep 2013 19:19:21 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201309131919.r8DJJLnw004942@svn.freebsd.org>
From: Joel Dahl <joel@FreeBSD.org>
Date: Fri, 13 Sep 2013 19:19:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255526 - head/usr.sbin/daemon
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 19:19:21 -0000

Author: joel (doc committer)
Date: Fri Sep 13 19:19:21 2013
New Revision: 255526
URL: http://svnweb.freebsd.org/changeset/base/255526

Log:
  mdoc: remove EOL whitespace.
  
  Approved by:	re (blanket)

Modified:
  head/usr.sbin/daemon/daemon.8

Modified: head/usr.sbin/daemon/daemon.8
==============================================================================
--- head/usr.sbin/daemon/daemon.8	Fri Sep 13 19:08:10 2013	(r255525)
+++ head/usr.sbin/daemon/daemon.8	Fri Sep 13 19:19:21 2013	(r255526)
@@ -73,7 +73,7 @@ regardless of whether the
 .Fl u
 option is used or not.
 .It Fl P Ar supervisor_pidfile
-Write the ID of the 
+Write the ID of the
 .Nm
 process into the
 .Ar supervisor_pidfile
@@ -120,7 +120,7 @@ The
 .Fl P
 option is useful combined with the
 .Fl r
-option as 
+option as
 .Ar supervisor_pidfile
 contains the ID of the supervisor
 not the child. This is especially important if you use
@@ -128,7 +128,7 @@ not the child. This is especially import
 in an rc script as the
 .Fl p
 option will give you the child's ID to signal when you attempt to
-stop the service, causing 
+stop the service, causing
 .Nm
 to restart the child.
 .Sh EXIT STATUS

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 19:50:51 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8DC08B2B;
 Fri, 13 Sep 2013 19:50:51 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 61FE12DC6;
 Fri, 13 Sep 2013 19:50:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DJopWQ024753;
 Fri, 13 Sep 2013 19:50:51 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DJooh2024750;
 Fri, 13 Sep 2013 19:50:50 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309131950.r8DJooh2024750@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 13 Sep 2013 19:50:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255527 - in head/sys: kern 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 19:50:51 -0000

Author: kib
Date: Fri Sep 13 19:50:50 2013
New Revision: 255527
URL: http://svnweb.freebsd.org/changeset/base/255527

Log:
  Use TAILQ instead of STAILQ for kqeueue filedescriptors to ensure constant
  time removal on kqueue close.
  
  Reported and tested by:	pho
  Reviewed by:	jmg
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Approved by:	re (delphij)

Modified:
  head/sys/kern/kern_event.c
  head/sys/sys/event.h
  head/sys/sys/eventvar.h

Modified: head/sys/kern/kern_event.c
==============================================================================
--- head/sys/kern/kern_event.c	Fri Sep 13 19:19:21 2013	(r255526)
+++ head/sys/kern/kern_event.c	Fri Sep 13 19:50:50 2013	(r255527)
@@ -707,7 +707,7 @@ sys_kqueue(struct thread *td, struct kqu
 	TASK_INIT(&kq->kq_task, 0, kqueue_task, kq);
 
 	FILEDESC_XLOCK(fdp);
-	SLIST_INSERT_HEAD(&fdp->fd_kqlist, kq, kq_list);
+	TAILQ_INSERT_HEAD(&fdp->fd_kqlist, kq, kq_list);
 	FILEDESC_XUNLOCK(fdp);
 
 	finit(fp, FREAD | FWRITE, DTYPE_KQUEUE, kq, &kqueueops);
@@ -1718,7 +1718,7 @@ kqueue_close(struct file *fp, struct thr
 	KQ_UNLOCK(kq);
 
 	FILEDESC_XLOCK(fdp);
-	SLIST_REMOVE(&fdp->fd_kqlist, kq, kqueue, kq_list);
+	TAILQ_REMOVE(&fdp->fd_kqlist, kq, kq_list);
 	FILEDESC_XUNLOCK(fdp);
 
 	seldrain(&kq->kq_sel);
@@ -2095,7 +2095,7 @@ knote_fdclose(struct thread *td, int fd)
 	 * We shouldn't have to worry about new kevents appearing on fd
 	 * since filedesc is locked.
 	 */
-	SLIST_FOREACH(kq, &fdp->fd_kqlist, kq_list) {
+	TAILQ_FOREACH(kq, &fdp->fd_kqlist, kq_list) {
 		KQ_LOCK(kq);
 
 again:

Modified: head/sys/sys/event.h
==============================================================================
--- head/sys/sys/event.h	Fri Sep 13 19:19:21 2013	(r255526)
+++ head/sys/sys/event.h	Fri Sep 13 19:50:50 2013	(r255527)
@@ -135,7 +135,7 @@ struct kevent {
 struct knote;
 SLIST_HEAD(klist, knote);
 struct kqueue;
-SLIST_HEAD(kqlist, kqueue);
+TAILQ_HEAD(kqlist, kqueue);
 struct knlist {
 	struct	klist	kl_list;
 	void    (*kl_lock)(void *);	/* lock function */

Modified: head/sys/sys/eventvar.h
==============================================================================
--- head/sys/sys/eventvar.h	Fri Sep 13 19:19:21 2013	(r255526)
+++ head/sys/sys/eventvar.h	Fri Sep 13 19:50:50 2013	(r255527)
@@ -41,7 +41,7 @@
 struct kqueue {
 	struct		mtx kq_lock;
 	int		kq_refcnt;
-	SLIST_ENTRY(kqueue)	kq_list;
+	TAILQ_ENTRY(kqueue)	kq_list;
 	TAILQ_HEAD(, knote)	kq_head;	/* list of pending event */
 	int		kq_count;		/* number of pending events */
 	struct		selinfo kq_sel;

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 19:55:41 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B4D08D3B;
 Fri, 13 Sep 2013 19:55:41 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A16522DF6;
 Fri, 13 Sep 2013 19:55:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DJtfw0026881;
 Fri, 13 Sep 2013 19:55:41 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DJtfQa026878;
 Fri, 13 Sep 2013 19:55:41 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201309131955.r8DJtfQa026878@svn.freebsd.org>
From: Sean Bruno <sbruno@FreeBSD.org>
Date: Fri, 13 Sep 2013 19:55:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255528 - in head: share/man/man4 usr.sbin/gpioctl
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 19:55:41 -0000

Author: sbruno
Date: Fri Sep 13 19:55:40 2013
New Revision: 255528
URL: http://svnweb.freebsd.org/changeset/base/255528

Log:
  Add gpio(4) man page to attempt to document the current hints based setup of
  pin outputs, functions and setup.
  
  Add cross reference in gpioctl(8) for people to find.
  
  This is by no means complete and really only covers gpioled(4) and the
  Atheros based systems who expose a few extra hints at boot time.
  
  This should be updated by developers who know more about this system than
  I and viewed as the beginning of documentation, not the end.
  
  Reviewed by:	adrian
  Approved by:	re (joel)
  MFC after:	2 weeks

Added:
  head/share/man/man4/gpio.4   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/usr.sbin/gpioctl/gpioctl.8

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/Makefile	Fri Sep 13 19:50:50 2013	(r255527)
+++ head/share/man/man4/Makefile	Fri Sep 13 19:55:40 2013	(r255528)
@@ -154,6 +154,7 @@ MAN=	aac.4 \
 	geom_uzip.4 \
 	gif.4 \
 	gpib.4 \
+	gpio.4 \
 	gre.4 \
 	h_ertt.4 \
 	hatm.4 \

Added: head/share/man/man4/gpio.4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man4/gpio.4	Fri Sep 13 19:55:40 2013	(r255528)
@@ -0,0 +1,176 @@
+.\" Copyright (c) 2013, Sean Bruno <sbruno@freebsd.org>
+.\" 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 September 13, 2013
+.Dt GPIO 4
+.Os
+.Sh NAME
+.Nm gpiobus
+.Nd GPIO bus system
+.Sh SYNOPSIS
+To compile these devices into your kernel and use the device hints, place the
+following lines in your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device gpiobus"
+.Cd "device gpioiic"
+.Cd "device gpio"
+.Cd "device gpioc"
+.Cd "device gpioled"
+.Ed
+.Pp
+Additional device entries for the
+.Li ARM
+architecure include:
+.Bd -ragged -offset indent
+.Cd "device a10_gpio"
+.Cd "device bcm_gpio"
+.Cd "device imx51_gpio"
+.Cd "device lpcgpio"
+.Cd "device mv_gpio"
+.Cd "device ti_gpio"
+.Cd "device gpio_avila"
+.Cd "device gpio_cambria"
+.Cd "device zy7_gpio"
+.Cd "device pxagpio"
+.Ed
+.Pp
+Additional device entries for the
+.Li MIPS
+architecure include:
+.Bd -ragged -offset indent
+.Cd "device ar71xxx_gpio"
+.Cd "device octeon_gpio"
+.Cd "device rt305_gpio"
+.Ed
+.Pp
+Additional device entries for the
+.Li POWERPC
+architecure include:
+.Bd -ragged -offset indent
+.Cd "device wiigpio"
+.Cd "device macgpio"
+.Ed
+.Sh DESCRIPTION
+The
+.Em gpiobus
+system provides a simple interface to the bit banging style GPIO bus
+found on embedded architectures.
+.Pp
+The acronym
+.Li GPIO
+means
+.Dq General-Purpose Input/Output.
+.Pp
+The BUS physically consists of multiple pins that can be configured
+for input/output, IRQ delivery, SDA/SCL
+.Em iicbus
+use, etc.
+On most embedded architechtures (mips/arm), discovery of the bus and
+configuration of the pins is done via
+.Xr device.hints 5
+in the platform's kernel
+.Xr config 5
+file.
+.Pp
+Assignment of
+.Xr gpioiic 4
+bus variables is done via:
+.Bl -tag -width ".Va hint.gpioiic.%d.atXXX"
+.It Va hint.gpioiic.%d.at
+Normally just gpiobus0.
+.It Va hint.gpioiic.%d.pins
+This is a bitmask of the pins on the gpio board that are to be used for
+SCLOCK and SDATA from the IIC bus.
+To configure pin 0 and 7, use the bitmask of
+10000001 and convert it to a hexadecimal value of 0x0081.
+Should only ever have two bits set in mask.
+.It Va hint.gpioiic.%d.scl
+Indicates which bit in the
+.Va hint.gpioiic.%d.pins
+should be used as the SCLOCK
+source.
+.It Va hint.gpioiic.%d.sda
+Indicates which bit in the
+.Va hint.gpioiic.%d.pins
+should be used as the SDATA
+source.
+.El
+.Pp
+The following are only provided by the
+.Cd ar71xx_gpio
+driver.
+.Bl -tag -width ".Va hint.gpioiic.%d.atXXX"
+.It Va hint.gpio.%d.pinmask
+This is a bitmask of pins on the gpio board that we would like to expose
+for use to the host o/s.
+To expose pin 0, 4 and 7, use the bitmask of
+10010001 converted to the hexadecimal value 0x0091.
+.It Va hint.gpio.%d.pinon
+This is a bitmask of pins on the gpio board that will be set to ON at host
+start.
+To set pin 2, 5 and 13 to be set ON at boot, use the bitmask of
+10000000010010 converted to the hexadecimal value 0x2022.
+.It Va hint.gpio.function_set
+.It Va hint.gpio.function_clear
+These are a bitmask of pins that will remap a pin to handle a specific
+function (USB, UART TX/RX, etc) in the Atheros function registers.
+This is mainly used to set/clear functions that we need when they are setup or
+not setup by uBoot.
+.El
+.Pp
+These values are configureable from the
+.Xr gpioled 4
+interface and help create
+.Xr led 4
+compatible devices in
+.Pa /dev/led/<name> .
+.Bl -tag -width ".Va hint.gpioiic.%d.atXXX"
+.It Va hint.gpioled.%d.at
+Normally assigned to gpiobus0.
+.It Va hint.gpioled.%d.name
+Arbitrary name of device in
+.Pa /dev/led/
+to create for
+.Xr led 4
+interfaces.
+.It Va hint.gpioled.%d.pins
+Which pin on the GPIO interface to map to this instance.
+.El
+.Pp
+Simply put, each pin of the GPIO interface is connected to an input/output
+of some device in a system.
+.Sh SEE ALSO
+.Xr iicbus 4 ,
+.Xr gpioctl 8
+.Sh HISTORY
+The
+.Nm
+manual page first appeared in
+.Fx 10.0 .
+.Sh AUTHORS
+This
+manual page was written by
+.An Sean Bruno Aq sbruno@FreeBSD.org .

Modified: head/usr.sbin/gpioctl/gpioctl.8
==============================================================================
--- head/usr.sbin/gpioctl/gpioctl.8	Fri Sep 13 19:50:50 2013	(r255527)
+++ head/usr.sbin/gpioctl/gpioctl.8	Fri Sep 13 19:55:40 2013	(r255528)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 25, 2011
+.Dd August 13, 2013
 .Dt GPIOCTL 1
 .Os
 .Sh NAME
@@ -105,6 +105,8 @@ Configure pin 12 to be input pin
 .Pp
 gpioctl -f /dev/gpioc0 -c 12 IN
 .El
+.Sh SEE ALSO
+.Xr gpio 4
 .Sh HISTORY
 The
 .Nm

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 20:56:42 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CD838B09;
 Fri, 13 Sep 2013 20:56:42 +0000 (UTC)
 (envelope-from jilles@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B9187215B;
 Fri, 13 Sep 2013 20:56:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DKugMG062402;
 Fri, 13 Sep 2013 20:56:42 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DKugOM062401;
 Fri, 13 Sep 2013 20:56:42 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201309132056.r8DKugOM062401@svn.freebsd.org>
From: Jilles Tjoelker <jilles@FreeBSD.org>
Date: Fri, 13 Sep 2013 20:56: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: r255529 - stable/9/usr.sbin/watch
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 20:56:42 -0000

Author: jilles
Date: Fri Sep 13 20:56:42 2013
New Revision: 255529
URL: http://svnweb.freebsd.org/changeset/base/255529

Log:
  MFC r255261: watch: Do not mess up the tty modes on early error.
  
  Record the initial state earlier, so it is always safe to restore it.
  
  One way this happens is if watch(8) is started by a user that does not have
  access to /dev/snp. The result is "staircase effect" during later commands.
  
  PR:		bin/153052

Modified:
  stable/9/usr.sbin/watch/watch.c
Directory Properties:
  stable/9/usr.sbin/watch/   (props changed)

Modified: stable/9/usr.sbin/watch/watch.c
==============================================================================
--- stable/9/usr.sbin/watch/watch.c	Fri Sep 13 19:55:40 2013	(r255528)
+++ stable/9/usr.sbin/watch/watch.c	Fri Sep 13 20:56:42 2013	(r255529)
@@ -110,7 +110,6 @@ set_tty(void)
 {
 	struct termios	ntty;
 
-	tcgetattr(std_in, &otty);
 	ntty = otty;
 	ntty.c_lflag &= ~ICANON;	/* disable canonical operation */
 	ntty.c_lflag &= ~ECHO;
@@ -324,6 +323,8 @@ main(int ac, char *av[])
 			usage();
 		}
 
+	tcgetattr(std_in, &otty);
+
 	if (modfind("snp") == -1)
 		if (kldload("snp") == -1 || modfind("snp") == -1)
 			warn("snp module not available");

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 21:23:05 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 476F7408;
 Fri, 13 Sep 2013 21:23:05 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3567D24BC;
 Fri, 13 Sep 2013 21:23:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DLN5Uu079435;
 Fri, 13 Sep 2013 21:23:05 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DLN5sn079434;
 Fri, 13 Sep 2013 21:23:05 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201309132123.r8DLN5sn079434@svn.freebsd.org>
From: Sean Bruno <sbruno@FreeBSD.org>
Date: Fri, 13 Sep 2013 21:23:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255531 - head/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 21:23:05 -0000

Author: sbruno
Date: Fri Sep 13 21:23:04 2013
New Revision: 255531
URL: http://svnweb.freebsd.org/changeset/base/255531

Log:
  Correct my inability to do math and provide a GOOD example.
  
  Approved by:	re (implicit)

Modified:
  head/share/man/man4/gpio.4

Modified: head/share/man/man4/gpio.4
==============================================================================
--- head/share/man/man4/gpio.4	Fri Sep 13 21:16:52 2013	(r255530)
+++ head/share/man/man4/gpio.4	Fri Sep 13 21:23:04 2013	(r255531)
@@ -132,7 +132,7 @@ To expose pin 0, 4 and 7, use the bitmas
 This is a bitmask of pins on the gpio board that will be set to ON at host
 start.
 To set pin 2, 5 and 13 to be set ON at boot, use the bitmask of
-10000000010010 converted to the hexadecimal value 0x2022.
+10000000010010 converted to the hexadecimal value 0x2012.
 .It Va hint.gpio.function_set
 .It Va hint.gpio.function_clear
 These are a bitmask of pins that will remap a pin to handle a specific

From owner-svn-src-all@FreeBSD.ORG  Fri Sep 13 23:10:54 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C96C7671;
 Fri, 13 Sep 2013 23:10:54 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A71F52FED;
 Fri, 13 Sep 2013 23:10:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DNAs8u044549;
 Fri, 13 Sep 2013 23:10:54 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DNArPb044542;
 Fri, 13 Sep 2013 23:10:53 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201309132310.r8DNArPb044542@svn.freebsd.org>
From: Rick Macklem <rmacklem@FreeBSD.org>
Date: Fri, 13 Sep 2013 23:10: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: r255532 - in stable/9/sys/fs: nfs nfsserver
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Sep 2013 23:10:55 -0000

Author: rmacklem
Date: Fri Sep 13 23:10:53 2013
New Revision: 255532
URL: http://svnweb.freebsd.org/changeset/base/255532

Log:
  MFC: r254337
  Fix several performance related issues in the new NFS server's
  DRC for NFS over TCP.
  - Increase the size of the hash tables.
  - Create a separate mutex for each hash list of the TCP hash table.
  - Single thread the code that deletes stale cache entries.
  - Add a tunable called vfs.nfsd.tcphighwater, which can be increased
    to allow the cache to grow larger, avoiding the overhead of frequent
    scans to delete stale cache entries.
    (The default value will result in frequent scans to delete stale cache
     entries, analagous to what the pre-patched code does.)
  - Add a tunable called vfs.nfsd.cachetcp that can be used to disable
    DRC caching for NFS over TCP, since the old NFS server didn't DRC cache TCP.
  It also adjusts the size of nfsrc_floodlevel dynamically, so that it is
  always greater than vfs.nfsd.tcphighwater.
  
  For UDP the algorithm remains the same as the pre-patched code, but the
  tunable vfs.nfsd.udphighwater can be used to allow the cache to grow
  larger and reduce the overhead caused by frequent scans for stale entries.
  UDP also uses a larger hash table size than the pre-patched code.

Modified:
  stable/9/sys/fs/nfs/nfsport.h
  stable/9/sys/fs/nfs/nfsrvcache.h
  stable/9/sys/fs/nfsserver/nfs_nfsdcache.c
  stable/9/sys/fs/nfsserver/nfs_nfsdport.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nfs/nfsport.h
==============================================================================
--- stable/9/sys/fs/nfs/nfsport.h	Fri Sep 13 21:23:04 2013	(r255531)
+++ stable/9/sys/fs/nfs/nfsport.h	Fri Sep 13 23:10:53 2013	(r255532)
@@ -541,11 +541,6 @@ void nfsrvd_rcv(struct socket *, void *,
 #define	NFSREQSPINLOCK		extern struct mtx nfs_req_mutex
 #define	NFSLOCKREQ()		mtx_lock(&nfs_req_mutex)
 #define	NFSUNLOCKREQ()		mtx_unlock(&nfs_req_mutex)
-#define	NFSCACHEMUTEX		extern struct mtx nfs_cache_mutex
-#define	NFSCACHEMUTEXPTR	(&nfs_cache_mutex)
-#define	NFSLOCKCACHE()		mtx_lock(&nfs_cache_mutex)
-#define	NFSUNLOCKCACHE()	mtx_unlock(&nfs_cache_mutex)
-#define	NFSCACHELOCKREQUIRED()	mtx_assert(&nfs_cache_mutex, MA_OWNED)
 #define	NFSSOCKMUTEX		extern struct mtx nfs_slock_mutex
 #define	NFSSOCKMUTEXPTR		(&nfs_slock_mutex)
 #define	NFSLOCKSOCK()		mtx_lock(&nfs_slock_mutex)

Modified: stable/9/sys/fs/nfs/nfsrvcache.h
==============================================================================
--- stable/9/sys/fs/nfs/nfsrvcache.h	Fri Sep 13 21:23:04 2013	(r255531)
+++ stable/9/sys/fs/nfs/nfsrvcache.h	Fri Sep 13 23:10:53 2013	(r255532)
@@ -41,8 +41,9 @@
 #define	NFSRVCACHE_MAX_SIZE	2048
 #define	NFSRVCACHE_MIN_SIZE	  64
 
-#define	NFSRVCACHE_HASHSIZE	20
+#define	NFSRVCACHE_HASHSIZE	500
 
+/* Cache table entry. */
 struct nfsrvcache {
 	LIST_ENTRY(nfsrvcache) rc_hash;		/* Hash chain */
 	TAILQ_ENTRY(nfsrvcache)	rc_lru;		/* UDP lru chain */
@@ -104,4 +105,11 @@ struct nfsrvcache {
 
 LIST_HEAD(nfsrvhashhead, nfsrvcache);
 
+/* The fine-grained locked cache hash table for TCP. */
+struct nfsrchash_bucket {
+	struct mtx		mtx;
+	char			lock_name[16];
+	struct nfsrvhashhead	tbl;
+};
+
 #endif	/* _NFS_NFSRVCACHE_H_ */

Modified: stable/9/sys/fs/nfsserver/nfs_nfsdcache.c
==============================================================================
--- stable/9/sys/fs/nfsserver/nfs_nfsdcache.c	Fri Sep 13 21:23:04 2013	(r255531)
+++ stable/9/sys/fs/nfsserver/nfs_nfsdcache.c	Fri Sep 13 23:10:53 2013	(r255532)
@@ -160,15 +160,51 @@ __FBSDID("$FreeBSD$");
 #include <fs/nfs/nfsport.h>
 
 extern struct nfsstats newnfsstats;
-NFSCACHEMUTEX;
+extern struct mtx nfsrc_udpmtx;
+extern struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE];
 int nfsrc_floodlevel = NFSRVCACHE_FLOODLEVEL, nfsrc_tcpsavedreplies = 0;
 #endif	/* !APPLEKEXT */
 
-static int nfsrc_tcpnonidempotent = 1;
-static int nfsrc_udphighwater = NFSRVCACHE_UDPHIGHWATER, nfsrc_udpcachesize = 0;
+SYSCTL_DECL(_vfs_nfsd);
+
+static u_int	nfsrc_tcphighwater = 0;
+static int
+sysctl_tcphighwater(SYSCTL_HANDLER_ARGS)
+{
+	int error, newhighwater;
+
+	newhighwater = nfsrc_tcphighwater;
+	error = sysctl_handle_int(oidp, &newhighwater, 0, req);
+	if (error != 0 || req->newptr == NULL)
+		return (error);
+	if (newhighwater < 0)
+		return (EINVAL);
+	if (newhighwater >= nfsrc_floodlevel)
+		nfsrc_floodlevel = newhighwater + newhighwater / 5;
+	nfsrc_tcphighwater = newhighwater;
+	return (0);
+}
+SYSCTL_PROC(_vfs_nfsd, OID_AUTO, tcphighwater, CTLTYPE_UINT | CTLFLAG_RW, 0,
+    sizeof(nfsrc_tcphighwater), sysctl_tcphighwater, "IU",
+    "High water mark for TCP cache entries");
+
+static u_int	nfsrc_udphighwater = NFSRVCACHE_UDPHIGHWATER;
+SYSCTL_UINT(_vfs_nfsd, OID_AUTO, udphighwater, CTLFLAG_RW,
+    &nfsrc_udphighwater, 0,
+    "High water mark for UDP cache entries");
+static u_int	nfsrc_tcptimeout = NFSRVCACHE_TCPTIMEOUT;
+SYSCTL_UINT(_vfs_nfsd, OID_AUTO, tcpcachetimeo, CTLFLAG_RW,
+    &nfsrc_tcptimeout, 0,
+    "Timeout for TCP entries in the DRC");
+static u_int nfsrc_tcpnonidempotent = 1;
+SYSCTL_UINT(_vfs_nfsd, OID_AUTO, cachetcp, CTLFLAG_RW,
+    &nfsrc_tcpnonidempotent, 0,
+    "Enable the DRC for NFS over TCP");
+
+static int nfsrc_udpcachesize = 0;
 static TAILQ_HEAD(, nfsrvcache) nfsrvudplru;
-static struct nfsrvhashhead nfsrvhashtbl[NFSRVCACHE_HASHSIZE],
-    nfsrvudphashtbl[NFSRVCACHE_HASHSIZE];
+static struct nfsrvhashhead nfsrvudphashtbl[NFSRVCACHE_HASHSIZE];
+
 /*
  * and the reverse mapping from generic to Version 2 procedure numbers
  */
@@ -197,10 +233,11 @@ static int newnfsv2_procid[NFS_V3NPROCS]
 	NFSV2PROC_NOOP,
 };
 
+#define	nfsrc_hash(xid)	(((xid) + ((xid) >> 24)) % NFSRVCACHE_HASHSIZE)
 #define	NFSRCUDPHASH(xid) \
-	(&nfsrvudphashtbl[((xid) + ((xid) >> 24)) % NFSRVCACHE_HASHSIZE])
+	(&nfsrvudphashtbl[nfsrc_hash(xid)])
 #define	NFSRCHASH(xid) \
-	(&nfsrvhashtbl[((xid) + ((xid) >> 24)) % NFSRVCACHE_HASHSIZE])
+	(&nfsrchash_table[nfsrc_hash(xid)].tbl)
 #define	TRUE	1
 #define	FALSE	0
 #define	NFSRVCACHE_CHECKLEN	100
@@ -251,6 +288,18 @@ static int nfsrc_getlenandcksum(mbuf_t m
 static void nfsrc_marksametcpconn(u_int64_t);
 
 /*
+ * Return the correct mutex for this cache entry.
+ */
+static __inline struct mtx *
+nfsrc_cachemutex(struct nfsrvcache *rp)
+{
+
+	if ((rp->rc_flag & RC_UDP) != 0)
+		return (&nfsrc_udpmtx);
+	return (&nfsrchash_table[nfsrc_hash(rp->rc_xid)].mtx);
+}
+
+/*
  * Initialize the server request cache list
  */
 APPLESTATIC void
@@ -264,7 +313,7 @@ nfsrvd_initcache(void)
 	inited = 1;
 	for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) {
 		LIST_INIT(&nfsrvudphashtbl[i]);
-		LIST_INIT(&nfsrvhashtbl[i]);
+		LIST_INIT(&nfsrchash_table[i].tbl);
 	}
 	TAILQ_INIT(&nfsrvudplru);
 	nfsrc_tcpsavedreplies = 0;
@@ -325,10 +374,12 @@ nfsrc_getudp(struct nfsrv_descript *nd, 
 	struct sockaddr_in6 *saddr6;
 	struct nfsrvhashhead *hp;
 	int ret = 0;
+	struct mtx *mutex;
 
+	mutex = nfsrc_cachemutex(newrp);
 	hp = NFSRCUDPHASH(newrp->rc_xid);
 loop:
-	NFSLOCKCACHE();
+	mtx_lock(mutex);
 	LIST_FOREACH(rp, hp, rc_hash) {
 	    if (newrp->rc_xid == rp->rc_xid &&
 		newrp->rc_proc == rp->rc_proc &&
@@ -336,8 +387,8 @@ loop:
 		nfsaddr_match(NETFAMILY(rp), &rp->rc_haddr, nd->nd_nam)) {
 			if ((rp->rc_flag & RC_LOCKED) != 0) {
 				rp->rc_flag |= RC_WANTED;
-				(void)mtx_sleep(rp, NFSCACHEMUTEXPTR,
-				    (PZERO - 1) | PDROP, "nfsrc", 10 * hz);
+				(void)mtx_sleep(rp, mutex, (PZERO - 1) | PDROP,
+				    "nfsrc", 10 * hz);
 				goto loop;
 			}
 			if (rp->rc_flag == 0)
@@ -347,14 +398,14 @@ loop:
 			TAILQ_INSERT_TAIL(&nfsrvudplru, rp, rc_lru);
 			if (rp->rc_flag & RC_INPROG) {
 				newnfsstats.srvcache_inproghits++;
-				NFSUNLOCKCACHE();
+				mtx_unlock(mutex);
 				ret = RC_DROPIT;
 			} else if (rp->rc_flag & RC_REPSTATUS) {
 				/*
 				 * V2 only.
 				 */
 				newnfsstats.srvcache_nonidemdonehits++;
-				NFSUNLOCKCACHE();
+				mtx_unlock(mutex);
 				nfsrvd_rephead(nd);
 				*(nd->nd_errp) = rp->rc_status;
 				ret = RC_REPLY;
@@ -362,7 +413,7 @@ loop:
 					NFSRVCACHE_UDPTIMEOUT;
 			} else if (rp->rc_flag & RC_REPMBUF) {
 				newnfsstats.srvcache_nonidemdonehits++;
-				NFSUNLOCKCACHE();
+				mtx_unlock(mutex);
 				nd->nd_mreq = m_copym(rp->rc_reply, 0,
 					M_COPYALL, M_WAIT);
 				ret = RC_REPLY;
@@ -377,7 +428,7 @@ loop:
 		}
 	}
 	newnfsstats.srvcache_misses++;
-	newnfsstats.srvcache_size++;
+	atomic_add_int(&newnfsstats.srvcache_size, 1);
 	nfsrc_udpcachesize++;
 
 	newrp->rc_flag |= RC_INPROG;
@@ -392,7 +443,7 @@ loop:
 	}
 	LIST_INSERT_HEAD(hp, newrp, rc_hash);
 	TAILQ_INSERT_TAIL(&nfsrvudplru, newrp, rc_lru);
-	NFSUNLOCKCACHE();
+	mtx_unlock(mutex);
 	nd->nd_rp = newrp;
 	ret = RC_DOIT;
 
@@ -410,12 +461,14 @@ nfsrvd_updatecache(struct nfsrv_descript
 	struct nfsrvcache *rp;
 	struct nfsrvcache *retrp = NULL;
 	mbuf_t m;
+	struct mtx *mutex;
 
 	rp = nd->nd_rp;
 	if (!rp)
 		panic("nfsrvd_updatecache null rp");
 	nd->nd_rp = NULL;
-	NFSLOCKCACHE();
+	mutex = nfsrc_cachemutex(rp);
+	mtx_lock(mutex);
 	nfsrc_lock(rp);
 	if (!(rp->rc_flag & RC_INPROG))
 		panic("nfsrvd_updatecache not inprog");
@@ -430,7 +483,7 @@ nfsrvd_updatecache(struct nfsrv_descript
 	 */
 	if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) {
 		newnfsstats.srvcache_nonidemdonehits++;
-		NFSUNLOCKCACHE();
+		mtx_unlock(mutex);
 		nd->nd_repstat = 0;
 		if (nd->nd_mreq)
 			mbuf_freem(nd->nd_mreq);
@@ -438,7 +491,7 @@ nfsrvd_updatecache(struct nfsrv_descript
 			panic("reply from cache");
 		nd->nd_mreq = m_copym(rp->rc_reply, 0,
 		    M_COPYALL, M_WAIT);
-		rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_TCPTIMEOUT;
+		rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout;
 		nfsrc_unlock(rp);
 		goto out;
 	}
@@ -463,29 +516,28 @@ nfsrvd_updatecache(struct nfsrv_descript
 		    nfsv2_repstat[newnfsv2_procid[nd->nd_procnum]]) {
 			rp->rc_status = nd->nd_repstat;
 			rp->rc_flag |= RC_REPSTATUS;
-			NFSUNLOCKCACHE();
+			mtx_unlock(mutex);
 		} else {
 			if (!(rp->rc_flag & RC_UDP)) {
-			    nfsrc_tcpsavedreplies++;
+			    atomic_add_int(&nfsrc_tcpsavedreplies, 1);
 			    if (nfsrc_tcpsavedreplies >
 				newnfsstats.srvcache_tcppeak)
 				newnfsstats.srvcache_tcppeak =
 				    nfsrc_tcpsavedreplies;
 			}
-			NFSUNLOCKCACHE();
+			mtx_unlock(mutex);
 			m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAIT);
-			NFSLOCKCACHE();
+			mtx_lock(mutex);
 			rp->rc_reply = m;
 			rp->rc_flag |= RC_REPMBUF;
-			NFSUNLOCKCACHE();
+			mtx_unlock(mutex);
 		}
 		if (rp->rc_flag & RC_UDP) {
 			rp->rc_timestamp = NFSD_MONOSEC +
 			    NFSRVCACHE_UDPTIMEOUT;
 			nfsrc_unlock(rp);
 		} else {
-			rp->rc_timestamp = NFSD_MONOSEC +
-			    NFSRVCACHE_TCPTIMEOUT;
+			rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout;
 			if (rp->rc_refcnt > 0)
 				nfsrc_unlock(rp);
 			else
@@ -493,7 +545,7 @@ nfsrvd_updatecache(struct nfsrv_descript
 		}
 	} else {
 		nfsrc_freecache(rp);
-		NFSUNLOCKCACHE();
+		mtx_unlock(mutex);
 	}
 
 out:
@@ -509,14 +561,16 @@ out:
 APPLESTATIC void
 nfsrvd_delcache(struct nfsrvcache *rp)
 {
+	struct mtx *mutex;
 
+	mutex = nfsrc_cachemutex(rp);
 	if (!(rp->rc_flag & RC_INPROG))
 		panic("nfsrvd_delcache not in prog");
-	NFSLOCKCACHE();
+	mtx_lock(mutex);
 	rp->rc_flag &= ~RC_INPROG;
 	if (rp->rc_refcnt == 0 && !(rp->rc_flag & RC_LOCKED))
 		nfsrc_freecache(rp);
-	NFSUNLOCKCACHE();
+	mtx_unlock(mutex);
 }
 
 /*
@@ -528,7 +582,9 @@ APPLESTATIC void
 nfsrvd_sentcache(struct nfsrvcache *rp, struct socket *so, int err)
 {
 	tcp_seq tmp_seq;
+	struct mtx *mutex;
 
+	mutex = nfsrc_cachemutex(rp);
 	if (!(rp->rc_flag & RC_LOCKED))
 		panic("nfsrvd_sentcache not locked");
 	if (!err) {
@@ -537,10 +593,10 @@ nfsrvd_sentcache(struct nfsrvcache *rp, 
 		     so->so_proto->pr_protocol != IPPROTO_TCP)
 			panic("nfs sent cache");
 		if (nfsrv_getsockseqnum(so, &tmp_seq)) {
-			NFSLOCKCACHE();
+			mtx_lock(mutex);
 			rp->rc_tcpseq = tmp_seq;
 			rp->rc_flag |= RC_TCPSEQ;
-			NFSUNLOCKCACHE();
+			mtx_unlock(mutex);
 		}
 	}
 	nfsrc_unlock(rp);
@@ -559,11 +615,13 @@ nfsrc_gettcp(struct nfsrv_descript *nd, 
 	struct nfsrvcache *hitrp;
 	struct nfsrvhashhead *hp, nfsrc_templist;
 	int hit, ret = 0;
+	struct mtx *mutex;
 
+	mutex = nfsrc_cachemutex(newrp);
 	hp = NFSRCHASH(newrp->rc_xid);
 	newrp->rc_reqlen = nfsrc_getlenandcksum(nd->nd_mrep, &newrp->rc_cksum);
 tryagain:
-	NFSLOCKCACHE();
+	mtx_lock(mutex);
 	hit = 1;
 	LIST_INIT(&nfsrc_templist);
 	/*
@@ -621,8 +679,8 @@ tryagain:
 		rp = hitrp;
 		if ((rp->rc_flag & RC_LOCKED) != 0) {
 			rp->rc_flag |= RC_WANTED;
-			(void)mtx_sleep(rp, NFSCACHEMUTEXPTR,
-			    (PZERO - 1) | PDROP, "nfsrc", 10 * hz);
+			(void)mtx_sleep(rp, mutex, (PZERO - 1) | PDROP,
+			    "nfsrc", 10 * hz);
 			goto tryagain;
 		}
 		if (rp->rc_flag == 0)
@@ -630,7 +688,7 @@ tryagain:
 		rp->rc_flag |= RC_LOCKED;
 		if (rp->rc_flag & RC_INPROG) {
 			newnfsstats.srvcache_inproghits++;
-			NFSUNLOCKCACHE();
+			mtx_unlock(mutex);
 			if (newrp->rc_sockref == rp->rc_sockref)
 				nfsrc_marksametcpconn(rp->rc_sockref);
 			ret = RC_DROPIT;
@@ -639,24 +697,22 @@ tryagain:
 			 * V2 only.
 			 */
 			newnfsstats.srvcache_nonidemdonehits++;
-			NFSUNLOCKCACHE();
+			mtx_unlock(mutex);
 			if (newrp->rc_sockref == rp->rc_sockref)
 				nfsrc_marksametcpconn(rp->rc_sockref);
 			ret = RC_REPLY;
 			nfsrvd_rephead(nd);
 			*(nd->nd_errp) = rp->rc_status;
-			rp->rc_timestamp = NFSD_MONOSEC +
-				NFSRVCACHE_TCPTIMEOUT;
+			rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout;
 		} else if (rp->rc_flag & RC_REPMBUF) {
 			newnfsstats.srvcache_nonidemdonehits++;
-			NFSUNLOCKCACHE();
+			mtx_unlock(mutex);
 			if (newrp->rc_sockref == rp->rc_sockref)
 				nfsrc_marksametcpconn(rp->rc_sockref);
 			ret = RC_REPLY;
 			nd->nd_mreq = m_copym(rp->rc_reply, 0,
 				M_COPYALL, M_WAIT);
-			rp->rc_timestamp = NFSD_MONOSEC +
-				NFSRVCACHE_TCPTIMEOUT;
+			rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout;
 		} else {
 			panic("nfs tcp cache1");
 		}
@@ -665,7 +721,7 @@ tryagain:
 		goto out;
 	}
 	newnfsstats.srvcache_misses++;
-	newnfsstats.srvcache_size++;
+	atomic_add_int(&newnfsstats.srvcache_size, 1);
 
 	/*
 	 * For TCP, multiple entries for a key are allowed, so don't
@@ -674,7 +730,7 @@ tryagain:
 	newrp->rc_cachetime = NFSD_MONOSEC;
 	newrp->rc_flag |= RC_INPROG;
 	LIST_INSERT_HEAD(hp, newrp, rc_hash);
-	NFSUNLOCKCACHE();
+	mtx_unlock(mutex);
 	nd->nd_rp = newrp;
 	ret = RC_DOIT;
 
@@ -685,16 +741,17 @@ out:
 
 /*
  * Lock a cache entry.
- * Also puts a mutex lock on the cache list.
  */
 static void
 nfsrc_lock(struct nfsrvcache *rp)
 {
-	NFSCACHELOCKREQUIRED();
+	struct mtx *mutex;
+
+	mutex = nfsrc_cachemutex(rp);
+	mtx_assert(mutex, MA_OWNED);
 	while ((rp->rc_flag & RC_LOCKED) != 0) {
 		rp->rc_flag |= RC_WANTED;
-		(void)mtx_sleep(rp, NFSCACHEMUTEXPTR, PZERO - 1,
-		    "nfsrc", 0);
+		(void)mtx_sleep(rp, mutex, PZERO - 1, "nfsrc", 0);
 	}
 	rp->rc_flag |= RC_LOCKED;
 }
@@ -705,11 +762,13 @@ nfsrc_lock(struct nfsrvcache *rp)
 static void
 nfsrc_unlock(struct nfsrvcache *rp)
 {
+	struct mtx *mutex;
 
-	NFSLOCKCACHE();
+	mutex = nfsrc_cachemutex(rp);
+	mtx_lock(mutex);
 	rp->rc_flag &= ~RC_LOCKED;
 	nfsrc_wanted(rp);
-	NFSUNLOCKCACHE();
+	mtx_unlock(mutex);
 }
 
 /*
@@ -732,7 +791,6 @@ static void
 nfsrc_freecache(struct nfsrvcache *rp)
 {
 
-	NFSCACHELOCKREQUIRED();
 	LIST_REMOVE(rp, rc_hash);
 	if (rp->rc_flag & RC_UDP) {
 		TAILQ_REMOVE(&nfsrvudplru, rp, rc_lru);
@@ -742,10 +800,10 @@ nfsrc_freecache(struct nfsrvcache *rp)
 	if (rp->rc_flag & RC_REPMBUF) {
 		mbuf_freem(rp->rc_reply);
 		if (!(rp->rc_flag & RC_UDP))
-			nfsrc_tcpsavedreplies--;
+			atomic_add_int(&nfsrc_tcpsavedreplies, -1);
 	}
 	FREE((caddr_t)rp, M_NFSRVCACHE);
-	newnfsstats.srvcache_size--;
+	atomic_add_int(&newnfsstats.srvcache_size, -1);
 }
 
 /*
@@ -757,20 +815,21 @@ nfsrvd_cleancache(void)
 	struct nfsrvcache *rp, *nextrp;
 	int i;
 
-	NFSLOCKCACHE();
 	for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) {
-		LIST_FOREACH_SAFE(rp, &nfsrvhashtbl[i], rc_hash, nextrp) {
+		mtx_lock(&nfsrchash_table[i].mtx);
+		LIST_FOREACH_SAFE(rp, &nfsrchash_table[i].tbl, rc_hash, nextrp)
 			nfsrc_freecache(rp);
-		}
+		mtx_unlock(&nfsrchash_table[i].mtx);
 	}
+	mtx_lock(&nfsrc_udpmtx);
 	for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) {
 		LIST_FOREACH_SAFE(rp, &nfsrvudphashtbl[i], rc_hash, nextrp) {
 			nfsrc_freecache(rp);
 		}
 	}
 	newnfsstats.srvcache_size = 0;
+	mtx_unlock(&nfsrc_udpmtx);
 	nfsrc_tcpsavedreplies = 0;
-	NFSUNLOCKCACHE();
 }
 
 /*
@@ -780,28 +839,97 @@ static void
 nfsrc_trimcache(u_int64_t sockref, struct socket *so)
 {
 	struct nfsrvcache *rp, *nextrp;
-	int i;
+	int i, j, k, time_histo[10];
+	time_t thisstamp;
+	static time_t udp_lasttrim = 0, tcp_lasttrim = 0;
+	static int onethread = 0;
 
-	NFSLOCKCACHE();
-	TAILQ_FOREACH_SAFE(rp, &nfsrvudplru, rc_lru, nextrp) {
-		if (!(rp->rc_flag & (RC_INPROG|RC_LOCKED|RC_WANTED))
-		     && rp->rc_refcnt == 0
-		     && ((rp->rc_flag & RC_REFCNT) ||
-			 NFSD_MONOSEC > rp->rc_timestamp ||
-			 nfsrc_udpcachesize > nfsrc_udphighwater))
-			nfsrc_freecache(rp);
-	}
-	for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) {
-		LIST_FOREACH_SAFE(rp, &nfsrvhashtbl[i], rc_hash, nextrp) {
+	if (atomic_cmpset_acq_int(&onethread, 0, 1) == 0)
+		return;
+	if (NFSD_MONOSEC != udp_lasttrim ||
+	    nfsrc_udpcachesize >= (nfsrc_udphighwater +
+	    nfsrc_udphighwater / 2)) {
+		mtx_lock(&nfsrc_udpmtx);
+		udp_lasttrim = NFSD_MONOSEC;
+		TAILQ_FOREACH_SAFE(rp, &nfsrvudplru, rc_lru, nextrp) {
 			if (!(rp->rc_flag & (RC_INPROG|RC_LOCKED|RC_WANTED))
 			     && rp->rc_refcnt == 0
 			     && ((rp->rc_flag & RC_REFCNT) ||
-				 NFSD_MONOSEC > rp->rc_timestamp ||
-				 nfsrc_activesocket(rp, sockref, so)))
+				 udp_lasttrim > rp->rc_timestamp ||
+				 nfsrc_udpcachesize > nfsrc_udphighwater))
 				nfsrc_freecache(rp);
 		}
+		mtx_unlock(&nfsrc_udpmtx);
+	}
+	if (NFSD_MONOSEC != tcp_lasttrim ||
+	    nfsrc_tcpsavedreplies >= nfsrc_tcphighwater) {
+		for (i = 0; i < 10; i++)
+			time_histo[i] = 0;
+		for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) {
+			mtx_lock(&nfsrchash_table[i].mtx);
+			if (i == 0)
+				tcp_lasttrim = NFSD_MONOSEC;
+			LIST_FOREACH_SAFE(rp, &nfsrchash_table[i].tbl, rc_hash,
+			    nextrp) {
+				if (!(rp->rc_flag &
+				     (RC_INPROG|RC_LOCKED|RC_WANTED))
+				     && rp->rc_refcnt == 0) {
+					/*
+					 * The timestamps range from roughly the
+					 * present (tcp_lasttrim) to the present
+					 * + nfsrc_tcptimeout. Generate a simple
+					 * histogram of where the timeouts fall.
+					 */
+					j = rp->rc_timestamp - tcp_lasttrim;
+					if (j >= nfsrc_tcptimeout)
+						j = nfsrc_tcptimeout - 1;
+					if (j < 0)
+						j = 0;
+					j = (j * 10 / nfsrc_tcptimeout) % 10;
+					time_histo[j]++;
+					if ((rp->rc_flag & RC_REFCNT) ||
+					    tcp_lasttrim > rp->rc_timestamp ||
+					    nfsrc_activesocket(rp, sockref, so))
+						nfsrc_freecache(rp);
+				}
+			}
+			mtx_unlock(&nfsrchash_table[i].mtx);
+		}
+		j = nfsrc_tcphighwater / 5;	/* 20% of it */
+		if (j > 0 && (nfsrc_tcpsavedreplies + j) > nfsrc_tcphighwater) {
+			/*
+			 * Trim some more with a smaller timeout of as little
+			 * as 20% of nfsrc_tcptimeout to try and get below
+			 * 80% of the nfsrc_tcphighwater.
+			 */
+			k = 0;
+			for (i = 0; i < 8; i++) {
+				k += time_histo[i];
+				if (k > j)
+					break;
+			}
+			k = nfsrc_tcptimeout * (i + 1) / 10;
+			if (k < 1)
+				k = 1;
+			thisstamp = tcp_lasttrim + k;
+			for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) {
+				mtx_lock(&nfsrchash_table[i].mtx);
+				LIST_FOREACH_SAFE(rp, &nfsrchash_table[i].tbl,
+				    rc_hash, nextrp) {
+					if (!(rp->rc_flag &
+					     (RC_INPROG|RC_LOCKED|RC_WANTED))
+					     && rp->rc_refcnt == 0
+					     && ((rp->rc_flag & RC_REFCNT) ||
+						 thisstamp > rp->rc_timestamp ||
+						 nfsrc_activesocket(rp, sockref,
+						    so)))
+						nfsrc_freecache(rp);
+				}
+				mtx_unlock(&nfsrchash_table[i].mtx);
+			}
+		}
 	}
-	NFSUNLOCKCACHE();
+	atomic_store_rel_int(&onethread, 0);
 }
 
 /*
@@ -810,12 +938,14 @@ nfsrc_trimcache(u_int64_t sockref, struc
 APPLESTATIC void
 nfsrvd_refcache(struct nfsrvcache *rp)
 {
+	struct mtx *mutex;
 
-	NFSLOCKCACHE();
+	mutex = nfsrc_cachemutex(rp);
+	mtx_lock(mutex);
 	if (rp->rc_refcnt < 0)
 		panic("nfs cache refcnt");
 	rp->rc_refcnt++;
-	NFSUNLOCKCACHE();
+	mtx_unlock(mutex);
 }
 
 /*
@@ -824,14 +954,16 @@ nfsrvd_refcache(struct nfsrvcache *rp)
 APPLESTATIC void
 nfsrvd_derefcache(struct nfsrvcache *rp)
 {
+	struct mtx *mutex;
 
-	NFSLOCKCACHE();
+	mutex = nfsrc_cachemutex(rp);
+	mtx_lock(mutex);
 	if (rp->rc_refcnt <= 0)
 		panic("nfs cache derefcnt");
 	rp->rc_refcnt--;
 	if (rp->rc_refcnt == 0 && !(rp->rc_flag & (RC_LOCKED | RC_INPROG)))
 		nfsrc_freecache(rp);
-	NFSUNLOCKCACHE();
+	mtx_unlock(mutex);
 }
 
 /*

Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- stable/9/sys/fs/nfsserver/nfs_nfsdport.c	Fri Sep 13 21:23:04 2013	(r255531)
+++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c	Fri Sep 13 23:10:53 2013	(r255532)
@@ -60,7 +60,8 @@ extern SVCPOOL	*nfsrvd_pool;
 extern struct nfsv4lock nfsd_suspend_lock;
 struct vfsoptlist nfsv4root_opt, nfsv4root_newopt;
 NFSDLOCKMUTEX;
-struct mtx nfs_cache_mutex;
+struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE];
+struct mtx nfsrc_udpmtx;
 struct mtx nfs_v4root_mutex;
 struct nfsrvfh nfs_rootfh, nfs_pubfh;
 int nfs_pubfhset = 0, nfs_rootfhset = 0;
@@ -3291,7 +3292,7 @@ extern int (*nfsd_call_nfsd)(struct thre
 static int
 nfsd_modevent(module_t mod, int type, void *data)
 {
-	int error = 0;
+	int error = 0, i;
 	static int loaded = 0;
 
 	switch (type) {
@@ -3299,7 +3300,14 @@ nfsd_modevent(module_t mod, int type, vo
 		if (loaded)
 			goto out;
 		newnfs_portinit();
-		mtx_init(&nfs_cache_mutex, "nfs_cache_mutex", NULL, MTX_DEF);
+		for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) {
+			snprintf(nfsrchash_table[i].lock_name,
+			    sizeof(nfsrchash_table[i].lock_name), "nfsrc_tcp%d",
+			    i);
+			mtx_init(&nfsrchash_table[i].mtx,
+			    nfsrchash_table[i].lock_name, NULL, MTX_DEF);
+		}
+		mtx_init(&nfsrc_udpmtx, "nfs_udpcache_mutex", NULL, MTX_DEF);
 		mtx_init(&nfs_v4root_mutex, "nfs_v4root_mutex", NULL, MTX_DEF);
 		mtx_init(&nfsv4root_mnt.mnt_mtx, "struct mount mtx", NULL,
 		    MTX_DEF);
@@ -3343,7 +3351,9 @@ nfsd_modevent(module_t mod, int type, vo
 			svcpool_destroy(nfsrvd_pool);
 
 		/* and get rid of the locks */
-		mtx_destroy(&nfs_cache_mutex);
+		for (i = 0; i < NFSRVCACHE_HASHSIZE; i++)
+			mtx_destroy(&nfsrchash_table[i].mtx);
+		mtx_destroy(&nfsrc_udpmtx);
 		mtx_destroy(&nfs_v4root_mutex);
 		mtx_destroy(&nfsv4root_mnt.mnt_mtx);
 		lockdestroy(&nfsv4root_mnt.mnt_explock);

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:22:58 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7AB9D8F4;
 Sat, 14 Sep 2013 08:22:58 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 65AAE28CB;
 Sat, 14 Sep 2013 08:22:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8MwJd067844;
 Sat, 14 Sep 2013 08:22:58 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8Mw46067843;
 Sat, 14 Sep 2013 08:22:58 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140822.r8E8Mw46067843@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:22: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: r255534 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:22:58 -0000

Author: mav
Date: Sat Sep 14 08:22:57 2013
New Revision: 255534
URL: http://svnweb.freebsd.org/changeset/base/255534

Log:
  MFC r255119:
  Fix SES_ENABLE_PASSTHROUGH kernel option, unexpectedly broken during driver
  overhaul.

Modified:
  stable/9/sys/cam/scsi/scsi_enc.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_enc.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_enc.c	Sat Sep 14 06:43:09 2013	(r255533)
+++ stable/9/sys/cam/scsi/scsi_enc.c	Sat Sep 14 08:22:57 2013	(r255534)
@@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$");
 #include <cam/scsi/scsi_enc.h>
 #include <cam/scsi/scsi_enc_internal.h>
 
+#include <opt_ses.h>
+
 MALLOC_DEFINE(M_SCSIENC, "SCSI ENC", "SCSI ENC buffers");
 
 /* Enclosure type independent driver */
@@ -719,12 +721,12 @@ enc_type(struct ccb_getdev *cgd)
 		return (ENC_NONE);
 	}
 
-#ifdef	ENC_ENABLE_PASSTHROUGH
+#ifdef	SES_ENABLE_PASSTHROUGH
 	if ((iqd[6] & 0x40) && (iqd[2] & 0x7) >= 2) {
 		/*
 		 * PassThrough Device.
 		 */
-		return (ENC_ENC_PASSTHROUGH);
+		return (ENC_SES_PASSTHROUGH);
 	}
 #endif
 

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:24:34 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B96AEA28;
 Sat, 14 Sep 2013 08:24:34 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A55EB28D2;
 Sat, 14 Sep 2013 08:24:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8OYTc068224;
 Sat, 14 Sep 2013 08:24:34 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8OYWl068223;
 Sat, 14 Sep 2013 08:24:34 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140824.r8E8OYWl068223@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:24:34 +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: r255535 - stable/9/share/man/man4
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:24:34 -0000

Author: mav
Date: Sat Sep 14 08:24:34 2013
New Revision: 255535
URL: http://svnweb.freebsd.org/changeset/base/255535

Log:
  MFC r255534:
  Add more references.

Modified:
  stable/9/share/man/man4/netgraph.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/netgraph.4
==============================================================================
--- stable/9/share/man/man4/netgraph.4	Sat Sep 14 08:22:57 2013	(r255534)
+++ stable/9/share/man/man4/netgraph.4	Sat Sep 14 08:24:34 2013	(r255535)
@@ -1284,7 +1284,7 @@ link between two machines.
 There is a full multilink PPP implementation that runs in
 .Nm .
 The
-.Pa net/mpd
+.Pa net/mpd5
 port can use these modules to make a very low latency high
 capacity PPP system.
 It also supports
@@ -1423,6 +1423,7 @@ common networking problems, solved using
 .Xr ng_bridge 4 ,
 .Xr ng_bt3c 4 ,
 .Xr ng_btsocket 4 ,
+.Xr ng_car 4 ,
 .Xr ng_cisco 4 ,
 .Xr ng_device 4 ,
 .Xr ng_echo 4 ,
@@ -1439,13 +1440,16 @@ common networking problems, solved using
 .Xr ng_hub 4 ,
 .Xr ng_iface 4 ,
 .Xr ng_ip_input 4 ,
+.Xr ng_ipfw 4 ,
 .Xr ng_ksocket 4 ,
 .Xr ng_l2cap 4 ,
 .Xr ng_l2tp 4 ,
 .Xr ng_lmi 4 ,
 .Xr ng_mppc 4 ,
+.Xr ng_nat 4 ,
 .Xr ng_netflow 4 ,
 .Xr ng_one2many 4 ,
+.Xr ng_patch 4 ,
 .Xr ng_ppp 4 ,
 .Xr ng_pppoe 4 ,
 .Xr ng_pptpgre 4 ,

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:29:11 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 9D9EFEF4;
 Sat, 14 Sep 2013 08:29:11 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 887D828F9;
 Sat, 14 Sep 2013 08:29:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8TBQt070159;
 Sat, 14 Sep 2013 08:29:11 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8TB4E070158;
 Sat, 14 Sep 2013 08:29:11 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140829.r8E8TB4E070158@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:29:11 +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: r255536 -
 stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:29:11 -0000

Author: mav
Date: Sat Sep 14 08:29:11 2013
New Revision: 255536
URL: http://svnweb.freebsd.org/changeset/base/255536

Log:
  MFC r253643:
  Following r222950, revert unintentional change cls -> class in argument name
  in r245264.  Aside from non-uniformity, that again confused C++ compilers.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h	Sat Sep 14 08:24:34 2013	(r255535)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h	Sat Sep 14 08:29:11 2013	(r255536)
@@ -172,7 +172,7 @@ extern void ddt_object_name(ddt_t *ddt, 
 extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type,
     enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde);
 extern int ddt_object_count(ddt_t *ddt, enum ddt_type type,
-    enum ddt_class class, uint64_t *count);
+    enum ddt_class cls, uint64_t *count);
 extern int ddt_object_info(ddt_t *ddt, enum ddt_type type,
     enum ddt_class cls, dmu_object_info_t *);
 extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type,

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:32:17 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E2424114;
 Sat, 14 Sep 2013 08:32:17 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B4D76293C;
 Sat, 14 Sep 2013 08:32:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8WHbN073623;
 Sat, 14 Sep 2013 08:32:17 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8WHLa073622;
 Sat, 14 Sep 2013 08:32:17 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140832.r8E8WHLa073622@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:32: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: r255537 -
 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:32:18 -0000

Author: mav
Date: Sat Sep 14 08:32:17 2013
New Revision: 255537
URL: http://svnweb.freebsd.org/changeset/base/255537

Log:
  MFC r253806:
  Allow three IOCTLs to be used on suspended pool, restoring state that
  existed before IOCTL code refactoring merged change 4445fffb from illumos
  at r248571.
  
  This change allows `zpool clear` to be used again to recover suspended pool.
  It seems the only was supposed by the code to restore pool operation after
  reconnecting lost disks that were required for data completeness.  There
  are still cases where `zpool clear` command can just safely stuck due to
  deadlocks inside ZFS kernel part, but probably that is better then having
  no chances to recover at all.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  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_ioctl.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Sat Sep 14 08:29:11 2013	(r255536)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Sat Sep 14 08:32:17 2013	(r255537)
@@ -5504,10 +5504,10 @@ zfs_ioctl_init(void)
 	    zfs_secpolicy_read, B_FALSE, POOL_CHECK_NONE);
 
 	zfs_ioctl_register_pool(ZFS_IOC_ERROR_LOG, zfs_ioc_error_log,
-	    zfs_secpolicy_inject, B_FALSE, POOL_CHECK_SUSPENDED);
+	    zfs_secpolicy_inject, B_FALSE, POOL_CHECK_NONE);
 	zfs_ioctl_register_pool(ZFS_IOC_DSOBJ_TO_DSNAME,
 	    zfs_ioc_dsobj_to_dsname,
-	    zfs_secpolicy_diff, B_FALSE, POOL_CHECK_SUSPENDED);
+	    zfs_secpolicy_diff, B_FALSE, POOL_CHECK_NONE);
 	zfs_ioctl_register_pool(ZFS_IOC_POOL_GET_HISTORY,
 	    zfs_ioc_pool_get_history,
 	    zfs_secpolicy_config, B_FALSE, POOL_CHECK_SUSPENDED);
@@ -5516,7 +5516,7 @@ zfs_ioctl_init(void)
 	    zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE);
 
 	zfs_ioctl_register_pool(ZFS_IOC_CLEAR, zfs_ioc_clear,
-	    zfs_secpolicy_config, B_TRUE, POOL_CHECK_SUSPENDED);
+	    zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE);
 	zfs_ioctl_register_pool(ZFS_IOC_POOL_REOPEN, zfs_ioc_pool_reopen,
 	    zfs_secpolicy_config, B_TRUE, POOL_CHECK_SUSPENDED);
 

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:33:59 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8098524C;
 Sat, 14 Sep 2013 08:33:59 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5E5892946;
 Sat, 14 Sep 2013 08:33:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8Xxuq073973;
 Sat, 14 Sep 2013 08:33:59 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8Xxsq073971;
 Sat, 14 Sep 2013 08:33:59 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140833.r8E8Xxsq073971@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:33:59 +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: r255538 - in
 stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:33:59 -0000

Author: mav
Date: Sat Sep 14 08:33:58 2013
New Revision: 255538
URL: http://svnweb.freebsd.org/changeset/base/255538

Log:
  MFC r253990:
  Make ZFS to use separate thread to handle SPA_ASYNC_REMOVE async events.
  Existing async thread is running only on successfull spa_sync() completion,
  that is impossible in case of pool loosing required (last) disk(s).  That
  indefinite delay of SPA_ASYNC_REMOVE processing made ZFS to not close the
  lost disks, preventing GEOM/CAM from destroying devices and reusing names
  on later disk reattach.
  
  In earlier version of the patch I've tried to just run existing thread
  immediately, unrelated to spa_sync() completion, but that exposed number
  of situations where it could stuck due to locks held by stuck spa_sync(),
  that are required for other kinds of async events.
  
  Experiments with OpenIndiana snapshot confirmed that they also have this
  issue with lost disks reattach.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Sat Sep 14 08:32:17 2013	(r255537)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Sat Sep 14 08:33:58 2013	(r255538)
@@ -5763,7 +5763,7 @@ spa_async_thread(void *arg)
 
 	mutex_enter(&spa->spa_async_lock);
 	tasks = spa->spa_async_tasks;
-	spa->spa_async_tasks = 0;
+	spa->spa_async_tasks &= SPA_ASYNC_REMOVE;
 	mutex_exit(&spa->spa_async_lock);
 
 	/*
@@ -5789,19 +5789,6 @@ spa_async_thread(void *arg)
 		}
 	}
 
-	/*
-	 * See if any devices need to be marked REMOVED.
-	 */
-	if (tasks & SPA_ASYNC_REMOVE) {
-		spa_vdev_state_enter(spa, SCL_NONE);
-		spa_async_remove(spa, spa->spa_root_vdev);
-		for (int i = 0; i < spa->spa_l2cache.sav_count; i++)
-			spa_async_remove(spa, spa->spa_l2cache.sav_vdevs[i]);
-		for (int i = 0; i < spa->spa_spares.sav_count; i++)
-			spa_async_remove(spa, spa->spa_spares.sav_vdevs[i]);
-		(void) spa_vdev_state_exit(spa, NULL, 0);
-	}
-
 	if ((tasks & SPA_ASYNC_AUTOEXPAND) && !spa_suspended(spa)) {
 		spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
 		spa_async_autoexpand(spa, spa->spa_root_vdev);
@@ -5839,12 +5826,53 @@ spa_async_thread(void *arg)
 	thread_exit();
 }
 
+static void
+spa_async_thread_vd(void *arg)
+{
+	spa_t *spa = arg;
+	int tasks;
+
+	ASSERT(spa->spa_sync_on);
+
+	mutex_enter(&spa->spa_async_lock);
+	tasks = spa->spa_async_tasks;
+retry:
+	spa->spa_async_tasks &= ~SPA_ASYNC_REMOVE;
+	mutex_exit(&spa->spa_async_lock);
+
+	/*
+	 * See if any devices need to be marked REMOVED.
+	 */
+	if (tasks & SPA_ASYNC_REMOVE) {
+		spa_vdev_state_enter(spa, SCL_NONE);
+		spa_async_remove(spa, spa->spa_root_vdev);
+		for (int i = 0; i < spa->spa_l2cache.sav_count; i++)
+			spa_async_remove(spa, spa->spa_l2cache.sav_vdevs[i]);
+		for (int i = 0; i < spa->spa_spares.sav_count; i++)
+			spa_async_remove(spa, spa->spa_spares.sav_vdevs[i]);
+		(void) spa_vdev_state_exit(spa, NULL, 0);
+	}
+
+	/*
+	 * Let the world know that we're done.
+	 */
+	mutex_enter(&spa->spa_async_lock);
+	tasks = spa->spa_async_tasks;
+	if ((tasks & SPA_ASYNC_REMOVE) != 0)
+		goto retry;
+	spa->spa_async_thread_vd = NULL;
+	cv_broadcast(&spa->spa_async_cv);
+	mutex_exit(&spa->spa_async_lock);
+	thread_exit();
+}
+
 void
 spa_async_suspend(spa_t *spa)
 {
 	mutex_enter(&spa->spa_async_lock);
 	spa->spa_async_suspended++;
-	while (spa->spa_async_thread != NULL)
+	while (spa->spa_async_thread != NULL &&
+	    spa->spa_async_thread_vd != NULL)
 		cv_wait(&spa->spa_async_cv, &spa->spa_async_lock);
 	mutex_exit(&spa->spa_async_lock);
 }
@@ -5865,7 +5893,8 @@ spa_async_tasks_pending(spa_t *spa)
 	uint_t config_task;
 	boolean_t config_task_suspended;
 
-	non_config_tasks = spa->spa_async_tasks & ~SPA_ASYNC_CONFIG_UPDATE;
+	non_config_tasks = spa->spa_async_tasks & ~(SPA_ASYNC_CONFIG_UPDATE |
+	    SPA_ASYNC_REMOVE);
 	config_task = spa->spa_async_tasks & SPA_ASYNC_CONFIG_UPDATE;
 	if (spa->spa_ccw_fail_time == 0) {
 		config_task_suspended = B_FALSE;
@@ -5891,6 +5920,19 @@ spa_async_dispatch(spa_t *spa)
 	mutex_exit(&spa->spa_async_lock);
 }
 
+static void
+spa_async_dispatch_vd(spa_t *spa)
+{
+	mutex_enter(&spa->spa_async_lock);
+	if ((spa->spa_async_tasks & SPA_ASYNC_REMOVE) != 0 &&
+	    !spa->spa_async_suspended &&
+	    spa->spa_async_thread_vd == NULL &&
+	    rootdir != NULL)
+		spa->spa_async_thread_vd = thread_create(NULL, 0,
+		    spa_async_thread_vd, spa, 0, &p0, TS_RUN, maxclsyspri);
+	mutex_exit(&spa->spa_async_lock);
+}
+
 void
 spa_async_request(spa_t *spa, int task)
 {
@@ -5898,6 +5940,7 @@ spa_async_request(spa_t *spa, int task)
 	mutex_enter(&spa->spa_async_lock);
 	spa->spa_async_tasks |= task;
 	mutex_exit(&spa->spa_async_lock);
+	spa_async_dispatch_vd(spa);
 }
 
 /*
@@ -6486,6 +6529,7 @@ spa_sync(spa_t *spa, uint64_t txg)
 	 * If any async tasks have been requested, kick them off.
 	 */
 	spa_async_dispatch(spa);
+	spa_async_dispatch_vd(spa);
 }
 
 /*

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h	Sat Sep 14 08:32:17 2013	(r255537)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h	Sat Sep 14 08:33:58 2013	(r255538)
@@ -169,6 +169,7 @@ struct spa {
 	uint64_t	spa_scan_pass_exam;	/* examined bytes per pass */
 	kmutex_t	spa_async_lock;		/* protect async state */
 	kthread_t	*spa_async_thread;	/* thread doing async task */
+	kthread_t	*spa_async_thread_vd;	/* thread doing vd async task */
 	int		spa_async_suspended;	/* async tasks suspended */
 	kcondvar_t	spa_async_cv;		/* wait for thread_exit() */
 	uint16_t	spa_async_tasks;	/* async task mask */

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:35:21 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 2C2AB379;
 Sat, 14 Sep 2013 08:35:21 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 172122949;
 Sat, 14 Sep 2013 08:35:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8ZKmJ074518;
 Sat, 14 Sep 2013 08:35:20 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8ZKDe074517;
 Sat, 14 Sep 2013 08:35:20 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140835.r8E8ZKDe074517@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:35:20 +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: r255539 -
 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:35:21 -0000

Author: mav
Date: Sat Sep 14 08:35:20 2013
New Revision: 255539
URL: http://svnweb.freebsd.org/changeset/base/255539

Log:
  MFC r253991:
  Make `zpool clear` to reopen also reconnected cache and spare devices.
  Since `zpool status` reports about such kinds of errors, it is strange
  that they are not cleared by `zpool clear`.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Sat Sep 14 08:33:58 2013	(r255538)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Sat Sep 14 08:35:20 2013	(r255539)
@@ -2379,6 +2379,14 @@ vdev_clear(spa_t *spa, vdev_t *vd)
 	for (int c = 0; c < vd->vdev_children; c++)
 		vdev_clear(spa, vd->vdev_child[c]);
 
+	if (vd == rvd) {
+		for (int c = 0; c < spa->spa_l2cache.sav_count; c++)
+			vdev_clear(spa, spa->spa_l2cache.sav_vdevs[c]);
+
+		for (int c = 0; c < spa->spa_spares.sav_count; c++)
+			vdev_clear(spa, spa->spa_spares.sav_vdevs[c]);
+	}
+
 	/*
 	 * If we're in the FAULTED state or have experienced failed I/O, then
 	 * clear the persistent state and attempt to reopen the device.  We

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:37:50 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 28B164CA;
 Sat, 14 Sep 2013 08:37:50 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id EFB52295A;
 Sat, 14 Sep 2013 08:37:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8bneB075311;
 Sat, 14 Sep 2013 08:37:49 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8bnaj075310;
 Sat, 14 Sep 2013 08:37:49 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140837.r8E8bnaj075310@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:37:49 +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: r255540 -
 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:37:50 -0000

Author: mav
Date: Sat Sep 14 08:37:49 2013
New Revision: 255540
URL: http://svnweb.freebsd.org/changeset/base/255540

Log:
  MFC r253993:
  Block reporting of ZFS features for suspended pools.
  
  Before executing any subcommand, zpool tool fetches pools configuration from
  the kernel.  Before features support was added, kernel was regenerating that
  configuration based on data always present in memory.  Unfortunately, pool
  features list and activity counters are not such. They are stored in ZAP,
  that normally resides in ARC, but under heavy memory pressure may be swapped
  out.  If pool is suspended at this point, there is no way to recover it back
  since any zpool command will stuck.
  
  This change has one predictable flaw: `zpool upgrade` always wish to upgrade
  suspended pools, but fortunately it can't do it due to the suspension.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Sat Sep 14 08:35:20 2013	(r255539)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Sat Sep 14 08:37:49 2013	(r255540)
@@ -3060,6 +3060,10 @@ spa_add_feature_stats(spa_t *spa, nvlist
 	ASSERT(spa_config_held(spa, SCL_CONFIG, RW_READER));
 	VERIFY(nvlist_alloc(&features, NV_UNIQUE_NAME, KM_SLEEP) == 0);
 
+	/* We may be unable to read features if pool is suspended. */
+	if (spa_suspended(spa))
+		goto out;
+
 	if (spa->spa_feat_for_read_obj != 0) {
 		for (zap_cursor_init(&zc, spa->spa_meta_objset,
 		    spa->spa_feat_for_read_obj);
@@ -3086,6 +3090,7 @@ spa_add_feature_stats(spa_t *spa, nvlist
 		zap_cursor_fini(&zc);
 	}
 
+out:
 	VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS,
 	    features) == 0);
 	nvlist_free(features);

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:45:16 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 2F6C062E;
 Sat, 14 Sep 2013 08:45:16 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1BC41299D;
 Sat, 14 Sep 2013 08:45:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8jFSg080232;
 Sat, 14 Sep 2013 08:45:15 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8jFTq080231;
 Sat, 14 Sep 2013 08:45:15 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140845.r8E8jFTq080231@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:45:15 +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: r255541 - stable/9/sys/kern
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:45:16 -0000

Author: mav
Date: Sat Sep 14 08:45:15 2013
New Revision: 255541
URL: http://svnweb.freebsd.org/changeset/base/255541

Log:
  MFC r255363:
  Micro-optimize cpu_search(), allowing compiler to use more efficient inline
  ffsl() implementation, when it is available, instead of homegrown iteration.
  
  On dual-E5645 amd64 system (2x6x2 cores) under heavy I/O load that reduces
  time spent inside cpu_search() from 19% to 13%, while IOPS increased by 5%.

Modified:
  stable/9/sys/kern/sched_ule.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/sched_ule.c
==============================================================================
--- stable/9/sys/kern/sched_ule.c	Sat Sep 14 08:37:49 2013	(r255540)
+++ stable/9/sys/kern/sched_ule.c	Sat Sep 14 08:45:15 2013	(r255541)
@@ -632,10 +632,14 @@ cpu_search(const struct cpu_group *cg, s
 	}
 
 	/* Iterate through the child CPU groups and then remaining CPUs. */
-	for (i = cg->cg_children, cpu = mp_maxid; i >= 0; ) {
+	for (i = cg->cg_children, cpu = mp_maxid; ; ) {
 		if (i == 0) {
+#ifdef HAVE_INLINE_FFSL
+			cpu = CPU_FFS(&cpumask) - 1;
+#else
 			while (cpu >= 0 && !CPU_ISSET(cpu, &cpumask))
 				cpu--;
+#endif
 			if (cpu < 0)
 				break;
 			child = NULL;
@@ -660,6 +664,7 @@ cpu_search(const struct cpu_group *cg, s
 				break;
 			}
 		} else {			/* Handle child CPU. */
+			CPU_CLR(cpu, &cpumask);
 			tdq = TDQ_CPU(cpu);
 			load = tdq->tdq_load * 256;
 			rndptr = DPCPU_PTR(randomval);
@@ -707,8 +712,11 @@ cpu_search(const struct cpu_group *cg, s
 			i--;
 			if (i == 0 && CPU_EMPTY(&cpumask))
 				break;
-		} else
+		}
+#ifndef HAVE_INLINE_FFSL
+		else
 			cpu--;
+#endif
 	}
 	return (total);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:55:49 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 6196CFF9;
 Sat, 14 Sep 2013 08:55:49 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3F2A42A15;
 Sat, 14 Sep 2013 08:55:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8tnRE086854;
 Sat, 14 Sep 2013 08:55:49 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8tmV0086850;
 Sat, 14 Sep 2013 08:55:48 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140855.r8E8tmV0086850@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:55:48 +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: r255542 - in stable/9/sys/cam: . scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:55:49 -0000

Author: mav
Date: Sat Sep 14 08:55:48 2013
New Revision: 255542
URL: http://svnweb.freebsd.org/changeset/base/255542

Log:
  MFC r252382 (by scottl), r252684 (by jkim):
  Introduce accessors for the ccb status word.  Convert one (of many more)
  modules to use it, will convert the others once the appropriate shed
  color is selected by consensus.

Modified:
  stable/9/sys/cam/cam_ccb.h
  stable/9/sys/cam/scsi/scsi_xpt.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/cam_ccb.h
==============================================================================
--- stable/9/sys/cam/cam_ccb.h	Sat Sep 14 08:45:15 2013	(r255541)
+++ stable/9/sys/cam/cam_ccb.h	Sat Sep 14 08:55:48 2013	(r255542)
@@ -1305,6 +1305,19 @@ cam_fill_smpio(struct ccb_smpio *smpio, 
 	smpio->smp_response_len = smp_response_len;
 }
 
+static __inline void
+cam_set_ccbstatus(union ccb *ccb, cam_status status)
+{
+	ccb->ccb_h.status &= ~CAM_STATUS_MASK;
+	ccb->ccb_h.status |= status;
+}
+
+static __inline cam_status
+cam_ccb_status(union ccb *ccb)
+{
+	return ((cam_status)(ccb->ccb_h.status & CAM_STATUS_MASK));
+}
+
 void cam_calc_geometry(struct ccb_calc_geometry *ccg, int extended);
 
 __END_DECLS

Modified: stable/9/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_xpt.c	Sat Sep 14 08:45:15 2013	(r255541)
+++ stable/9/sys/cam/scsi/scsi_xpt.c	Sat Sep 14 08:55:48 2013	(r255542)
@@ -975,7 +975,7 @@ proberequestdefaultnegotiation(struct ca
 	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_USER_SETTINGS;
 	xpt_action((union ccb *)&cts);
-	if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+	if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP) {
 		return;
 	}
 	cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
@@ -997,7 +997,7 @@ proberequestbackoff(struct cam_periph *p
 	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_CURRENT_SETTINGS;
 	xpt_action((union ccb *)&cts);
-	if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+	if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP) {
 		if (bootverbose) {
 			xpt_print(periph->path,
 			    "failed to get current device settings\n");
@@ -1076,7 +1076,7 @@ proberequestbackoff(struct cam_periph *p
 		cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
 		cts.type = CTS_TYPE_CURRENT_SETTINGS;
 		xpt_action((union ccb *)&cts);
-		if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+		if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP) {
 			break;
 		}
 		CAM_DEBUG(periph->path, CAM_DEBUG_PROBE,
@@ -1106,7 +1106,7 @@ probedone(struct cam_periph *periph, uni
 	switch (softc->action) {
 	case PROBE_TUR:
 	{
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+		if (cam_ccb_status(done_ccb) != CAM_REQ_CMP) {
 
 			if (cam_periph_error(done_ccb, 0,
 					     SF_NO_PRINT, NULL) == ERESTART)
@@ -1125,7 +1125,7 @@ probedone(struct cam_periph *periph, uni
 	case PROBE_INQUIRY:
 	case PROBE_FULL_INQUIRY:
 	{
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+		if (cam_ccb_status(done_ccb) == CAM_REQ_CMP) {
 			struct scsi_inquiry_data *inq_buf;
 			u_int8_t periph_qual;
 
@@ -1243,7 +1243,7 @@ probedone(struct cam_periph *periph, uni
 		nlun = scsi_4btoul(lp->length) / 8;
 		maxlun = (csio->dxfer_len / 8) - 1;
 
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+		if (cam_ccb_status(done_ccb) != CAM_REQ_CMP) {
 			if (cam_periph_error(done_ccb, 0,
 			    done_ccb->ccb_h.target_lun > 0 ?
 			    SF_RETRY_UA|SF_QUIET_IR : SF_RETRY_UA,
@@ -1354,7 +1354,7 @@ probedone(struct cam_periph *periph, uni
 
 		csio = &done_ccb->csio;
 		mode_hdr = (struct scsi_mode_header_6 *)csio->data_ptr;
-		if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+		if (cam_ccb_status(done_ccb) == CAM_REQ_CMP) {
 			struct scsi_control_page *page;
 			u_int8_t *offset;
 
@@ -1489,7 +1489,7 @@ probe_device_check:
 			/*
 			 * Don't process the command as it was never sent
 			 */
-		} else if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP
+		} else if (cam_ccb_status(done_ccb) == CAM_REQ_CMP
 			&& (serial_buf->length > 0)) {
 
 			have_serialnum = 1;
@@ -1574,7 +1574,7 @@ probe_device_check:
 	}
 	case PROBE_TUR_FOR_NEGOTIATION:
 	case PROBE_DV_EXIT:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+		if (cam_ccb_status(done_ccb) != CAM_REQ_CMP) {
 			cam_periph_error(done_ccb, 0,
 			    SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY, NULL);
 		}
@@ -1625,7 +1625,7 @@ probe_device_check:
 		struct scsi_inquiry_data *nbuf;
 		struct ccb_scsiio *csio;
 
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+		if (cam_ccb_status(done_ccb) != CAM_REQ_CMP) {
 			cam_periph_error(done_ccb, 0,
 			    SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY, NULL);
 		}
@@ -1980,7 +1980,7 @@ scsi_scan_bus(struct cam_periph *periph,
 
 		oldpath = request_ccb->ccb_h.path;
 
-		status = request_ccb->ccb_h.status & CAM_STATUS_MASK;
+		status = cam_ccb_status(request_ccb);
 		/* Reuse the same CCB to query if a device was really found */
 		scan_info = (scsi_scan_bus_info *)request_ccb->ccb_h.ppriv_ptr0;
 		xpt_setup_ccb(&request_ccb->ccb_h, request_ccb->ccb_h.path,
@@ -2663,7 +2663,7 @@ scsi_set_transfer_settings(struct ccb_tr
 		cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 		cur_cts.type = cts->type;
 		xpt_action((union ccb *)&cur_cts);
-		if ((cur_cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+		if (cam_ccb_status((union ccb *)&cur_cts) != CAM_REQ_CMP) {
 			return;
 		}
 		cur_scsi = &cur_cts.proto_specific.scsi;
@@ -2947,7 +2947,7 @@ scsi_announce_periph(struct cam_periph *
 	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_CURRENT_SETTINGS;
 	xpt_action((union ccb*)&cts);
-	if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
+	if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP)
 		return;
 	/* Ask the SIM for its base transfer speed */
 	xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL);

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 08:58:29 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 30DD71D6;
 Sat, 14 Sep 2013 08:58:29 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1BB262A26;
 Sat, 14 Sep 2013 08:58:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E8wTfe087953;
 Sat, 14 Sep 2013 08:58:29 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E8wTRD087952;
 Sat, 14 Sep 2013 08:58:29 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140858.r8E8wTRD087952@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 08:58:29 +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: r255543 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 08:58:29 -0000

Author: mav
Date: Sat Sep 14 08:58:28 2013
New Revision: 255543
URL: http://svnweb.freebsd.org/changeset/base/255543

Log:
  MFC  r253228, r253307 (by scottl):
  Refactor the various delete methods out of dastart().  Cleans up a bunch
  of style and adds more modularity and clarity.

Modified:
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 08:55:48 2013	(r255542)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 08:58:28 2013	(r255543)
@@ -145,6 +145,22 @@ typedef enum {
 	DA_DELETE_MAX = DA_DELETE_ZERO
 } da_delete_methods;
 
+typedef void da_delete_func_t (struct cam_periph *periph, union ccb *ccb,
+			      struct bio *bp);
+static da_delete_func_t da_delete_trim;
+static da_delete_func_t da_delete_unmap;
+static da_delete_func_t da_delete_ws;
+
+static const void * da_delete_functions[] = {
+	NULL,
+	NULL,
+	da_delete_trim,
+	da_delete_unmap,
+	da_delete_ws,
+	da_delete_ws,
+	da_delete_ws
+};
+
 static const char *da_delete_method_names[] =
     { "NONE", "DISABLE", "ATA_TRIM", "UNMAP", "WS16", "WS10", "ZERO" };
 static const char *da_delete_method_desc[] =
@@ -199,6 +215,7 @@ struct da_softc {
 	uint32_t		unmap_max_lba;
 	uint64_t		ws_max_blks;
 	da_delete_methods	delete_method;
+	da_delete_func_t	*delete_func;
 	struct	 disk_params params;
 	struct	 disk *disk;
 	union	 ccb saved_ccb;
@@ -1813,6 +1830,7 @@ dadeletemethodset(struct da_softc *softc
 
 	softc->delete_method = delete_method;
 	softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method);
+	softc->delete_func = da_delete_functions[delete_method];
 
 	if (softc->delete_method > DA_DELETE_DISABLE)
 		softc->disk->d_flags |= DISKFLAG_CANDELETE;
@@ -2172,7 +2190,7 @@ skipstate:
 	switch (softc->state) {
 	case DA_STATE_NORMAL:
 	{
-		struct bio *bp, *bp1;
+		struct bio *bp;
 		uint8_t tag_code;
 
 		/* Execute immediate CCB if waiting. */
@@ -2192,237 +2210,13 @@ skipstate:
 		/* Run BIO_DELETE if not running yet. */
 		if (!softc->delete_running &&
 		    (bp = bioq_first(&softc->delete_queue)) != NULL) {
-		    uint64_t lba;
-		    uint64_t count; /* forward compat with WS32 */
-
-		    /*
-		     * In each of the methods below, while its the caller's
-		     * responsibility to ensure the request will fit into a
-		     * single device request, we might have changed the delete
-		     * method due to the device incorrectly advertising either
-		     * its supported methods or limits.
-		     * 
-		     * To prevent this causing further issues we validate the
-		     * against the methods limits, and warn which would
-		     * otherwise be unnecessary.
-		     */
-
-		    if (softc->delete_method == DA_DELETE_UNMAP) {
-			uint8_t *buf = softc->unmap_buf;
-			uint64_t lastlba = (uint64_t)-1;
-			uint32_t lastcount = 0, c;
-			uint64_t totalcount = 0;
-			uint32_t off, ranges = 0;
-
-			/*
-			 * Currently this doesn't take the UNMAP
-			 * Granularity and Granularity Alignment
-			 * fields into account.
-			 *
-			 * This could result in both unoptimal unmap
-			 * requests as as well as UNMAP calls unmapping
-			 * fewer LBA's than requested.
-			 */
-
-			softc->delete_running = 1;
-			bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
-			bp1 = bp;
-			do {
-				bioq_remove(&softc->delete_queue, bp1);
-				if (bp1 != bp)
-					bioq_insert_tail(&softc->delete_run_queue, bp1);
-				lba = bp1->bio_pblkno;
-				count = bp1->bio_bcount / softc->params.secsize;
-
-				/* Try to extend the previous range. */
-				if (lba == lastlba) {
-					c = min(count, softc->unmap_max_lba -
-						lastcount);
-					lastcount += c;
-					off = ((ranges - 1) * UNMAP_RANGE_SIZE) +
-					      UNMAP_HEAD_SIZE;
-					scsi_ulto4b(lastcount, &buf[off + 8]);
-					count -= c;
-					lba +=c;
-					totalcount += c;
-				}
-
-				while (count > 0) {
-					c = min(count, softc->unmap_max_lba);
-					if (totalcount + c > softc->unmap_max_lba ||
-					    ranges >= softc->unmap_max_ranges) {
-						xpt_print(periph->path,
-						  "%s issuing short delete %ld > %ld"
-						  "|| %d >= %d",
-						  da_delete_method_desc[softc->delete_method],
-						  totalcount + c, softc->unmap_max_lba,
-						  ranges, softc->unmap_max_ranges);
-						break;
-					}
-					off = (ranges * UNMAP_RANGE_SIZE) +
-					      UNMAP_HEAD_SIZE;
-					scsi_u64to8b(lba, &buf[off + 0]);
-					scsi_ulto4b(c, &buf[off + 8]);
-					lba += c;
-					totalcount += c;
-					ranges++;
-					count -= c;
-					lastcount = c;
-				}
-				lastlba = lba;
-				bp1 = bioq_first(&softc->delete_queue);
-				if (bp1 == NULL ||
-				    ranges >= softc->unmap_max_ranges ||
-				    totalcount + bp1->bio_bcount /
-				     softc->params.secsize > softc->unmap_max_lba)
-					break;
-			} while (1);
-			scsi_ulto2b(ranges * 16 + 6, &buf[0]);
-			scsi_ulto2b(ranges * 16, &buf[2]);
-
-			scsi_unmap(&start_ccb->csio,
-					/*retries*/da_retry_count,
-					/*cbfcnp*/dadone,
-					/*tag_action*/MSG_SIMPLE_Q_TAG,
-					/*byte2*/0,
-					/*data_ptr*/ buf,
-					/*dxfer_len*/ ranges * 16 + 8,
-					/*sense_len*/SSD_FULL_SIZE,
-					da_default_timeout * 1000);
-			start_ccb->ccb_h.ccb_state = DA_CCB_DELETE;
-			goto out;
-		    } else if (softc->delete_method == DA_DELETE_ATA_TRIM) {
-				uint8_t *buf = softc->unmap_buf;
-				uint64_t lastlba = (uint64_t)-1;
-				uint32_t lastcount = 0, c, requestcount;
-				int ranges = 0, off, block_count;
-
-				softc->delete_running = 1;
-				bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
-				bp1 = bp;
-				do {
-					bioq_remove(&softc->delete_queue, bp1);
-					if (bp1 != bp)
-						bioq_insert_tail(&softc->delete_run_queue, bp1);
-					lba = bp1->bio_pblkno;
-					count = bp1->bio_bcount / softc->params.secsize;
-					requestcount = count;
-
-					/* Try to extend the previous range. */
-					if (lba == lastlba) {
-						c = min(count, ATA_DSM_RANGE_MAX - lastcount);
-						lastcount += c;
-						off = (ranges - 1) * 8;
-						buf[off + 6] = lastcount & 0xff;
-						buf[off + 7] = (lastcount >> 8) & 0xff;
-						count -= c;
-						lba += c;
-					}
-
-					while (count > 0) {
-						c = min(count, ATA_DSM_RANGE_MAX);
-						off = ranges * 8;
-
-						buf[off + 0] = lba & 0xff;
-						buf[off + 1] = (lba >> 8) & 0xff;
-						buf[off + 2] = (lba >> 16) & 0xff;
-						buf[off + 3] = (lba >> 24) & 0xff;
-						buf[off + 4] = (lba >> 32) & 0xff;
-						buf[off + 5] = (lba >> 40) & 0xff;
-						buf[off + 6] = c & 0xff;
-						buf[off + 7] = (c >> 8) & 0xff;
-						lba += c;
-						ranges++;
-						count -= c;
-						lastcount = c;
-						if (count != 0 && ranges == softc->trim_max_ranges) {
-							xpt_print(periph->path,
-							  "%s issuing short delete %ld > %ld",
-							  da_delete_method_desc[softc->delete_method],
-							  requestcount,
-							  (softc->trim_max_ranges - ranges) *
-							  ATA_DSM_RANGE_MAX);
-							break;
-						}
-					}
-					lastlba = lba;
-					bp1 = bioq_first(&softc->delete_queue);
-					if (bp1 == NULL ||
-					    bp1->bio_bcount / softc->params.secsize >
-					    (softc->trim_max_ranges - ranges) *
-						    ATA_DSM_RANGE_MAX)
-						break;
-				} while (1);
-
-				block_count = (ranges + ATA_DSM_BLK_RANGES - 1) /
-					      ATA_DSM_BLK_RANGES;
-				scsi_ata_trim(&start_ccb->csio,
-						/*retries*/da_retry_count,
-						/*cbfcnp*/dadone,
-						/*tag_action*/MSG_SIMPLE_Q_TAG,
-						block_count,
-						/*data_ptr*/buf,
-						/*dxfer_len*/block_count * ATA_DSM_BLK_SIZE,
-						/*sense_len*/SSD_FULL_SIZE,
-						da_default_timeout * 1000);
-				start_ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+			if (softc->delete_func != NULL) {
+				softc->delete_func(periph, start_ccb, bp);
 				goto out;
-		    } else if (softc->delete_method == DA_DELETE_ZERO ||
-			       softc->delete_method == DA_DELETE_WS10 ||
-			       softc->delete_method == DA_DELETE_WS16) {
-			/*
-			 * We calculate ws_max_blks here based off d_delmaxsize instead
-			 * of using softc->ws_max_blks as it is absolute max for the
-			 * device not the protocol max which may well be lower
-			 */
-			uint64_t ws_max_blks;
-			ws_max_blks = softc->disk->d_delmaxsize / softc->params.secsize;
-			softc->delete_running = 1;
-			lba = bp->bio_pblkno;
-			count = 0;
-			bp1 = bp;
-			do {
-				bioq_remove(&softc->delete_queue, bp1);
-				if (bp1 != bp)
-					bioq_insert_tail(&softc->delete_run_queue, bp1);
-				count += bp1->bio_bcount / softc->params.secsize;
-				if (count > ws_max_blks) {
-					count = min(count, ws_max_blks);
-					xpt_print(periph->path,
-					  "%s issuing short delete %ld > %ld",
-					  da_delete_method_desc[softc->delete_method],
-					  count, ws_max_blks);
-					break;
-				}
-				bp1 = bioq_first(&softc->delete_queue);
-				if (bp1 == NULL ||
-				    lba + count != bp1->bio_pblkno ||
-				    count + bp1->bio_bcount /
-				     softc->params.secsize > ws_max_blks)
-					break;
-			} while (1);
-
-			scsi_write_same(&start_ccb->csio,
-					/*retries*/da_retry_count,
-					/*cbfcnp*/dadone,
-					/*tag_action*/MSG_SIMPLE_Q_TAG,
-					/*byte2*/softc->delete_method ==
-					    DA_DELETE_ZERO ? 0 : SWS_UNMAP,
-					softc->delete_method ==
-					    DA_DELETE_WS16 ? 16 : 10,
-					/*lba*/lba,
-					/*block_count*/count,
-					/*data_ptr*/ __DECONST(void *,
-					    zero_region),
-					/*dxfer_len*/ softc->params.secsize,
-					/*sense_len*/SSD_FULL_SIZE,
-					da_default_timeout * 1000);
-			start_ccb->ccb_h.ccb_state = DA_CCB_DELETE;
-			goto out;
-		    } else {
-			bioq_flush(&softc->delete_queue, NULL, 0);
-			/* FALLTHROUGH */
-		    }
+			} else {
+				bioq_flush(&softc->delete_queue, NULL, 0);
+				/* FALLTHROUGH */
+			}
 		}
 
 		/* Run regular command. */
@@ -2714,6 +2508,240 @@ out:
 	}
 }
 
+/*
+ * In each of the methods below, while its the caller's
+ * responsibility to ensure the request will fit into a
+ * single device request, we might have changed the delete
+ * method due to the device incorrectly advertising either
+ * its supported methods or limits.
+ * 
+ * To prevent this causing further issues we validate the
+ * against the methods limits, and warn which would
+ * otherwise be unnecessary.
+ */
+static void
+da_delete_unmap(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
+{
+	struct da_softc *softc = (struct da_softc *)periph->softc;;
+	struct bio *bp1;
+	uint8_t *buf = softc->unmap_buf;
+	uint64_t lba, lastlba = (uint64_t)-1;
+	uint64_t totalcount = 0;
+	uint64_t count;
+	uint32_t lastcount = 0, c;
+	uint32_t off, ranges = 0;
+
+	/*
+	 * Currently this doesn't take the UNMAP
+	 * Granularity and Granularity Alignment
+	 * fields into account.
+	 *
+	 * This could result in both unoptimal unmap
+	 * requests as as well as UNMAP calls unmapping
+	 * fewer LBA's than requested.
+	 */
+
+	softc->delete_running = 1;
+	bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
+	bp1 = bp;
+	do {
+		bioq_remove(&softc->delete_queue, bp1);
+		if (bp1 != bp)
+			bioq_insert_tail(&softc->delete_run_queue, bp1);
+		lba = bp1->bio_pblkno;
+		count = bp1->bio_bcount / softc->params.secsize;
+
+		/* Try to extend the previous range. */
+		if (lba == lastlba) {
+			c = min(count, softc->unmap_max_lba - lastcount);
+			lastcount += c;
+			off = ((ranges - 1) * UNMAP_RANGE_SIZE) +
+			      UNMAP_HEAD_SIZE;
+			scsi_ulto4b(lastcount, &buf[off + 8]);
+			count -= c;
+			lba +=c;
+			totalcount += c;
+		}
+
+		while (count > 0) {
+			c = min(count, softc->unmap_max_lba);
+			if (totalcount + c > softc->unmap_max_lba ||
+			    ranges >= softc->unmap_max_ranges) {
+				xpt_print(periph->path,
+				    "%s issuing short delete %ld > %ld"
+				    "|| %d >= %d",
+				    da_delete_method_desc[softc->delete_method],
+				    totalcount + c, softc->unmap_max_lba,
+				    ranges, softc->unmap_max_ranges);
+				break;
+			}
+			off = (ranges * UNMAP_RANGE_SIZE) + UNMAP_HEAD_SIZE;
+			scsi_u64to8b(lba, &buf[off + 0]);
+			scsi_ulto4b(c, &buf[off + 8]);
+			lba += c;
+			totalcount += c;
+			ranges++;
+			count -= c;
+			lastcount = c;
+		}
+		lastlba = lba;
+		bp1 = bioq_first(&softc->delete_queue);
+		if (bp1 == NULL || ranges >= softc->unmap_max_ranges ||
+		    totalcount + bp1->bio_bcount /
+		    softc->params.secsize > softc->unmap_max_lba)
+			break;
+	} while (1);
+	scsi_ulto2b(ranges * 16 + 6, &buf[0]);
+	scsi_ulto2b(ranges * 16, &buf[2]);
+
+	scsi_unmap(&ccb->csio,
+		   /*retries*/da_retry_count,
+		   /*cbfcnp*/dadone,
+		   /*tag_action*/MSG_SIMPLE_Q_TAG,
+		   /*byte2*/0,
+		   /*data_ptr*/ buf,
+		   /*dxfer_len*/ ranges * 16 + 8,
+		   /*sense_len*/SSD_FULL_SIZE,
+		   da_default_timeout * 1000);
+	ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+}
+
+static void
+da_delete_trim(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
+{
+	struct da_softc *softc = (struct da_softc *)periph->softc;
+	struct bio *bp1;
+	uint8_t *buf = softc->unmap_buf;
+	uint64_t lastlba = (uint64_t)-1;
+	uint64_t count;
+	uint64_t lba;
+	uint32_t lastcount = 0, c, requestcount;
+	int ranges = 0, off, block_count;
+
+	softc->delete_running = 1;
+	bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
+	bp1 = bp;
+	do {
+		bioq_remove(&softc->delete_queue, bp1);
+		if (bp1 != bp)
+			bioq_insert_tail(&softc->delete_run_queue, bp1);
+		lba = bp1->bio_pblkno;
+		count = bp1->bio_bcount / softc->params.secsize;
+		requestcount = count;
+
+		/* Try to extend the previous range. */
+		if (lba == lastlba) {
+			c = min(count, ATA_DSM_RANGE_MAX - lastcount);
+			lastcount += c;
+			off = (ranges - 1) * 8;
+			buf[off + 6] = lastcount & 0xff;
+			buf[off + 7] = (lastcount >> 8) & 0xff;
+			count -= c;
+			lba += c;
+		}
+
+		while (count > 0) {
+			c = min(count, ATA_DSM_RANGE_MAX);
+			off = ranges * 8;
+
+			buf[off + 0] = lba & 0xff;
+			buf[off + 1] = (lba >> 8) & 0xff;
+			buf[off + 2] = (lba >> 16) & 0xff;
+			buf[off + 3] = (lba >> 24) & 0xff;
+			buf[off + 4] = (lba >> 32) & 0xff;
+			buf[off + 5] = (lba >> 40) & 0xff;
+			buf[off + 6] = c & 0xff;
+			buf[off + 7] = (c >> 8) & 0xff;
+			lba += c;
+			ranges++;
+			count -= c;
+			lastcount = c;
+			if (count != 0 && ranges == softc->trim_max_ranges) {
+				xpt_print(periph->path,
+				    "%s issuing short delete %ld > %ld",
+				    da_delete_method_desc[softc->delete_method],
+				    requestcount,
+				    (softc->trim_max_ranges - ranges) *
+				    ATA_DSM_RANGE_MAX);
+				break;
+			}
+		}
+		lastlba = lba;
+		bp1 = bioq_first(&softc->delete_queue);
+		if (bp1 == NULL || bp1->bio_bcount / softc->params.secsize >
+		    (softc->trim_max_ranges - ranges) * ATA_DSM_RANGE_MAX)
+			break;
+	} while (1);
+
+	block_count = (ranges + ATA_DSM_BLK_RANGES - 1) / ATA_DSM_BLK_RANGES;
+	scsi_ata_trim(&ccb->csio,
+		      /*retries*/da_retry_count,
+		      /*cbfcnp*/dadone,
+		      /*tag_action*/MSG_SIMPLE_Q_TAG,
+		      block_count,
+		      /*data_ptr*/buf,
+		      /*dxfer_len*/block_count * ATA_DSM_BLK_SIZE,
+		      /*sense_len*/SSD_FULL_SIZE,
+		      da_default_timeout * 1000);
+	ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+}
+
+/*
+ * We calculate ws_max_blks here based off d_delmaxsize instead
+ * of using softc->ws_max_blks as it is absolute max for the
+ * device not the protocol max which may well be lower
+ */
+static void
+da_delete_ws(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
+{
+	struct da_softc *softc;
+	struct bio *bp1;
+	uint64_t ws_max_blks;
+	uint64_t lba;
+	uint64_t count; /* forward compat with WS32 */
+
+	softc = (struct da_softc *)periph->softc;
+	ws_max_blks = softc->disk->d_delmaxsize / softc->params.secsize;
+	softc->delete_running = 1;
+	lba = bp->bio_pblkno;
+	count = 0;
+	bp1 = bp;
+	do {
+		bioq_remove(&softc->delete_queue, bp1);
+		if (bp1 != bp)
+			bioq_insert_tail(&softc->delete_run_queue, bp1);
+		count += bp1->bio_bcount / softc->params.secsize;
+		if (count > ws_max_blks) {
+			count = min(count, ws_max_blks);
+			xpt_print(periph->path,
+			    "%s issuing short delete %ld > %ld",
+			    da_delete_method_desc[softc->delete_method],
+			    count, ws_max_blks);
+			break;
+		}
+		bp1 = bioq_first(&softc->delete_queue);
+		if (bp1 == NULL || lba + count != bp1->bio_pblkno ||
+		    count + bp1->bio_bcount /
+		    softc->params.secsize > ws_max_blks)
+			break;
+	} while (1);
+
+	scsi_write_same(&ccb->csio,
+			/*retries*/da_retry_count,
+			/*cbfcnp*/dadone,
+			/*tag_action*/MSG_SIMPLE_Q_TAG,
+			/*byte2*/softc->delete_method ==
+			    DA_DELETE_ZERO ? 0 : SWS_UNMAP,
+			softc->delete_method == DA_DELETE_WS16 ? 16 : 10,
+			/*lba*/lba,
+			/*block_count*/count,
+			/*data_ptr*/ __DECONST(void *, zero_region),
+			/*dxfer_len*/ softc->params.secsize,
+			/*sense_len*/SSD_FULL_SIZE,
+			da_default_timeout * 1000);
+	ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+}
+
 static int
 cmd6workaround(union ccb *ccb)
 {

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:00:22 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E3607448;
 Sat, 14 Sep 2013 09:00:22 +0000 (UTC)
 (envelope-from to.my.trociny@gmail.com)
Received: from mail-ee0-x22d.google.com (mail-ee0-x22d.google.com
 [IPv6:2a00:1450:4013:c00::22d])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0F3B82A72;
 Sat, 14 Sep 2013 09:00:21 +0000 (UTC)
Received: by mail-ee0-f45.google.com with SMTP id c50so1015967eek.4
 for <multiple recipients>; Sat, 14 Sep 2013 02:00:20 -0700 (PDT)
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=j9QTl6GKcFEgkWI1wZfAJIJm0yH16HVzSh1Fl0oDF8c=;
 b=GOQ25WQp1tqFr63xHFOvJNgII7v6Pc4PQ0po9IWoSLC8cKpvFdNNMoMeTUEoVi/zI/
 W1uqESNj+3J9EwDNXja6p8t9UiBSKac0Tl4AMQYxCGVMUyV0ZUWz5QoCFliZrL9UPUKJ
 OTc1X07hIke0JvKepddalTdYUHbVLlj3LgmOlWl2EFjbxdB2q+cznEg4RGEuA2f4NOq5
 AsFA7AfZ401w+ueCXinIEcQKxoicGByA1GTdpDigS2oE8ScLYsjNMy91yBhJW5yzUt9s
 PyNX8ipIGD+43d8XGKbecnYS05YntfxAXqQx3IV+9GrFWai8Yh7fLctYXngKy1NKant2
 3ApA==
X-Received: by 10.15.45.8 with SMTP id a8mr24970015eew.1.1379149220368;
 Sat, 14 Sep 2013 02:00:20 -0700 (PDT)
Received: from localhost ([178.150.115.244])
 by mx.google.com with ESMTPSA id h52sm22265326eez.3.1969.12.31.16.00.00
 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Sat, 14 Sep 2013 02:00:19 -0700 (PDT)
Sender: Mikolaj Golub <to.my.trociny@gmail.com>
Date: Sat, 14 Sep 2013 12:00:17 +0300
From: Mikolaj Golub <trociny@FreeBSD.org>
To: John-Mark Gurney <jmg@FreeBSD.org>
Subject: Re: svn commit: r255521 - head/usr.sbin/daemon
Message-ID: <20130914090016.GA27774@gmail.com>
References: <201309131657.r8DGvSnd020061@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201309131657.r8DGvSnd020061@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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:00:23 -0000

On Fri, Sep 13, 2013 at 04:57:28PM +0000, John-Mark Gurney wrote:
> Author: jmg
> Date: Fri Sep 13 16:57:28 2013
> New Revision: 255521
> URL: http://svnweb.freebsd.org/changeset/base/255521
> 
> Log:
>   add support for writing the pid of the daemon program to a pid file so
>   that daemon can be used w/ rc.subr and ports can use the additional
>   functionality, such as keeping the ldap daemon up and running, and have
>   the proper program to signal to exit..
>   
>   PR:		bin/181341
>   Submitted by:	feld
>   Approved by:	re (glebius)

Thank you for doing this. I was aware about this issue after I had
added restart option but could not come with a solution that would
satisfy me.

Having 2 options for pid files might look a little confusing but I
think it is much better than we had before.

Still please see a couple of notes below.

> Modified: head/usr.sbin/daemon/daemon.c
> ==============================================================================
> --- head/usr.sbin/daemon/daemon.c	Fri Sep 13 14:15:52 2013	(r255520)
> +++ head/usr.sbin/daemon/daemon.c	Fri Sep 13 16:57:28 2013	(r255521)
> @@ -53,16 +53,17 @@ static void usage(void);
>  int
>  main(int argc, char *argv[])
>  {
> -	struct pidfh *pfh = NULL;
> +	struct pidfh  *ppfh, *pfh;
>  	sigset_t mask, oldmask;
>  	int ch, nochdir, noclose, restart;
> -	const char *pidfile, *user;
> +	const char *pidfile, *ppidfile,  *user;
>  	pid_t otherpid, pid;
>  
>  	nochdir = noclose = 1;
>  	restart = 0;
> -	pidfile = user = NULL;
> -	while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) {
> +	ppfh = pfh = NULL;
> +	ppidfile = pidfile = user = NULL;
> +	while ((ch = getopt(argc, argv, "cfp:P:ru:")) != -1) {
>  		switch (ch) {
>  		case 'c':
>  			nochdir = 0;
> @@ -73,6 +74,9 @@ main(int argc, char *argv[])
>  		case 'p':
>  			pidfile = optarg;
>  			break;
> +		case 'P':
> +			ppidfile = optarg;
> +			break;
>  		case 'r':
>  			restart = 1;
>  			break;
> @@ -89,7 +93,7 @@ main(int argc, char *argv[])
>  	if (argc == 0)
>  		usage();
>  
> -	pfh = NULL;
> +	ppfh = pfh = NULL;
>  	/*
>  	 * Try to open the pidfile before calling daemon(3),
>  	 * to be able to report the error intelligently
> @@ -104,6 +108,18 @@ main(int argc, char *argv[])
>  			err(2, "pidfile ``%s''", pidfile);
>  		}
>  	}
> +	
> +	/* do same for actual daemon process */
> +	if (ppidfile != NULL) {
> +		ppfh = pidfile_open(ppidfile, 0600, &otherpid);
> +		if (ppfh == NULL) {
> +			if (errno == EEXIST) {
> +				errx(3, "process already running, pid: %d",
> +				     otherpid);
> +			}
> +			err(2, "ppidfile ``%s''", ppidfile);

You have to pidfile_remove(pfh) before exiting not to leave the child
pidfile on fs. Also pidfile_remove(ppfh) if fork() fails, and there
are several other places where pidfile_remove() is missed for the
child too before err exit (me should be blamed for most of these).

> +		}
> +	}
>  
>  	if (daemon(nochdir, noclose) == -1)
>  		err(1, NULL);
> @@ -176,12 +192,17 @@ restart:
>  		 */
>  		err(1, "%s", argv[0]);
>  	}
> +	/* write out parent pidfile if needed */
> +	if (ppidfile != NULL)
> +		pidfile_write(ppfh);
> +

No need to check for ppidfile != NULL. It is safe to call
pidfile_write() (and pidfile_remove()) with NULL argument.

Also, doing pidfile_write() here will cause needlessly rewriting the
file after every child restart. I think it is better to call
pidfile_write(ppfh) once, before the restart loop, just after
daemon().

>  	setproctitle("%s[%d]", argv[0], pid);
>  	if (wait_child(pid, &mask) == 0 && restart) {
>  		sleep(1);
>  		goto restart;
>  	}
>  	pidfile_remove(pfh);
> +	pidfile_remove(ppfh);
>  	exit(0); /* Exit status does not matter. */
>  }
>  
> @@ -240,7 +261,7 @@ static void
>  usage(void)
>  {
>  	(void)fprintf(stderr,
> -	    "usage: daemon [-cfr] [-p pidfile] [-u user] command "
> -		"arguments ...\n");
> +	    "usage: daemon [-cfr] [-p child_pidfile] [-P supervisor_pidfile] "
> +	    "[-u user]\n              command arguments ...\n");
>  	exit(1);
>  }

-- 
Mikolaj Golub

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:01:43 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 7D3B1688;
 Sat, 14 Sep 2013 09:01:43 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 698A92AAC;
 Sat, 14 Sep 2013 09:01:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E91hbG091607;
 Sat, 14 Sep 2013 09:01:43 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E91gtt091603;
 Sat, 14 Sep 2013 09:01:42 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140901.r8E91gtt091603@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:01: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: r255544 - in stable/9/sys/cam: . scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:01:43 -0000

Author: mav
Date: Sat Sep 14 09:01:42 2013
New Revision: 255544
URL: http://svnweb.freebsd.org/changeset/base/255544

Log:
  MFC r253322, r253370:
  Improve handling of 0x3F/0x0E "Reported LUNs data has changed" and 0x25/0x00
  "Logical unit not supported" errors.  First initiates specific target rescan,
  second -- destroys specific LUN.  That allows to automatically detect changes
  in list of device LUNs.  This mechanism doesn't work when target is completely
  idle, but probably that is all what can be done without active polling.

Modified:
  stable/9/sys/cam/cam_periph.c
  stable/9/sys/cam/scsi/scsi_all.c
  stable/9/sys/cam/scsi/scsi_all.h
  stable/9/sys/cam/scsi/scsi_xpt.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/cam_periph.c
==============================================================================
--- stable/9/sys/cam/cam_periph.c	Sat Sep 14 08:58:28 2013	(r255543)
+++ stable/9/sys/cam/cam_periph.c	Sat Sep 14 09:01:42 2013	(r255544)
@@ -75,7 +75,7 @@ static int		camperiphscsistatuserror(uni
 						 int *openings,
 						 u_int32_t *relsim_flags,
 						 u_int32_t *timeout,
-						 int *print,
+						 u_int32_t  *action,
 						 const char **action_string);
 static	int		camperiphscsisenseerror(union ccb *ccb,
 					        union ccb **orig_ccb,
@@ -84,7 +84,7 @@ static	int		camperiphscsisenseerror(unio
 					        int *openings,
 					        u_int32_t *relsim_flags,
 					        u_int32_t *timeout,
-					        int *print,
+					        u_int32_t *action,
 					        const char **action_string);
 
 static int nperiph_drivers;
@@ -1283,7 +1283,7 @@ static int
 camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb,
     cam_flags camflags, u_int32_t sense_flags,
     int *openings, u_int32_t *relsim_flags,
-    u_int32_t *timeout, int *print, const char **action_string)
+    u_int32_t *timeout, u_int32_t *action, const char **action_string)
 {
 	int error;
 
@@ -1302,7 +1302,7 @@ camperiphscsistatuserror(union ccb *ccb,
 					        openings,
 					        relsim_flags,
 					        timeout,
-					        print,
+					        action,
 					        action_string);
 		break;
 	case SCSI_STATUS_QUEUE_FULL:
@@ -1357,7 +1357,7 @@ camperiphscsistatuserror(union ccb *ccb,
 			}
 			*timeout = 0;
 			error = ERESTART;
-			*print = 0;
+			*action &= ~SSQ_PRINT_SENSE;
 			break;
 		}
 		/* FALLTHROUGH */
@@ -1389,7 +1389,7 @@ static int
 camperiphscsisenseerror(union ccb *ccb, union ccb **orig,
     cam_flags camflags, u_int32_t sense_flags,
     int *openings, u_int32_t *relsim_flags,
-    u_int32_t *timeout, int *print, const char **action_string)
+    u_int32_t *timeout, u_int32_t *action, const char **action_string)
 {
 	struct cam_periph *periph;
 	union ccb *orig_ccb = ccb;
@@ -1412,7 +1412,7 @@ camperiphscsisenseerror(union ccb *ccb, 
 		 * imperitive that we don't violate this assumption.
 		 */
 		error = ERESTART;
-		*print = 0;
+		*action &= ~SSQ_PRINT_SENSE;
 	} else {
 		scsi_sense_action err_action;
 		struct ccb_getdev cgd;
@@ -1584,7 +1584,7 @@ camperiphscsisenseerror(union ccb *ccb, 
 		}
 
 sense_error_done:
-		*print = ((err_action & SSQ_PRINT_SENSE) != 0);
+		*action = err_action;
 	}
 	return (error);
 }
@@ -1598,32 +1598,32 @@ int
 cam_periph_error(union ccb *ccb, cam_flags camflags,
 		 u_int32_t sense_flags, union ccb *save_ccb)
 {
-	union ccb  *orig_ccb;
+	struct cam_path *newpath;
+	union ccb  *orig_ccb, *scan_ccb;
 	struct cam_periph *periph;
 	const char *action_string;
 	cam_status  status;
-	int	    frozen, error, openings, print, lost_device;
-	int	    error_code, sense_key, asc, ascq;
-	u_int32_t   relsim_flags, timeout;
+	int	    frozen, error, openings;
+	u_int32_t   action, relsim_flags, timeout;
 
-	print = 1;
+	action = SSQ_PRINT_SENSE;
 	periph = xpt_path_periph(ccb->ccb_h.path);
 	action_string = NULL;
 	status = ccb->ccb_h.status;
 	frozen = (status & CAM_DEV_QFRZN) != 0;
 	status &= CAM_STATUS_MASK;
-	openings = relsim_flags = timeout = lost_device = 0;
+	openings = relsim_flags = timeout = 0;
 	orig_ccb = ccb;
 
 	switch (status) {
 	case CAM_REQ_CMP:
 		error = 0;
-		print = 0;
+		action &= ~SSQ_PRINT_SENSE;
 		break;
 	case CAM_SCSI_STATUS_ERROR:
 		error = camperiphscsistatuserror(ccb, &orig_ccb,
 		    camflags, sense_flags, &openings, &relsim_flags,
-		    &timeout, &print, &action_string);
+		    &timeout, &action, &action_string);
 		break;
 	case CAM_AUTOSENSE_FAIL:
 		error = EIO;	/* we have to kill the command */
@@ -1654,8 +1654,7 @@ cam_periph_error(union ccb *ccb, cam_fla
 		/* FALLTHROUGH */
 	case CAM_DEV_NOT_THERE:
 		error = ENXIO;
-		print = 0;
-		lost_device = 1;
+		action = SSQ_LOST;
 		break;
 	case CAM_REQ_INVALID:
 	case CAM_PATH_INVALID:
@@ -1686,7 +1685,7 @@ cam_periph_error(union ccb *ccb, cam_fla
 			action_string = "Retry was blocked";
 		} else {
 			error = ERESTART;
-			print = 0;
+			action &= ~SSQ_PRINT_SENSE;
 		}
 		break;
 	case CAM_RESRC_UNAVAIL:
@@ -1725,12 +1724,12 @@ cam_periph_error(union ccb *ccb, cam_fla
 
 	if ((sense_flags & SF_PRINT_ALWAYS) ||
 	    CAM_DEBUGGED(ccb->ccb_h.path, CAM_DEBUG_INFO))
-		print = 1;
+		action |= SSQ_PRINT_SENSE;
 	else if (sense_flags & SF_NO_PRINT)
-		print = 0;
-	if (print)
+		action &= ~SSQ_PRINT_SENSE;
+	if ((action & SSQ_PRINT_SENSE) != 0)
 		cam_error_print(orig_ccb, CAM_ESF_ALL, CAM_EPF_ALL);
-	if (error != 0 && print) {
+	if (error != 0 && (action & SSQ_PRINT_SENSE) != 0) {
 		if (error != ERESTART) {
 			if (action_string == NULL)
 				action_string = "Unretryable error";
@@ -1742,8 +1741,7 @@ cam_periph_error(union ccb *ccb, cam_fla
 			xpt_print(ccb->ccb_h.path, "Retrying command\n");
 	}
 
-	if (lost_device) {
-		struct cam_path *newpath;
+	if ((action & SSQ_LOST) != 0) {
 		lun_id_t lun_id;
 
 		/*
@@ -1752,10 +1750,10 @@ cam_periph_error(union ccb *ccb, cam_fla
 		 * then we only get rid of the device(s) specified by the
 		 * path in the original CCB.
 		 */
-		if (status == CAM_DEV_NOT_THERE)
-			lun_id = xpt_path_lun_id(ccb->ccb_h.path);
-		else
+		if (status == CAM_SEL_TIMEOUT)
 			lun_id = CAM_LUN_WILDCARD;
+		else
+			lun_id = xpt_path_lun_id(ccb->ccb_h.path);
 
 		/* Should we do more if we can't create the path?? */
 		if (xpt_create_path(&newpath, periph,
@@ -1770,12 +1768,29 @@ cam_periph_error(union ccb *ccb, cam_fla
 			xpt_async(AC_LOST_DEVICE, newpath, NULL);
 			xpt_free_path(newpath);
 		}
+	}
 
 	/* Broadcast UNIT ATTENTIONs to all periphs. */
-	} else if (scsi_extract_sense_ccb(ccb,
-	    &error_code, &sense_key, &asc, &ascq) &&
-	    sense_key == SSD_KEY_UNIT_ATTENTION) {
+	if ((action & SSQ_UA) != 0)
 		xpt_async(AC_UNIT_ATTENTION, orig_ccb->ccb_h.path, orig_ccb);
+
+	/* Rescan target on "Reported LUNs data has changed" */
+	if ((action & SSQ_RESCAN) != 0) {
+		if (xpt_create_path(&newpath, NULL,
+				    xpt_path_path_id(ccb->ccb_h.path),
+				    xpt_path_target_id(ccb->ccb_h.path),
+				    CAM_LUN_WILDCARD) == CAM_REQ_CMP) {
+
+			scan_ccb = xpt_alloc_ccb_nowait();
+			if (scan_ccb != NULL) {
+				scan_ccb->ccb_h.path = newpath;
+				scan_ccb->ccb_h.func_code = XPT_SCAN_TGT;
+				scan_ccb->crcn.flags = 0;
+				xpt_rescan(scan_ccb);
+			} else
+				xpt_print(newpath,
+				    "Can't allocate CCB to rescan target\n");
+		}
 	}
 
 	/* Attempt a retry */

Modified: stable/9/sys/cam/scsi/scsi_all.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_all.c	Sat Sep 14 08:58:28 2013	(r255543)
+++ stable/9/sys/cam/scsi/scsi_all.c	Sat Sep 14 09:01:42 2013	(r255544)
@@ -1645,7 +1645,7 @@ static struct asc_table_entry asc_table[
 	{ SST(0x24, 0x08, SS_RDEF,	/* XXX TBD */
 	    "Invalid XCDB") },
 	/* DTLPWROMAEBKVF */
-	{ SST(0x25, 0x00, SS_FATAL | ENXIO,
+	{ SST(0x25, 0x00, SS_FATAL | ENXIO | SSQ_LOST,
 	    "Logical unit not supported") },
 	/* DTLPWROMAEBKVF */
 	{ SST(0x26, 0x00, SS_FATAL | EINVAL,
@@ -2163,7 +2163,7 @@ static struct asc_table_entry asc_table[
 	{ SST(0x3F, 0x0D, SS_RDEF,
 	    "Volume set reassigned") },
 	/* DTLPWROMAE     */
-	{ SST(0x3F, 0x0E, SS_RDEF,	/* XXX TBD */
+	{ SST(0x3F, 0x0E, SS_RDEF | SSQ_RESCAN ,
 	    "Reported LUNs data has changed") },
 	/* DTLPWROMAEBKVF */
 	{ SST(0x3F, 0x0F, SS_RDEF,	/* XXX TBD */
@@ -3263,6 +3263,7 @@ scsi_error_action(struct ccb_scsiio *csi
 				action |= SS_RETRY|SSQ_DECREMENT_COUNT|
 					  SSQ_PRINT_SENSE;
 			}
+			action |= SSQ_UA;
 		}
 	}
 	if ((action & SS_MASK) >= SS_START &&

Modified: stable/9/sys/cam/scsi/scsi_all.h
==============================================================================
--- stable/9/sys/cam/scsi/scsi_all.h	Sat Sep 14 08:58:28 2013	(r255543)
+++ stable/9/sys/cam/scsi/scsi_all.h	Sat Sep 14 09:01:42 2013	(r255544)
@@ -88,6 +88,9 @@ typedef enum {
 					    * and text.
 					    */
 	SSQ_PRINT_SENSE		= 0x0800,
+	SSQ_UA			= 0x1000,  /* Broadcast UA. */
+	SSQ_RESCAN		= 0x2000,  /* Rescan target for LUNs. */
+	SSQ_LOST		= 0x4000,  /* Destroy the LUNs. */
 	SSQ_MASK		= 0xff00
 } scsi_sense_action_qualifier;
 

Modified: stable/9/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_xpt.c	Sat Sep 14 08:58:28 2013	(r255543)
+++ stable/9/sys/cam/scsi/scsi_xpt.c	Sat Sep 14 09:01:42 2013	(r255544)
@@ -1877,8 +1877,8 @@ scsi_scan_bus(struct cam_periph *periph,
 		if ((work_ccb->cpi.hba_inquiry &
 		    (PI_WIDE_32|PI_WIDE_16|PI_SDTR_ABLE)) &&
 		    !(work_ccb->cpi.hba_misc & PIM_NOBUSRESET) &&
-		    !timevalisset(&request_ccb->ccb_h.path->bus->last_reset)) {
-			reset_ccb = xpt_alloc_ccb_nowait();
+		    !timevalisset(&request_ccb->ccb_h.path->bus->last_reset) &&
+		    (reset_ccb = xpt_alloc_ccb_nowait()) != NULL) {
 			xpt_setup_ccb(&reset_ccb->ccb_h, request_ccb->ccb_h.path,
 			      CAM_PRIORITY_NONE);
 			reset_ccb->ccb_h.func_code = XPT_RESET_BUS;

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:03:21 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id BE5A47C2;
 Sat, 14 Sep 2013 09:03:21 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A9F1A2AB4;
 Sat, 14 Sep 2013 09:03:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E93Lg6092122;
 Sat, 14 Sep 2013 09:03:21 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E93Lcr092121;
 Sat, 14 Sep 2013 09:03:21 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140903.r8E93Lcr092121@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:03: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: r255545 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:03:21 -0000

Author: mav
Date: Sat Sep 14 09:03:21 2013
New Revision: 255545
URL: http://svnweb.freebsd.org/changeset/base/255545

Log:
  MFC r253323:
  When printing opcode description, map T_NODEVICE to Direct Access Device to
  handle REPORT LUNS, etc.

Modified:
  stable/9/sys/cam/scsi/scsi_all.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_all.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_all.c	Sat Sep 14 09:01:42 2013	(r255544)
+++ stable/9/sys/cam/scsi/scsi_all.c	Sat Sep 14 09:03:21 2013	(r255545)
@@ -665,6 +665,10 @@ scsi_op_desc(u_int16_t opcode, struct sc
 	if (pd_type == T_RBC)
 		pd_type = T_DIRECT;
 
+	/* Map NODEVICE to Direct Access Device to handle REPORT LUNS, etc. */
+	if (pd_type == T_NODEVICE)
+		pd_type = T_DIRECT;
+
 	opmask = 1 << pd_type;
 
 	for (j = 0; j < num_tables; j++) {

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:05:04 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1A0F99E1;
 Sat, 14 Sep 2013 09:05:04 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 074CC2AC4;
 Sat, 14 Sep 2013 09:05:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E95361092622;
 Sat, 14 Sep 2013 09:05:03 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E953vv092621;
 Sat, 14 Sep 2013 09:05:03 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140905.r8E953vv092621@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:05:03 +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: r255546 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:05:04 -0000

Author: mav
Date: Sat Sep 14 09:05:03 2013
New Revision: 255546
URL: http://svnweb.freebsd.org/changeset/base/255546

Log:
  MFC r253721, r253722:
  Detect unsupported PREVENT ALLOW MEDIUM REMOVAL and SYNCHRONIZE CACHE(10)
  to not spam devices with useless commands and logs with errors.

Modified:
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:03:21 2013	(r255545)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:05:03 2013	(r255546)
@@ -2797,6 +2797,28 @@ cmd6workaround(union ccb *ccb)
 		return (0);
 	}
 
+	/* Detect unsupported PREVENT ALLOW MEDIUM REMOVAL. */
+	if ((ccb->ccb_h.flags & CAM_CDB_POINTER) == 0 &&
+	    (*cdb == PREVENT_ALLOW) &&
+	    (softc->quirks & DA_Q_NO_PREVENT) == 0) {
+		if (bootverbose)
+			xpt_print(ccb->ccb_h.path,
+			    "PREVENT ALLOW MEDIUM REMOVAL not supported.\n");
+		softc->quirks |= DA_Q_NO_PREVENT;
+		return (0);
+	}
+
+	/* Detect unsupported SYNCHRONIZE CACHE(10). */
+	if ((ccb->ccb_h.flags & CAM_CDB_POINTER) == 0 &&
+	    (*cdb == SYNCHRONIZE_CACHE) &&
+	    (softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) {
+		if (bootverbose)
+			xpt_print(ccb->ccb_h.path,
+			    "SYNCHRONIZE CACHE(10) not supported.\n");
+		softc->quirks |= DA_Q_NO_SYNC_CACHE;
+		return (0);
+	}
+
 	/* Translation only possible if CDB is an array and cmd is R/W6 */
 	if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0 ||
 	    (*cdb != READ_6 && *cdb != WRITE_6))

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:06:32 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E35FDB21;
 Sat, 14 Sep 2013 09:06:32 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id D01552AD2;
 Sat, 14 Sep 2013 09:06:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E96Wrk093159;
 Sat, 14 Sep 2013 09:06:32 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E96W7s093157;
 Sat, 14 Sep 2013 09:06:32 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140906.r8E96W7s093157@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:06:32 +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: r255547 - in stable/9/sys/cam: ata scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:06:33 -0000

Author: mav
Date: Sat Sep 14 09:06:32 2013
New Revision: 255547
URL: http://svnweb.freebsd.org/changeset/base/255547

Log:
  MFC r253724:
  Synchronize device cache on close only if there were some write operations.
  While these operations are not really needed otherwise, at least for SCSI
  they may cause extra errors if some other initiator holds write exclusive
  reservation on the LUN (SYNCHRONIZE CACHE handled as "write" operation).

Modified:
  stable/9/sys/cam/ata/ata_da.c
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/ata/ata_da.c
==============================================================================
--- stable/9/sys/cam/ata/ata_da.c	Sat Sep 14 09:05:03 2013	(r255546)
+++ stable/9/sys/cam/ata/ata_da.c	Sat Sep 14 09:06:32 2013	(r255547)
@@ -88,7 +88,8 @@ typedef enum {
 	ADA_FLAG_SCTX_INIT	= 0x0200,
 	ADA_FLAG_CAN_CFA        = 0x0400,
 	ADA_FLAG_CAN_POWERMGT   = 0x0800,
-	ADA_FLAG_CAN_DMA48	= 0x1000
+	ADA_FLAG_CAN_DMA48	= 0x1000,
+	ADA_FLAG_DIRTY		= 0x2000
 } ada_flags;
 
 typedef enum {
@@ -613,6 +614,7 @@ adaclose(struct disk *dp)
 	struct	cam_periph *periph;
 	struct	ada_softc *softc;
 	union ccb *ccb;
+	int error;
 
 	periph = (struct cam_periph *)dp->d_drv1;
 	cam_periph_lock(periph);
@@ -628,7 +630,8 @@ adaclose(struct disk *dp)
 	    ("adaclose\n"));
 
 	/* We only sync the cache if the drive is capable of it. */
-	if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 &&
+	if ((softc->flags & ADA_FLAG_DIRTY) != 0 &&
+	    (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 &&
 	    (softc->flags & ADA_FLAG_PACK_INVALID) == 0) {
 
 		ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
@@ -645,11 +648,13 @@ adaclose(struct disk *dp)
 			ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0);
 		else
 			ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0);
-		cam_periph_runccb(ccb, adaerror, /*cam_flags*/0,
+		error = cam_periph_runccb(ccb, adaerror, /*cam_flags*/0,
 		    /*sense_flags*/0, softc->disk->d_devstat);
 
-		if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
+		if (error != 0)
 			xpt_print(periph->path, "Synchronize cache failed\n");
+		else
+			softc->flags &= ~ADA_FLAG_DIRTY;
 		xpt_release_ccb(ccb);
 	}
 
@@ -1498,8 +1503,10 @@ adastart(struct cam_periph *periph, unio
 			tag_code = 1;
 		}
 		switch (bp->bio_cmd) {
-		case BIO_READ:
 		case BIO_WRITE:
+			softc->flags |= ADA_FLAG_DIRTY;
+			/* FALLTHROUGH */
+		case BIO_READ:
 		{
 			uint64_t lba = bp->bio_pblkno;
 			uint16_t count = bp->bio_bcount / softc->params.secsize;

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:05:03 2013	(r255546)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:06:32 2013	(r255547)
@@ -90,7 +90,8 @@ typedef enum {
 	DA_FLAG_OPEN		= 0x100,
 	DA_FLAG_SCTX_INIT	= 0x200,
 	DA_FLAG_CAN_RC16	= 0x400,
-	DA_FLAG_PROBED		= 0x800		
+	DA_FLAG_PROBED		= 0x800,
+	DA_FLAG_DIRTY		= 0x1000
 } da_flags;
 
 typedef enum {
@@ -1249,6 +1250,7 @@ daclose(struct disk *dp)
 {
 	struct	cam_periph *periph;
 	struct	da_softc *softc;
+	int error;
 
 	periph = (struct cam_periph *)dp->d_drv1;
 	cam_periph_lock(periph);
@@ -1263,8 +1265,9 @@ daclose(struct disk *dp)
 	CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH,
 	    ("daclose\n"));
 
-	if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0
-	 && (softc->flags & DA_FLAG_PACK_INVALID) == 0) {
+	if ((softc->flags & DA_FLAG_DIRTY) != 0 &&
+	    (softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 &&
+	    (softc->flags & DA_FLAG_PACK_INVALID) == 0) {
 		union	ccb *ccb;
 
 		ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
@@ -1278,9 +1281,11 @@ daclose(struct disk *dp)
 				       SSD_FULL_SIZE,
 				       5 * 60 * 1000);
 
-		cam_periph_runccb(ccb, daerror, /*cam_flags*/0,
+		error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0,
 				  /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR,
 				  softc->disk->d_devstat);
+		if (error == 0)
+			softc->flags &= ~DA_FLAG_DIRTY;
 		xpt_release_ccb(ccb);
 
 	}
@@ -2252,8 +2257,10 @@ skipstate:
 		}
 
 		switch (bp->bio_cmd) {
-		case BIO_READ:
 		case BIO_WRITE:
+			softc->flags |= DA_FLAG_DIRTY;
+			/* FALLTHROUGH */
+		case BIO_READ:
 			scsi_read_write(&start_ccb->csio,
 					/*retries*/da_retry_count,
 					/*cbfcnp*/dadone,

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:10:01 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 9DBD8C8E;
 Sat, 14 Sep 2013 09:10:01 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8B0632AF3;
 Sat, 14 Sep 2013 09:10:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9A14k094661;
 Sat, 14 Sep 2013 09:10:01 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9A1Ve094660;
 Sat, 14 Sep 2013 09:10:01 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140910.r8E9A1Ve094660@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:10: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: r255548 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:10:01 -0000

Author: mav
Date: Sat Sep 14 09:10:01 2013
New Revision: 255548
URL: http://svnweb.freebsd.org/changeset/base/255548

Log:
  MFC r253803:
  Add NO_RC16 quirk to make da driver avoid using READ CAPACITY(16) command
  if possible.  Use it for Kingston JetFlash USB sticks, that are known to
  return garbage in response to that command.

Modified:
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:06:32 2013	(r255547)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:10:01 2013	(r255548)
@@ -99,7 +99,8 @@ typedef enum {
 	DA_Q_NO_SYNC_CACHE	= 0x01,
 	DA_Q_NO_6_BYTE		= 0x02,
 	DA_Q_NO_PREVENT		= 0x04,
-	DA_Q_4K			= 0x08
+	DA_Q_4K			= 0x08,
+	DA_Q_NO_RC16		= 0x10
 } da_quirks;
 
 #define DA_Q_BIT_STRING		\
@@ -107,7 +108,8 @@ typedef enum {
 	"\001NO_SYNC_CACHE"	\
 	"\002NO_6_BYTE"		\
 	"\003NO_PREVENT"	\
-	"\0044K"
+	"\0044K"		\
+	"\005NO_RC16"
 
 typedef enum {
 	DA_CCB_PROBE_RC		= 0x01,
@@ -681,6 +683,11 @@ static struct da_quirk_entry da_quirk_ta
 		{T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston", "DataTraveler G3",
 		 "1.00"}, /*quirks*/ DA_Q_NO_PREVENT
 	},
+	{
+		/* At least several Transcent USB sticks lie on RC16. */
+		{T_DIRECT, SIP_MEDIA_REMOVABLE, "JetFlash", "Transcend*",
+		 "*"}, /*quirks*/ DA_Q_NO_RC16
+	},
 	/* ATA/SATA devices over SAS/USB/... */
 	{
 		/* Hitachi Advanced Format (4k) drives */
@@ -2087,7 +2094,8 @@ daregister(struct cam_periph *periph, vo
 		softc->minimum_cmd_size = 16;
 
 	/* Predict whether device may support READ CAPACITY(16). */
-	if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3) {
+	if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 &&
+	    (softc->quirks & DA_Q_NO_RC16) == 0) {
 		softc->flags |= DA_FLAG_CAN_RC16;
 		softc->state = DA_STATE_PROBE_RC16;
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:11:31 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C25B4DD4;
 Sat, 14 Sep 2013 09:11:31 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id AF37B2B21;
 Sat, 14 Sep 2013 09:11:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9BVmN097545;
 Sat, 14 Sep 2013 09:11:31 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9BV8Y097544;
 Sat, 14 Sep 2013 09:11:31 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140911.r8E9BV8Y097544@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:11:31 +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: r255549 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:11:31 -0000

Author: mav
Date: Sat Sep 14 09:11:31 2013
New Revision: 255549
URL: http://svnweb.freebsd.org/changeset/base/255549

Log:
  MFC r254052:
  Improve r253721 by reporting detected lack of BIO_FLUSH support to GEOM.
  That prevents more of such requests from coming and errors from logging.

Modified:
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:10:01 2013	(r255548)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:11:31 2013	(r255549)
@@ -2831,6 +2831,7 @@ cmd6workaround(union ccb *ccb)
 			xpt_print(ccb->ccb_h.path,
 			    "SYNCHRONIZE CACHE(10) not supported.\n");
 		softc->quirks |= DA_Q_NO_SYNC_CACHE;
+		softc->disk->d_flags &= ~DISKFLAG_CANFLUSHCACHE;
 		return (0);
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:19:28 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 8A345F61;
 Sat, 14 Sep 2013 09:19:28 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 771D82B54;
 Sat, 14 Sep 2013 09:19:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9JSG9000243;
 Sat, 14 Sep 2013 09:19:28 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9JSOQ000242;
 Sat, 14 Sep 2013 09:19:28 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140919.r8E9JSOQ000242@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:19:28 +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: r255550 - stable/9/sys/cam
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:19:28 -0000

Author: mav
Date: Sat Sep 14 09:19:27 2013
New Revision: 255550
URL: http://svnweb.freebsd.org/changeset/base/255550

Log:
  MFC r249008 (by trasz):
  Fix panic in the error path caused by recursive acquisition of XPT topology
  lock.

Modified:
  stable/9/sys/cam/cam_periph.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/cam_periph.c
==============================================================================
--- stable/9/sys/cam/cam_periph.c	Sat Sep 14 09:11:31 2013	(r255549)
+++ stable/9/sys/cam/cam_periph.c	Sat Sep 14 09:19:27 2013	(r255550)
@@ -218,9 +218,9 @@ cam_periph_alloc(periph_ctor_t *periph_c
 	}
 	if (*p_drv == NULL) {
 		printf("cam_periph_alloc: invalid periph name '%s'\n", name);
+		xpt_unlock_buses();
 		xpt_free_path(periph->path);
 		free(periph, M_CAMPERIPH);
-		xpt_unlock_buses();
 		return (CAM_REQ_INVALID);
 	}
 	periph->unit_number = camperiphunit(*p_drv, path_id, target_id, lun_id);

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:24:41 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 785BA17D;
 Sat, 14 Sep 2013 09:24:41 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 641F22B9C;
 Sat, 14 Sep 2013 09:24:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9OfW1004629;
 Sat, 14 Sep 2013 09:24:41 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9OfQ3004628;
 Sat, 14 Sep 2013 09:24:41 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140924.r8E9OfQ3004628@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:24: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: r255551 - stable/9/sys/cam/ctl
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:24:41 -0000

Author: mav
Date: Sat Sep 14 09:24:40 2013
New Revision: 255551
URL: http://svnweb.freebsd.org/changeset/base/255551

Log:
  MFC r249194 (by trasz):
  Make SYNCHRONIZE CACHE work with LUNs backed by device files (as opposed
  to regular files, which already worked fine).  With this change, it's no
  longer neccessary to use "ctladm realsync off" workaround.

Modified:
  stable/9/sys/cam/ctl/ctl_backend_block.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- stable/9/sys/cam/ctl/ctl_backend_block.c	Sat Sep 14 09:19:27 2013	(r255550)
+++ stable/9/sys/cam/ctl/ctl_backend_block.c	Sat Sep 14 09:24:40 2013	(r255551)
@@ -956,6 +956,7 @@ ctl_be_block_cw_dispatch(struct ctl_be_b
 	switch (io->scsiio.cdb[0]) {
 	case SYNCHRONIZE_CACHE:
 	case SYNCHRONIZE_CACHE_16:
+		beio->bio_cmd = BIO_FLUSH;
 		beio->ds_trans_type = DEVSTAT_NO_DATA;
 		beio->ds_tag_type = DEVSTAT_TAG_ORDERED;
 		beio->io_len = 0;

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:34:26 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id B2FB5403;
 Sat, 14 Sep 2013 09:34:26 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 912702C05;
 Sat, 14 Sep 2013 09:34:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9YQVd010206;
 Sat, 14 Sep 2013 09:34:26 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9YQPA010204;
 Sat, 14 Sep 2013 09:34:26 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140934.r8E9YQPA010204@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:34:26 +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: r255552 - in stable/9/sys/cam: ata scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:34:26 -0000

Author: mav
Date: Sat Sep 14 09:34:25 2013
New Revision: 255552
URL: http://svnweb.freebsd.org/changeset/base/255552

Log:
  MFC r249981:
  Remove ADA_FLAG_PACK_INVALID flag. Since ATA disks have no concept of media
  change it only duplicates CAM_PERIPH_INVALID flag, so we can use last one.
  
  Slightly cleanup DA_FLAG_PACK_INVALID use.

Modified:
  stable/9/sys/cam/ata/ata_da.c
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/ata/ata_da.c
==============================================================================
--- stable/9/sys/cam/ata/ata_da.c	Sat Sep 14 09:24:40 2013	(r255551)
+++ stable/9/sys/cam/ata/ata_da.c	Sat Sep 14 09:34:25 2013	(r255552)
@@ -76,7 +76,6 @@ typedef enum {
 } ada_state;
 
 typedef enum {
-	ADA_FLAG_PACK_INVALID	= 0x0001,
 	ADA_FLAG_CAN_48BIT	= 0x0002,
 	ADA_FLAG_CAN_FLUSHCACHE	= 0x0004,
 	ADA_FLAG_CAN_NCQ	= 0x0008,
@@ -592,16 +591,11 @@ adaopen(struct disk *dp)
 		return (error);
 	}
 
-	softc = (struct ada_softc *)periph->softc;
-	softc->flags |= ADA_FLAG_OPEN;
-
 	CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH,
 	    ("adaopen\n"));
 
-	if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) {
-		/* Invalidate our pack information. */
-		softc->flags &= ~ADA_FLAG_PACK_INVALID;
-	}
+	softc = (struct ada_softc *)periph->softc;
+	softc->flags |= ADA_FLAG_OPEN;
 
 	cam_periph_unhold(periph);
 	cam_periph_unlock(periph);
@@ -632,7 +626,7 @@ adaclose(struct disk *dp)
 	/* We only sync the cache if the drive is capable of it. */
 	if ((softc->flags & ADA_FLAG_DIRTY) != 0 &&
 	    (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 &&
-	    (softc->flags & ADA_FLAG_PACK_INVALID) == 0) {
+	    (periph->flags & CAM_PERIPH_INVALID) == 0) {
 
 		ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 		cam_fill_ataio(&ccb->ataio,
@@ -709,7 +703,7 @@ adastrategy(struct bio *bp)
 	/*
 	 * If the device has been made invalid, error out
 	 */
-	if ((softc->flags & ADA_FLAG_PACK_INVALID)) {
+	if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
 		cam_periph_unlock(periph);
 		biofinish(bp, NULL, ENXIO);
 		return;
@@ -760,7 +754,7 @@ adadump(void *arg, void *virtual, vm_off
 	lba = offset / secsize;
 	count = length / secsize;
 	
-	if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) {
+	if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
 		cam_periph_unlock(periph);
 		return (ENXIO);
 	}
@@ -885,8 +879,6 @@ adaoninvalidate(struct cam_periph *perip
 	 */
 	xpt_register_async(0, adaasync, periph, periph->path);
 
-	softc->flags |= ADA_FLAG_PACK_INVALID;
-
 	/*
 	 * Return all queued I/O with ENXIO.
 	 * XXX Handle any transactions queued to the card
@@ -1050,7 +1042,7 @@ adasysctlinit(void *context, int pending
 	periph = (struct cam_periph *)context;
 
 	/* periph was held for us when this task was enqueued */
-	if (periph->flags & CAM_PERIPH_INVALID) {
+	if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
 		cam_periph_release(periph);
 		return;
 	}
@@ -1664,7 +1656,7 @@ out:
 	case ADA_STATE_RAHEAD:
 	case ADA_STATE_WCACHE:
 	{
-		if (softc->flags & ADA_FLAG_PACK_INVALID) {
+		if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
 			softc->state = ADA_STATE_NORMAL;
 			xpt_release_ccb(start_ccb);
 			cam_release_devq(periph->path,
@@ -1726,20 +1718,6 @@ adadone(struct cam_periph *periph, union
 				return;
 			}
 			if (error != 0) {
-				if (error == ENXIO &&
-				    (softc->flags & ADA_FLAG_PACK_INVALID) == 0) {
-					/*
-					 * Catastrophic error.  Mark our pack as
-					 * invalid.
-					 */
-					/*
-					 * XXX See if this is really a media
-					 * XXX change first?
-					 */
-					xpt_print(periph->path,
-					    "Invalidating pack\n");
-					softc->flags |= ADA_FLAG_PACK_INVALID;
-				}
 				bp->bio_error = error;
 				bp->bio_resid = bp->bio_bcount;
 				bp->bio_flags |= BIO_ERROR;

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:24:40 2013	(r255551)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:34:25 2013	(r255552)
@@ -1194,7 +1194,6 @@ daopen(struct disk *dp)
 {
 	struct cam_periph *periph;
 	struct da_softc *softc;
-	int unit;
 	int error;
 
 	periph = (struct cam_periph *)dp->d_drv1;
@@ -1209,17 +1208,12 @@ daopen(struct disk *dp)
 		return (error);
 	}
 
-	unit = periph->unit_number;
-	softc = (struct da_softc *)periph->softc;
-	softc->flags |= DA_FLAG_OPEN;
-
 	CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH,
 	    ("daopen\n"));
 
-	if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) {
-		/* Invalidate our pack information. */
-		softc->flags &= ~DA_FLAG_PACK_INVALID;
-	}
+	softc = (struct da_softc *)periph->softc;
+	softc->flags |= DA_FLAG_OPEN;
+	softc->flags &= ~DA_FLAG_PACK_INVALID;
 
 	dareprobe(periph);
 
@@ -2976,11 +2970,6 @@ dadone(struct cam_periph *periph, union 
 		if (softc->outstanding_cmds == 0)
 			softc->flags |= DA_FLAG_WENT_IDLE;
 
-		if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) {
-			xpt_print(periph->path, "oustanding %d\n",
-				  softc->outstanding_cmds);
-		}
-
 		if (state == DA_CCB_DELETE) {
 			while ((bp1 = bioq_takefirst(&softc->delete_run_queue))
 			    != NULL) {

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:37:22 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id E6DEF55E;
 Sat, 14 Sep 2013 09:37:21 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id D45F92C1B;
 Sat, 14 Sep 2013 09:37:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9bLkU010887;
 Sat, 14 Sep 2013 09:37:21 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9bLGQ010886;
 Sat, 14 Sep 2013 09:37:21 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140937.r8E9bLGQ010886@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:37: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: r255553 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:37:22 -0000

Author: mav
Date: Sat Sep 14 09:37:21 2013
New Revision: 255553
URL: http://svnweb.freebsd.org/changeset/base/255553

Log:
  MFC r250208:
  Tune support for removable media in da driver:
   - remove DA_FLAG_SAW_MEDIA flag, almost opposite to DA_FLAG_PACK_INVALID,
  using the last instead.
   - allow opening device with no media present, reporting zero media size
  and non-zero sector size, as geom/notes suggests.  That allow to read
  device attributes and potentially do other things, not related to media.

Modified:
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:34:25 2013	(r255552)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:37:21 2013	(r255553)
@@ -83,7 +83,6 @@ typedef enum {
 	DA_FLAG_NEW_PACK	= 0x002,
 	DA_FLAG_PACK_LOCKED	= 0x004,
 	DA_FLAG_PACK_REMOVABLE	= 0x008,
-	DA_FLAG_SAW_MEDIA	= 0x010,
 	DA_FLAG_NEED_OTAG	= 0x020,
 	DA_FLAG_WENT_IDLE	= 0x040,
 	DA_FLAG_RETRY_UA	= 0x080,
@@ -1212,9 +1211,6 @@ daopen(struct disk *dp)
 	    ("daopen\n"));
 
 	softc = (struct da_softc *)periph->softc;
-	softc->flags |= DA_FLAG_OPEN;
-	softc->flags &= ~DA_FLAG_PACK_INVALID;
-
 	dareprobe(periph);
 
 	/* Wait for the disk size update.  */
@@ -1223,25 +1219,23 @@ daopen(struct disk *dp)
 	if (error != 0)
 		xpt_print(periph->path, "unable to retrieve capacity data");
 
-	if (periph->flags & CAM_PERIPH_INVALID ||
-	    softc->disk->d_sectorsize == 0 ||
-	    softc->disk->d_mediasize == 0)
+	if (periph->flags & CAM_PERIPH_INVALID)
 		error = ENXIO;
 
 	if (error == 0 && (softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 &&
 	    (softc->quirks & DA_Q_NO_PREVENT) == 0)
 		daprevent(periph, PR_PREVENT);
 
-	if (error == 0)
-		softc->flags |= DA_FLAG_SAW_MEDIA;
+	if (error == 0) {
+		softc->flags &= ~DA_FLAG_PACK_INVALID;
+		softc->flags |= DA_FLAG_OPEN;
+	}
 
 	cam_periph_unhold(periph);
 	cam_periph_unlock(periph);
 
-	if (error != 0) {
-		softc->flags &= ~DA_FLAG_OPEN;
+	if (error != 0)
 		cam_periph_release(periph);
-	}
 
 	return (error);
 }
@@ -3045,9 +3039,10 @@ dadone(struct cam_periph *periph, union 
 			 * here.
 			 */
 			if (block_size == 0 && maxsector == 0) {
-				snprintf(announce_buf, sizeof(announce_buf),
-				        "0MB (no media?)");
-			} else if (block_size >= MAXPHYS || block_size == 0) {
+				block_size = 512;
+				maxsector = -1;
+			}
+			if (block_size >= MAXPHYS || block_size == 0) {
 				xpt_print(periph->path,
 				    "unsupportable block size %ju\n",
 				    (uintmax_t) block_size);
@@ -3147,6 +3142,7 @@ dadone(struct cam_periph *periph, union 
 					const char *sense_key_desc;
 					const char *asc_desc;
 
+					dasetgeom(periph, 512, -1, NULL, 0);
 					scsi_sense_desc(sense_key, asc, ascq,
 							&cgd.inq_data,
 							&sense_key_desc,
@@ -3525,8 +3521,8 @@ daerror(union ccb *ccb, u_int32_t cam_fl
 		    asc == 0x28 && ascq == 0x00)
 			disk_media_changed(softc->disk, M_NOWAIT);
 		else if (sense_key == SSD_KEY_NOT_READY &&
-		    asc == 0x3a && (softc->flags & DA_FLAG_SAW_MEDIA)) {
-			softc->flags &= ~DA_FLAG_SAW_MEDIA;
+		    asc == 0x3a && (softc->flags & DA_FLAG_PACK_INVALID) == 0) {
+			softc->flags |= DA_FLAG_PACK_INVALID;
 			disk_media_gone(softc->disk, M_NOWAIT);
 		}
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:40:24 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id DE48C6AD;
 Sat, 14 Sep 2013 09:40:24 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CBB712C35;
 Sat, 14 Sep 2013 09:40:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9eOt2011701;
 Sat, 14 Sep 2013 09:40:24 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9eO7N011699;
 Sat, 14 Sep 2013 09:40:24 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140940.r8E9eO7N011699@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:40:24 +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: r255554 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:40:25 -0000

Author: mav
Date: Sat Sep 14 09:40:24 2013
New Revision: 255554
URL: http://svnweb.freebsd.org/changeset/base/255554

Log:
  MFC r250557:
  Suppress error printing for "PREVENT ALLOW MEDIUM REMOVAL" on da open.
  Change at r250208 exposed more errors here, hidden before.  The same flag
  is used in cd driver.

Modified:
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:37:21 2013	(r255553)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:40:24 2013	(r255554)
@@ -3583,7 +3583,7 @@ daprevent(struct cam_periph *periph, int
 		     5000);
 
 	error = cam_periph_runccb(ccb, daerror, CAM_RETRY_SELTO,
-	    SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat);
+	    SF_RETRY_UA | SF_NO_PRINT, softc->disk->d_devstat);
 
 	if (error == 0) {
 		if (action == PR_ALLOW)

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:42:02 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A9DE9991;
 Sat, 14 Sep 2013 09:42:02 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 87EB02C63;
 Sat, 14 Sep 2013 09:42:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9g2WQ014390;
 Sat, 14 Sep 2013 09:42:02 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9g2Sb014388;
 Sat, 14 Sep 2013 09:42:02 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140942.r8E9g2Sb014388@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:42:02 +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: r255555 - in stable/9/sys/cam: ata scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:42:02 -0000

Author: mav
Date: Sat Sep 14 09:42:01 2013
New Revision: 255555
URL: http://svnweb.freebsd.org/changeset/base/255555

Log:
  MFC r253752:
  Fix returning incorrect bio_resid value with failed BIO_DELETE requests.
  Neither residual length reported for ATA/SCSI command nor one from another
  BIO_DELETE request are in any way related to the value to be returned.

Modified:
  stable/9/sys/cam/ata/ata_da.c
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/ata/ata_da.c
==============================================================================
--- stable/9/sys/cam/ata/ata_da.c	Sat Sep 14 09:40:24 2013	(r255554)
+++ stable/9/sys/cam/ata/ata_da.c	Sat Sep 14 09:42:01 2013	(r255555)
@@ -1696,37 +1696,27 @@ adadone(struct cam_periph *periph, union
 	struct ada_softc *softc;
 	struct ccb_ataio *ataio;
 	struct ccb_getdev *cgd;
+	int state;
 
 	softc = (struct ada_softc *)periph->softc;
 	ataio = &done_ccb->ataio;
 
 	CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n"));
 
-	switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) {
+	state = ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK;
+	switch (state) {
 	case ADA_CCB_BUFFER_IO:
 	case ADA_CCB_TRIM:
 	{
 		struct bio *bp;
+		int error;
 
-		bp = (struct bio *)done_ccb->ccb_h.ccb_bp;
 		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
-			int error;
-			
 			error = adaerror(done_ccb, 0, 0);
 			if (error == ERESTART) {
 				/* A retry was scheduled, so just return. */
 				return;
 			}
-			if (error != 0) {
-				bp->bio_error = error;
-				bp->bio_resid = bp->bio_bcount;
-				bp->bio_flags |= BIO_ERROR;
-			} else {
-				bp->bio_resid = ataio->resid;
-				bp->bio_error = 0;
-				if (bp->bio_resid != 0)
-					bp->bio_flags |= BIO_ERROR;
-			}
 			if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
 				cam_release_devq(done_ccb->ccb_h.path,
 						 /*relsim_flags*/0,
@@ -1736,26 +1726,38 @@ adadone(struct cam_periph *periph, union
 		} else {
 			if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
 				panic("REQ_CMP with QFRZN");
-			bp->bio_resid = ataio->resid;
-			if (ataio->resid > 0)
+			error = 0;
+		}
+		bp = (struct bio *)done_ccb->ccb_h.ccb_bp;
+		bp->bio_error = error;
+		if (error != 0) {
+			bp->bio_resid = bp->bio_bcount;
+			bp->bio_flags |= BIO_ERROR;
+		} else {
+			if (state == ADA_CCB_TRIM)
+				bp->bio_resid = 0;
+			else
+				bp->bio_resid = ataio->resid;
+			if (bp->bio_resid > 0)
 				bp->bio_flags |= BIO_ERROR;
 		}
 		softc->outstanding_cmds--;
 		if (softc->outstanding_cmds == 0)
 			softc->flags |= ADA_FLAG_WENT_IDLE;
-		if ((ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) ==
-		    ADA_CCB_TRIM) {
+		if (state == ADA_CCB_TRIM) {
 			struct trim_request *req =
 			    (struct trim_request *)ataio->data_ptr;
 			int i;
 
 			for (i = 1; i < TRIM_MAX_BIOS && req->bps[i]; i++) {
 				struct bio *bp1 = req->bps[i];
-				
-				bp1->bio_resid = bp->bio_resid;
+
 				bp1->bio_error = bp->bio_error;
-				if (bp->bio_flags & BIO_ERROR)
+				if (bp->bio_flags & BIO_ERROR) {
 					bp1->bio_flags |= BIO_ERROR;
+					bp1->bio_resid = bp1->bio_bcount;
+				} else
+					bp1->bio_resid = 0;
 				biodone(bp1);
 			}
 			softc->trim_running = 0;

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:40:24 2013	(r255554)
+++ stable/9/sys/cam/scsi/scsi_da.c	Sat Sep 14 09:42:01 2013	(r255555)
@@ -2929,7 +2929,10 @@ dadone(struct cam_periph *periph, union 
 					bp->bio_flags |= BIO_ERROR;
 				}
 			} else if (bp != NULL) {
-				bp->bio_resid = csio->resid;
+				if (state == DA_CCB_DELETE)
+					bp->bio_resid = 0;
+				else
+					bp->bio_resid = csio->resid;
 				bp->bio_error = 0;
 				if (bp->bio_resid != 0)
 					bp->bio_flags |= BIO_ERROR;
@@ -2943,7 +2946,10 @@ dadone(struct cam_periph *periph, union 
 		} else if (bp != NULL) {
 			if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
 				panic("REQ_CMP with QFRZN");
-			bp->bio_resid = csio->resid;
+			if (state == DA_CCB_DELETE)
+				bp->bio_resid = 0;
+			else
+				bp->bio_resid = csio->resid;
 			if (csio->resid > 0)
 				bp->bio_flags |= BIO_ERROR;
 			if (softc->error_inject != 0) {
@@ -2952,7 +2958,6 @@ dadone(struct cam_periph *periph, union 
 				bp->bio_flags |= BIO_ERROR;
 				softc->error_inject = 0;
 			}
-
 		}
 
 		/*
@@ -2967,10 +2972,12 @@ dadone(struct cam_periph *periph, union 
 		if (state == DA_CCB_DELETE) {
 			while ((bp1 = bioq_takefirst(&softc->delete_run_queue))
 			    != NULL) {
-				bp1->bio_resid = bp->bio_resid;
 				bp1->bio_error = bp->bio_error;
-				if (bp->bio_flags & BIO_ERROR)
+				if (bp->bio_flags & BIO_ERROR) {
 					bp1->bio_flags |= BIO_ERROR;
+					bp1->bio_resid = bp1->bio_bcount;
+				} else
+					bp1->bio_resid = 0;
 				biodone(bp1);
 			}
 			softc->delete_running = 0;

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:49:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id D7BF0B1D;
 Sat, 14 Sep 2013 09:49:19 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id AA73A2C8F;
 Sat, 14 Sep 2013 09:49:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9nJcp017269;
 Sat, 14 Sep 2013 09:49:19 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9nJsn017267;
 Sat, 14 Sep 2013 09:49:19 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140949.r8E9nJsn017267@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:49:19 +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: r255556 - in stable/9/sys: cam geom
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:49:19 -0000

Author: mav
Date: Sat Sep 14 09:49:18 2013
New Revision: 255556
URL: http://svnweb.freebsd.org/changeset/base/255556

Log:
  MFC r254766:
  Add new attribute lunname to report only textual LUN-specific device IDs.
  While lunid attribute prefers to report numeric ones, having both may be
  useful in some situations.

Modified:
  stable/9/sys/cam/cam_xpt.c
  stable/9/sys/geom/geom_disk.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/cam_xpt.c
==============================================================================
--- stable/9/sys/cam/cam_xpt.c	Sat Sep 14 09:42:01 2013	(r255555)
+++ stable/9/sys/cam/cam_xpt.c	Sat Sep 14 09:49:18 2013	(r255556)
@@ -1157,7 +1157,8 @@ xpt_getattr(char *buf, size_t len, const
 		cdai.buftype = CDAI_TYPE_SERIAL_NUM;
 	else if (!strcmp(attr, "GEOM::physpath"))
 		cdai.buftype = CDAI_TYPE_PHYS_PATH;
-	else if (!strcmp(attr, "GEOM::lunid")) {
+	else if (strcmp(attr, "GEOM::lunid") == 0 ||
+		 strcmp(attr, "GEOM::lunname") == 0) {
 		cdai.buftype = CDAI_TYPE_SCSI_DEVID;
 		cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN;
 	} else
@@ -1174,11 +1175,14 @@ xpt_getattr(char *buf, size_t len, const
 	if (cdai.provsiz == 0)
 		goto out;
 	if (cdai.buftype == CDAI_TYPE_SCSI_DEVID) {
-		idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf,
-		    cdai.provsiz, scsi_devid_is_lun_naa);
-		if (idd == NULL)
+		if (strcmp(attr, "GEOM::lunid") == 0) {
 			idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf,
-			    cdai.provsiz, scsi_devid_is_lun_eui64);
+			    cdai.provsiz, scsi_devid_is_lun_naa);
+			if (idd == NULL)
+				idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf,
+				    cdai.provsiz, scsi_devid_is_lun_eui64);
+		} else
+			idd = NULL;
 		if (idd == NULL)
 			idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf,
 			    cdai.provsiz, scsi_devid_is_lun_t10);

Modified: stable/9/sys/geom/geom_disk.c
==============================================================================
--- stable/9/sys/geom/geom_disk.c	Sat Sep 14 09:42:01 2013	(r255555)
+++ stable/9/sys/geom/geom_disk.c	Sat Sep 14 09:49:18 2013	(r255556)
@@ -466,6 +466,12 @@ g_disk_dumpconf(struct sbuf *sb, const c
 			if (dp->d_getattr(bp) == 0)
 				sbuf_printf(sb, "%s<lunid>%s</lunid>\n",
 				    indent, buf);
+			bp->bio_attribute = "GEOM::lunname";
+			bp->bio_length = DISK_IDENT_SIZE;
+			bp->bio_data = buf;
+			if (dp->d_getattr(bp) == 0)
+				sbuf_printf(sb, "%s<lunname>%s</lunname>\n",
+				    indent, buf);
 			g_destroy_bio(bp);
 			g_free(buf);
 		} else

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:50:45 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 3ED9FC4F;
 Sat, 14 Sep 2013 09:50:45 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2B8112C97;
 Sat, 14 Sep 2013 09:50:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9ojla019396;
 Sat, 14 Sep 2013 09:50:45 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9oj1k019395;
 Sat, 14 Sep 2013 09:50:45 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140950.r8E9oj1k019395@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:50:45 +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: r255557 - stable/9/sys/cam/ctl
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:50:45 -0000

Author: mav
Date: Sat Sep 14 09:50:44 2013
New Revision: 255557
URL: http://svnweb.freebsd.org/changeset/base/255557

Log:
  MFC r255117:
  Fix the build with CTLFEDEBUG, broken by unmapped I/O support changes.

Modified:
  stable/9/sys/cam/ctl/scsi_ctl.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- stable/9/sys/cam/ctl/scsi_ctl.c	Sat Sep 14 09:49:18 2013	(r255556)
+++ stable/9/sys/cam/ctl/scsi_ctl.c	Sat Sep 14 09:50:44 2013	(r255557)
@@ -962,23 +962,23 @@ ctlfestart(struct cam_periph *periph, un
 
 		/*
 		 * Valid combinations:
-		 *  - CAM_SEND_STATUS, SCATTER_VALID = 0, dxfer_len = 0,
+		 *  - CAM_SEND_STATUS, CAM_DATA_SG = 0, dxfer_len = 0,
 		 *    sglist_cnt = 0
-		 *  - CAM_SEND_STATUS = 0, SCATTER_VALID = 0, dxfer_len != 0,
+		 *  - CAM_SEND_STATUS = 0, CAM_DATA_SG = 0, dxfer_len != 0,
 		 *    sglist_cnt = 0 
-		 *  - CAM_SEND_STATUS = 0, SCATTER_VALID, dxfer_len != 0,
+		 *  - CAM_SEND_STATUS = 0, CAM_DATA_SG, dxfer_len != 0,
 		 *    sglist_cnt != 0
 		 */
 #ifdef CTLFEDEBUG
 		if (((flags & CAM_SEND_STATUS)
-		  && (((flags & CAM_SCATTER_VALID) != 0)
+		  && (((flags & CAM_DATA_SG) != 0)
 		   || (dxfer_len != 0)
 		   || (csio->sglist_cnt != 0)))
 		 || (((flags & CAM_SEND_STATUS) == 0)
 		  && (dxfer_len == 0))
-		 || ((flags & CAM_SCATTER_VALID)
+		 || ((flags & CAM_DATA_SG)
 		  && (csio->sglist_cnt == 0))
-		 || (((flags & CAM_SCATTER_VALID) == 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,

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:50:46 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 1F459C50;
 Sat, 14 Sep 2013 09:50:46 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E73F62C98;
 Sat, 14 Sep 2013 09:50:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9ojCb019429;
 Sat, 14 Sep 2013 09:50:45 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9oj2X019428;
 Sat, 14 Sep 2013 09:50:45 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309140950.r8E9oj2X019428@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:50:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255558 - head/sys/modules/hyperv/stordisengage
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:50:46 -0000

Author: kib
Date: Sat Sep 14 09:50:45 2013
New Revision: 255558
URL: http://svnweb.freebsd.org/changeset/base/255558

Log:
  Add svn:keywords property to Makefile.
  
  Approved by:	re (gjb)

Modified:
Directory Properties:
  head/sys/modules/hyperv/stordisengage/Makefile   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:52:31 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C9624EC3;
 Sat, 14 Sep 2013 09:52:31 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 51CD02CCE;
 Sat, 14 Sep 2013 09:52:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9qV7X020203;
 Sat, 14 Sep 2013 09:52:31 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9qVTj020202;
 Sat, 14 Sep 2013 09:52:31 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309140952.r8E9qVTj020202@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:52:31 +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: r255559 - stable/9/sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:52:31 -0000

Author: mav
Date: Sat Sep 14 09:52:30 2013
New Revision: 255559
URL: http://svnweb.freebsd.org/changeset/base/255559

Log:
  MFC r255118:
  Fix targbh crash on XPT_IMMED_NOTIFY error during attach.

Modified:
  stable/9/sys/cam/scsi/scsi_targ_bh.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_targ_bh.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_targ_bh.c	Sat Sep 14 09:50:45 2013	(r255558)
+++ stable/9/sys/cam/scsi/scsi_targ_bh.c	Sat Sep 14 09:52:30 2013	(r255559)
@@ -283,16 +283,13 @@ targbhenlun(struct cam_periph *periph)
 		xpt_setup_ccb(&atio->ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		atio->ccb_h.func_code = XPT_ACCEPT_TARGET_IO;
 		atio->ccb_h.cbfcnp = targbhdone;
-		xpt_action((union ccb *)atio);
-		status = atio->ccb_h.status;
-		if (status != CAM_REQ_INPROG) {
-			targbhfreedescr(atio->ccb_h.ccb_descr);
-			free(atio, M_SCSIBH);
-			break;
-		}
 		((struct targbh_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link =
 		    softc->accept_tio_list;
 		softc->accept_tio_list = atio;
+		xpt_action((union ccb *)atio);
+		status = atio->ccb_h.status;
+		if (status != CAM_REQ_INPROG)
+			break;
 	}
 
 	if (i == 0) {
@@ -321,14 +318,12 @@ targbhenlun(struct cam_periph *periph)
 		xpt_setup_ccb(&inot->ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		inot->ccb_h.func_code = XPT_IMMED_NOTIFY;
 		inot->ccb_h.cbfcnp = targbhdone;
+		SLIST_INSERT_HEAD(&softc->immed_notify_slist, &inot->ccb_h,
+				  periph_links.sle);
 		xpt_action((union ccb *)inot);
 		status = inot->ccb_h.status;
-		if (status != CAM_REQ_INPROG) {
-			free(inot, M_SCSIBH);
+		if (status != CAM_REQ_INPROG)
 			break;
-		}
-		SLIST_INSERT_HEAD(&softc->immed_notify_slist, &inot->ccb_h,
-				  periph_links.sle);
 	}
 
 	if (i == 0) {
@@ -413,7 +408,9 @@ targbhctor(struct cam_periph *periph, vo
 	periph->softc = softc;
 	softc->init_level++;
 
-	return (targbhenlun(periph));
+	if (targbhenlun(periph) != CAM_REQ_CMP)
+		cam_periph_invalidate(periph);
+	return (CAM_REQ_CMP);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:53:37 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 06E40FF4;
 Sat, 14 Sep 2013 09:53:37 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id CE8852CD4;
 Sat, 14 Sep 2013 09:53:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9rar2020595;
 Sat, 14 Sep 2013 09:53:36 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9ra9f020594;
 Sat, 14 Sep 2013 09:53:36 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309140953.r8E9ra9f020594@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:53:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255560 - head/sys/modules/hyperv/stordisengage
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:53:37 -0000

Author: kib
Date: Sat Sep 14 09:53:36 2013
New Revision: 255560
URL: http://svnweb.freebsd.org/changeset/base/255560

Log:
  Correct the svn:keywords value.
  
  Approved by:	re (gjb, implicit)

Modified:
Directory Properties:
  head/sys/modules/hyperv/stordisengage/Makefile   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 09:53:57 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id A5CBD1B8;
 Sat, 14 Sep 2013 09:53:57 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 933FD2CDA;
 Sat, 14 Sep 2013 09:53:57 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9rvo9020725;
 Sat, 14 Sep 2013 09:53:57 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9rvIV020724;
 Sat, 14 Sep 2013 09:53:57 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309140953.r8E9rvIV020724@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Sat, 14 Sep 2013 09:53:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255561 - head/sys/modules/hyperv/stordisengage
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 09:53:57 -0000

Author: kib
Date: Sat Sep 14 09:53:57 2013
New Revision: 255561
URL: http://svnweb.freebsd.org/changeset/base/255561

Log:
  Fix module build when device ata is not in kernel config.
  
  Sponsored by:	The FreeBSD Foundation
  Build-tested by:	gjb
  Approved by:	re (delphij)

Modified:
  head/sys/modules/hyperv/stordisengage/Makefile

Modified: head/sys/modules/hyperv/stordisengage/Makefile
==============================================================================
--- head/sys/modules/hyperv/stordisengage/Makefile	Sat Sep 14 09:53:36 2013	(r255560)
+++ head/sys/modules/hyperv/stordisengage/Makefile	Sat Sep 14 09:53:57 2013	(r255561)
@@ -4,6 +4,6 @@
 
 KMOD=	 hv_ata_pci_disengage
 
-SRCS=	hv_ata_pci_disengage.c
+SRCS=	hv_ata_pci_disengage.c ata_if.h
 
 .include <bsd.kmod.mk>

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 10:00:21 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 55A855C9;
 Sat, 14 Sep 2013 10:00:21 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3420D2D35;
 Sat, 14 Sep 2013 10:00:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EA0Lcb023929;
 Sat, 14 Sep 2013 10:00:21 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EA0KUd023924;
 Sat, 14 Sep 2013 10:00:20 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309141000.r8EA0KUd023924@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 10:00:20 +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: r255562 - in stable/9: share/examples/scsi_target
 sys/cam/scsi
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 10:00:21 -0000

Author: mav
Date: Sat Sep 14 10:00:20 2013
New Revision: 255562
URL: http://svnweb.freebsd.org/changeset/base/255562

Log:
  MFC r255120:
  Bring legacy CAM target implementation back into API/KPI-coherent and even
  functional state.  While CTL is much more superior target from all points,
  there is no reason why this code should not work.

Modified:
  stable/9/share/examples/scsi_target/scsi_target.c
  stable/9/sys/cam/scsi/scsi_targ_bh.c
  stable/9/sys/cam/scsi/scsi_target.c
Directory Properties:
  stable/9/share/examples/scsi_target/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/share/examples/scsi_target/scsi_target.c
==============================================================================
--- stable/9/share/examples/scsi_target/scsi_target.c	Sat Sep 14 09:53:57 2013	(r255561)
+++ stable/9/share/examples/scsi_target/scsi_target.c	Sat Sep 14 10:00:20 2013	(r255562)
@@ -371,7 +371,7 @@ init_ccbs()
 	for (i = 0; i < MAX_INITIATORS; i++) {
 		struct ccb_accept_tio *atio;
 		struct atio_descr *a_descr;
-		struct ccb_immed_notify *inot;
+		struct ccb_immediate_notify *inot;
 
 		atio = (struct ccb_accept_tio *)malloc(sizeof(*atio));
 		if (atio == NULL) {
@@ -388,7 +388,7 @@ init_ccbs()
 		atio->ccb_h.targ_descr = a_descr;
 		send_ccb((union ccb *)atio, /*priority*/1);
 
-		inot = (struct ccb_immed_notify *)malloc(sizeof(*inot));
+		inot = (struct ccb_immediate_notify *)malloc(sizeof(*inot));
 		if (inot == NULL) {
 			warn("malloc INOT");
 			return (-1);
@@ -599,7 +599,7 @@ handle_read()
 			oo += run_queue(c_descr->atio);
 			break;
 		}
-		case XPT_IMMED_NOTIFY:
+		case XPT_IMMEDIATE_NOTIFY:
 			/* INOTs are handled with priority */
 			TAILQ_INSERT_HEAD(&work_queue, &ccb->ccb_h,
 					  periph_links.tqe);
@@ -909,7 +909,7 @@ free_ccb(union ccb *ccb)
 	case XPT_ACCEPT_TARGET_IO:
 		free(ccb->ccb_h.targ_descr);
 		/* FALLTHROUGH */
-	case XPT_IMMED_NOTIFY:
+	case XPT_IMMEDIATE_NOTIFY:
 	default:
 		free(ccb);
 		break;

Modified: stable/9/sys/cam/scsi/scsi_targ_bh.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_targ_bh.c	Sat Sep 14 09:53:57 2013	(r255561)
+++ stable/9/sys/cam/scsi/scsi_targ_bh.c	Sat Sep 14 10:00:20 2013	(r255562)
@@ -305,10 +305,10 @@ targbhenlun(struct cam_periph *periph)
 	 * so the SIM can tell us of asynchronous target mode events.
 	 */
 	for (i = 0; i < MAX_ACCEPT; i++) {
-		struct ccb_immed_notify *inot;
+		struct ccb_immediate_notify *inot;
 
-		inot = (struct ccb_immed_notify*)malloc(sizeof(*inot), M_SCSIBH,
-						        M_NOWAIT);
+		inot = (struct ccb_immediate_notify*)malloc(sizeof(*inot),
+			    M_SCSIBH, M_NOWAIT);
 
 		if (inot == NULL) {
 			status = CAM_RESRC_UNAVAIL;
@@ -316,7 +316,7 @@ targbhenlun(struct cam_periph *periph)
 		}
 
 		xpt_setup_ccb(&inot->ccb_h, periph->path, CAM_PRIORITY_NORMAL);
-		inot->ccb_h.func_code = XPT_IMMED_NOTIFY;
+		inot->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY;
 		inot->ccb_h.cbfcnp = targbhdone;
 		SLIST_INSERT_HEAD(&softc->immed_notify_slist, &inot->ccb_h,
 				  periph_links.sle);
@@ -712,7 +712,7 @@ targbhdone(struct cam_periph *periph, un
 		}
 		break;
 	}
-	case XPT_IMMED_NOTIFY:
+	case XPT_IMMEDIATE_NOTIFY:
 	{
 		int frozen;
 

Modified: stable/9/sys/cam/scsi/scsi_target.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_target.c	Sat Sep 14 09:53:57 2013	(r255561)
+++ stable/9/sys/cam/scsi/scsi_target.c	Sat Sep 14 10:00:20 2013	(r255562)
@@ -590,6 +590,7 @@ targwrite(struct cdev *dev, struct uio *
 		switch (func_code) {
 		case XPT_ACCEPT_TARGET_IO:
 		case XPT_IMMED_NOTIFY:
+		case XPT_IMMEDIATE_NOTIFY:
 			cam_periph_lock(softc->periph);
 			ccb = targgetccb(softc, func_code, priority);
 			descr = (struct targ_cmd_descr *)ccb->ccb_h.targ_descr;
@@ -820,6 +821,7 @@ targdone(struct cam_periph *periph, unio
 	switch (done_ccb->ccb_h.func_code) {
 	/* All FC_*_QUEUED CCBs go back to userland */
 	case XPT_IMMED_NOTIFY:
+	case XPT_IMMEDIATE_NOTIFY:
 	case XPT_ACCEPT_TARGET_IO:
 	case XPT_CONT_TARGET_IO:
 		TAILQ_INSERT_TAIL(&softc->user_ccb_queue, &done_ccb->ccb_h,
@@ -1000,6 +1002,7 @@ targfreeccb(struct targ_softc *softc, un
 	switch (ccb->ccb_h.func_code) {
 	case XPT_ACCEPT_TARGET_IO:
 	case XPT_IMMED_NOTIFY:
+	case XPT_IMMEDIATE_NOTIFY:
 		CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH, ("freeing ccb %p\n", ccb));
 		free(ccb, M_TARG);
 		break;
@@ -1182,6 +1185,9 @@ targccblen(xpt_opcode func_code)
 	case XPT_IMMED_NOTIFY:
 		len = sizeof(struct ccb_immed_notify);
 		break;
+	case XPT_IMMEDIATE_NOTIFY:
+		len = sizeof(struct ccb_immediate_notify);
+		break;
 	case XPT_REL_SIMQ:
 		len = sizeof(struct ccb_relsim);
 		break;

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 10:08:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 376C9818;
 Sat, 14 Sep 2013 10:08:10 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 140262D7F;
 Sat, 14 Sep 2013 10:08:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EA89i9028360;
 Sat, 14 Sep 2013 10:08:09 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EA89Pe028358;
 Sat, 14 Sep 2013 10:08:09 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309141008.r8EA89Pe028358@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 10:08:09 +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: r255563 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 10:08:10 -0000

Author: mav
Date: Sat Sep 14 10:08:09 2013
New Revision: 255563
URL: http://svnweb.freebsd.org/changeset/base/255563

Log:
  MFC r253706:
  Introduce 3 seconds timeout on `graid stop` command (mostly with -f flag).
  Since completion waiting goes in g_event thread, it may cause GEOM deadlock
  if consumer on top (for example, ZFS) uses g_event thread for closing.

Modified:
  stable/9/sys/geom/raid/g_raid.c
  stable/9/sys/geom/raid/g_raid_ctl.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/raid/g_raid.c
==============================================================================
--- stable/9/sys/geom/raid/g_raid.c	Sat Sep 14 10:00:20 2013	(r255562)
+++ stable/9/sys/geom/raid/g_raid.c	Sat Sep 14 10:08:09 2013	(r255563)
@@ -2171,7 +2171,7 @@ g_raid_destroy_disk(struct g_raid_disk *
 int
 g_raid_destroy(struct g_raid_softc *sc, int how)
 {
-	int opens;
+	int error, opens;
 
 	g_topology_assert_not();
 	if (sc == NULL)
@@ -2188,11 +2188,13 @@ g_raid_destroy(struct g_raid_softc *sc, 
 			G_RAID_DEBUG1(1, sc,
 			    "%d volumes are still open.",
 			    opens);
+			sx_xunlock(&sc->sc_lock);
 			return (EBUSY);
 		case G_RAID_DESTROY_DELAYED:
 			G_RAID_DEBUG1(1, sc,
 			    "Array will be destroyed on last close.");
 			sc->sc_stopping = G_RAID_DESTROY_DELAYED;
+			sx_xunlock(&sc->sc_lock);
 			return (EBUSY);
 		case G_RAID_DESTROY_HARD:
 			G_RAID_DEBUG1(1, sc,
@@ -2206,9 +2208,9 @@ g_raid_destroy(struct g_raid_softc *sc, 
 	/* Wake up worker to let it selfdestruct. */
 	g_raid_event_send(sc, G_RAID_NODE_E_WAKE, 0);
 	/* Sleep until node destroyed. */
-	sx_sleep(&sc->sc_stopping, &sc->sc_lock,
-	    PRIBIO | PDROP, "r:destroy", 0);
-	return (0);
+	error = sx_sleep(&sc->sc_stopping, &sc->sc_lock,
+	    PRIBIO | PDROP, "r:destroy", hz * 3);
+	return (error == EWOULDBLOCK ? EBUSY : 0);
 }
 
 static void
@@ -2303,8 +2305,6 @@ g_raid_destroy_geom(struct gctl_req *req
 	sx_xlock(&sc->sc_lock);
 	g_cancel_event(sc);
 	error = g_raid_destroy(gp->softc, G_RAID_DESTROY_SOFT);
-	if (error != 0)
-		sx_xunlock(&sc->sc_lock);
 	g_topology_lock();
 	return (error);
 }
@@ -2469,7 +2469,6 @@ g_raid_shutdown_post_sync(void *arg, int
 	struct g_geom *gp, *gp2;
 	struct g_raid_softc *sc;
 	struct g_raid_volume *vol;
-	int error;
 
 	mp = arg;
 	DROP_GIANT();
@@ -2483,9 +2482,7 @@ g_raid_shutdown_post_sync(void *arg, int
 		TAILQ_FOREACH(vol, &sc->sc_volumes, v_next)
 			g_raid_clean(vol, -1);
 		g_cancel_event(sc);
-		error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED);
-		if (error != 0)
-			sx_xunlock(&sc->sc_lock);
+		g_raid_destroy(sc, G_RAID_DESTROY_DELAYED);
 		g_topology_lock();
 	}
 	g_topology_unlock();

Modified: stable/9/sys/geom/raid/g_raid_ctl.c
==============================================================================
--- stable/9/sys/geom/raid/g_raid_ctl.c	Sat Sep 14 10:00:20 2013	(r255562)
+++ stable/9/sys/geom/raid/g_raid_ctl.c	Sat Sep 14 10:08:09 2013	(r255563)
@@ -181,7 +181,7 @@ g_raid_ctl_stop(struct gctl_req *req, st
 	sx_xlock(&sc->sc_lock);
 	error = g_raid_destroy(sc, how);
 	if (error != 0)
-		sx_xunlock(&sc->sc_lock);
+		gctl_error(req, "Array is busy.");
 	g_topology_lock();
 }
 

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 10:10:02 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 30DAA958;
 Sat, 14 Sep 2013 10:10:02 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1D2332D89;
 Sat, 14 Sep 2013 10:10:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EAA1PO029364;
 Sat, 14 Sep 2013 10:10:01 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EAA1Sb029363;
 Sat, 14 Sep 2013 10:10:01 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309141010.r8EAA1Sb029363@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 10:10: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: r255564 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 10:10:02 -0000

Author: mav
Date: Sat Sep 14 10:10:01 2013
New Revision: 255564
URL: http://svnweb.freebsd.org/changeset/base/255564

Log:
  MFC r254269, r254271:
  Fix reasonable but safe Clang warnings.

Modified:
  stable/9/sys/geom/raid/tr_raid5.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/raid/tr_raid5.c
==============================================================================
--- stable/9/sys/geom/raid/tr_raid5.c	Sat Sep 14 10:08:09 2013	(r255563)
+++ stable/9/sys/geom/raid/tr_raid5.c	Sat Sep 14 10:10:01 2013	(r255564)
@@ -106,7 +106,8 @@ g_raid_tr_taste_raid5(struct g_raid_tr_o
 	trs = (struct g_raid_tr_raid5_object *)tr;
 	qual = tr->tro_volume->v_raid_level_qualifier;
 	if (tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID4 &&
-	    qual >= 0 && qual <= 1) {
+	    (qual == G_RAID_VOLUME_RLQ_R4P0 ||
+	     qual == G_RAID_VOLUME_RLQ_R4PN)) {
 		/* RAID4 */
 	} else if ((tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5 ||
 	     tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5E ||
@@ -114,7 +115,10 @@ g_raid_tr_taste_raid5(struct g_raid_tr_o
 	     tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5R ||
 	     tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID6 ||
 	     tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAIDMDF) &&
-	    qual >= 0 && qual <= 3) {
+	    (qual == G_RAID_VOLUME_RLQ_R5RA ||
+	     qual == G_RAID_VOLUME_RLQ_R5RS ||
+	     qual == G_RAID_VOLUME_RLQ_R5LA ||
+	     qual == G_RAID_VOLUME_RLQ_R5LS)) {
 		/* RAID5/5E/5EE/5R/6/MDF */
 	} else
 		return (G_RAID_TR_TASTE_FAIL);

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 10:11:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 79147A86;
 Sat, 14 Sep 2013 10:11:10 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4B1B22DB4;
 Sat, 14 Sep 2013 10:11:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EABAc9031985;
 Sat, 14 Sep 2013 10:11:10 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EAB9nn031981;
 Sat, 14 Sep 2013 10:11:09 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309141011.r8EAB9nn031981@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 10:11:09 +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: r255565 - 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 10:11:10 -0000

Author: mav
Date: Sat Sep 14 10:11:09 2013
New Revision: 255565
URL: http://svnweb.freebsd.org/changeset/base/255565

Log:
  MFC r254275:
  Return error when opening read-only volumes (like RAID4/5/...) for writing.
  Previously opens succeeded, but actual write operations returned errors.

Modified:
  stable/9/sys/geom/raid/g_raid.c
  stable/9/sys/geom/raid/g_raid.h
  stable/9/sys/geom/raid/tr_raid5.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/raid/g_raid.c
==============================================================================
--- stable/9/sys/geom/raid/g_raid.c	Sat Sep 14 10:10:01 2013	(r255564)
+++ stable/9/sys/geom/raid/g_raid.c	Sat Sep 14 10:11:09 2013	(r255565)
@@ -1863,6 +1863,11 @@ g_raid_access(struct g_provider *pp, int
 		error = ENXIO;
 		goto out;
 	}
+	/* Deny write opens for read-only volumes. */
+	if (vol->v_read_only && acw > 0) {
+		error = EROFS;
+		goto out;
+	}
 	if (dcw == 0)
 		g_raid_clean(vol, dcw);
 	vol->v_provider_open += acr + acw + ace;

Modified: stable/9/sys/geom/raid/g_raid.h
==============================================================================
--- stable/9/sys/geom/raid/g_raid.h	Sat Sep 14 10:10:01 2013	(r255564)
+++ stable/9/sys/geom/raid/g_raid.h	Sat Sep 14 10:11:09 2013	(r255565)
@@ -306,6 +306,7 @@ struct g_raid_volume {
 	int			 v_stopping;	/* Volume is stopping */
 	int			 v_provider_open; /* Number of opens. */
 	int			 v_global_id;	/* Global volume ID (rX). */
+	int			 v_read_only;	/* Volume is read-only. */
 	TAILQ_ENTRY(g_raid_volume)	 v_next; /* List of volumes entry. */
 	LIST_ENTRY(g_raid_volume)	 v_global_next; /* Global list entry. */
 };

Modified: stable/9/sys/geom/raid/tr_raid5.c
==============================================================================
--- stable/9/sys/geom/raid/tr_raid5.c	Sat Sep 14 10:10:01 2013	(r255564)
+++ stable/9/sys/geom/raid/tr_raid5.c	Sat Sep 14 10:11:09 2013	(r255565)
@@ -185,8 +185,9 @@ g_raid_tr_start_raid5(struct g_raid_tr_o
 	struct g_raid_volume *vol;
 
 	trs = (struct g_raid_tr_raid5_object *)tr;
-	vol = tr->tro_volume;
 	trs->trso_starting = 0;
+	vol = tr->tro_volume;
+	vol->v_read_only = 1;
 	g_raid_tr_update_state_raid5(vol, NULL);
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 10:11:39 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 78BE9BB7;
 Sat, 14 Sep 2013 10:11:39 +0000 (UTC) (envelope-from kib@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 66EDE2DB9;
 Sat, 14 Sep 2013 10:11:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EABdLC032235;
 Sat, 14 Sep 2013 10:11:39 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EABdwo032234;
 Sat, 14 Sep 2013 10:11:39 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201309141011.r8EABdwo032234@svn.freebsd.org>
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Sat, 14 Sep 2013 10:11:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255566 - head/sys/vm
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 10:11:39 -0000

Author: kib
Date: Sat Sep 14 10:11:38 2013
New Revision: 255566
URL: http://svnweb.freebsd.org/changeset/base/255566

Log:
  If the last page of the file is partially full and whole valid
  portion is invalidated, invalidate the whole page.  Otherwise,
  partially valid page appears on a page queue, which is wrong.  This
  could only happen for the last page, because only then buffer which
  triggered invalidation could not cover the whole page.
  
  Reported and tested by:	pho (previous version)
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  Approved by:	re (delphij)
  MFC after:	2 weeks

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Sat Sep 14 10:11:09 2013	(r255565)
+++ head/sys/vm/vm_page.c	Sat Sep 14 10:11:38 2013	(r255566)
@@ -2980,12 +2980,19 @@ void
 vm_page_set_invalid(vm_page_t m, int base, int size)
 {
 	vm_page_bits_t bits;
+	vm_object_t object;
 
-	VM_OBJECT_ASSERT_WLOCKED(m->object);
-	bits = vm_page_bits(base, size);
+	object = m->object;
+	VM_OBJECT_ASSERT_WLOCKED(object);
+	if (object->type == OBJT_VNODE && base == 0 && IDX_TO_OFF(m->pindex) +
+	    size >= object->un_pager.vnp.vnp_size)
+		bits = VM_PAGE_BITS_ALL;
+	else
+		bits = vm_page_bits(base, size);
 	if (m->valid == VM_PAGE_BITS_ALL && bits != 0)
 		pmap_remove_all(m);
-	KASSERT(!pmap_page_is_mapped(m),
+	KASSERT((bits == 0 && m->valid == VM_PAGE_BITS_ALL) ||
+	    !pmap_page_is_mapped(m),
 	    ("vm_page_set_invalid: page %p is mapped", m));
 	m->valid &= ~bits;
 	m->dirty &= ~bits;

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 10:12:29 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 85EEACF3;
 Sat, 14 Sep 2013 10:12:29 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 583E92DC0;
 Sat, 14 Sep 2013 10:12:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EACTcU032485;
 Sat, 14 Sep 2013 10:12:29 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EACTW9032484;
 Sat, 14 Sep 2013 10:12:29 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309141012.r8EACTW9032484@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 10:12:29 +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: r255567 - stable/9/sys/geom/zero
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 10:12:29 -0000

Author: mav
Date: Sat Sep 14 10:12:28 2013
New Revision: 255567
URL: http://svnweb.freebsd.org/changeset/base/255567

Log:
  MFC r254936:
  Add unmapped BIO support to GEOM ZERO if kern.geom.zero.clear is cleared.

Modified:
  stable/9/sys/geom/zero/g_zero.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/zero/g_zero.c
==============================================================================
--- stable/9/sys/geom/zero/g_zero.c	Sat Sep 14 10:11:38 2013	(r255566)
+++ stable/9/sys/geom/zero/g_zero.c	Sat Sep 14 10:12:28 2013	(r255567)
@@ -41,16 +41,37 @@ __FBSDID("$FreeBSD$");
 
 #define	G_ZERO_CLASS_NAME	"ZERO"
 
+static int	g_zero_clear_sysctl(SYSCTL_HANDLER_ARGS);
+
 SYSCTL_DECL(_kern_geom);
 static SYSCTL_NODE(_kern_geom, OID_AUTO, zero, CTLFLAG_RW, 0,
     "GEOM_ZERO stuff");
 static int g_zero_clear = 1;
-SYSCTL_INT(_kern_geom_zero, OID_AUTO, clear, CTLFLAG_RW, &g_zero_clear, 0,
-    "Clear read data buffer");
+SYSCTL_PROC(_kern_geom_zero, OID_AUTO, clear, CTLTYPE_INT|CTLFLAG_RW,
+    &g_zero_clear, 0, g_zero_clear_sysctl, "I", "Clear read data buffer");
 static int g_zero_byte = 0;
 SYSCTL_INT(_kern_geom_zero, OID_AUTO, byte, CTLFLAG_RW, &g_zero_byte, 0,
     "Byte (octet) value to clear the buffers with");
 
+static struct g_provider *gpp;
+
+static int
+g_zero_clear_sysctl(SYSCTL_HANDLER_ARGS)
+{
+	int error;
+
+	error = sysctl_handle_int(oidp, &g_zero_clear, 0, req);
+	if (error != 0 || req->newptr == NULL)
+		return (error);
+	if (gpp == NULL)
+		return (ENXIO);
+	if (g_zero_clear)
+		gpp->flags &= ~G_PF_ACCEPT_UNMAPPED;
+	else
+		gpp->flags |= G_PF_ACCEPT_UNMAPPED;
+	return (0);
+}
+
 static void
 g_zero_start(struct bio *bp)
 {
@@ -58,7 +79,7 @@ g_zero_start(struct bio *bp)
 
 	switch (bp->bio_cmd) {
 	case BIO_READ:
-		if (g_zero_clear)
+		if (g_zero_clear && (bp->bio_flags & BIO_UNMAPPED) == 0)
 			memset(bp->bio_data, g_zero_byte, bp->bio_length);
 		/* FALLTHROUGH */
 	case BIO_DELETE:
@@ -84,7 +105,9 @@ g_zero_init(struct g_class *mp)
 	gp = g_new_geomf(mp, "gzero");
 	gp->start = g_zero_start;
 	gp->access = g_std_access;
-	pp = g_new_providerf(gp, "%s", gp->name);
+	gpp = pp = g_new_providerf(gp, "%s", gp->name);
+	if (!g_zero_clear)
+		pp->flags |= G_PF_ACCEPT_UNMAPPED;
 	pp->mediasize = 1152921504606846976LLU;
 	pp->sectorsize = 512;
 	g_error_provider(pp, 0);
@@ -104,6 +127,7 @@ g_zero_destroy_geom(struct gctl_req *req
 		return (0);
 	if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)
 		return (EBUSY);
+	gpp = NULL;
 	g_wither_geom(gp, ENXIO);
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 10:14:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 65B3AE32;
 Sat, 14 Sep 2013 10:14:10 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3791B2DCD;
 Sat, 14 Sep 2013 10:14:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EAEAJo032835;
 Sat, 14 Sep 2013 10:14:10 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EAEASc032834;
 Sat, 14 Sep 2013 10:14:10 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309141014.r8EAEASc032834@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 10:14:10 +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: r255568 - stable/9/sys/geom/eli
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 10:14:10 -0000

Author: mav
Date: Sat Sep 14 10:14:09 2013
New Revision: 255568
URL: http://svnweb.freebsd.org/changeset/base/255568

Log:
  MFC r255144:
  Make ELI destruction (including orphanization) less aggressive, making it
  always wait for provider close.  Old algorithm was reported to cause NULL
  dereference panic on attempt to close provider after softc destruction.
  If not global workaroung in GEOM, that could even cause destruction with
  requests still in flight.

Modified:
  stable/9/sys/geom/eli/g_eli.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/eli/g_eli.c
==============================================================================
--- stable/9/sys/geom/eli/g_eli.c	Sat Sep 14 10:12:28 2013	(r255567)
+++ stable/9/sys/geom/eli/g_eli.c	Sat Sep 14 10:14:09 2013	(r255568)
@@ -620,21 +620,19 @@ end:
  * to close it when this situation occur.
  */
 static void
-g_eli_last_close(struct g_eli_softc *sc)
+g_eli_last_close(void *arg, int flags __unused)
 {
 	struct g_geom *gp;
-	struct g_provider *pp;
-	char ppname[64];
+	char gpname[64];
 	int error;
 
 	g_topology_assert();
-	gp = sc->sc_geom;
-	pp = LIST_FIRST(&gp->provider);
-	strlcpy(ppname, pp->name, sizeof(ppname));
-	error = g_eli_destroy(sc, TRUE);
+	gp = arg;
+	strlcpy(gpname, gp->name, sizeof(gpname));
+	error = g_eli_destroy(gp->softc, TRUE);
 	KASSERT(error == 0, ("Cannot detach %s on last close (error=%d).",
-	    ppname, error));
-	G_ELI_DEBUG(0, "Detached %s on last close.", ppname);
+	    gpname, error));
+	G_ELI_DEBUG(0, "Detached %s on last close.", gpname);
 }
 
 int
@@ -664,7 +662,7 @@ g_eli_access(struct g_provider *pp, int 
 	 */
 	if ((sc->sc_flags & G_ELI_FLAG_RW_DETACH) ||
 	    (sc->sc_flags & G_ELI_FLAG_WOPEN)) {
-		g_eli_last_close(sc);
+		g_post_event(g_eli_last_close, gp, M_WAITOK, NULL);
 	}
 	return (0);
 }
@@ -910,6 +908,10 @@ g_eli_destroy(struct g_eli_softc *sc, bo
 		if (force) {
 			G_ELI_DEBUG(1, "Device %s is still open, so it "
 			    "cannot be definitely removed.", pp->name);
+			sc->sc_flags |= G_ELI_FLAG_RW_DETACH;
+			gp->access = g_eli_access;
+			g_wither_provider(pp, ENXIO);
+			return (EBUSY);
 		} else {
 			G_ELI_DEBUG(1,
 			    "Device %s is still open (r%dw%de%d).", pp->name,

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 13:12:13 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id D516DB6;
 Sat, 14 Sep 2013 13:12:13 +0000 (UTC) (envelope-from mav@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id C1ABB265B;
 Sat, 14 Sep 2013 13:12:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EDCDXk027814;
 Sat, 14 Sep 2013 13:12:13 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EDCDQX027813;
 Sat, 14 Sep 2013 13:12:13 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201309141312.r8EDCDQX027813@svn.freebsd.org>
From: Alexander Motin <mav@FreeBSD.org>
Date: Sat, 14 Sep 2013 13:12:13 +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: r255569 - stable/9/sys/kern
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 13:12:13 -0000

Author: mav
Date: Sat Sep 14 13:12:13 2013
New Revision: 255569
URL: http://svnweb.freebsd.org/changeset/base/255569

Log:
  Temporary revert r255541 since there is no CPU_FFS in stable/9 yet.  Sorry.

Modified:
  stable/9/sys/kern/sched_ule.c

Modified: stable/9/sys/kern/sched_ule.c
==============================================================================
--- stable/9/sys/kern/sched_ule.c	Sat Sep 14 10:14:09 2013	(r255568)
+++ stable/9/sys/kern/sched_ule.c	Sat Sep 14 13:12:13 2013	(r255569)
@@ -632,14 +632,10 @@ cpu_search(const struct cpu_group *cg, s
 	}
 
 	/* Iterate through the child CPU groups and then remaining CPUs. */
-	for (i = cg->cg_children, cpu = mp_maxid; ; ) {
+	for (i = cg->cg_children, cpu = mp_maxid; i >= 0; ) {
 		if (i == 0) {
-#ifdef HAVE_INLINE_FFSL
-			cpu = CPU_FFS(&cpumask) - 1;
-#else
 			while (cpu >= 0 && !CPU_ISSET(cpu, &cpumask))
 				cpu--;
-#endif
 			if (cpu < 0)
 				break;
 			child = NULL;
@@ -664,7 +660,6 @@ cpu_search(const struct cpu_group *cg, s
 				break;
 			}
 		} else {			/* Handle child CPU. */
-			CPU_CLR(cpu, &cpumask);
 			tdq = TDQ_CPU(cpu);
 			load = tdq->tdq_load * 256;
 			rndptr = DPCPU_PTR(randomval);
@@ -712,11 +707,8 @@ cpu_search(const struct cpu_group *cg, s
 			i--;
 			if (i == 0 && CPU_EMPTY(&cpumask))
 				break;
-		}
-#ifndef HAVE_INLINE_FFSL
-		else
+		} else
 			cpu--;
-#endif
 	}
 	return (total);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 15:29:08 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 88FFDCE0;
 Sat, 14 Sep 2013 15:29:08 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 71DD72BFE;
 Sat, 14 Sep 2013 15:29:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EFT82k098145;
 Sat, 14 Sep 2013 15:29:08 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EFT647098130;
 Sat, 14 Sep 2013 15:29:06 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201309141529.r8EFT647098130@svn.freebsd.org>
From: Edward Tomasz Napierala <trasz@FreeBSD.org>
Date: Sat, 14 Sep 2013 15:29:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255570 - in head: etc/defaults etc/rc.d sbin/iscontrol
 share/man/man4 sys/cam/ctl sys/conf sys/dev/iscsi sys/dev/iscsi_initiator
 sys/modules sys/modules/ctl sys/modules/iscsi tools/reg...
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 15:29:08 -0000

Author: trasz
Date: Sat Sep 14 15:29:06 2013
New Revision: 255570
URL: http://svnweb.freebsd.org/changeset/base/255570

Log:
  Bring in the new iSCSI target and initiator.
  
  Reviewed by:	ken (parts)
  Approved by:	re (delphij)
  Sponsored by:	FreeBSD Foundation

Added:
  head/etc/rc.d/ctld   (contents, props changed)
  head/etc/rc.d/iscsictl   (contents, props changed)
  head/etc/rc.d/iscsid   (contents, props changed)
  head/sys/cam/ctl/ctl_frontend_iscsi.c   (contents, props changed)
  head/sys/cam/ctl/ctl_frontend_iscsi.h   (contents, props changed)
  head/sys/dev/iscsi/icl.c   (contents, props changed)
  head/sys/dev/iscsi/icl.h   (contents, props changed)
  head/sys/dev/iscsi/icl_proxy.c   (contents, props changed)
  head/sys/dev/iscsi/iscsi.c   (contents, props changed)
  head/sys/dev/iscsi/iscsi.h   (contents, props changed)
  head/sys/dev/iscsi/iscsi_ioctl.h   (contents, props changed)
  head/sys/dev/iscsi/iscsi_proto.h   (contents, props changed)
  head/tools/regression/iscsi/
  head/tools/regression/iscsi/ctl.conf   (contents, props changed)
  head/tools/regression/iscsi/initiator-instructions.txt   (contents, props changed)
  head/tools/regression/iscsi/iscsi-test.sh   (contents, props changed)
  head/usr.bin/iscsictl/
  head/usr.bin/iscsictl/Makefile   (contents, props changed)
  head/usr.bin/iscsictl/iscsictl.8   (contents, props changed)
  head/usr.bin/iscsictl/iscsictl.c   (contents, props changed)
  head/usr.bin/iscsictl/iscsictl.h   (contents, props changed)
  head/usr.bin/iscsictl/parse.y   (contents, props changed)
  head/usr.bin/iscsictl/periphs.c   (contents, props changed)
  head/usr.bin/iscsictl/token.l   (contents, props changed)
  head/usr.sbin/ctld/
  head/usr.sbin/ctld/Makefile   (contents, props changed)
  head/usr.sbin/ctld/ctl.conf.5   (contents, props changed)
  head/usr.sbin/ctld/ctld.8   (contents, props changed)
  head/usr.sbin/ctld/ctld.c   (contents, props changed)
  head/usr.sbin/ctld/ctld.h   (contents, props changed)
  head/usr.sbin/ctld/discovery.c   (contents, props changed)
  head/usr.sbin/ctld/kernel.c   (contents, props changed)
  head/usr.sbin/ctld/keys.c   (contents, props changed)
  head/usr.sbin/ctld/log.c   (contents, props changed)
  head/usr.sbin/ctld/login.c   (contents, props changed)
  head/usr.sbin/ctld/parse.y   (contents, props changed)
  head/usr.sbin/ctld/pdu.c   (contents, props changed)
  head/usr.sbin/ctld/token.l   (contents, props changed)
  head/usr.sbin/iscsid/
  head/usr.sbin/iscsid/Makefile   (contents, props changed)
  head/usr.sbin/iscsid/discovery.c   (contents, props changed)
  head/usr.sbin/iscsid/iscsid.8   (contents, props changed)
  head/usr.sbin/iscsid/iscsid.c   (contents, props changed)
  head/usr.sbin/iscsid/iscsid.h   (contents, props changed)
  head/usr.sbin/iscsid/keys.c   (contents, props changed)
  head/usr.sbin/iscsid/log.c   (contents, props changed)
  head/usr.sbin/iscsid/login.c   (contents, props changed)
  head/usr.sbin/iscsid/pdu.c   (contents, props changed)
Modified:
  head/etc/defaults/rc.conf
  head/etc/rc.d/Makefile
  head/sbin/iscontrol/iscontrol.8
  head/sbin/iscontrol/iscsi.conf.5
  head/share/man/man4/ctl.4
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_ioctl.h
  head/sys/conf/files
  head/sys/dev/iscsi_initiator/iscsi.c
  head/sys/modules/Makefile
  head/sys/modules/ctl/Makefile
  head/sys/modules/iscsi/Makefile
  head/usr.bin/Makefile
  head/usr.sbin/Makefile
  head/usr.sbin/ctladm/ctladm.8
  head/usr.sbin/ctladm/ctladm.c

Modified: head/etc/defaults/rc.conf
==============================================================================
--- head/etc/defaults/rc.conf	Sat Sep 14 13:12:13 2013	(r255569)
+++ head/etc/defaults/rc.conf	Sat Sep 14 15:29:06 2013	(r255570)
@@ -263,9 +263,13 @@ syslogd_flags="-s"		# Flags to syslogd (
 inetd_enable="NO"		# Run the network daemon dispatcher (YES/NO).
 inetd_program="/usr/sbin/inetd"	# path to inetd, if you want a different one.
 inetd_flags="-wW -C 60"		# Optional flags to inetd
+iscsid_enable="NO"		# iSCSI initiator daemon.
+iscsictl_enable="NO"		# iSCSI initiator autostart.
+iscsictl_flags="-Aa"		# Optional flags to iscsictl.
 hastd_enable="NO"		# Run the HAST daemon (YES/NO).
 hastd_program="/sbin/hastd"	# path to hastd, if you want a different one.
 hastd_flags=""			# Optional flags to hastd.
+ctld_enable="NO"		# CAM Target Layer / iSCSI target daemon.
 #
 # named.  It may be possible to run named in a sandbox, man security for
 # details.

Modified: head/etc/rc.d/Makefile
==============================================================================
--- head/etc/rc.d/Makefile	Sat Sep 14 13:12:13 2013	(r255569)
+++ head/etc/rc.d/Makefile	Sat Sep 14 15:29:06 2013	(r255570)
@@ -30,6 +30,7 @@ FILES=	DAEMON \
 	cleanvar \
 	cleartmp \
 	cron \
+	ctld \
 	ddb \
 	defaultroute \
 	devd \
@@ -62,6 +63,8 @@ FILES=	DAEMON \
 	ipnat \
 	ipsec \
 	${_ipxrouted} \
+	iscsictl \
+	iscsid \
 	jail \
 	kadmind \
 	kerberos \

Added: head/etc/rc.d/ctld
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/etc/rc.d/ctld	Sat Sep 14 15:29:06 2013	(r255570)
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ctld
+# REQUIRE: FILESYSTEMS
+# BEFORE:  DAEMON
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="ctld"
+rcvar="ctld_enable"
+pidfile="/var/run/${name}.pid"
+command="/usr/sbin/${name}"
+required_files="/etc/ctl.conf"
+required_modules="ctl"
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"

Added: head/etc/rc.d/iscsictl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/etc/rc.d/iscsictl	Sat Sep 14 15:29:06 2013	(r255570)
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: iscsictl
+# REQUIRE: NETWORK iscsid
+# BEFORE:  DAEMON
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="iscsictl"
+rcvar="iscsictl_enable"
+command="/usr/bin/${name}"
+command_args="${iscsictl_flags}"
+required_modules="iscsi"
+
+load_rc_config $name
+run_rc_command "$1"

Added: head/etc/rc.d/iscsid
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/etc/rc.d/iscsid	Sat Sep 14 15:29:06 2013	(r255570)
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: iscsid
+# REQUIRE: NETWORK
+# BEFORE:  DAEMON
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="iscsid"
+rcvar="iscsid_enable"
+pidfile="/var/run/${name}.pid"
+command="/usr/sbin/${name}"
+required_modules="iscsi"
+
+load_rc_config $name
+run_rc_command "$1"

Modified: head/sbin/iscontrol/iscontrol.8
==============================================================================
--- head/sbin/iscontrol/iscontrol.8	Sat Sep 14 13:12:13 2013	(r255569)
+++ head/sbin/iscontrol/iscontrol.8	Sat Sep 14 15:29:06 2013	(r255570)
@@ -112,6 +112,7 @@ whatever options are specified, and star
 .Xr iscsi_initiator 4 ,
 .Xr sa 4 ,
 .Xr iscsi.conf 5 ,
+.Xr iscsictl 8 ,
 .Xr camcontrol 8
 .Sh STANDARDS
 RFC 3720

Modified: head/sbin/iscontrol/iscsi.conf.5
==============================================================================
--- head/sbin/iscontrol/iscsi.conf.5	Sat Sep 14 13:12:13 2013	(r255569)
+++ head/sbin/iscontrol/iscsi.conf.5	Sat Sep 14 15:29:06 2013	(r255570)
@@ -201,6 +201,7 @@ The parsing is very primitive, so do not
 error messages.
 .Sh SEE ALSO
 .Xr iscsi_initiator 4 ,
+.Xr iscsictl 8 ,
 .Xr iscontrol 8
 .Sh STANDARDS
 ISCSI RFC 3720

Modified: head/share/man/man4/ctl.4
==============================================================================
--- head/share/man/man4/ctl.4	Sat Sep 14 13:12:13 2013	(r255569)
+++ head/share/man/man4/ctl.4	Sat Sep 14 15:29:06 2013	(r255570)
@@ -75,8 +75,11 @@ Error injection support
 .It
 All I/O handled in-kernel, no userland context switch overhead
 .El
+.Pp
+It also serves as a kernel component of the native iSCSI target.
 .Sh SEE ALSO
 .Xr ctladm 8 ,
+.Xr ctld 8 ,
 .Xr ctlstat 8
 .Sh HISTORY
 The

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Sep 14 13:12:13 2013	(r255569)
+++ head/sys/cam/ctl/ctl.c	Sat Sep 14 15:29:06 2013	(r255570)
@@ -3148,6 +3148,28 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		sbuf_delete(sb);
 		break;
 	}
+	case CTL_ISCSI: {
+		struct ctl_iscsi *ci;
+		struct ctl_frontend *fe;
+
+		ci = (struct ctl_iscsi *)addr;
+
+		mtx_lock(&softc->ctl_lock);
+		STAILQ_FOREACH(fe, &softc->fe_list, links) {
+			if (strcmp(fe->port_name, "iscsi") == 0)
+				break;
+		}
+		mtx_unlock(&softc->ctl_lock);
+
+		if (fe == NULL) {
+			ci->status = CTL_ISCSI_ERROR;
+			snprintf(ci->error_str, sizeof(ci->error_str), "Backend \"iscsi\" not found.");
+			break;
+		}
+
+		retval = fe->ioctl(dev, cmd, addr, flag, td);
+		break;
+	}
 	default: {
 		/* XXX KDM should we fix this? */
 #if 0

Added: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Sep 14 15:29:06 2013	(r255570)
@@ -0,0 +1,2638 @@
+/*-
+ * Copyright (c) 2012 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * CTL frontend for the iSCSI protocol.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/capability.h>
+#include <sys/condvar.h>
+#include <sys/file.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/queue.h>
+#include <sys/sbuf.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+#include <sys/uio.h>
+#include <sys/unistd.h>
+#include <vm/uma.h>
+
+#include <cam/scsi/scsi_all.h>
+#include <cam/scsi/scsi_da.h>
+#include <cam/ctl/ctl_io.h>
+#include <cam/ctl/ctl.h>
+#include <cam/ctl/ctl_backend.h>
+#include <cam/ctl/ctl_frontend.h>
+#include <cam/ctl/ctl_frontend_internal.h>
+#include <cam/ctl/ctl_debug.h>
+#include <cam/ctl/ctl_ha.h>
+#include <cam/ctl/ctl_ioctl.h>
+#include <cam/ctl/ctl_private.h>
+
+#include "../../dev/iscsi/icl.h"
+#include "../../dev/iscsi/iscsi_proto.h"
+#include "ctl_frontend_iscsi.h"
+
+#ifdef ICL_KERNEL_PROXY
+#include <sys/socketvar.h>
+#endif
+
+static MALLOC_DEFINE(M_CFISCSI, "cfiscsi", "Memory used for CTL iSCSI frontend");
+static uma_zone_t cfiscsi_data_wait_zone;
+
+SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0,
+    "CAM Target Layer iSCSI Frontend");
+static int debug = 3;
+TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug);
+SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RW,
+    &debug, 1, "Enable debug messages");
+static int ping_timeout = 5;
+TUNABLE_INT("kern.cam.ctl.iscsi.ping_timeout", &ping_timeout);
+SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RW,
+    &ping_timeout, 5, "Interval between ping (NOP-Out) requests, in seconds");
+static int login_timeout = 60;
+TUNABLE_INT("kern.cam.ctl.iscsi.login_timeout", &login_timeout);
+SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RW,
+    &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds");
+static int maxcmdsn_delta = 256;
+TUNABLE_INT("kern.cam.ctl.iscsi.maxcmdsn_delta", &maxcmdsn_delta);
+SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RW,
+    &maxcmdsn_delta, 256, "Number of commands the initiator can send "
+    "without confirmation");
+
+#define	CFISCSI_DEBUG(X, ...)					\
+	if (debug > 1) {					\
+		printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
+	} while (0)
+
+#define	CFISCSI_WARN(X, ...)					\
+	if (debug > 0) {					\
+		printf("WARNING: %s: " X "\n",			\
+		    __func__, ## __VA_ARGS__);			\
+	} while (0)
+
+#define	CFISCSI_SESSION_DEBUG(S, X, ...)			\
+	if (debug > 1) {					\
+		printf("%s: %s (%s): " X "\n",			\
+		    __func__, S->cs_initiator_addr,		\
+		    S->cs_initiator_name, ## __VA_ARGS__);	\
+	} while (0)
+
+#define	CFISCSI_SESSION_WARN(S, X, ...)				\
+	if (debug > 0) {					\
+		printf("WARNING: %s (%s): " X "\n",		\
+		    S->cs_initiator_addr,			\
+		    S->cs_initiator_name, ## __VA_ARGS__);	\
+	} while (0)
+
+#define CFISCSI_SESSION_LOCK(X)		mtx_lock(&X->cs_lock)
+#define CFISCSI_SESSION_UNLOCK(X)	mtx_unlock(&X->cs_lock)
+#define CFISCSI_SESSION_LOCK_ASSERT(X)	mtx_assert(&X->cs_lock, MA_OWNED)
+
+#define	CONN_SESSION(X)			((struct cfiscsi_session *)(X)->ic_prv0)
+#define	PDU_SESSION(X)			CONN_SESSION((X)->ip_conn)
+#define	PDU_EXPDATASN(X)		(X)->ip_prv0
+#define	PDU_TOTAL_TRANSFER_LEN(X)	(X)->ip_prv1
+#define	PDU_R2TSN(X)			(X)->ip_prv2
+
+int		cfiscsi_init(void);
+static void	cfiscsi_online(void *arg);
+static void	cfiscsi_offline(void *arg);
+static int	cfiscsi_targ_enable(void *arg, struct ctl_id targ_id);
+static int	cfiscsi_targ_disable(void *arg, struct ctl_id targ_id);
+static int	cfiscsi_lun_enable(void *arg,
+		    struct ctl_id target_id, int lun_id);
+static int	cfiscsi_lun_disable(void *arg,
+		    struct ctl_id target_id, int lun_id);
+static int	cfiscsi_ioctl(struct cdev *dev,
+		    u_long cmd, caddr_t addr, int flag, struct thread *td);
+static int	cfiscsi_devid(struct ctl_scsiio *ctsio, int alloc_len);
+static void	cfiscsi_datamove(union ctl_io *io);
+static void	cfiscsi_done(union ctl_io *io);
+static uint32_t	cfiscsi_map_lun(void *arg, uint32_t lun);
+static void	cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request);
+static void	cfiscsi_pdu_handle_nop_out(struct icl_pdu *request);
+static void	cfiscsi_pdu_handle_scsi_command(struct icl_pdu *request);
+static void	cfiscsi_pdu_handle_task_request(struct icl_pdu *request);
+static void	cfiscsi_pdu_handle_data_out(struct icl_pdu *request);
+static void	cfiscsi_pdu_handle_logout_request(struct icl_pdu *request);
+static void	cfiscsi_session_terminate(struct cfiscsi_session *cs);
+static struct cfiscsi_target	*cfiscsi_target_find(struct cfiscsi_softc
+		    *softc, const char *name);
+static void	cfiscsi_target_release(struct cfiscsi_target *ct);
+static void	cfiscsi_session_delete(struct cfiscsi_session *cs);
+
+static struct cfiscsi_softc cfiscsi_softc;
+extern struct ctl_softc *control_softc;
+
+static int cfiscsi_module_event_handler(module_t, int /*modeventtype_t*/, void *);
+
+static moduledata_t cfiscsi_moduledata = {
+	"ctlcfiscsi",
+	cfiscsi_module_event_handler,
+	NULL
+};
+
+DECLARE_MODULE(ctlcfiscsi, cfiscsi_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH);
+MODULE_VERSION(ctlcfiscsi, 1);
+MODULE_DEPEND(ctlcfiscsi, ctl, 1, 1, 1);
+MODULE_DEPEND(ctlcfiscsi, icl, 1, 1, 1);
+
+static struct icl_pdu *
+cfiscsi_pdu_new_response(struct icl_pdu *request, int flags)
+{
+
+	return (icl_pdu_new_bhs(request->ip_conn, flags));
+}
+
+static void
+cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request)
+{
+	const struct iscsi_bhs_scsi_command *bhssc;
+	struct cfiscsi_session *cs;
+	uint32_t cmdsn, expstatsn;
+
+	cs = PDU_SESSION(request);
+
+	/*
+	 * Every incoming PDU - not just NOP-Out - resets the ping timer.
+	 * The purpose of the timeout is to reset the connection when it stalls;
+	 * we don't want this to happen when NOP-In or NOP-Out ends up delayed
+	 * in some queue.
+	 *
+	 * XXX: Locking?
+	 */
+	cs->cs_timeout = 0;
+
+	/*
+	 * Data-Out PDUs don't contain CmdSN.
+	 */
+	if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) ==
+	    ISCSI_BHS_OPCODE_SCSI_DATA_OUT)
+		return;
+
+	/*
+	 * We're only using fields common for all the request
+	 * (initiator -> target) PDUs.
+	 */
+	bhssc = (const struct iscsi_bhs_scsi_command *)request->ip_bhs;
+	cmdsn = ntohl(bhssc->bhssc_cmdsn);
+	expstatsn = ntohl(bhssc->bhssc_expstatsn);
+
+	CFISCSI_SESSION_LOCK(cs);
+#if 0
+	if (expstatsn != cs->cs_statsn) {
+		CFISCSI_SESSION_DEBUG(cs, "received PDU with ExpStatSN %d, "
+		    "while current StatSN is %d", expstatsn,
+		    cs->cs_statsn);
+	}
+#endif
+
+	/*
+	 * XXX: The target MUST silently ignore any non-immediate command
+	 *	outside of this range or non-immediate duplicates within
+	 *	the range.
+	 */
+	if (cmdsn != cs->cs_cmdsn) {
+		CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %d, "
+		    "while expected CmdSN was %d", cmdsn, cs->cs_cmdsn);
+		cs->cs_cmdsn = cmdsn + 1;
+		CFISCSI_SESSION_UNLOCK(cs);
+		return;
+	}
+
+	/*
+	 * XXX: The CmdSN of the rejected command PDU (if it is a non-immediate
+	 *	command) MUST NOT be considered received by the target
+	 *	(i.e., a command sequence gap must be assumed for the CmdSN)
+	 */
+
+	if ((request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0)
+		cs->cs_cmdsn++;
+
+	CFISCSI_SESSION_UNLOCK(cs);
+}
+
+static void
+cfiscsi_pdu_handle(struct icl_pdu *request)
+{
+	struct cfiscsi_session *cs;
+
+	cs = PDU_SESSION(request);
+
+	cfiscsi_pdu_update_cmdsn(request);
+
+	/*
+	 * Handle the PDU; this includes e.g. receiving the remaining
+	 * part of PDU and submitting the SCSI command to CTL
+	 * or queueing a reply.  The handling routine is responsible
+	 * for freeing the PDU when it's no longer needed.
+	 */
+	switch (request->ip_bhs->bhs_opcode &
+	    ~ISCSI_BHS_OPCODE_IMMEDIATE) {
+	case ISCSI_BHS_OPCODE_NOP_OUT:
+		cfiscsi_pdu_handle_nop_out(request);
+		break;
+	case ISCSI_BHS_OPCODE_SCSI_COMMAND:
+		cfiscsi_pdu_handle_scsi_command(request);
+		break;
+	case ISCSI_BHS_OPCODE_TASK_REQUEST:
+		cfiscsi_pdu_handle_task_request(request);
+		break;
+	case ISCSI_BHS_OPCODE_SCSI_DATA_OUT:
+		cfiscsi_pdu_handle_data_out(request);
+		break;
+	case ISCSI_BHS_OPCODE_LOGOUT_REQUEST:
+		cfiscsi_pdu_handle_logout_request(request);
+		break;
+	default:
+		CFISCSI_SESSION_WARN(cs, "received PDU with unsupported "
+		    "opcode 0x%x; dropping connection",
+		    request->ip_bhs->bhs_opcode);
+		cfiscsi_session_terminate(cs);
+		icl_pdu_free(request);
+	}
+
+}
+
+static void
+cfiscsi_receive_callback(struct icl_pdu *request)
+{
+	struct cfiscsi_session *cs;
+
+	cs = PDU_SESSION(request);
+
+#ifdef ICL_KERNEL_PROXY
+	if (cs->cs_waiting_for_ctld || cs->cs_login_phase) {
+		if (cs->cs_login_pdu == NULL)
+			cs->cs_login_pdu = request;
+		else
+			icl_pdu_free(request);
+		cv_signal(&cs->cs_login_cv);
+		return;
+	}
+#endif
+
+	cfiscsi_pdu_handle(request);
+}
+
+static void
+cfiscsi_error_callback(struct icl_conn *ic)
+{
+	struct cfiscsi_session *cs;
+
+	cs = CONN_SESSION(ic);
+
+	CFISCSI_SESSION_WARN(cs, "connection error; dropping connection");
+	cfiscsi_session_terminate(cs);
+}
+
+static int
+cfiscsi_pdu_prepare(struct icl_pdu *response)
+{
+	struct cfiscsi_session *cs;
+	struct iscsi_bhs_scsi_response *bhssr;
+	bool advance_statsn = true;
+
+	cs = PDU_SESSION(response);
+
+	CFISCSI_SESSION_LOCK_ASSERT(cs);
+
+	/*
+	 * We're only using fields common for all the response
+	 * (target -> initiator) PDUs.
+	 */
+	bhssr = (struct iscsi_bhs_scsi_response *)response->ip_bhs;
+
+	/*
+	 * 10.8.3: "The StatSN for this connection is not advanced
+	 * after this PDU is sent."
+	 */
+	if (bhssr->bhssr_opcode == ISCSI_BHS_OPCODE_R2T)
+		advance_statsn = false;
+
+	/*
+	 * 10.19.2: "However, when the Initiator Task Tag is set to 0xffffffff,
+	 * StatSN for the connection is not advanced after this PDU is sent."
+	 */
+	if (bhssr->bhssr_opcode == ISCSI_BHS_OPCODE_NOP_IN && 
+	    bhssr->bhssr_initiator_task_tag == 0xffffffff)
+		advance_statsn = false;
+
+	/*
+	 * See the comment below - StatSN is not meaningful and must
+	 * not be advanced.
+	 */
+	if (bhssr->bhssr_opcode == ISCSI_BHS_OPCODE_SCSI_DATA_IN)
+		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)
+		bhssr->bhssr_statsn = htonl(cs->cs_statsn);
+	bhssr->bhssr_expcmdsn = htonl(cs->cs_cmdsn);
+	bhssr->bhssr_maxcmdsn = htonl(cs->cs_cmdsn + maxcmdsn_delta);
+
+	if (advance_statsn)
+		cs->cs_statsn++;
+
+	return (0);
+}
+
+static void
+cfiscsi_pdu_queue(struct icl_pdu *response)
+{
+	struct cfiscsi_session *cs;
+
+	cs = PDU_SESSION(response);
+
+	CFISCSI_SESSION_LOCK(cs);
+	cfiscsi_pdu_prepare(response);
+	icl_pdu_queue(response);
+	CFISCSI_SESSION_UNLOCK(cs);
+}
+
+static uint32_t
+cfiscsi_decode_lun(uint64_t encoded)
+{
+	uint8_t lun[8];
+	uint32_t result;
+
+	/*
+	 * The LUN field in iSCSI PDUs may look like an ordinary 64 bit number,
+	 * but is in fact an evil, multidimensional structure defined
+	 * in SCSI Architecture Model 5 (SAM-5), section 4.6.
+	 */
+	memcpy(lun, &encoded, sizeof(lun));
+	switch (lun[0] & 0xC0) {
+	case 0x00:
+		if ((lun[0] & 0x3f) != 0 || lun[2] != 0 || lun[3] != 0 ||
+		    lun[4] != 0 || lun[5] != 0 || lun[6] != 0 || lun[7] != 0) {
+			CFISCSI_WARN("malformed LUN "
+			    "(peripheral device addressing method): 0x%jx",
+			    (uintmax_t)encoded);
+			result = 0xffffffff;
+			break;
+		}
+		result = lun[1];
+		break;
+	case 0x40:
+		if (lun[2] != 0 || lun[3] != 0 || lun[4] != 0 || lun[5] != 0 ||
+		    lun[6] != 0 || lun[7] != 0) {
+			CFISCSI_WARN("malformed LUN "
+			    "(flat address space addressing method): 0x%jx",
+			    (uintmax_t)encoded);
+			result = 0xffffffff;
+			break;
+		}
+		result = ((lun[0] & 0x3f) << 8) + lun[1];
+		break;
+	case 0xC0:
+		if (lun[0] != 0xD2 || lun[4] != 0 || lun[5] != 0 ||
+		    lun[6] != 0 || lun[7] != 0) {
+			CFISCSI_WARN("malformed LUN (extended flat "
+			    "address space addressing method): 0x%jx",
+			    (uintmax_t)encoded);
+			result = 0xffffffff;
+			break;
+		}
+		result = (lun[1] << 16) + (lun[2] << 8) + lun[3];
+	default:
+		CFISCSI_WARN("unsupported LUN format 0x%jx",
+		    (uintmax_t)encoded);
+		result = 0xffffffff;
+		break;
+	}
+
+	return (result);
+}
+
+static void
+cfiscsi_pdu_handle_nop_out(struct icl_pdu *request)
+{
+	struct cfiscsi_session *cs;
+	struct iscsi_bhs_nop_out *bhsno;
+	struct iscsi_bhs_nop_in *bhsni;
+	struct icl_pdu *response;
+
+	cs = PDU_SESSION(request);
+	bhsno = (struct iscsi_bhs_nop_out *)request->ip_bhs;
+
+	if (bhsno->bhsno_initiator_task_tag == 0xffffffff) {
+		/*
+		 * Nothing to do, iscsi_pdu_update_statsn() already
+		 * zeroed the timeout.
+		 */
+		icl_pdu_free(request);
+		return;
+	}
+
+	response = cfiscsi_pdu_new_response(request, M_NOWAIT);
+	if (response == NULL) {
+		icl_pdu_free(request);
+		return;
+	}
+	bhsni = (struct iscsi_bhs_nop_in *)response->ip_bhs;
+	bhsni->bhsni_opcode = ISCSI_BHS_OPCODE_NOP_IN;
+	bhsni->bhsni_flags = 0x80;
+	bhsni->bhsni_initiator_task_tag = bhsno->bhsno_initiator_task_tag;
+	bhsni->bhsni_target_transfer_tag = 0xffffffff;
+
+#if 0
+	/* XXX */
+	response->ip_data_len = request->ip_data_len;
+	response->ip_data_mbuf = request->ip_data_mbuf;
+	request->ip_data_len = 0;
+	request->ip_data_mbuf = NULL;
+#endif
+
+	icl_pdu_free(request);
+	cfiscsi_pdu_queue(response);
+}
+
+static void
+cfiscsi_pdu_handle_scsi_command(struct icl_pdu *request)
+{
+	struct iscsi_bhs_scsi_command *bhssc;
+	struct cfiscsi_session *cs;
+	union ctl_io *io;
+	int error;
+
+	cs = PDU_SESSION(request);
+	bhssc = (struct iscsi_bhs_scsi_command *)request->ip_bhs;
+	//CFISCSI_SESSION_DEBUG(cs, "initiator task tag 0x%x",
+	//    bhssc->bhssc_initiator_task_tag);
+
+	if (request->ip_data_len > 0 && cs->cs_immediate_data == false) {
+		CFISCSI_SESSION_WARN(cs, "unsolicited data with "
+		    "ImmediateData=No; dropping connection");
+		cfiscsi_session_terminate(cs);
+		icl_pdu_free(request);
+		return;
+	}
+	io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref);
+	if (io == NULL) {
+		CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io");
+		icl_pdu_free(request);
+		return;
+	}
+	ctl_zero_io(io);
+	io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request;
+	io->io_hdr.io_type = CTL_IO_SCSI;
+	io->io_hdr.nexus.initid.id = cs->cs_ctl_initid;
+	io->io_hdr.nexus.targ_port = cs->cs_target->ct_softc->fe.targ_port;
+	io->io_hdr.nexus.targ_target.id = 0;
+	io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhssc->bhssc_lun);
+	io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun;
+	io->io_hdr.nexus.lun_map_arg = cs;
+	io->scsiio.tag_num = bhssc->bhssc_initiator_task_tag;
+	switch ((bhssc->bhssc_flags & BHSSC_FLAGS_ATTR)) {
+	case BHSSC_FLAGS_ATTR_UNTAGGED:
+		io->scsiio.tag_type = CTL_TAG_UNTAGGED;
+		break;
+	case BHSSC_FLAGS_ATTR_SIMPLE:
+		io->scsiio.tag_type = CTL_TAG_SIMPLE;
+		break;
+	case BHSSC_FLAGS_ATTR_ORDERED:
+        	io->scsiio.tag_type = CTL_TAG_ORDERED;
+		break;
+	case BHSSC_FLAGS_ATTR_HOQ:
+        	io->scsiio.tag_type = CTL_TAG_HEAD_OF_QUEUE;
+		break;
+	case BHSSC_FLAGS_ATTR_ACA:
+		io->scsiio.tag_type = CTL_TAG_ACA;
+		break;
+	default:
+		io->scsiio.tag_type = CTL_TAG_UNTAGGED;
+		CFISCSI_SESSION_WARN(cs, "unhandled tag type %d",
+		    bhssc->bhssc_flags & BHSSC_FLAGS_ATTR);
+		break;
+	}
+	io->scsiio.cdb_len = sizeof(bhssc->bhssc_cdb); /* Which is 16. */
+	memcpy(io->scsiio.cdb, bhssc->bhssc_cdb, sizeof(bhssc->bhssc_cdb));
+	refcount_acquire(&cs->cs_outstanding_ctl_pdus);
+	error = ctl_queue(io);
+	if (error != CTL_RETVAL_COMPLETE) {
+		CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error);
+		ctl_free_io(io);
+		refcount_release(&cs->cs_outstanding_ctl_pdus);
+		icl_pdu_free(request);
+	}
+}
+
+static void
+cfiscsi_pdu_handle_task_request(struct icl_pdu *request)
+{
+	struct iscsi_bhs_task_management_request *bhstmr;
+	struct iscsi_bhs_task_management_response *bhstmr2;
+	struct icl_pdu *response;
+	struct cfiscsi_session *cs;
+	union ctl_io *io;
+	int error;
+
+	cs = PDU_SESSION(request);
+	bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs;
+	io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref);
+	if (io == NULL) {
+		CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io");
+		icl_pdu_free(request);
+		return;
+	}
+	ctl_zero_io(io);
+	io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request;
+	io->io_hdr.io_type = CTL_IO_TASK;
+	io->io_hdr.nexus.initid.id = cs->cs_ctl_initid;
+	io->io_hdr.nexus.targ_port = cs->cs_target->ct_softc->fe.targ_port;
+	io->io_hdr.nexus.targ_target.id = 0;
+	io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhstmr->bhstmr_lun);
+	io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun;
+	io->io_hdr.nexus.lun_map_arg = cs;
+	io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */
+
+	switch (bhstmr->bhstmr_function & ~0x80) {
+	case BHSTMR_FUNCTION_ABORT_TASK:
+#if 0
+		CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_ABORT_TASK");
+#endif
+		io->taskio.task_action = CTL_TASK_ABORT_TASK;
+		io->taskio.tag_num = bhstmr->bhstmr_referenced_task_tag;
+		break;
+	case BHSTMR_FUNCTION_LOGICAL_UNIT_RESET:
+#if 0
+		CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_LOGICAL_UNIT_RESET");
+#endif
+		io->taskio.task_action = CTL_TASK_LUN_RESET;
+		break;
+	case BHSTMR_FUNCTION_TARGET_COLD_RESET:
+#if 0
+		CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_TARGET_COLD_RESET");
+#endif
+		io->taskio.task_action = CTL_TASK_BUS_RESET;
+		break;
+	default:
+		CFISCSI_SESSION_DEBUG(cs, "unsupported function 0x%x",
+		    bhstmr->bhstmr_function & ~0x80);
+		ctl_free_io(io);
+
+		response = cfiscsi_pdu_new_response(request, M_NOWAIT);
+		if (response == NULL) {
+			icl_pdu_free(request);
+			return;
+		}
+		bhstmr2 = (struct iscsi_bhs_task_management_response *)
+		    response->ip_bhs;
+		bhstmr2->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_RESPONSE;
+		bhstmr2->bhstmr_flags = 0x80;
+		bhstmr2->bhstmr_response =
+		    BHSTMR_RESPONSE_FUNCTION_NOT_SUPPORTED;
+		bhstmr2->bhstmr_initiator_task_tag =
+		    bhstmr->bhstmr_initiator_task_tag;
+		icl_pdu_free(request);
+		cfiscsi_pdu_queue(response);
+		return;
+	}
+
+	refcount_acquire(&cs->cs_outstanding_ctl_pdus);
+	error = ctl_queue(io);
+	if (error != CTL_RETVAL_COMPLETE) {
+		CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error);
+		ctl_free_io(io);
+		refcount_release(&cs->cs_outstanding_ctl_pdus);
+		icl_pdu_free(request);
+	}
+}
+
+static bool
+cfiscsi_handle_data_segment(struct icl_pdu *request, struct cfiscsi_data_wait *cdw)
+{
+	struct iscsi_bhs_data_out *bhsdo;
+	struct cfiscsi_session *cs;
+	struct ctl_sg_entry ctl_sg_entry, *ctl_sglist;
+	size_t copy_len, off, buffer_offset;
+	int ctl_sg_count;
+	union ctl_io *io;
+
+	cs = PDU_SESSION(request);
+
+	KASSERT((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) ==
+	    ISCSI_BHS_OPCODE_SCSI_DATA_OUT ||
+	    (request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) ==
+	    ISCSI_BHS_OPCODE_SCSI_COMMAND,
+	    ("bad opcode 0x%x", request->ip_bhs->bhs_opcode));
+
+	/*
+	 * We're only using fields common for Data Out and SCSI Command PDUs.
+	 */
+	bhsdo = (struct iscsi_bhs_data_out *)request->ip_bhs;
+
+	io = cdw->cdw_ctl_io;
+	KASSERT((io->io_hdr.flags & CTL_FLAG_DATA_MASK) != CTL_FLAG_DATA_IN,
+	    ("CTL_FLAG_DATA_IN"));
+
+#if 0
+	CFISCSI_SESSION_DEBUG(cs, "received %zd bytes out of %d",
+	    request->ip_data_len, io->scsiio.kern_total_len);
+#endif
+
+	if (io->scsiio.kern_sg_entries > 0) {
+		ctl_sglist = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr;
+		ctl_sg_count = io->scsiio.kern_sg_entries;
+	} else {
+		ctl_sglist = &ctl_sg_entry;
+		ctl_sglist->addr = io->scsiio.kern_data_ptr;
+		ctl_sglist->len = io->scsiio.kern_data_len;
+		ctl_sg_count = 1;
+	}
+#if 0
+	if (ctl_sg_count > 1)
+		CFISCSI_SESSION_DEBUG(cs, "ctl_sg_count = %d", ctl_sg_count);
+#endif
+
+	if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) ==
+	    ISCSI_BHS_OPCODE_SCSI_DATA_OUT)
+		buffer_offset = ntohl(bhsdo->bhsdo_buffer_offset);
+	else
+		buffer_offset = 0;
+
+	/*
+	 * Make sure the offset, as sent by the initiator, matches the offset
+	 * we're supposed to be at in the scatter-gather list.
+	 */
+	if (buffer_offset != io->scsiio.ext_data_filled) {
+		CFISCSI_SESSION_WARN(cs, "received bad buffer offset %zd, "
+		    "expected %zd", buffer_offset,
+		    (size_t)io->scsiio.ext_data_filled);
+		cfiscsi_session_terminate(cs);
+		return (true);
+	}
+
+	off = 0;
+	for (;;) {
+		KASSERT(cdw->cdw_sg_index < ctl_sg_count,
+		    ("cdw->cdw_sg_index >= ctl_sg_count"));
+		if (cdw->cdw_sg_len == 0) {
+			cdw->cdw_sg_addr = ctl_sglist[cdw->cdw_sg_index].addr;
+			cdw->cdw_sg_len = ctl_sglist[cdw->cdw_sg_index].len;
+		}
+		copy_len = icl_pdu_data_segment_length(request) - off;
+		if (copy_len > cdw->cdw_sg_len)
+			copy_len = cdw->cdw_sg_len;
+
+		icl_pdu_get_data(request, off, cdw->cdw_sg_addr, copy_len);
+		cdw->cdw_sg_addr += copy_len;
+		cdw->cdw_sg_len -= copy_len;
+		off += copy_len;
+		io->scsiio.ext_data_filled += copy_len;
+
+		if (cdw->cdw_sg_len == 0) {
+			if (cdw->cdw_sg_index == ctl_sg_count - 1)
+				break;
+			cdw->cdw_sg_index++;
+		}
+		if (off == icl_pdu_data_segment_length(request))
+			break;
+	}
+
+	if (off < icl_pdu_data_segment_length(request)) {
+		CFISCSI_SESSION_WARN(cs, "received too much data: got %zd bytes, "
+		    "expected %zd", icl_pdu_data_segment_length(request), off);
+		cfiscsi_session_terminate(cs);
+		return (true);
+	}
+
+	if (bhsdo->bhsdo_flags & BHSDO_FLAGS_F ||
+	    io->scsiio.ext_data_filled == io->scsiio.kern_total_len) {
+		if ((bhsdo->bhsdo_flags & BHSDO_FLAGS_F) == 0) {
+			CFISCSI_SESSION_WARN(cs, "got the final packet without "
+			    "the F flag; flags = 0x%x; dropping connection",
+			    bhsdo->bhsdo_flags);
+			cfiscsi_session_terminate(cs);
+			return (true);
+		}
+
+		if (io->scsiio.ext_data_filled != io->scsiio.kern_total_len) {
+			if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) ==
+			    ISCSI_BHS_OPCODE_SCSI_DATA_OUT) {
+				CFISCSI_SESSION_WARN(cs, "got the final packet, but the "
+				    "transmitted size was %zd bytes instead of %d; "
+				    "dropping connection",
+				    (size_t)io->scsiio.ext_data_filled,
+				    io->scsiio.kern_total_len);
+				cfiscsi_session_terminate(cs);
+				return (true);
+			} else {
+				/*
+				 * For SCSI Command PDU, this just means we need to
+				 * solicit more data by sending R2T.
+				 */
+				return (false);
+			}
+		}
+#if 0
+		CFISCSI_SESSION_DEBUG(cs, "no longer expecting Data-Out with target "
+		    "transfer tag 0x%x", cdw->cdw_target_transfer_tag);
+#endif
+
+		return (true);
+	}
+
+	return (false);
+}
+
+static void
+cfiscsi_pdu_handle_data_out(struct icl_pdu *request)
+{
+	struct iscsi_bhs_data_out *bhsdo;
+	struct cfiscsi_session *cs;
+	struct cfiscsi_data_wait *cdw = NULL;
+	union ctl_io *io;
+	bool done;
+
+	cs = PDU_SESSION(request);
+	bhsdo = (struct iscsi_bhs_data_out *)request->ip_bhs;
+
+	CFISCSI_SESSION_LOCK(cs);
+	TAILQ_FOREACH(cdw, &cs->cs_waiting_for_data_out, cdw_next) {
+#if 0
+		CFISCSI_SESSION_DEBUG(cs, "have ttt 0x%x, itt 0x%x; looking for "
+		    "ttt 0x%x, itt 0x%x",
+		    bhsdo->bhsdo_target_transfer_tag,
+		    bhsdo->bhsdo_initiator_task_tag,
+		    cdw->cdw_target_transfer_tag, cdw->cdw_initiator_task_tag));
+#endif
+		if (bhsdo->bhsdo_target_transfer_tag ==
+		    cdw->cdw_target_transfer_tag)
+			break;
+	}
+	CFISCSI_SESSION_UNLOCK(cs);
+	if (cdw == NULL) {
+		CFISCSI_SESSION_WARN(cs, "data transfer tag 0x%x, initiator task tag "
+		    "0x%x, not found", bhsdo->bhsdo_target_transfer_tag,
+		    bhsdo->bhsdo_initiator_task_tag);
+		icl_pdu_free(request);
+		cfiscsi_session_terminate(cs);
+		return;
+	}
+
+	io = cdw->cdw_ctl_io;
+	KASSERT((io->io_hdr.flags & CTL_FLAG_DATA_MASK) != CTL_FLAG_DATA_IN,
+	    ("CTL_FLAG_DATA_IN"));
+
+	done = cfiscsi_handle_data_segment(request, cdw);
+	if (done) {
+		CFISCSI_SESSION_LOCK(cs);
+		TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next);
+		CFISCSI_SESSION_UNLOCK(cs);
+		uma_zfree(cfiscsi_data_wait_zone, cdw);
+		io->scsiio.be_move_done(io);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 17:17:33 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 0FFBD97D;
 Sat, 14 Sep 2013 17:17:33 +0000 (UTC)
 (envelope-from dumbbell@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E0E342071;
 Sat, 14 Sep 2013 17:17:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EHHWDF056899;
 Sat, 14 Sep 2013 17:17:32 GMT
 (envelope-from dumbbell@svn.freebsd.org)
Received: (from dumbbell@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EHHWcc056898;
 Sat, 14 Sep 2013 17:17:32 GMT
 (envelope-from dumbbell@svn.freebsd.org)
Message-Id: <201309141717.r8EHHWcc056898@svn.freebsd.org>
From: Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
Date: Sat, 14 Sep 2013 17:17:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255571 - head/sys/dev/pci
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 17:17:33 -0000

Author: dumbbell
Date: Sat Sep 14 17:17:32 2013
New Revision: 255571
URL: http://svnweb.freebsd.org/changeset/base/255571

Log:
  vgapci: Use vga_pci_alloc_resource() to map PCI Expansion ROM
  
  This is cleaner and fixes Video BIOS mapping when the given device isn't
  the boot display.
  
  Submitted by:	jhb@
  Approved by:	re (kib)

Modified:
  head/sys/dev/pci/vga_pci.c

Modified: head/sys/dev/pci/vga_pci.c
==============================================================================
--- head/sys/dev/pci/vga_pci.c	Sat Sep 14 15:29:06 2013	(r255570)
+++ head/sys/dev/pci/vga_pci.c	Sat Sep 14 17:17:32 2013	(r255571)
@@ -67,6 +67,12 @@ struct vga_pci_softc {
 
 SYSCTL_DECL(_hw_pci);
 
+static struct vga_resource *lookup_res(struct vga_pci_softc *sc, int rid);
+static struct resource *vga_pci_alloc_resource(device_t dev, device_t child,
+    int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+static int	vga_pci_release_resource(device_t dev, device_t child, int type,
+    int rid, struct resource *r);
+
 int vga_pci_default_unit = -1;
 TUNABLE_INT("hw.pci.default_vgapci_unit", &vga_pci_default_unit);
 SYSCTL_INT(_hw_pci, OID_AUTO, default_vgapci_unit, CTLFLAG_RDTUN,
@@ -80,7 +86,6 @@ vga_pci_is_boot_display(device_t dev)
 	 * Return true if the given device is the default display used
 	 * at boot time.
 	 */
-
 	return (
 	    (pci_get_class(dev) == PCIC_DISPLAY ||
 	     (pci_get_class(dev) == PCIC_OLD &&
@@ -111,7 +116,8 @@ vga_pci_map_bios(device_t dev, size_t *s
 #endif
 
 	rid = PCIR_BIOS;
-	res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+	res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0ul,
+	    ~0ul, 1, RF_ACTIVE);
 	if (res == NULL) {
 		return (NULL);
 	}
@@ -123,8 +129,7 @@ vga_pci_map_bios(device_t dev, size_t *s
 void
 vga_pci_unmap_bios(device_t dev, void *bios)
 {
-	int rid;
-	struct resource *res;
+	struct vga_resource *vr;
 
 	if (bios == NULL) {
 		return;
@@ -140,25 +145,15 @@ vga_pci_unmap_bios(device_t dev, void *b
 #endif
 
 	/*
-	 * FIXME: We returned only the virtual address of the resource
-	 * to the caller. Now, to get the resource struct back, we
-	 * allocate it again: the struct exists once in memory in
-	 * device softc. Therefore, we release twice now to release the
-	 * reference we just obtained to get the structure back and the
-	 * caller's reference.
+	 * Look up the PCIR_BIOS resource in our softc.  It should match
+	 * the address we returned previously.
 	 */
-
-	rid = PCIR_BIOS;
-	res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
-
-	KASSERT(res != NULL,
-	    ("%s: Can't get BIOS resource back", __func__));
-	KASSERT(bios == rman_get_virtual(res),
-	    ("%s: Given BIOS address doesn't match "
-	     "resource virtual address", __func__));
-
-	bus_release_resource(dev, SYS_RES_MEMORY, rid, bios);
-	bus_release_resource(dev, SYS_RES_MEMORY, rid, bios);
+	vr = lookup_res(device_get_softc(dev), PCIR_BIOS);
+	KASSERT(vr->vr_res != NULL, ("vga_pci_unmap_bios: bios not mapped"));
+	KASSERT(rman_get_virtual(vr->vr_res) == bios,
+	    ("vga_pci_unmap_bios: mismatch"));
+	vga_pci_release_resource(dev, NULL, SYS_RES_MEMORY, PCIR_BIOS,
+	    vr->vr_res);
 }
 
 static int

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 17:22:34 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id C1C72ADF;
 Sat, 14 Sep 2013 17:22:34 +0000 (UTC)
 (envelope-from dumbbell@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id A491C20AC;
 Sat, 14 Sep 2013 17:22:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EHMYvc060570;
 Sat, 14 Sep 2013 17:22:34 GMT
 (envelope-from dumbbell@svn.freebsd.org)
Received: (from dumbbell@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EHMYcX060569;
 Sat, 14 Sep 2013 17:22:34 GMT
 (envelope-from dumbbell@svn.freebsd.org)
Message-Id: <201309141722.r8EHMYcX060569@svn.freebsd.org>
From: Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
Date: Sat, 14 Sep 2013 17:22:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255572 - head/sys/dev/drm2/radeon
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 17:22:34 -0000

Author: dumbbell
Date: Sat Sep 14 17:22:34 2013
New Revision: 255572
URL: http://svnweb.freebsd.org/changeset/base/255572

Log:
  drm/radeon: Fix usage of vga_pci_map_bios()
  
  vga_pci_(un)map_bios() takes a vgapci device as argument, not a drmn
  one. This fixes a bug where the BIOS couldn't be mapped if the device
  wasn't the boot display.
  
  Approved by:	re (kib; blanket for following drm2/radeon commits)

Modified:
  head/sys/dev/drm2/radeon/radeon_bios.c

Modified: head/sys/dev/drm2/radeon/radeon_bios.c
==============================================================================
--- head/sys/dev/drm2/radeon/radeon_bios.c	Sat Sep 14 17:17:32 2013	(r255571)
+++ head/sys/dev/drm2/radeon/radeon_bios.c	Sat Sep 14 17:22:34 2013	(r255572)
@@ -100,14 +100,16 @@ static bool igp_read_bios_from_vram(stru
 
 static bool radeon_read_bios(struct radeon_device *rdev)
 {
+	device_t vga_dev;
 	uint8_t __iomem *bios;
 	size_t size;
 
 	DRM_INFO("%s: ===> Try PCI Expansion ROM...\n", __func__);
 
+	vga_dev = device_get_parent(rdev->dev);
 	rdev->bios = NULL;
 	/* XXX: some cards may return 0 for rom size? ddx has a workaround */
-	bios = vga_pci_map_bios(rdev->dev, &size);
+	bios = vga_pci_map_bios(vga_dev, &size);
 	if (!bios) {
 		return false;
 	}
@@ -120,11 +122,11 @@ static bool radeon_read_bios(struct rade
 			DRM_INFO("%s: Incorrect BIOS signature: 0x%02X%02X\n",
 			    __func__, bios[0], bios[1]);
 		}
-		vga_pci_unmap_bios(rdev->dev, bios);
+		vga_pci_unmap_bios(vga_dev, bios);
 	}
 	rdev->bios = malloc(size, DRM_MEM_DRIVER, M_WAITOK);
 	memcpy(rdev->bios, bios, size);
-	vga_pci_unmap_bios(rdev->dev, bios);
+	vga_pci_unmap_bios(vga_dev, bios);
 	return true;
 }
 

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 17:24:43 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 05F69C45;
 Sat, 14 Sep 2013 17:24:43 +0000 (UTC)
 (envelope-from dumbbell@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id E5F4020BA;
 Sat, 14 Sep 2013 17:24:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EHOgEY060902;
 Sat, 14 Sep 2013 17:24:42 GMT
 (envelope-from dumbbell@svn.freebsd.org)
Received: (from dumbbell@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EHOgj8060898;
 Sat, 14 Sep 2013 17:24:42 GMT
 (envelope-from dumbbell@svn.freebsd.org)
Message-Id: <201309141724.r8EHOgj8060898@svn.freebsd.org>
From: Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
Date: Sat, 14 Sep 2013 17:24:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255573 - head/sys/dev/drm2/radeon
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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 17:24:43 -0000

Author: dumbbell
Date: Sat Sep 14 17:24:41 2013
New Revision: 255573
URL: http://svnweb.freebsd.org/changeset/base/255573

Log:
  drm/radeon: Fix usage of pci_save_state() and pci_restore_state()
  
  Calling those functions with the drmn device as argument causes a panic,
  because it's not a direct child of pci$N. They must be called with the
  vgapci device instead.
  
  This fix is not enough to make suspend/resume work reliably.
  
  Approved by:	re (blanket)

Modified:
  head/sys/dev/drm2/radeon/r100.c
  head/sys/dev/drm2/radeon/r300.c
  head/sys/dev/drm2/radeon/radeon_device.c
  head/sys/dev/drm2/radeon/rs600.c

Modified: head/sys/dev/drm2/radeon/r100.c
==============================================================================
--- head/sys/dev/drm2/radeon/r100.c	Sat Sep 14 17:22:34 2013	(r255572)
+++ head/sys/dev/drm2/radeon/r100.c	Sat Sep 14 17:24:41 2013	(r255573)
@@ -2647,7 +2647,7 @@ int r100_asic_reset(struct radeon_device
 	WREG32(RADEON_CP_RB_WPTR, 0);
 	WREG32(RADEON_CP_RB_CNTL, tmp);
 	/* save PCI state */
-	pci_save_state(rdev->dev);
+	pci_save_state(device_get_parent(rdev->dev));
 	/* disable bus mastering */
 	r100_bm_disable(rdev);
 	WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_SE(1) |
@@ -2669,7 +2669,7 @@ int r100_asic_reset(struct radeon_device
 	status = RREG32(R_000E40_RBBM_STATUS);
 	dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
 	/* restore PCI & busmastering */
-	pci_restore_state(rdev->dev);
+	pci_restore_state(device_get_parent(rdev->dev));
 	r100_enable_bm(rdev);
 	/* Check if GPU is idle */
 	if (G_000E40_SE_BUSY(status) || G_000E40_RE_BUSY(status) ||

Modified: head/sys/dev/drm2/radeon/r300.c
==============================================================================
--- head/sys/dev/drm2/radeon/r300.c	Sat Sep 14 17:22:34 2013	(r255572)
+++ head/sys/dev/drm2/radeon/r300.c	Sat Sep 14 17:24:41 2013	(r255573)
@@ -401,7 +401,7 @@ int r300_asic_reset(struct radeon_device
 	WREG32(RADEON_CP_RB_WPTR, 0);
 	WREG32(RADEON_CP_RB_CNTL, tmp);
 	/* save PCI state */
-	pci_save_state(rdev->dev);
+	pci_save_state(device_get_parent(rdev->dev));
 	/* disable bus mastering */
 	r100_bm_disable(rdev);
 	WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_VAP(1) |
@@ -425,7 +425,7 @@ int r300_asic_reset(struct radeon_device
 	status = RREG32(R_000E40_RBBM_STATUS);
 	dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
 	/* restore PCI & busmastering */
-	pci_restore_state(rdev->dev);
+	pci_restore_state(device_get_parent(rdev->dev));
 	r100_enable_bm(rdev);
 	/* Check if GPU is idle */
 	if (G_000E40_GA_BUSY(status) || G_000E40_VAP_BUSY(status)) {

Modified: head/sys/dev/drm2/radeon/radeon_device.c
==============================================================================
--- head/sys/dev/drm2/radeon/radeon_device.c	Sat Sep 14 17:22:34 2013	(r255572)
+++ head/sys/dev/drm2/radeon/radeon_device.c	Sat Sep 14 17:24:41 2013	(r255573)
@@ -1316,7 +1316,7 @@ int radeon_suspend_kms(struct drm_device
 
 	radeon_agp_suspend(rdev);
 
-	pci_save_state(dev->device);
+	pci_save_state(device_get_parent(rdev->dev));
 #ifdef DUMBBELL_WIP
 	if (state.event == PM_EVENT_SUSPEND) {
 		/* Shut down the device */
@@ -1356,7 +1356,7 @@ int radeon_resume_kms(struct drm_device 
 	console_lock();
 #endif /* DUMBBELL_WIP */
 	pci_set_powerstate(dev->device, PCI_POWERSTATE_D0);
-	pci_restore_state(dev->device);
+	pci_restore_state(device_get_parent(rdev->dev));
 #ifdef DUMBBELL_WIP
 	if (pci_enable_device(dev->pdev)) {
 		console_unlock();

Modified: head/sys/dev/drm2/radeon/rs600.c
==============================================================================
--- head/sys/dev/drm2/radeon/rs600.c	Sat Sep 14 17:22:34 2013	(r255572)
+++ head/sys/dev/drm2/radeon/rs600.c	Sat Sep 14 17:24:41 2013	(r255573)
@@ -373,7 +373,7 @@ int rs600_asic_reset(struct radeon_devic
 	WREG32(RADEON_CP_RB_RPTR_WR, 0);
 	WREG32(RADEON_CP_RB_WPTR, 0);
 	WREG32(RADEON_CP_RB_CNTL, tmp);
-	pci_save_state(rdev->dev);
+	pci_save_state(device_get_parent(rdev->dev));
 	/* disable bus mastering */
 	pci_disable_busmaster(rdev->dev);
 	DRM_MDELAY(1);
@@ -403,7 +403,7 @@ int rs600_asic_reset(struct radeon_devic
 	status = RREG32(R_000E40_RBBM_STATUS);
 	dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
 	/* restore PCI & busmastering */
-	pci_restore_state(rdev->dev);
+	pci_restore_state(device_get_parent(rdev->dev));
 	/* Check if GPU is idle */
 	if (G_000E40_GA_BUSY(status) || G_000E40_VAP_BUSY(status)) {
 		dev_err(rdev->dev, "failed to reset GPU\n");

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 20:38:23 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 53134BCE;
 Sat, 14 Sep 2013 20:38:23 +0000 (UTC)
 (envelope-from grehan@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3F1792A16;
 Sat, 14 Sep 2013 20:38:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EKcNLT061769;
 Sat, 14 Sep 2013 20:38:23 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EKcN8Q061768;
 Sat, 14 Sep 2013 20:38:23 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201309142038.r8EKcN8Q061768@svn.freebsd.org>
From: Peter Grehan <grehan@FreeBSD.org>
Date: Sat, 14 Sep 2013 20:38:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255574 - head/sys/amd64/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 20:38:23 -0000

Author: grehan
Date: Sat Sep 14 20:38:22 2013
New Revision: 255574
URL: http://svnweb.freebsd.org/changeset/base/255574

Log:
  Pull the hyperv drivers from GENERIC until the fix to the disengage
  driver to make it only probe when running on hyperv is reviewed and
  tested.
  
  Approved by:	re (rodrigc)

Modified:
  head/sys/amd64/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Sat Sep 14 17:24:41 2013	(r255573)
+++ head/sys/amd64/conf/GENERIC	Sat Sep 14 20:38:22 2013	(r255574)
@@ -341,6 +341,3 @@ device		virtio_blk	# VirtIO Block device
 device		virtio_scsi	# VirtIO SCSI device
 device		virtio_balloon	# VirtIO Memory Balloon device
 
-# HyperV drivers
-device		hyperv		# HyperV drivers
-

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 21:43:19 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id 70E7A5B0;
 Sat, 14 Sep 2013 21:43:19 +0000 (UTC)
 (envelope-from joel@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 43F3B2CC0;
 Sat, 14 Sep 2013 21:43:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8ELhJUM096687;
 Sat, 14 Sep 2013 21:43:19 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8ELhIsW096684;
 Sat, 14 Sep 2013 21:43:18 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201309142143.r8ELhIsW096684@svn.freebsd.org>
From: Joel Dahl <joel@FreeBSD.org>
Date: Sat, 14 Sep 2013 21:43:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255575 - in head: usr.bin/iscsictl 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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 21:43:19 -0000

Author: joel (doc committer)
Date: Sat Sep 14 21:43:18 2013
New Revision: 255575
URL: http://svnweb.freebsd.org/changeset/base/255575

Log:
  Minor mdoc fixes.
  
  Approved by:	re (blanket)

Modified:
  head/usr.bin/iscsictl/iscsictl.8
  head/usr.sbin/ctld/ctld.8
  head/usr.sbin/iscsid/iscsid.8

Modified: head/usr.bin/iscsictl/iscsictl.8
==============================================================================
--- head/usr.bin/iscsictl/iscsictl.8	Sat Sep 14 20:38:22 2013	(r255574)
+++ head/usr.bin/iscsictl/iscsictl.8	Sat Sep 14 21:43:18 2013	(r255575)
@@ -117,7 +117,7 @@ with its control utility
 and the new one,
 .Xr iscsi 4 ,
 with
-.Xr iscsictl 8
+.Nm
 and
 .Xr iscsid 8 .
 The only thing the two have in common is the configuration file,
@@ -138,8 +138,8 @@ Attach to target qn.2012-06.com.example:
 Disconnect all iSCSI sessions:
 .Dl Nm Fl Ra
 .Sh SEE ALSO
-.Xr iscsid 8 ,
-.Xr iscsi.conf 5
+.Xr iscsi.conf 5 ,
+.Xr iscsid 8
 .Sh HISTORY
 The
 .Nm

Modified: head/usr.sbin/ctld/ctld.8
==============================================================================
--- head/usr.sbin/ctld/ctld.8	Sat Sep 14 20:38:22 2013	(r255574)
+++ head/usr.sbin/ctld/ctld.8	Sat Sep 14 21:43:18 2013	(r255575)
@@ -44,7 +44,6 @@ daemon is responsible for managing the C
 accepting incoming iSCSI connections, performing authentication and
 passing connections to the kernel part of the native iSCSI target.
 .Pp
-.Pp
 Upon startup, the
 .Nm
 daemon parses the configuration file and exits, if it encounters any errors.
@@ -52,7 +51,7 @@ Then it compares the configuration with 
 by previously running
 .Nm
 instances, removes LUNs no longer existing in the configuration file,
-and creates new LUNs as neccessary. 
+and creates new LUNs as neccessary.
 After that it listens for the incoming iSCSI connections, performs
 authentication, and, if successful, passes the connections to the kernel part
 of CTL iSCSI target, which handles it from that point.

Modified: head/usr.sbin/iscsid/iscsid.8
==============================================================================
--- head/usr.sbin/iscsid/iscsid.8	Sat Sep 14 20:38:22 2013	(r255574)
+++ head/usr.sbin/iscsid/iscsid.8	Sat Sep 14 21:43:18 2013	(r255575)
@@ -46,7 +46,6 @@ The
 daemon is responsible for performing the Login Phase of iSCSI connections,
 as well as performing SendTargets discovery.
 .Pp
-.Pp
 Upon startup, the
 .Nm
 daemon opens the iSCSI initiator device file and waits for kernel requests.
@@ -64,7 +63,8 @@ The following options are available:
 .Bl -tag -width ".Fl P Ar pidfile"
 .It Fl P Ar pidfile
 Specify alternative location of a file where main process PID will be stored.
-The default location is /var/run/iscsid.pid.
+The default location is
+.Pa /var/run/iscsid.pid .
 .It Fl d
 Debug mode.
 The server sends verbose debug output to standard error, and does not

From owner-svn-src-all@FreeBSD.ORG  Sat Sep 14 22:09:10 2013
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTP id CA768938;
 Sat, 14 Sep 2013 22:09:10 +0000 (UTC) (envelope-from ed@FreeBSD.org)
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))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id B84682DD8;
 Sat, 14 Sep 2013 22:09:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EM9AMx009386;
 Sat, 14 Sep 2013 22:09:10 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EM9AIX009385;
 Sat, 14 Sep 2013 22:09:10 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201309142209.r8EM9AIX009385@svn.freebsd.org>
From: Ed Schouten <ed@FreeBSD.org>
Date: Sat, 14 Sep 2013 22:09:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r255576 - head/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.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Sep 2013 22:09:10 -0000

Author: ed
Date: Sat Sep 14 22:09:10 2013
New Revision: 255576
URL: http://svnweb.freebsd.org/changeset/base/255576

Log:
  Properly remove c++filt.
  
  The c++filt binary is only installed if ${MK_GCC} == yes && ${MK_CXX} ==
  yes. This means that it should be removed if ${MK_GCC} == no ||
  ${MK_CXX} == no. In its current form, it actually uses a conjunction
  instead of a disjunction.
  
  As there is already a separate block for ${MK_CXX} == no listing
  c++filt, simply remove the conditional entirely.
  
  Approved by:	re (gjb)

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Sat Sep 14 21:43:18 2013	(r255575)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Sat Sep 14 22:09:10 2013	(r255576)
@@ -1562,9 +1562,7 @@ OLD_FILES+=usr/share/man/man8/unstr.8.gz
 .endif
 
 .if ${MK_GCC} == no
-.if ${MK_CXX} == no
 OLD_FILES+=usr/bin/c++filt
-.endif
 OLD_FILES+=usr/bin/g++
 OLD_FILES+=usr/bin/gcc
 OLD_FILES+=usr/bin/gcov